本文整理汇总了C#中Controller.LoadInitialFile方法的典型用法代码示例。如果您正苦于以下问题:C# Controller.LoadInitialFile方法的具体用法?C# Controller.LoadInitialFile怎么用?C# Controller.LoadInitialFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Controller
的用法示例。
在下文中一共展示了Controller.LoadInitialFile方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OpenLastViewedEvent
// Open existing event was selected.
public void OpenLastViewedEvent()
{
MainFrame mainFrame = new MainFrame();
Controller controller = new Controller(mainFrame);
if (!controller.LoadInitialFile(Settings.Default.LastLoadedFile, true)) {
// User cancelled or the file didn't load.
// Go back and show the initial screen again.
mainFrame.Dispose();
Activate();
return;
}
// Start the UI
mainFrame.Show();
mainFrame.Activate();
Dispose(); // The initial screen is over and out.
}
示例2: OpenSampleEvent
// Open sample event was selected
public void OpenSampleEvent()
{
MainFrame mainFrame = new MainFrame();
Controller controller = new Controller(mainFrame);
if (!controller.LoadInitialFile(SampleEventFileName(), false)) { // Don't set sample event as the last loaded file.
// File didn't load.
// Go back and show the initial screen again.
mainFrame.Dispose();
Activate();
return;
}
// Set the description language to the UI language.
string langId = Util.CurrentLangName();
if (controller.HasDescriptionLanguage(langId)) {
controller.SetDescriptionLanguage(langId);
controller.MarkClean();
}
// Start the UI
mainFrame.Show();
mainFrame.Activate();
Dispose(); // The initial screen is over and out.
}
示例3: OpenExistingEvent
// Open existing event was selected.
public void OpenExistingEvent()
{
MainFrame mainFrame = new MainFrame();
Controller controller = new Controller(mainFrame);
string fileName = mainFrame.GetOpenFileName();
if (fileName == null || ! controller.LoadInitialFile(fileName, true)) {
// User cancelled or the file didn't load.
// Go back and show the initial screen again.
mainFrame.Dispose();
Activate();
return;
}
// Start the UI
mainFrame.Show();
mainFrame.Activate();
Dispose(); // The initial screen is over and out.
}
示例4: Setup
public void Setup(string filename)
{
ui = TestUI.Create();
controller = ui.controller;
eventDB = controller.GetEventDB();
string fileName = TestUtil.GetTestFile(filename);
bool success = controller.LoadInitialFile(fileName, true);
Assert.IsTrue(success);
}
示例5: LoadInitialFile
void LoadInitialFile(string filename)
{
mainFrame = new MainFrame();
controller = new Controller(mainFrame);
bool success = controller.LoadInitialFile(TestUtil.GetTestFile(filename), true);
Assert.IsTrue(success);
controller.GetEventDB().Validate();
// Start the UI
mainFrame.Show();
}
示例6: Setup
public void Setup()
{
ui = TestUI.Create();
controller = ui.controller;
eventDB = controller.GetEventDB();
string fileName = TestUtil.GetTestFile("modes\\marymoor.coursescribe");
bool success = controller.LoadInitialFile(fileName, true);
Assert.IsTrue(success);
}
示例7: LoadCommandLineFile
// Attempt to load file from a command line file. Return true on success.
static bool LoadCommandLineFile(string filename)
{
MainFrame mainFrame = new MainFrame();
Controller controller = new Controller(mainFrame);
if (!controller.LoadInitialFile(filename, true)) {
// File didn't load.
// Go back and show the initial screen again.
mainFrame.Dispose();
return false;
}
// Start the UI
mainFrame.Show();
return true;
}