コード例 #1
0
 public static void MainProcess(string textStr,ref MainForm.ProgramCharacteristics answerStruct)
 {
     text = new StringBuilder(textStr);
     MainClass mainMethods = new MainClass();
     int vertexAmount = 2;
     int arcAmount = 1;
     int coherenceComponentAmount = 1;
     int textIndex = 0;
     byte signFound = 0;
     bool firstConstruction = true;
     while(mainMethods.condition_to_continue_watch_text(ref textIndex,ref signFound,text.Length))
     {
         if (signFound == 0)
             mainMethods.work_with_if(ref textIndex, true, false,ref vertexAmount,ref arcAmount,firstConstruction,";");
         else
             mainMethods.work_with_switch(ref textIndex, false,ref vertexAmount,ref arcAmount,firstConstruction);
     }
     int McCabeNumber = arcAmount - vertexAmount + 2 * coherenceComponentAmount;
     mainMethods.write_results_in_struct(ref answerStruct,vertexAmount,arcAmount,coherenceComponentAmount,McCabeNumber);
 }
コード例 #2
0
 private void write_results_in_struct(ref MainForm.ProgramCharacteristics answerStruct, int vertexAmount, int arcAmount,
                                      int coherenceComponentAmount, int McCabeNumber)
 {
     answerStruct.arcAmount = arcAmount;
     answerStruct.coherenceComponentAmount = coherenceComponentAmount;
     answerStruct.vertexAmount = vertexAmount;
     answerStruct.McCabeNumber = McCabeNumber;
 }