diff --git a/BINARY/Broadlink.NET.dll b/BINARY/Broadlink.NET.dll
index 31cf562..87b0766 100644
Binary files a/BINARY/Broadlink.NET.dll and b/BINARY/Broadlink.NET.dll differ
diff --git a/BINARY/Broadlink.OneClick.exe b/BINARY/Broadlink.OneClick.exe
index ebe7347..a644488 100644
Binary files a/BINARY/Broadlink.OneClick.exe and b/BINARY/Broadlink.OneClick.exe differ
diff --git a/BINARY/Broadlink.WinApp.exe b/BINARY/Broadlink.WinApp.exe
index 959841f..c8f8fb9 100644
Binary files a/BINARY/Broadlink.WinApp.exe and b/BINARY/Broadlink.WinApp.exe differ
diff --git a/Broadlink.WinApp/Broadlink.WinApp.csproj b/Broadlink.WinApp/Broadlink.WinApp.csproj
index 6ce251d..70131f0 100644
--- a/Broadlink.WinApp/Broadlink.WinApp.csproj
+++ b/Broadlink.WinApp/Broadlink.WinApp.csproj
@@ -68,6 +68,9 @@
+
+ MainForm.cs
+
MainForm.cs
diff --git a/Broadlink.WinApp/Forms/MainForm.Designer.cs b/Broadlink.WinApp/Forms/MainForm.Designer.cs
index 6473b96..4a9dd4a 100644
--- a/Broadlink.WinApp/Forms/MainForm.Designer.cs
+++ b/Broadlink.WinApp/Forms/MainForm.Designer.cs
@@ -54,7 +54,7 @@ private void InitializeComponent()
//
// toolStrip1
//
- this.toolStrip1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
+ resources.ApplyResources(this.toolStrip1, "toolStrip1");
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.btnLogClean,
this.toolStripSeparator2,
@@ -69,47 +69,37 @@ private void InitializeComponent()
this.btnKomutlariKaydet,
this.toolStripSeparator4,
this.btnIceAktar});
- this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
- this.toolStrip1.Size = new System.Drawing.Size(805, 25);
- this.toolStrip1.TabIndex = 1;
- this.toolStrip1.Text = "toolStrip1";
//
// btnLogClean
//
this.btnLogClean.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
- this.btnLogClean.Image = ((System.Drawing.Image)(resources.GetObject("btnLogClean.Image")));
- this.btnLogClean.ImageTransparentColor = System.Drawing.Color.Magenta;
+ resources.ApplyResources(this.btnLogClean, "btnLogClean");
this.btnLogClean.Name = "btnLogClean";
- this.btnLogClean.Size = new System.Drawing.Size(66, 22);
- this.btnLogClean.Text = "Log Temizle";
this.btnLogClean.Click += new System.EventHandler(this.btnLogClean_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
- this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
+ resources.ApplyResources(this.toolStripSeparator2, "toolStripSeparator2");
//
// cmbDevices
//
this.cmbDevices.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbDevices.Name = "cmbDevices";
- this.cmbDevices.Size = new System.Drawing.Size(121, 25);
+ resources.ApplyResources(this.cmbDevices, "cmbDevices");
//
// btnConnect
//
this.btnConnect.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
- this.btnConnect.Image = ((System.Drawing.Image)(resources.GetObject("btnConnect.Image")));
- this.btnConnect.ImageTransparentColor = System.Drawing.Color.Magenta;
+ resources.ApplyResources(this.btnConnect, "btnConnect");
this.btnConnect.Name = "btnConnect";
- this.btnConnect.Size = new System.Drawing.Size(68, 22);
- this.btnConnect.Text = "Tarama Yap";
this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
- this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);
+ resources.ApplyResources(this.toolStripSeparator3, "toolStripSeparator3");
//
// btnMenuOgren
//
@@ -118,89 +108,68 @@ private void InitializeComponent()
this.btnIR_Learn,
this.btnRF_Learn,
this.btnLearnCancel});
- this.btnMenuOgren.Enabled = false;
- this.btnMenuOgren.Image = ((System.Drawing.Image)(resources.GetObject("btnMenuOgren.Image")));
- this.btnMenuOgren.ImageTransparentColor = System.Drawing.Color.Magenta;
+ resources.ApplyResources(this.btnMenuOgren, "btnMenuOgren");
this.btnMenuOgren.Name = "btnMenuOgren";
- this.btnMenuOgren.Size = new System.Drawing.Size(106, 22);
- this.btnMenuOgren.Text = "Yeni Komut Öğren";
//
// btnIR_Learn
//
this.btnIR_Learn.Name = "btnIR_Learn";
- this.btnIR_Learn.Size = new System.Drawing.Size(172, 22);
- this.btnIR_Learn.Text = "Kızılötesi Öğren";
+ resources.ApplyResources(this.btnIR_Learn, "btnIR_Learn");
this.btnIR_Learn.Click += new System.EventHandler(this.btnIR_Learn_Click);
//
// btnRF_Learn
//
this.btnRF_Learn.Name = "btnRF_Learn";
- this.btnRF_Learn.Size = new System.Drawing.Size(172, 22);
- this.btnRF_Learn.Text = "RF Frekans Öğren";
+ resources.ApplyResources(this.btnRF_Learn, "btnRF_Learn");
this.btnRF_Learn.Click += new System.EventHandler(this.btnRF_Learn_Click);
//
// btnLearnCancel
//
this.btnLearnCancel.Name = "btnLearnCancel";
- this.btnLearnCancel.Size = new System.Drawing.Size(172, 22);
- this.btnLearnCancel.Text = "Öğrenme Modu İptal";
+ resources.ApplyResources(this.btnLearnCancel, "btnLearnCancel");
this.btnLearnCancel.Click += new System.EventHandler(this.btnLearnCancel_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
- this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
+ resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
//
// btnKomutGonder
//
this.btnKomutGonder.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
- this.btnKomutGonder.Enabled = false;
- this.btnKomutGonder.Image = ((System.Drawing.Image)(resources.GetObject("btnKomutGonder.Image")));
- this.btnKomutGonder.ImageTransparentColor = System.Drawing.Color.Magenta;
+ resources.ApplyResources(this.btnKomutGonder, "btnKomutGonder");
this.btnKomutGonder.Name = "btnKomutGonder";
- this.btnKomutGonder.Size = new System.Drawing.Size(79, 22);
- this.btnKomutGonder.Text = "Komut Gönder";
this.btnKomutGonder.Click += new System.EventHandler(this.btnKomutGonder_Click);
//
// cmbKomutListe
//
this.cmbKomutListe.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbKomutListe.DropDownWidth = 200;
- this.cmbKomutListe.Enabled = false;
+ resources.ApplyResources(this.cmbKomutListe, "cmbKomutListe");
this.cmbKomutListe.Name = "cmbKomutListe";
- this.cmbKomutListe.Size = new System.Drawing.Size(121, 25);
//
// txtIRCount
//
+ resources.ApplyResources(this.txtIRCount, "txtIRCount");
this.txtIRCount.Name = "txtIRCount";
- this.txtIRCount.Size = new System.Drawing.Size(20, 25);
- this.txtIRCount.Text = "1";
//
// btnKomutlariKaydet
//
this.btnKomutlariKaydet.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
- this.btnKomutlariKaydet.Enabled = false;
- this.btnKomutlariKaydet.Image = ((System.Drawing.Image)(resources.GetObject("btnKomutlariKaydet.Image")));
- this.btnKomutlariKaydet.ImageTransparentColor = System.Drawing.Color.Magenta;
+ resources.ApplyResources(this.btnKomutlariKaydet, "btnKomutlariKaydet");
this.btnKomutlariKaydet.Name = "btnKomutlariKaydet";
- this.btnKomutlariKaydet.Size = new System.Drawing.Size(45, 22);
- this.btnKomutlariKaydet.Text = "Kaydet";
this.btnKomutlariKaydet.Click += new System.EventHandler(this.btnKomutlariKaydet_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
- this.toolStripSeparator4.Size = new System.Drawing.Size(6, 25);
+ resources.ApplyResources(this.toolStripSeparator4, "toolStripSeparator4");
//
// btnIceAktar
//
this.btnIceAktar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
- this.btnIceAktar.Enabled = false;
- this.btnIceAktar.Image = ((System.Drawing.Image)(resources.GetObject("btnIceAktar.Image")));
- this.btnIceAktar.ImageTransparentColor = System.Drawing.Color.Magenta;
+ resources.ApplyResources(this.btnIceAktar, "btnIceAktar");
this.btnIceAktar.Name = "btnIceAktar";
- this.btnIceAktar.Size = new System.Drawing.Size(99, 22);
- this.btnIceAktar.Text = "eControl İçe Aktar";
this.btnIceAktar.Click += new System.EventHandler(this.btnIceAktar_Click);
//
// timerSicaklik
@@ -211,27 +180,18 @@ private void InitializeComponent()
// txtLog
//
this.txtLog.BackColor = System.Drawing.Color.Black;
- this.txtLog.Dock = System.Windows.Forms.DockStyle.Fill;
- this.txtLog.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
+ resources.ApplyResources(this.txtLog, "txtLog");
this.txtLog.ForeColor = System.Drawing.Color.White;
- this.txtLog.Location = new System.Drawing.Point(0, 25);
this.txtLog.Name = "txtLog";
- this.txtLog.Size = new System.Drawing.Size(805, 359);
- this.txtLog.TabIndex = 2;
- this.txtLog.Text = "";
//
// MainForm
//
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(805, 384);
this.Controls.Add(this.txtLog);
this.Controls.Add(this.toolStrip1);
- this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
this.Name = "MainForm";
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Tag = "Broadlink .NET | Oda sıcaklığı : {0}°C";
- this.Text = "Broadlink .NET | Developed By K3M41";
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.ResumeLayout(false);
diff --git a/Broadlink.WinApp/Forms/MainForm.cs b/Broadlink.WinApp/Forms/MainForm.cs
index 89a6f88..d458c77 100644
--- a/Broadlink.WinApp/Forms/MainForm.cs
+++ b/Broadlink.WinApp/Forms/MainForm.cs
@@ -5,6 +5,7 @@
using System.Drawing;
using System.IO;
using System.Linq;
+using System.Resources;
using System.Windows.Forms;
namespace Broadlink.WinApp.Forms
@@ -12,6 +13,7 @@ namespace Broadlink.WinApp.Forms
public partial class MainForm : Form
{
#region Fields
+ private ResourceManager _resourceManager;
private RMDevice RMDevice;
private List Commands;
private Client DiscoverClient;
@@ -21,6 +23,9 @@ public partial class MainForm : Form
public MainForm()
{
InitializeComponent();
+
+ _resourceManager = new ResourceManager("Broadlink.WinApp.Forms.MainForm", typeof(MainForm).Assembly);
+
Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
HelperMy.NotificationEvent += HelperMy_NotificationEvent;
}
@@ -59,13 +64,13 @@ private async void btnConnect_Click(object senderBtn, EventArgs eBtn)
DiscoverClient = new Client();
DiscoverClient.DeviceHandler += Client_DeviceHandler;
}
- HelperMy.Notification(Color.Gray, "Cihazlar aranıyor...");
+ HelperMy.Notification(Color.Gray, _resourceManager.GetString("TXT_INFO_SEARCHING"));
await DiscoverClient.DiscoverAsync();
- btnConnect.Text = "Tarama Yap";
+ btnConnect.Text = _resourceManager.GetString("BTN_Connect_TEXT");
}
else if (cmbDevices.SelectedItem is RMDevice secim)
{
- HelperMy.Notification(Color.Gray, "Bağlantı kuruluyor...");
+ HelperMy.Notification(Color.Gray, _resourceManager.GetString("TXT_INFO_ESTABLISHING_CONNECTION"));
RMDevice = secim as RMDevice;
if (!RMDevice.IsEventsReady)
{
@@ -80,10 +85,10 @@ private async void btnConnect_Click(object senderBtn, EventArgs eBtn)
await RMDevice.AuthorizeAsync();
KomutYukle();
btnMenuOgren.Enabled = cmbKomutListe.Enabled = btnIR_Learn.Enabled = btnRF_Learn.Enabled = btnLearnCancel.Enabled = btnKomutGonder.Enabled = btnKomutlariKaydet.Enabled = btnIceAktar.Enabled = true;
- btnConnect.Text = "Bağlanıldı";
+ btnConnect.Text = _resourceManager.GetString("BTN_Connect__CONNECTED_TEXT");
}
else
- HelperMy.Notification(Color.Red, "Yazılıma uyumlu cihaz tespit edilemedi!");
+ HelperMy.Notification(Color.Red, _resourceManager.GetString("TXT_ERROR_NO_COMPATIBLE_DEVICES"));
btnConnect.Enabled = true;
}
@@ -92,23 +97,23 @@ private async void btnIR_Learn_Click(object sender, EventArgs e)
if (RMDevice == null) return;
btnIR_Learn.Enabled = false;
await RMDevice.EnterIRLearningModeAsync();
- HelperMy.Notification(Color.RoyalBlue, "IR Kızılötesi Öğrenme modu etkinleştirildi.");
+ HelperMy.Notification(Color.RoyalBlue, _resourceManager.GetString("TXT_INFO_IRLEARNING_MODE_ACTIVE"));
}
private async void btnRF_Learn_Click(object sender, EventArgs e)
{
if (RMDevice == null) return;
btnRF_Learn.Enabled = false;
await RMDevice.EnterRFLearningModeAsync();
- HelperMy.Notification(Color.RoyalBlue, "RF Frekans Öğrenme modu etkinleştirildi.");
- HelperMy.Notification(Color.Yellow, "RF Frekans Tarama [1/2]");
- HelperMy.Notification(Color.Yellow, "[Düğmeye basılı tutunuz!]");
+ HelperMy.Notification(Color.RoyalBlue, _resourceManager.GetString("TXT_INFO_RFLEARNING_MODE_ACTIVE"));
+ HelperMy.Notification(Color.Yellow, _resourceManager.GetString("TXT_INFO_RF_FREQ_SCAN_1of2"));
+ HelperMy.Notification(Color.Yellow, _resourceManager.GetString("TXT_INFO_KEEP_BUTTON_PRESSED"));
}
private async void btnLearnCancel_Click(object sender, EventArgs e)
{
if (RMDevice == null) return;
btnIR_Learn.Enabled = btnRF_Learn.Enabled = true;
await RMDevice.ExitLearningModeAsync();
- HelperMy.Notification(Color.RoyalBlue, "Öğrenme modundan çıkıldı.");
+ HelperMy.Notification(Color.RoyalBlue, _resourceManager.GetString("TXT_INFO_LEARNING_MODE_EXITED"));
}
private async void btnKomutGonder_Click(object sender, EventArgs e)
{
@@ -118,18 +123,18 @@ private async void btnKomutGonder_Click(object sender, EventArgs e)
if (txtIRCount.Text.IsNumeric() && txtIRCount.Text != "1")
command[1] = (byte)(Convert.ToByte(txtIRCount.Text) - 1);
await RMDevice.SendRemoteCommandAsync(command);
- HelperMy.Notification(Color.White, "Komut gönderildi : {0}", selected);
+ HelperMy.Notification(Color.White, _resourceManager.GetString("TXT_INFO_COMMAND_SENT_COUNT"), selected);
}
private void btnKomutlariKaydet_Click(object sender, EventArgs e) => File.WriteAllText(CommandFilePath, Commands.ToJson(), new System.Text.UTF8Encoding(false));
private async void timerSicaklik_Tick(object sender, EventArgs e) => await RMDevice?.GetTemperatureAsync();
private void btnIceAktar_Click(object sender, EventArgs e)
{
- HelperMy.Notification(Color.RoyalBlue, "Broadlink eControl uygulamasındaki verileri içe aktarma");
- HelperMy.Notification(Color.White, "1) Uygulamadaki menüden 'Paylaş' butonuna tıklayınız.");
- HelperMy.Notification(Color.White, "2) 'Ağdaki başka bir telefon ile paylaşın' butonuna tıklayınız.");
- HelperMy.Notification(Color.White, "3) 'İptal' butonuna tıklayınız.");
- HelperMy.Notification(Color.White, "4) Telefon hafızasında bulunan aşağıdaki dosyaları bilgisayarınıza kopyalayınız.");
- HelperMy.Notification(Color.White, "\tKlasör : /broadlink/newremote/SharedData");
+ HelperMy.Notification(Color.RoyalBlue, _resourceManager.GetString("TXT_IMPORT_DATA"));
+ HelperMy.Notification(Color.White, _resourceManager.GetString("TXT_IMPORT_DATA_STEP_1"));
+ HelperMy.Notification(Color.White, _resourceManager.GetString("TXT_IMPORT_DATA_STEP_2"));
+ HelperMy.Notification(Color.White, _resourceManager.GetString("TXT_IMPORT_DATA_STEP_3"));
+ HelperMy.Notification(Color.White, _resourceManager.GetString("TXT_IMPORT_DATA_STEP_4"));
+ HelperMy.Notification(Color.White, _resourceManager.GetString("TXT_IMPORT_DATA_STEP_5"));
HelperMy.Notification(Color.White, "\t* jsonDevice");
HelperMy.Notification(Color.White, "\t* jsonButton");
HelperMy.Notification(Color.White, "\t* jsonIrCode");
@@ -137,7 +142,7 @@ private void btnIceAktar_Click(object sender, EventArgs e)
var model = NET.SharedData.CodeInfo.GetSharedData();
if (model == null || model.Length == 0)
{
- HelperMy.Notification(Color.Red, "Veri bulunamadı!");
+ HelperMy.Notification(Color.Red, _resourceManager.GetString("TXT_ERR_NO_DATA_FOUND"));
return;
}
if (Commands == null)
@@ -167,11 +172,11 @@ private void Client_DeviceHandler(object sender, BroadlinkDevice device)
{
if (!cmbDevices.Items.Cast