private void CollectionChange(InBase item, bool visible) {
      if(item == null) {
        throw new ArgumentNullException("item");
      }
      if(visible) {
        lock(_valueVC) {
          int min = 0, mid = -1, max = _valueVC.Count - 1, cr;

          while(min <= max) {
            mid = (min + max) / 2;
            cr = item.CompareTo(_valueVC[mid]);
            if(cr > 0) {
              min = mid + 1;
            } else if(cr < 0) {
              max = mid - 1;
              mid = max;
            } else {
              break;
            }
          }
          _valueVC.Insert(mid + 1, item);
        }
      } else {
        _valueVC.Remove(item);
      }
    }
Esempio n. 2
0
 public override string ToString()
 {
     return(InBase.ToString()[0].ToString()
            + InLocal.ToString()[0].ToString()
            + InRemote.ToString()[0].ToString()
            + " " + Path);
 }
 public veSliderBool(InBase owner, JSC.JSValue schema) {
   _owner = owner;
   InitializeComponent();
   ValueChanged(_owner.value);
   cbBool.Checked+=cbBool_Checked;
   cbBool.Unchecked+=cbBool_Unchecked;
 }
 public static IValueEditor GetEdititor(string view, InBase owner, JSC.JSValue schema) {
   IValueEditor rez;
   Func<InBase, JSC.JSValue, IValueEditor> ct;
   if(_editors.TryGetValue(view, out ct) && ct != null) {
     rez = ct(owner, schema);
   } else {
     rez = new veDefault(owner, schema);
   }
   return rez;
 }
Esempio n. 5
0
 public veString(InBase owner, JSC.JSValue schema) {
   _owner = owner;
   base.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
   base.Padding = new System.Windows.Thickness(10, 0, 10, 0);
   base.BorderThickness = new System.Windows.Thickness(0);
   base.Background = System.Windows.Media.Brushes.Azure;
   base.GotFocus += ve_GotFocus;
   base.LostFocus += ve_LostFocus;
   base.KeyUp += ve_KeyUp;
   ValueChanged(_owner.value);
   SchemaChanged(schema);
 }
Esempio n. 6
0
 public override int CompareTo(InBase other) {
   var o = other as InValue;
   return o == null ? -1 : this._path.CompareTo(o._path);
 }
Esempio n. 7
0
 public veDefault(InBase owner, JSC.JSValue schema) {
   base.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
   base.Padding = new System.Windows.Thickness(10, 2, 10, 0);
   ValueChanged(owner.value);
 }
Esempio n. 8
0
 public static IValueEditor Create(InBase owner, JSC.JSValue schema) {
   return new veInteger(owner, schema);
 }
 public static IValueEditor Create(InBase owner, JSC.JSValue schema) {
   return new veSliderBool(owner, schema);
 }
Esempio n. 10
0
 public override int CompareTo(InBase other) {
   var o = other as InTopic;
   return o == null?1:this.path.CompareTo(o.path);
 }