コード例 #1
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;
            _rldf  = (IRasterLayerDefinition)((ILayerDefinition)_edsvc.GetEditedResource()).SubLayer;
            _edsvc.RegisterCustomNotifier(this);
            rasterLayerSettingsSectionCtrl.Bind(_edsvc);
            rasterLayerVisibilitySectionCtrl.Bind(_edsvc);
            rasterLayerAdvancedSectionCtrl.Bind(_edsvc);

            //Add watermark component if supported
            var sl2 = _rldf as ISubLayerDefinition2;

            if (sl2 != null)
            {
                this.Controls.Remove(rasterLayerSettingsSectionCtrl);
                this.Controls.Remove(rasterLayerVisibilitySectionCtrl);
                this.Controls.Remove(rasterLayerAdvancedSectionCtrl);

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

                this.Controls.Add(wm);
                this.Controls.Add(rasterLayerAdvancedSectionCtrl);
                this.Controls.Add(rasterLayerVisibilitySectionCtrl);
                this.Controls.Add(rasterLayerSettingsSectionCtrl);
            }
        }
コード例 #2
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;

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

            _map.ExtentCalculator = new LayerExtentCalculator(_edSvc.CurrentConnection);

            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 += OnRequestLayerOpen;
        }
コード例 #3
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);

            //A prompt to repair the feature source may have changed this, so update it.
            resSettings.SetFeatureSource(_vl.ResourceId);

            //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);
            }
        }