Пример #1
0
        private void InitializeTheUI(INumericFormat iNumericFormat, DuhringLine duhringLine, bool readOnly)
        {
            this.textBoxConcentration.InitializeVariable(iNumericFormat, duhringLine.Concentration);
            this.textBoxStartSolventBoilingPoint.InitializeVariable(iNumericFormat, duhringLine.StartSolventBoilingPoint);
            this.textBoxStartSolutionBoilingPoint.InitializeVariable(iNumericFormat, duhringLine.StartSolutionBoilingPoint);
            this.textBoxEndSolventBoilingPoint.InitializeVariable(iNumericFormat, duhringLine.EndSolventBoilingPoint);
            this.textBoxEndSolutionBoilingPoint.InitializeVariable(iNumericFormat, duhringLine.EndSolutionBoilingPoint);
            if (readOnly)
            {
                this.Controls.Remove(this.labelHook);
                this.Size = new Size(this.Width - 60, 20);

                this.textBoxConcentration.Location             = new Point(this.textBoxConcentration.Location.X - 60, 0);
                this.textBoxStartSolventBoilingPoint.Location  = new Point(this.textBoxStartSolventBoilingPoint.Location.X - 60, 0);
                this.textBoxStartSolutionBoilingPoint.Location = new Point(this.textBoxStartSolutionBoilingPoint.Location.X - 60, 0);
                this.textBoxEndSolventBoilingPoint.Location    = new Point(this.textBoxEndSolventBoilingPoint.Location.X - 60, 0);
                this.textBoxEndSolutionBoilingPoint.Location   = new Point(this.textBoxEndSolutionBoilingPoint.Location.X - 60, 0);

                this.textBoxConcentration.ReadOnly             = true;
                this.textBoxStartSolventBoilingPoint.ReadOnly  = true;
                this.textBoxStartSolutionBoilingPoint.ReadOnly = true;
                this.textBoxEndSolventBoilingPoint.ReadOnly    = true;
                this.textBoxEndSolutionBoilingPoint.ReadOnly   = true;
            }
        }
Пример #2
0
        public DuhringLineControl(INumericFormat iNumericFormat, DuhringLine duhringLine, bool readOnly)
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            this.duhringLine = duhringLine;
            this.IsSelected  = false;
            this.InitializeTheUI(iNumericFormat, this.duhringLine, readOnly);
        }
Пример #3
0
        private void UpdateTheUI(INumericFormat iNumericFormat, DuhringLinesCache duhringLinesCache)
        {
            this.panel.Controls.Clear();
            IEnumerator e = duhringLinesCache.DuhringLines.GetEnumerator();
            int         i = 0;

            while (e.MoveNext())
            {
                DuhringLine        duhringLine = (DuhringLine)e.Current;
                DuhringLineControl ctrl        = new DuhringLineControl(iNumericFormat, duhringLine, true);
                ctrl.Location = new Point(0, ctrl.Height * i++);
                this.panel.Controls.Add(ctrl);
            }
        }