diff --git a/XrmToolBox/Forms/OptionsDialog.Designer.cs b/XrmToolBox/Forms/OptionsDialog.Designer.cs index e57aa73c..84e46ea4 100644 --- a/XrmToolBox/Forms/OptionsDialog.Designer.cs +++ b/XrmToolBox/Forms/OptionsDialog.Designer.cs @@ -67,16 +67,16 @@ private void InitializeComponent() this.chAssembly = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.chVersion = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.tbAppProtocol = new System.Windows.Forms.TabPage(); + this.panel4 = new System.Windows.Forms.Panel(); this.pnlAppProtocolButton = new System.Windows.Forms.Panel(); this.btnAppProtocol = new System.Windows.Forms.Button(); + this.pnlAppProtocolPath = new System.Windows.Forms.Panel(); + this.lblAppProtocolPath = new System.Windows.Forms.Label(); this.pnlAppProtocolStatus = new System.Windows.Forms.Panel(); this.lblAppProtocolStatus = new System.Windows.Forms.Label(); this.pnlAppProtocolTop = new System.Windows.Forms.Panel(); this.lblAppProtocolSummary = new System.Windows.Forms.Label(); - this.panel4 = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); - this.txtAppProtocolPath = new System.Windows.Forms.TextBox(); - this.pnlAppProtocolPath = new System.Windows.Forms.Panel(); + this.llProtocolDoc = new System.Windows.Forms.LinkLabel(); this.panel1.SuspendLayout(); this.pnlHeader.SuspendLayout(); this.tabControl1.SuspendLayout(); @@ -89,11 +89,11 @@ private void InitializeComponent() this.tbDataCollect.SuspendLayout(); this.tpAssemblies.SuspendLayout(); this.tbAppProtocol.SuspendLayout(); + this.panel4.SuspendLayout(); this.pnlAppProtocolButton.SuspendLayout(); + this.pnlAppProtocolPath.SuspendLayout(); this.pnlAppProtocolStatus.SuspendLayout(); this.pnlAppProtocolTop.SuspendLayout(); - this.panel4.SuspendLayout(); - this.pnlAppProtocolPath.SuspendLayout(); this.SuspendLayout(); // // panel1 @@ -520,14 +520,24 @@ private void InitializeComponent() this.tbAppProtocol.Text = "Application protocol"; this.tbAppProtocol.UseVisualStyleBackColor = true; // + // panel4 + // + this.panel4.Controls.Add(this.llProtocolDoc); + this.panel4.Dock = System.Windows.Forms.DockStyle.Top; + this.panel4.Location = new System.Drawing.Point(3, 325); + this.panel4.Name = "panel4"; + this.panel4.Padding = new System.Windows.Forms.Padding(10); + this.panel4.Size = new System.Drawing.Size(846, 259); + this.panel4.TabIndex = 3; + // // pnlAppProtocolButton // this.pnlAppProtocolButton.Controls.Add(this.btnAppProtocol); this.pnlAppProtocolButton.Dock = System.Windows.Forms.DockStyle.Top; - this.pnlAppProtocolButton.Location = new System.Drawing.Point(3, 181); + this.pnlAppProtocolButton.Location = new System.Drawing.Point(3, 177); this.pnlAppProtocolButton.Name = "pnlAppProtocolButton"; this.pnlAppProtocolButton.Padding = new System.Windows.Forms.Padding(40); - this.pnlAppProtocolButton.Size = new System.Drawing.Size(846, 150); + this.pnlAppProtocolButton.Size = new System.Drawing.Size(846, 148); this.pnlAppProtocolButton.TabIndex = 2; // // btnAppProtocol @@ -535,12 +545,31 @@ private void InitializeComponent() this.btnAppProtocol.Dock = System.Windows.Forms.DockStyle.Fill; this.btnAppProtocol.Location = new System.Drawing.Point(40, 40); this.btnAppProtocol.Name = "btnAppProtocol"; - this.btnAppProtocol.Size = new System.Drawing.Size(766, 70); + this.btnAppProtocol.Size = new System.Drawing.Size(766, 68); this.btnAppProtocol.TabIndex = 0; this.btnAppProtocol.Text = "Enable"; this.btnAppProtocol.UseVisualStyleBackColor = true; this.btnAppProtocol.Click += new System.EventHandler(this.btnAppProtocol_Click); // + // pnlAppProtocolPath + // + this.pnlAppProtocolPath.Controls.Add(this.lblAppProtocolPath); + this.pnlAppProtocolPath.Dock = System.Windows.Forms.DockStyle.Top; + this.pnlAppProtocolPath.Location = new System.Drawing.Point(3, 151); + this.pnlAppProtocolPath.Name = "pnlAppProtocolPath"; + this.pnlAppProtocolPath.Padding = new System.Windows.Forms.Padding(27, 4, 27, 4); + this.pnlAppProtocolPath.Size = new System.Drawing.Size(846, 26); + this.pnlAppProtocolPath.TabIndex = 4; + // + // lblAppProtocolPath + // + this.lblAppProtocolPath.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblAppProtocolPath.Location = new System.Drawing.Point(27, 4); + this.lblAppProtocolPath.Name = "lblAppProtocolPath"; + this.lblAppProtocolPath.Size = new System.Drawing.Size(792, 18); + this.lblAppProtocolPath.TabIndex = 1; + this.lblAppProtocolPath.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // pnlAppProtocolStatus // this.pnlAppProtocolStatus.Controls.Add(this.lblAppProtocolStatus); @@ -557,7 +586,7 @@ private void InitializeComponent() this.lblAppProtocolStatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblAppProtocolStatus.Location = new System.Drawing.Point(10, 10); this.lblAppProtocolStatus.Name = "lblAppProtocolStatus"; - this.lblAppProtocolStatus.Size = new System.Drawing.Size(826, 54); + this.lblAppProtocolStatus.Size = new System.Drawing.Size(826, 34); this.lblAppProtocolStatus.TabIndex = 0; this.lblAppProtocolStatus.Tag = "Current Status : {0}"; this.lblAppProtocolStatus.Text = "Current Status"; @@ -582,45 +611,17 @@ private void InitializeComponent() this.lblAppProtocolSummary.TabIndex = 0; this.lblAppProtocolSummary.Text = resources.GetString("lblAppProtocolSummary.Text"); // - // panel4 - // - this.panel4.Controls.Add(this.label1); - this.panel4.Dock = System.Windows.Forms.DockStyle.Top; - this.panel4.Location = new System.Drawing.Point(3, 331); - this.panel4.Name = "panel4"; - this.panel4.Padding = new System.Windows.Forms.Padding(10); - this.panel4.Size = new System.Drawing.Size(846, 259); - this.panel4.TabIndex = 3; - // - // label1 - // - this.label1.Dock = System.Windows.Forms.DockStyle.Top; - this.label1.Location = new System.Drawing.Point(10, 10); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(826, 255); - this.label1.TabIndex = 0; - this.label1.Text = resources.GetString("label1.Text"); - // - // txtAppProtocolPath + // llProtocolDoc // - this.txtAppProtocolPath.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.txtAppProtocolPath.Dock = System.Windows.Forms.DockStyle.Fill; - this.txtAppProtocolPath.Location = new System.Drawing.Point(27, 4); - this.txtAppProtocolPath.Name = "txtAppProtocolPath"; - this.txtAppProtocolPath.ReadOnly = true; - this.txtAppProtocolPath.Size = new System.Drawing.Size(507, 18); - this.txtAppProtocolPath.TabIndex = 1; - this.txtAppProtocolPath.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // pnlAppProtocolPath - // - this.pnlAppProtocolPath.Controls.Add(this.txtAppProtocolPath); - this.pnlAppProtocolPath.Dock = System.Windows.Forms.DockStyle.Top; - this.pnlAppProtocolPath.Location = new System.Drawing.Point(2, 118); - this.pnlAppProtocolPath.Name = "pnlAppProtocolPath"; - this.pnlAppProtocolPath.Padding = new System.Windows.Forms.Padding(27, 4, 27, 4); - this.pnlAppProtocolPath.Size = new System.Drawing.Size(561, 26); - this.pnlAppProtocolPath.TabIndex = 4; + this.llProtocolDoc.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.llProtocolDoc.AutoSize = true; + this.llProtocolDoc.Location = new System.Drawing.Point(280, 229); + this.llProtocolDoc.Name = "llProtocolDoc"; + this.llProtocolDoc.Size = new System.Drawing.Size(556, 20); + this.llProtocolDoc.TabIndex = 0; + this.llProtocolDoc.TabStop = true; + this.llProtocolDoc.Text = "Click here to read documentation about how to implement application protocol"; + this.llProtocolDoc.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llProtocolDoc_LinkClicked); // // OptionsDialog // @@ -655,12 +656,12 @@ private void InitializeComponent() this.tbDataCollect.PerformLayout(); this.tpAssemblies.ResumeLayout(false); this.tbAppProtocol.ResumeLayout(false); + this.panel4.ResumeLayout(false); + this.panel4.PerformLayout(); this.pnlAppProtocolButton.ResumeLayout(false); + this.pnlAppProtocolPath.ResumeLayout(false); this.pnlAppProtocolStatus.ResumeLayout(false); this.pnlAppProtocolTop.ResumeLayout(false); - this.panel4.ResumeLayout(false); - this.pnlAppProtocolPath.ResumeLayout(false); - this.pnlAppProtocolPath.PerformLayout(); this.ResumeLayout(false); } @@ -712,8 +713,8 @@ private void InitializeComponent() private System.Windows.Forms.Panel pnlAppProtocolButton; private System.Windows.Forms.Button btnAppProtocol; private System.Windows.Forms.Panel panel4; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.TextBox txtAppProtocolPath; + private System.Windows.Forms.Label lblAppProtocolPath; private System.Windows.Forms.Panel pnlAppProtocolPath; + private System.Windows.Forms.LinkLabel llProtocolDoc; } } \ No newline at end of file diff --git a/XrmToolBox/Forms/OptionsDialog.cs b/XrmToolBox/Forms/OptionsDialog.cs index a9aa08e1..23741cd0 100644 --- a/XrmToolBox/Forms/OptionsDialog.cs +++ b/XrmToolBox/Forms/OptionsDialog.cs @@ -31,6 +31,15 @@ public OptionsDialog(Options option) public Options Option { get; private set; } + private static string assemblyPrioritizer(string assemblyName) + { + return + assemblyName.Equals("XrmToolBox") ? "AAAAAAAAAAAA" : + assemblyName.Contains("XrmToolBox") ? "AAAAAAAAAAAB" : + assemblyName.Equals(Assembly.GetExecutingAssembly().GetName().Name) ? "AAAAAAAAAAAC" : + assemblyName; + } + private void btnAppProtocol_Click(object sender, EventArgs e) { try @@ -124,35 +133,8 @@ private void CheckAppProtocolStatus() btnAppProtocol.Text = isEnabled ? "Disable" : "Enable"; - txtAppProtocolPath.Text = protocolPath; - txtAppProtocolPath.Visible = isEnabled; - } - - private void llOpenRootFolder_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - Process.Start(new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName); - } - - private void llOpenStorageFolder_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - Process.Start(Paths.XrmToolBoxPath); - } - - private void rbCustomAuthYes_CheckedChanged(object sender, EventArgs e) - { - txtProxyPassword.Enabled = rbCustomAuthYes.Checked; - txtProxyUser.Enabled = rbCustomAuthYes.Checked; - } - - #region Assembly - - private static string assemblyPrioritizer(string assemblyName) - { - return - assemblyName.Equals("XrmToolBox") ? "AAAAAAAAAAAA" : - assemblyName.Contains("XrmToolBox") ? "AAAAAAAAAAAB" : - assemblyName.Equals(Assembly.GetExecutingAssembly().GetName().Name) ? "AAAAAAAAAAAC" : - assemblyName; + lblAppProtocolPath.Text = protocolPath; + lblAppProtocolPath.Visible = isEnabled; } private ListViewItem GetListItem(AssemblyName a) @@ -174,6 +156,21 @@ private List GetReferencedAssemblies() return names; } + private void llOpenRootFolder_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + Process.Start(new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName); + } + + private void llOpenStorageFolder_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + Process.Start(Paths.XrmToolBoxPath); + } + + private void llProtocolDoc_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + Process.Start("https://www.xrmtoolbox.com/documentation/for-developers/implement-application-protocol/"); + } + private void PopulateAssemblies() { var assemblies = GetReferencedAssemblies(); @@ -182,6 +179,10 @@ private void PopulateAssemblies() lvAssemblies.Items.AddRange(items); } - #endregion Assembly + private void rbCustomAuthYes_CheckedChanged(object sender, EventArgs e) + { + txtProxyPassword.Enabled = rbCustomAuthYes.Checked; + txtProxyUser.Enabled = rbCustomAuthYes.Checked; + } } } \ No newline at end of file diff --git a/XrmToolBox/Forms/OptionsDialog.resx b/XrmToolBox/Forms/OptionsDialog.resx index 5549e6ec..e5fe548a 100644 --- a/XrmToolBox/Forms/OptionsDialog.resx +++ b/XrmToolBox/Forms/OptionsDialog.resx @@ -139,16 +139,6 @@ We collect only the following information: Therefore, the following url is used to send data : https://dc.services.visualstudio.com/v2/track - - - Use the following example to put a link to open XrmToolBox through application protocol - -<html> -<a href="xrmtoolbox:%2Fplugin%3A%22View%20Layout%20Replicator%22%20%2Fconnection%3A%22DEMO%22">Click here</a> -</html> - -where the url encoded content (after xrmtoolbox:) must be: -/plugin:"Name of the tool" /connection:"Name of the connection" Application protocol allows to open XrmToolBox with a specific connection for a specific tool. This integration is made through a registry key declaration. To enable the application protocol, use buttons below.