本文整理汇总了C#中System.App.Run方法的典型用法代码示例。如果您正苦于以下问题:C# App.Run方法的具体用法?C# App.Run怎么用?C# App.Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.App
的用法示例。
在下文中一共展示了App.Run方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
App app = new App();
app.Run();
Console.ReadLine();
}
示例2: Main
public static void Main(string[] args)
{
var app = new App { ShutdownMode = ShutdownMode.OnLastWindowClose };
app.InitializeComponent();
var container = new Container(x=> x.AddRegistry<AppRegistry>());
var factory = container.GetInstance<TraderWindowFactory>();
var window = factory.Create(true);
container.Configure(x => x.For<Dispatcher>().Add(window.Dispatcher));
//run start up jobs
var priceUpdater = container.GetInstance<TradePriceUpdateJob>();
window.Show();
app.Resources.Add(SystemParameters.ClientAreaAnimationKey, null);
app.Resources.Add(SystemParameters.MinimizeAnimationKey, null);
app.Resources.Add(SystemParameters.UIEffectsKey, null);
app.Run();
}
示例3: Main
static void Main()
{
using (var mutex = new Mutex(false, mutex_id))
{
var hasHandle = false;
try
{
try
{
hasHandle = mutex.WaitOne(5000, false);
if (hasHandle == false) return; //another instance exist
}
catch (AbandonedMutexException)
{
// Log the fact the mutex was abandoned in another process, it will still get aquired
}
App app = new App();
app.MainWindow = new MainWindow();
app.Run();
}
finally
{
if (hasHandle)
mutex.ReleaseMutex();
}
}
}
示例4: Main
static void Main()
{
App app = new App();
app.MainWindow = new MainWindow();
app.MainWindow.Show();
app.Run();
}
示例5: Main
static void Main(string[] args)
{
if (args.Length == 0)
{
App app = new App();
app.MainWindow = new MainWindow();
app.MainWindow.Show();
app.Run();
}
else
{
InitializeParameterSet();
// now we came into command line mode.
if (args[0] == "/?" || args[0] == "/h")
{
PrintHelp();
}
else
{
ParseParameter(args);
if (!ParasAllSet())
{
PrintHelp();
}
else
{
}
}
}
}
示例6: Main
static void Main(string[] args)
{
CLayer = new ControlLayer();
MWindow = new MainWindow();
App app = new App();
app.Run(MWindow);
}
示例7: Main
static void Main()
{
App a = new App();
View.MainWindow wnd = new View.MainWindow();
a.Run(wnd);
}
示例8: RunApp
public void RunApp()
{
var app = new App();
app.Run();
app.Shutdown();
}
示例9: Main
static void Main(string[] args)
{
App myApp = new App();
lock (myApp)
{
myApp.Run(args);
}
}
示例10: Main
static void Main(string[] args)
{
//Application.EnableVisualStyles();
//Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(FrmMain);
App myApp = new App();
myApp.Run(args);
}
示例11: StartApplication
private void StartApplication()
{
_app = new App();
var regionManager = new RegionManager(new RegionFactory(new IRegionAdapter[] { new TabControlAdapter() }));
_locator.Register(regionManager);
_app.Run(new MainWindow(_locator, _resetEvent));
}
示例12: Main
static void Main(string[] args)
{
if (args.Length == 0)
{
App app = new App();
app.MainWindow = new Window1();
app.MainWindow.Show();
app.Run();
}
}
示例13: Main
static void Main()
{
App app = new App();
//this applies the XAML, e.g. StartupUri, Application.Resources
app.InitializeComponent();
//shows the Window specified by StartupUri
app.Run();
}
示例14: Main
public static void Main()
{
IController controller = new MyController();
IModel model = new MyModel(controller);
controller.setModel(model);
IView view = new MainWindow();
view.setController(controller);
controller.setView(view);
App app = new App();
app.Run((MainWindow)view);
}
示例15: OnStartup
// called on first run.
protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e)
{
app = new App();
app.InitializeComponent();
MainWindow mainWindow = new MainWindow();
CapturedItemsListController.Create(mainWindow);
app.Run(mainWindow);
return false;
}