Esempio n. 1
0
        public PropertyManipulator this[string property]
        {
            get
            {
                PropertyManipulator found;
                {
                    bool did_find;
                    // don't want to do anything but lookup or define when the thread lock is acquired.
                    // who knows what the constructor will awake.
                    lock (dict_lock)
                        did_find = dict.TryGetValue(property, out found);

                    if (!did_find)
                    {
                        // make the lookup, and bind it if there wasn't a challenge previously entered
                        // whilst we left the lock unlocked.
                        PropertyManipulator made = new PropertyManipulator(this, property);

                        lock (dict_lock)
                            if (!dict.TryGetValue(property, out found))
                            {
                                dict[property] = (found = made);
                            }
                    }
                }
                return(found);
            }
        }
Esempio n. 2
0
        public void HideShowProperty(PropertyManipulator property, bool show)
        {
            if (property.Manipulator != this)
            {
                throw new System.ArgumentException("Not made by this manipulator!", "property");
            }

            if (!property.SetBrowsable(show))
            {
                Console.Error.WriteLine(
                    string.Format(show ? "Failed to show property \"{0}\"" : "Failed to hide property \"{0}\"", PropLookupString(property)));
            }
        }
Esempio n. 3
0
        public void ChangePropertyDescription(PropertyManipulator property, string description)
        {
            if (property.Manipulator != this)
            {
                throw new System.ArgumentException("Not made by this manipulator!", "property");
            }

            if (!property.SetDescription(description))
            {
                Console.Error.WriteLine(
                    string.Format("Failed to set property \"{0}\" description (\"{1}\")", PropLookupString(property), description ?? "NULL"));
            }
        }
Esempio n. 4
0
        public void ChangePropertyName(PropertyManipulator property, string name)
        {
            if (property.Manipulator != this)
            {
                throw new System.ArgumentException("Not made by this manipulator!", "property");
            }

            if (!property.SetDisplayName(name))
            {
                Console.Error.WriteLine(
                    string.Format("Failed to set property \"{0}\" display name (\"{1}\")",
                                  PropLookupString(property), name ?? "NULL"));
            }
        }
Esempio n. 5
0
        public void UpdatePropertyDescription(PropertyManipulator property, string oce_desc)
        {
            if (property.Manipulator != this)
            {
                throw new System.ArgumentException("Not made by this manipulator!", "property");
            }

            if ((object)oce_desc != null && 0 != oce_desc.Length)
            {
                ChangePropertyDescription(property, oce_desc);
            }
            else
            {
                ChangePropertyDescription(property, "");
            }
        }
Esempio n. 6
0
        public void UpdatePropertyName(PropertyManipulator property, string oce_name, string otherName)
        {
            if (property.Manipulator != this)
            {
                throw new System.ArgumentException("Not made by this manipulator!", "property");
            }

            if ((object)oce_name != null && 0 != oce_name.Length)
            {
                ChangePropertyName(property, oce_name);
            }
            else
            {
                ChangePropertyName(property, otherName);
            }
        }
Esempio n. 7
0
        public static string PropLookupString(PropertyManipulator lookup)
        {
            //if (lookup.Manipulator != this) throw new System.ArgumentException("Not made by this manipulator!", "property");

            return(null == (object)lookup ? "NULL" : lookup.PropertyName ?? "NULL");
        }