示例#1
0
        public override bool Equals(object obj)
        {
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }
            IntDataStruct d = (IntDataStruct)obj;

            return(this.iVal == d.iVal && this.born == d.born);
        }
示例#2
0
        // Clear
        public override void Clear()
        {
            IntDataStruct old = this.value;

            this.value.IntVal = 0;
            this.value.Born   = false;

            if (old != this.value && IsChangedHandlers())
            {
                OnChanged(this, new ChangedEventsArgs(old, this.value));
            }
        }
示例#3
0
 public bool FromString(String str)
 {
     try
     {
         int           newVal = Int32.Parse(str);
         IntDataStruct old    = this.value;
         Value = newVal;
         if (old.IntVal != newVal && old == this.value) //если значение не изменилось, хотя должно было (т.е. не попало в интервал [min;max])
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
     catch (FormatException e)
     {
         //Born = false; //----????????
         return(false);
     }
 }