コード例 #1
0
        /*********
        ** Public methods
        *********/
        /// <summary>Construct an instance.</summary>
        /// <param name="field">The field to watch.</param>
        public NetValueWatcher(NetFieldBase <T, TSelf> field)
        {
            this.Field         = field;
            this.PreviousValue = field.Value;
            this.CurrentValue  = field.Value;

            field.fieldChangeVisibleEvent += this.OnValueChanged;
            field.fieldChangeEvent        += this.OnValueChanged;
        }
コード例 #2
0
ファイル: WatcherFactory.cs プロジェクト: ebehar/SMAPI
 /// <summary>Get a watcher for a net collection.</summary>
 /// <typeparam name="T">The value type.</typeparam>
 /// <typeparam name="TSelf">The net field instance type.</typeparam>
 /// <param name="field">The net collection.</param>
 public static NetValueWatcher <T, TSelf> ForNetValue <T, TSelf>(NetFieldBase <T, TSelf> field) where TSelf : NetFieldBase <T, TSelf>
 {
     return(new NetValueWatcher <T, TSelf>(field));
 }