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; }
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 (ipScannerView == null) { ipScannerView = new IPScannerView(); } contentControlApplication.Content = ipScannerView; break; case ApplicationViewManager.Name.PortScanner: if (portScannerView == null) { portScannerView = new PortScannerView(); } contentControlApplication.Content = portScannerView; break; case ApplicationViewManager.Name.Ping: if (pingHostView == null) { pingHostView = new PingHostView(); } contentControlApplication.Content = pingHostView; break; case ApplicationViewManager.Name.Traceroute: if (tracerouteView == null) { tracerouteView = new TracerouteView(); } contentControlApplication.Content = tracerouteView; break; case ApplicationViewManager.Name.DNSLookup: if (dnsLookupView == null) { dnsLookupView = new DNSLookupView(); } contentControlApplication.Content = dnsLookupView; break; case ApplicationViewManager.Name.RemoteDesktop: if (remoteDesktopView == null) { remoteDesktopView = new RemoteDesktopView(); } contentControlApplication.Content = remoteDesktopView; 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.SubnetCalculator: if (subnetCalculatorHostView == null) { subnetCalculatorHostView = new SubnetCalculatorHostView(); } contentControlApplication.Content = subnetCalculatorHostView; break; case ApplicationViewManager.Name.HTTPHeaders: if (httpHeadersView == null) { httpHeadersView = new HTTPHeadersView(); } contentControlApplication.Content = httpHeadersView; break; case ApplicationViewManager.Name.ARPTable: if (arpTableView == null) { arpTableView = new ARPTableView(); } contentControlApplication.Content = arpTableView; break; case ApplicationViewManager.Name.Lookup: if (lookupHostView == null) { lookupHostView = new LookupHostView(); } contentControlApplication.Content = lookupHostView; break; } currentApplicationViewName = name; }