Skip to content

Commit

Permalink
Improved UI for application protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
MscrmTools committed Jan 11, 2023
1 parent 8d2b475 commit cf1daf0
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 93 deletions.
107 changes: 54 additions & 53 deletions XrmToolBox/Forms/OptionsDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 31 additions & 30 deletions XrmToolBox/Forms/OptionsDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -174,6 +156,21 @@ private List<AssemblyName> 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();
Expand All @@ -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;
}
}
}
10 changes: 0 additions & 10 deletions XrmToolBox/Forms/OptionsDialog.resx
Original file line number Diff line number Diff line change
Expand Up @@ -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
</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Use the following example to put a link to open XrmToolBox through application protocol

&lt;html&gt;
&lt;a href="xrmtoolbox:%2Fplugin%3A%22View%20Layout%20Replicator%22%20%2Fconnection%3A%22DEMO%22"&gt;Click here&lt;/a&gt;
&lt;/html&gt;

where the url encoded content (after xrmtoolbox:) must be:
/plugin:"Name of the tool" /connection:"Name of the connection"</value>
</data>
<data name="lblAppProtocolSummary.Text" xml:space="preserve">
<value>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. </value>
Expand Down

0 comments on commit cf1daf0

Please sign in to comment.