コード例 #1
0
        private void linkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (e.Link.Length <= 0)
            {
                return;
            }
            if (transFolder == null)
            {
                transFolder = Environment.Layout.Folders.Add("Trans");
            }
            int    w  = transFolder.LoadIntOption("Width", 640);
            int    h  = transFolder.LoadIntOption("Height", 460);
            Screen sr = null;

            sr = Screen.FromControl(this);
            if (sr != null)
            {
                Console.WriteLine("{0}: {1}", DateTime.Now.ToString("HH:mm:ss fff"), sr);

                if (sr.WorkingArea.Width < w)
                {
                    w = sr.WorkingArea.Width;
                }
                if (sr.WorkingArea.Height < h)
                {
                    h = sr.WorkingArea.Height;
                }
            }
            else
            {
                Console.WriteLine("{0}: No Screen", DateTime.Now.ToString("HH:mm:ss fff"));
            }
            Web.UrlBrowseDialog dialog = new Web.UrlBrowseDialog(e.Link.LinkData.ToString(),
                                                                 Environment.StringResources.GetString("Control_TransactionControl_linkLabel_LinkClicked_Message1") + " ")
            {
                Tag = docID
            };
            dialog.DialogEvent += urlBrowseDialog_DialogEvent;
            formOpen            = true;
            dialog.Show();
            dialog.Width  = w;
            dialog.Height = h;
            if (sr.WorkingArea.Bottom < dialog.Bottom || dialog.Top < sr.WorkingArea.Top)
            {
                dialog.Top = sr.WorkingArea.Top;
            }
            if (sr.WorkingArea.Right < dialog.Right || dialog.Left < sr.WorkingArea.Left)
            {
                dialog.Left = sr.WorkingArea.Left;
            }
        }
コード例 #2
0
        public void LoadState(Options.Folder optFolder)
        {
            if (optFolder == null)
            {
                return;
            }

            OptionFolder = optFolder;

            string boolObj;
            bool   tempPlaces = Places;

            if (!locked)
            {
                boolObj    = optFolder.LoadStringOption("Places", tempPlaces.ToString());
                tempPlaces = Convert.ToBoolean(boolObj);
            }

            if (!locked || tempPlaces)
            {
                boolObj = optFolder.LoadStringOption("Free", Free.ToString());
                Free    = Convert.ToBoolean(boolObj);

                boolObj  = optFolder.LoadStringOption("Insiders", Insiders.ToString());
                Insiders = Convert.ToBoolean(boolObj);

                unitID = optFolder.LoadIntOption("UnitID", 0);
            }

            if (!locked || !tempPlaces)
            {
                boolObj = optFolder.LoadStringOption("Guests", Guests.ToString());
                Guests  = Convert.ToBoolean(boolObj);

                companyID = optFolder.LoadIntOption("CompanyID", 0);
            }

            checkInsiders.Enabled = tempPlaces;
            checkFree.Enabled     = tempPlaces && !freeLocked;
            checkGuests.Enabled   = !tempPlaces;

            Places = tempPlaces;
        }
コード例 #3
0
        private void linkCreate_Clicked(object sender, EventArgs e)
        {
            Web.UrlBrowseDialog viewDialog = new Web.UrlBrowseDialog(Environment.CreateTransactionString + docID.ToString(),
                                                                     Environment.StringResources.GetString("Control_TransactionControl_Message1"));
            if (crFolder == null)
            {
                crFolder = Environment.Layout.Folders.Add("TransCreate");
            }
            int    w  = crFolder.LoadIntOption("Width", 640);
            int    h  = crFolder.LoadIntOption("Height", 460);
            Form   fr = this.FindForm();
            Screen sr = null;

            if (fr != null)
            {
                sr = Screen.AllScreens.FirstOrDefault(x => x.Bounds.IntersectsWith(fr.Bounds));
                if (sr != null)
                {
                    if (sr.WorkingArea.Width < w)
                    {
                        w = sr.WorkingArea.Width;
                    }
                    if (sr.WorkingArea.Height < h)
                    {
                        h = sr.WorkingArea.Height;
                    }
                }
            }
            viewDialog.Tag          = docID;
            viewDialog.DialogEvent += urlBrowseDialog_DialogEvent;
            formOpen = true;
            viewDialog.Show();
            viewDialog.Width  = w;
            viewDialog.Height = h;
            if (sr.WorkingArea.Bottom < viewDialog.Bottom)
            {
                viewDialog.Top = sr.WorkingArea.Top;
            }
            if (sr.WorkingArea.Right < viewDialog.Right)
            {
                viewDialog.Left = sr.WorkingArea.Left;
            }
        }
