|
|
|
@ -180,69 +180,6 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
@@ -180,69 +180,6 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public class ShowServiceInBrowser : AbstractMenuCommand |
|
|
|
|
{ |
|
|
|
|
static string NodePath = "//system.serviceModel//client//endpoint"; |
|
|
|
|
|
|
|
|
|
public override void Run() |
|
|
|
|
{ |
|
|
|
|
XmlDocument appConfig = LoadAppConfig(); |
|
|
|
|
if (appConfig != null) { |
|
|
|
|
string endpointAddress = FindEndPointAddress(appConfig); |
|
|
|
|
if (endpointAddress != null) { |
|
|
|
|
StartInternetExplorer(endpointAddress); |
|
|
|
|
} else { |
|
|
|
|
MessageService.ShowError("No service found."); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
MessageService.ShowError("No app.config file found."); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
XmlDocument LoadAppConfig() |
|
|
|
|
{ |
|
|
|
|
AbstractProjectBrowserTreeNode node = ProjectBrowserPad.Instance.SelectedNode; |
|
|
|
|
FileName appConfigFileName = CompilableProject.GetAppConfigFile(node.Project, false); |
|
|
|
|
if (!String.IsNullOrEmpty(appConfigFileName)) { |
|
|
|
|
return LoadAppConfig(appConfigFileName); |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static XmlDocument LoadAppConfig(string fileName) |
|
|
|
|
{ |
|
|
|
|
try { |
|
|
|
|
var doc = new XmlDocument(); |
|
|
|
|
doc.Load(fileName); |
|
|
|
|
return doc; |
|
|
|
|
} catch (FileNotFoundException ex) { |
|
|
|
|
LoggingService.Debug("LoadConfigDocument: " + fileName + ": " + ex.Message); |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
string FindEndPointAddress(XmlDocument appConfig) |
|
|
|
|
{ |
|
|
|
|
XmlNode endPoint = appConfig.SelectSingleNode(NodePath); |
|
|
|
|
if (endPoint != null) { |
|
|
|
|
XmlAttribute addressAttribute = endPoint.Attributes["address"]; |
|
|
|
|
if (addressAttribute != null) { |
|
|
|
|
return addressAttribute.Value; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void StartInternetExplorer(string arguments) |
|
|
|
|
{ |
|
|
|
|
var startInfo = new ProcessStartInfo("IExplore.exe") { |
|
|
|
|
WindowStyle = ProcessWindowStyle.Normal, |
|
|
|
|
Arguments = arguments |
|
|
|
|
}; |
|
|
|
|
Process.Start(startInfo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public class AddServiceReferenceToProject : AbstractMenuCommand |
|
|
|
|
{ |
|
|
|
|
public override void Run() |
|
|
|
|