當前位置: 首頁>>代碼示例>>C#>>正文


C# ComponentModel.PropertyChangingEventArgs類代碼示例

本文整理匯總了C#中System.ComponentModel.PropertyChangingEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# PropertyChangingEventArgs類的具體用法?C# PropertyChangingEventArgs怎麽用?C# PropertyChangingEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PropertyChangingEventArgs類屬於System.ComponentModel命名空間,在下文中一共展示了PropertyChangingEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: _location_PropertyChanging

        public void _location_PropertyChanging(object sender, PropertyChangingEventArgs e)
        {
            //if (e.PropertyName == "StadiumName")
            //{
            //    if (((PropertyChangingCancelEventArgs<String>)e).NewValue.All(char.IsLetter))
            //    {
            //        ((PropertyChangingCancelEventArgs<String>)e).Cancel = false;
            //    }
            //    else
            //    {
            //        ((PropertyChangingCancelEventArgs<String>)e).Cancel = true;

            //        throw new Exception("StadiumName should not have numbers");
            //    }
            //}

             if (e.PropertyName == "LocationName")
            {
                if (((PropertyChangingCancelEventArgs<String>)e).NewValue.All(char.IsLetter))
                {
                    ((PropertyChangingCancelEventArgs<String>)e).Cancel = false;
                }
                else
                {
                    ((PropertyChangingCancelEventArgs<String>)e).Cancel = true;

                    throw new Exception("LocationName should not have numbers");
                }
            }
        }
開發者ID:prafulpc,項目名稱:Cricket,代碼行數:30,代碼來源:NewLocationBLL.cs

示例2: RaisePropertyChanging

		protected virtual void RaisePropertyChanging(PropertyChangingEventArgs property)
		{
			if (this.PropertyChanging != null)
			{
				this.PropertyChanging(this, property);
			}
		}
開發者ID:gleblebedev,項目名稱:toe,代碼行數:7,代碼來源:ClassWithNotification.cs

示例3: CPropertyChanging

 static void CPropertyChanging(Object sender, PropertyChangingEventArgs e)
 {
     if ("Nome|Sobrenome".Contains(e.PropertyName))
         Console.WriteLine("o valor original da propriedade {0} é {1}",
             e.PropertyName,
             sender.GetType().GetProperty(e.PropertyName).GetValue(sender, null));
 }
開發者ID:50minutos,項目名稱:MOC-10265,代碼行數:7,代碼來源:Program.cs

示例4: OnPropertyChanging

 /// <summary>
 /// Raises the PropertyChanging event.
 /// </summary>
 /// <param name="propertyName">The name of the property.</param>
 protected virtual void OnPropertyChanging([CallerMemberName] string propertyName = "")
 {
     if (PropertyChanging != null && SuppressEvents == false)
     {
         PropertyChangingEventArgs args = new PropertyChangingEventArgs(propertyName);
         PropertyChanging(this, args);
     }
 }
開發者ID:akordowski,項目名稱:NToolbox,代碼行數:12,代碼來源:NotifyObject.cs

示例5: NotifyPropertyChanging

        protected virtual void NotifyPropertyChanging(string propertyName)
        {
            if (this.PropertyChanging != null)
            {
                var e = new PropertyChangingEventArgs(propertyName);

                this.PropertyChanging(this, e);
            }
        }
開發者ID:adrian-phillips-rivensoft,項目名稱:rivensoft-mobile-mileagetracker,代碼行數:9,代碼來源:LinqEntityBase.cs

示例6: Preset

        public void Preset(object sender, PropertyChangingEventArgs args)
        {
            if (!_resetOnce)
                return;

            var stones = ((CupVM)DataContext).Stones;
            tbStones.ClearValue(TextBlock.TextProperty);
            tbStones.Text = stones.ToString();
            _resetOnce = false;
        }
開發者ID:SamirHafez,項目名稱:Bantu,代碼行數:10,代碼來源:CupControl.xaml.cs

示例7: RememberOldValue

        public void RememberOldValue(object sender, PropertyChangingEventArgs e)
        {
            if(instance != null)
            {
                throw new InvalidOperationException("Old value is already initialized");
            }

            instance = sender;
            propertyName = e.PropertyName;
            oldValue = TypeUtils.GetPropertyValue(sender, e.PropertyName);
        }
開發者ID:lishxi,項目名稱:_SharpMap,代碼行數:11,代碼來源:NotifyPropertyChangeMemento.cs

示例8: RaisePropertyChangingEvent

        /// <summary>
        /// elevar el evento de PropertyChanging. La propiedad especificada va a ser cambiada.
        /// </summary>
        /// <param name="propertyName">El nombre de la propiedad que ha cambiado.</param>
        public virtual void RaisePropertyChangingEvent(string propertyName)
        {
            // Salir si los cambios son ignorados.
            if (IgnorePropertyChangeEvents) return;

            // Salir si no se suscriben
            if (PropertyChanging == null) return;

            // Elevar el evento
            var e = new PropertyChangingEventArgs(propertyName);
            PropertyChanging(this, e);
        }
