예제 #1
0
 private void SetupPropertyAfterInitialize(object obj, string name, Type propertyType, object value, string category, string description, string editor, string typeConverter)
 {
     if (HasTypeConverter(obj, propertyType, typeConverter))
     {
         PropertyDetail spec = Properties[Properties.IndexOf(name)];
         if (propertyType == typeof(Interval))
         {
             spec.DefaultValue = value;
         }
         else
         {
             HandleReadOnly(value, spec);
         }
         values[name] = value;
     }
     else
     {
         if (value != null && value != obj)
         {
             PropertyDetail spec  = Properties[Properties.IndexOf(name)];
             PropertyTable  table = (PropertyTable)values[name];
             table.UpdateAfterInitialize();
         }
     }
 }
예제 #2
0
 private void HandleReadOnly(object value, PropertyDetail detail)
 {
     if (value == null || !value.Equals(detail.DefaultValue))
     {
         detail.IsReadOnly  = true;
         detail.Description = "READ ONLY: Properties that you set in OnInitialize() are read only to the GUI because project settings apply before and get overwritten by OnInitialize().";
     }
 }
예제 #3
0
		PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty()
		{
			PropertyDetail propertySpec = null;
			if(defaultProperty != null)
			{
				int index = properties.IndexOf(defaultProperty);
				propertySpec = properties[index];
			}

			if(propertySpec != null)
				return new PropertyDetailDescriptor(propertySpec, this, propertySpec.Name, null);
			else
				return null;
		}
예제 #4
0
 private void SetPropertyFromProjectFile(object obj, string name, Type propertyType, object value, string category, string description, string editor, string typeConverter)
 {
     if (HasTypeConverter(obj, propertyType, typeConverter))
     {
         PropertyDetail spec = Properties[Properties.IndexOf(name)];
         values[name] = value;
     }
     else
     {
         if (value != null && value != obj)
         {
             PropertyDetail spec  = Properties[Properties.IndexOf(name)];
             PropertyTable  table = (PropertyTable)values[name];
             table.UpdateAfterProjectFile();
         }
     }
 }
예제 #5
0
 private void SetupProperty(object obj, string name, Type propertyType, object value, string category, string description, string editor, string typeConverter)
 {
     if (propertyType.FullName.Equals("TickZoom.Api.Elapsed"))
     {
         editor        = "ElapsedPropertyEditor";
         typeConverter = typeof(ElapsedTypeConverter).AssemblyQualifiedName;
     }
     if (propertyType == typeof(TimeStamp))
     {
         editor        = "TimestampPropertyEditor";
         typeConverter = typeof(TimestampTypeConverter).AssemblyQualifiedName;
     }
     if (propertyType == typeof(Interval))
     {
         editor        = "IntervalPropertyEditor";
         typeConverter = typeof(IntervalTypeConverter).AssemblyQualifiedName;
     }
     if (propertyType == typeof(Interval))
     {
         editor        = "IntervalPropertyEditor";
         typeConverter = typeof(IntervalTypeConverter).AssemblyQualifiedName;
     }
     if (HasTypeConverter(obj, propertyType, typeConverter))
     {
         PropertyDetail detail = new PropertyDetail(name, propertyType, category, description, value, editor, typeConverter);
         this.Properties.Add(detail);
         this.DefaultProperty = name;
         values[name]         = value;
     }
     else
     {
         if (value != null && !value.Equals(obj))
         {
             PropertyTable  table  = new PropertyTable(value);
             PropertyDetail detail = new PropertyDetail(name, table.GetType(), category, description);
             this.Properties.Add(detail);
             values[name] = table;
         }
     }
 }
예제 #6
0
		public abstract void SetValue(PropertyDetail item, object value);
예제 #7
0
		public abstract object GetValue(PropertyDetail item);
 public PropertyDetailDescriptor(PropertyDetail item, PropertyStore store, string name, Attribute[] attrs) :
     base(name, attrs)
 {
     this.store = store;
     this.info  = item;
 }
 public PropertyDetailEventArgs(PropertyDetail property, object val)
 {
     this.property = property;
     this.val      = val;
 }
예제 #10
0
 public override void SetValue(PropertyDetail item, object value)
 {
     values[item.Name] = value;
 }
예제 #11
0
 public override object GetValue(PropertyDetail item)
 {
     return(values[item.Name]);
 }