Example #1
0
        /// <summary>
        /// 刷新参数面板
        /// </summary>
        /// <param name="protoType"></param>
        public void ReflushParamsView(Type protoType)
        {
            if (protoType == null)
            {
                return;
            }

            curProtoType = protoType;

            PropertyInfo[] properties = protoType.GetProperties();

            SkinFlowLayoutPanel parentPanel = this.mainForm.ParamFlowPanel;

            parentPanel.Controls.Clear();


            foreach (PropertyInfo propertyInfo in properties)
            {
                ParamItem item = new ParamItem(parentPanel);

                if (!propertyInfo.PropertyType.Name.StartsWith("Nullable"))
                {
                    item.ParamName.Text  = propertyInfo.Name + " *";
                    item.ParamsType.Text = propertyInfo.PropertyType.Name;
                }
                else
                {
                    item.ParamName.Text = propertyInfo.Name;

                    string fullProperty = propertyInfo.PropertyType.FullName;
                    int    index        = fullProperty.IndexOf("[[");
                    int    lastIndex    = fullProperty.IndexOf(",");
                    fullProperty = fullProperty.Substring(index + 1, lastIndex - index - 1);
                    string propertyTypeName = fullProperty.Substring(fullProperty.IndexOf(".") + 1);
                    item.ParamsType.Text = propertyTypeName;
                }
            }
            parentPanel.ResumeLayout(false);
        }
Example #2
0
 public ParamItem(SkinFlowLayoutPanel parentPanel)
 {
     this.initComponent(parentPanel);
 }
Example #3
0
        private void initComponent(SkinFlowLayoutPanel parentPanel)
        {
            this.paramsItem = new SkinPanel();
            this.paramsItem.SuspendLayout();

            //
            // paramsType
            //
            this.paramsType = new SkinLabel();
            this.paramsType.ArtTextStyle = CCWin.SkinControl.ArtTextStyle.None;
            this.paramsType.AutoSize     = false;
            this.paramsType.RightToLeft  = System.Windows.Forms.RightToLeft.No;
            this.paramsType.BackColor    = System.Drawing.Color.Transparent;
            this.paramsType.BorderColor  = System.Drawing.Color.White;
            this.paramsType.Font         = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.paramsType.ForeColor    = System.Drawing.SystemColors.ActiveBorder;
            this.paramsType.Location     = new System.Drawing.Point(105, 2);
            this.paramsType.Name         = "paramsType";
            this.paramsType.Size         = new System.Drawing.Size(56, 17);
            this.paramsType.TabIndex     = 5;
            this.paramsType.Anchor       = AnchorStyles.Right;
            this.paramsType.TextAlign    = ContentAlignment.MiddleRight;
            this.paramsType.Text         = "类型";
            //
            // skinLabel3
            //
            this.paramName = new SkinLabel();
            this.paramName.ArtTextStyle = CCWin.SkinControl.ArtTextStyle.None;
            this.paramName.AutoSize     = true;
            this.paramName.BackColor    = System.Drawing.Color.Transparent;
            this.paramName.BorderColor  = System.Drawing.Color.Transparent;
            this.paramName.Font         = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.paramName.ForeColor    = System.Drawing.SystemColors.ActiveBorder;
            this.paramName.Location     = new System.Drawing.Point(3, 2);
            this.paramName.Name         = "skinLabel3";
            this.paramName.Size         = new System.Drawing.Size(39, 17);
            this.paramName.TabIndex     = 2;
            this.paramName.Text         = "参数1";

            this.paramInputText                      = new SkinTextBox();
            this.paramInputText.BackColor            = System.Drawing.Color.Transparent;
            this.paramInputText.DownBack             = null;
            this.paramInputText.Icon                 = null;
            this.paramInputText.IconIsButton         = false;
            this.paramInputText.IconMouseState       = CCWin.SkinClass.ControlState.Normal;
            this.paramInputText.IsPasswordChat       = '\0';
            this.paramInputText.IsSystemPasswordChar = false;
            this.paramInputText.Lines                = new string[0];
            this.paramInputText.Location             = new System.Drawing.Point(16, 22);
            this.paramInputText.Margin               = new System.Windows.Forms.Padding(0);
            this.paramInputText.MaxLength            = 32767;
            this.paramInputText.MinimumSize          = new System.Drawing.Size(28, 28);
            this.paramInputText.MouseBack            = null;
            this.paramInputText.MouseState           = CCWin.SkinClass.ControlState.Normal;
            this.paramInputText.Multiline            = false;
            this.paramInputText.Name                 = "paramInputText";
            this.paramInputText.NormlBack            = null;
            this.paramInputText.Padding              = new System.Windows.Forms.Padding(5);
            this.paramInputText.ReadOnly             = false;
            this.paramInputText.ScrollBars           = System.Windows.Forms.ScrollBars.None;
            this.paramInputText.Size                 = new System.Drawing.Size(142, 28);
            //
            //
            //
            this.paramInputText.SkinTxt.BackColor   = System.Drawing.SystemColors.ActiveBorder;
            this.paramInputText.SkinTxt.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.paramInputText.SkinTxt.Dock        = System.Windows.Forms.DockStyle.Fill;
            this.paramInputText.SkinTxt.Font        = new System.Drawing.Font("微软雅黑", 9.75F);
            this.paramInputText.SkinTxt.Location    = new System.Drawing.Point(5, 5);
            this.paramInputText.SkinTxt.Name        = "BaseText";
            this.paramInputText.SkinTxt.Size        = new System.Drawing.Size(132, 18);
            this.paramInputText.SkinTxt.TabIndex    = 0;
            this.paramInputText.SkinTxt.WaterColor  = System.Drawing.SystemColors.ActiveBorder;
            this.paramInputText.SkinTxt.WaterText   = "";
            this.paramInputText.TabIndex            = 1;
            this.paramInputText.TextAlign           = System.Windows.Forms.HorizontalAlignment.Left;
            this.paramInputText.WaterColor          = System.Drawing.SystemColors.ActiveBorder;
            this.paramInputText.WaterText           = "";
            this.paramInputText.WordWrap            = true;

            this.paramsItem.BackColor = System.Drawing.Color.Transparent;
            this.paramsItem.Controls.Add(this.paramName);
            this.paramsItem.Controls.Add(this.paramsType);
            this.paramsItem.Controls.Add(this.paramInputText);
            this.paramsItem.ControlState = CCWin.SkinClass.ControlState.Normal;
            this.paramsItem.DownBack     = null;
            this.paramsItem.Location     = new System.Drawing.Point(3, 3);
            this.paramsItem.Margin       = new Padding(1);
            this.paramsItem.MouseBack    = null;
            this.paramsItem.Name         = "paramsItem";
            this.paramsItem.NormlBack    = null;
            this.paramsItem.Size         = new System.Drawing.Size(168, 55);
            this.paramsItem.TabIndex     = 10;

            parentPanel.Controls.Add(this.paramsItem);
        }
