Exemple #1
0
        protected override void OnMouseClick(MouseEventArgs e)
        {
            switch (Mode)
            {
            case Mode.AddClientNode:
                var clientNodeView = new ClientNodeView();
                _selectedNodeView = clientNodeView;
                new ClientNodeForm(clientNodeView).ShowDialog(this);
                break;

            case Mode.AddNetworkNode:
                var networkNodeView = new NetworkNodeView();
                _selectedNodeView = networkNodeView;

                var parameters = networkNodeView.Parameters;
                parameters.IpAddress = Settings.Default.IpAddress;
                parameters.CableCloudListeningPort             = Settings.Default.CableCloudListenerPort;
                parameters.NetworkManagmentSystemListeningPort = Settings.Default.NetworkManagmentSystemListeningPort;
                parameters.SignallingCloudListeningPort        = Settings.Default.SignallingCloudListeningPort;
                break;

            default:
                return;
            }

            Add(_selectedNodeView);
            _selectedNodeView.Location = e.Location;
            Refresh();
        }
        private void AddToNetworkHierarchyTreeView(NetworkNodeView node)
        {
            var treeNode = new TreeNode {
                Tag = node
            };

            var address = AddToTreeView(treeNode);

            node.Parameters.NetworkAddress = address;
            node.NetworkAddress            = address;
            treeNode.Text = address.ToString();
        }
        public void InitializeNetworkNodeTest()
        {
            var networkNodePictureBox = new NetworkNodeView {
                Parameters = new NetworkNodeModel {
                    NumberOfPorts           = 8,
                    CableCloudListeningPort = 10000,
                    IpAddress = "127.0.0.1",
                    NetworkManagmentSystemListeningPort = 6666,
                    SignallingCloudListeningPort        = PortRandomizer.RandomFreePort()
                }
            };

            networkNodePictureBox.Initialize().Start();
        }
Exemple #4
0
        public void SerializeNetworkNodePictureBox()
        {
            var networkNodePictureBox = new NetworkNodeView {
                Parameters = new NetworkNodeModel {
                    CableCloudListeningPort = 10000,
                    IpAddress = "localhost",
                    NetworkManagmentSystemListeningPort = 6666,
                    NumberOfPorts = 8
                }
            };

            var serialized = XmlSerializer.Serialize(networkNodePictureBox);

            var deserialized = new NetworkNodeView();

            XmlSerializer.Deserialize(deserialized, serialized);
        }