Exemplo n.º 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();
         }
     }
 }
Exemplo n.º 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().";
     }
 }
Exemplo n.º 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;
		}
Exemplo n.º 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();
         }
     }
 }
Exemplo n.º 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;
         }
     }
 }
Exemplo n.º 6
0
		public abstract void SetValue(PropertyDetail item, object value);
Exemplo n.º 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;
 }
Exemplo n.º 10
0
 public override void SetValue(PropertyDetail item, object value)
 {
     values[item.Name] = value;
 }
Exemplo n.º 11
0
 public override object GetValue(PropertyDetail item)
 {
     return(values[item.Name]);
 }