Пример #1
0
        public GeneralInfoForm()
        {
            InitializeComponent();

            // fill the 2 combo boxes from text file
            sFillLUGComboBox(this.lugComboBox, @"/config/LugList.txt");
            sFillLUGComboBox(this.showComboBox, @"/config/EventList.txt");

            // fill the text controls
            this.AuthorTextBox.Text = Map.Instance.Author;
            this.lugComboBox.Text = Map.Instance.LUG;
            this.showComboBox.Text = Map.Instance.Show;
            this.dateTimePicker.Value = Map.Instance.Date;
            char[] splitter = { '\n' };
            this.commentTextBox.Lines = Map.Instance.Comment.Split(splitter);

            // compute the size
            RectangleF totalArea = Map.Instance.getTotalAreaInStud(true);
            MapData.Tools.Distance width = new MapData.Tools.Distance(totalArea.Width, MapData.Tools.Distance.Unit.STUD);
            MapData.Tools.Distance height = new MapData.Tools.Distance(totalArea.Height, MapData.Tools.Distance.Unit.STUD);

            this.labelWidthModule.Text = Math.Ceiling(width.DistanceInModule).ToString();
            this.labelHeightModule.Text = Math.Ceiling(height.DistanceInModule).ToString();

            this.labelWidthStud.Text = Math.Round(width.DistanceInStud).ToString();
            this.labelHeightStud.Text = Math.Round(height.DistanceInStud).ToString();

            this.labelWidthMeter.Text = width.DistanceInMeter.ToString("N2");
            this.labelHeightMeter.Text = height.DistanceInMeter.ToString("N2");

            this.labelWidthFeet.Text = width.DistanceInFeet.ToString("N2");
            this.labelHeightFeet.Text = height.DistanceInFeet.ToString("N2");
        }
Пример #2
0
 /// <summary>
 /// Copy constructor
 /// </summary>
 public RulerItem(RulerItem model)
     : base(model)
 {
     mColor = model.Color;
     mLineThickness = model.mLineThickness;
     mDisplayDistance = model.mDisplayDistance;
     mDisplayUnit = model.mDisplayUnit;
     mGuidelineColor = model.mGuidelineColor;
     mGuidelineThickness = model.mGuidelineThickness;
     mGuidelineDashPattern = model.mGuidelineDashPattern;
     mMeasuredDistance = new Tools.Distance(model.mMeasuredDistance.DistanceInCurrentUnit, model.mMeasuredDistance.CurrentUnit);
     mMeasureFont = model.mMeasureFont.Clone() as Font;
     mMeasureBrush = new SolidBrush(model.mMeasureBrush.Color);
     mMeasureStringFormat = model.mMeasureStringFormat.Clone() as StringFormat;
     // the rest of the variable should be initialized when the geometry will be created
 }