예제 #1
0
        public override void Bind(IEditorService service)
        {
            _edsvc = service;
            _edsvc.RegisterCustomNotifier(this);

            _parent = service.GetEditedResource() as ILayerDefinition;
            Debug.Assert(_parent != null);

            _vl = _parent.SubLayer as IVectorLayerDefinition;
            Debug.Assert(_vl != null);

            if (service.IsNew)
            {
                //Let's try to auto-assign a feature class
                string[] classNames = _edsvc.FeatureService.GetClassNames(_vl.ResourceId, null);
                if (classNames.Length == 1) //Only one class in this Feature Source
                {
                    var clsDef = _edsvc.FeatureService.GetClassDefinition(_vl.ResourceId, classNames[0]);
                    if (!string.IsNullOrEmpty(clsDef.DefaultGeometryPropertyName)) //It has a default geometry
                    {
                        _vl.FeatureName = classNames[0];
                        _vl.Geometry = clsDef.DefaultGeometryPropertyName;
                    }
                }
            }

            _props = new List<INameStringPair>(_vl.PropertyMapping);
            //Modifying the visibility constitutes a change in the resource
            //_props.ListChanged += OnPropertyListChanged;
            PopulatePropertyList();
            _vl.PropertyChanged += OnVectorLayerPropertyChanged;
        }
예제 #2
0
        public override void Bind(IEditorService service)
        {
            _edSvc = service;
            _edSvc.RegisterCustomNotifier(this);
            _wm = (IWatermarkDefinition)service.GetEditedResource();

            NumericBinder.BindValueChanged(numRotation, _wm.Appearance, "Rotation");
            NumericBinder.BindValueChanged(numTransparency, _wm.Appearance, "Transparency");

            if (_wm.Position.Type == PositionType.Tile)
                _tile = (ITilePosition)_wm.Position;
            else if (_wm.Position.Type == PositionType.XY)
                _xy = (IXYPosition)_wm.Position;

            if (_tile == null)
            {
                _tile = _wm.CreateTilePosition();
                rdXY.Checked = true;
            }
            else if (_xy == null)
            {
                _xy = _wm.CreateXYPosition();
                rdTile.Checked = true;
            }
        }
예제 #3
0
        public override void Bind(IEditorService service)
        {
            _edsvc = service;
            _edsvc.RegisterCustomNotifier(this);

            try
            {
                _fsvc = (IFusionService)_edsvc.GetService((int)ServiceType.Fusion);
                _baseUrl = service.GetCustomProperty("BaseUrl").ToString(); //NOXLATE

                if (!_baseUrl.EndsWith("/")) //NOXLATE
                    _baseUrl += "/"; //NOXLATE
            }
            catch
            {
                throw new NotSupportedException(Strings.IncompatibleConnection);
            }

            _edsvc.Saved += OnSaved;
            _flexLayout = (IApplicationDefinition)service.GetEditedResource();

            TextBoxBinder.BindText(txtTemplateUrl, _flexLayout, "TemplateUrl"); //NOXLATE
            TextBoxBinder.BindText(txtTitle, _flexLayout, "Title"); //NOXLATE
            var templates = _fsvc.GetApplicationTemplates();
            InitializeTemplateList(templates);

            GeneratePreviewUrl();
        }
예제 #4
0
        /// <summary>
        /// Binds the specified service.
        /// </summary>
        /// <param name="service">The service.</param>
        public override void Bind(IEditorService service)
        {
            _fs = service.GetEditedResource() as IFeatureSource;
            service.RegisterCustomNotifier(this);
            Debug.Assert(_fs != null);

            CollapsiblePanel panel = FsEditorMap.GetPanel(_fs.Provider);
            var b = panel as IEditorBindable;
            if (b != null)
                b.Bind(service);

            panel.Dock = DockStyle.Top;

            var ov = new CoordSysOverrideCtrl();
            ov.Bind(service);

            ov.Dock = DockStyle.Top;

            var ext = new ExtensionsCtrl();
            ext.Bind(service);

            ext.Dock = DockStyle.Top;

            this.Controls.Add(ext);
            this.Controls.Add(ov);
            this.Controls.Add(panel);
        }
예제 #5
0
        /// <summary>
        /// Sets the initial state of this editor and sets up any databinding
        /// within such that user interface changes will propagate back to the
        /// model.
        /// </summary>
        /// <param name="service"></param>
        public override void Bind(IEditorService service)
        {
            _edsvc = service;
            _vl = (IVectorLayerDefinition)((ILayerDefinition)service.GetEditedResource()).SubLayer;

            service.RegisterCustomNotifier(this);
            resSettings.Bind(service);
            layerProperties.Bind(service);
            layerStyles.Bind(service);

            //Add watermark component if supported
            var sl2 = _vl as ISubLayerDefinition2;
            if (sl2 != null)
            {
                this.Controls.Remove(resSettings);
                this.Controls.Remove(layerProperties);
                this.Controls.Remove(layerStyles);

                var wm = new WatermarkCollectionEditorCtrl(service, sl2);
                wm.Dock = DockStyle.Top;

                this.Controls.Add(wm);
                this.Controls.Add(layerStyles);
                this.Controls.Add(layerProperties);
                this.Controls.Add(resSettings);
            }
        }
예제 #6
0
        /// <summary>
        /// Sets the initial state of this editor and sets up any databinding
        /// within such that user interface changes will propagate back to the
        /// model.
        /// </summary>
        /// <param name="service"></param>
        public override void Bind(IEditorService service)
        {
            _edSvc = service;
            _map = _edSvc.GetEditedResource() as IMapDefinition;
            _map.SetExtentsFromFirstAddedLayer = true;

            mapSettingsCtrl.Bind(service);
            mapLayersCtrl.Bind(service);

            var mp2 = _map as IMapDefinition2;
            if (mp2 != null)
            {
                this.Controls.Remove(mapSettingsCtrl);
                this.Controls.Remove(mapLayersCtrl);

                var wm = new WatermarkCollectionEditorCtrl(service, mp2);
                wm.Dock = DockStyle.Fill;

                this.Controls.Add(wm);
                this.Controls.Add(mapLayersCtrl);
                this.Controls.Add(mapSettingsCtrl);
            }

            mapLayersCtrl.RequestLayerOpen += new OpenLayerEventHandler(OnRequestLayerOpen);
        }
