Skip to content

Commit

Permalink
Fix MscrmTools#244 View Transfer Tool: Cannot connect to target organ…
Browse files Browse the repository at this point in the history
…ization
  • Loading branch information
MscrmTools committed Sep 22, 2015
1 parent 0ad3603 commit e1104e0
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions XrmToolBox/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private void ManageConnectionControl()
if (pluginModel == null)
{
// Actual Plugin was passed, Just update the plugin's Tab.
UpdateTabConnection((TabPage) control.Parent);
UpdateTabConnection((TabPage)control.Parent);
}
else
{
Expand Down Expand Up @@ -398,7 +398,14 @@ private void MainForm_OnCloseTool(object sender, EventArgs e)

private void MainForm_OnRequestConnection(object sender, EventArgs e)
{
ConnectUponApproval(sender);
if (e is RequestConnectionEventArgs)
{
ConnectUponApproval(e);
}
else
{
ConnectUponApproval(sender);
}
}

private void PluginClicked(object sender, EventArgs e)
Expand Down Expand Up @@ -681,17 +688,6 @@ private void ApplyConnectionToTabs()
}
}

private void UpdateTabConnection(TabPage tab)
{
tab.GetPlugin().UpdateConnection(service, currentConnectionDetail);

tab.Text = string.Format("{0} ({1})",
((Lazy<IXrmToolBoxPlugin, IPluginMetadata>) tab.Tag).Metadata.Name,
currentConnectionDetail != null
? currentConnectionDetail.ConnectionName
: "Not connected");
}

private string ExtractSwitchValue(string key, ref string[] args)
{
var name = string.Empty;
Expand All @@ -707,6 +703,17 @@ private string ExtractSwitchValue(string key, ref string[] args)
return name;
}

private void UpdateTabConnection(TabPage tab)
{
tab.GetPlugin().UpdateConnection(service, currentConnectionDetail);

tab.Text = string.Format("{0} ({1})",
((Lazy<IXrmToolBoxPlugin, IPluginMetadata>)tab.Tag).Metadata.Name,
currentConnectionDetail != null
? currentConnectionDetail.ConnectionName
: "Not connected");
}

#endregion Other methods
}
}

0 comments on commit e1104e0

Please sign in to comment.