Exemplo n.º 1
0
        public static void FillNode(this KeSchema schema, TreeNode schemaNode)
        {
            // Enum types
            TreeNode enumTypesNode = schemaNode.Nodes.Add("Enum Types");

            enumTypesNode.Tag = schema;
            enumTypesNode.ContextMenuStrip = ContextMenuEnumTypes.CreateContextMenuForEnumType();

            foreach (KeEnumType enumType in schema.EnumTypes)
            {
                TreeNode enumTypeNode = enumTypesNode.Nodes.Add(enumType.Name);
                enumTypeNode.Tag = enumType;
            }

            // Complex types
            TreeNode complexTypesNode = schemaNode.Nodes.Add("Complex Types");

            complexTypesNode.Tag = "";

            foreach (KeComplexType complexType in schema.ComplexTypes)
            {
            }

            // Entity types
            TreeNode entityTypesNode = schemaNode.Nodes.Add("Entity Types");

            entityTypesNode.Tag = "";

            foreach (KeEntityType entityType in schema.EntityTypes)
            {
            }
        }
Exemplo n.º 2
0
        public AddEnumTypeDialog(KeSchema schema)
        {
            InitializeComponent();
            enumTypeNamespace.Text    = schema.Namespace;
            enumTypeNamespace.Enabled = false;

            enumUnderlingTypeCombox.SelectedIndex = 2;
            this.schema = schema;
        }
Exemplo n.º 3
0
        public static bool IsUnique(KeSchema schema, string name)
        {
            if (schema.EnumTypes.Any(e => e.Name == name))
            {
                return(false);
            }

            if (schema.ComplexTypes.Any(e => e.Name == name))
            {
                return(false);
            }

            if (schema.EntityTypes.Any(e => e.Name == name))
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 4
0
        public static void newEnumTypeMenuItem_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem menuItem = sender as ToolStripMenuItem;
            TreeNode          treeNode = (TreeNode)(menuItem.GetCurrentParent().Tag);
            KeSchema          schema   = treeNode.Tag as KeSchema;

            AddEnumTypeDialog newEnumTypeDialog = new AddEnumTypeDialog(schema);

            newEnumTypeDialog.StartPosition = FormStartPosition.CenterParent;

            if (newEnumTypeDialog.ShowDialog() == DialogResult.OK)
            {
                schema.EnumTypes.Add(new KeEnumType(schema.Namespace, newEnumTypeDialog.EnumName, newEnumTypeDialog.UnderlingTypeName, newEnumTypeDialog.IsFlag));
            }

            var node = treeNode.Nodes.Add(newEnumTypeDialog.EnumName);

            treeNode.Expand();
            //schema.DelaringModel.FillTreeView(treeNode.TreeView);

            // MessageBox.Show("Ok");
        }
Exemplo n.º 5
0
 public KeAction(KeSchema schema, string name, bool isBound, KePathExpression entitySetPathExpression)
     : base(schema, name, isBound, entitySetPathExpression)
 {
 }
Exemplo n.º 6
0
 public KeSchemaElement(KeSchema declaringSchema, string name)
     : base(name)
 {
     DeclaringSchema = declaringSchema;
 }
Exemplo n.º 7
0
 public KeTerm(KeSchema schema, string name, KeTypeReference type)
     : base(schema, name)
 {
 }
Exemplo n.º 8
0
 public KeFunction(KeSchema schema, string name, bool isBound, KePathExpression entitySetPathExpression, bool isComposable)
     : base(schema, name, isBound, entitySetPathExpression)
 {
     IsComposable = isComposable;
 }