Example #1
0
        public void Init()
        {
            thisWindow = new XingKongWindow();
            string shutdownWindowJson = File.ReadAllText(@"AppForm.json");

            XingKongWindow.Entity windowEntity = JsonConvert.DeserializeObject <XingKongWindow.Entity>(shutdownWindowJson);
            thisWindow.SetEntity(windowEntity);

            btLaunch  = thisWindow.ControlsSet["btLaunch"] as XingKongButton;
            btBack    = thisWindow.ControlsSet["btBack"] as XingKongButton;
            pbIcon    = thisWindow.ControlsSet["pbIcon"] as XingKongImageBox;
            lbAllApps = thisWindow.ControlsSet["lbAllApps"] as XingKongLabel;
            lbApps    = thisWindow.ControlsSet["lbApps"] as XingKongListBox;

            lbApps.Refresh();

            pbIcon.SkipPreProceed = true;
            pbIcon.LoadPicture(Path.Combine("SystemUI", "appstore.png"));

            apps = AppFinder.GetAppList();
            if ((apps == null) || (apps.Count == 0))
            {
                XingKongMessageBox box1 = new XingKongMessageBox
                {
                    Caption = "提示",
                    Title   = "然而一个应用都没有。"
                };
                box1.btOk.IsChecked = true;
                box1.DialogStyle    = XingKongMessageBox.Style.OK;
                Console.WriteLine("user clicked: " + box1.ShowAsync().Result);
            }
            else
            {
                if (lbApps.Items == null)
                {
                    lbApps.Items = new List <string>();
                }
                foreach (AppInfo info in apps)
                {
                    lbApps.Items.Add(info.AppName);
                }
                lbApps.Refresh();
            }
            XingKongScreen.ClearScreen();
            thisWindow.HardworkDraw();
            XingKongScreen.FreshScreen();
            keyboard             = XingKongScreen.GetKeyboard();
            keyboard.KeyPressed += new Keyboard.KeyPressedHandler(Keyboard_KeyPressed);
        }
Example #2
0
        private void ShowMainWindow()
        {
            currentWindow = mainWindow;
            List <string> kuaidiListSource = new List <string>();

            KuaidiItemList = GetKuaidiList();
            foreach (var item in KuaidiItemList)
            {
                kuaidiListSource.Add(item.DisplayName);
            }
            lbKuaidis.Items = kuaidiListSource;
            lbKuaidis.Refresh();

            XingKongScreen.ClearScreen();
            currentWindow.HardworkDraw();
            XingKongScreen.FreshScreen();
        }
Example #3
0
 public override void Init()
 {
     appPath       = Path.Combine("Apps", "PhotoLibrary");
     currentWindow = new XingKongWindow();
     XingKongWindow.Entity entity = JsonConvert.DeserializeObject <XingKongWindow.Entity>(File.ReadAllText(Path.Combine(this.appPath, "MainForm.json")));
     currentWindow.SetEntity(entity);
     lbHint          = this.currentWindow.ControlsSet["lbHint"] as XingKongLabel;
     lbCaption       = this.currentWindow.ControlsSet["lbCaption"] as XingKongLabel;
     lbPicList       = this.currentWindow.ControlsSet["lbPicList"] as XingKongListBox;
     lbPicList.Items = this.GetPicFileNames();
     lbPicList.Refresh();
     keyboard             = XingKongScreen.GetKeyboard();
     keyboard.KeyPressed += new Keyboard.KeyPressedHandler(this.Keyboard_KeyPressed);
     XingKongScreen.ClearScreen();
     currentWindow.HardworkDraw();
     XingKongScreen.FreshScreen();
 }