Ejemplo n.º 1
0
 private void lvwTSD_DoubleClick(object sender, EventArgs e)
 {
     if ((this.lvwTSD.SelectedItems.Count == 1) && (PLGrantPerm.CanDoClassOperation(ClientData.LogonUser.Oid, "DQDOSSIERPRINT", Guid.Empty, "ClaRel_BROWSE") != 0))
     {
         ListViewItem item = this.lvwTSD.SelectedItems[0];
         IBizItem     tag  = item.Tag as IBizItem;
         this.OpenItem(sender, tag);
     }
 }
Ejemplo n.º 2
0
 private void GetCando()
 {
     if (PLGrantPerm.CanDoClassOperation(ClientData.LogonUser.Oid, "DQDOSSIERPRINT", Guid.Empty, "ClaRel_CREATE") == 1)
     {
         this.lstCando.Add(this.D_ADD_TSD);
     }
     if (PLGrantPerm.CanDoClassOperation(ClientData.LogonUser.Oid, "DQDOSSIERPRINT", Guid.Empty, "ClaRel_BROWSE") == 1)
     {
         this.lstCando.Add(this.D_OPEN_TSD);
     }
     if (PLGrantPerm.CanDoClassOperation(ClientData.LogonUser.Oid, "DQDOSSIERPRINT", Guid.Empty, "ClaRel_DELETE") == 1)
     {
         this.lstCando.Add(this.D_DEL_TSD);
     }
     if (PLGrantPerm.CanDoClassOperation(ClientData.LogonUser.Oid, "DQDOSSIERPRINT", Guid.Empty, "ClaRel_CHECKIN") == 1)
     {
         this.lstCando.Add(this.D_TOPRINT_TSD);
     }
     if (PLGrantPerm.CanDoClassOperation(ClientData.LogonUser.Oid, "DQDOSSIERPRINT", Guid.Empty, "ClaRel_RELEASE") == 1)
     {
         this.lstCando.Add(this.D_TOSENT_TSD);
     }
 }
Ejemplo n.º 3
0
 private void NodeClear(TreeNode node)
 {
     if (node.Nodes.Count != 0)
     {
         for (int i = 0; i < node.Nodes.Count; i++)
         {
             TreeNode    node2 = node.Nodes[i];
             DEMetaClass tag   = node2.Tag as DEMetaClass;
             if (tag != null)
             {
                 this.NodeClear(node2);
                 if ((node2.Nodes.Count == 0) && ((!tag.IsSearchable || !ModelContext.MetaModel.IsVisibleCustomizedClass(tag.Name)) || (tag.IsGrantable && (PLGrantPerm.CanDoClassOperation(ClientData.LogonUser.Oid, tag.Name, Guid.Empty, "ClaRel_SEARCH") != 1))))
                 {
                     node.Nodes.Remove(node2);
                     i--;
                 }
             }
         }
     }
 }
Ejemplo n.º 4
0
 public UCSelectClassPLM(bool IsQuickSch, bool leafClassOnly, SelectClassConstraint constraint) : this()
 {
     this.ucClassTree = new UCClassTree(null, leafClassOnly, constraint);
     this.ucClassTree.ClassTree.Nodes.RemoveByKey("资源");
     this.ucClassTree.ClassTree.Nodes.RemoveByKey("业务状态");
     for (int i = 0; i < this.ucClassTree.ClassTree.Nodes.Count; i++)
     {
         TreeNode    node = this.ucClassTree.ClassTree.Nodes[i];
         DEMetaClass tag  = node.Tag as DEMetaClass;
         if (tag != null)
         {
             if (tag.Name == "RESOURCE")
             {
                 this.ucClassTree.ClassTree.Nodes.Remove(node);
                 i--;
             }
             else
             {
                 this.NodeClear(node);
                 if ((node.Nodes.Count == 0) && ((!tag.IsSearchable || !ModelContext.MetaModel.IsVisibleCustomizedClass(tag.Name)) || (tag.IsGrantable && (PLGrantPerm.CanDoClassOperation(ClientData.LogonUser.Oid, tag.Name, Guid.Empty, "ClaRel_SEARCH") != 1))))
                 {
                     this.ucClassTree.ClassTree.Nodes.Remove(node);
                     i--;
                 }
             }
         }
     }
     this.popupContainer.Controls.Add(this.ucClassTree);
     base.Properties.PopupControl.Size = new Size(base.Width, this.ucClassTree.Height);
     this.ucClassTree.Dock             = DockStyle.Fill;
     this.handler = new SelectClassHandler(this.ucClassTree_ClassSelected);
     this.ucClassTree.ClassSelected += this.handler;
     this.handler2 = new DoubClickClassHandler(this.ucClassTree_DoubleClikedcls);
     this.ucClassTree.DoubClicked += this.handler2;
 }
