示例#1
0
        private void RefreshTextContent()
        {
            string text = string.Empty;

            if (PIMAttribute.AttributeType != null)
            {
                text = string.Format("{0} : {1}", PIMAttribute.Name, PIMAttribute.AttributeType.Name);
            }
            else
            {
                text = PIMAttribute.Name;
            }

            if (!String.IsNullOrEmpty(PIMAttribute.GetCardinalityString()) && PIMAttribute.GetCardinalityString() != "1")
            {
                text += String.Format(" {{{0}}}", PIMAttribute.GetCardinalityString());
            }

            if (PIMAttribute.DefaultValue != null)
            {
                text += string.Format(" [init: {0}]", PIMAttribute.DefaultValue);
            }

            if (PIMAttribute.AppliedStereotypes.Count > 0)
            {
                text =
                    PIMAttribute.AppliedStereotypes.GetStereotypesString() + Environment.NewLine + text;
            }

            this.Text = text;
        }
示例#2
0
 private void CopyValues(PIMAttribute a)
 {
     Name         = a.Name;
     Type         = a.AttributeType;
     Multiplicity = a.GetCardinalityString();
     DefaultValue = a.DefaultValue;
 }
示例#3
0
 public FakePSMAttribute(PIMAttribute p)
     : this()
 {
     Name                 = p.Name;
     Type                 = p.AttributeType;
     Multiplicity         = p.GetCardinalityString();
     DefaultValue         = p.DefaultValue;
     SourceAttribute      = null;
     RepresentedAttribute = p;
     ComesFrom            = (PIMClass)p.PIMClass;
     Checked              = false;
     XFormElement         = false;
 }
示例#4
0
 public FakePSMAttribute(PIMAttribute p, TypeFinder typeFinder)
     : this()
 {
     Name                 = p.Name;
     Multiplicity         = p.GetCardinalityString();
     DefaultValue         = p.DefaultValue;
     SourceAttribute      = null;
     RepresentedAttribute = p;
     ComesFrom            = (PIMClass)p.PIMClass;
     Checked              = false;
     XFormElement         = true;
     if (p.AttributeType != null)
     {
         Type = typeFinder(p.AttributeType);
     }
 }