本文整理汇总了C#中MainWindow.Show方法的典型用法代码示例。如果您正苦于以下问题:C# MainWindow.Show方法的具体用法?C# MainWindow.Show怎么用?C# MainWindow.Show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainWindow
的用法示例。
在下文中一共展示了MainWindow.Show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoginWindow_login
private void LoginWindow_login(object sender, Guid guid)
{
IsEnabled = false;
Visibility = Visibility.Hidden;
MainWindow mw = new MainWindow(guid);
mw.Show();
}
示例2: Call
public override void Call (object o)
{
Application.Init ();
win = new MainWindow ();
win.Show ();
Application.Run ();
}
示例3: MainClass
public MainClass()
{
window = new MainWindow();
window.OnClickEvent += OnPinCode_ButtonClickEvent;
window.Closing += new CancelEventHandler(MainWindow_Closing);
window.Show();
Task.Run(() => {
trialThread = new Thread(TrialTimer);
trialThread.Start();
server = new QuitServer();
serverThread = new Thread(server.Run);
serverThread.Start();
twitter = new Twitter();
twitter.OnRequestEvent += OnRequest_TwitterEvent;
twitter.OnIndexTextEvent += OnIndexText_TwitterEvent;
twitter.OnAuthCompleteEvent += OnAuthComplete_TwitterEvent;
twitter.OnAuthErrorEvent += OnAuthError_TwitterEvent;
twitter.Init();
});
app = new Application();
app.Run(window);
}
示例4: InitializeWindow
public void InitializeWindow()
{
Dispatcher rubyThreadDispatcher = Dispatcher.CurrentDispatcher;
Thread thread = new Thread(() =>
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
lock (windowLock)
{
_window = new MainWindow(rubyThreadDispatcher);
_window.Title = Name;
}
_window.Closed += (sender2, e2) => { _window.Dispatcher.InvokeShutdown(); };
_window.Show();
Dispatcher.Run();
});
thread.SetApartmentState(ApartmentState.STA);
thread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
thread.Start();
for (int waited = 0; waited < 1000 && _window == null; waited += 10)
{
Thread.Sleep(10);
}
}
示例5: OnStartup
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
_container = new UnityContainer();
_container.RegisterInstance<IUnityContainer>(_container);
var locator = new UnityServiceLocator(_container);
ServiceLocator.SetLocatorProvider(() => locator);
_container.RegisterType<UserProvider>(new ContainerControlledLifetimeManager());
_container.RegisterType<IChildViewModelManager, ChildViewModelManager>(new ContainerControlledLifetimeManager());
_container.RegisterType<UserDetailsViewModel>(new ContainerControlledLifetimeManager());
_container.RegisterType<UserListViewModel>(new ContainerControlledLifetimeManager());
var mappingResolver = new MappingViewTypeResolver();
mappingResolver.RegisterTypeMapping<UserDetailsView, UserDetailsViewModel>();
mappingResolver.RegisterTypeMapping<UserListView, UserListViewModel>();
mappingResolver.RegisterTypeMapping<UserDetailsWindow, UserDetailsWindowViewModel>();
_container.RegisterInstance<IViewTypeResolver>(mappingResolver);
var mainVM = _container.Resolve<MainWindowViewModel>();
mainVM.Initialize();
var mainWindow = new MainWindow();
mainWindow.DataContext = mainVM;
mainWindow.Show();
}
示例6: Main
/// <summary>
/// The entry point of the program, where the program control starts and ends.
/// </summary>
/// <param name='args'>
/// The command-line arguments.
/// </param>
public static void Main(string[] args)
{
//Initalize a new object of the argument parser
libTerminus.cArgumentParser argsP = new libTerminus.cArgumentParser (args, Assembly.GetExecutingAssembly ().GetName ().Version.ToString ());
GLib.ExceptionManager.UnhandledException += delegate(GLib.UnhandledExceptionArgs argsEx) {
Console.WriteLine (argsEx.ExceptionObject.ToString ());
};
new libTerminus.cPathEnvironment ().ConfFileManagement ();
if (argsP.Path == "") {
Mono.Unix.Catalog.Init ("i8n1", "./locale");
Console.WriteLine ("Useing locale path \"{0}\"", "./locale");
} else {
Console.WriteLine ("Useing locale path \"{0}\"", argsP.Path + "/locale");
Mono.Unix.Catalog.Init ("i8n1", argsP.Path + "/locale");
}
//if the program should be runned..
if (argsP.AllowedToRun) {
Application.Init ();
if (argsP.FileToOpen == "") {
MainWindow win = new MainWindow ("");
win.Show ();
} else {
MainWindow win = new MainWindow (argsP.FileToOpen);
win.Show ();
}
Application.Run ();
} else if (argsP.AllowedToRun == false && argsP.RunIntoShell == true) {
new libTerminus.cShell ();
} else
Environment.Exit (-1);
}
示例7: Main
public static void Main (string[] args)
{
Core.Initialize ("FlashUnit", ref args);
Log.Information ("Hello World! Flash!");
var main_window = new MainWindow ();
main_window.Destroyed += (o, e) => Application.Quit ();
main_window.Show ();
/*if (ApplicationContext.CommandLine ["add-foldersrc"] != String.Empty) {
var source = new LocalFolderPhotoSource (new Uri (ApplicationContext.CommandLine["add-foldersrc"]));
Core.MainCachePhotoSource.RegisterPhotoSource (source);
}*/
/*var enu = (Core.MainCachePhotoSource.Photos as TripodQuery<Tripod.Sources.Cache.CachePhoto>).Where (p => p.Comment != String.Empty);
foreach (IPhoto photo in enu.Take (25)) {
Log.Debug (photo.Uri.ToString ());
}
var model = new HyenaLINQModel<Tripod.Sources.Cache.CachePhoto> (enu);
model.Reload ();
Hyena.Log.Debug (model == null ? "null" : model.ToString ());
Hyena.Log.Debug (model.Count.ToString ());*/
Application.Run ();
}
示例8: CancelChanges_Click
private void CancelChanges_Click(object sender, RoutedEventArgs e)
{
MainWindow mainWindow = new MainWindow();
mainWindow.Show();
this.Close();
}
示例9: OnNextButtonClicked
protected void OnNextButtonClicked(object sender, EventArgs e)
{
if (winRegKeyPath.Active)
{
if(Directory.Exists(GetPGEFromRegistry()))
{
Program.ProgramSettings.PGEDirectory = GetPGEFromRegistry();
Program.SaveSettings();
MainWindow mw = new MainWindow();
mw.Show();
this.Destroy();
}
}
else
{
if (entry1.Text.Trim() != "")
{
Program.ProgramSettings.PGEDirectory = entry1.Text;
Program.SaveSettings();
MainWindow mw = new MainWindow();
mw.Show();
this.Destroy();
}
}
}
示例10: StartGtkApp
static void StartGtkApp()
{
Gtk.Application.Init();
MainWindow win = new MainWindow();
win.Show();
Application.Run();
}
示例11: Main
public static void Main(string[] args)
{
Application.Init ();
bool reindex = false;
bool hidden = false;
if (args.Length > 0) {
if (args[0] == "--reindex" || args.Length > 1 && args[1] == "--reindex")
reindex = true;
else if (args[0] == "--hidden" || args.Length > 1 && args[1] == "--hidden")
hidden = true;
for (int i = 0; i < args.Length; ++i)
if (args[i] == "--help") {
System.Console.WriteLine("Usage: nemo [options]");
System.Console.WriteLine(" where options include:");
System.Console.WriteLine("");
System.Console.WriteLine(" --reindex: Reindex all files");
System.Console.WriteLine(" --hidden: Start nemo hidden");
return;
}
else
System.Console.WriteLine(args[0]);
}
MainWindow win = new MainWindow(reindex, hidden);
if (!hidden)
win.Show();
Application.Run();
}
示例12: Main
public static void Main(string[] args)
{
Application.Init ();
MainWindow win = new MainWindow ();
try
{
Configuration.LoadConfiguration();
win.ApplyConfiguration();
if (args.Length>0)
{
foreach (var arg in args)
{
if (Directory.Exists(arg))
{
win.AddFolder(args[0],false);
}
}
}
win.Show ();
Application.Run ();
} catch (Exception ex)
{
Logger.Logger.WriteToLog("Caught general error: ", ex);
}
}
示例13: App
public App()
{
DAOFactory daoFactory = new DAOFactory();
Registry.setRepositoryFactory(daoFactory);
MainWindow window = new MainWindow();
window.Show();
}
示例14: Main
public static void Main (string[] args)
{
ObservableArrayList arr = new ObservableArrayList();
ObservableFilterList filter = new ObservableFilterList (arr);
filter.IsVisibleInFilter += new IsVisibleInFilterEvent(infilter);
/* delegate(object aObject) {
if (aObject is Named == false)
return (false);
return (((Named) aObject).Age > 15);
};*/
filter.ElementAdded += delegate(object aList, int[] aIdx) {
System.Console.WriteLine("Added({2}): {0} - {1}", aIdx.PathToString(), 0, 0);//filter.Count);
};
filter.ElementChanged += delegate(object aList, int[] aIdx) {
System.Console.WriteLine("Changed({2}): {0} - {1}", aIdx.PathToString(), 0, 0);//filter[aIdx], filter.Count);
};
filter.ElementRemoved += delegate(object aList, int[] aIdx, object aObject) {
System.Console.WriteLine("Removed({2}): {0} - {1}", aIdx.PathToString(), 0, 0);//filter[aIdx], filter.Count);
};
filter.Add (new Named ("A", 13));
filter.Add (new Named ("B", 16));
filter.Add (new Named ("C", 12));
// System.Console.WriteLine("ItemCount={0}", arr.Count);
System.Console.WriteLine("{0}:{1}",filter.Count, arr.Count);
if (arr[0] is Named)
System.Console.WriteLine("NAMED");
(arr[0] as Named).Age = 33;
return;
Application.Init ();
MainWindow win = new MainWindow ();
win.Show ();
Application.Run ();
}
示例15: Main
public static void Main(string[] args)
{
//GLib.Thread.Init();
//Gdk.Threads.Init();
Application.Init();
MainWindow win = new MainWindow();
GLib.ExceptionManager.UnhandledException += (unhandledException) =>
{
MessageDialog md = new MessageDialog(
win, DialogFlags.Modal, MessageType.Other,
ButtonsType.Ok, unhandledException.ExceptionObject.ToString());
md.Run();
md.Destroy();
};
win.Show();
Application.Run();
//Gdk.Threads.Enter();
//try
//{
// Application.Run();
//}
//finally
//{
// Gdk.Threads.Leave();
//}
}