Exemple #1
0
        private void batchActionRenameType_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog folderDialog = new FolderBrowserDialog();

            folderDialog.ShowNewFolderButton = false;
            folderDialog.SelectedPath        = Path.GetFullPath(DualityApp.DataDirectory);
            folderDialog.Description         = "Select a folder to process..";
            if (folderDialog.ShowDialog(this) == DialogResult.OK)
            {
                RenameTypeDialog dialog = new RenameTypeDialog(this.GetAvailTypes());
                if (dialog.ShowDialog(this) == DialogResult.OK)
                {
                    int replaced = 0;
                    ProcessingBigTaskDialog taskDialog = new ProcessingBigTaskDialog(
                        PluginRes.ResourceHackerRes.TaskBatchRenameType_Caption,
                        string.Format(PluginRes.ResourceHackerRes.TaskBatchRenameType_Desc, dialog.SearchFor, dialog.ReplaceWith),
                        this.async_PerformBatchAction,
                        new BatchActionTaskData(folderDialog.SelectedPath, n => replaced += n.ReplaceTypeStrings(dialog.SearchFor, dialog.ReplaceWith)));
                    taskDialog.MainThreadRequired = false;
                    taskDialog.ShowDialog();

                    MessageBox.Show(
                        string.Format(PluginRes.ResourceHackerRes.MessageBox_RenameType_Text, replaced, dialog.SearchFor, dialog.ReplaceWith),
                        PluginRes.ResourceHackerRes.MessageBox_RenameType_Title,
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Information);
                }
            }
        }
Exemple #2
0
        private void actionRenameType_Click(object sender, EventArgs e)
        {
            RenameTypeDialog dialog = new RenameTypeDialog(this.GetAvailTypes());

            if (dialog.ShowDialog(this) == DialogResult.OK)
            {
                int replaced = 0;
                this.CurrentPerformAction(n => replaced += n.ReplaceTypeStrings(dialog.SearchFor, dialog.ReplaceWith));
                MessageBox.Show(
                    string.Format(PluginRes.ResourceHackerRes.MessageBox_RenameType_Text, replaced, dialog.SearchFor, dialog.ReplaceWith),
                    PluginRes.ResourceHackerRes.MessageBox_RenameType_Title,
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information);
            }
        }
Exemple #3
0
		private void batchActionRenameType_Click(object sender, EventArgs e)
		{
			FolderBrowserDialog folderDialog = new FolderBrowserDialog();
			folderDialog.ShowNewFolderButton = false;
			folderDialog.SelectedPath = Path.GetFullPath(DualityApp.DataDirectory);
			folderDialog.Description = "Select a folder to process..";
			if (folderDialog.ShowDialog(this) == DialogResult.OK)
			{
				RenameTypeDialog dialog = new RenameTypeDialog(this.GetAvailTypes());
				if (dialog.ShowDialog(this) == DialogResult.OK)
				{
					int replaced = 0;
					ProcessingBigTaskDialog taskDialog = new ProcessingBigTaskDialog(
						PluginRes.ResourceHackerRes.TaskBatchRenameType_Caption,
						string.Format(PluginRes.ResourceHackerRes.TaskBatchRenameType_Desc, dialog.SearchFor, dialog.ReplaceWith), 
						this.async_PerformBatchAction,
						new BatchActionTaskData(folderDialog.SelectedPath, n => replaced += n.ReplaceTypeStrings(dialog.SearchFor, dialog.ReplaceWith)));
					taskDialog.MainThreadRequired = false;
					taskDialog.ShowDialog();

					MessageBox.Show(
						string.Format(PluginRes.ResourceHackerRes.MessageBox_RenameType_Text, replaced, dialog.SearchFor, dialog.ReplaceWith), 
						PluginRes.ResourceHackerRes.MessageBox_RenameType_Title, 
						MessageBoxButtons.OK, 
						MessageBoxIcon.Information);
				}
			}
		}
Exemple #4
0
		private void actionRenameType_Click(object sender, EventArgs e)
		{
			RenameTypeDialog dialog = new RenameTypeDialog(this.GetAvailTypes());
			if (dialog.ShowDialog(this) == DialogResult.OK)
			{
				int replaced = 0;
				this.CurrentPerformAction(n => replaced += n.ReplaceTypeStrings(dialog.SearchFor, dialog.ReplaceWith));
				MessageBox.Show(
					string.Format(PluginRes.ResourceHackerRes.MessageBox_RenameType_Text, replaced, dialog.SearchFor, dialog.ReplaceWith), 
					PluginRes.ResourceHackerRes.MessageBox_RenameType_Title, 
					MessageBoxButtons.OK, 
					MessageBoxIcon.Information);
			}
		}