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
| <Style x:Key="EditableTextBlockStyle" TargetType="TextBox"> | |
| <Setter Property="OverridesDefaultStyle" Value="True"/> | |
| <Setter Property="BorderBrush" Value="{x:Null}"/> | |
| <Setter Property="Background" Value="{x:Null}"/> | |
| <Setter Property="BorderThickness" Value="0"/> | |
| <Setter Property="Margin" Value="-2,-1,-2,-1"/> | |
| <Setter Property="AllowDrop" Value="true"/> | |
| <Setter Property="MaxLines" Value="1"/> | |
| <Setter Property="FocusVisualStyle" Value="{x:Null}"/> | |
| <Setter Property="VerticalAlignment" Value="Top"/> |
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 EditableTextBlock : TextBox | |
| { | |
| public EditableTextBlock() | |
| { | |
| SetTextBlockStyle(); | |
| AddHandler(PreviewMouseLeftButtonDownEvent, new MouseButtonEventHandler(ToggleTriStateFocus)); | |
| AddHandler(LostFocusEvent, new RoutedEventHandler((sender, args) => SetTextBlockStyle())); | |
| } | |
| private void SetTextBlockStyle() |
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
| <Application.Resources> | |
| <DataTemplate x:Key="DateTemplate" DataType="{x:Type system:DateTime}"> | |
| <TextBlock Text="{Binding Date}"/> | |
| </DataTemplate> | |
| <DataTemplate x:Key="DayOfWeekTemplate" DataType="{x:Type system:DateTime}"> | |
| <TextBlock Text="{Binding DayOfWeek}"/> | |
| </DataTemplate> | |
| </Application.Resources> |
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 class Canvas | |
| { | |
| public static readonly DependencyProperty XProperty = | |
| DependencyProperty.RegisterAttached("X", typeof(double), typeof(Canvas), new PropertyMetadata(default(double), OnXchanged)); | |
| private static void OnXchanged(DependencyObject o, DependencyPropertyChangedEventArgs e) | |
| { | |
| if (IsChanged(e)) | |
| UpdateX((FrameworkElement)o); | |
| } | |
| public static void SetX(FrameworkElement element, double value) |
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
| sampler2D inputSampler : register(S0); | |
| /// <summary>The center of the gradient. </summary> | |
| /// <minValue>0,0</minValue> | |
| /// <maxValue>1,1</maxValue> | |
| /// <defaultValue>.5,.5</defaultValue> | |
| float2 CenterPoint : register(C0); | |
| /// <summary>The primary color of the gradient. </summary> | |
| /// <defaultValue>Blue</defaultValue> | |
| float4 StartColor : register(C1); |
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
| [Test] | |
| public void ReactiveTest() | |
| { | |
| var c = new MyClass(); | |
| c.ToTrackingObservable(x => x.Name) | |
| .Subscribe(x => Console.WriteLine("New: {0}, old: {1}", x.CurrentValue, x.PreviousValue)); | |
| string[] names = {"Johan", "Max", "Erik"}; | |
| foreach (var name in names) |
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
| [TestCase("15 °", "-10 °", 25, typeof(Degrees))] | |
| [TestCase("-10 °", "15 °", -25, typeof(Degrees))] | |
| [TestCase("-10 °", "0 °", -10, typeof(Degrees))] | |
| [TestCase("-90 °", "1.5707 rad", -3.1414, typeof(Radians))] | |
| [TestCase("1.5707 rad", "-90 °", 3.1414, typeof(Radians))] | |
| [TestCase("1.5707 rad", "1.5707 rad", 0, typeof(Radians))] | |
| public void SubtractionTest(string lvs, string rvs, double ev, Type et) | |
| { | |
| var lv = AngleUnitValue.Parse(lvs); | |
| var rv = AngleUnitValue.Parse(rvs); |
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 Polynom | |
| { | |
| public Polynom(params double[] coefficients) | |
| { | |
| Coefficients = coefficients; | |
| } | |
| public static Polynom Parse(string s) | |
| { | |
| var cs = new Dictionary<int, double>(); | |
| var reader = new PolynomReader(s); |
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 NinjectLoader : IContentLoader | |
| { | |
| private readonly IKernel _kernel; | |
| internal readonly Dictionary<string, Func<IKernel, object>> Locator = new Dictionary<string, Func<IKernel, object>>(); | |
| private readonly string[] _splits = { "component/" }; | |
| public NinjectLoader(IKernel kernel) | |
| { | |
| _kernel = kernel; | |
| Add<Content.LanguagesView>(); | |
| Add<Pages.OrderView>(); |
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 ResxTranslationProvider(ResourceManager resourceManager) | |
| { | |
| _resourceManager = resourceManager; | |
| foreach (var culture in CultureInfo.GetCultures(CultureTypes.AllCultures)) | |
| { | |
| var resourceSet = _resourceManager.GetResourceSet(culture, false, false); | |
| if (resourceSet != null) | |
| { | |
| _languages.Add(culture); | |
| } |