}\r
}\r
\r
- public Task Disconnect(string essid)\r
- {\r
- Debug("WiFi.Disconnect");\r
- WiFiAP ap = FindAP(essid);\r
- if (ap == null)\r
- {\r
- return Task.FromException(new ArgumentException("Cannot find " + essid));\r
- }\r
- return ap.DisconnectAsync();\r
- }\r
-\r
- public async Task Forget(string essid)\r
+ public async Task Forget(AP ap)\r
{\r
Debug("WiFi.Forget");\r
- WiFiAP ap = FindAP(essid);\r
if (ap == null)\r
{\r
- Debug("Cannot find " + essid);\r
+ Debug("Cannot find AP");\r
return;\r
}\r
- ap.ForgetAP();\r
+\r
+ WiFiAP apHandle = ap.ApHandle;\r
+ apHandle.ForgetAP();\r
}\r
\r
public async Task ScanSpecificAP(string essid)\r
public async Task ConnectWps(AP ap, string pin)\r
{\r
Debug("WiFi.ConnectWps");\r
- WiFiAP wifiAP = FindAP(ap.Essid);\r
- if (wifiAP == null)\r
+ if (ap == null)\r
{\r
- Debug("Cannot find " + ap.Essid);\r
+ Debug("Cannot find AP");\r
return;\r
}\r
\r
+ WiFiAP apHandle = ap.ApHandle;\r
try\r
{\r
if (pin == null)\r
{\r
- await wifiAP.ConnectWpsAsync(new WpsPbcInfo());\r
+ await apHandle.ConnectWpsAsync(new WpsPbcInfo());\r
}\r
else\r
{\r
- await wifiAP.ConnectWpsAsync(new WpsPinInfo(pin));\r
+ await apHandle.ConnectWpsAsync(new WpsPinInfo(pin));\r
}\r
}\r
catch (Exception e)\r
}\r
}\r
\r
- private WiFiAP FindAP(string essid)\r
- {\r
- Debug("WiFi.FindAP");\r
- GetScanResult();\r
- foreach (var item in mApList)\r
- {\r
- Debug("Found AP\t" + item.NetworkInformation.Essid);\r
- if (item.NetworkInformation.Essid.Equals(essid))\r
- {\r
- return item;\r
- }\r
- }\r
- return null;\r
- }\r
-\r
public bool IsActive()\r
{\r
Debug("WiFi.IsActive");\r
bool isWpsSupported = item.SecurityInformation.IsWpsSupported;\r
WiFiState state = convertWiFiState(item.NetworkInformation.ConnectionState);\r
\r
- if (item.NetworkInformation.ConnectionState.ToString().Equals(Resources.IDS_WIFI_SBODY_CONNECTED_M_STATUS))\r
- {\r
- apInfoList.Add(new AP(item, item.NetworkInformation.Essid,\r
- state, securityType, isWpsSupported,\r
- item.NetworkInformation.Bssid, item.NetworkInformation.RssiLevel));\r
- }\r
+ var networkInfo = item.NetworkInformation;\r
+ var ap = new AP(item, networkInfo.Essid,\r
+ state, securityType, isWpsSupported,\r
+ networkInfo.Bssid, networkInfo.RssiLevel);\r
+\r
+ apInfoList.Add(ap);\r
}\r
\r
return apInfoList;\r
namespace SettingWiFi.res.locale {
using System;
-
+
/// <summary>
/// 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Resources {
-
+
private static global::System.Resources.ResourceManager resourceMan;
-
+
private static global::System.Globalization.CultureInfo resourceCulture;
-
+
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
-
+
/// <summary>
/// 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다.
/// </summary>
return resourceMan;
}
}
-
+
/// <summary>
/// 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대해 현재 스레드의 CurrentUICulture 속성을
/// 재정의합니다.
resourceCulture = value;
}
}
-
+
/// <summary>
/// 과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
return ResourceManager.GetString("IDS_ST_HEADER_AVAILABLE_NETWORKS", resourceCulture);
}
}
-
+
/// <summary>
/// 과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
return ResourceManager.GetString("IDS_WIFI_SBODY_CONNECTED_M_STATUS", resourceCulture);
}
}
-
+
/// <summary>
/// 과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
return ResourceManager.GetString("IDS_WIFI_HEADER_WI_FI_NETWORK_INFO_ABB", resourceCulture);
}
}
-
+
/// <summary>
/// 과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
return ResourceManager.GetString("IDS_WIFI_HEADER_PASSWORD", resourceCulture);
}
}
+
+ /// <summary>
+ /// 과(와) 유사한 지역화된 문자열을 찾습니다.
+ /// </summary>
+ public static string IDS_WIFI_OPT_FORGET_NETWORK {
+ get {
+ return ResourceManager.GetString("IDS_WIFI_OPT_FORGET_NETWORK", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// 과(와) 유사한 지역화된 문자열을 찾습니다.
+ /// </summary>
+ public static string IDS_WIFI_BODY_STATIC_IP {
+ get {
+ return ResourceManager.GetString("IDS_WIFI_BODY_STATIC_IP", resourceCulture);
+ }
+ }
}
}
<data name="IDS_WIFI_HEADER_PASSWORD" xml:space="preserve">\r
<value>Password</value>\r
</data>\r
+ <data name="IDS_WIFI_OPT_FORGET_NETWORK" xml:space="preserve">\r
+ <value>Forget network</value>\r
+ </data>\r
+ <data name="IDS_WIFI_BODY_STATIC_IP" xml:space="preserve">\r
+ <value>Static IP</value>\r
+ </data>\r
</root>
\ No newline at end of file
<data name="IDS_WIFI_HEADER_PASSWORD" xml:space="preserve">\r
<value>비밀번호</value>\r
</data>\r
+ <data name="IDS_WIFI_OPT_FORGET_NETWORK" xml:space="preserve">\r
+ <value>네트워크 지우기</value>\r
+ </data>\r
+ <data name="IDS_WIFI_BODY_STATIC_IP" xml:space="preserve">\r
+ <value>고정 IP</value>\r
+ </data>\r
</root>
\ No newline at end of file
<data name="IDS_WIFI_HEADER_PASSWORD" xml:space="preserve">\r
<value />\r
</data>\r
+ <data name="IDS_WIFI_OPT_FORGET_NETWORK" xml:space="preserve">\r
+ <value />\r
+ </data>\r
+ <data name="IDS_WIFI_BODY_STATIC_IP" xml:space="preserve">\r
+ <value />\r
+ </data>\r
</root>
\ No newline at end of file
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Binding;
using Tizen.NUI.Components;
+using SettingWiFi.res.locale;
using static SettingWiFi.Logger;
var appBar = new AppBar()
{
- Title = "Wi-Fi network info",
+ Title = Resources.IDS_WIFI_HEADER_WI_FI_NETWORK_INFO_ABB,
};
AppBarStyle appBarStyle = (AppBarStyle)ThemeManager.GetStyle("Tizen.NUI.Components.AppBar");
var forgetButton = new Button()
{
- Text = "Forget",
+ Text = Resources.IDS_WIFI_SK_FORGET,
WidthSpecification = 300,
HeightSpecification = 80,
};
var toggle = new DefaultLinearItem()
{
WidthSpecification = LayoutParamPolicies.MatchParent,
- Text = "Staic IP",
+ Text = Resources.IDS_WIFI_BODY_STATIC_IP,
IsSelectable = false,
};
toggle.Label.HorizontalAlignment = HorizontalAlignment.Begin;
var cancelButton = new Button()
{
- Text = "Cancel",
+ Text = Resources.IDS_WIFI_SK_CANCEL,
WidthSpecification = 300,
HeightSpecification = 80,
};
var forgetButton = new Button()
{
- Text = "Forget",
+ Text = Resources.IDS_WIFI_SK_FORGET,
WidthSpecification = 300,
HeightSpecification = 80,
};
{
Content = new AlertDialog()
{
- Title = "Forget network",
+ Title = Resources.IDS_WIFI_OPT_FORGET_NETWORK,
Content = forgetView,
Actions = new View[] { cancelButton, forgetButton },
},
private async void Forget()
{
- await mWifi.Forget(mAp.Essid);
- if (mWifi.IsActive())
- {
- ScanAP();
- }
- }
-
- private async void ScanAP()
- {
- await mWifi.Scan();
- List<AP> apList = mWifi.GetScanResult();
- mApSource.UpdateScanList(apList);
+ await mWifi.Forget(mAp);
}
}
}
\ No newline at end of file