AddFile() public méthode

public AddFile ( string file ) : void
file string
Résultat void
Exemple #1
0
        private bool ProcessWsdlWizardRequest(bool roundtrip)
        {
            if (!ValidateItemAndProject())
            {
                return(false);
            }

            string currentDir     = selectedItem.Directory;
            string projectRootDir = selectedItem.ParentProject.ProjectDirectory;
            string metdataFile    = selectedItem.FileName;

            WsdlWizardForm wizard = null;

            try
            {
                wizard = (roundtrip) ? new WsdlWizardForm(metdataFile, true) : new WsdlWizardForm(metdataFile);

                wizard.WsdlLocation          = currentDir;
                wizard.DefaultPathForImports = "";
                wizard.ProjectRootDirectory  = projectRootDir;
                wizard.ShowDialog();

                if (wizard.DialogResult == DialogResult.OK)
                {
                    if (wizard.WsdlLocation.Length > 0)
                    {
                        string wsdlFile = wizard.WsdlLocation;

                        if (!roundtrip)
                        {
                            currentProject.AddFile(wsdlFile);
                        }

                        if (wizard.OpenCodeGenDialog)
                        {
                            ProcessCodeGenerationRequest(wsdlFile);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message,
                                "WSDL Wizard", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                if (wizard != null)
                {
                    wizard.Close();
                }
                return(false);
            }

            return(true);
        }
Exemple #2
0
        private void AddFileToCurrentProject(string file)
        {
            VisualStudioProject project = this.VisualStudio.SelectedProject;

            project.AddFile(file);
        }