Ejemplo n.º 1
0
        void textBox_Pasting(object sender, EventArgs e)
        {
            string text = Clipboard.GetText();

            if (text.IndexOf("\n") > 0)
            {
                text = string.Join(",", text.Replace("\r", "").Split(new string[] { "\n" }, StringSplitOptions.RemoveEmptyEntries));
            }
            text = text.Replace("\n", ",");
            TextBoxWithPaste textBox = (TextBoxWithPaste)sender;

            textBox.Paste(text);
        }
Ejemplo n.º 2
0
        private Control configSearch(NodeData data)
        {
            panel1.Controls.Clear();
            buttonAccept.Tag = data;
            XmlNodeList nodes = nodeManager.InputItems(data);

            for (int i = nodes.Count - 1; i >= 0; i--)
            {
                XmlNode    node    = nodes[i];
                XmlElement element = node as XmlElement;
                Panel      panel   = new Panel();
                panel.Height   = 40;
                panel.Dock     = DockStyle.Top;
                panel.TabIndex = i;
                Label label = new Label();
                label.Bounds    = new Rectangle(0, 10, 200, 28);
                label.Text      = element.GetAttribute("prompt");
                label.Dock      = DockStyle.Left;
                label.TextAlign = ContentAlignment.TopRight;
                label.Padding   = new Padding(3, 3, 20, 3);
                TextBoxWithPaste textBox = new TextBoxWithPaste();
                textBox.Bounds      = new Rectangle(300, 10, 200, 28);
                textBox.Text        = element.GetAttribute("default");
                textBox.Dock        = DockStyle.Fill;
                textBox.MinimumSize = new System.Drawing.Size(200, 28);
                textBox.Text        = element.GetAttribute("value");
                if (data.KeyCount - data.KeyCountOriginal > i)
                {
                    textBox.Text = data.Keys[i + data.KeyCountOriginal];
                }
                textBox.Pasting += new EventHandler(textBox_Pasting);
                Label comment = new Label();
                comment.Bounds  = new Rectangle(510, 10, 500, 28);
                comment.Text    = element.GetAttribute("comment");
                comment.Dock    = DockStyle.Right;
                comment.Padding = new Padding(20, 3, 3, 3);
                panel.Controls.Add(textBox);
                panel.Controls.Add(label);
                panel.Controls.Add(comment);
                panel1.Controls.Add(panel);
            }
            return(nodes.Count == 0 ? null : panel1.Controls[panel1.Controls.Count - 1].Controls[0]);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.videoCode     = new OpenLiveWriter.Controls.TextBoxWithPaste();
     this.previewButton = new System.Windows.Forms.Button();
     this.previewBox    = new System.Windows.Forms.WebBrowser();
     this.pictureBorder = new OpenLiveWriter.ApplicationFramework.BorderControl();
     this.lblSize       = new System.Windows.Forms.Label();
     this.lblService    = new System.Windows.Forms.Label();
     this.lblVideoCode  = new System.Windows.Forms.Label();
     this.SuspendLayout();
     //
     // videoCode
     //
     this.videoCode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                   | System.Windows.Forms.AnchorStyles.Right)));
     this.videoCode.Location     = new System.Drawing.Point(8, 26);
     this.videoCode.Name         = "videoCode";
     this.videoCode.Size         = new System.Drawing.Size(185, 20);
     this.videoCode.TabIndex     = 15;
     this.videoCode.DoubleClick += new System.EventHandler(this.VideoCode_Enter);
     this.videoCode.TextChanged += new System.EventHandler(this.videoCode_TextChanged);
     this.videoCode.Enter       += new System.EventHandler(this.VideoCode_Enter);
     //
     // previewButton
     //
     this.previewButton.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.previewButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.previewButton.Location  = new System.Drawing.Point(197, 26);
     this.previewButton.Name      = "previewButton";
     this.previewButton.Size      = new System.Drawing.Size(75, 23);
     this.previewButton.TabIndex  = 16;
     this.previewButton.Text      = "&Preview";
     this.previewButton.Click    += new System.EventHandler(this._previewButton_Click);
     //
     // previewBox
     //
     this.previewBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                    | System.Windows.Forms.AnchorStyles.Right)));
     this.previewBox.Location = new System.Drawing.Point(0, 0);
     this.previewBox.Name     = "previewBox";
     this.previewBox.Size     = new System.Drawing.Size(259, 204);
     this.previewBox.TabIndex = 0;
     this.previewBox.TabStop  = false;
     //
     // pictureBorder
     //
     this.pictureBorder.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                        | System.Windows.Forms.AnchorStyles.Left)
                                                                       | System.Windows.Forms.AnchorStyles.Right)));
     this.pictureBorder.AutoHeight           = false;
     this.pictureBorder.BottomInset          = 0;
     this.pictureBorder.Control              = this.previewBox;
     this.pictureBorder.LeftInset            = 0;
     this.pictureBorder.Location             = new System.Drawing.Point(8, 50);
     this.pictureBorder.Name                 = "pictureBorder";
     this.pictureBorder.RightInset           = 0;
     this.pictureBorder.Size                 = new System.Drawing.Size(263, 208);
     this.pictureBorder.SuppressBottomBorder = false;
     this.pictureBorder.TabIndex             = 18;
     this.pictureBorder.TabStop              = false;
     this.pictureBorder.ThemeBorder          = false;
     this.pictureBorder.TopInset             = 0;
     //
     // lblSize
     //
     this.lblSize.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.lblSize.AutoSize  = true;
     this.lblSize.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.lblSize.Location  = new System.Drawing.Point(8, 262);
     this.lblSize.Name      = "lblSize";
     this.lblSize.Size      = new System.Drawing.Size(30, 13);
     this.lblSize.TabIndex  = 2;
     this.lblSize.Text      = "Size:";
     //
     // lblService
     //
     this.lblService.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.lblService.AutoSize  = true;
     this.lblService.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.lblService.Location  = new System.Drawing.Point(112, 262);
     this.lblService.Name      = "lblService";
     this.lblService.Size      = new System.Drawing.Size(46, 13);
     this.lblService.TabIndex  = 1;
     this.lblService.Text      = "Service:";
     //
     // lblVideoCode
     //
     this.lblVideoCode.Location = new System.Drawing.Point(8, 8);
     this.lblVideoCode.Name     = "lblVideoCode";
     this.lblVideoCode.Size     = new System.Drawing.Size(349, 15);
     this.lblVideoCode.TabIndex = 0;
     this.lblVideoCode.Text     = "&Video URL or Embed:";
     //
     // WebVideoSource
     //
     this.Controls.Add(this.lblVideoCode);
     this.Controls.Add(this.lblService);
     this.Controls.Add(this.lblSize);
     this.Controls.Add(this.videoCode);
     this.Controls.Add(this.previewButton);
     this.Controls.Add(this.pictureBorder);
     this.Name = "WebVideoSource";
     this.Size = new System.Drawing.Size(279, 279);
     this.ResumeLayout(false);
     this.PerformLayout();
 }