Esempio n. 1
0
        public PropertyDescriptorCollection GetProperties()
        {
            PropertyDescriptorCollection NewProps = new PropertyDescriptorCollection(null);

            if (Value.Type == EWmeValue.Native)
            {
                string[] Attrs = DebugClient.GetClassProperties(Value.GetNative().NativeClass);
                if (Attrs != null)
                {
                    foreach (string Attr in Attrs)
                    {
                        NativePropertyDescriptor Prop = GetNativeProp(Attr);
                        if (Prop != null)
                        {
                            NewProps.Add(Prop);
                        }
                    }
                }
            }

            if (Value.Properties.Count > 0)
            {
                foreach (IWmeValue Val in Value.Properties)
                {
                    VariablePropertyDescriptor pd = new VariablePropertyDescriptor(new Variable(Val, this.Line));
                    NewProps.Add(pd);
                }
            }
            return(NewProps);
        }
Esempio n. 2
0
        public PropertyDescriptorCollection GetProperties()
        {
            PropertyDescriptorCollection NewProps = new PropertyDescriptorCollection(null);

            if (Script != null)
            {
                // script globals
                foreach (KeyValuePair <IWmeValue, Variable> kvp in Script.GlobalScope.Vars)
                {
                    if (kvp.Value.Value.Name == "self")
                    {
                        continue;
                    }

                    kvp.Value.Scope = Variable.VariableScope.Global;
                    VariablePropertyDescriptor pd = new VariablePropertyDescriptor(kvp.Value);
                    NewProps.Add(pd);
                }

                // scope vars
                ScriptScope Scope = Script.GetCurrentScope();
                if (Scope != null)
                {
                    foreach (KeyValuePair <IWmeValue, Variable> kvp in Scope.Vars)
                    {
                        kvp.Value.Scope = Variable.VariableScope.Local;
                        VariablePropertyDescriptor pd = new VariablePropertyDescriptor(kvp.Value);
                        NewProps.Add(pd);
                    }
                }
            }
            return(NewProps);
        }
Esempio n. 3
0
        //////////////////////////////////////////////////////////////////////////
        public override bool GetPropertiesSupported(ITypeDescriptorContext context)
        {
            VariablePropertyDescriptor pd = context.PropertyDescriptor as VariablePropertyDescriptor;

            if (pd != null)
            {
                return(pd.Var.Value.Properties.Count > 0 || pd.Var.Value.Type == EWmeValue.Native);
            }
            else
            {
                return(true);
            }
        }
Esempio n. 4
0
        public PropertyDescriptorCollection GetProperties()
        {
            PropertyDescriptorCollection NewProps = new PropertyDescriptorCollection(null);

            if (Vars.Count > 0)
            {
                foreach (KeyValuePair <IWmeValue, Variable> kvp in Vars)
                {
                    VariablePropertyDescriptor pd = new VariablePropertyDescriptor(kvp.Value);
                    NewProps.Add(pd);
                }
            }
            return(NewProps);
        }
Esempio n. 5
0
 //////////////////////////////////////////////////////////////////////////
 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
 {
     if (value is string)
     {
         VariablePropertyDescriptor pd = context.PropertyDescriptor as VariablePropertyDescriptor;
         if (pd != null)
         {
             pd.Var.Value.SetValue((string)value);
             return(pd.Var);
         }
         else
         {
             return(null);
         }
     }
     return(base.ConvertFrom(context, culture, value));
 }
Esempio n. 6
0
        public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
        {
            VariablePropertyDescriptor pd = context.PropertyDescriptor as VariablePropertyDescriptor;

            if (pd != null)
            {
                if (pd.Var.Value.Properties.Count > 0)
                {
                    return(UITypeEditorEditStyle.None);
                }
                else
                {
                    return(UITypeEditorEditStyle.Modal);
                }
            }
            return(UITypeEditorEditStyle.None);
        }
Esempio n. 7
0
        public PropertyDescriptorCollection GetProperties()
        {
            PropertyDescriptorCollection NewProps = new PropertyDescriptorCollection(null);

            foreach (WatchItem Item in Items)
            {
                if (Item.Value == null)
                {
                    NewProps.Add(Item);
                }
                else
                {
                    VariablePropertyDescriptor pd = new VariablePropertyDescriptor(Item.Value);
                    NewProps.Add(pd);
                }
            }
            return(NewProps);
        }
 public PropertyDescriptorCollection GetProperties()
 {
     PropertyDescriptorCollection NewProps = new PropertyDescriptorCollection(null);
     if (Vars.Count > 0)
     {
         foreach(KeyValuePair<IWmeValue, Variable> kvp in Vars)
         {
             VariablePropertyDescriptor pd = new VariablePropertyDescriptor(kvp.Value);
             NewProps.Add(pd);
         }
     }
     return NewProps;
 }
 public PropertyDescriptorCollection GetProperties()
 {
     PropertyDescriptorCollection NewProps = new PropertyDescriptorCollection(null);
     foreach(WatchItem Item in Items)
     {
         if(Item.Value==null)
         {
             NewProps.Add(Item);
         }
         else
         {
             VariablePropertyDescriptor pd = new VariablePropertyDescriptor(Item.Value);
             NewProps.Add(pd);
         }
     }
     return NewProps;
 }
        public PropertyDescriptorCollection GetProperties()
        {
            PropertyDescriptorCollection NewProps = new PropertyDescriptorCollection(null);

            if (Value.Type == EWmeValue.Native)
            {
                string[] Attrs = DebugClient.GetClassProperties(Value.GetNative().NativeClass);
                if(Attrs!=null)
                {
                    foreach(string Attr in Attrs)
                    {
                        NativePropertyDescriptor Prop = GetNativeProp(Attr);
                        if(Prop!=null) NewProps.Add(Prop);
                    }
                }
            }

            if (Value.Properties.Count > 0)
            {
                foreach(IWmeValue Val in Value.Properties)
                {
                    VariablePropertyDescriptor pd = new VariablePropertyDescriptor(new Variable(Val, this.Line));
                    NewProps.Add(pd);
                }
            }
            return NewProps;
        }
        public PropertyDescriptorCollection GetProperties()
        {
            PropertyDescriptorCollection NewProps = new PropertyDescriptorCollection(null);
            if (Script != null)
            {
                // script globals
                foreach(KeyValuePair<IWmeValue, Variable> kvp in Script.GlobalScope.Vars)
                {
                    if (kvp.Value.Value.Name == "self") continue;

                    kvp.Value.Scope = Variable.VariableScope.Global;
                    VariablePropertyDescriptor pd = new VariablePropertyDescriptor(kvp.Value);
                    NewProps.Add(pd);
                }

                // scope vars
                ScriptScope Scope = Script.GetCurrentScope();
                if (Scope != null)
                {
                    foreach (KeyValuePair<IWmeValue, Variable> kvp in Scope.Vars)
                    {
                        kvp.Value.Scope = Variable.VariableScope.Local;
                        VariablePropertyDescriptor pd = new VariablePropertyDescriptor(kvp.Value);
                        NewProps.Add(pd);
                    }
                }
            }
            return NewProps;
        }