예제 #7
0
        public override void Bind(IEditorService service)
        {
            _edSvc = service;
            _edSvc.RegisterCustomNotifier(this);
            _sym = (ISimpleSymbolDefinition)_edSvc.GetEditedResource();
            _rbox = _sym.ResizeBox;
            try
            {
                _init = true;

                chkEnableResizeBox.Checked = (_rbox != null);
                grpResizeBox.Enabled = chkEnableResizeBox.Checked;

                if (_rbox == null)
                    _rbox = _sym.CreateResizeBox();

                symGrowControl.Items = SymbolField.GetItems<GrowControl>();

                symGrowControl.Bind(_rbox, "GrowControl");
                symHeight.Bind(_rbox, "SizeY");
                symWidth.Bind(_rbox, "SizeX");
                symXCoord.Bind(_rbox, "PositionX");
                symYCoord.Bind(_rbox, "PositionY");
            }
            finally
            {
                _init = false;
            }
        }
        public override void Bind(IEditorService service)
        {
            cmbBgColor.ResetColors();
            service.RegisterCustomNotifier(this);
            _layout = (IPrintLayout)service.GetEditedResource();

            //ColorComboBox requires custom databinding
            cmbBgColor.CurrentColor = _layout.PageProperties.BackgroundColor;
            cmbBgColor.SelectedIndexChanged += (sender, e) =>
            {
                _layout.PageProperties.BackgroundColor = cmbBgColor.CurrentColor;
            };
            _layout.LayoutProperties.PropertyChanged += (sender, e) =>
            {
                OnResourceChanged();
            };

            CheckBoxBinder.BindChecked(chkCustomLogos, _layout.LayoutProperties, "ShowCustomLogos");
            CheckBoxBinder.BindChecked(chkCustomText, _layout.LayoutProperties, "ShowCustomText");
            CheckBoxBinder.BindChecked(chkDateTime, _layout.LayoutProperties, "ShowDateTime");
            CheckBoxBinder.BindChecked(chkLegend, _layout.LayoutProperties, "ShowLegend");
            CheckBoxBinder.BindChecked(chkNorthArrow, _layout.LayoutProperties, "ShowNorthArrow");
            CheckBoxBinder.BindChecked(chkScaleBar, _layout.LayoutProperties, "ShowScaleBar");
            CheckBoxBinder.BindChecked(chkTitle, _layout.LayoutProperties, "ShowTitle");
            CheckBoxBinder.BindChecked(chkURL, _layout.LayoutProperties, "ShowURL");
        }
예제 #9
0
        //--------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="OutputViewModel" /> class.
        /// </summary>
        /// <param name="editor">The editor. Can be <see langword="null"/> at design-time.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="editor"/> is <see langword="null"/>.
        /// </exception>
        public OutputViewModel(IEditorService editor)
        {
            if (editor == null && !WindowsHelper.IsInDesignMode)
                throw new ArgumentNullException(nameof(editor));

            _editor = editor;
            DisplayName = "Output";
            IsPersistent = true;
            DockId = DockIdString;
            //Icon = MultiColorGlyphs.Output;

            _buffers = new Dictionary<string, StringBuilder>
            {
                { DefaultView, new StringBuilder() }
            };
            Views = new ObservableCollection<string> { DefaultView };
            PrintPreviewCommand = new DelegateCommand(ShowPrintPreview, CanPrint);
            PrintCommand = new DelegateCommand(Print, CanPrint);

            _nlogTarget = editor?.Services.GetInstance<INLogTarget>();
            if (_nlogTarget != null)
            {
                _buffers.Add(NLogView, new StringBuilder());
                Views.Add(NLogView);
            }
            _windowService = editor?.Services.GetInstance<IWindowService>().ThrowIfMissing();

            Output = new TextDocument { UndoStack = { SizeLimit = 0 } };
            SelectedView = DefaultView;
        }
예제 #10
0
        public RasterDefinitionCtrl(WmsConfigurationDocument config, RasterWmsItem item, IEditorService edsvc)
        {
            InitializeComponent();
            cmbBackground.ResetColors();
            _config = config;

            _fs = (IFeatureSource)edsvc.GetEditedResource();
            _item = item;
            _edsvc = edsvc;

            txtImageFormat.Text = item.ImageFormat;
            chkTransparent.Checked = item.IsTransparent;
            cmbBackground.CurrentColor = item.BackgroundColor;
            txtElevation.Text = item.ElevationDimension;
            txtEpsg.Text = item.SpatialContextName;
            txtTime.Text = item.Time;

            txtImageFormat.TextChanged += (s, e) => { item.ImageFormat = txtImageFormat.Text; };
            chkTransparent.CheckedChanged += (s, e) => { item.IsTransparent = chkTransparent.Checked; };
            cmbBackground.SelectedIndexChanged += (s, e) => { item.BackgroundColor = cmbBackground.CurrentColor; };
            txtElevation.TextChanged += (s, e) => { item.ElevationDimension = txtElevation.Text; };
            txtEpsg.TextChanged += (s, e) => { item.SpatialContextName = txtEpsg.Text; };
            txtTime.TextChanged += (s, e) => { item.Time = txtTime.Text; };

            List<string> names = new List<string>();
            foreach (var layer in item.Layers)
            {
                names.Add(layer.Name);
            }
            txtLayers.Lines = names.ToArray();
            lnkUpdate.Enabled = false;
        }
예제 #11
0
        public FontStyleEditor(IEditorService editor, ClassDefinition schema, string featureSource)
            : this()
        {
            m_editor = editor;
            m_schema = schema;

            var fs = (IFeatureSource)editor.ResourceService.GetResource(featureSource);

            _factory = (ILayerElementFactory)editor.GetEditedResource();

            m_providername = fs.Provider;
            m_featureSource = featureSource;

            propertyCombo.Items.Clear();
            foreach (var col in m_schema.Properties)
            {
                if (col.Type == PropertyDefinitionType.Data)
                    propertyCombo.Items.Add(col.Name);
            }
            propertyCombo.Items.Add(Strings.ExpressionItem);

            fontCombo.Items.Clear();
            foreach (FontFamily f in new System.Drawing.Text.InstalledFontCollection().Families)
                fontCombo.Items.Add(f.Name);
        }
예제 #12
0
 public override void Bind(IEditorService service)
 {
     _service = service;
     _service.RegisterCustomNotifier(this);
     _fs = (IFeatureSource)_service.GetEditedResource();
     InitDefaults();
 }
