コード例 #1
0
ファイル: LMForm.cs プロジェクト: vlo111/LaserMarkTerminal
        private void LMForm_Load(object sender, EventArgs e)
        {
            this.rightPanelControl.Width = SystemInformation.VirtualScreen.Width / 100 * 15;

            // Init image parent
            this.foregroundCustomPictureEdit.Parent = this.backgroundCustomPictureEdit;
            this.backgroundCustomPictureEdit.Parent = this.panelControl1;

            if (this.backgroundCustomPictureEdit.Image != null && this.foregroundCustomPictureEdit != null)
            {
                CurrentEzd.BgPictureEdit = this.backgroundCustomPictureEdit;

                CurrentEzd.EzdPictureEdit = this.foregroundCustomPictureEdit;

                // Initial preview
                this.preview = new Preview(PictureControl.Images.PanelToImage(this.panelControl1));

                this.preview.StartPosition = FormStartPosition.Manual;

                this.preview.Show();
            }

            CurrentUIData.RightLayoutControl = this.rightPanelControl;

            CurrentUIData.WindowSize = new Size(ClientRectangle.Width, ClientRectangle.Height);

            CurrentUIData.RightPanelSize = new Size(this.rightPanelControl.Width, SystemInformation.VirtualScreen.Height);

            try
            {
                EzdDataL.Load data = new EzdDataL.Load();

                if (!data.Go())
                {
                    if (new CustomMessage().ShowDialog() >= 0)
                    {
                        Application.Exit();
                    }

                    Application.Exit();
                }
            }
            catch (Exception)
            {
                Application.Exit();
            }
        }
コード例 #2
0
ファイル: LMForm.cs プロジェクト: vlo111/LaserMarkTerminal
        private void SaveBtn_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(this.loginTextEdit.Text) && !string.IsNullOrEmpty(this.passwordTextEdit.Text) &&
                !string.IsNullOrEmpty(this.urlTextEdit.Text))
            {
                if (CurrentEzd.BgPictureEdit != null && CurrentEzd.EzdPictureEdit != null)
                {
                    if (currentPEindex < 10)
                    {
                        // current saved
                        var selectedImage = this.layoutControl1.Controls.OfType <PictureEdit>()
                                            .Where(c => c.TabIndex == currentPEindex + 40)
                                            .Select(c => c)
                                            .First();

                        selectedImage.Image  = Images.PanelToImage(this.panelControl1);
                        selectedImage.Cursor = Cursors.Hand;
                        selectedImage.Properties.ReadOnly = false;
                        selectedImage.Tag = "filled";

                        if (currentPEindex < 9)
                        {
                            // next plus
                            var selectedNextImage = this.layoutControl1.Controls.OfType <PictureEdit>()
                                                    .Where(c => c.TabIndex == (currentPEindex + 1) + 40)
                                                    .Select(c => c)
                                                    .First();

                            if (selectedNextImage.Properties.ReadOnly)
                            {
                                selectedNextImage.Image  = Image.FromFile($@"{iconsPath}plus.png");
                                selectedNextImage.Cursor = Cursors.Hand;
                                selectedNextImage.Properties.ReadOnly = false;
                                selectedNextImage.Tag = "next";
                            }
                        }

                        SaveImageDB();

                        if (this.preview != null)
                        {
                            this.preview.Close();
                        }

                        // Initial preview
                        this.foregroundCustomPictureEdit.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
                        this.preview = new Preview(PictureControl.Images.PanelToImage(this.panelControl1));
                        this.foregroundCustomPictureEdit.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Default;
                        this.preview.StartPosition = FormStartPosition.Manual;

                        this.preview.Show();
                    }
                }
                else
                {
                    XtraMessageBox.Show("Выберите обложку или ezd файл", "Error", MessageBoxButtons.OK);
                }
            }
            else
            {
                XtraMessageBox.Show("Пожалуйста войдите в систему", "Error", MessageBoxButtons.OK);
            }
        }