예제 #1
0
        public void StartInterface()
        {
            const int menuSpacing = 20;
            bool      inMenu      = true;
            char      keyPressed;

            while (inMenu)
            {
                _c.Lines(2);
                _c.HorizontalRule();
                Console.WriteLine(@"**  MENU:(press a character to select an option)  **");
                _c.HorizontalRule();
                WriteLoadedFileList();
                Console.WriteLine(@"Q. [QUIT]" + _c.GetAlignmentSpacing(4, menuSpacing) + @"Quit.");
                Console.WriteLine(@"L. [LOAD]" + _c.GetAlignmentSpacing(4, menuSpacing) + @"Load an additional xml file for comparison.");
                Console.WriteLine(@"D. [DISPLAY]" + _c.GetAlignmentSpacing(7, menuSpacing) +
                                  @"Display overview or full contents of a loaded file.");
                Console.WriteLine(@"C. [COMPARE]" + _c.GetAlignmentSpacing(7, menuSpacing) + @"Compare all files loaded to the buffer.");
                Console.WriteLine(@"R. [RESOLVE]" + _c.GetAlignmentSpacing(7, 20) + @"Resolve conflicted templates.");
                Console.WriteLine(@"W. [WRITE]" + _c.GetAlignmentSpacing(5, menuSpacing) + @"Write the final output file.");
                _c.HorizontalRule();
                _c.Lines(2);
                Console.Write(@"Your choice is: ");
                keyPressed = Console.ReadKey().KeyChar;
                _c.Line();
                switch (keyPressed)
                {
                case 'Q':
                case 'q':
                    inMenu = false;
                    break;

                case 'L':
                case 'l':
                    LoadXmlFile();
                    break;

                case 'D':
                case 'd':
                    DisplayXmlFileContents();
                    break;

                case 'c':
                case 'C':
                    CompareXmlFilesInBuffer();
                    break;

                case 'r':
                case 'R':
                    ResolveTemplateConflicts();
                    break;

                case 'w':
                case 'W':
                    WriteFile();
                    break;
                }
            }
        }
예제 #2
0
        public void Resolve()
        {
            _c.Lines(2);
            _c.HorizontalRule();
            Console.WriteLine(@"** LOCATION CONFLICT (Select a location) **");
            Console.WriteLine(Description);
            _c.Line();
            int count            = 1;
            int selectedTemplate = -1;

            foreach (CodeTemplate template in ConflictedTemplates)
            {
                Console.WriteLine(count + @". " + template.Description + @" from " + template.ParentGuid + @"-" + template.Id);
                Console.WriteLine(@"	Location: "+ template.Category);
                count++;
            }
            Console.Write(@"Your choice is: ");
            selectedTemplate = Int32.Parse(Console.ReadKey().KeyChar.ToString());
            while (selectedTemplate - 1 < 0 || selectedTemplate - 1 >= ConflictedTemplates.Count)
            {
                Console.WriteLine(@"Invalid Selection. Choose a template from the list above.");
                selectedTemplate = Int32.Parse(Console.ReadKey().KeyChar.ToString());
            }
            ResolutionTemplate = ConflictedTemplates.ElementAt(selectedTemplate - 1);
        }
 public void Resolve()
 {
     ResolutionTemplate = ConflictedTemplates.First();
     _c.Lines(2);
     _c.HorizontalRule();
     Console.WriteLine(@"** DUPLICATE CODE CONFLICT (Autoresolved) **");
     Console.WriteLine(ResolutionTemplate.Description);
 }
예제 #4
0
        public void Resolve()
        {
            //bool finished = false;
            //while (finished == false)
            //{
            _c.Lines(2);
            _c.HorizontalRule();
            Console.WriteLine(@"** RESOLVE ACCESS CONFLICT (press a key to select an option) **");
            Console.WriteLine(Description);
            _c.Line();
            int count            = 1;
            int selectedTemplate = -1;

            foreach (CodeTemplate template in ConflictedTemplates)
            {
                Console.WriteLine(count + @". " + template.Description + @" from " + template.ParentGuid + @"-" + template.Id);
                Console.WriteLine(@"	Expansion Keyword : "+ template.ExpansionKeyword);
                Console.WriteLine(@"	Command Name      : "+ template.CommandName);

                count++;
            }
            Console.Write(@"Your choice is: ");
            selectedTemplate = Int32.Parse(Console.ReadKey().KeyChar.ToString());
            while (selectedTemplate - 1 < 0 || selectedTemplate - 1 >= ConflictedTemplates.Count)
            {
                Console.WriteLine(@"Invalid Selection. Choose a template from the list above.");
                selectedTemplate = Int32.Parse(Console.ReadKey().KeyChar.ToString());
            }
            ResolutionTemplate = ConflictedTemplates.ElementAt(selectedTemplate - 1);


            //Console.WriteLine(@"A. [ALL]" + _c.GetAlignmentSpacing(3,20) + @"Display all conflict templates current access settings");
            //Console.WriteLine(@"S. [SELECT]" + _c.GetAlignmentSpacing(6,20) + @"Select which template will resolve this conflict");
            //char keyPressed;
            //Console.Write(@"Your choice is: ");
            //keyPressed = Console.ReadKey().KeyChar;
            //_c.Line();
            //switch (keyPressed)
            //{
            //	case 'A':
            //	case 'a':
            //		DisplayAccessConflicts();
            //		break;
            //	case 'S':
            //	case 's':
            //		SelectResolution();
            //		break;
            //	default:
            //		Console.WriteLine(@"Invalid selection.");
            //		break;
            //}
            //	finished = true;
            //}
        }
        public void Resolve()
        {
            _c.Lines(2);
            _c.HorizontalRule();
            Console.WriteLine(@"** RESOLVE NAME CHANGE (select which name you'd like to keep) **");
            Console.WriteLine(Description);
            int count            = 1;
            int selectedTemplate = -1;

            foreach (CodeTemplate template in ConflictedTemplates)
            {
                Console.WriteLine(count + @". " + template.Description + @" from " + template.ParentGuid + @"-" + template.Id);
                count++;
            }
            Console.Write(@"Your choice is: ");
            selectedTemplate = Int32.Parse(Console.ReadKey().KeyChar.ToString());
            while (selectedTemplate - 1 < 0 || selectedTemplate - 1 >= ConflictedTemplates.Count)
            {
                Console.WriteLine(@"Invalid Selection. Choose a template from the list above.");
                selectedTemplate = Int32.Parse(Console.ReadKey().KeyChar.ToString());
            }
            ResolutionTemplate = ConflictedTemplates.ElementAt(selectedTemplate - 1);
        }