Ejemplo n.º 5
0
        public UCSelectClass(bool IsQuickSch, bool leafClassOnly, SelectClassConstraint constraint)
            : this()
        {
            this.ucClassTree = new UCClassTree(null, leafClassOnly, constraint);
            this.ucClassTree.ClassTree.Nodes.RemoveByKey("资源");
            this.ucClassTree.ClassTree.Nodes.RemoveByKey("业务状态");
            for (int i = 0; i < this.ucClassTree.ClassTree.Nodes.Count; i++)
            {
                TreeNode    node = this.ucClassTree.ClassTree.Nodes[i];
                DEMetaClass tag  = node.Tag as DEMetaClass;
                if (tag != null)
                {
                    if (tag.Name == "RESOURCE")
                    {
                        this.ucClassTree.ClassTree.Nodes.Remove(node);
                        i--;
                    }
                    else
                    {
                        this.NodeClear(node);
                        if ((node.Nodes.Count == 0) && ((!tag.IsSearchable || !ModelContext.MetaModel.IsVisibleCustomizedClass(tag.Name)) || (tag.IsGrantable && (PLGrantPerm.CanDoClassOperation(ClientData.LogonUser.Oid, tag.Name, Guid.Empty, "ClaRel_SEARCH") != 1))))
                        {
                            this.ucClassTree.ClassTree.Nodes.Remove(node);
                            i--;
                        }
                    }
                }
            }
            DropDownEditorButton button = base.ButtonsRight["SelectClass"] as DropDownEditorButton;

            button.Control = this.ucClassTree;
            this.handler   = new SelectClassHandler(this.ucClassTree_ClassSelected);
            this.ucClassTree.ClassSelected += this.handler;
            this.handler2 = new DoubClickClassHandler(this.ucClassTree_DoubleClikedcls);
            this.ucClassTree.DoubClicked += this.handler2;
        }
Ejemplo n.º 6
0
        private TreeNode CreateClassNode(Guid pOid, string parentText, string parentClass, SelectClassConstraint constraint, DEMetaClass meta)
        {
            TreeNode node  = null;
            bool     flag  = false;
            bool     flag2 = true;

            if (constraint == SelectClassConstraint.InstancableClass)
            {
                Hashtable creatableClasses = ClientData.GetCreatableClasses();
                if (creatableClasses == null)
                {
                    return(null);
                }
                flag2 = Convert.ToBoolean(creatableClasses[parentClass]);
            }
            if (pOid != Guid.Empty)
            {
                node = new TreeNode(parentClass)
                {
                    Text = parentText
                };
                node.SelectedImageIndex = node.ImageIndex = ClientData.MyImageList.GetIconIndex("ICO_DMM_CLASS");
                node.Tag = meta;
            }
            else
            {
                node = new TreeNode("");
            }
            foreach (DEMetaClass class2 in ModelContext.MetaModel.GetClasses())
            {
                if (((constraint == SelectClassConstraint.CanSchableClass) || (class2.SystemClass != 'Y')) && ModelContext.MetaModel.IsVisibleCustomizedClass(class2.Name))
                {
                    if ((constraint == SelectClassConstraint.CanSchableClass) || (constraint == SelectClassConstraint.CustomizedClasses))
                    {
                        if (!class2.IsSearchable)
                        {
                            continue;
                        }
                        try
                        {
                            if (PLGrantPerm.CanDoClassOperation(ClientData.LogonUser.Oid, class2.Name, Guid.Empty, "ClaRel_BROWSE") == 0)
                            {
                                continue;
                            }
                        }
                        catch (Exception exception)
                        {
                            PLMEventLog.WriteExceptionLog(exception);
                            continue;
                        }
                    }
                    if (((pOid == Guid.Empty) && (class2.Parent == Guid.Empty)) || ((class2.Parent == pOid) && (class2.Parent != Guid.Empty)))
                    {
                        flag = true;
                        string   label = class2.Label;
                        string   name  = class2.Name;
                        TreeNode node2 = this.CreateClassNode(class2.Oid, label, name, constraint, class2);
                        if (node2 != null)
                        {
                            node.Nodes.Add(node2);
                        }
                    }
                }
            }
            if (node == null)
            {
                return(null);
            }
            if ((node.Nodes.Count <= 0) && (((node.Nodes.Count != 0) || flag) || !flag2))
            {
                return(null);
            }
            return(node);
        }
