Ejemplo n.º 1
0
 private void btnEditLayerStyle_Click(object sender, EventArgs e)
 {
     using (var diag = new RedlineStyleDialog(_style))
     {
         if (diag.ShowDialog() == DialogResult.OK)
         {
             _style = diag.GetUpdatedStyle();
         }
     }
 }
Ejemplo n.º 2
0
 public NewRedlineLayerDialog(RedlineStyle style, RedlineDataStoreFormat defaultDataStore, int defaultGeometryTypes, string defaultName)
     : this()
 {
     _style = style;
     cmbDataStoreFormat.DataSource = Enum.GetValues(typeof(RedlineDataStoreFormat));
     
     txtName.Text = defaultName;
     cmbDataStoreFormat.SelectedItem = defaultDataStore;
     if ((defaultGeometryTypes & MgFeatureGeometricType.Point) == MgFeatureGeometricType.Point)
         chkPoints.Checked = true;
     if ((defaultGeometryTypes & MgFeatureGeometricType.Curve) == MgFeatureGeometricType.Curve)
         chkLines.Checked = true;
     if ((defaultGeometryTypes & MgFeatureGeometricType.Surface) == MgFeatureGeometricType.Surface)
         chkPolygons.Checked = true;
 }
Ejemplo n.º 3
0
        private void InitFromStyle(RedlineStyle style)
        {
            cmbLabelSizeUnits.DataSource = Enum.GetValues(typeof(SizeUnit));
            cmbLineThicknessUnit.DataSource = Enum.GetValues(typeof(SizeUnit));
            cmbPolyBorderThicknessUnit.DataSource = Enum.GetValues(typeof(SizeUnit));
            cmbMarkerSizeUnit.DataSource = Enum.GetValues(typeof(SizeUnit));

            cmbLinePattern.DataSource = Enum.GetValues(typeof(LinePattern));
            cmbPolyBorderPattern.DataSource = Enum.GetValues(typeof(LinePattern));
            cmbPolyFillPattern.DataSource = Enum.GetValues(typeof(FillPattern));

            cmbPointMarkerType.DataSource = Enum.GetValues(typeof(MarkerType));
            cmbLabelStyle.DataSource = Enum.GetValues(typeof(LabelStyle));

            numFillTransparency.Value = Convert.ToDecimal(style.FillTransparency);

            cmbLabelSizeUnits.SelectedItem = style.LabelSizeUnits;
            cmbLineThicknessUnit.SelectedItem = style.LineSizeUnits;
            cmbPolyBorderThicknessUnit.SelectedItem = style.BorderSizeUnits;
            cmbMarkerSizeUnit.SelectedItem = style.MarkerSizeUnits;
            cmbLinePattern.SelectedItem = style.LinePattern;
            cmbPolyBorderPattern.SelectedItem = style.BorderPattern;
            cmbPolyFillPattern.SelectedItem = style.FillPattern;
            cmbPointMarkerType.SelectedItem = style.MarkerType;
            cmbLabelStyle.SelectedItem = style.LabelBackStyle;

            clrLabelBackground.BackColor = style.LabelBackColor;
            clrLabelForeground.BackColor = style.LabelForeColor;
            
            chkTransparent.Checked = style.FillBackTransparency;

            clrPolyFillBackground.BackColor = style.FillBackColor;
            clrPolyFillForeground.BackColor = style.FillForeColor;
            clrLine.BackColor = style.LineColor;
            clrMarker.BackColor = style.MarkerColor;
            clrPolyBorder.BackColor = style.BorderColor;

            txtLabelSizeValue.Text = style.LabelFontSize.ToString(CultureInfo.InvariantCulture);
            txtLineThicknessValue.Text = style.LineThickness.ToString(CultureInfo.InvariantCulture);
            txtMarkerSizeValue.Text = style.MarkerSize.ToString(CultureInfo.InvariantCulture);
            txtPolyBorderThicknessValue.Text = style.BorderThickness.ToString(CultureInfo.InvariantCulture);

            chkBold.Checked = style.LabelBold;
            chkItalic.Checked = style.LabelItalic;
            chkUnderline.Checked = style.LabelUnderline;
        }
Ejemplo n.º 4
0
 private CreateRedlineLayerParams GetCreateParams()
 {
     if (_component.UseDefaultSettings)
     {
         //TODO: Popup UI dialog for user to enter this information if desired
         return(new CreateRedlineLayerParams()
         {
             AddToMap = true,
             Format = _component.DefaultDataStoreFormat,
             GeometryTypes = _component.DefaultGeometryTypes,
             Name = GetName(),
             Style = RedlineStyle.CreateDefault(),
             StyleType = _component.StylizationType
         });
     }
     else
     {
         using (var diag = new NewRedlineLayerDialog(RedlineStyle.CreateDefault(),
                                                     _component.DefaultDataStoreFormat,
                                                     _component.DefaultGeometryTypes,
                                                     GetName()))
         {
             if (diag.ShowDialog() == DialogResult.OK)
             {
                 return(new CreateRedlineLayerParams()
                 {
                     AddToMap = true,
                     Format = diag.Format,
                     GeometryTypes = diag.GeometryTypes,
                     Name = diag.LayerName,
                     Style = diag.Style,
                     StyleType = _component.StylizationType
                 });
             }
         }
     }
     return(null);
 }
Ejemplo n.º 5
0
 public RedlineStyleDialog(RedlineStyle style)
     : this()
 {
     InitFromStyle(style);
 }