本文整理汇总了C#中MainWindow.SaveAsXML方法的典型用法代码示例。如果您正苦于以下问题:C# MainWindow.SaveAsXML方法的具体用法?C# MainWindow.SaveAsXML怎么用?C# MainWindow.SaveAsXML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainWindow
的用法示例。
在下文中一共展示了MainWindow.SaveAsXML方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Application_Startup
//.........这里部分代码省略.........
initialView = MainViewType.Devices;
Log.InfoFormat("=> set initialView to {0}", initialView);
}
else if (key.Equals("MODULES"))
{
initialView = MainViewType.Modules;
Log.InfoFormat("=> set initialView to {0}", initialView);
}
else if (key.Equals("PROCESSES"))
{
initialView = MainViewType.Processes;
Log.InfoFormat("=> set initialView to {0}", initialView);
}
else if (key.Equals("UNINSTALLER"))
{
initialView = MainViewType.Uninstaller;
Log.InfoFormat("=> set initialView to {0}", initialView);
}
else if (key.Equals("WINDOWS"))
{
initialView = MainViewType.Windows;
Log.InfoFormat("=> set initialView to {0}", initialView);
}
else if (key.Equals("DUMPXML"))
{
dumpXml = true;
Log.Info("=> set dumpXml to true");
}
else if (key.Equals("CLIPBOARD"))
{
dumpXml = true;
useClipboard = true;
Log.Info("=> set dumpXml to true");
Log.Info("=> set useClipboard to true");
}
else if (key.Equals("START"))
{
ssr = new services.RequestServiceStart();
Log.InfoFormat("=> set ssr to {0}", ssr);
}
else if (key.Equals("STOP"))
{
ssr = new services.RequestServiceStop();
Log.InfoFormat("=> set ssr to {0}", ssr);
}
else if (key.Equals("RESTART"))
{
ssr = new services.RequestServiceRestart();
Log.InfoFormat("=> set ssr to {0}", ssr);
}
else if (key.Equals("PAUSE"))
{
ssr = new services.RequestServicePause();
Log.InfoFormat("=> set ssr to {0}", ssr);
}
else if (key.Equals("CONTINUE"))
{
ssr = new services.RequestServiceContinue();
Log.InfoFormat("=> set ssr to {0}", ssr);
}
}
else if( dumpXml && string.IsNullOrEmpty(dumpXmlFilename))
{
dumpXmlFilename = arg;
Log.InfoFormat("=> set dumpXmlFilename to {0}", dumpXmlFilename);
}
else if( ssr != null)
{
Log.InfoFormat("=> add service named '{0}'", arg);
servicenames.Add(arg);
}
}
MainWindow wnd = new MainWindow(initialView);
if (dumpXml)
{
wnd.SwitchController(initialView, false);
if (useClipboard)
{
wnd.CopyToClipboard(null, null);
}
else if (string.IsNullOrEmpty(dumpXmlFilename))
{
wnd.SaveAsXML(null, null);
}
else
{
wnd.SaveAsXML(dumpXmlFilename, null);
}
Shutdown();
}
else
{
if( ssr != null )
{
wnd.SetInitialAction(ssr, servicenames);
}
wnd.Show();
}
}