コード例 #1
0
ファイル: Form1.cs プロジェクト: jonrgrover/ideas
        public ForeignKey(string tableName, string columnLabel, string toTableName, string toPrimaryKey)
        {
            ForeignTableColumn = new GraphNode(columnLabel);
            ForeignTableColumn.Container = tableName;

            PrimaryTableColumn = new GraphNode(toPrimaryKey);
            PrimaryTableColumn.Container = toTableName;

            FromForeignToPrimary = new GraphEdge(ForeignTableColumn, PrimaryTableColumn, "Foreign Key");
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: jonrgrover/ideas
 public MemberList(string myNamespace, string className)
 {
     HeadOfList = new GraphNode("");
     HeadOfList.Container  = className;
     HeadOfList.Container2 = myNamespace;
 }
コード例 #3
0
ファイル: Form1.cs プロジェクト: jonrgrover/ideas
        // ----------------------------------------------------------------------------------------
        /// <!-- btnRun_Click -->
        /// <summary>
        ///      basing L4 on L2
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnRun_Click(object sender, EventArgs e)
        {
            // --------------------------------------------------------------------------
            // L4: (constructs at this level should be able to subsume the other levels)
            // --------------------------------------------------------------------------
            Graph     graph = new Graph();
            GraphNode node1 = new GraphNode("Jon");
            GraphNode node2 = new GraphNode("Grover");
            GraphEdge edge  = new GraphEdge(node1, node2);

            graph.Add(node1);
            graph.Add(node2);
            graph.Add(edge);
            string strEdge = edge.ToString();
            Assert.That(strEdge == "Jon -> Grover");


            // --------------------------------------------------------------------------
            // L3 concrete class: (there is no language, system or tool yet)
            // --------------------------------------------------------------------------
            MemberListConcrete dog = new MemberListConcrete("AnimalNamespace", "Dog");
            dog.Add("AnimalNamespace", "AppendageList", "Paws");
            dog.Add("AnimalNamespace", "Sense"        , "Nose");
            string strMemberList = dog.ToString();
            Assert.That(strMemberList  == "Dog : Paws, Nose");

            // --------------------------------------------------------------------------
            // L3 abstract class: (there is no language, system or tool yet)
            // --------------------------------------------------------------------------
            MemberList dog2 = new MemberList("AnimalNamespace", "Dog");



            // --------------------------------------------------------------------------
            // L2 concrete class: (oo languages)
            // --------------------------------------------------------------------------
            InheritClassConcrete inheritRelation = new InheritClassConcrete("Dog", "Animal");
            Assert.That(inheritRelation.ToString() == "Dog : Animal");
            inheritRelation = new InheritClassConcrete("AnimalNamespace", "Dog", "AnimalNamespace", "Animal");
            Assert.That(inheritRelation.ToString() == "AnimalNamespace.Dog : AnimalNamespace.Animal");

            // --------------------------------------------------------------------------
            // L2 abstract class: (oo languages) - basing L2 on L4
            // --------------------------------------------------------------------------
            InheritClass inheritRelation2 = new InheritClass("Dog", "Animal");
            Assert.That(inheritRelation2.ToString() == "Dog : Animal");
            inheritRelation2 = new InheritClass("AnimalNamespace", "Dog", "AnimalNamespace", "Animal");
            Assert.That(inheritRelation2.ToString() == "AnimalNamespace.Dog : AnimalNamespace.Animal");



            // --------------------------------------------------------------------------
            // L1 concrete class: (databases)
            // --------------------------------------------------------------------------
            ForeignKeyConcrete join = new ForeignKeyConcrete("EggDetail", "ParentEggID", "EggMaster", "EggID");
            string strJoin = join.ToString();
            Assert.That(strJoin == "EggDetail.ParentEggID >- EggMaster.EggID");

            // --------------------------------------------------------------------------
            // L1 abstract class: (databases) basing L1 on L4
            // --------------------------------------------------------------------------
            ForeignKey join2 = new ForeignKey("EggDetail", "ParentEggID", "EggMaster", "EggID");
            string strJoin2 = join2.ToString();
            Assert.That(strJoin2 == "EggDetail.ParentEggID >- EggMaster.EggID");



            btnRun.Text = "Success";
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: jonrgrover/ideas
 public InheritClass(string myNamespace, string className, string parentNamespace, string parentName)
 {
     MyClass     = new GraphNode(className ); MyClass.Container     = myNamespace    ;
     ParentClass = new GraphNode(parentName); ParentClass.Container = parentNamespace;
     Inheritance = new GraphEdge(ParentClass, MyClass, "Inherits");
 }
コード例 #5
0
ファイル: Form1.cs プロジェクト: jonrgrover/ideas
 public InheritClass(string name, string parent)
 {
     MyClass     = new GraphNode(name  );
     ParentClass = new GraphNode(parent);
     Inheritance = new GraphEdge(ParentClass, MyClass, "Inherits");
 }
コード例 #6
0
ファイル: Form1.cs プロジェクト: jonrgrover/ideas
 public GraphEdge(GraphNode FKColumn, GraphNode PKColumn, string edgeType)
 {
     SourceNode      = FKColumn;
     DestinationNode = PKColumn;
     EdgeType        = edgeType;
 }
コード例 #7
0
ファイル: Form1.cs プロジェクト: jonrgrover/ideas
 public GraphEdge(GraphNode fromNode, GraphNode toNode)
 {
     SourceNode      = fromNode;
     DestinationNode = toNode  ;
     EdgeType        = "Graph" ;
 }
コード例 #8
0
ファイル: Form1.cs プロジェクト: jonrgrover/ideas
 public void Add(GraphNode node)
 {
     _graph.Add(node);
 }