Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public partial class modifiableInputsIndi : Strategy
- {
- protected override void Initialize(){ Name = ""; }
- public override string ToString() { if (isSameDefaultClass()) return "_"; else return this.Name; }
- public bool isSameDefaultClass(){
- //string basenam = this.GetType().BaseType.Name; // DeclaringType // System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name
- //return Name == basenam;
- return this.GetType().Name== MethodBase.GetCurrentMethod().DeclaringType.Name; // "ttDefaultStrategy" //
- }
- }
- namespace NinjaTrader.Strategy
- {
- #region modifiableInputsIndi
- public partial class modifiableInputsIndi : ICustomTypeDescriptor
- {
- // partial void ModifyProperties(PropertyDescriptorCollection col);
- // public virtual void ModifyProperties(PropertyDescriptorCollection col){}
- // internal partial void ModifyProperties(PropertyDescriptorCollection col)
- // {
- // if (!ShowB) col.Remove(col.Find("InputB", true));
- // }
- #region ICustomTypeDescriptor Members
- public AttributeCollection GetAttributes()
- {
- return TypeDescriptor.GetAttributes(GetType());
- }
- public string GetClassName()
- {
- return TypeDescriptor.GetClassName(GetType());
- }
- public string GetComponentName()
- {
- return TypeDescriptor.GetComponentName(GetType());
- }
- public TypeConverter GetConverter()
- {
- return TypeDescriptor.GetConverter(GetType());
- }
- public EventDescriptor GetDefaultEvent()
- {
- return TypeDescriptor.GetDefaultEvent(GetType());
- }
- public PropertyDescriptor GetDefaultProperty()
- {
- return TypeDescriptor.GetDefaultProperty(GetType());
- }
- public object GetEditor(Type editorBaseType)
- {
- return TypeDescriptor.GetEditor(GetType(), editorBaseType);
- }
- public EventDescriptorCollection GetEvents(Attribute[] attributes)
- {
- return TypeDescriptor.GetEvents(GetType(), attributes);
- }
- public EventDescriptorCollection GetEvents()
- {
- return TypeDescriptor.GetEvents(GetType());
- }
- public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
- {
- PropertyDescriptorCollection orig = TypeDescriptor.GetProperties(GetType(), attributes);
- PropertyDescriptor[] arr = new PropertyDescriptor[orig.Count];
- orig.CopyTo(arr, 0);
- PropertyDescriptorCollection col = new PropertyDescriptorCollection(arr);
- ModifyProperties(col);
- return col;
- }
- public PropertyDescriptorCollection GetProperties()
- {
- return TypeDescriptor.GetProperties(GetType());
- }
- public object GetPropertyOwner(PropertyDescriptor pd)
- {
- return this;
- }
- #endregion
- }
- #endregion
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement