public void CanBeBound_CommandWithoutType_ReturnTrue() { Type actualType = typeof(ObservableCommand); Type targetType = typeof(IObservableCommand); bool canBeBound = BindingUtils.CanBeBound(actualType, targetType); canBeBound.Should().BeTrue(); }
private void _PressAnyKey() { if (BindingUtils.GetAnyPressedKey() != KeyCode.None) { anim.enabled = true; UI[1].SetActive(false); StartCoroutine(PressAnyAnimation()); } }
public void CanBeBound_RawTypeToObservableCollection_ReturnFalse() { Type actualType = typeof(int); Type targetType = typeof(IReadOnlyObservableCollection <int>); bool canBeBound = BindingUtils.CanBeBound(actualType, targetType); canBeBound.Should().BeFalse(); }
public void CanBeBound_VariableWithReferenceType_ReturnTrue() { Type actualType = typeof(ObservableVariable <string>); Type targetType = typeof(IReadOnlyObservableVariable <string>); bool canBeBound = BindingUtils.CanBeBound(actualType, targetType); canBeBound.Should().BeTrue(); }
public void NeedsToBeBoxed_EventWithReferenceTypeToObject_ReturnFalse() { Type actualType = typeof(ObservableEvent <string>); Type targetType = typeof(IObservableEvent <object>); bool needsToBeBoxed = BindingUtils.NeedsToBeBoxed(actualType, targetType); needsToBeBoxed.Should().BeFalse(); }
public void CanBeBound_CollectionWithBuiltInValueType_ReturnTrue() { Type actualType = typeof(ObservableCollection <int>); Type targetType = typeof(IReadOnlyObservableCollection <int>); bool canBeBound = BindingUtils.CanBeBound(actualType, targetType); canBeBound.Should().BeTrue(); }
public void NeedsToBeBoxed_CollectionWithReferenceTypeToObject_ReturnFalse() { Type actualType = typeof(ObservableCollection <string>); Type targetType = typeof(IReadOnlyObservableCollection <object>); bool needsToBeBoxed = BindingUtils.NeedsToBeBoxed(actualType, targetType); needsToBeBoxed.Should().BeFalse(); }
public void NeedsToBeBoxed_EventWithBuiltInValueTypeToObject_ReturnTrue() { Type actualType = typeof(ObservableEvent <int>); Type targetType = typeof(IObservableEvent <object>); bool needsToBeBoxed = BindingUtils.NeedsToBeBoxed(actualType, targetType); needsToBeBoxed.Should().BeTrue(); }
public void NeedsToBeBoxed_CollectionWithBuiltInValueTypeToObject_ReturnTrue() { Type actualType = typeof(ObservableCollection <int>); Type targetType = typeof(IReadOnlyObservableCollection <object>); bool needsToBeBoxed = BindingUtils.NeedsToBeBoxed(actualType, targetType); needsToBeBoxed.Should().BeTrue(); }
public void CanBeBound_RawTypeToObservableEvent_ReturnFalse() { Type actualType = typeof(int); Type targetType = typeof(IObservableEvent <int>); bool canBeBound = BindingUtils.CanBeBound(actualType, targetType); canBeBound.Should().BeFalse(); }
public void CanBeBound_EventWithBuiltInValueType_ReturnTrue() { Type actualType = typeof(ObservableEvent <int>); Type targetType = typeof(IObservableEvent <int>); bool canBeBound = BindingUtils.CanBeBound(actualType, targetType); canBeBound.Should().BeTrue(); }
private static void OnDecodeIpcMsgAuthCb(IntPtr userData, uint reqId, IntPtr authGranted) { var tcs = BindingUtils.FromHandlePtr <TaskCompletionSource <IpcMsg> >(userData); tcs.SetResult( new AuthIpcMsg( reqId, new AuthGranted(Marshal.PtrToStructure <AuthGrantedNative>(authGranted)))); }
public Task <string> EncodeContainersRespAsync(IntPtr auth, ref ContainersReq req, uint reqId, bool isGranted) { var reqNative = req.ToNative(); var(ret, userData) = BindingUtils.PrepareTask <string>(); EncodeContainersRespNative(auth, ref reqNative, reqId, isGranted, userData, DelegateOnFfiResultStringCb); reqNative.Free(); return(ret); }
/// <summary> /// Returns native registered app /// </summary> /// <returns></returns> internal RegisteredAppNative ToNative() { return(new RegisteredAppNative { AppInfo = AppInfo, ContainersPtr = BindingUtils.CopyFromObjectList(Containers), ContainersLen = (UIntPtr)(Containers?.Count ?? 0) }); }
public ColorAssigmentOption(ReadOnlyDictionary <CalculationsMode, IChart> charts, AssignmentOfColorMethod assignmentOfColorMethod) : base(assignmentOfColorMethod, charts) { this.assignmentOfColorMethod = assignmentOfColorMethod; IsOption = true; Checked = complexChart.ColorAssignmentMethod == assignmentOfColorMethod; BindingUtils.OnPropertyChanged(complexChart, nameof(complexChart.ColorAssignmentMethod), () => Checked = complexChart.ColorAssignmentMethod == assignmentOfColorMethod); }
public Task <string> AuthAppAsync( string appId, string appName, string appVendor, string endpoint) { var(ret, userData) = BindingUtils.PrepareTask <string>(); AuthAppNative(appId, appName, appVendor, endpoint, userData, DelegateOnFfiResultStringCb); return(ret); }
public ContourLinesOption(ReadOnlyDictionary <CalculationsMode, IChart> charts, CountourLinesMode contourLinesMode) : base(contourLinesMode, charts) { this.contourLinesMode = contourLinesMode; IsOption = true; Checked = complexChart.CountourMode == contourLinesMode; BindingUtils.OnPropertyChanged(complexChart, nameof(complexChart.CountourMode), () => Checked = complexChart.CountourMode == contourLinesMode); }
private static void OnFfiResultAppExchangeInfoListCb( IntPtr userData, IntPtr result, IntPtr appExchangeInfoPtr, UIntPtr appExchangeInfoLen) { BindingUtils.CompleteTask( userData, Marshal.PtrToStructure <FfiResult>(result), () => BindingUtils.CopyToObjectList <AppExchangeInfo>(appExchangeInfoPtr, (int)appExchangeInfoLen)); }
protected override void PrepareContainerForItemOverride(DependencyObject element, object item) { var calendarXItem = element as CalendarXItem; BindingUtils.BindingProperty(calendarXItem, CalendarXItem.ContentProperty, item, CalendarXItemModel.ContentProperty); BindingUtils.BindingProperty(calendarXItem, CalendarXItem.IsCheckedProperty, item, CalendarXItemModel.IsCheckedProperty, System.Windows.Data.BindingMode.TwoWay); BindingUtils.BindingProperty(calendarXItem, CalendarXItem.IsDownplayProperty, item, CalendarXItemModel.IsDownplayProperty); BindingUtils.BindingProperty(calendarXItem, CalendarXItem.IsTodayProperty, item, CalendarXItemModel.IsTodayProperty); BindingUtils.BindingProperty(calendarXItem, CalendarXItem.IsInRangeProperty, item, CalendarXItemModel.IsInRangeProperty); BindingUtils.BindingProperty(calendarXItem, CalendarXItem.IsEnabledProperty, item, CalendarXItemModel.IsEnabledProperty); }
public ContourLinesOption(IComplexChart complexChart, CountourLinesMode contourLinesMode) : base(contourLinesMode) { _complexChart = complexChart; this.contourLinesMode = contourLinesMode; IsOption = true; Checked = complexChart.CountourMode == contourLinesMode; BindingUtils.OnPropertyChanged(complexChart, nameof(complexChart.CountourMode), () => Checked = complexChart.CountourMode == contourLinesMode); }
public ColorAssigmentOption(IComplexChart complexChart, AssignmentOfColorMethod assignmentOfColorMethod) : base(assignmentOfColorMethod) { _complexChart = complexChart; this.assignmentOfColorMethod = assignmentOfColorMethod; IsOption = true; Checked = complexChart.ColorAssignmentMethod == assignmentOfColorMethod; BindingUtils.OnPropertyChanged(complexChart, nameof(complexChart.ColorAssignmentMethod), () => Checked = complexChart.ColorAssignmentMethod == assignmentOfColorMethod); }
private static void OnFfiResultRegisteredAppListCb( IntPtr userData, IntPtr result, IntPtr registeredAppPtr, UIntPtr registeredAppLen) { BindingUtils.CompleteTask( userData, Marshal.PtrToStructure <FfiResult>(result), () => BindingUtils.CopyToObjectList <RegisteredAppNative>(registeredAppPtr, (int)registeredAppLen). Select(native => new RegisteredApp(native)).ToList()); }
public LanguageOption(CultureInfo language) { Text = language.NativeName; ToolTip = language.EnglishName; this.language = language; CheckOnClick = true; IsOption = true; Checked = Equals(CultureInfo.CurrentCulture, language); BindingUtils.OnPropertyChanged(Settings.Default, nameof(Settings.Default.Language), () => Checked = Equals(Settings.Default.Language, this.language)); }
private static string RoundTripBinding(string indexer) { var indexerBinding = BindingUtils.GetIndexerBinding(indexer); var boundClass = new BoundClass { DataContext = new ReflectingIndexer() }; boundClass.SetBinding(TextBlock.TextProperty, indexerBinding); return(boundClass.BoundValue); }
public void Setup(string _toMap) { bindingToMap = _toMap; // Automatically set the onclick function and change the name text to the binding. button.onClick.AddListener(OnClick); bindingName.text = _toMap; // Update the button text with the binding's value and make the GO active BindingUtils.UpdateTextWithBinding(bindingToMap, buttonText); gameObject.SetActive(true); }
private void InitTableData() { if (_haveInitedData) { return; } _haveInitedData = true; var data = (VolatilitySurfaceData <Tenor, Tenor>)DataContext; while (detailsList.Columns.Count > 1) { detailsList.Columns.RemoveAt(1); } foreach (var x in data.Xs) { var textBlockStyle = new Style(typeof(FrameworkElement)); var binding = BindingUtils.GetIndexerBinding(x.ToString()); binding.Converter = new ValueToColorConverter(_zRange); textBlockStyle.Setters.Add(new Setter(BackgroundProperty, binding)); detailsList.Columns.Add(new DataGridTextColumn { Width = 60, Header = x, CellStyle = textBlockStyle, Binding = BindingUtils.GetIndexerBinding(x.ToString()) }); } var rows = new List <Dictionary <string, object> >(); foreach (var y in data.Ys) { var row = new Dictionary <string, object>(); row["Length"] = y; foreach (var x in data.Xs) { double value; if (data.TryGet(x, y, out value)) { row[x.ToString()] = value; } } rows.Add(row); } detailsList.ItemsSource = rows; }
public LegendPositionsCommand(ISharedViewState sharedViewState, LegendPlacementCommand legendPlacementCommand, LegendAligmentCommand legendAligmentCommand) : base(MenuStrings.legendPositions_Text) { _sharedViewState = sharedViewState; Visible = _sharedViewState.CalculationsMode == CalculationsMode.Real; BindingUtils.OnPropertyChanged(_sharedViewState, nameof(_sharedViewState.CalculationsMode), () => Visible = _sharedViewState.CalculationsMode == CalculationsMode.Real); ChildrenCommands = new List <IToolbarCommand> { legendPlacementCommand, legendAligmentCommand }; }
public RescaleCommand(ISharedViewState sharedViewState, FitAxesCommand fitAxesCommand, EqualAxesCommand equalAxesCommand) : base(MenuStrings.rescale_Text) { _sharedViewState = sharedViewState; Visible = _sharedViewState.CalculationsMode == CalculationsMode.Fxy; BindingUtils.OnPropertyChanged(_sharedViewState, nameof(_sharedViewState.CalculationsMode), () => Visible = _sharedViewState.CalculationsMode == CalculationsMode.Fxy); ChildrenCommands = new List <IToolbarCommand> { fitAxesCommand, equalAxesCommand }; }
public Task <ISafeData> InspectAsync(IntPtr app, string url) { var(task, userData) = BindingUtils.PrepareTask <ISafeData>(); InspectNative( app, url, userData, DelegateOnFfiResultPublishedImmutableDataCb, DelegateOnFfiResultWalletCb, DelegateOnFfiResultSafeKeyCb, DelegateOnFfiResultFilesContainerCb, DelegateOnFfiFetchFailedCb); return(task); }
public Task <IpcReq> DecodeIpcMessage(IntPtr authPtr, string msg) { var(task, userData) = BindingUtils.PrepareTask <IpcReq>(); AuthDecodeIpcMsgNative( authPtr, msg, userData, DelegateOnDecodeIpcReqAuthCb, DelegateOnDecodeIpcReqContainersCb, DelegateOnDecodeIpcReqUnregisteredCb, DelegateOnDecodeIpcReqShareMDataCb, DelegateOnFfiResultIpcReqErrorCb); return(task); }