private void btnSave_Click(object sender, EventArgs e)
        {
            var options = new MgViewerOptions();
            _viewer.SelectionColor = lblSelectionColor.BackColor;
            options.SelectionColor = Util.ToHtmlColorWithAlpha(_viewer.SelectionColor);
            options.ShowVertexCoordinates = _viewer.ShowVertexCoordinatesWhenDigitizing = chkShowVertexCoordinates.Checked;
            options.ConvertTiledLayersToNonTiled = _viewer.ConvertTiledGroupsToNonTiled = chkConvertTiledToNonTiled.Checked;
            options.ZoomInFactor = _viewer.ZoomInFactor = Convert.ToDouble(numZoomInFactor.Value);
            options.ZoomOutFactor = _viewer.ZoomOutFactor = Convert.ToDouble(numZoomOutFactor.Value);

            var ser = new XmlSerializer(typeof(MgViewerOptions));
            using (var stream = File.OpenWrite(Path.Combine(_saveDirectory, MgViewerOptions.FILENAME)))
            {
                ser.Serialize(stream, options);
            }
            MessageBox.Show(Strings.TextOptionsSaved);
            base.Close();
        }
示例#2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            var options = new MgViewerOptions();

            _viewer.SelectionColor               = lblSelectionColor.BackColor;
            options.SelectionColor               = Util.ToHtmlColorWithAlpha(_viewer.SelectionColor);
            options.ShowVertexCoordinates        = _viewer.ShowVertexCoordinatesWhenDigitizing = chkShowVertexCoordinates.Checked;
            options.ConvertTiledLayersToNonTiled = _viewer.ConvertTiledGroupsToNonTiled = chkConvertTiledToNonTiled.Checked;
            options.ZoomInFactor  = _viewer.ZoomInFactor = Convert.ToDouble(numZoomInFactor.Value);
            options.ZoomOutFactor = _viewer.ZoomOutFactor = Convert.ToDouble(numZoomOutFactor.Value);

            var ser = new XmlSerializer(typeof(MgViewerOptions));

            using (var stream = File.OpenWrite(Path.Combine(_saveDirectory, MgViewerOptions.FILENAME)))
            {
                ser.Serialize(stream, options);
            }
            MessageBox.Show(Strings.TextOptionsSaved);
            base.Close();
        }