This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface IProcessor<T,U> where T: unmanaged, IResult | |
{ | |
T ProcessSingle(int x); | |
async IAsyncEnumerable<T> ProcessMany(int[] xs, int batch) | |
{ | |
static T[] ProccessBatch(Func<int,T> func, Span<int> list, in Range range) | |
{ | |
(_, int length) = range.GetOffsetAndLenght(list.length); | |
using var batcher = new Batcher<T>(stackalloc T[length]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Android.App; | |
using Android.Content.PM; | |
using Android.Runtime; | |
using Android.OS; | |
using AndroidX.Work; | |
namespace BackgroundWork.Droid | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Android.Content; | |
using Android.Util; | |
using AndroidX.Work; | |
using Xamarin.Essentials; | |
namespace BackgroundWork.Droid | |
{ | |
public class LocalWorker : Worker | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static async Task SaveSessionAsync(string json) | |
{ | |
try | |
{ | |
File = Path.Combine(FileSystem.AppDataDirectory, "login.json"); | |
using (var file = new FileStream(File, FileMode.Create)) | |
using (var output = new StreamWriter(file, Encoding.UTF8)) | |
await output.WriteAsync(json); | |
} | |
catch (System.Exception ex) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using VisualTest.iOS; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Platform.iOS; | |
[assembly: ExportRenderer(typeof(Xamarin.Forms.Picker), typeof(MyPicker), new[] { typeof(VisualTest.TestVisual) })] | |
namespace VisualTest.iOS | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Android.Content; | |
using VisualTest.Droid; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Platform.Android; | |
[assembly: ExportRenderer(typeof(Xamarin.Forms.Picker), typeof(MyPicker), new[] { typeof(VisualTest.TestVisual) })] | |
namespace VisualTest.Droid | |
{ | |
public class MyPicker : PickerRenderer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:local="clr-namespace:VisualTest" | |
x:Class="VisualTest.MainPage" | |
Visual="Material"> | |
<ContentPage.BindingContext> | |
<local:MainViewModel/> | |
</ContentPage.BindingContext> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Foundation; | |
namespace Cocos2D { | |
[BaseType (typeof (NSObject))] | |
interface Camera { | |
[Static, Export ("getZEye")] | |
nfloat ZEye { get; } | |
[Export ("restore")] | |
void Restore (); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JavaScript | |
var React = require('react-native'); | |
var { NativeModules, Text } = React; | |
var Message = React.createClass({ | |
getInitialState() { | |
return { text: 'Goodbye World.' }; | |
}, | |
componentDidMount() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Objective-C | |
#import "RCTBridgeModule.h" | |
@interface MyCustomModule : NSObject <RCTBridgeModule> | |
@end | |
@implementation MyCustomModule |