public static void Constructor_NullAsPropertyName_SetsPropertyNameToNull() { // Null has special meaning; it means all properties have changed var e = new PropertyChangingEventArgs((string)null); Assert.Equal((string)null, e.PropertyName); }
void OnLabelPropertyChanging(object sender, PropertyChangingEventArgs e) { if(!(sender is Label)) return; if(e.PropertyName == "Text") OnLabelTextChanging(sender as Label); }
/// <summary> /// Handles the <see cref="E:PropertyChanging" /> event. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="PropertyChangingEventArgs"/> instance containing the event data.</param> private void OnPropertyChanging(object sender, PropertyChangingEventArgs e) { if (e.PropertyName == "CurrentPage") { this.RaiseCurrentPageChanging(); } }
public static void Constructor_NullAsPropertyName_SetsPropertyNameToEmpty() { // Empty has special meaning; it means all properties have changed var e = new PropertyChangingEventArgs(string.Empty); Assert.Equal(string.Empty, e.PropertyName); }
public virtual void OnPropertyChanging(PropertyChangingEventArgs propertyArg) { var handler = PropertyChanging; if (handler != null) { handler(this, propertyArg); } }
private void FlowListViewPropertyChanging (object sender, PropertyChangingEventArgs e) { if (e.PropertyName == FlowItemsSourceProperty.PropertyName) { var flowItemSource = FlowItemsSource as INotifyCollectionChanged; if (flowItemSource != null) flowItemSource.CollectionChanged -= FlowItemsSourceCollectionChanged; } }
public static void Constructor_ValueAsPropertyName_SetsPropertyNameToValue() { var inputs = new string[] { "PropertyName", "PROPERTYNAME", "propertyname" }; foreach (string input in inputs) { var e = new PropertyChangingEventArgs(input); Assert.Equal(input, e.PropertyName); } }
private void BaseTessellator_TextureChanging(object sender, PropertyChangingEventArgs<Texture2D> e) { var isStarted = _isStarted; if (isStarted) { End(); } e.NewValue.Bind(); if (isStarted) { Begin(PrimitiveType); } }
private void FlowListViewPropertyChanging(object sender, PropertyChangingEventArgs e) { if (e.PropertyName == FlowItemsSourceProperty.PropertyName) { var flowItemSource = FlowItemsSource as INotifyCollectionChanged; if (flowItemSource != null) { flowItemSource.CollectionChanged -= FlowItemsSourceCollectionChanged; } if (IsGroupingEnabled) { var groupedSource = FlowItemsSource as IEnumerable <INotifyCollectionChanged>; if (groupedSource != null) { foreach (var gr in groupedSource) { gr.CollectionChanged -= FlowItemsSourceCollectionChanged; } } } } }
public void Invoke(InterceptionArgs arg) { var isSetter = arg.Method.Name.StartsWith("set_"); var propertyName = isSetter ? arg.Method.Name.Substring(4) : string.Empty; var isNotifyPropertyChanging = isSetter && arg.Target is INotifyPropertyChanging; var isNotifyPropertyChanged = isSetter && arg.Target is INotifyPropertyChanged; if (isNotifyPropertyChanging) { var eventDelegate = (MulticastDelegate)arg.Target.GetType().GetField(nameof(INotifyPropertyChanging.PropertyChanging), BindingFlags.Instance | BindingFlags.NonPublic).GetValue(arg.Target); var args = new PropertyChangingEventArgs(propertyName); if (eventDelegate != null) { foreach (var handler in eventDelegate.GetInvocationList()) { handler.Method.Invoke(handler.Target, new object[] { arg.Target, args }); } } } arg.Proceed(); if (isNotifyPropertyChanged) { var eventDelegate = (MulticastDelegate)arg.Target.GetType().GetField(nameof(INotifyPropertyChanged.PropertyChanged), BindingFlags.Instance | BindingFlags.NonPublic).GetValue(arg.Target); var args = new PropertyChangedEventArgs(propertyName); if (eventDelegate != null) { foreach (var handler in eventDelegate.GetInvocationList()) { handler.Method.Invoke(handler.Target, new object[] { arg.Target, args }); } } } }
void Background_PropertyChanged(object sender, PropertyChangingEventArgs eventArgs) { SearchView searchView = (base.Control as SearchView); searchView.SetInputType(InputTypes.ClassText | InputTypes.TextVariationNormal); int frameId = searchView.Context.Resources.GetIdentifier("android:id/search_plate", null, null); if (eventArgs.PropertyName == "IsdarkThemEnabled") { var isDarkTheme = false; //(App.Current as App).IsDarkThemeEnabled; //Can be set from the app from settings, but just set to false for now Android.Views.View frameView = (searchView.FindViewById(frameId) as Android.Views.View); if (isDarkTheme) { frameView.SetBackgroundColor(G.Color.Rgb(51, 48, 46)); } else { frameView.SetBackgroundColor(G.Color.Rgb(250, 250, 250)); } } }
private void MeliponarioSancuano_PropertyChanging(object sender, PropertyChangingEventArgs e) { TotalSancuanoTrampa.Text = (int.Parse(MeliponarioSancuano.Text) + int.Parse(CampoSancuano.Text)).ToString(); }
private void ACFNSancuano_PropertyChanging(object sender, PropertyChangingEventArgs e) { TotalSancuanoCajas.Text = (int.Parse(ACFNSancuano.Text) + int.Parse(RusticaSancuano.Text)).ToString(); }
public MvxInpcInterceptionResult Intercept(IMvxNotifyPropertyChanged sender, PropertyChangingEventArgs args) { return(ChangingHandler(sender, args)); }
//public event EventHandler<PropertyChangingEventArgs<IParent>> ParentChanging; //public event EventHandler<PropertyChangedEventArgs<IParent>> ParentChanged; protected virtual bool OnNameChanging(string currentValue, string newValue) { bool result = true; if (NameChanging != null) { var e = new PropertyChangingEventArgs<string> { OldValue = currentValue, NewValue = newValue }; NameChanging(this, e); result = !e.Cancel; } return result; }
static CommittedBlock() { CommittedBlock.emptyChangingEventArgs = new PropertyChangingEventArgs(string.Empty); }
void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { PropertyChangingEventManager.DeliverEvent(this, args); }
private void DatePropertyChangingEventHandler(object sender, PropertyChangingEventArgs e) { NotifyChildPropertyChanging(PROPERTIES.DATE, sender, e); }
private void BaseTessellator_ColorChanging(object sender, PropertyChangingEventArgs<Color> e) { GL.Color4(e.NewValue); }
private void OnPropertyChanging(object sender, PropertyChangingEventArgs args) { StandardTrackedObject ti; if (this.items.TryGetValue(sender, out ti)) { ti.StartTracking(); } else if (this.IsFastTracked(sender)) { ti = this.PromoteFastTrackedObject(sender); ti.StartTracking(); } }
/// <summary> /// Use for validation as well as IEditable object, /// for Editable object the value for the data will not be committed until the EndEdit is called /// </summary> /// <param name="propertyName"></param> /// <param name="value"></param> protected virtual void OnPropertyChanging(PropertyChangingEventArgs e) { if (m_setValueFlag) return; if (null != PropertyChanging) { PropertyChanging(this, e); if (e.Cancel) return; } if (null != m_propertyHashtable) { if (m_propertyHashtable.ContainsKey(e.PropertyName)) { m_propertyHashtable[e.PropertyName] = e.NewValue; } else { m_propertyHashtable.Add(e.PropertyName, e.NewValue); } e.Cancel = true; } }
public virtual void OnPropertyChanging(PropertyChangingEventArgs propertyArg) { PropertyChanging?.Invoke(this, propertyArg); }
private void P2PropertyChangingEventHandler(object sender, PropertyChangingEventArgs e) { NotifyChildPropertyChanging(PROPERTIES.P2, sender, e); }
private void ChangingNameLocal(object sender, PropertyChangingEventArgs e) { this._changingProperty = new NotificationData(e.PropertyName, ((CheckNotificationInTest)sender).Name); }
private void Texto_PropertyChanging(object sender, PropertyChangingEventArgs e) { GetFrame((Label)sender); }
/// <summary> /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed. /// <example> /// propertychangingeventhandler.BeginInvoke(sender, e, callback); /// </example> /// </summary> public static IAsyncResult BeginInvoke(this PropertyChangingEventHandler propertychangingeventhandler, Object sender, PropertyChangingEventArgs e, AsyncCallback callback) { if (propertychangingeventhandler == null) { throw new ArgumentNullException("propertychangingeventhandler"); } return(propertychangingeventhandler.BeginInvoke(sender, e, callback, null)); }
/// <summary> /// プロパティ変更前に呼ばれます。 /// </summary> protected virtual void OnPropertyChanging(PropertyChangingEventArgs e) { }
public void RaisePropertyChanging(PropertyChangingEventArgs args) { }
private void HousesLazyItemPropertyChangingEventHandler(object sender, PropertyChangingEventArgs e) { NotifyChildPropertyChanging(PROPERTIES.HOUSES_LAZY, sender, e); }
protected override void OnPropertyChanging(PropertyChangingEventArgs e) { base.OnPropertyChanging(e); if (editing && !e.Cancel) { curPropertyValue = new PropertyValue(); curPropertyValue.OldValue = e.PropertyValue; } }
private static void OnItemChanging(PropertyNotifier <T> tree, object itemThatIsChanging, PropertyChangingEventArgs args) { var itemChanging = tree.ItemChanging; if (itemChanging != null) { itemChanging(tree, (T)itemThatIsChanging, args); } }
protected virtual void NotifyChildPropertyChanging(string propertyName, object sender, PropertyChangingEventArgs e) { ChildPropertyChangingEventHandler handler = ChildPropertyChanging; if (handler != null) handler(sender, new ChildPropertyChangingEventArgs(this, propertyName, sender, e)); }
void ActiveEnumerablePropertyChanging(object sender, PropertyChangingEventArgs e) => PropertyChanging?.Invoke(this, e);
/// <summary>Handles the PropertyChanging event of the DataContext control.</summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="PropertyChangingEventArgs"/> instance containing the event data.</param> private void DataContext_PropertyChanging(object sender, PropertyChangingEventArgs e) { }
private void CoinTable_PropertyChanging(object sender, PropertyChangingEventArgs e) { OnPropertyChanging("CoinList"); }
/// <summary> /// Implements changes in response to changes in the visualization object configuration. /// </summary> /// <param name="sender">The sender of the change.</param> /// <param name="e">The event arguments.</param> protected virtual void OnVisualizationObjectConfigurationPropertyChanging(object sender, PropertyChangingEventArgs e) { }
protected virtual void NotifyChildPropertyChanging(string propertyName, object sender, PropertyChangingEventArgs e) { ChildPropertyChangingEventHandler handler = ChildPropertyChanging; if (handler != null) { handler(sender, new ChildPropertyChangingEventArgs(this, propertyName, sender, e)); } }
public void RaisePropertyChanging(PropertyChangingEventArgs args) { this.RaisePropertyChanged(args.PropertyName); }
void root_PropertyChanging(object sender, PropertyChangingEventArgs e) { _changingName = e.PropertyName; }
public void RaisePropertyChanging(PropertyChangingEventArgs args) { PropertyChanging?.Invoke(this, args); }
private void RusticaOtro_PropertyChanging(object sender, PropertyChangingEventArgs e) { TotalOtroCajas.Text = (int.Parse(ACFNOtro.Text) + int.Parse(RusticaOtro.Text)).ToString(); }
void OnParentPropertyChanging(object sender, PropertyChangingEventArgs e) { if (e.PropertyName == "RowHeight") OnPropertyChanging("RenderHeight"); }
private void ACFNMariola_PropertyChanging(object sender, PropertyChangingEventArgs e) { TotalMariolaCajas.Text = (int.Parse(ACFNMariola.Text) + int.Parse(RusticaMariola.Text)).ToString(); }
public ItemPropertyChangingEventArgs(int index, T item, PropertyChangingEventArgs routedEventArgs) : base(index, item) { RoutedEventArgs = routedEventArgs; }
private void MeliponarioMariola_PropertyChanging(object sender, PropertyChangingEventArgs e) { TotalMariolaTrampa.Text = (int.Parse(MeliponarioMariola.Text) + int.Parse(CampoMariola.Text)).ToString(); }
protected virtual void OnPropertyChanging(PropertyChangingEventArgs e) { var handler = this.PropertyChanging; handler?.Invoke(this, e); }
/// <summary> /// Raises the <see cref="PropertyChanging" /> event. /// </summary> /// <param name="e"> Details of the property that is changing. </param> protected virtual void OnPropertyChanging(PropertyChangingEventArgs e) => PropertyChanging?.Invoke(this, e);
private void NotifyPropertyChanging(String propertyName) { PropertyChangingEventHandler handler = PropertyChanging; if (null != handler) { PropertyChangingEventArgs args = new PropertyChangingEventArgs(propertyName); handler(this, args); } }