예제 #13
0
        public XYPositionEditor(IXYPosition pos, IEditorService service)
        {
            InitializeComponent();
            _pos = pos;
            _edSvc = service;

            try
            {
                _init = true;

                cmbHorizontalAlignment.DataSource = Enum.GetValues(typeof(HorizontalAlignmentType));
                cmbVerticalAlignment.DataSource = Enum.GetValues(typeof(VerticalAlignmentType));
                cmbHorizontalUnits.DataSource = Enum.GetValues(typeof(UnitType));
                cmbVerticalUnits.DataSource = Enum.GetValues(typeof(UnitType));

                cmbVerticalAlignment.SelectedItem = _pos.YPosition.Alignment;
                cmbVerticalUnits.SelectedItem = _pos.YPosition.Unit;
                numVerticalOffset.Value = Convert.ToDecimal(_pos.YPosition.Offset);

                cmbHorizontalUnits.SelectedItem = _pos.XPosition.Unit;
                cmbHorizontalAlignment.SelectedItem = _pos.XPosition.Alignment;
                numHorizontalOffset.Value = Convert.ToDecimal(_pos.XPosition.Offset);
            }
            finally
            {
                _init = false;
            }
        }
        public override void Bind(IEditorService service)
        {
            _init = true;
            try
            {
                _edsvc = service;
                _edsvc.RegisterCustomNotifier(this);
                _rl = (IRasterLayerDefinition)((ILayerDefinition)service.GetEditedResource()).SubLayer;

                _activeRange = _rl.GetScaleRangeAt(0);
                _colorStyle = _activeRange.ColorStyle;

                _backgroundColor = _colorStyle.GetColorRuleAt(0);
                _foregroundColor = _colorStyle.GetColorRuleAt(1);

                txtVisibleFrom.Text = (_activeRange.MinScale.HasValue ? _activeRange.MinScale.Value : 0).ToString();
                txtRebuildFactor.Text = _activeRange.RebuildFactor.ToString();
                cmbVisibleTo.Text = (_activeRange.MaxScale.HasValue ? _activeRange.MaxScale.Value.ToString() : Strings.Infinity);

                string fg = _foregroundColor.Color.GetValue();
                string bg = _backgroundColor.Color.GetValue();

                if (!string.IsNullOrEmpty(fg))
                    cmbForegroundColor.CurrentColor = Utility.ParseHTMLColor(fg);
                if (!string.IsNullOrEmpty(bg))
                    cmbBackgroundColor.CurrentColor = Utility.ParseHTMLColor(bg);
            }
            finally
            {
                _init = false;
            }
        }
예제 #15
0
        //--------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="HighlightingManager"/> class.
        /// </summary>
        /// <param name="editor">The editor.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="editor"/> is <see langword="null"/>.
        /// </exception>
        public HighlightingManager(IEditorService editor)
        {
            if (editor == null)
                throw new ArgumentNullException(nameof(editor));

            _themeService = editor.Services.GetInstance<IThemeService>().ThrowIfMissing();
        }
예제 #16
0
        //--------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="EditorDockTabPaneViewModel" /> class.
        /// </summary>
        /// <param name="editor">The editor.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="editor"/> is <see langword="null"/>.
        /// </exception>
        public EditorDockTabPaneViewModel(IEditorService editor)
        {
            if (editor == null)
                throw new ArgumentNullException(nameof(editor));

            Editor = editor;
        }
예제 #17
0
        public WmsAdvancedConfigurationDialog(IEditorService service)
        {
            InitializeComponent();
            grdSpatialContexts.AutoGenerateColumns = false;
            _service = service;
            _fs = (IFeatureSource)_service.GetEditedResource();
            txtFeatureServer.Text = _fs.GetConnectionProperty("FeatureServer"); //NOXLATE
            string xml = _fs.GetConfigurationContent();
            if (!string.IsNullOrEmpty(xml))
            {
                try
                {
                    _config = (WmsConfigurationDocument)ConfigurationDocument.LoadXml(xml);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format(Strings.ErrorLoadingWmsConfig, ex.Message), Strings.TitleError, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    MakeDefaultDocument();
                }
            }
            else
            {
                MakeDefaultDocument();
            }

            lstFeatureClasses.DataSource = _config.RasterOverrides;
            grdSpatialContexts.DataSource = _config.SpatialContexts;
        }
예제 #18
0
        public ElevationDialog(IEditorService edSvc, IVectorScaleRange2 vsr2, string featureSourceId, ClassDefinition clsDef, string provider)
        {
            InitializeComponent();

            _edSvc = edSvc;
            _vsr2 = vsr2;
            _clsDef = clsDef;
            _provider = provider;
            _featureSourceId = featureSourceId;

            cmbUnits.DataSource = Enum.GetValues(typeof(LengthUnitType));
            cmbZOffsetType.DataSource = Enum.GetValues(typeof(ElevationTypeType));

            _elSettings = vsr2.ElevationSettings;
            grpSettings.Enabled = (_elSettings != null);
            chkEnabled.Checked = (_elSettings != null);

            if (_elSettings == null)
                _elSettings = vsr2.Create("0", "0", ElevationTypeType.RelativeToGround, LengthUnitType.Meters); //NOXLATE

            try
            {
                _init = true;

                txtZExtrusion.Text = _elSettings.ZExtrusion;
                txtZOffset.Text = _elSettings.ZOffset;
                cmbUnits.SelectedItem = _elSettings.Unit;
                cmbZOffsetType.SelectedItem = _elSettings.ZOffsetType;
            }
            finally
            {
                _init = false;
            }
        }
예제 #19
0
 public WatermarkInstanceEditorDialog(IEditorService service, IWatermark watermark)
 {
     InitializeComponent();
     _ed = new WatermarkInstanceEditor(service, watermark);
     _ed.Dock = DockStyle.Fill;
     panel1.Controls.Add(_ed);
 }
