コード例 #1
0
        private void ClasslifyPicture_Click(object sender, EventArgs e)
        {
            ClearLibraryDialogTab();
            PictureBox Btn     = sender as PictureBox;
            string     PathStr = Btn.Tag as string;

            //改变Classify Buttom的颜色
            this.ToggleClasslifyBtn();

            if (Directory.Exists(PathStr))
            {
                LibaryDialog ParentForm = this.FindForm() as LibaryDialog;
                if (ParentForm == null)
                {
                    return;
                }
                this.CreateTabCollection(PathStr, ParentForm.TabControl);
                TabPage page      = ParentForm.TabControl.SelectedTab;
                bool    IsSuccess = this.CreateDWGThumnailCollection(ref page);
                //这个是在知道的情况下才可以这样做因为Controls[0]是FlowPanelControl
            }
            else
            {
                MessageBox.Show(string.Format("路径{0}不存在", PathStr));
            }
        }
コード例 #2
0
        //change all the libarydialog tablelayout control to nomal style;
        //and change the current classifybtn to active style
        private void ToggleClasslifyBtn()
        {
            LibaryDialog ParentForm = this.FindForm() as LibaryDialog;

            if (ParentForm == null)
            {
                return;
            }
            TableLayoutPanel   TbLayoutControl = ParentForm.TableLayout;
            List <ClassifyBtn> Collect         = TbLayoutControl.Controls.Cast <ClassifyBtn>().ToList();

            Collect.ForEach(item => { item.ToNomalStyle(); });
            this.ToActiveStyle();
        }
コード例 #3
0
        public void DwgStdSystem()
        {
            string _Path = Properties.Settings.Default.StdSysPath;

            /*
             * string Code = GetMd5Hash(MD5.Create(), EncryString);
             * if (Properties.Settings.Default.verifycode != Code)
             * {
             *  AcadApp.DocumentManager.MdiActiveDocument.Editor.WriteMessage("未注册软件,请注册后使用");
             *  return;
             * }
             */
            if (Directory.Exists(_Path))
            {
                LibaryDialog Diag = new LibaryDialog(_Path, "中建深装-标准节点图库", LibType.SysLib);
                AcadApp.ShowModelessDialog(Diag);
            }
            else
            {
                AcadApp.ShowAlertDialog(string.Format("路径:{0}不存在,请先设置正确的图库加载路径", _Path));
            }
        }
コード例 #4
0
        private void ClearLibraryDialogTab()
        {
            LibaryDialog ParentForm = this.FindForm() as LibaryDialog;

            ParentForm.TabControl.Controls.Clear();
        }