Example #4
0
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DlgBase));
     this.skinPanel1       = new CCWin.SkinControl.SkinPanel();
     this.flowLayoutBottom = new CCWin.SkinControl.SkinFlowLayoutPanel();
     this.MainPanel        = new CCWin.SkinControl.SkinPanel();
     this.skinPanel1.SuspendLayout();
     this.SuspendLayout();
     //
     // skinPanel1
     //
     this.skinPanel1.BackColor = System.Drawing.Color.Transparent;
     this.skinPanel1.Controls.Add(this.flowLayoutBottom);
     this.skinPanel1.ControlState = CCWin.SkinClass.ControlState.Normal;
     resources.ApplyResources(this.skinPanel1, "skinPanel1");
     this.skinPanel1.DownBack  = null;
     this.skinPanel1.MouseBack = null;
     this.skinPanel1.Name      = "skinPanel1";
     this.skinPanel1.NormlBack = null;
     //
     // flowLayoutBottom
     //
     this.flowLayoutBottom.BackColor    = System.Drawing.Color.Transparent;
     this.flowLayoutBottom.ControlState = CCWin.SkinClass.ControlState.Normal;
     resources.ApplyResources(this.flowLayoutBottom, "flowLayoutBottom");
     this.flowLayoutBottom.DownBack  = null;
     this.flowLayoutBottom.MouseBack = null;
     this.flowLayoutBottom.Name      = "flowLayoutBottom";
     this.flowLayoutBottom.NormlBack = null;
     this.flowLayoutBottom.Radius    = 4;
     //
     // MainPanel
     //
     this.MainPanel.BackColor    = System.Drawing.Color.Transparent;
     this.MainPanel.ControlState = CCWin.SkinClass.ControlState.Normal;
     resources.ApplyResources(this.MainPanel, "MainPanel");
     this.MainPanel.DownBack  = null;
     this.MainPanel.MouseBack = null;
     this.MainPanel.Name      = "MainPanel";
     this.MainPanel.NormlBack = null;
     this.MainPanel.Radius    = 4;
     //
     // DlgBase
     //
     resources.ApplyResources(this, "$this");
     this.BackColor              = System.Drawing.Color.White;
     this.BackRectangle          = new System.Drawing.Rectangle(2, 2, 2, 2);
     this.BorderColor            = System.Drawing.Color.Gainsboro;
     this.BorderRectangle        = new System.Drawing.Rectangle(1, 1, 1, 1);
     this.CaptionBackColorBottom = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
     this.CaptionBackColorTop    = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
     this.CaptionFont            = new System.Drawing.Font("微软雅黑", 9.2F);
     this.CaptionHeight          = 28;
     this.CloseBoxSize           = new System.Drawing.Size(45, 25);
     this.CloseNormlBack         = ((System.Drawing.Image)(resources.GetObject("$this.CloseNormlBack")));
     this.ControlBoxOffset       = new System.Drawing.Point(2, 2);
     this.Controls.Add(this.MainPanel);
     this.Controls.Add(this.skinPanel1);
     this.EffectBack       = System.Drawing.Color.WhiteSmoke;
     this.EffectWidth      = 0;
     this.ICoOffset        = new System.Drawing.Point(2, 0);
     this.IsShadowStraight = true;
     this.MdiBackColor     = System.Drawing.Color.White;
     this.MdiBorderStyle   = System.Windows.Forms.BorderStyle.None;
     this.MdiImageAlign    = System.Drawing.ContentAlignment.MiddleLeft;
     this.Name             = "DlgBase";
     this.Radius           = 0;
     this.Shadow           = true;
     this.ShadowColor      = System.Drawing.Color.Gainsboro;
     this.ShowIcon         = false;
     this.SizeGripStyle    = System.Windows.Forms.SizeGripStyle.Hide;
     this.skinPanel1.ResumeLayout(false);
     this.ResumeLayout(false);
 }