예제 #20
0
        public WatermarkInstanceEditor(IEditorService service, IWatermark watermark)
        {
            InitializeComponent();
            _edSvc = service;
            _watermark = watermark;

            try
            {
                _init = true;

                cmbUsage.DataSource = Enum.GetValues(typeof(UsageType));
                cmbUsage.SelectedItem = _watermark.Usage;
                txtResourceId.Text = _watermark.ResourceId;
                txtName.Text = _watermark.Name;

                _ovAppearance = _watermark.AppearanceOverride;

                chkOverrideAppearance.Checked = (_ovAppearance != null);
                chkOverridePosition.Checked = (_watermark.PositionOverride != null);

                if (_ovAppearance == null)
                    _ovAppearance = _watermark.CreateDefaultAppearance();

                //Init appearance
                numOvRotation.Value = Convert.ToDecimal(_ovAppearance.Rotation);
                numOvTransparency.Value = Convert.ToDecimal(_ovAppearance.Transparency);

                if (_watermark.PositionOverride == null)
                {
                    _ovTilePosition = _watermark.CreateDefaultTilePosition();
                    _ovXyPosition = _watermark.CreateDefaultXYPosition();
                }
                else
                {
                    if (_watermark.PositionOverride.Type == PositionType.Tile)
                    {
                        _ovXyPosition = _watermark.CreateDefaultXYPosition();
                        _ovTilePosition = (ITilePosition)_watermark.PositionOverride;

                        rdOvTilePos.Checked = true;
                    }
                    else
                    {
                        _ovXyPosition = (IXYPosition)_watermark.PositionOverride;
                        _ovTilePosition = _watermark.CreateDefaultTilePosition();

                        rdOvPosXY.Checked = true;
                    }
                    TilePos_CheckedChanged(this, EventArgs.Empty);
                }

                Debug.Assert(_ovTilePosition != null);
                Debug.Assert(_ovXyPosition != null);
            }
            finally
            {
                _init = false;
            }
        }
예제 #21
0
        public void Bind(IEditorService service)
        {
            _service = service;
            _service.RegisterCustomNotifier(this);

            var lyr = service.GetEditedResource() as ILayerDefinition;
            Debug.Assert(lyr != null);

            _dlayer = lyr.SubLayer as IDrawingLayerDefinition;
            Debug.Assert(_dlayer != null);

            TextBoxBinder.BindText(txtDrawingSource, _dlayer, "ResourceId"); //NOXLATE
            cmbSheet.DisplayMember = "Title"; //NOXLATE
            cmbSheet.ValueMember = "Name"; //NOXLATE
            cmbSheet.DataSource = _sheets;
            PopulateSheets();
            cmbSheet_SelectedIndexChanged(this, EventArgs.Empty);
            ComboBoxBinder.BindSelectedIndexChanged(cmbSheet, "SelectedValue", _dlayer, "Sheet"); //NOXLATE

            var minBinding = new Binding("Text", _dlayer, "MinScale"); //NOXLATE
            var maxBinding = new Binding("Text", _dlayer, "MaxScale"); //NOXLATE

            minBinding.Format += (sender, ce) =>
            {
                if (ce.DesiredType != typeof(string)) return;

                ce.Value = Convert.ToDouble(ce.Value);
            };
            minBinding.Parse += (sender, ce) =>
            {
                if (ce.DesiredType != typeof(double)) return;
                double val;
                if (!double.TryParse(ce.Value.ToString(), out val))
                    return;

                ce.Value = val;
            };
            maxBinding.Format += (sender, ce) =>
            {
                if (ce.DesiredType != typeof(string)) return;

                ce.Value = Convert.ToDouble(ce.Value);
            };
            maxBinding.Parse += (sender, ce) =>
            {
                if (ce.DesiredType != typeof(double)) return;
                double val;
                if (!double.TryParse(ce.Value.ToString(), out val))
                    return;

                ce.Value = val;
            };

            TextBoxBinder.BindText(txtMinScale, minBinding);
            TextBoxBinder.BindText(txtMaxScale, maxBinding);

            //This is not the root object so no change listeners have been subscribed
            _dlayer.PropertyChanged += (sender, e) => { OnResourceChanged(); };
        }
예제 #22
0
        /// <summary>
        /// Sets the initial state of this editor and sets up any databinding
        /// within such that user interface changes will propagate back to the
        /// model.
        /// </summary>
        /// <param name="service"></param>
        public override void Bind(IEditorService service)
        {
            _wm = (IWatermarkDefinition)service.GetEditedResource();
            _wm.Content.RemoveSchemaAttributes(); //Sanity

            wmContent.Bind(service);
            wmSettings.Bind(service);
        }
예제 #23
0
        /// <summary>
        /// Sets the initial state of this editor and sets up any databinding
        /// within such that user interface changes will propagate back to the
        /// model.
        /// </summary>
        /// <param name="service"></param>
        public override void Bind(IEditorService service)
        {
            _flexLayout = (IApplicationDefinition)service.GetEditedResource();

            settingsCtrl.Bind(service);
            mapsCtrl.Bind(service);
            widgetsCtrl.Bind(service);
        }
예제 #24
0
        //--------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="ShortcutsOptionsPageViewModel"/> class.
        /// </summary>
        /// <param name="editor">The editor.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="editor"/> is <see langword="null"/>.
        /// </exception>
        public ShortcutsOptionsPageViewModel(IEditorService editor)
            : base("Shortcuts")
        {
            if (editor == null && !WindowsHelper.IsInDesignMode)
                throw new ArgumentNullException(nameof(editor));

            _editor = editor;
        }
예제 #25
0
 public void Setup(IWidget widget, FlexibleLayoutEditorContext context, IEditorService edsvc)
 {
     _widget = widget;
     _xml = _widget.ToXml();
     _widgetInfo = context.GetWidgetInfo(widget.Type);
     btnWidgetInfo.Enabled = (_widgetInfo != null);
     txtXmlContent.Text = _xml;
 }
예제 #26
0
        /// <summary>
        /// Binds the specified service.
        /// </summary>
        /// <param name="service">The service.</param>
        public override void Bind(IEditorService service)
        {
            _ed = service;
            _lp = _ed.GetEditedResource() as OSGeo.MapGuide.ObjectModels.LoadProcedure.ILoadProcedure;
            Debug.Assert(_lp != null);

            service.RegisterCustomNotifier(this);

            CollapsiblePanel tp = null;

            if (_lp.SubType.Type == LoadType.Sdf)
            {
                var trans = new SdfTransformationCtrl();
                trans.Bind(service);
                tp = trans;
            }
            else if (_lp.SubType.Type == LoadType.Shp)
            {
                var trans = new ShpTransformationCtrl();
                trans.Bind(service);
                tp = trans;
            }
            else if (_lp.SubType.Type == LoadType.Dwf)
            {
                var trans = new DwfTransformationCtrl();
                trans.Bind(service);
                tp = trans;
            }
            else if (_lp.SubType.Type == LoadType.Sqlite)
            {
                var trans = new SqliteTransformationCtrl();
                trans.Bind(service);
                tp = trans;
            }
            else
            {
                throw new NotSupportedException();
            }

            var input = new InputFilesCtrl();
            input.Bind(service);

            var target = new LoadTargetCtrl();
            target.Bind(service);

            tp.Dock = DockStyle.Top;
            input.Dock = DockStyle.Top;
            target.Dock = DockStyle.Top;

            var exec = new ExecuteCtrl();
            exec.Dock = DockStyle.Bottom;
            exec.Execute += new EventHandler(OnExecute);

            this.Controls.Add(exec);
            this.Controls.Add(target);
            this.Controls.Add(tp);
            this.Controls.Add(input);
        }
