public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes) { PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(value, false); LinearPointer linearPointer = (LinearPointer)value; PropertyDescriptorCollection propertyDescriptorCollection = new PropertyDescriptorCollection(null); for (int i = 0; i < properties.Count; i++) { if (properties[i].IsBrowsable) { if (linearPointer.Type == LinearPointerType.Thermometer && (properties[i].Name == "MarkerLength" || properties[i].Name == "MarkerStyle" || properties[i].Name == "BarStart")) { propertyDescriptorCollection.Add(TypeDescriptor.CreateProperty(value.GetType(), properties[i], new ReadOnlyAttribute(true))); } else if (linearPointer.Type == LinearPointerType.Marker && (properties[i].Name == "BarStart" || properties[i].Name == "NeedleStyle" || properties[i].Name.StartsWith("Thermometer", StringComparison.Ordinal))) { propertyDescriptorCollection.Add(TypeDescriptor.CreateProperty(value.GetType(), properties[i], new ReadOnlyAttribute(true))); } else if (linearPointer.Type == LinearPointerType.Bar && (properties[i].Name == "MarkerLength" || properties[i].Name == "MarkerStyle" || properties[i].Name == "NeedleStyle" || properties[i].Name.StartsWith("Thermometer", StringComparison.Ordinal))) { propertyDescriptorCollection.Add(TypeDescriptor.CreateProperty(value.GetType(), properties[i], new ReadOnlyAttribute(true))); } else { propertyDescriptorCollection.Add(properties[i]); } } } return(propertyDescriptorCollection); }
public LinearPointer Add(string name) { LinearPointer linearPointer = new LinearPointer(); linearPointer.Name = name; this.Add(linearPointer); return(linearPointer); }
public override object Clone() { MemoryStream stream = new MemoryStream(); BinaryFormatSerializer binaryFormatSerializer = new BinaryFormatSerializer(); binaryFormatSerializer.Serialize(this, stream); LinearPointer linearPointer = new LinearPointer(); binaryFormatSerializer.Deserialize(linearPointer, stream); return(linearPointer); }
public int IndexOf(LinearPointer value) { return(base.List.IndexOf(value)); }
public void Insert(int index, LinearPointer value) { base.List.Insert(index, value); }
public bool Contains(LinearPointer value) { return(base.List.Contains(value)); }
public void Remove(LinearPointer value) { base.List.Remove(value); }
public int Add(LinearPointer value) { return(base.List.Add(value)); }