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.PuTTY: if (puTTYView == null) { puTTYView = new PuTTYView(); } contentControlApplication.Content = puTTYView; break; case ApplicationViewManager.Name.SNMP: if (snmpView == null) { snmpView = new SNMPView(); } contentControlApplication.Content = snmpView; 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; }
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.SubnetCalculator: if (subnetCalculatorView == null) { subnetCalculatorView = new SubnetCalculatorView(); } contentControlApplication.Content = subnetCalculatorView; break; case ApplicationViewManager.Name.WakeOnLAN: if (wakeOnLANView == null) { wakeOnLANView = new WakeOnLANView(); } contentControlApplication.Content = wakeOnLANView; break; case ApplicationViewManager.Name.Ping: if (pingView == null) { pingView = new PingView(); } contentControlApplication.Content = pingView; 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.Wiki: if (wikiView == null) { wikiView = new WikiView(); } contentControlApplication.Content = wikiView; break; } currentApplicationViewName = name; }