Esempio n. 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");
        }
        public LoadFileButton(StartForm.StartForm startForm)
        {
            Text = "Load file";

            this.left = left;

            FlatStyle = System.Windows.Forms.FlatStyle.Popup;

            ForeColor = Color.Black;

            this.BackColor = Color.Orange;

            Font = new System.Drawing.Font("Comic Sans MS", 11.25F, System.Drawing.FontStyle.Regular,
                                           System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

            Location = new System.Drawing.Point(350, 220);

            Size = new System.Drawing.Size(100, 50);

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

            vertexDraws = new List <VertexDraw>();

            this.startForm = startForm;

            edgeDraws = new List <EdgeDraw>();

            Click += new EventHandler(ButtonClick);

            deserializeGraph = new DeserializeGraph();

            converter = new DrawForm.Converter();

            ofd = new OpenFileDialog();

            ofd.Filter = "Json files (*.json)|*.json";

            ofd.CheckFileExists = true;

            collisionVertex = new CollisionVertex();
        }