Ejemplo n.º 1
0
                public override object Run(Hashtable xc)
                {
                    MainWindow mainWindow = MainWindow.MainApp;

                    GasControl.Page.GasPage page = mainWindow.Return();
                    return(new Variable(page));
                }
Ejemplo n.º 2
0
 public PageClassTemplate() : base("Page", "Page")
 {
     Istr_xcname = "title";
     csctor      = (xc) =>
     {
         string title = Variable.GetTrueVariable <object>(xc, "title").ToString();
         GasControl.Page.GasPage gasPage = new GasControl.Page.GasPage(title);
         gasPage.Background = Brushes.White;
         return(gasPage);
     };
 }
Ejemplo n.º 3
0
                public override object Run(Hashtable xc)
                {
                    MainWindow mainWindow = MainWindow.MainApp;

                    if (mainWindow.Pages.Count > 1)
                    {
                        throw new Exceptions.RunException(Exceptions.EXID.逻辑错误, "请勿多次调用本方法");
                    }
                    GasControl.Page.GasPage page = xc.GetCSVariableFromSpeType <GasControl.Page.GasPage>("page", "Page");
                    mainWindow.GotoPage(page);

                    return(new Variable(0));
                }
Ejemplo n.º 4
0
                public override object Run(Hashtable xc)
                {
                    MainWindow mainWindow = MainWindow.MainApp;

                    if (mainWindow.Pages.Count == 0)
                    {
                        throw new Exceptions.RunException(Exceptions.EXID.逻辑错误, "请先通过  Page.LoadApp(page)   方法确定主页面,然后再使用本方法");
                    }
                    lock (mainWindow)
                    {
                        GasControl.Page.GasPage page = xc.GetCSVariableFromSpeType <GasControl.Page.GasPage>("page", "Page");
                        mainWindow.GotoPage(page);
                    }
                    return(new Variable(0));
                }
Ejemplo n.º 5
0
        public GasControl.Page.GasPage Return()
        {
            if (Pages.Count > 1)
            {
                GasControl.Page.GasPage rgp = Pages[Pages.Count - 1] as GasControl.Page.GasPage;
                Pages.Remove(rgp);
                PageBase.Children.Clear();
                GasControl.Page.GasPage page = Pages[Pages.Count - 1] as GasControl.Page.GasPage;
                PageBase.Children.Add(page);
                GasTitle.Content = page.title;

                ToolButton.Visibility = page.hastool ? Visibility.Visible : Visibility.Hidden;
                return(rgp);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 6
0
        public void GotoPage(GasControl.Page.GasPage page)
        {
            Dispatcher.Invoke(new Action(() =>
            {
                ThicknessAnimation thicknessAnimation = new ThicknessAnimation();
                thicknessAnimation.From     = new Thickness(0, 200, 0, 0);
                thicknessAnimation.To       = new Thickness(0);
                thicknessAnimation.Duration = TimeSpan.FromMilliseconds(200);

                GasTitle.Content = page.title;
                Pages.Add(page);
                PageBase.Children.Clear();
                PageBase.Children.Add(page);

                ToolButton.Visibility = page.hastool ? Visibility.Visible : Visibility.Hidden;

                PageBase.Visibility = Visibility.Visible;
                page.BeginAnimation(Grid.MarginProperty, thicknessAnimation);
            }
                                         ));
        }