Пример #1
0
        string GetMessageVersion(ConverterMessages msg)   //8.1 tt
        {
            switch (msg)
            {
            case ConverterMessages.ExactConversion:
                return(currentProjectVersion.ToString());

            case ConverterMessages.LastMinor:
                if (currentInstalledMajor == null)
                {
                    return(LastMinorOfCurrentMajor.ToString());
                }
                return(currentInstalledMajor.ToString());

            case ConverterMessages.MainMajorLastVersion:
                return(mainMajorLastVersion.ToString());

            default:
                return(null);
            }
        }
Пример #2
0
        private void PrintConverterMessage(ConverterMessages msg, string key)  //8tt
        {
            if (msg == ConverterMessages.OpenSolution)
            {
                MyMessageProcessor.ConsoleWrite("To open solution press: ");
                MyMessageProcessor.ConsoleWrite(key, ConsoleColor.Red);
                MyMessageProcessor.ConsoleWriteLine();
                return;
            }
            if (msg == ConverterMessages.OpenFolder)
            {
                MyMessageProcessor.ConsoleWrite("To open folder press: ");
                MyMessageProcessor.ConsoleWrite("9", ConsoleColor.Red);
                MyMessageProcessor.ConsoleWriteLine();
                return;
            }
            string vers = GetMessageVersion(msg);

            MyMessageProcessor.ConsoleWrite("To convert to : ");
            MyMessageProcessor.ConsoleWrite(vers, ConsoleColor.Red);
            MyMessageProcessor.ConsoleWrite(" press ");
            MyMessageProcessor.ConsoleWrite(key, ConsoleColor.Red);
            MyMessageProcessor.ConsoleWriteLine();
        }
Пример #3
0
        private void ProcessProject(ConverterMessages message)  //12
        {
            if (message == ConverterMessages.OpenFolder)
            {
                OpenFolder();
                return;
            }
            CopyBatchFiles();
            if (isXafSolution)
            {
                MakeApplicationProjectFirst();
                CorrectConnectionStringsInConfigFiles();
            }

            csProjProcessor.DisableUseVSHostingProcess();
            csProjProcessor.AddImagesLibraries();
            csProjProcessor.CorrectFrameworkVersionIfNeeded();
            if (isExample)
            {
                if (isMainMajor)
                {
                    csProjProcessor.SetSpecificVersionFalseAndRemoveHintPath();
                    csProjProcessor.SaveNewCsProj();
                }
                else
                {
                    csProjProcessor.SaveNewCsProj();
                    ConvertProjectWithDxConverter(mainMajorLastVersion);
                }
            }
            else                                                           //check how to avoid csProjProcessor.SaveNewCsProj();
            {
                if (!(currentProjectVersion.CompareTo(Version.Zero) == 0)) //there are dx libs
                {
                    csProjProcessor.RemoveLicense();
                    switch (message)
                    {
                    case ConverterMessages.MainMajorLastVersion:
                        if (isMainMajor && !hasWebProject)
                        {
                            csProjProcessor.SetSpecificVersionFalseAndRemoveHintPath();
                            csProjProcessor.SaveNewCsProj();
                        }
                        else
                        {
                            csProjProcessor.SaveNewCsProj();
                            ConvertProjectWithDxConverter(mainMajorLastVersion);
                        }
                        break;

                    case ConverterMessages.LastMinor:
                        if (isCurrentVersionMajorInstalled)
                        {
                            if (!hasWebProject)
                            {
                                csProjProcessor.SetSpecificVersionFalseAndRemoveHintPath();
                                csProjProcessor.SaveNewCsProj();
                            }
                            else
                            {
                                csProjProcessor.SaveNewCsProj();
                                ConvertProjectWithDxConverter(currentInstalledMajor);
                            }
                        }
                        else
                        {
                            csProjProcessor.SaveNewCsProj();

                            if (GetIfLibrariesPersist())
                            {
                                break;
                            }
                            ConvertProjectWithDxConverter(LastMinorOfCurrentMajor);
                        }
                        break;

                    case ConverterMessages.ExactConversion:
                        csProjProcessor.SaveNewCsProj();

                        if (GetIfLibrariesPersist())
                        {
                            break;
                        }
                        ConvertProjectWithDxConverter(currentProjectVersion);
                        break;

                    default:
                        csProjProcessor.SetSpecificVersionFalseAndRemoveHintPath();
                        csProjProcessor.SaveNewCsProj();
                        break;
                    }
                }
                else
                {
                    csProjProcessor.SaveNewCsProj();
                }
            }

            OpenSolution();
        }