private void CreateNewObjectButton_Click(object sender, EventArgs e) { if (NewObjectNameTextBox.Text == "") { MessageBox.Show("Please enter a name for the new object"); return; } String newObjectName = m_MainForm.m_CurrentObjectsFolderName +NewObjectNameTextBox.Text +".xml"; if (ExposedObject.ObjectExists(newObjectName)) { MessageBox.Show("An object with same name exists, change the name"); return; } String objectTypeName = ObjectTypesComboBox.SelectedItem.ToString(); ObjectType newObjectType = (ObjectType)m_MainForm.m_Database.GetDataType(objectTypeName); ObjectsTreeView objectsTreeView = m_MainForm.GetObjectsTree(); ExposedObject newObject = new ExposedObject(newObjectType, newObjectName); newObject.Save(); m_MainForm.RefreshNodes(); this.Close(); // check for repeated names... // create a new object object of the desired type and name.. // the name will be contatenaded from the active path }
private void ObjectReferencesTreeView_AfterSelect(object sender, TreeViewEventArgs e) { TreeNode selectedNode = e.Node; ExposedObject exposedObject = null; if (ObjectReferencesTreeView.m_NodesToObjects.TryGetValue(selectedNode, out exposedObject)) { m_SelectObject = exposedObject; } else { m_SelectObject = null; } }
public static ExposedObject Load(XmlNode rootNode, String objectName) { //String objectName = rootNode.Attributes.GetNamedItem("name").Value; String objectTypeName = rootNode.Attributes.GetNamedItem("type").Value; if ( objectTypeName == null) return null; ObjectType objectType = DatabaseSystem.GetObjectType(objectTypeName); if (objectType == null) return null; ExposedObject newObject =new ExposedObject(objectType, objectName); newObject.ReadMembers(rootNode); return newObject; }
public void FillPanelForObject(ExposedObject exposedObject) { if (m_CurrentObject != null) { m_CurrentObject.ReadControl(ObjectType.s_ActiveObjectTypeControl,true); } ActiveExposedObjectTypeNameLabel.Text = exposedObject.m_Type.m_Name; ActiveExposedObjectNameLabel.Text = exposedObject.m_Name; if (exposedObject.m_NeedsSaving) { ActiveExposedObjectNameLabel.Text += " * "; } DataControl_ObjectType mainControl = exposedObject.m_Type.m_Control; ObjectType.s_ActiveObjectTypeControl = mainControl; ObjectType.s_MainPanel = ObjectPanel; exposedObject.FillControl(mainControl); m_CurrentObject = exposedObject; ObjectType.RefreshActiveObjectTypeControl(); }
private void CancelButton_Click(object sender, EventArgs e) { m_SelectObject = null; this.Close(); }
public override Object CreateDefault() { ExposedObject newObject = new ExposedObject(this, ""); return newObject; }