Example #1
0
        /// <summary>
        /// Create a default proxy graph factory (contains two log elements and two end points)
        /// </summary>
        /// <param name="name">A name to associate with the graph</param>
        /// <returns>The new factory</returns>
        public static NetGraphFactory CreateDefaultProxyGraph(string name)
        {
            string prefix = name != null?String.Format("{0} - ", name) : String.Empty;

            NetGraphBuilder builder = new NetGraphBuilder();

            ClientEndpointFactory client = builder.AddClient(prefix + "CLIENT", Guid.NewGuid());
            ServerEndpointFactory server = builder.AddServer(prefix + "SERVER", Guid.NewGuid());
            LogPacketNodeFactory  logOut = builder.AddLog(prefix + "Out", Guid.NewGuid(), ColorValue.Pink, null, false);
            LogPacketNodeFactory  logIn  = builder.AddLog(prefix + "In", Guid.NewGuid(), ColorValue.Powderblue, null, false);

            builder.AddLines(server, logOut, client, logIn, server);

            return(builder.Factory);
        }
        /// <summary>
        /// Create a default proxy graph factory
        /// </summary>
        /// <param name="name">A name to associate with the graph</param>
        /// <returns>The new factory</returns>
        public static NetGraphFactory CreateDefaultProxyGraph(string name)
        {
            string prefix = name != null?String.Format("{0} - ", name) : String.Empty;

            NetGraphBuilder builder = new NetGraphBuilder();

            var client = builder.AddClient(prefix + "CLIENT", Guid.NewGuid());
            var server = builder.AddServer(prefix + "SERVER", Guid.NewGuid());
            var logOut = builder.AddLog(prefix + "LOGOUT", Guid.NewGuid(),
                                        ColorValue.Pink, "Out", false);
            var logIn = builder.AddLog(prefix + "LOGIN", Guid.NewGuid(),
                                       ColorValue.Powderblue, "In", false);
            var editOut = builder.AddEdit(prefix + "EDITOUT", Guid.NewGuid(), ColorValue.White, "Out");
            var editIn  = builder.AddEdit(prefix + "EDITIN", Guid.NewGuid(), ColorValue.White, "In");

            builder.AddLines(server, editOut, logOut, client, editIn, logIn, server);

            return(builder.Factory);
        }