AddAliasReplacement() публичный Метод

public AddAliasReplacement ( string original, string replacement ) : void
original string
replacement string
Результат void
Пример #1
0
        private void makeFineVersionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TreeNode selectedNode     = treeView.SelectedNode;
            FileData selectedFileData = ModuleDataManager.GetInstance().GetSelectedFileData(treeView.SelectedNode);

            if (!CanAddFineVersion(selectedFileData))
            {
                return;
            }

            JsonFileData          jsonFileData = selectedFileData as JsonFileData;
            ModuleFile            moduleFile   = jsonFileData.GetModuleFile();
            CloneObjectParameters parameters   = new CloneObjectParameters();

            parameters.AddStringReplacement(moduleFile.ShortName, moduleFile.ShortName + "_fine");
            parameters.AddAliasReplacement(moduleFile.ShortName + "_fine", moduleFile.ShortName + ":fine");
            HashSet <string>          dependencies = ModuleDataManager.GetInstance().PreviewCloneDependencies(selectedFileData, parameters);
            PreviewCloneAliasCallback callback     = new PreviewCloneAliasCallback(this, selectedFileData, parameters);
            PreviewCloneDialog        dialog       = new PreviewCloneDialog("Creating " + moduleFile.ShortName + ":fine", dependencies, callback);

            dialog.ShowDialog();
        }
        private void makeFineVersionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TreeNode selectedNode = treeView.SelectedNode;
            FileData selectedFileData = ModuleDataManager.GetInstance().GetSelectedFileData(treeView.SelectedNode);
            if (!CanAddFineVersion(selectedFileData))
            {
                return;
            }

            JsonFileData jsonFileData = selectedFileData as JsonFileData;
            ModuleFile moduleFile = jsonFileData.GetModuleFile();
            CloneObjectParameters parameters = new CloneObjectParameters();
            parameters.AddStringReplacement(moduleFile.ShortName, moduleFile.ShortName + "_fine");
            parameters.AddAliasReplacement(moduleFile.ShortName + "_fine", moduleFile.ShortName + ":fine");
            HashSet<string> dependencies = ModuleDataManager.GetInstance().PreviewCloneDependencies(selectedFileData, parameters);
            PreviewCloneAliasCallback callback = new PreviewCloneAliasCallback(this, selectedFileData, parameters);
            PreviewCloneDialog dialog = new PreviewCloneDialog("Creating " + moduleFile.ShortName + ":fine", dependencies, callback);
            dialog.ShowDialog();
        }