示例#1
0
        public MainWindow(double left_margin)
        {
            taskbarCreated = API.RegisterWindowMessage("TaskbarCreated");
            #region
            InitializeComponent();

            moveleft                   = new DispatcherTimer();
            moveleft.Interval          = new TimeSpan(1);
            moveleft.Tick             += new EventHandler(moveleft_Tick);
            moveright                  = new DispatcherTimer();
            moveright.Interval         = new TimeSpan(1);
            moveright.Tick            += new EventHandler(moveright_Tick);
            moveleftWhenDel            = new DispatcherTimer();
            moverightWhenDel           = new DispatcherTimer();
            moverightWhenDel.Interval  = new TimeSpan(1);
            moveleftWhenDel.Interval   = new TimeSpan(1);
            moveleftWhenDel.Tick      += new EventHandler(moveleftWhenDel_Tick);
            moverightWhenDel.Tick     += new EventHandler(moverightWhenDel_Tick);
            moverightWhenDel.IsEnabled = false;
            moveleftWhenDel.IsEnabled  = false;
            moveright.IsEnabled        = false;
            moveleft.IsEnabled         = false;
            #endregion
            btnskin.Source      = new BitmapImage(new Uri("pack://application:,,/images/skin1.png"));
            btnmenu.Source      = new BitmapImage(new Uri("pack://application:,,/images/menu1.png"));
            btnedit.Source      = new BitmapImage(new Uri("pack://application:,,/images/edit1.png"));
            menugrid.Visibility = Visibility.Hidden;
            this.Left           = left_margin;

            if (RegWork.CheckFirstRun())
            {
                if (false)
                {
                    MyWork.startExePath.CheckRegRun();
                    MyWork.startExePath.AddRegMenu();
                }
            }
            if (!File.Exists(Path.Combine(MyWork.StartDir, "data.xml")))
            {
                new XElement("Data").Save(Path.Combine(MyWork.StartDir, "data.xml"));
            }

            SettingInfo tempset;
            MyWork.ConfigPath.ReadSetting(out tempset);
            currentBack = tempset.BackImg;
            SetBackImage(currentBack, false);

            UpdateItems();
            Dal.RepairData();
            PageCount   = Dal.GetPageCount();
            PageCount   = PageCount == 0 ? PageCount + 1 : PageCount;
            CurrentPage = 1;

            SetPanel(PageCount);
            UpdatePageControl(PageCount);
            UpdatePageControlChecked(CurrentPage);
            ks          = new KeyboardStart(ReadData());
            this.Title += "i";
        }
示例#2
0
        public MainWindow(double left_margin)
        {
            taskbarCreated = API.RegisterWindowMessage("TaskbarCreated");
            #region
            InitializeComponent();

            moveleft = new DispatcherTimer();
            moveleft.Interval = new TimeSpan(1);
            moveleft.Tick += new EventHandler(moveleft_Tick);
            moveright = new DispatcherTimer();
            moveright.Interval = new TimeSpan(1);
            moveright.Tick += new EventHandler(moveright_Tick);
            moveleftWhenDel = new DispatcherTimer();
            moverightWhenDel = new DispatcherTimer();
            moverightWhenDel.Interval = new TimeSpan(1);
            moveleftWhenDel.Interval = new TimeSpan(1);
            moveleftWhenDel.Tick += new EventHandler(moveleftWhenDel_Tick);
            moverightWhenDel.Tick += new EventHandler(moverightWhenDel_Tick);
            moverightWhenDel.IsEnabled = false;
            moveleftWhenDel.IsEnabled = false;
            moveright.IsEnabled = false;
            moveleft.IsEnabled = false;
            #endregion
            btnskin.Source = new BitmapImage(new Uri("pack://application:,,/images/skin1.png"));
            btnmenu.Source = new BitmapImage(new Uri("pack://application:,,/images/menu1.png"));
            btnedit.Source = new BitmapImage(new Uri("pack://application:,,/images/edit1.png"));
            menugrid.Visibility = Visibility.Hidden;
            this.Left = left_margin;

            if (RegWork.CheckFirstRun())
            {
                if (false)
                {
                    MyWork.startExePath.CheckRegRun();
                    MyWork.startExePath.AddRegMenu();
                }
            }
            if (!File.Exists(Path.Combine(MyWork.StartDir, "data.xml")))
                new XElement("Data").Save(Path.Combine(MyWork.StartDir, "data.xml"));

            SettingInfo tempset;
            MyWork.ConfigPath.ReadSetting(out tempset);
            currentBack = tempset.BackImg;
            SetBackImage(currentBack, false);

            UpdateItems();
            Dal.RepairData();
            PageCount = Dal.GetPageCount();
            PageCount = PageCount == 0 ? PageCount + 1 : PageCount;
            CurrentPage = 1;

            SetPanel(PageCount);
            UpdatePageControl(PageCount);
            UpdatePageControlChecked(CurrentPage);
            ks = new KeyboardStart(ReadData());
            this.Title += "i";
        }