Exemplo n.º 1
0
 public Shell(Messages messages, string basePath)
 {
     _messages = messages;
     _basePath = basePath;
     _syncCtx = SynchronizationContext.Current;
 }
Exemplo n.º 2
0
        public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            _dte = (DTE)automationObject;
            _messages = new Messages(_dte);
            _messages.WriteLine("Creating zetbox project");

            _wrongProjectFolder = replacementsDictionary["$destinationdirectory$"];
            _solutionFolder = Path.GetDirectoryName(_wrongProjectFolder);
            _templatePath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName((string)customParams[0]), ".."));
            _solutionName = replacementsDictionary["$safeprojectname$"];
            replacementsDictionary.Add("$safesolutionname$", _solutionName);

            _shell = new Shell(_messages, _solutionFolder);

            var dlg = new WizardForm(_solutionName);
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                replacementsDictionary.Add("$connectionstring$", dlg.ConnectinString);
                replacementsDictionary.Add("$databasename$", dlg.DatabaseName);
                replacementsDictionary.Add("$databaseuser$", dlg.DatabaseUser);
                replacementsDictionary.Add("$ormapperclassname$", dlg.ORMapperClassName);
                replacementsDictionary.Add("$ormappermodule$", dlg.ORMapperModule);
                replacementsDictionary.Add("$schema$", dlg.Schema);
                replacementsDictionary.Add("$provider$", dlg.Provider);

                replacementsDictionary.Add("$modulename$", dlg.ModuleName);
                replacementsDictionary.Add("$description$", dlg.Description);
                replacementsDictionary.Add("$namespace$", dlg.Namespace);
                replacementsDictionary.Add("$schemaName$", dlg.SchemaName);

                replacementsDictionary.Add("$moduleguid$", System.Xml.XmlConvert.ToString(Guid.NewGuid()));
                replacementsDictionary.Add("$modulexmldatetime$", System.Xml.XmlConvert.ToString(DateTime.Now, System.Xml.XmlDateTimeSerializationMode.Utc));
            }
            else
            {
                _messages.WriteLine("Aborted by user");
                throw new WizardCancelledException("Aborted by user");
            }

            _replacementsDictionary = replacementsDictionary;
        }