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);
			}
		}
Ejemplo n.º 9
0
        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 });
                    }
                }
            }
        }
Ejemplo n.º 11
0
        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();
 }
Ejemplo n.º 14
0
 public MvxInpcInterceptionResult Intercept(IMvxNotifyPropertyChanged sender, PropertyChangingEventArgs args)
 {
     return(ChangingHandler(sender, args));
 }
Ejemplo n.º 15
0
        //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;
        }
Ejemplo n.º 16
0
 static CommittedBlock()
 {
     CommittedBlock.emptyChangingEventArgs = new PropertyChangingEventArgs(string.Empty);
 }
Ejemplo n.º 17
0
 void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args)
 {
     PropertyChangingEventManager.DeliverEvent(this, args);
 }
 void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args)
 {
     PropertyChangingEventManager.DeliverEvent(this, args);
 }
Ejemplo n.º 19
0
 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);
		}
Ejemplo n.º 21
0
 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();
     }
 }
Ejemplo n.º 22
0
        /// <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);
 }
Ejemplo n.º 24
0
	private void P2PropertyChangingEventHandler(object sender, PropertyChangingEventArgs e)
	{
		NotifyChildPropertyChanging(PROPERTIES.P2, sender, e);
	}
Ejemplo n.º 25
0
 private void ChangingNameLocal(object sender, PropertyChangingEventArgs e)
 {
     this._changingProperty = new NotificationData(e.PropertyName, ((CheckNotificationInTest)sender).Name);
 }
Ejemplo n.º 26
0
 private void Texto_PropertyChanging(object sender, PropertyChangingEventArgs e)
 {
     GetFrame((Label)sender);
 }
Ejemplo n.º 27
0
        /// <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));
        }
Ejemplo n.º 28
0
 /// <summary>
 /// プロパティ変更前に呼ばれます。
 /// </summary>
 protected virtual void OnPropertyChanging(PropertyChangingEventArgs e)
 {
 }
Ejemplo n.º 29
0
 public void RaisePropertyChanging(PropertyChangingEventArgs args)
 {
 }
Ejemplo n.º 30
0
 private void HousesLazyItemPropertyChangingEventHandler(object sender, PropertyChangingEventArgs e)
 {
     NotifyChildPropertyChanging(PROPERTIES.HOUSES_LAZY, sender, e);
 }
Ejemplo n.º 31
0
 protected override void OnPropertyChanging(PropertyChangingEventArgs e)
 {
     base.OnPropertyChanging(e);
     if (editing && !e.Cancel)
     {
         curPropertyValue = new PropertyValue();
         curPropertyValue.OldValue = e.PropertyValue;
     }
 }
Ejemplo n.º 32
0
        private static void OnItemChanging(PropertyNotifier <T> tree, object itemThatIsChanging, PropertyChangingEventArgs args)
        {
            var itemChanging = tree.ItemChanging;

            if (itemChanging != null)
            {
                itemChanging(tree, (T)itemThatIsChanging, args);
            }
        }
Ejemplo n.º 33
0
	protected virtual void NotifyChildPropertyChanging(string propertyName, object sender, PropertyChangingEventArgs e)
	{
		ChildPropertyChangingEventHandler handler = ChildPropertyChanging;
		if (handler != null)
			handler(sender, new ChildPropertyChangingEventArgs(this, propertyName, sender, e));
	}
Ejemplo n.º 34
0
 void ActiveEnumerablePropertyChanging(object sender, PropertyChangingEventArgs e) => PropertyChanging?.Invoke(this, e);
Ejemplo n.º 35
0
 /// <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)
 {
 }
Ejemplo n.º 36
0
 private void CoinTable_PropertyChanging(object sender, PropertyChangingEventArgs e)
 {
     OnPropertyChanging("CoinList");
 }
Ejemplo n.º 37
0
 /// <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));
            }
        }
Ejemplo n.º 39
0
 public void RaisePropertyChanging(PropertyChangingEventArgs args)
 {
     this.RaisePropertyChanged(args.PropertyName);
 }
Ejemplo n.º 40
0
 void root_PropertyChanging(object sender, PropertyChangingEventArgs e)
 {
     _changingName = e.PropertyName;
 }
Ejemplo n.º 41
0
 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();
 }
Ejemplo n.º 43
0
		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();
 }
Ejemplo n.º 47
0
        protected virtual void OnPropertyChanging(PropertyChangingEventArgs e)
        {
            var handler = this.PropertyChanging;

            handler?.Invoke(this, e);
        }
Ejemplo n.º 48
0
 /// <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);
Ejemplo n.º 49
0
 private void NotifyPropertyChanging(String propertyName)
 {
     PropertyChangingEventHandler handler = PropertyChanging;
     if (null != handler)
     {
         PropertyChangingEventArgs args = new PropertyChangingEventArgs(propertyName);
         handler(this, args);
     }
 }