Ejemplo n.º 1
0
        private void ConvertProject(NetVertVsProject project)
        {
            string TmpLang;
            string TmpSrc;
            string TmpTar;

            TmpSrc = project.VSProject.FullName;
            switch (project.Language)
            {
            case "VB":
                TmpLang = "VB.NET -> C#";

            case "CS":
                TmpLang = "C# -> VB.NET";

            default:
                TmpLang = "(UNSUPPORTED)";
            }
            FOutputPane.OutputString("------ Convert started: Project: " + project.VSProject.Name + ", Language: " + TmpLang + " ------" + vbCrLf);
            FOutputPane.OutputString("Output Folder: " + project.GetDestinationPath + vbCrLf);
            Application.DoEvents();
            switch (project.Language)
            {
            case "VB":
                TmpTar = Path.Combine(project.GetDestinationPath, Path.ChangeExtension(new FileInfo(TmpSrc).Name, "." + FConverterVBCS.OutputFileExtension));
                FConverterVBCS.ConvertProject(TmpSrc, TmpTar, true, project.FixNamespaceImport);

            case "CS":
                TmpTar = Path.Combine(project.GetDestinationPath, Path.ChangeExtension(new FileInfo(TmpSrc).Name, "." + FConverterCSVB.OutputFileExtension));
                FConverterCSVB.ConvertProject(TmpSrc, TmpTar, true, project.FixNamespaceImport);
            }
            FOutputPane.OutputString(vbCrLf);
        }
Ejemplo n.º 2
0
        private List <NetVertVsProject> GetEnabledProjects()
        {
            NetVertVsProject        TmpP;
            List <NetVertVsProject> RetLst = new List <NetVertVsProject>();

            if (_applicationObject.Solution.IsOpen)
            {
                foreach (Project proj in _applicationObject.Solution.Projects)
                {
                    TmpP = new NetVertVsProject(proj);
                    if (TmpP.Enabled)
                    {
                        RetLst.Add(TmpP);
                    }
                }
            }
            return(RetLst);
        }
Ejemplo n.º 3
0
        //PRIVATE
        private void OpenProject(NetVertVsProject proj)
        {
            FCurrentProject = proj;
            FDoEvents       = false;
            //Enabled
            ChkEnabled.Checked = FCurrentProject.Enabled;
            //Path
            TxtPath.Text = FCurrentProject.Path;
            //Fix Namespace
            ChkFixNs.Checked = FCurrentProject.FixNamespaceImport;
            //Execute
            CmbExecute.SelectedIndex = FCurrentProject.ExecuteMethod;
            //Lang
            switch (FCurrentProject.Language)
            {
            case "VB":
                TxtLang.Text = "Visual Basic .NET -> C#";

            case "CS":
                TxtLang.Text = "C# -> Visual Basic .NET";
            }
            FDoEvents = true;
        }
Ejemplo n.º 4
0
        //PUBLIC
        public void InitDTE(EnvDTE80.DTE2 dte)
        {
            NetVertVsProject TmpP;

            FEnvDte = dte;
            if ((!dte.Solution == null) && dte.Solution.IsOpen)
            {
                foreach (EnvDTE.Project proj in dte.Solution.Projects)
                {
                    TmpP = new NetVertVsProject(proj);
                    if (TmpP.Language != "")
                    {
                        CmbProject.Items.Add(proj.Name);
                        FProjects.Add(TmpP);
                    }
                }
                if (FProjects.Count > 0)
                {
                    CmbProject.SelectedIndex = 0;
                    ChkEnabled.Enabled       = true;
                }
            }
        }