Skip to content

Instantly share code, notes, and snippets.

View Stayrony's full-sized avatar

Ana Mi Stayrony

View GitHub Profile
@Stayrony
Stayrony / IImageMergeService.cs
Created December 24, 2019 18:24
How to merge multiple images into one with Xamarin.iOS C#
namespace Mobile.Services
{
public interface IImageMergeService
{
byte[] MergeTwoImageByteArrays(byte[] imageBackgroundBytes, byte[] imageForegroundBytes);
}
}
@Stayrony
Stayrony / CalendarNotificationModel.cs
Last active April 25, 2023 13:45
Create iCal ics Files in C# ASP.NET Core
public class CalendarNotificationModel
{
public string Name { get; set; }
public IEnumerable<Attendee> Attendees { get; set; }
public DateTime StartDateTime { get; set; }
public string CreatorEmail { get; set; }
public string Location { get; set; }
public string Description { get; set; }
}
@Stayrony
Stayrony / AccountServiceTests.cs
Created March 15, 2019 16:27
Unit testing ASP.NET Core Identity. Defines two fake classes: FakeUserManager and FakeSignInManager, which will be used by the mocking framework. Finally, we need to mock our FakeUserManager and FakeSignInManager classes by using Moq. The mocking will be implemented by the constructor (setup) of the InjectFixture class. And finally we can write …
[CollectionDefinition("Test")]
public class AccountServiceTests
{
private readonly InjectFixture _injectFixture;
public AccountServiceTests()
{
_injectFixture = new InjectFixture();
}
@Stayrony
Stayrony / AccountServiceTests.cs
Created March 15, 2019 16:21
Unit testing ASP.NET Core Identity
[CollectionDefinition("Test")]
public class AccountServiceTests
{
private readonly InjectFixture _injectFixture;
public AccountServiceTests()
{
_injectFixture = new InjectFixture();
}
@Stayrony
Stayrony / AccountServiceTests.cs
Created March 15, 2019 16:21
Unit testing ASP.NET Core Identity
[CollectionDefinition("Test")]
public class AccountServiceTests
{
private readonly InjectFixture _injectFixture;
public AccountServiceTests()
{
_injectFixture = new InjectFixture();
}
@Stayrony
Stayrony / MultipleMutation
Created February 12, 2019 21:24
Multiple Mutation classes in graphql-dotnet
Multiple Mutation
@Stayrony
Stayrony / dotnetlayout.md
Created September 8, 2018 20:53 — forked from davidfowl/dotnetlayout.md
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@Stayrony
Stayrony / MainActivity.sc
Created July 20, 2018 21:30
How to Exit App When Press Back Button - Xamarin.Android
...
public override void OnBackPressed()
{
RunOnUiThread(
async () =>
{
var isCloseApp = await AlertAsync(this, "NameOfApp", "Do you want to close this app?", "Yes", "No");
if (isCloseApp)
{
@Stayrony
Stayrony / ShadowCardView.xaml
Last active July 9, 2017 20:01
Adding shadows to views in Xamarin.Forms Android using 9-patch image
<controls:ShadowFrame Grid.Row="1" Padding="0" VerticalOptions="Center">
<controls:ShadowFrame.Content>
<StackLayout Spacing="10" VerticalOptions="FillAndExpand">
<Image Source="https://i.ytimg.com/vi/61aM0DXpKkc/maxresdefault.jpg" Aspect="AspectFill" />
<Label Text="EXTREME DOWNHILL" Margin="20, 0" />
<Label Margin="20, 10, 20, 40" Text="Downhill mountain biking (DH) is a genre of mountain biking practiced on steep, rough terrain that often features jumps, drops, rock gardens and other obstacles ..." />
</StackLayout>
</controls:ShadowFrame.Content>
</controls:ShadowFrame>
using System;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using Xamarin.Forms.Samples.Controls;
using Xamarin.Forms.Samples.Droid.Renderers;
[assembly: ExportRenderer(typeof(ShadowFrame), typeof(ShadowFrameRenderer))]
namespace Xamarin.Forms.Samples.Droid.Renderers
{