本文整理汇总了C#中IEditorService.GetEditedResource方法的典型用法代码示例。如果您正苦于以下问题:C# IEditorService.GetEditedResource方法的具体用法?C# IEditorService.GetEditedResource怎么用?C# IEditorService.GetEditedResource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEditorService
的用法示例。
在下文中一共展示了IEditorService.GetEditedResource方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Bind
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;
}
}
示例2: Bind
/// <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);
}
示例3: Bind
/// <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);
}
示例4: Bind
public override void Bind(IEditorService service)
{
_service = service;
_service.RegisterCustomNotifier(this);
_fs = (IFeatureSource)_service.GetEditedResource();
InitDefaults();
}
示例5: Bind
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;
}
}
示例6: Bind
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;
}
}
示例7: FontStyleEditor
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);
}
示例8: Bind
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;
}
示例9: RasterDefinitionCtrl
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;
}
示例10: WmsAdvancedConfigurationDialog
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;
}
示例11: Bind
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");
}
示例12: Bind
/// <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);
}
}
示例13: Bind
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(); };
}
示例14: Bind
/// <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);
}
示例15: Bind
/// <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);
}