当前位置: 首页>>代码示例>>C#>>正文


C# Controller.LoadInitialFile方法代码示例

本文整理汇总了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.
        }
开发者ID:petergolde,项目名称:PurplePen,代码行数:20,代码来源:InitialScreen.cs

示例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.
        }
开发者ID:petergolde,项目名称:PurplePen,代码行数:27,代码来源:InitialScreen.cs

示例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.
        }
开发者ID:petergolde,项目名称:PurplePen,代码行数:21,代码来源:InitialScreen.cs

示例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);
        }
开发者ID:petergolde,项目名称:PurplePen,代码行数:11,代码来源:AddCornerModeTests.cs

示例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();
        }
开发者ID:petergolde,项目名称:PurplePen,代码行数:13,代码来源:CompatibilityTests.cs

示例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);
        }
开发者ID:petergolde,项目名称:PurplePen,代码行数:11,代码来源:AddControlModeTests.cs

示例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;
        }
开发者ID:petergolde,项目名称:PurplePen,代码行数:17,代码来源:Program.cs


注:本文中的Controller.LoadInitialFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。