protected override void OnPropertyChanged(PropertyNotificationEventArgs args) { base.OnPropertyChanged(args); switch (args.PropertyName) { case nameof(ExportModuleFormat): case nameof(ImpersonatedVehicleName): case nameof(ExportModuleBaseName): case nameof(ExportModuleText): if (!HasEmbeddedModule) { // all formats require an embedded file for this to be valid EmbeddedModuleTargetPath = null; return; } switch (ExportModuleFormat) { case DCSExportModuleFormat.HeliosDriver16: EmbeddedModuleTargetPath = string.IsNullOrWhiteSpace(ImpersonatedVehicleName) ? null : $"Drivers\\{ImpersonatedVehicleName}.lua"; break; case DCSExportModuleFormat.CaptZeenModule1: EmbeddedModuleTargetPath = string.IsNullOrWhiteSpace(ExportModuleBaseName) ? null : $"Modules\\{ExportModuleBaseName}.lua"; break; case DCSExportModuleFormat.TelemetryOnly: EmbeddedModuleTargetPath = null; break; default: throw new ArgumentOutOfRangeException(); } break; } }
protected override void OnPropertyChanged(PropertyNotificationEventArgs args) { if (args.PropertyName.Equals("Width") || args.PropertyName.Equals("Height")) { UpdatePoints(); } base.OnPropertyChanged(args); }
private void userVM_PropertyChanged(object sender, PropertyChangedEventArgs e) { PropertyNotificationEventArgs e2 = e as PropertyNotificationEventArgs; if (null != e2) { } }
void PositionChanged(object sender, KneeBoardPositionChangeArgs e) { PropertyNotificationEventArgs args = new PropertyNotificationEventArgs(e.Position, e.PropertyName, e.OldValue, e.NewValue, true); OnPropertyChanged("Positions", args); UpdateValueHelp(); Refresh(); }
void LabelFormat_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { PropertyNotificationEventArgs origArgs = e as PropertyNotificationEventArgs; if (origArgs != null) { OnPropertyChanged("LabelFormat", origArgs); } Refresh(); }
void Profile_PropertyChanged(object sender, PropertyChangedEventArgs e) { PropertyNotificationEventArgs args = e as PropertyNotificationEventArgs; if (args != null) { ConfigManager.UndoManager.AddPropertyChange(sender, args); } }
protected override void OnPropertyChanged(PropertyNotificationEventArgs args) { if (args.PropertyName.Equals("Visual")) { _display = args.NewValue as FalconTextureDisplay; OnRefresh(); } base.OnPropertyChanged(args); }
protected virtual void OnPropertyChanged(PropertyNotificationEventArgs args) { PropertyChangedEventHandler handler = PropertyChanged; if (handler != null) { handler(this, args); } }
protected override void OnPropertyChanged(PropertyNotificationEventArgs args) { if (args.PropertyName.Equals("Width") || args.PropertyName.Equals("Height")) { double scaleX = Width / NativeSize.Width; double scaleY = Height / NativeSize.Height; _scaledScreenRect.Scale(scaleX, scaleY); } base.OnPropertyChanged(args); }
void Format_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { PropertyNotificationEventArgs origArgs = e as PropertyNotificationEventArgs; if (origArgs != null) { OnPropertyChanged("TextFormat", origArgs); } OnDisplayUpdate(); }
void Child_PropertyChanged(object sender, PropertyChangedEventArgs e) { HeliosObject child = sender as HeliosObject; PropertyNotificationEventArgs args = e as PropertyNotificationEventArgs; if (child != null && args != null) { OnPropertyChanged(child.Name, args); } }
void PositionChanged(object sender, RotarySwitchPositionChangeArgs e) { PropertyNotificationEventArgs args = new PropertyNotificationEventArgs(e.Position, e.PropertyName, e.OldValue, e.NewValue, true); if (e.PropertyName.Equals("Rotation")) { _rotation = Positions[CurrentPosition - 1].Rotation; } OnPropertyChanged("Positions", args); UpdateValueHelp(); Refresh(); }
public void AddPropertyChange(object sender, PropertyNotificationEventArgs notification) { if (notification != null && notification.IsUndoable) { while (notification.HasChildNotification) { notification = notification.ChildNotification; } AddPropertyChange(notification.EventSource, notification.PropertyName, notification.OldValue, notification.NewValue); } }
void Item_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { PropertyNotificationEventArgs args = e as PropertyNotificationEventArgs; if (args != null && e.PropertyName.Equals("Name")) { T item = sender as T; if (item != null) { KeyChanged((string)args.OldValue, item.Name); } } }
void Item_PropertyChanged(object sender, PropertyChangedEventArgs e) { PropertyNotificationEventArgs args = e as PropertyNotificationEventArgs; EventHandler <RotarySwitchPositionChangeArgs> handler = PositionChanged; if (args != null) { if (handler != null) { handler.Invoke(this, new RotarySwitchPositionChangeArgs(sender as RotarySwitchPosition, args.PropertyName, args.OldValue, args.NewValue)); } } }
protected override void OnPropertyChanged(PropertyNotificationEventArgs args) { if (args.PropertyName.Equals("Width") || args.PropertyName.Equals("Height")) { double scaleX = Width / NativeSize.Width; double scaleY = Height / NativeSize.Height; _guardUpRegion = GuardedThreeWayToggle.GuardUpRegion; _guardUpRegion.Scale(scaleX, scaleY); _switchRegion = GuardedThreeWayToggle.SwitchRegion; _switchRegion.Scale(scaleX, scaleY); _guardDownRegion = GuardedThreeWayToggle.GuardDownRegion; _guardDownRegion.Scale(scaleX, scaleY); } base.OnPropertyChanged(args); }
protected void OnPropertyChanged(string childPropertyName, PropertyNotificationEventArgs args) { OnPropertyChanged(new PropertyNotificationEventArgs(this, childPropertyName, args)); }
protected virtual void OnPropertyChanged(PropertyNotificationEventArgs args) { PropertyChangedEventHandler handler = PropertyChanged; handler?.Invoke(this, args); }
protected override void OnPropertyChanged(PropertyNotificationEventArgs args) { if (args.PropertyName.Equals("Left")) { if (!_recalcing) { _recalcing = true; double oldLocation = (double)args.OldValue; double newLocation = (double)args.NewValue; Start = new Point(Start.X + (newLocation - oldLocation), Start.Y); End = new Point(End.X + (newLocation - oldLocation), End.Y); _recalcing = false; } } else if (args.PropertyName.Equals("Top")) { if (!_recalcing) { _recalcing = true; double oldLocation = (double)args.OldValue; double newLocation = (double)args.NewValue; Start = new Point(Start.X, Start.Y + (newLocation - oldLocation)); End = new Point(End.X, End.Y + (newLocation - oldLocation)); _recalcing = false; } } else if (args.PropertyName.Equals("Width")) { if (!_recalcing) { _recalcing = true; double oldSize = (double)args.OldValue; double newSize = (double)args.NewValue; Point newStart = Start; Point newEnd = End; if (Start.X > End.X) { newStart.X += newSize - oldSize; } else if (Start.X < End.X) { newEnd.X += newSize - oldSize; } Start = newStart; End = newEnd; _recalcing = false; } } else if (args.PropertyName.Equals("Height")) { if (!_recalcing) { _recalcing = true; double oldSize = (double)args.OldValue; double newSize = (double)args.NewValue; Point newStart = Start; Point newEnd = End; if (Start.Y > End.Y) { newStart.Y += newSize - oldSize; } else if (Start.Y < End.Y) { newEnd.Y += newSize - oldSize; } Start = newStart; End = newEnd; _recalcing = false; } } base.OnPropertyChanged(args); }
protected override void OnPropertyChanged(PropertyNotificationEventArgs args) { base.OnPropertyChanged(args); Update(); }