コード例 #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
        public UpdateEzdDataFromApi(LMForm form)
        {
            try
            {
                EzdDataL.Load data = new EzdDataL.Load();

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

                    Application.Exit();
                }
            }
            catch (Exception)
            {
                Application.Exit();
            }

            _form       = form;
            _currentEzd = (PictureEdit)CurrentEzd.EzdPictureEdit;

            this.MaximumSize = CurrentUIData.RightPanelSize;
            this.MinimumSize = CurrentUIData.RightPanelSize;

            InitializeComponent();

            this.marginUpEmptySpace.MinSize = new Size(0, CurrentUIData.RightPanelSize.Height / 6);

            this.flyoutPanel1.OwnerControl = CurrentUIData.RightLayoutControl;

            this.flyoutPanel1.MaximumSize = CurrentUIData.RightPanelSize;
            this.flyoutPanel1.MinimumSize = CurrentUIData.RightPanelSize;

            this.flyoutPanel1.ShowPopup();
        }
コード例 #3
0
        public UpdateEzdData(List <Tuple <string, StringBuilder> > competitor)
        {
            try
            {
                EzdDataL.Load data = new EzdDataL.Load();

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

                    Application.Exit();
                }
            }
            catch (Exception)
            {
                Application.Exit();
            }

            _competitor = competitor;
            _currentEzd = (CustomPictureEdit)(CurrentEzd.EzdPictureEdit);

            this.MaximumSize = CurrentUIData.RightPanelSize;
            this.MinimumSize = CurrentUIData.RightPanelSize;

            InitializeComponent();

            try
            {
                this.flyoutPanel1.OwnerControl = CurrentUIData.RightLayoutControl;

                this.flyoutPanel1.MaximumSize = CurrentUIData.RightPanelSize;
                this.flyoutPanel1.MinimumSize = CurrentUIData.RightPanelSize;

                this.flyoutPanel1.ShowPopup();

                // Text
                var textEditSize = new Size();
                textEditSize.Height = 40 - 5;
                textEditSize.Width  = this.Width - (int)(this.Width / 2.5) - 5;

                // Text`s layout
                var middlelayoutItemSize = new Size();
                middlelayoutItemSize.Height = 40;
                middlelayoutItemSize.Width  = this.Width - (int)(this.Width / 2.5);

                // Button`s layout
                var layoutItemSize = new Size();
                layoutItemSize.Height = 40;
                layoutItemSize.Width  = 42;

                for (int index = 60; index < (60 + competitor.Count); index++)
                {
                    #region Initial TextEdits

                    var textEdit = this.layoutControl2.Controls.OfType <TextEdit>()
                                   .Where(c => c.TabIndex == index)
                                   .Select(c => c)
                                   .First();

                    textEdit.Text = competitor[index - 60].Item2.ToString();

                    textEdit.MinimumSize = textEditSize;
                    textEdit.MaximumSize = textEditSize;
                    textEdit.Size        = textEditSize;

                    textEdit.Properties.NullText = competitor[index - 60].Item1;

                    textEdits.Add(textEdit);

                    #endregion

                    #region Initial TextEditLayout

                    var layoutItem = layoutControlGroup3.Items
                                     .Where(p =>
                    {
                        if (p.Tag != null)
                        {
                            p.Tag = Convert.ToString(p.Tag);

                            string layout_index = index.ToString();

                            bool tag = (string)p.Tag == layout_index;

                            return(tag);
                        }
                        return(false);
                    })
                                     .Select(c => c)
                                     .First();

                    layoutItem.MaxSize = middlelayoutItemSize;
                    layoutItem.MinSize = middlelayoutItemSize;
                    layoutItem.Size    = middlelayoutItemSize;

                    #endregion

                    #region Initial Button`s layouts

                    var pluslayout = layoutControlGroup3.Items
                                     .Where(p =>
                    {
                        if (p.Tag != null)
                        {
                            p.Tag = Convert.ToString(p.Tag);

                            string layout_index = (index + 40).ToString();

                            bool tag = (string)p.Tag == layout_index;

                            return(tag);
                        }
                        return(false);
                    })
                                     .Select(c => c)
                                     .First();

                    var minuslayout = layoutControlGroup3.Items
                                      .Where(p =>
                    {
                        if (p.Tag != null)
                        {
                            p.Tag = Convert.ToString(p.Tag);

                            string layout_index = (index + 50).ToString();

                            bool tag = (string)p.Tag == layout_index;

                            return(tag);
                        }
                        return(false);
                    })
                                      .Select(c => c)
                                      .First();

                    pluslayout.MaxSize = layoutItemSize;
                    pluslayout.MinSize = layoutItemSize;
                    pluslayout.Size    = layoutItemSize;

                    minuslayout.MaxSize = layoutItemSize;
                    minuslayout.MinSize = layoutItemSize;
                    minuslayout.Size    = layoutItemSize;

                    #endregion
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }