Exemplo n.º 1
0
        private void ChangeApplicationView(ApplicationViewManager.Name name)
        {
            if (currentApplicationViewName == name)
            {
                return;
            }

            switch (name)
            {
            case ApplicationViewManager.Name.NetworkInterface:
                if (_networkInterfaceView == null)
                {
                    _networkInterfaceView = new NetworkInterfaceView();
                }
                else
                {
                    RefreshApplicationView(name);
                }

                contentControlApplication.Content = _networkInterfaceView;
                break;

            case ApplicationViewManager.Name.IPScanner:
                if (_ipScannerHostView == null)
                {
                    _ipScannerHostView = new IPScannerHostView();
                }

                contentControlApplication.Content = _ipScannerHostView;
                break;

            case ApplicationViewManager.Name.PortScanner:
                if (_portScannerHostView == null)
                {
                    _portScannerHostView = new PortScannerHostView();
                }

                contentControlApplication.Content = _portScannerHostView;
                break;

            case ApplicationViewManager.Name.Ping:
                if (_pingHostView == null)
                {
                    _pingHostView = new PingHostView();
                }

                contentControlApplication.Content = _pingHostView;
                break;

            case ApplicationViewManager.Name.Traceroute:
                if (_tracerouteHostView == null)
                {
                    _tracerouteHostView = new TracerouteHostView();
                }

                contentControlApplication.Content = _tracerouteHostView;
                break;

            case ApplicationViewManager.Name.DNSLookup:
                if (_dnsLookupHostView == null)
                {
                    _dnsLookupHostView = new DNSLookupHostView();
                }

                contentControlApplication.Content = _dnsLookupHostView;
                break;

            case ApplicationViewManager.Name.RemoteDesktop:
                if (_remoteDesktopHostView == null)
                {
                    _remoteDesktopHostView = new RemoteDesktopHostView();
                }

                contentControlApplication.Content = _remoteDesktopHostView;
                break;

            case ApplicationViewManager.Name.PuTTY:
                if (_puTTYHostView == null)
                {
                    _puTTYHostView = new PuTTYHostView();
                }

                contentControlApplication.Content = _puTTYHostView;
                break;

            case ApplicationViewManager.Name.SNMP:
                if (_snmpHostView == null)
                {
                    _snmpHostView = new SNMPHostView();
                }

                contentControlApplication.Content = _snmpHostView;
                break;

            case ApplicationViewManager.Name.WakeOnLAN:
                if (_wakeOnLANView == null)
                {
                    _wakeOnLANView = new WakeOnLANView();
                }

                contentControlApplication.Content = _wakeOnLANView;
                break;

            case ApplicationViewManager.Name.HTTPHeaders:
                if (_httpHeadersHostView == null)
                {
                    _httpHeadersHostView = new HTTPHeadersHostView();
                }

                contentControlApplication.Content = _httpHeadersHostView;
                break;

            case ApplicationViewManager.Name.SubnetCalculator:
                if (_subnetCalculatorHostView == null)
                {
                    _subnetCalculatorHostView = new SubnetCalculatorHostView();
                }

                contentControlApplication.Content = _subnetCalculatorHostView;
                break;

            case ApplicationViewManager.Name.Lookup:
                if (_lookupHostView == null)
                {
                    _lookupHostView = new LookupHostView();
                }

                contentControlApplication.Content = _lookupHostView;
                break;

            case ApplicationViewManager.Name.Connections:
                if (_connectionsView == null)
                {
                    _connectionsView = new ConnectionsView();
                }

                contentControlApplication.Content = _connectionsView;
                break;

            case ApplicationViewManager.Name.Listeners:
                if (_listenersView == null)
                {
                    _listenersView = new ListenersView();
                }

                contentControlApplication.Content = _listenersView;
                break;

            case ApplicationViewManager.Name.ARPTable:
                if (_arpTableView == null)
                {
                    _arpTableView = new ARPTableView();
                }

                contentControlApplication.Content = _arpTableView;
                break;
            }

            currentApplicationViewName = name;
        }
