private BaseNode MakeNewNode(int id) { string nodeId = DataViewHierarchyAccessor.GetNodeId(id); nodeId = nodeId.ToLowerInvariant(); BaseNode newNode = null; switch (nodeId) { case "table": newNode = new TableNode(DataViewHierarchyAccessor, id); break; case "storedprocedure": newNode = new StoredProcedureNode(DataViewHierarchyAccessor, id, false); break; case "storedfunction": newNode = new StoredProcedureNode(DataViewHierarchyAccessor, id, true); break; case "view": newNode = new ViewNode(DataViewHierarchyAccessor, id); break; case "udf": newNode = new UDFNode(DataViewHierarchyAccessor, id); break; case "trigger": newNode = new TriggerNode(DataViewHierarchyAccessor, id); break; default: throw new NotSupportedException("Node type not supported"); } Debug.Assert(newNode != null); return(newNode); }
public static void CreateNew(DataViewHierarchyAccessor HierarchyAccessor) { ViewNode node = new ViewNode(HierarchyAccessor, 0); node.Edit(); }
private BaseNode MakeNewNode(int id) { string nodeId = DataViewHierarchyAccessor.GetNodeId(id); nodeId = nodeId.ToLowerInvariant(); BaseNode newNode = null; switch (nodeId) { case "table": newNode = new TableNode(DataViewHierarchyAccessor, id); break; case "storedprocedure": newNode = new StoredProcedureNode(DataViewHierarchyAccessor, id, false); break; case "storedfunction": newNode = new StoredProcedureNode(DataViewHierarchyAccessor, id, true); break; case "view": newNode = new ViewNode(DataViewHierarchyAccessor, id); break; case "udf": newNode = new UDFNode(DataViewHierarchyAccessor, id); break; case "trigger": newNode = new TriggerNode(DataViewHierarchyAccessor, id); break; default: throw new NotSupportedException("Node type not supported"); } Debug.Assert(newNode != null); return newNode; }