Server.Gumps.PropertiesGump.OnValueChanged C# (CSharp) Méthode

OnValueChanged() public static méthode

public static OnValueChanged ( object obj, PropertyInfo prop, Stack stack ) : void
obj object
prop System.Reflection.PropertyInfo
stack System.Collections.Stack
Résultat void
		public static void OnValueChanged( object obj, PropertyInfo prop, Stack stack )
		{
			if ( stack == null || stack.Count == 0 )
				return;

			if ( !prop.PropertyType.IsValueType )
				return;

			StackEntry peek = (StackEntry)stack.Peek();

			if ( peek.m_Property.CanWrite )
				peek.m_Property.SetValue( peek.m_Object, obj, null );
		}

Usage Example

            protected override void OnTarget(Mobile from, object targeted)
            {
                IPoint3D p = targeted as IPoint3D;

                if (p != null)
                {
                    try
                    {
                        Server.Scripts.Commands.CommandLogging.LogChangeProperty(m_Mobile, m_Object, m_Property.Name, new Point2D(p).ToString());
                        m_Property.SetValue(m_Object, new Point2D(p), null);
                        PropertiesGump.OnValueChanged(m_Object, m_Property, m_Stack);

                        if (Miscellanious.ValidateLabeling(m_Object))
                        {
                            if (m_Object is Item)
                            {
                                ((Item)m_Object).Cheater_Name = String.Format("This item modified by GM {0}", m_Mobile.Name);
                            }

                            if (m_Object is Mobile)
                            {
                                ((Mobile)m_Object).Cheater_Name = String.Format("This mobile modified by GM {0}", m_Mobile.Name);
                            }
                        }
                    }
                    catch
                    {
                        m_Mobile.SendMessage("An exception was caught. The property may not have changed.");
                    }
                }
            }
All Usage Examples Of Server.Gumps.PropertiesGump::OnValueChanged