コード例 #1
0
        public void Setup()
        {
            graph            = new Graph();
            vertex           = new Vertex();
            serializeGraph   = new SerializeGraph();
            deserializeGraph = new DeserializeGraph();

            graph.Vertexs = new List <Vertex>(1);
            vertex.Nodes  = new List <Node>(2);

            vertex.Nodes.Add(new Node()
            {
                Weight = 228, Connectable = 20
            });
            vertex.Nodes.Add(new Node()
            {
                Weight = 14, Connectable = 17
            });

            graph.Vertexs.Add(new Vertex()
            {
                Nodes = vertex.Nodes, Id = 42
            });

            serializeGraph.SaveGraph(graph, "TestSeving");
        }
コード例 #2
0
        public SaveButton(int width, int height, AdjacencyList adjacencyList, StartForm.DrawForm drawForm)
        {
            Size = new System.Drawing.Size(width, height);

            Dock = DockStyle.Top;

            Text = "Save that graph";

            Size = new System.Drawing.Size(150, 30);

            Anchor = (AnchorStyles.Bottom | AnchorStyles.Right); // anchorage to place

            Click += new EventHandler(ButtonClick);

            serializeGraph = new SerializeGraph();

            converter = new Converter();

            this.adjacencyList = adjacencyList;

            this.drawForm = drawForm;
        }