コード例 #1
0
        /// <summary>
        /// Resets the state of the application to just after launch with parameters.
        /// </summary>
        public void ResetState()
        {
            Title              = APP_NAME;
            DesignerControl    = new DesignerPage();
            DevelopmentControl = new Development();
            ProductionControl  = new Production();

            ProductionControl.Visibility  = Visibility.Hidden;
            DevelopmentControl.Visibility = Visibility.Hidden;

            SetActive(DesignerControl);
            if (Schema != null)
            {
                DesignerControl.UnpackSchema(Schema);
            }
        }
コード例 #2
0
        protected override void OnKeyUp(KeyEventArgs e)
        {
            base.OnKeyUp(e);

            if (e.Key == Key.F5 && DesignerControl.Pages.Count > 0)
            {
                SetActive(ProductionControl);
            }
            else if (e.Key == Key.F6 && DesignerControl.Pages.Count > 0 && SchemaData != null)
            {
                DevelopmentControl = new Development();
                DevelopmentControl.Load(DesignerControl.Pages, Schema, SchemaData);
                SetActive(DevelopmentControl);
            }
            else if (e.Key == Key.F6)
            {
                string msg = "";
                if (DesignerControl.Pages.Count <= 0)
                {
                    msg += "Page template does not exist. Please design one first.{0}";
                }
                if (SchemaData == null)
                {
                    msg += "Data file and/or schema is not loaded.{0}";
                }

                if (msg.Length > 0)
                {
                    MessageBox.Show(string.Format(msg, Environment.NewLine), "", MessageBoxButton.OK, MessageBoxImage.Information);
                }
            }
            else if (e.Key == Key.Escape)
            {
                if (Content != DesignerControl)
                {
                    SetActive(DesignerControl);
                }
            }
        }