本文整理汇总了C#中IWindowManager.ShowMetroMessageBox方法的典型用法代码示例。如果您正苦于以下问题:C# IWindowManager.ShowMetroMessageBox方法的具体用法?C# IWindowManager.ShowMetroMessageBox怎么用?C# IWindowManager.ShowMetroMessageBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWindowManager
的用法示例。
在下文中一共展示了IWindowManager.ShowMetroMessageBox方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainViewModel
private MainViewModel(IWindowManager windowManager, IEventAggregator eventAggregator)
{
_windowManager = windowManager;
eventAggregator.Subscribe(this);
// automatically use the correct translations if available (fallback: en)
LocalizeDictionary.Instance.SetCurrentThreadCulture = true;
LocalizeDictionary.Instance.Culture = Thread.CurrentThread.CurrentCulture;
// this is already defined in the app.manifest, but to be sure check it again
if (!IsAdministrator())
{
_windowManager.ShowMetroMessageBox(
LocalizationEx.GetUiString("dialog_message_bad_privileges", Thread.CurrentThread.CurrentCulture),
LocalizationEx.GetUiString("dialog_error_title", Thread.CurrentThread.CurrentCulture),
MessageBoxButton.OK, BoxType.Error);
Environment.Exit(1);
}
// do a simple check, if all needed files are available
if (!ValidateDnsCryptProxyFolder())
{
_windowManager.ShowMetroMessageBox(
LocalizationEx.GetUiString("dialog_message_missing_proxy_files",
Thread.CurrentThread.CurrentCulture),
LocalizationEx.GetUiString("dialog_error_title", Thread.CurrentThread.CurrentCulture),
MessageBoxButton.OK, BoxType.Error);
Environment.Exit(1);
}
DisplayName = string.Format("{0} {1} ({2})", Global.ApplicationName, VersionUtilities.PublishVersion,
LocalizationEx.GetUiString("global_ipv6_disabled", Thread.CurrentThread.CurrentCulture));
_resolvers = new List<DnsCryptProxyEntry>();
//TODO: make UpdateResolverListOnStart configurable by user
_updateResolverListOnStart = Global.UpdateResolverListOnStart;
_isWorkingOnPrimaryService = false;
_isWorkingOnSecondaryService = false;
LocalNetworkInterfaces = new CollectionViewSource {Source = _localNetworkInterfaces};
PrimaryDnsCryptProxyManager = new DnsCryptProxyManager(DnsCryptProxyType.Primary);
SecondaryDnsCryptProxyManager = new DnsCryptProxyManager(DnsCryptProxyType.Secondary);
ShowHiddenCards = false;
if (PrimaryDnsCryptProxyManager.DnsCryptProxy.Parameter.TcpOnly ||
SecondaryDnsCryptProxyManager.DnsCryptProxy.Parameter.TcpOnly)
{
_useTcpOnly = true;
}
// check the primary resolver for plugins
if (PrimaryDnsCryptProxyManager.DnsCryptProxy.Parameter.Plugins.Any())
{
_plugins = PrimaryDnsCryptProxyManager.DnsCryptProxy.Parameter.Plugins.ToList();
}
else
{
if (SecondaryDnsCryptProxyManager.DnsCryptProxy.Parameter.Plugins.Any())
{
_plugins = SecondaryDnsCryptProxyManager.DnsCryptProxy.Parameter.Plugins.ToList();
}
else
{
// no stored plugins
_plugins = new List<string>();
}
}
var proxyList = Path.Combine(Directory.GetCurrentDirectory(),
Global.DnsCryptProxyFolder, Global.DnsCryptProxyResolverListName);
var proxyListSignature = Path.Combine(Directory.GetCurrentDirectory(),
Global.DnsCryptProxyFolder, Global.DnsCryptProxySignatureFileName);
if (!File.Exists(proxyList) || !File.Exists(proxyListSignature) || UpdateResolverListOnStart)
{
// download and verify the proxy list if there is no one.
AsyncHelpers.RunSync(DnsCryptProxyListManager.UpdateResolverListAsync);
}
var dnsProxyList =
DnsCryptProxyListManager.ReadProxyList(proxyList, proxyListSignature, true);
if (dnsProxyList != null && dnsProxyList.Any())
{
foreach (var dnsProxy in dnsProxyList)
{
if (
dnsProxy.Name.Equals(
PrimaryDnsCryptProxyManager.DnsCryptProxy.Parameter.ResolverName))
{
_primaryResolver = dnsProxy;
// restore the local port
_primaryResolver.LocalPort = PrimaryDnsCryptProxyManager.DnsCryptProxy.Parameter.LocalPort;
}
if (
dnsProxy.Name.Equals(
SecondaryDnsCryptProxyManager.DnsCryptProxy.Parameter.ResolverName))
{
_secondaryResolver = dnsProxy;
}
_resolvers.Add(dnsProxy);
}
//.........这里部分代码省略.........