示例#1
0
        /// <summary>
        /// Shows the View of the Controller parameter
        /// </summary>
        /// <param name="controller">The controller instance</param>
        public void Show(_Controller controller)
        {
            if (curController != null &&
                curController.View.Form.InvokeRequired)
            {
                curController.View.Form.BeginInvoke((MethodInvoker) delegate
                {
                    Show(controller);
                });
                return;
            }

            if (curController != null)
            {
                curController.View.Form.Close();
                curController.View.Form.Dispose();
            }

            curController = controller;

            Thread th = new Thread(openForm);

            th.SetApartmentState(ApartmentState.STA);
            th.Start();
        }
        public StoryNodesHierarchyViewPanel(StoryNodesPanel storyNodesPanel)
        {
            InitializeComponent();

            this.storyNodesPanel = storyNodesPanel;
            this.window = storyNodesPanel.Window;

            this.controller = new _Controller(this);
            this.DataContext = this.Controller;

            this.storyNodesPanel.Controller.PropertyChanged += Controller_PropertyChanged;
        }
示例#3
0
        private void MainWin_Load(object sender, EventArgs e)
        {
            JSONBIBLEPATH = "C:\\BibleFiles\\JSONBible\\";
            if (Properties.Settings.Default.firstRun)
            {
                try
                {
                    FolderBrowserDialog fd = new FolderBrowserDialog();
                    if (fd.ShowDialog() == DialogResult.OK)
                    {
                        fd.SelectedPath = JSONBIBLEPATH;
                        fd.Description  = "Select the \\BibleFiles\\JSONBible folder where you unzipped the JSON Bible files.";
                        JSONBIBLEPATH   = fd.SelectedPath + "\\";
                    }
                    Properties.Settings.Default.firstRun      = false;
                    Properties.Settings.Default.JSONBiblePath = JSONBIBLEPATH;
                    Properties.Settings.Default.Save();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error: " + ex.Message);
                }
            }

            if (!"".Equals(Properties.Settings.Default.JSONBiblePath))
            {
                controller = new _Controller(Properties.Settings.Default.JSONBiblePath);
            }
            else
            {
                SetJSONPath();
                controller = new _Controller(JSONBIBLEPATH);
                Properties.Settings.Default.JSONBiblePath = JSONBIBLEPATH;
                Properties.Settings.Default.Save();
            }

            LoadBooks();

            if (Properties.Settings.Default.font != null)
            {
                RTB1.Font = Properties.Settings.Default.font;
            }

            if (this.Height < mainWinMinHeight)
            {
                this.Height = mainWinMinHeight;
            }
            if (this.Width < mainWinMinWidth)
            {
                this.Width = mainWinMinWidth;
            }
        }
示例#4
0
        private void SetJSONPath()
        {
            FolderBrowserDialog fd = new FolderBrowserDialog();

            fd.SelectedPath = JSONBIBLEPATH;
            if (fd.ShowDialog() == DialogResult.OK)
            {
                JSONBIBLEPATH = fd.SelectedPath + "\\";
                Properties.Settings.Default.JSONBiblePath = JSONBIBLEPATH;
                Properties.Settings.Default.Save();
                controller = new _Controller(JSONBIBLEPATH);
                LoadBooks();
            }
        }
示例#5
0
        static void Main(string[] args)
        {
            //while (true)
            //{
            //    int n;double res;
            //    n = Convert.ToInt32(Console.ReadLine());
            //    res = (n == 1) ? 0 : 1 + Math.Log2(n / 2);
            //    Console.Write("\nlob(n)="+res+"\n");
            //}
            _Controller controller = new _Controller();

            Console.Write("-number of a grid or index of it inside the range [0,1,2,3,4,5,6,7,8,9]\n\n");
            controller.Level = 2; // Difficult
            controller.PlayGame();
            controller.ShowGrid();
        }
示例#6
0
 public FamilyTablePageController(_Controller parent) : base(parent)
 {
 }
 public _PageController(_Controller parent)
 {
     viewController = parent;
 }
示例#8
0
 public DashboardPageController(_Controller parent) : base(parent)
 {
 }