Ejemplo n.º 7
0
        public static void ViewFile(DESecureFile file, string fileName, string className, DELProcessInfoForCLT processArgs, bool deleteAllowed, IBizItem bizItem, DEBrowser browser, bool isShowFileList)
        {
            CurViewFilePath = fileName;
            if (bizItem != null)
            {
                switch (PLGrantPerm.Agent.CanDoObjectOperation(ClientData.LogonUser.Oid, bizItem.MasterOid, bizItem.ClassName, PLGrantPerm.ToPermString(PLMBOOperation.BOView), bizItem.SecurityLevel, bizItem.Phase, bizItem.RevNum))
                {
                case 0:
                    MessageBoxPLM.Show("您没有浏览该对象源文件的权限。", "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;

                case 2:
                    MessageBoxPLM.Show("当前对象在流程中,您没有浏览该对象源文件的权限。", "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
                if (Path.GetExtension(fileName).ToUpper() == ".GXT")
                {
                    switch (PLGrantPerm.Agent.CanDoObjectOperation(ClientData.LogonUser.Oid, bizItem.MasterOid, bizItem.ClassName, PLGrantPerm.ToPermString(PLMBOOperation.BODownload), bizItem.SecurityLevel, bizItem.Phase, bizItem.RevNum))
                    {
                    case 0:
                        MessageBoxPLM.Show("您没有下载该对象源文件的权限。", "编辑源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;

                    case 2:
                        MessageBoxPLM.Show("当前对象在流程中,您没有下载该对象源文件的权限。", "编辑源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                }
            }
            FileBrowseWay      innerBrowser = FileBrowseWay.InnerBrowser;
            string             title        = "文件浏览";
            BrowserDisplayRule rule         = null;

            if (Path.GetExtension(fileName).ToUpper() == ".GXT")
            {
                rule = new BrowserDisplayRule {
                    IsEdit      = IsEditGxt,
                    OnlyBrowser = IsOnlyBrowser
                };
                if (IsEditGxt)
                {
                    title = "文件编辑";
                }
                rule.Item     = bizItem as DEBusinessItem;
                IsEditGxt     = false;
                IsOnlyBrowser = false;
            }
            try
            {
                if (browser == null)
                {
                    innerBrowser = UIBrowser.GetBrowser(file.FileOid, fileName, file.FileType, out browser);
                }
                else
                {
                    innerBrowser = browser.IsInnerBrowser ? FileBrowseWay.InnerBrowser : FileBrowseWay.OpenProcess;
                }
            }
            catch (Exception exception)
            {
                PrintException.Print(exception, title);
                return;
            }
            if (innerBrowser == FileBrowseWay.InnerBrowser)
            {
                FrmViewFile file2 = null;
                Form        form  = FormManager.GetForm(PLMFormType.ViewFile, file.FileOid);
                if ((form != null) && (form is FrmViewFile))
                {
                    file2 = (FrmViewFile)form;
                    if (bizItem != null)
                    {
                        file2.Text = bizItem.Id + "[" + ModelContext.MetaModel.GetClassLabel(bizItem.ClassName) + "] - " + title;
                        file2.SetStatusText(GetSecureFile(bizItem, file.FileOid));
                    }
                    else
                    {
                        file2.Text = Path.GetFileName(fileName) + " - " + title;
                    }
                }
                else
                {
                    try
                    {
                        file2 = new FrmViewFile();
                        if (bizItem != null)
                        {
                            file2.Text = bizItem.Id + "[" + ModelContext.MetaModel.GetClassLabel(bizItem.ClassName) + "] - " + title;
                            file2.SetStatusText(GetSecureFile(bizItem, file.FileOid));
                        }
                        else
                        {
                            file2.Text = Path.GetFileName(fileName) + " - " + title;
                        }
                    }
                    catch (Exception exception2)
                    {
                        PrintException.Print(exception2, MessageBoxIcon.Exclamation);
                        return;
                    }
                    file2.SetManaged(PLMFormType.ViewFile, file.FileOid);
                }
                file2.SetInput(bizItem, file, isShowFileList, processArgs, className);
                file2.Show();
                file2.Activate();
                string deleteFilePath = null;
                if (deleteAllowed)
                {
                    deleteFilePath = Path.GetDirectoryName(fileName);
                }
                UIBrowser.OpenFileWithBrowser(file.FileOid, fileName, file2.panelBrowser, innerBrowser, browser, deleteFilePath, rule, bizItem);
            }
            else
            {
                UIBrowser.OpenFileWithBrowser(file.FileOid, fileName, null, innerBrowser, browser, Path.GetDirectoryName(fileName), bizItem);
            }
        }
Ejemplo n.º 8
0
        private void combFiles_SelectedIndexChanged(object sender, EventArgs e)
        {
            DESecureFile  selectedItem;
            string        str;
            bool          flag;
            FileBrowseWay way;

            if (this.combFiles.SelectedItem != null)
            {
                if (this.IsMarkUpMode)
                {
                    MessageBox.Show("当前文件处于批注状态,请先保存批注或者退出批注状态再操作!", "提示");
                    this.combFiles.SelectedIndexChanged -= new EventHandler(this.combFiles_SelectedIndexChanged);
                    this.combFiles.SelectedIndex         = this.LastSelectedIndex;
                    this.combFiles.SelectedIndexChanged += new EventHandler(this.combFiles_SelectedIndexChanged);
                    return;
                }
                if (this._bizItem == null)
                {
                    return;
                }
                selectedItem           = this.combFiles.SelectedItem as DESecureFile;
                this.LastSelectedIndex = this.combFiles.SelectedIndex;
                if (this._bizItem.FileList.GetFileByFileOid(selectedItem.FileOid) == null)
                {
                    return;
                }
                if (Path.GetExtension(selectedItem.FileName).ToUpper() == ".GXT")
                {
                    switch (PLGrantPerm.Agent.CanDoObjectOperation(ClientData.LogonUser.Oid, this._bizItem.MasterOid, this._bizItem.ClassName, PLGrantPerm.ToPermString(PLMBOOperation.BODownload), this._bizItem.SecurityLevel, this._bizItem.Phase, this._bizItem.RevNum))
                    {
                    case 0:
                        MessageBoxPLM.Show("您没有下载该对象源文件的权限。", "编辑源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;

                    case 2:
                        MessageBoxPLM.Show("当前对象在流程中,您没有下载该对象源文件的权限。", "编辑源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                }
                DESecureFile relationFileForBrowse = ViewFileHelper.GetRelationFileForBrowse(this._bizItem.Iteration, selectedItem);
                if (relationFileForBrowse != null)
                {
                    selectedItem = relationFileForBrowse;
                }
                ArrayList files = PLFileService.Agent.GetFiles(selectedItem.FileOid);
                if ((files != null) && (files.Count > 0))
                {
                    DEFile file3 = files[0] as DEFile;
                    if (file3 != null)
                    {
                        int num2 = Convert.ToInt32((long)(file3.OriginalSize / 0x100000L));
                        if ((num2 > 50) && (MessageBoxPLM.Show("您当前要浏览的源文件为" + num2.ToString() + "M,浏览会花费较长时间,您确认要继续吗?", "浏览源文件", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) == DialogResult.Cancel))
                        {
                            return;
                        }
                    }
                }
                str = string.Empty;
                string path = string.Empty;
                flag = false;
                if (FileEvent.fileOperEvent != null)
                {
                    FileEvent.fileOperEvent(OperEventType.Before, "ClaRel_BROWSE", selectedItem.FileOid);
                }
                bool editable = this._bizItem.CanEdit(ClientData.LogonUser.Oid);
                if (!selectedItem.InLocalHost)
                {
                    try
                    {
                        str = ViewFileHelper.DownloadFileByDir(this._bizItem.Iteration, selectedItem, null, ClientData.UserGlobalOption, false, true, "ClaRel_BROWSE");
                    }
                    catch (Exception exception4)
                    {
                        if (editable)
                        {
                            MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:" + exception4.Message, "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        else
                        {
                            MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:" + exception4.Message, "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        return;
                    }
                    switch (str)
                    {
                    case null:
                    case "":
                        return;
                    }
                    if (!File.Exists(str))
                    {
                        MessageBoxPLM.Show("指定的文件索引不存在,可能是文件没有正确上载。", "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                    flag = true;
                    goto Label_04DE;
                }
                if (selectedItem.InCurrentHost)
                {
                    path = selectedItem.Location;
                    str  = selectedItem.Location + @"\" + selectedItem.FileName;
                    if (!File.Exists(str))
                    {
                        if (DialogResult.Yes == MessageBoxPLM.Show("在指定路径下没有找到该文件,无法浏览!可能是文件路径发生变化,或已被删除。是否尝试从服务器获取文件?", "浏览源文件", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
                        {
                            try
                            {
                                ViewFileHelper.DownLoadFile(this._bizItem.Iteration, selectedItem, path, ClientData.UserGlobalOption, editable, "ClaRel_BROWSE", this._bizItem);
                                goto Label_04DE;
                            }
                            catch (Exception exception)
                            {
                                if (editable)
                                {
                                    MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:" + exception.Message, "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                }
                                else
                                {
                                    MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:" + exception.Message, "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                }
                            }
                        }
                        return;
                    }
                    try
                    {
                        if (ClientData.LogonUser.Oid != selectedItem.UserOid)
                        {
                            str = ViewFileHelper.DownLoadFile(this._bizItem.Iteration, selectedItem, null, ClientData.UserGlobalOption, true, "ClaRel_BROWSE", this._bizItem);
                        }
                        if (!File.Exists(str))
                        {
                            MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:源文件未上载", "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            return;
                        }
                        goto Label_04DE;
                    }
                    catch (Exception exception2)
                    {
                        if (editable)
                        {
                            MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:" + exception2.Message, "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        else
                        {
                            MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:" + exception2.Message, "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        return;
                    }
                }
                if (DialogResult.Yes == MessageBoxPLM.Show("文件存在于他人机器上。是否尝试从服务器获取文件?", "浏览源文件", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
                {
                    try
                    {
                        str = ViewFileHelper.DownLoadFile(this._bizItem.Iteration, selectedItem, null, ClientData.UserGlobalOption, editable, "ClaRel_BROWSE", this._bizItem);
                        if (str == null)
                        {
                            MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:文件未上载", "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            return;
                        }
                        goto Label_04DE;
                    }
                    catch (Exception exception3)
                    {
                        if (editable)
                        {
                            MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:" + exception3.Message, "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        else
                        {
                            MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:" + exception3.Message, "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        return;
                    }
                }
            }
            return;

Label_04DE:
            way = FileBrowseWay.InnerBrowser;
            string             title = "文件浏览";
            BrowserDisplayRule rule  = null;

            if (Path.GetExtension(str).ToUpper() == ".GXT")
            {
                rule = new BrowserDisplayRule {
                    IsEdit      = IsEditGxt,
                    OnlyBrowser = IsOnlyBrowser
                };
                if (IsEditGxt)
                {
                    title = "文件编辑";
                }
                rule.Item     = this._bizItem;
                IsEditGxt     = false;
                IsOnlyBrowser = false;
            }
            DEBrowser browser = null;

            try
            {
                way = UIBrowser.GetBrowser(selectedItem.FileOid, str, selectedItem.FileType, out browser);
            }
            catch (Exception exception5)
            {
                PrintException.Print(exception5, title);
                return;
            }
            if (way == FileBrowseWay.InnerBrowser)
            {
                string deleteFilePath = null;
                if (flag)
                {
                    deleteFilePath = Path.GetDirectoryName(str);
                }
                UIBrowser.OpenFileWithBrowser(selectedItem.FileOid, str, this.panelBrowser, way, browser, deleteFilePath, rule, this._bizItem);
            }
            else
            {
                UIBrowser.OpenFileWithBrowser(selectedItem.FileOid, str, null, way, browser, Path.GetDirectoryName(str), this._bizItem);
            }
        }
Ejemplo n.º 9
0
        public void UpdateUI(DEBusinessItem item, DEMetaClassEx meta, Guid uOid, bool readOnly)
        {
            this.Item = item;
            if (meta != null)
            {
                this.meta = meta;
            }
            this.uOid = uOid;
            this.Text = "编辑对象" + item.Master.Id;
            int y      = 20;
            int x      = 20;
            int num3   = 150;
            int num4   = 50;
            int height = 30;
            int width  = 100;
            int num7   = 150;

            this.pnlProperty.Controls.Clear();
            foreach (DEMetaAttribute attribute in this.meta.Attributes)
            {
                if (attribute.IsViewable)
                {
                    Label label = new Label {
                        Location = new Point(x, y + 5),
                        Size     = new Size(width, height),
                        Text     = attribute.Label + ":"
                    };
                    TextBox  box   = null;
                    ResCombo combo = null;
                    if (!readOnly)
                    {
                        if (attribute.LinkedResClass != Guid.Empty)
                        {
                            combo = new ResCombo(ModelContext.MetaModel.GetClass(attribute.LinkedResClass).Name, attribute);
                        }
                        else
                        {
                            box = new TextBox();
                        }
                    }
                    else
                    {
                        box = new TextBox();
                    }
                    if (!attribute.IsEditable || (PLGrantPerm.CanDoClassAttribute(ClientData.LogonUser.Oid, item.Master.ClassName, attribute.Name, item) == 1))
                    {
                        if (box != null)
                        {
                            box.ReadOnly = true;
                        }
                        else if (combo != null)
                        {
                            combo.readOnly = true;
                        }
                    }
                    if (readOnly)
                    {
                        if (box != null)
                        {
                            box.ReadOnly = true;
                        }
                        else if (combo != null)
                        {
                            combo.readOnly = true;
                        }
                    }
                    if (box != null)
                    {
                        box.Location = new Point(num3, y);
                        box.Size     = new Size(num7, height);
                        box.Tag      = attribute;
                    }
                    else if (combo != null)
                    {
                        combo.Location = new Point(num3, y);
                        combo.Size     = new Size(num7, height);
                        combo.Tag      = attribute;
                    }
                    object attrValue = this.Item.Iteration.GetAttrValue(attribute.Name);
                    if (box != null)
                    {
                        if (attrValue is Guid)
                        {
                            box.Text = PrincipalRepository.GetPrincipalName((Guid)attrValue);
                        }
                        else
                        {
                            box.Text = PSConvert.Attribute2String(attrValue, attribute);
                        }
                    }
                    else if (combo != null)
                    {
                        if ((attribute.LinkType == 0) && (attribute.DataType == 8))
                        {
                            if (attrValue == null)
                            {
                                combo.ResValue = "";
                            }
                            else
                            {
                                combo.ResValue = combo.GetResourceID(new Guid((byte[])attrValue), ModelContext.MetaModel.GetClass(attribute.LinkedResClass).Name);
                            }
                        }
                        else
                        {
                            combo.ResValue = PSConvert.Attribute2String(attrValue, attribute);
                        }
                    }
                    this.pnlProperty.Controls.Add(label);
                    if (box != null)
                    {
                        this.pnlProperty.Controls.Add(box);
                    }
                    else if (combo != null)
                    {
                        this.pnlProperty.Controls.Add(combo);
                    }
                    y += num4;
                }
            }
        }