public override NSObject GetObjectValue(NSTableView tableView, NSTableColumn tableColumn, nint row) { var valueKey = (NSString)tableColumn.Identifier.ToString(); CWNetwork selectedNetwork = Networks [row]; switch (valueKey) { case "NETWORK_NAME": return((NSString)selectedNetwork.Ssid); case "BSSID": return((NSString)selectedNetwork.Bssid); case "CHANNEL": return((NSString)selectedNetwork.WlanChannel.ChannelNumber.ToString()); case "PHY_MODE": return((NSString)selectedNetwork.GetSupportedPHYMode().GetStringInterpretation()); case "NETWORK_MODE": return((NSString)(selectedNetwork.Ibss ? "Yes" : "No")); case "RSSI": return((NSString)selectedNetwork.RssiValue.ToString()); case "SECURITY_MODE": return((NSString)selectedNetwork.GetSecurityMode().GetStringInterpretation()); } throw new Exception(string.Format("Incorrect value requested '{0}'", valueKey)); }
public static CWSecurity GetSecurityMode(this CWNetwork network) { foreach (var securityMode in (CWSecurity[])Enum.GetValues(typeof(CWSecurity))) { if (network.SupportsSecurity(securityMode)) { return(securityMode); } } return(CWSecurity.None); }
public static CWPhyMode GetSupportedPHYMode(this CWNetwork network) { foreach (var phyMode in (CWPhyMode[])Enum.GetValues(typeof(CWPhyMode))) { if (network.SupportsPhyMode(phyMode)) { return(phyMode); } } return(CWPhyMode.None); }
private void UpdateScanTab() { NSDictionary param = NSDictionary.FromObjectAndKey(NSNumber.FromBoolean(mergeScanResultsCheckbox.State == NSCellStateValue.On), new NSString("true")); NSError error = null; ScanResults = CurrentInterface.ScanForNetworksWithParameters(param, out error); if (error == null) { Array.Sort(ScanResults, delegate(CWNetwork networkA, CWNetwork networkB) { return(networkA.Ssid.CompareTo(networkB.Ssid)); }); } else { ScanResults = new CWNetwork[0]; NSAlert.WithError(error).RunModal(); } scanResultsTable.ReloadData(); }
// Call to load from the XIB/NIB file public JoinDialogController (CWNetwork networkToJoin, CWInterface currentInterface) : base ("JoinDialog") { NetworkToJoin = networkToJoin; CurrentInterface = currentInterface; }
// Shared initialization code public void Initialize() { ScanResults = new CWNetwork[0]; }
// Shared initialization code public void Initialize () { ScanResults = new CWNetwork[0]; }
private void UpdateScanTab () { NSDictionary param = NSDictionary.FromObjectAndKey (NSNumber.FromBoolean (mergeScanResultsCheckbox.State == NSCellStateValue.On), new NSString ("true")); NSError error = null; ScanResults = CurrentInterface.ScanForNetworksWithParameters (param, out error); if (error == null) { Array.Sort (ScanResults, delegate(CWNetwork networkA, CWNetwork networkB) { return networkA.Ssid.CompareTo(networkB.Ssid); }); } else { ScanResults = new CWNetwork[0]; NSAlert.WithError(error).RunModal(); } scanResultsTable.ReloadData(); }
// Call to load from the XIB/NIB file public JoinDialogController(CWNetwork networkToJoin, CWInterface currentInterface) : base("JoinDialog") { NetworkToJoin = networkToJoin; CurrentInterface = currentInterface; }