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
| try{ | |
| using (var client = new HttpClient()){ | |
| var response = await client.PostAsync("hogehoge"); | |
| var stream = await response.Content.ReadAsStreamAsync(); | |
| // ほげほげ | |
| } | |
| }catch{ | |
| // れいがい | |
| } |
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:LocalizeTest;assembly=LocalizeTest" | |
| x:Class="LocalizeTest.XamlPage"> | |
| <Label Text="{local:LocalizedString Hello}" VerticalOptions="Center" HorizontalOptions="Center" /> | |
| </ContentPage> |
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" | |
| x:Class="LocalizeTest.XamlPage"> | |
| <Label Text="{Binding MainText}" VerticalOptions="Center" HorizontalOptions="Center" /> | |
| </ContentPage> |
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
| [ContentProperty("Text")] | |
| public class LocalizedStringExtension : IMarkupExtension | |
| { | |
| public string Text { get; set; } | |
| public object ProvideValue(IServiceProvider serviceProvider) | |
| { | |
| if (Text == null) return null; | |
| return Strings.ResourceManager.GetString(Text); | |
| } |
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 class App | |
| { | |
| public static Page GetMainPage() | |
| { | |
| return new ContentPage | |
| { | |
| Content = new StackLayout | |
| { | |
| Children = { | |
| new Label |
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(var ms = new MemoryStream()) | |
| { | |
| using(var ds = new DeflateStream(ms, CompressionLevel.Fastest)) | |
| { | |
| ProtoBuf.Serializer.Serialize(ds, DATA); | |
| } | |
| return ms.ToArray(); | |
| } |
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(var ms = new MemoryStream()) | |
| using(var ds = new DeflateStream(ms, CompressionLevel.Fastest)) | |
| { | |
| ProtoBuf.Serializer.Serialize(ds, DATA); | |
| return ms.ToArray(); | |
| } |
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
| class Program | |
| { | |
| static void Main() | |
| { | |
| // テスト用データ | |
| var testDataList = new List<TestData>(); | |
| var r = new Random(); | |
| for (var count = 0; count < 1000000; count++) testDataList.Add(new TestData(r.Next())); | |
| var testDataArray = testDataList.ToArray(); |
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 class AnimationItemsControl : ItemsControl { | |
| private List<FrameworkElement> appendingItems = new List<FrameworkElement>(); | |
| private Duration opacityDuration = new Duration(TimeSpan.FromSeconds(0.5)); | |
| private Duration zoomDuration = new Duration(TimeSpan.FromSeconds(1)); | |
| private double itemInterval = 0.5; | |
| protected override void OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { | |
| base.OnItemsChanged(e); | |
| if (e.Action == NotifyCollectionChangedAction.Reset) { |