コード例 #1
0
        void m_tree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            BaseTreeNode myNode = e.Node as BaseTreeNode;

            if (myNode != null && (myNode.NodeType == TreeNodeType.TmpltFolder || myNode.NodeType == TreeNodeType.TmpltRootFolder))
            {
                OKBtn.Enabled    = true;
                nameTextBox.Text = XmlUtilService.CreateIncreaseTmpltTitle(((ElementNode)m_tree.CurrentNode).Element as FolderXmlElement, TranTmpltType);
            }
            else
            {
                OKBtn.Enabled = false;
            }
        }
コード例 #2
0
        /// <summary>
        /// 构造函数
        /// </summary>
        public NewTmpltSetupForm(FolderXmlElement parentFolder, TmpltType type)
        {
            this._parentFolder = parentFolder;
            InitializeComponent();
            PenSize     = 1;
            PenColor    = Color.Black;
            TmpltType   = type;
            _imageScale = (float)panelGraghics.Width / (float)panelGraghics.Height;

            if (_backImage != null)
            {
                textBoxWidth.Text  = _backImage.Width.ToString();
                textBoxHeight.Text = _backImage.Height.ToString();
            }

            _defaultHeight = panelGraghics.Height;
            _defaultWidth  = panelGraghics.Width;
            _pen           = new Pen(PenColor, PenSize);
            _pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;

            textBoxTitle.Text = XmlUtilService.CreateIncreaseTmpltTitle(_parentFolder, type);
            string _newTmpltIsUseImg = Service.DesignData.GetValue("NewTmpltIsUseImg");

            if (_newTmpltIsUseImg == null)
            {
                checkBoxChooseImage.Checked = true;
                Service.DesignData.SetValue("NewTmpltIsUseImg", true.ToString());
            }
            else
            {
                checkBoxChooseImage.Checked = Utility.Convert.StringToBool(_newTmpltIsUseImg);
            }

            InitEvent();
            Resetimage();
        }