Пример #1
0
        private void BuildDefaultProxyNetgraph(NetGraphDocument document)
        {
            List<BaseNodeConfig> nodes = new List<BaseNodeConfig>();

            ServerEndpointConfig server = new ServerEndpointConfig();
            server.Label = "SERVER";
            server.X = 80;
            server.Y = 150;
            nodes.Add(server);

            ClientEndpointConfig client = new ClientEndpointConfig();
            client.Label = "CLIENT";
            client.X = 280;
            client.Y = 150;
            nodes.Add(client);

            LogPacketConfig logout = new LogPacketConfig();
            logout.Label = "LOGOUT";
            logout.X = 180;
            logout.Y = 60;
            logout.Color = ColorValue.Pink;
            logout.Tag = "Out";
            nodes.Add(logout);

            LogPacketConfig login = new LogPacketConfig();
            login.Label = "LOGIN";
            login.X = 180;
            login.Y = 240;
            login.Color = ColorValue.Powderblue;
            login.Tag = "In";
            nodes.Add(login);

            List<LineConfig> lines = new List<LineConfig>();
            lines.Add(new LineConfig(server, logout, false, null, false));
            lines.Add(new LineConfig(logout, client, false, null, false));
            lines.Add(new LineConfig(client, login, false, null, false));
            lines.Add(new LineConfig(login, server, false, null, false));

            document.UpdateGraph(nodes.ToArray(), lines.ToArray());
        }