예제 #1
0
파일: Page.cs 프로젝트: freeman888/GI
                public override object Run(Hashtable xc)
                {
                    MainWindow mainWindow = MainWindow.MainApp;

                    GasControl.Page.GasPage page = mainWindow.Return();
                    return(new Variable(page));
                }
예제 #2
0
파일: Page.cs 프로젝트: freeman888/GI
 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);
     };
 }
예제 #3
0
파일: Page.cs 프로젝트: freeman888/GI
                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));
                }
예제 #4
0
파일: Page.cs 프로젝트: freeman888/GI
                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));
                }
예제 #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);
            }
        }
예제 #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);
            }
                                         ));
        }