Ejemplo n.º 1
0
        protected DesignerProperty SafeGetDesignerProperty(DesignerProperty designerProperty, string propertyName)
        {
            // Check if the object is already disposed, we should try to get a new value if it is true.
            if (designerProperty != null &&
                designerProperty.IsDisposed)
            {
                designerProperty = null;
            }

            if (designerProperty == null &&
                PropertySet != null)
            {
                PropertySet.TryGetDesignerProperty(propertyName, out designerProperty);
            }
            return(designerProperty);
        }
Ejemplo n.º 2
0
        internal override bool ParseSingleElement(ICollection <XName> unprocessedElements, XElement elem)
        {
            // we leave the parsing of properties to the subclasses of BaseDesignerModel
            if (elem.Name.LocalName == "DesignerProperty")
            {
                var propertyName = elem.Attribute(EFNameableItem.AttributeName).Value;
                // Fix for bug 390580 - only include DesignerProperty if one with that name
                // does not already exist (otherwise Dictionary throws when you attempt to add
                // it which casues VS to crash)
                if (false == _designerProperties.ContainsKey(propertyName))
                {
                    var prop = new DesignerProperty(this, elem);
                    prop.Parse(unprocessedElements);
                    AddDesignerProperty(propertyName, prop);
                }
            }
            else
            {
                return(base.ParseSingleElement(unprocessedElements, elem));
            }

            return(true);
        }
Ejemplo n.º 3
0
 protected void AddDesignerProperty(string propertyName, DesignerProperty prop)
 {
     PropertySet.AddDesignerProperty(propertyName, prop);
 }
Ejemplo n.º 4
0
 internal void AddDesignerProperty(string propertyName, DesignerProperty prop)
 {
     _designerProperties.Add(propertyName, prop);
 }
Ejemplo n.º 5
0
 internal bool TryGetDesignerProperty(string propertyName, out DesignerProperty designerProperty)
 {
     return(_designerProperties.TryGetValue(propertyName, out designerProperty));
 }