開發者ID:llenroc,項目名稱:Inflexion2,代碼行數:16,代碼來源:ViewModelBase.cs

示例9: MyPropertyChanging

        private void MyPropertyChanging(object sender, PropertyChangingEventArgs e)
        {
            lock (this.oldPropertyValueDic)
            {
                // ViewModelの狀態を元すため、プロパティの元の値を保存します。
                if (!this.oldPropertyValueDic.ContainsKey(e.PropertyName))
                {
                    this.oldPropertyValueDic[e.PropertyName] =
                        MethodUtil.GetPropertyValue(sender, e.PropertyName);
                }
            }

            base.OnPropertyChanging(e);
        }
開發者ID:JuroGandalf,項目名稱:Ragnarok,代碼行數:14,代碼來源:ViewModelProxy.cs

示例10: OnLocationPropertyChanging

        protected void OnLocationPropertyChanging(object sender, PropertyChangingEventArgs e)
        {
            LocationObj loc = sender as LocationObj;
            if (loc == null)
                return;

//            Trace.WriteLine("Location property changing: " + loc.ToString() + " property: " + e.PropertyName); 

            //Update if a position or everything has changed
            if (e.PropertyName.Contains("Position") || e.PropertyName.Contains("WorldPosition") || string.IsNullOrEmpty(e.PropertyName))
            {
//                Location locView = new Location(loc);
                RemoveStructureLinks(new LocationObj[]{loc});
                RemoveLocations(new LocationObj[] { loc }, false);
            }
        }
開發者ID:abordt,項目名稱:Viking,代碼行數:16,代碼來源:SectionLocationsViewModel.cs

示例11: _team_PropertyChanging

        public void _team_PropertyChanging(object sender, PropertyChangingEventArgs e)
        {
            if (e.PropertyName == "ShortName")
            {
                if(((PropertyChangingCancelEventArgs<String>)e).NewValue.All(char.IsLetter))
                {
                    ((PropertyChangingCancelEventArgs<String>)e).Cancel = false;
                }
                else
                {
                    ((PropertyChangingCancelEventArgs<String>)e).Cancel = true;

                    throw new Exception("Short Name should not have numbers");
                }
            }
        }
開發者ID:prafulpc,項目名稱:Cricket,代碼行數:16,代碼來源:NewTeamBLL.cs

示例12: _player_PropertyChanging

        public void _player_PropertyChanging(object sender, PropertyChangingEventArgs e)
        {
            //if (e.PropertyName == "FirstName")
            //{
            //    if (((PropertyChangingCancelEventArgs<String>)e).NewValue.All(char.IsLetter))
            //    {
            //        ((PropertyChangingCancelEventArgs<String>)e).Cancel = false;
            //    }
            //    else
            //    {
            //        ((PropertyChangingCancelEventArgs<String>)e).Cancel = true;

            //        throw new Exception("First Name should contain only Characters");
            //    }
            //}

            //else if (e.PropertyName == "LastName")
            //{
            //    if (((PropertyChangingCancelEventArgs<String>)e).NewValue.All(char.IsLetter))
            //    {
            //        ((PropertyChangingCancelEventArgs<String>)e).Cancel = false;
            //    }
            //    else
            //    {
            //        ((PropertyChangingCancelEventArgs<String>)e).Cancel = true;

            //        throw new Exception("Last Name should contain only Characters");
            //    }
            //}

             if (e.PropertyName == "MobileNo")
            {
                if (((PropertyChangingCancelEventArgs<String>)e).NewValue.All(char.IsDigit))
                {
                    ((PropertyChangingCancelEventArgs<String>)e).Cancel = false;
                }
                else
                {
                    ((PropertyChangingCancelEventArgs<String>)e).Cancel = true;

                    throw new Exception("Mobile No should contain only Numbers");
                }
            }
        }
開發者ID:prafulpc,項目名稱:Cricket,代碼行數:44,代碼來源:NewPlayerBLL.cs

示例13: OnPropertyChanging

 private void OnPropertyChanging(object subject, PropertyChangingEventArgs args)
 {
     if (args.PropertyName == PropertyName)
     {
         log.Trace("OnPropertyChanging " + args.PropertyName);
         // Unsubscribe from children
         UnsubscribeFromChildren(subject);
     }
 }
開發者ID:lycilph,項目名稱:Projects,代碼行數:9,代碼來源:PropertyNode.cs

示例14: OnPropertyChanging

 private void OnPropertyChanging(object sender, PropertyChangingEventArgs e)
 {
     switch (e.PropertyName)
     {
         case "SelectedView":
             CheckSettingsWorkspace(SelectedView);
             break;
     }
 }
開發者ID:sillsdev,項目名稱:cog,代碼行數:9,代碼來源:MainWindowViewModel.cs

示例15: InstancePropertyChanging

 private static void InstancePropertyChanging(object sender, PropertyChangingEventArgs e)
 {
 }
開發者ID:name2name2,項目名稱:mvvmlight,代碼行數:3,代碼來源:ViewModelBaseTest.cs


注:本文中的System.ComponentModel.PropertyChangingEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。