示例#1
0
        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
        }
示例#2
0
 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;
     }
 }
示例#3
0
        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;
        }
示例#4
0
        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();
        }
示例#5
0
 private void CancelButton_Click(object sender, EventArgs e)
 {
     m_SelectObject = null;
     this.Close();
 }
示例#6
0
 public override Object CreateDefault()
 {
     ExposedObject newObject = new ExposedObject(this, "");
     return newObject;
 }