private ClassDefinitionCtrl(ClassDefinitionDecorator cls, SchemaDesignContext context, NodeUpdateHandler updater, NodeUpdateHandler idUpdater) : this() { _cls = cls; _context = context; txtName.DataBindings.Add("Text", cls, "Name"); txtDescription.DataBindings.Add("Text", cls, "Description"); txtType.Text = cls.ClassType.ToString(); BindIdentityProperties(cls, idUpdater); //cmbBaseClass.DisplayMember = "Name"; //cmbBaseClass.DataSource = _context.GetClassesExceptFor(cls.ParentName, cls.Name); //cmbBaseClass.DataBindings.Add("SelectedItem", cls, "BaseClass"); chkAbstract.DataBindings.Add("Checked", cls, "IsAbstract"); chkComputed.DataBindings.Add("Checked", cls, "IsComputed"); cls.PropertyChanged += (s, evt) => { if (evt.PropertyName == "Name") { updater(); } }; lstUniqueConstraints.DataSource = cls.GetUniqueConstraints(); lnkEditUniqueConstraints.Enabled = _context.CanHaveUniqueConstraints; }
private ClassDefinitionCtrl(ClassDefinitionDecorator cls, SchemaDesignContext context, NodeUpdateHandler updater, NodeUpdateHandler idUpdater) : this() { _cls = cls; _context = context; txtName.DataBindings.Add("Text", cls, "Name"); txtDescription.DataBindings.Add("Text", cls, "Description"); txtType.Text = cls.ClassType.ToString(); BindIdentityProperties(cls, idUpdater); //cmbBaseClass.DisplayMember = "Name"; //cmbBaseClass.DataSource = _context.GetClassesExceptFor(cls.ParentName, cls.Name); //cmbBaseClass.DataBindings.Add("SelectedItem", cls, "BaseClass"); chkAbstract.DataBindings.Add("Checked", cls, "IsAbstract"); chkComputed.DataBindings.Add("Checked", cls, "IsComputed"); cls.PropertyChanged += (s, evt) => { if (evt.PropertyName == "Name") updater(); }; lstUniqueConstraints.DataSource = cls.GetUniqueConstraints(); lnkEditUniqueConstraints.Enabled = _context.CanHaveUniqueConstraints; }
public DataPropertyCtrl(DataPropertyDefinitionDecorator p, SchemaDesignContext context, NodeUpdateHandler updater) : this() { _context = context; _dp = p; txtName.DataBindings.Add("Text", p, "Name"); txtDescription.DataBindings.Add("Text", p, "Description"); cmbDataType.DataSource = _context.SupportedDataTypes; cmbDataType.DataBindings.Add("SelectedItem", p, "DataType"); chkReadOnly.DataBindings.Add("Checked", p, "ReadOnly"); numLength.DataBindings.Add("Value", p, "Length"); numPrecision.DataBindings.Add("Value", p, "Precision"); numScale.DataBindings.Add("Value", p, "Scale"); chkAutogenerated.Checked = p.IsAutoGenerated; chkAutogenerated.CheckedChanged += (s, e) => { p.IsAutoGenerated = chkAutogenerated.Checked; if (p.IsAutoGenerated) { //Not databound, so we have to modfiy UI state chkNullable.Checked = false; } }; chkNullable.Checked = p.Nullable; chkNullable.CheckedChanged += (s, e) => { p.Nullable = chkNullable.Checked; if (p.Nullable) { //Not databound, so we have to modfiy UI state chkAutogenerated.Checked = false; } }; p.PropertyChanged += (s, evt) => { if (evt.PropertyName == "Name") { updater(); } }; chkNullable.Enabled = !p.IsIdentity(); if (p.ValueConstraint != null) { txtValueConstraint.Text = p.ValueConstraint.ToString(); } btnEditConstraint.Enabled = _context.SupportsValueConstraints; }
public GeometricPropertyCtrl(GeometricPropertyDefinitionDecorator p, SchemaDesignContext context, NodeUpdateHandler updater) : this() { _context = context; txtName.DataBindings.Add("Text", p, "Name"); txtDescription.DataBindings.Add("Text", p, "Description"); chkElevation.DataBindings.Add("Checked", p, "HasElevation"); chkMeasure.DataBindings.Add("Checked", p, "HasMeasure"); cmbSpatialContext.DisplayMember = "Name"; var scNames = _context.GetSpatialContextNames(); cmbSpatialContext.DataSource = scNames; //Assign current association if defined if (!string.IsNullOrEmpty(p.SpatialContextAssociation)) { cmbSpatialContext.SelectedItem = p.SpatialContextAssociation; } //Setup event handler that will update the model EventHandler scChanged = (s, e) => { if (cmbSpatialContext.SelectedItem != null) { p.SpatialContextAssociation = cmbSpatialContext.SelectedItem.ToString(); } }; //Wire it up cmbSpatialContext.SelectedIndexChanged += scChanged; //If spatial contexts available and this property hasn't been assigned one, assign //it to the first available spatial context name if (string.IsNullOrEmpty(p.SpatialContextAssociation) && scNames.Length > 0) { cmbSpatialContext.SelectedIndex = 0; scChanged(this, EventArgs.Empty); } chkGeometryTypes.GeometryTypes = p.GeometryTypes; //Now wire up change listener chkGeometryTypes.ItemCheck += (s, e) => { p.GeometryTypes = chkGeometryTypes.GetPostCheckValue(e); }; p.PropertyChanged += (s, evt) => { if (evt.PropertyName == "Name") { updater(); } }; }
public DataPropertyCtrl(DataPropertyDefinitionDecorator p, SchemaDesignContext context, NodeUpdateHandler updater) : this() { _context = context; _dp = p; txtName.DataBindings.Add("Text", p, "Name"); txtDescription.DataBindings.Add("Text", p, "Description"); cmbDataType.DataSource = _context.SupportedDataTypes; cmbDataType.DataBindings.Add("SelectedItem", p, "DataType"); chkReadOnly.DataBindings.Add("Checked", p, "ReadOnly"); numLength.DataBindings.Add("Value", p, "Length"); numPrecision.DataBindings.Add("Value", p, "Precision"); numScale.DataBindings.Add("Value", p, "Scale"); chkAutogenerated.Checked = p.IsAutoGenerated; chkAutogenerated.CheckedChanged += (s, e) => { p.IsAutoGenerated = chkAutogenerated.Checked; if (p.IsAutoGenerated) { //Not databound, so we have to modfiy UI state chkNullable.Checked = false; } }; chkNullable.Checked = p.Nullable; chkNullable.CheckedChanged += (s, e) => { p.Nullable = chkNullable.Checked; if (p.Nullable) { //Not databound, so we have to modfiy UI state chkAutogenerated.Checked = false; } }; p.PropertyChanged += (s, evt) => { if (evt.PropertyName == "Name") updater(); }; chkNullable.Enabled = !p.IsIdentity(); if (p.ValueConstraint != null) txtValueConstraint.Text = p.ValueConstraint.ToString(); btnEditConstraint.Enabled = _context.SupportsValueConstraints; }
public GeometricPropertyCtrl(GeometricPropertyDefinitionDecorator p, SchemaDesignContext context, NodeUpdateHandler updater) : this() { _context = context; txtName.DataBindings.Add("Text", p, "Name"); txtDescription.DataBindings.Add("Text", p, "Description"); chkElevation.DataBindings.Add("Checked", p, "HasElevation"); chkMeasure.DataBindings.Add("Checked", p, "HasMeasure"); cmbSpatialContext.DisplayMember = "Name"; var scNames = _context.GetSpatialContextNames(); cmbSpatialContext.DataSource = scNames; //Assign current association if defined if (!string.IsNullOrEmpty(p.SpatialContextAssociation)) { cmbSpatialContext.SelectedItem = p.SpatialContextAssociation; } //Setup event handler that will update the model EventHandler scChanged = (s, e) => { if (cmbSpatialContext.SelectedItem != null) p.SpatialContextAssociation = cmbSpatialContext.SelectedItem.ToString(); }; //Wire it up cmbSpatialContext.SelectedIndexChanged += scChanged; //If spatial contexts available and this property hasn't been assigned one, assign //it to the first available spatial context name if (string.IsNullOrEmpty(p.SpatialContextAssociation) && scNames.Length > 0) { cmbSpatialContext.SelectedIndex = 0; scChanged(this, EventArgs.Empty); } chkGeometryTypes.GeometryTypes = p.GeometryTypes; //Now wire up change listener chkGeometryTypes.ItemCheck += (s, e) => { p.GeometryTypes = chkGeometryTypes.GetPostCheckValue(e); }; p.PropertyChanged += (s, evt) => { if (evt.PropertyName == "Name") updater(); }; }
protected override void OnLoad(EventArgs e) { _context = new SchemaDesignContext(_conn); if (!_context.IsConnected) this.Title = ResourceService.GetString("TITLE_DATA_STORE_STANDALONE"); schemaView.UpdateState += new EventHandler(OnUpdateState); spatialContextView.UpdateState += new EventHandler(OnUpdateState); schemaView.Context = _context; spatialContextView.Context = _context; EvaluateCommandStates(); base.OnLoad(e); }
public AssociationPropertyCtrl(AssociationPropertyDefinitionDecorator p, SchemaDesignContext context, NodeUpdateHandler updater) : this() { _context = context; _mappings = new BindingList <KeyMapping>(); _ap = p; txtName.DataBindings.Add("Text", p, "Name"); txtDescription.DataBindings.Add("Text", p, "Description"); string schema = p.DecoratedObject.Parent.Parent.Name; cmbDeleteRule.DataSource = Enum.GetValues(typeof(DeleteRule)); cmbDeleteRule.DataBindings.Add("SelectedItem", p, "DeleteRule"); var mappings = _ap.GetMappings(); cmbAssociatedClass.DisplayMember = "Name"; cmbAssociatedClass.DataSource = _context.GetClasses(schema); cmbAssociatedClass.DataBindings.Add("SelectedItem", p, "AssociatedClass"); txtMultiplicity.DataBindings.Add("Text", p, "Multiplicity"); chkReadOnly.DataBindings.Add("Checked", p, "IsReadOnly"); chkLockCascade.DataBindings.Add("Checked", p, "LockCascade"); txtReverseName.DataBindings.Add("Text", p, "ReverseName"); txtRevMultiplicity.DataBindings.Add("Text", p, "ReverseMultiplicity"); foreach (var map in mappings) { _mappings.Add(map); } grdMappings.DataSource = _mappings; _mappings.ListChanged += new ListChangedEventHandler(OnMappingsChanged); p.PropertyChanged += (s, evt) => { if (evt.PropertyName == "Name") { updater(); } }; }
public AssociationPropertyCtrl(AssociationPropertyDefinitionDecorator p, SchemaDesignContext context, NodeUpdateHandler updater) : this() { _context = context; _mappings = new BindingList<KeyMapping>(); _ap = p; txtName.DataBindings.Add("Text", p, "Name"); txtDescription.DataBindings.Add("Text", p, "Description"); string schema = p.DecoratedObject.Parent.Parent.Name; cmbDeleteRule.DataSource = Enum.GetValues(typeof(DeleteRule)); cmbDeleteRule.DataBindings.Add("SelectedItem", p, "DeleteRule"); var mappings = _ap.GetMappings(); cmbAssociatedClass.DisplayMember = "Name"; cmbAssociatedClass.DataSource = _context.GetClasses(schema); cmbAssociatedClass.DataBindings.Add("SelectedItem", p, "AssociatedClass"); txtMultiplicity.DataBindings.Add("Text", p, "Multiplicity"); chkReadOnly.DataBindings.Add("Checked", p, "IsReadOnly"); chkLockCascade.DataBindings.Add("Checked", p, "LockCascade"); txtReverseName.DataBindings.Add("Text", p, "ReverseName"); txtRevMultiplicity.DataBindings.Add("Text", p, "ReverseMultiplicity"); foreach (var map in mappings) { _mappings.Add(map); } grdMappings.DataSource = _mappings; _mappings.ListChanged += new ListChangedEventHandler(OnMappingsChanged); p.PropertyChanged += (s, evt) => { if (evt.PropertyName == "Name") updater(); }; }
public ClassDefinitionCtrl(FeatureClassDecorator cls, SchemaDesignContext context, NodeUpdateHandler updater, NodeUpdateHandler idUpdater) : this((ClassDefinitionDecorator)cls, context, updater, idUpdater) { // Fill available properties cmbGeometricProperty.DataSource = cls.AvailableGeometricProperties; // Assign designated one as selected item if (cls.GeometryProperty != null) { cmbGeometricProperty.SelectedItem = cls.GeometryProperty.Name; } // Setup event handler that will update the model EventHandler selIndexChanged = (s, e) => { if (cmbGeometricProperty.SelectedItem != null) { cls.AssignGeometricProperty(cmbGeometricProperty.SelectedItem.ToString()); } }; // Wire this up cmbGeometricProperty.SelectedIndexChanged += selIndexChanged; // Basically if no geometry property has been designated but the feature class // has geometric properties, then we want to auto-assign the first geometry // property out of the available ones if (cls.GeometryProperty == null) { if (cls.AvailableGeometricProperties.Count > 0) { cmbGeometricProperty.SelectedIndex = 0; selIndexChanged(this, EventArgs.Empty); } } }
public ClassDefinitionCtrl(FeatureClassDecorator cls, SchemaDesignContext context, NodeUpdateHandler updater, NodeUpdateHandler idUpdater) : this((ClassDefinitionDecorator)cls, context, updater, idUpdater) { // Fill available properties cmbGeometricProperty.DataSource = cls.AvailableGeometricProperties; // Assign designated one as selected item if (cls.GeometryProperty != null) { cmbGeometricProperty.SelectedItem = cls.GeometryProperty.Name; } // Setup event handler that will update the model EventHandler selIndexChanged = (s, e) => { if (cmbGeometricProperty.SelectedItem != null) { cls.AssignGeometricProperty(cmbGeometricProperty.SelectedItem.ToString()); } }; // Wire this up cmbGeometricProperty.SelectedIndexChanged += selIndexChanged; // Basically if no geometry property has been designated but the feature class // has geometric properties, then we want to auto-assign the first geometry // property out of the available ones if (cls.GeometryProperty == null) { if (cls.AvailableGeometricProperties.Count > 0) { cmbGeometricProperty.SelectedIndex = 0; selIndexChanged(this, EventArgs.Empty); } } }
public ClassDefinitionCtrl(ClassDecorator cls, SchemaDesignContext context, NodeUpdateHandler updater, NodeUpdateHandler idUpdater) : this((ClassDefinitionDecorator)cls, context, updater, idUpdater) { cmbGeometricProperty.Enabled = false; }
public ObjectPropertyCtrl(ObjectPropertyDefinitionDecorator p, SchemaDesignContext context, NodeUpdateHandler updater) : this() { _context = context; txtName.DataBindings.Add("Text", p, "Name"); txtDescription.DataBindings.Add("Text", p, "Description"); cmbObjectType.DataSource = Enum.GetValues(typeof(ObjectType)); cmbOrderType.DataSource = Enum.GetValues(typeof(OrderType)); cmbObjectType.DataBindings.Add("SelectedItem", p, "ObjectType"); cmbOrderType.DataBindings.Add("SelectedItem", p, "OrderType"); string schema = p.DecoratedObject.Parent.Parent.Name; cmbClass.DisplayMember = "Name"; cmbClass.DataSource = _context.GetClasses(schema); EventHandler clsIndexChanged = (sender, e) => { var cls = cmbClass.SelectedItem as ClassDefinition; if (cls != null) { p.Class = cls; cmbIdentityProperty.DisplayMember = "Name"; List<DataPropertyDefinition> dataProps = new List<DataPropertyDefinition>(); foreach (PropertyDefinition prop in cls.Properties) { if (prop.PropertyType == PropertyType.PropertyType_DataProperty) dataProps.Add((DataPropertyDefinition)prop); } cmbIdentityProperty.DataSource = dataProps; if (p.IdentityProperty != null && cls.Properties.Contains(p.IdentityProperty)) { cmbIdentityProperty.SelectedItem = p.IdentityProperty; } else { if (cmbIdentityProperty.Items.Count == 0) cmbIdentityProperty.SelectedIndex = 0; } } }; EventHandler prpIndexChanged = (sender, e) => { var prop = cmbIdentityProperty.SelectedItem as DataPropertyDefinition; if (prop != null) { p.IdentityProperty = prop; } else { p.IdentityProperty = null; } }; cmbClass.SelectedItem = p.Class; cmbClass.SelectedIndexChanged += clsIndexChanged; cmbIdentityProperty.SelectedIndexChanged += prpIndexChanged; clsIndexChanged(this, EventArgs.Empty); p.PropertyChanged += (s, evt) => { if (evt.PropertyName == "Name") updater(); }; }
public ImportElementsDialog(FdoDataStoreConfiguration dataStore, SchemaDesignContext context) : this() { _dataStore = dataStore; _context = context; }
public ObjectPropertyCtrl(ObjectPropertyDefinitionDecorator p, SchemaDesignContext context, NodeUpdateHandler updater) : this() { _context = context; txtName.DataBindings.Add("Text", p, "Name"); txtDescription.DataBindings.Add("Text", p, "Description"); cmbObjectType.DataSource = Enum.GetValues(typeof(ObjectType)); cmbOrderType.DataSource = Enum.GetValues(typeof(OrderType)); cmbObjectType.DataBindings.Add("SelectedItem", p, "ObjectType"); cmbOrderType.DataBindings.Add("SelectedItem", p, "OrderType"); string schema = p.DecoratedObject.Parent.Parent.Name; cmbClass.DisplayMember = "Name"; cmbClass.DataSource = _context.GetClasses(schema); EventHandler clsIndexChanged = (sender, e) => { var cls = cmbClass.SelectedItem as ClassDefinition; if (cls != null) { p.Class = cls; cmbIdentityProperty.DisplayMember = "Name"; List <DataPropertyDefinition> dataProps = new List <DataPropertyDefinition>(); foreach (PropertyDefinition prop in cls.Properties) { if (prop.PropertyType == PropertyType.PropertyType_DataProperty) { dataProps.Add((DataPropertyDefinition)prop); } } cmbIdentityProperty.DataSource = dataProps; if (p.IdentityProperty != null && cls.Properties.Contains(p.IdentityProperty)) { cmbIdentityProperty.SelectedItem = p.IdentityProperty; } else { if (cmbIdentityProperty.Items.Count == 0) { cmbIdentityProperty.SelectedIndex = 0; } } } }; EventHandler prpIndexChanged = (sender, e) => { var prop = cmbIdentityProperty.SelectedItem as DataPropertyDefinition; if (prop != null) { p.IdentityProperty = prop; } else { p.IdentityProperty = null; } }; cmbClass.SelectedItem = p.Class; cmbClass.SelectedIndexChanged += clsIndexChanged; cmbIdentityProperty.SelectedIndexChanged += prpIndexChanged; clsIndexChanged(this, EventArgs.Empty); p.PropertyChanged += (s, evt) => { if (evt.PropertyName == "Name") { updater(); } }; }
public FdoSchemaViewTreePresenter(FdoSchemaView view, SchemaDesignContext context) { _view = view; _context = context; _view.schemaTree.AfterSelect += new TreeViewEventHandler(OnAfterSelect); _view.schemaTree.MouseDown += new MouseEventHandler(RightClickHack); _context.SchemaAdded += new SchemaElementEventHandler<FeatureSchema>(OnSchemaAdded); _context.ClassAdded += new SchemaElementEventHandler<ClassDefinition>(OnClassAdded); _context.PropertyAdded += new SchemaElementEventHandler<PropertyDefinition>(OnPropertyAdded); _context.ClassRemoved += new SchemaElementEventHandler<ClassDefinition>(OnClassRemoved); _context.PropertyRemoved += new SchemaElementEventHandler<PropertyDefinition>(OnPropertyRemoved); InitContextMenus(); }
public ClassDefinitionCtrl(ClassDecorator cls, SchemaDesignContext context, NodeUpdateHandler updater, NodeUpdateHandler idUpdater) : this((ClassDefinitionDecorator)cls, context, updater, idUpdater) { cmbGeometricProperty.Enabled = false; }