Exemple #1
0
        void IWizard.RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            DTE dte = (DTE)automationObject;

            string deploymentFolder = String.Empty;

            string destinationDirectory = replacementsDictionary["$destinationdirectory$"];

            if (destinationDirectory.EndsWith("\\", StringComparison.Ordinal) == false)
            {
                destinationDirectory = destinationDirectory + "\\";
            }

            string parentFolder = Path.GetDirectoryName(destinationDirectory);

            DeploymentWizardForm wizardForm = new DeploymentWizardForm(parentFolder);

            if (wizardForm.ShowDialog(new WindowOwner((IntPtr)dte.MainWindow.HWnd)) == DialogResult.OK)
            {
                Uri destinationUri = new Uri(destinationDirectory);
                Uri deploymentUri  = new Uri(wizardForm.DeploymentFolder);

                Uri relativeUri = destinationUri.MakeRelativeUri(deploymentUri);

                deploymentFolder = relativeUri.ToString().Replace("/", "\\");
            }

            replacementsDictionary["$deploymentpath$"] = deploymentFolder;
        }
Exemple #2
0
        void IWizard.RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            DTE dte = (DTE)automationObject;

            string deploymentFolder = String.Empty;

            string destinationDirectory = replacementsDictionary["$destinationdirectory$"];
            if (destinationDirectory.EndsWith("\\", StringComparison.Ordinal) == false) {
                destinationDirectory = destinationDirectory + "\\";
            }

            string parentFolder = Path.GetDirectoryName(destinationDirectory);

            DeploymentWizardForm wizardForm = new DeploymentWizardForm(parentFolder);
            if (wizardForm.ShowDialog(new WindowOwner((IntPtr)dte.MainWindow.HWnd)) == DialogResult.OK) {
                Uri destinationUri = new Uri(destinationDirectory);
                Uri deploymentUri = new Uri(wizardForm.DeploymentFolder);

                Uri relativeUri = destinationUri.MakeRelativeUri(deploymentUri);

                deploymentFolder = relativeUri.ToString().Replace("/", "\\");
            }

            replacementsDictionary["$deploymentpath$"] = deploymentFolder;
        }