// create new culture private void ProcessNewCulture(object selectedCulture) { ResXOperator fo = new ResXOperator(patterns, new ResXOperationSettings { OperationMode = ResXOperationModes.GetAvailableCultures }, this.PrintStatus); fo.ProcessDirectory(label1.Text); fo.ChangeOperationSettings( new ResXOperationSettings { OperationMode = ResXOperationModes.CreateNewCulture, SelectedCulture = selectedCulture.ToString() }); fo.ProcessDirectory(label1.Text); EndProcessing(ResXOperationModes.CreateNewCulture, selectedCulture.ToString()); }
// get available cultures from resx private void ProcessAvailableCultures() { bool flag = false; if (this.InvokeRequired) { bool res = false; var action = new Action <Form1>(c => res = c.falseTabEnter); this.Invoke(action, this); flag = res; } flag = this.falseTabEnter; if (flag) { return; } ResXOperator fo = new ResXOperator(patterns, new ResXOperationSettings { OperationMode = ResXOperationModes.GetAvailableCultures }, this.PrintStatus); fo.ProcessDirectory(label1.Text); foreach (var item in fo.AvailableCultures) { if (!comboBox1.Items.Contains(item)) { var itemtoadd = new KeyValuePair <string, string>(item.Key, item.Value); comboBox1.Items.Add(itemtoadd); if (item.Key.ToLower().Equals("default")) { comboBox1.SelectedItem = itemtoadd; } } } if (this.InvokeRequired) { this.Invoke(new Action <Form1>(c => c.falseTabEnter = true)); } else { this.falseTabEnter = true; } EndProcessing(ResXOperationModes.GetAvailableCultures); }
// synchronize resx private void ProcessSync() { ResXOperator fo = new ResXOperator(patterns, new ResXOperationSettings { OperationMode = ResXOperationModes.Synchronize, Backup = checkBox1.Checked, AddOnly = checkBox2.Checked }, this.PrintStatus); fo.ProcessDirectory(label1.Text); EndProcessing(ResXOperationModes.Synchronize); }
// create package for selected culture private void ProcessPackage(object selectedCulture) { ResXOperator fo = new ResXOperator(patterns, new ResXOperationSettings { OperationMode = ResXOperationModes.CreatePackage, SelectedCulture = selectedCulture.ToString() }, this.PrintStatus); fo.ProcessDirectory(label1.Text); zippedPackage = Zipper.ZipFolder(fo.ResXFiles); EndProcessing(ResXOperationModes.CreatePackage, selectedCulture.ToString()); }
// get available cultures from resx private void ProcessAvailableCultures() { bool flag = false; if (this.InvokeRequired) { bool res = false; var action = new Action<Form1>(c => res = c.falseTabEnter); this.Invoke(action, this); flag = res; } flag = this.falseTabEnter; if(flag) { return; } ResXOperator fo = new ResXOperator(patterns, new ResXOperationSettings { OperationMode = ResXOperationModes.GetAvailableCultures }, this.PrintStatus); fo.ProcessDirectory(label1.Text); foreach (var item in fo.AvailableCultures) { if (!comboBox1.Items.Contains(item)) { var itemtoadd = new KeyValuePair<string, string>(item.Key, item.Value); comboBox1.Items.Add(itemtoadd); if (item.Key.ToLower().Equals("default")) { comboBox1.SelectedItem = itemtoadd; } } } if (this.InvokeRequired) { this.Invoke(new Action<Form1>(c => c.falseTabEnter = true)); } else { this.falseTabEnter = true; } EndProcessing(ResXOperationModes.GetAvailableCultures); }