Exemplo n.º 2
0
        private void ChangeApplicationView(ApplicationViewManager.Name name)
        {
            if (currentApplicationViewName == name)
            {
                return;
            }

            switch (name)
            {
            case ApplicationViewManager.Name.NetworkInterface:
                if (networkInterfaceView == null)
                {
                    networkInterfaceView = new NetworkInterfaceView();
                }

                contentControlApplication.Content = networkInterfaceView;
                break;

            case ApplicationViewManager.Name.IPScanner:
                if (ipScannerHostView == null)
                {
                    ipScannerHostView = new IPScannerHostView();
                }

                contentControlApplication.Content = ipScannerHostView;
                break;

            case ApplicationViewManager.Name.PortScanner:
                if (portScannerHostView == null)
                {
                    portScannerHostView = new PortScannerHostView();
                }

                contentControlApplication.Content = portScannerHostView;
                break;

            case ApplicationViewManager.Name.Ping:
                if (pingHostView == null)
                {
                    pingHostView = new PingHostView();
                }

                contentControlApplication.Content = pingHostView;
                break;

            case ApplicationViewManager.Name.Traceroute:
                if (tracerouteHostView == null)
                {
                    tracerouteHostView = new TracerouteHostView();
                }

                contentControlApplication.Content = tracerouteHostView;
                break;

            case ApplicationViewManager.Name.DNSLookup:
                if (dnsLookupHostView == null)
                {
                    dnsLookupHostView = new DNSLookupHostView();
                }

                contentControlApplication.Content = dnsLookupHostView;
                break;

            case ApplicationViewManager.Name.RemoteDesktop:
                if (remoteDesktopHostView == null)
                {
                    remoteDesktopHostView = new RemoteDesktopHostView();
                }

                contentControlApplication.Content = remoteDesktopHostView;
                break;

            case ApplicationViewManager.Name.PuTTY:
                if (puTTYHostView == null)
                {
                    puTTYHostView = new PuTTYHostView();
                }

                contentControlApplication.Content = puTTYHostView;
                break;

            case ApplicationViewManager.Name.SNMP:
                if (snmpHostView == null)
                {
                    snmpHostView = new SNMPHostView();
                }

                contentControlApplication.Content = snmpHostView;
                break;

            case ApplicationViewManager.Name.WakeOnLAN:
                if (wakeOnLANView == null)
                {
                    wakeOnLANView = new WakeOnLANView();
                }

                contentControlApplication.Content = wakeOnLANView;
                break;

            case ApplicationViewManager.Name.HTTPHeaders:
                if (httpHeadersHostView == null)
                {
                    httpHeadersHostView = new HTTPHeadersHostView();
                }

                contentControlApplication.Content = httpHeadersHostView;
                break;

            case ApplicationViewManager.Name.SubnetCalculator:
                if (subnetCalculatorHostView == null)
                {
                    subnetCalculatorHostView = new SubnetCalculatorHostView();
                }

                contentControlApplication.Content = subnetCalculatorHostView;
                break;

            case ApplicationViewManager.Name.Lookup:
                if (lookupHostView == null)
                {
                    lookupHostView = new LookupHostView();
                }

                contentControlApplication.Content = lookupHostView;
                break;

            case ApplicationViewManager.Name.Connections:
                if (connectionsView == null)
                {
                    connectionsView = new ConnectionsView();
                }

                contentControlApplication.Content = connectionsView;
                break;

            case ApplicationViewManager.Name.Listeners:
                if (listenersView == null)
                {
                    listenersView = new ListenersView();
                }

                contentControlApplication.Content = listenersView;
                break;

            case ApplicationViewManager.Name.ARPTable:
                if (arpTableView == null)
                {
                    arpTableView = new ARPTableView();
                }

                contentControlApplication.Content = arpTableView;
                break;
            }

            currentApplicationViewName = name;
        }