Example #1
0
        private void AddNetwork(NetworkInfo networkInfo)
        {
            foreach (var thisNetwork in networks)
            {
                if (thisNetwork.NetworkID == networkInfo.NetworkId)
                {
                    throw new Exception("That network has already been added.");
                }
            }

            var network = Network.FromNetworkInfo(this, networkInfo);

            networks.Add(network);

            /*
             * if (!fileSystem.RootDirectory.HasSubdirectory(network.NetworkID)) {
             *      Directory directory = fileSystem.RootDirectory.CreateSubdirectory(network.NetworkID);
             *      directory.Requested = true;
             * }
             */

            NetworkAdded?.Invoke(network);
            network.Start();
        }
Example #2
0
 internal static void OnNetworkAdded(Guid id) => NetworkAdded?.Invoke(id);