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); } }
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))); } }
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")); } }
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")); } }
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, ""); } }
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); } }
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"); }