コード例 #4
0
        private void SelectDocUniversalDialog_Load(object sender, EventArgs e)
        {
            // загружаем настройки
            options = Environment.Layout.Folders.Add(Name);
            bool maximized = (WindowState == FormWindowState.Maximized);

            if (options.LoadStringOption("Maximized", maximized.ToString()) == "True")
            {
                WindowState = FormWindowState.Maximized;
            }
            else
            {
                Left = options.LoadIntOption("Left", Left);
                Top  = options.LoadIntOption("Top", Top);

                Width  = options.LoadIntOption("Width", Width);
                Height = options.LoadIntOption("Height", Height);
            }

            int width = labelInfo.Width;

            if (width < panelInfo.Width)
            {
                panelInfo.Width        = width + SystemInformation.VerticalScrollBarWidth;
                buttonChange.Location  = new Point(width + 16, buttonChange.Location.Y);
                buttonOpenDoc.Location = new Point(buttonChange.Size.Width + buttonChange.Location.X + SystemInformation.VerticalScrollBarWidth,
                                                   buttonChange.Location.Y);
            }
            else if (width > panelInfo.Width)
            {
                if (stringCount < 3)
                {
                    panelText.Height += SystemInformation.VerticalScrollBarWidth + 1;
                }
                buttonChange.Location  = new Point(SystemInformation.VerticalScrollBarWidth + panelInfo.Width, 8);
                buttonOpenDoc.Location = new Point(buttonChange.Size.Width + buttonChange.Location.X + SystemInformation.VerticalScrollBarWidth,
                                                   buttonChange.Location.Y);
            }
            panelInfo.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left;


            buttonChange.BringToFront();
            buttonOpenDoc.BringToFront();
            panelTop.Height     = options.LoadIntOption("PanelTopHeight", panelTop.Height);
            panelLeft.Width     = options.LoadIntOption("PanelLeftWidth", panelLeft.Width);
            groupPersons.Height = options.LoadIntOption("GroupPersonsHeight", groupPersons.Height);

            // загружаем документы
            listPersons.Columns.Add(Environment.PersonWord.GetForm(Cases.I, true, true), listPersons.Width - SystemInformation.VerticalScrollBarWidth - 4,
                                    HorizontalAlignment.Left);
            groupPersons.Text         = Environment.PersonWord.GetForm(Cases.I, true, true);
            docControl.ZoomText       = options.LoadStringOption("ZoomString", Environment.StringResources.GetString("ToWidth"));
            docControl.ShowThumbPanel = Convert.ToBoolean(options.LoadStringOption("ShowThumb", false.ToString()));

            docGrid.Init(Environment.Layout);
            docGrid.Columns.Add(dataGridTextBoxColumnDocID);
            docGrid.Columns.Add(dataGridTextBoxColumnType);
            docGrid.Columns.Add(dataGridTextBoxColumnDate);
            docGrid.Columns.Add(dataGridTextBoxColumnNumber);
            docGrid.Columns.Add(dataGridTextBoxColumnDecr);
            docGrid.DoubleClick        += docGrid_DoubleClick;
            docGrid.CurrentCellChanged += docGrid_CurrentCellChanged;

            BeginInvoke((MethodInvoker)(FillAll));
        }
コード例 #5
0
 private void InitLayoutProperties()
 {
     formLayout = Environment.Layout.Folders.Add(Name);
     Width      = formLayout.LoadIntOption("Width", Width);
     Height     = formLayout.LoadIntOption("Height", Height);
 }