示例#1
0
 public void SetInput(Guid ClsOid, ArrayList al_unCodeMetaAttr, DECodeAttribute codeAttr, bool isAdd)
 {
     this.ClassOid          = ClsOid;
     this.theCls            = PLDataModel.Agent2.GetMetaClass(ClsOid);
     this.AL_unCodeMetaAttr = al_unCodeMetaAttr;
     this.b_IsAdd           = isAdd;
     this.ca_input          = codeAttr;
     this.SetEditText(codeAttr);
 }
示例#2
0
 private void btn_ok_Click(object sender, EventArgs e)
 {
     if (this.CodeAttrSelected != null)
     {
         DECodeAttribute codeAttrValue = this.GetCodeAttrValue();
         this.CodeAttrSelected(codeAttrValue);
     }
     base.Parent.Hide();
 }
示例#3
0
 public void ReLoad(Guid ClsOid, ArrayList al_unCodeMetaAttr, DECodeAttribute ca_in, bool isAdd)
 {
     this.ClassOid          = ClsOid;
     this.AL_unCodeMetaAttr = al_unCodeMetaAttr;
     this.b_isAdd           = isAdd;
     this.ca_input          = ca_in;
     this.LoadUnCodeMetaAttr();
     this.SetCodeAttrValue(ca_in);
 }
示例#4
0
        private string GetClsAttr2ResAttrLbl(DECodeAttribute ca_in)
        {
            ArrayList list = new ArrayList();

            new ArrayList();
            new ArrayList();
            new ArrayList();
            if (this.theCls != null)
            {
                foreach (DEMetaAttribute attribute in PLDataModel.Agent2.GetClassAllAttributes(this.theCls.Name))
                {
                    if ((attribute.IsViewable && !attribute.IsGrid) && !attribute.IsVirtualClass)
                    {
                        list.Add(attribute);
                    }
                }
                if (list.Count == 0)
                {
                    return("");
                }
                foreach (DEMetaAttribute attribute2 in list)
                {
                    if (attribute2.Oid == ca_in.ClassAttrOid)
                    {
                        DEMetaClass            metaClass = PLDataModel.Agent2.GetMetaClass(ca_in.ResClsOid);
                        List <DEMetaAttribute> list3     = new List <DEMetaAttribute>();
                        if (metaClass != null)
                        {
                            ArrayList resAttrs = new ResFunc().GetResAttrs(metaClass);
                            if ((resAttrs != null) && (resAttrs.Count > 0))
                            {
                                list3.AddRange((DEMetaAttribute[])resAttrs.ToArray(typeof(DEMetaAttribute)));
                            }
                        }
                        if ((list3 == null) || (list3.Count <= 0))
                        {
                            return(attribute2.Label + " -> ");
                        }
                        foreach (DEMetaAttribute attribute3 in list3)
                        {
                            if (attribute3.Oid == ca_in.ResAttrOid)
                            {
                                return(attribute2.Label + " -> " + attribute3.Label);
                            }
                        }
                    }
                }
            }
            return("");
        }
示例#5
0
 private void SetEditText(DECodeAttribute ca_in)
 {
     this.Text = "";
     if (this.b_IsAdd)
     {
         if (ca_in != null)
         {
             this.Text = this.GetClsAttr2ResAttrLbl(ca_in);
         }
     }
     else if (ca_in != null)
     {
         this.Text = this.GetClsAttr2ResAttrLbl(ca_in);
     }
 }
示例#6
0
        private void ucUser_CodeAttrSelected(DECodeAttribute ca_in)
        {
            bool flag = false;

            if ((base.Tag == null) && (ca_in != this.ca_input))
            {
                flag = true;
            }
            this.ca_input = ca_in;
            this.SetEditText(ca_in);
            if (flag && (this.DropListChanged != null))
            {
                this.DropListChanged(ca_in);
                base.CloseEditorButtonDropDowns();
            }
        }
示例#7
0
 private void SetCodeAttrValue(DECodeAttribute ca_def)
 {
     if ((ca_def != null) && (ca_def.ResClsOid != Guid.Empty))
     {
         DEMetaClass myCls = ModelContext.MetaModel.GetClass(ca_def.ResClsOid);
         if (myCls != null)
         {
             ArrayList resAttrs = new ResFunc().GetResAttrs(myCls);
             if (((resAttrs != null) && (resAttrs.Count != 0)) && (this.pnlValue.Controls.Count != 0))
             {
                 ComboBoxEditPLM tplm = this.pnlValue.Controls[0] as ComboBoxEditPLM;
                 foreach (DEMetaAttribute attribute in resAttrs)
                 {
                     if (attribute.Oid == ca_def.ResAttrOid)
                     {
                         tplm.Text = attribute.Label;
                         break;
                     }
                 }
             }
         }
     }
 }
示例#8
0
 public UCCodeAttrPicker(DECodeAttribute ca_in)
     : this()
 {
     this.ca_input = ca_in;
 }