Пример #1
0
        private void Add_Account(object sender, MouseButtonEventArgs e)
        {
            PIN_Code Add_Pin = new PIN_Code();

            Add_Pin.Topmost = true;
            Add_Pin.Closed += this.PIN_Code_Closed;
            Add_Pin.Show();
            this.IsEnabled = false;
        }
Пример #2
0
        public MainWindow()
        {
            bool IsInScreen = false;


            InitializeComponent();

            this.Visibility = Visibility.Hidden;

            Load_Setting();
            Load_NGdata();

            if (!mutex.WaitOne(0, false))
            {
                MessageBox.Show(Properties.Resources.multiple_startup_1, Properties.Resources.multiple_startup_title, MessageBoxButton.OK, MessageBoxImage.Exclamation);
                second_run = true;
                this.Close();
                return;
            }

            if (!(Network.Network_Connected()))
            {
                var dlg = new emanual.Wpf.Utility.MessageBoxEx();
                dlg.Message          = "Brith";
                dlg.Width            = 350;
                dlg.Height           = 165;
                dlg.TextBlock.Height = 65;
                dlg.TextBlock.Inlines.Add(new System.Windows.Documents.Bold(new System.Windows.Documents.Run(Properties.Resources.network_error_1)));
                dlg.TextBlock.Inlines.Add(Properties.Resources.network_error_2);

                //dlg.Owner = this;
                dlg.Left = this.Left + 50;
                dlg.Top  = this.Top + 50;

                //dlg.Background = Brushes.Wheat;
                dlg.Button = MessageBoxButton.OK;
                dlg.Image  = MessageBoxImage.Warning;

                dlg.Result = MessageBoxResult.OK;
                dlg.ShowDialog();

                this.Close();
                return;
            }



            window.SizeChanged += OnSizeChanged;

            window.BorderThickness = new Thickness(0);
            info = new InfoBox(this, Base_Grid);
            //window.BorderBrush = new SolidColorBrush(Color.FromArgb(255, 255, 10, 10));



            Change_Lang();


            if (!(Directory.Exists(Pass.tmp)))
            {
                Directory.CreateDirectory(Pass.tmp);
            }
            if (!(Directory.Exists(Pass.data)))
            {
                Directory.CreateDirectory(Pass.data);
            }


            if (!(Directory.Exists(Pass.pindir)))
            {
                var Pincode = new PIN_Code();
                Pincode.Topmost = true;
                Pincode.Closed += this.PIN_Code_Closed;
                Pincode.Show();
                this.Hide();
                this.IsEnabled = false;
            }
            else
            {
                this.Load_Token();
            }



            IsStarted = true;


            color_list.SetWindow(window);
            color_list.SetNum(setdata.d.colors);

            title = new Title(window, Title_Grid);

            account = new Account(Accont_Erea, tokens, color_list);
            account.add.MouseLeftButtonDown += Add_Account;


            key_erea   = new Key_Erea(Canvas_Erea, color_list, title);
            this.Title = "Birth   - " + key_erea.name + " -";

            menu = new Menu(this, Menu_Canvas, 0, color_list);
            menu.new_data.MouseLeftButtonDown  += On_New;
            menu.load_data.MouseLeftButtonDown += On_Load;
            menu.load_data.TouchDown           += On_Load;
            menu.save_data.MouseLeftButtonDown += On_Save;
            menu.save_data.TouchDown           += On_Save;
            menu.rt_data.MouseLeftButtonDown   += On_Run;
            menu.setting.MouseLeftButtonDown   += On_Setting;

            NewSetting();


            Base_Grid.Children.Add(Cover);
            Cover.Margin = new Thickness(0, Title_Grid.Height, 0, 0);

            color_list.Main_Back_Panel = Canvas_Erea;
            Color_Set();

            window.KeyDown += Window_KeyDown;
            title.Title_Change();



            Title_Grid.MouseLeftButtonDown        += (sender, e) => { this.DragMove(); };
            title.WindowTitle.MouseLeftButtonDown += Title_Clicking;
            title.WindowTitle.MouseLeftButtonUp   += Title_Clicked;

            foreach (System.Windows.Forms.Screen s in System.Windows.Forms.Screen.AllScreens)
            {
                monitor_point.Add(new Point(s.Bounds.X, s.Bounds.Y));
                monitor_size.Add(new Point(s.Bounds.Width, s.Bounds.Height));
                if ((s.Bounds.Top < setdata.d.window_pos.Y) && (s.Bounds.Bottom > setdata.d.window_pos.Y) && (s.Bounds.Left < setdata.d.window_pos.X) && (s.Bounds.Right > setdata.d.window_pos.X))
                {
                    IsInScreen = true;
                }
            }
            if (IsInScreen)
            {
                window.Top        = setdata.d.window_pos.Y;
                window.Left       = setdata.d.window_pos.X;
                window.Height     = setdata.d.window_size.Height;
                window.Width      = setdata.d.window_size.Width;
                window.Activated += Window_Activated;
            }
            //Title_Grid.Visibility = Visibility.Hidden;

            /*
             * Border winborder = new Border();
             * winborder.BorderThickness = new Thickness(7);
             * winborder.Child = Base_Grid;
             */
            /*neosize.Stroke = new SolidColorBrush(Color.FromArgb(255, 10, 10, 10));
             * neosize.StrokeThickness = 3;
             * neosize.Width = 100;
             * neosize.Height = 100;
             * neosize.Visibility = Visibility.Collapsed;
             * Base_Grid.Children.Add(neosize);
             */
            //info.Refresh();

            info.GetKeyAndTitleAndColor(key_erea, title, color_list);

            this.Visibility = Visibility.Visible;
        }