예제 #27
0
        public override void Bind(IEditorService service)
        {
            _ed = service;
            _ed.RegisterCustomNotifier(this);
            _fs = (IFeatureSource)_ed.GetEditedResource();

            grdOverrides.AutoGenerateColumns = false;
            UpdateSpatialContextList();
        }
 /// <summary>
 /// Sets the initial state of this editor and sets up any databinding
 /// within such that user interface changes will propagate back to the
 /// model.
 /// </summary>
 /// <param name="service"></param>
 public override void Bind(IEditorService service)
 {
     service.RegisterCustomNotifier(this);
     generalSettingsCtrl.Bind(service);
     symbolGraphicsCtrl.Bind(service);
     parametersCtrl.Bind(service);
     usageContextsCtrl.Bind(service);
     advancedSettingsCtrl.Bind(service);
 }
예제 #29
0
 public XmlEditorDialog(IEditorService edsvc)
     : this()
 {
     //NRE happens if we copy without setting a font first
     _ed.TextFont = new System.Drawing.Font("Courier New", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     _edSvc = edsvc;
     _edSvc.RegisterCustomNotifier(this);
     this.Disposed += new EventHandler(OnDisposed);
 }
예제 #30
0
 public override void Bind(IEditorService service)
 {
     _params.Clear();
     _sym = (ISimpleSymbolDefinition)service.GetEditedResource();
     foreach (var p in _sym.ParameterDefinition.Parameter)
     {
         _params.Add(p);
     }
 }
예제 #31
0
        public MapCtrl(IApplicationDefinition appDef, IMapGroup group, IEditorService edService, IMapWidget widget)
            : this()
        {
            _appDef = appDef;
            _widget = widget;
            _group  = group;
            _edSvc  = edService;
            _edSvc.RegisterCustomNotifier(this);
            _models            = new BindingList <MapModel>();
            lstMaps.DataSource = _models;
            UpdateMapList();
            txtMapId.Text = group.id;

            LoadMapOptions();
        }
예제 #32
0
        /// <summary>
        /// Sets the initial state of this editor and sets up any databinding
        /// within such that user interface changes will propagate back to the
        /// model.
        /// </summary>
        /// <param name="service"></param>
        public override void Bind(IEditorService service)
        {
            service.RegisterCustomNotifier(this);
            _edSvc   = service;
            _compSym = (ICompoundSymbolDefinition)_edSvc.GetEditedResource();
            _compSym.PurgeSimpleSymbolAttributes();

            TextBoxBinder.BindText(txtName, _compSym, "Name");
            TextBoxBinder.BindText(txtDescription, _compSym, "Description");

            foreach (var symRef in _compSym.SimpleSymbol)
            {
                AddSymbolReference(symRef);
            }
        }
        public override void Bind(IEditorService service)
        {
            try
            {
                _init = true;
                service.RegisterCustomNotifier(this);
                _fs   = (IFeatureSource)service.GetEditedResource();
                _conn = service.CurrentConnection;

                InitDefaults();
            }
            finally
            {
                _init = false;
            }
        }
예제 #34
0
        //--------------------------------------------------------------
        #region Creation & Cleanup
        //--------------------------------------------------------------

        public TestViewModel(IEditorService editor)
        {
            if (editor == null)
            {
                throw new ArgumentNullException(nameof(editor));
            }

            _editor     = editor;
            DisplayName = "TestView";
            DockId      = DockIdString;
            Icon        = MultiColorGlyphs.Document;

            PrintPreviewCommand = new DelegateCommand(ShowPrintPreview);
            PrintCommand        = new DelegateCommand(Print);
            DoSomethingCommand  = new DelegateCommand(DoSomething);
        }
예제 #35
0
 public FiniteScaleListCtrl(ITileSetAbstract map, IEditorService editorSvc)
     : this()
 {
     _tileSet = map;
     _edSvc   = editorSvc;
     //Init scale list
     if (_tileSet != null)
     {
         foreach (var scale in _tileSet.FiniteDisplayScale)
         {
             _scales.Add(scale);
         }
     }
     //Now wire change events
     _scales.ListChanged += new ListChangedEventHandler(OnScaleListChanged);
 }
예제 #36
0
        public override void Bind(IEditorService service)
        {
            base.Bind(service);
            _service = service;
            _fs      = service.GetEditedResource() as IFeatureSource;
            Debug.Assert(_fs != null);

            MarkSelected();

            //HACK: Set UseFdoMetadata property if not specified otherwise this will be an invalid feature source
            if (string.IsNullOrEmpty(_fs.GetConnectionProperty("UseFdoMetadata")))                                               //NOXLATE
            {
                _fs.SetConnectionProperty("UseFdoMetadata", "FALSE");                                                            //NOXLATE
            }
            chkUseFdoMetadata.Checked = _fs.GetConnectionProperty("UseFdoMetadata").ToUpper().Equals(true.ToString().ToUpper()); //NOXLATE
        }
        public override void Bind(IEditorService service)
        {
            _service = service;

            var lp = service.GetEditedResource() as ILoadProcedure;

            Debug.Assert(lp != null);

            service.RegisterCustomNotifier(this);

            var shplp = lp.SubType as IShpLoadProcedure;

            TextBoxBinder.BindText(txtCoordinateSystem, shplp, "CoordinateSystem");
            NumericBinder.BindValueChanged(numGeneralizePercentage, shplp, "Generalization");
            CheckBoxBinder.BindChecked(chkConvertToSdf, shplp, "ConvertToSdf");
        }
예제 #38
0
        public SimpleSymbolReferenceCtrl(IEditorService edSvc, IResourceIdReference symRef)
        {
            InitializeComponent();
            _edSvc  = edSvc;
            _symRef = symRef;

            try
            {
                _init = true;
                txtResourceId.Text = _symRef.ResourceId;
            }
            finally
            {
                _init = false;
            }
        }
예제 #39
0
 public SpeedWagonAdminContext(
     string path,
     IContentService cachelessContentService,
     IContentTypeService contentTypeService,
     IEditorService editorService,
     IWebContentService webContentService,
     IFileUploadService fileUploadService,
     ISearchService searchService)
 {
     this._path = path;
     this._cachelessContentService = cachelessContentService;
     this._editorService           = editorService;
     this._contentTypeService      = contentTypeService;
     this._webContentService       = webContentService;
     this._fileUploadService       = fileUploadService;
     this._searchService           = searchService;
 }
        /// <summary>
        /// Binds the specified resource to this control. This effectively initializes
        /// all the fields in this control and sets up databinding on all fields. All
        /// subclasses *must* override this method.
        ///
        /// Also note that this method may be called more than once (e.g. Returning from
        /// and XML edit of this resource). Thus subclasses must take this scenario into
        /// account when implementing
        /// </summary>
        /// <param name="service">The editor service</param>
        protected override void Bind(IEditorService service)
        {
            if (!_init)
            {
                _edsvc = service;
                //_edsvc.BeforeSave += new CancelEventHandler(OnBeforeSave);
                _init = true;
            }

            panelBody.Controls.Clear();

            var dsEditor = new DrawingSourceEditorCtrl();
            dsEditor.Dock = DockStyle.Fill;
            panelBody.Controls.Add(dsEditor);

            dsEditor.Bind(_edsvc);
        }
예제 #41
0
        public override void Bind(IEditorService service)
        {
            _service = service;

            var lp = service.GetEditedResource() as ILoadProcedure;

            Debug.Assert(lp != null);

            service.RegisterCustomNotifier(this);

            var sdflp = lp.SubType as ISdfLoadProcedure;

            TextBoxBinder.BindText(txtCoordinateSystem, sdflp, "CoordinateSystem");
            NumericBinder.BindValueChanged(numGeneralizePercentage, sdflp, "Generalization");
            cmbSdfConflictStrategy.DataSource = Enum.GetValues(typeof(SdfKeyTreatmentType));
            ComboBoxBinder.BindSelectedIndexChanged(cmbSdfConflictStrategy, "SelectedItem", sdflp, "SdfKeyTreatment");
        }
예제 #42
0
        /// <summary>
        /// Binds the specified resource to this control. This effectively initializes
        /// all the fields in this control and sets up databinding on all fields. All
        /// subclasses *must* override this method.
        ///
        /// Also note that this method may be called more than once (e.g. Returning from
        /// and XML edit of this resource). Thus subclasses must take this scenario into
        /// account when implementing
        /// </summary>
        /// <param name="service">The editor service</param>
        protected override void Bind(IEditorService service)
        {
            if (!_init)
            {
                _edsvc = service;
                _res   = _edsvc.GetEditedResource();
                _init  = true;
            }

            panelBody.Controls.Clear();
            var mapEditorCtrl = new MapDefinitionEditorCtrl();

            mapEditorCtrl.Dock = DockStyle.Fill;
            panelBody.Controls.Add(mapEditorCtrl);

            mapEditorCtrl.Bind(service);
        }
예제 #43
0
        public override void Bind(IEditorService service)
        {
            _edsvc = service;
            _edsvc.RegisterCustomNotifier(this);

            var res = service.GetEditedResource() as ILayerDefinition;

            Debug.Assert(res != null);

            _rl = res.SubLayer as IRasterLayerDefinition;
            Debug.Assert(_rl != null);

            TextBoxBinder.BindText(txtFeatureSource, _rl, nameof(_rl.ResourceId));
            TextBoxBinder.BindText(txtFeatureClass, _rl, nameof(_rl.FeatureName));
            TextBoxBinder.BindText(txtGeometry, _rl, nameof(_rl.Geometry));
            _rl.PropertyChanged += WeakEventHandler.Wrap <PropertyChangedEventHandler>(OnRasterLayerPropertyChanged, (eh) => _rl.PropertyChanged -= eh);
        }
        /// <summary>
        /// Sets the initial state of this editor and sets up any databinding
        /// within such that user interface changes will propagate back to the
        /// model.
        /// </summary>
        /// <param name="service"></param>
        public override void Bind(IEditorService service)
        {
            webLayoutSettingsCtrl.Bind(service);
            webLayoutMenusCtrl.Bind(service);
            webLayoutCommandsCtrl.Bind(service);
            var wl3 = service.GetEditedResource() as IWebLayout3;

            if (wl3 != null)
            {
                webLayout3SettingsCtrl.Bind(service);
            }
            else
            {
                this.Controls.Remove(webLayout3SettingsCtrl);
                webLayout3SettingsCtrl.Dispose();
            }
        }
        public override void Bind(IEditorService service)
        {
            service.RegisterCustomNotifier(this);
            _layout = (IPrintLayout)service.GetEditedResource();
            //Init current defined text
            foreach (var txt in _layout.CustomText)
            {
                if (txt.Value == null && txt.Font == null && txt.Position == null)
                {
                    continue;
                }

                _texts.Add(txt);
            }
            //Now wire change listeners
            _texts.ListChanged += new ListChangedEventHandler(OnTextListChanged);
        }
예제 #46
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ColorViewModel" /> class.
        /// </summary>
        /// <param name="editor">The editor. Can be <see langword="null"/> at design-time.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="editor"/> is <see langword="null"/>.
        /// </exception>
        public ColorViewModel(IEditorService editor)
        {
            DisplayName = "Color";
            DockId      = DockIdString;
            //Icon = MultiColorGlyphs.ColorPalette;
            IsPersistent = true;

            _oldColor = Settings.Default.OldColor;
            _color    = Settings.Default.NewColor;

            // Listen for Color messages on the message bus.
            _messageBus = editor?.Services.GetInstance <IMessageBus>().WarnIfMissing();
            if (_messageBus != null)
            {
                _subscription = _messageBus.Listen <Color>().Subscribe(ReceiveColor);
            }
        }
        public EditorController()
        {
            hesapHareketServis = InstanceFactory.GetInstance <IHesapHareketleriService>();
            editorServis       = InstanceFactory.GetInstance <IEditorService>();
            haberService       = InstanceFactory.GetInstance <IHaberService>();
            kategoriServis     = InstanceFactory.GetInstance <IKategoriService>();

            kategoriler = new List <SelectListItem>();
            foreach (var item in kategoriServis.List(null))
            {
                kategoriler.Add(new SelectListItem
                {
                    Text  = item.KategoriAdi,
                    Value = item.Id.ToString()
                });
            }
        }
예제 #48
0
        public MapGuideEditor(IEditorService edSvc, IMapGroup group, IMap map)
        {
            InitializeComponent();
            _edSvc = edSvc;
            _map   = map;
            _group = group;
            try
            {
                _init = true;
                cmbSelectionColor.ResetColors();
                txtMapDefinition.Text = _map.GetMapDefinition();

                _initialView           = group.InitialView;
                chkSingleTiled.Checked = _map.SingleTile;
                chkOverride.Checked    = (_initialView != null);
                if (_initialView == null)
                {
                    _initialView = group.CreateInitialView(0.0, 0.0, 0.0);
                }

                txtViewX.Text     = _initialView.CenterX.ToString(CultureInfo.InvariantCulture);
                txtViewY.Text     = _initialView.CenterY.ToString(CultureInfo.InvariantCulture);
                txtViewScale.Text = _initialView.Scale.ToString(CultureInfo.InvariantCulture);

                var selOverlay = _map.GetValue("SelectionAsOverlay"); //NOXLATE
                var selColor   = _map.GetValue("SelectionColor");     //NOXLATE

                if (!string.IsNullOrEmpty(selColor))
                {
                    cmbSelectionColor.CurrentColor = Utility.ParseHTMLColorRGBA(selColor.Substring(2)); //Strip the "0x" part
                }
                if (!string.IsNullOrEmpty(selOverlay))
                {
                    bool b = true;
                    if (bool.TryParse(selOverlay, out b))
                    {
                        chkSelectionAsOverlay.Checked = b;
                    }
                }
            }
            finally
            {
                _init = false;
            }
        }
        //--------------------------------------------------------------
        #region Properties & Events
        //--------------------------------------------------------------
        #endregion


        //--------------------------------------------------------------
        #region Creation & Cleanup
        //--------------------------------------------------------------

        /// <summary>
        /// Initializes a new instance of the <see cref="TextureDocumentFactory" /> class.
        /// </summary>
        /// <param name="editor">The editor.</param>
        public TextureDocumentFactory(IEditorService editor)
            : base("Texture Viewer")
        {
            if (editor == null)
            {
                throw new ArgumentNullException(nameof(editor));
            }

            _editor = editor;

            // ----- Initialize supported document types.
            // Textures
            var textureDocumentType = new DocumentType(
                name: "Texture",
                factory: this,
                icon: MultiColorGlyphs.Image,
                fileExtensions: new[]
            {
                ".bmp", ".dds", ".gif", ".ico", ".jpg", ".jpeg", ".png", ".tga", ".tif",
                ".jxr", ".hdp", ".wdp"     // HD Photo
            },
                isCreatable: false,
                isLoadable: true,
                isSavable: false,
                priority: 10);

            _processedTextureDocumentType = new DocumentType(
                name: "Texture, processed",
                factory: this,
                icon: MultiColorGlyphs.Image,
                fileExtensions: new[]
            {
                ".xnb"
            },
                isCreatable: false,
                isLoadable: true,
                isSavable: false,
                priority: 10);

            DocumentTypes = new[]
            {
                textureDocumentType,
                _processedTextureDocumentType,
            };
        }
        /// <summary>
        /// Binds the specified editor service to this editor
        /// </summary>
        /// <param name="service"></param>
        public override void Bind(IEditorService service)
        {
            this.EditorService = service;
            service.RegisterCustomNotifier(this);

            _shadowCopy = (IMapDefinition)service.GetEditedResource();
            _mapSvc     = (IMappingService)service.CurrentConnection.GetService((int)ServiceType.Mapping);
            _rtMap      = _mapSvc.CreateMap(_shadowCopy);
            repoView.Init(service.CurrentConnection.ResourceService, new string[] {
                ResourceTypes.LayerDefinition.ToString(),
                ResourceTypes.FeatureSource.ToString()
            }, new string[] {
                ResourceTypes.LayerDefinition.ToString(),
                ResourceTypes.FeatureSource.ToString()
            });

            ReloadViewer();
        }
예제 #51
0
 public MenuCtrl(IFlyoutItem menu, IEditorService edSvc)
     : this()
 {
     _menu  = menu;
     _edSvc = edSvc;
     _init  = true;
     try
     {
         txtMenuLabel.Text  = _menu.Label;
         txtImageClass.Text = _menu.ImageClass;
         txtImageUrl.Text   = _menu.ImageUrl;
         txtTooltip.Text    = _menu.Tooltip;
     }
     finally
     {
         _init = false;
     }
 }
        public override void Bind(IEditorService service)
        {
            try
            {
                _init = true;
                _wl   = (IWebLayout3)service.GetEditedResource();

                txtSelectionColor.Text               = _wl.SelectionColor;
                numPointBuffer.Value                 = _wl.PointSelectionBuffer;
                cmbMapImageFormat.SelectedItem       = _wl.MapImageFormat;
                cmbSelectionImageFormat.SelectedItem = _wl.SelectionImageFormat;
                txtStartupScript.Text                = _wl.StartupScript;
            }
            finally
            {
                _init = false;
            }
        }
        /// <summary>
        /// Binds the specified resource to this control. This effectively initializes
        /// all the fields in this control and sets up databinding on all fields. All
        /// subclasses *must* override this method.
        ///
        /// Also note that this method may be called more than once (e.g. Returning from
        /// and XML edit of this resource). Thus subclasses must take this scenario into
        /// account when implementing
        /// </summary>
        /// <param name="service">The editor service</param>
        protected override void Bind(IEditorService service)
        {
            if (!_init)
            {
                _edsvc = service;
                _res   = _edsvc.GetEditedResource();
                _init  = true;
            }

            panelBody.Controls.Clear();

            var flexEditor = new FlexibleLayoutEditor();

            flexEditor.Dock = DockStyle.Fill;
            panelBody.Controls.Add(flexEditor);

            flexEditor.Bind(_edsvc);
        }
        public override void Bind(IEditorService service)
        {
            service.RegisterCustomNotifier(this);

            _service  = service;
            _loadProc = _service.GetEditedResource() as ILoadProcedure;
            _fProc    = _loadProc.SubType;

            TextBoxBinder.BindText(txtTargetRoot, _fProc, "RootPath");
            CheckBoxBinder.BindChecked(chkCreateFeatureSources, _fProc, "GenerateSpatialDataSources");
            CheckBoxBinder.BindChecked(chkCreateLayers, _fProc, "GenerateLayers");
            TextBoxBinder.BindText(txtFeatureSourceRoot, _fProc, "SpatialDataSourcesPath");
            TextBoxBinder.BindText(txtFeatureFolderName, _fProc, "SpatialDataSourcesFolder");
            TextBoxBinder.BindText(txtLayerRoot, _fProc, "LayersPath");
            TextBoxBinder.BindText(txtLayerFolderName, _fProc, "LayersFolder");

            _fProc.PropertyChanged += WeakEventHandler.Wrap <PropertyChangedEventHandler>(OnLoadProcedurePropertyChanged, (eh) => _fProc.PropertyChanged -= eh);
        }
        public override void Bind(IEditorService service)
        {
            _wl = (IWebLayout)service.GetEditedResource();
            _wl.CommandSet.CustomCommandAdded   += OnCommandAdded;
            _wl.CommandSet.CustomCommandRemoved += OnCommandRemoved;

            edContextMenu.Bind(service, _wl, _wl.ContextMenu);
            edTaskMenu.Bind(service, _wl, _wl.TaskPane.TaskBar);
            edToolbar.Bind(service, _wl, _wl.ToolBar);

            foreach (var cmd in _wl.CommandSet.Commands)
            {
                var dec = new CommandDecorator(cmd);
                _cmds.Add(dec);
                _cmdsByName[dec.Name] = dec;
            }
            grdCommands.DataSource = _cmds;
        }
        /// <summary>
        /// Binds the specified resource to this control. This effectively initializes
        /// all the fields in this control and sets up databinding on all fields. All
        /// subclasses *must* override this method.
        ///
        /// Also note that this method may be called more than once (e.g. Returning from
        /// and XML edit of this resource). Thus subclasses must take this scenario into
        /// account when implementing
        /// </summary>
        /// <param name="service">The editor service</param>
        protected override void Bind(Maestro.Editors.IEditorService service)
        {
            if (!_init)
            {
                _edsvc = service;
                _res   = _edsvc.GetEditedResource();
                _init  = true;
            }
            panelBody.Controls.Clear();

            panelBody.Controls.Clear();
            var wmEditorCtrl = new WatermarkEditorCtrl();

            wmEditorCtrl.Dock = DockStyle.Fill;
            panelBody.Controls.Add(wmEditorCtrl);

            wmEditorCtrl.Bind(service);
        }
예제 #57
0
        public FiniteScaleListCtrl(IMapDefinition parent, IEditorService editorSvc)
            : this()
        {
            _parent = parent;
            _parent.InitBaseMap();

            _tileSet = _parent.BaseMap;
            _edSvc   = editorSvc;
            //Init scale list
            if (_tileSet != null)
            {
                foreach (var scale in _tileSet.FiniteDisplayScale)
                {
                    _scales.Add(scale);
                }
            }
            //Now wire change events
            _scales.ListChanged += new ListChangedEventHandler(OnScaleListChanged);
        }
예제 #58
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ModelDocumentFactory" /> class.
        /// </summary>
        /// <param name="editor">The editor.</param>
        public ModelDocumentFactory(IEditorService editor)
            : base("Model Viewer")
        {
            if (editor == null)
            {
                throw new ArgumentNullException(nameof(editor));
            }

            _editor = editor;

            // ----- Initialize supported document types.
            var modelDocumentType = new DocumentType(
                name: "3D model",
                factory: this,
                icon: MultiColorGlyphs.Model,
                fileExtensions: new[]
            {
                ".dae", ".fbx", ".x"
            },
                isCreatable: false,
                isLoadable: true,
                isSavable: false,
                priority: 10);

            _processedModelDocumentType = new DocumentType(
                name: "3D model, processed",
                factory: this,
                icon: MultiColorGlyphs.Model,
                fileExtensions: new[]
            {
                ".xnb"
            },
                isCreatable: false,
                isLoadable: true,
                isSavable: false,
                priority: 10);

            DocumentTypes = new[]
            {
                modelDocumentType,
                _processedModelDocumentType,
            };
        }
예제 #59
0
        internal void Bind(ISearchCommand searchCommandType, IEditorService service)
        {
            cmbTargetFrame.DataSource = Enum.GetValues(typeof(TargetType));
            _init = true;
            Bind(service);
            _cmd = searchCommandType;

            _wl = (IWebLayout)_edsvc.GetEditedResource();
            var wlMap = _wl.Map;

            wlMap.PropertyChanged += WeakEventHandler.Wrap <PropertyChangedEventHandler>(OnWebMapLayoutPropertyChanged, (eh) => wlMap.PropertyChanged -= eh);

            LoadLayers();

            if (!string.IsNullOrEmpty(_cmd.Layer))
            {
                foreach (var lyr in _layers)
                {
                    if (lyr.Name == _cmd.Layer)
                    {
                        txtLayer.Text = _cmd.Layer;
                        txtLayer.Tag  = lyr.ResourceId;
                    }
                }
            }

            TextBoxBinder.BindText(txtFrame, _cmd, nameof(_cmd.TargetFrame));
            ComboBoxBinder.BindSelectedIndexChanged(cmbTargetFrame, nameof(cmbTargetFrame.SelectedItem), _cmd, nameof(_cmd.Target));
            TextBoxBinder.BindText(txtLayer, _cmd, nameof(_cmd.Layer));
            TextBoxBinder.BindText(txtFilter, _cmd, nameof(_cmd.Filter));
            TextBoxBinder.BindText(txtPrompt, _cmd, nameof(_cmd.Prompt));

            NumericBinder.BindValueChanged(numLimit, _cmd, nameof(_cmd.MatchLimit));

            UpdateColumns();
            foreach (var col in _cmd.ResultColumns.Column)
            {
                _columns.Add(col);
            }
            grdOutputColumns.DataSource = _columns;
            _columns.AddingNew         += OnAddingNewColumn;
            _columns.ListChanged       += OnColumnsChanged;
        }
예제 #60
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OutlineViewModel"/> class.
        /// </summary>
        /// <param name="editor">The editor. Can be <see langword="null"/> at design-time.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="editor"/> is <see langword="null"/>.
        /// </exception>
        public OutlineViewModel(IEditorService editor)
        {
            DisplayName = "Outline";
            DockId      = DockIdString;
            //Icon = MultiColorGlyphs.Properties;
            IsPersistent   = true;
            DockWidth      = new GridLength(200);
            DockHeight     = new GridLength(300);
            AutoHideWidth  = 200;
            AutoHideHeight = 300;

            //if (!WindowsHelper.IsInDesignMode)
            //{
            //    if (editor == null)
            //        throw new ArgumentNullException(nameof(editor));

            //    _editor = editor;
            //}
        }