示例#1
0
 public CodeElement ConvertToDataModel(CodeSection codeSection)
 {
     CodeElement currentElement = null;
     codeSection.BlockType = codeSection.ReturnType;
     switch (codeSection.ReturnType)
     {
         case "namespace":
             currentElement = new ElementNamespace();
             break;
         case "class":
             currentElement = new ElementClass();
             break;
         default:
             currentElement = new ElementMethod();
             break;
     }
     currentElement.BlockType = codeSection.BlockType;
     currentElement.Name = codeSection.Identifier;
     currentElement.ReturnType = codeSection.ReturnType;
     currentElement.Parameters = codeSection.Parameters;
     currentElement.Extend = codeSection.Extend;
     if (codeSection.Header.Contains("("))
     {
         if (codeSection.Identifier.Contains("_"))
         {
             currentElement.ReturnType = "eventHandler";
         }
         else
         {
             //currentElement.ReturnType = "method";
         }
     }
     currentElement.Modifiers = codeSection.Modifiers;
     currentElement.Visibility = codeSection.Visibility;
     if (codeSection.CodeSections.Count > 0)
     {
         currentElement.Childs = new List<CodeElement>();
     }
     foreach (CodeSection codeSectionChild in codeSection.CodeSections)
     {
         CodeElement child = ConvertToDataModel(codeSectionChild);
         if (!string.IsNullOrEmpty(child.Name))
         {
             currentElement.Childs.Add(child);
         }
     }
     return currentElement;
 }
示例#2
0
        public List<SymbolID> getLeafsByRelation(SymbolID symbol, RelationItem relation)
        {
            System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            List<SymbolID> returnedSymbols = new List<SymbolID>();
            List<int[]> listID = new List<int[]>();
            //listID = serverAccess.getLeafsByRelation(relation.RelationID, symbol.SymbolID, 0);
            foreach (int[] ID in listID)
            {
                //listSymbol.Add(new Symbol(ID));
            }
            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelRelations;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                thisMethod.ElementName = stackTrace.GetFrame(0).GetMethod().ToString().Replace(stackTrace.GetFrame(0).GetMethod().Name.ToString(), "<span style='color: red'>" + stackTrace.GetFrame(0).GetMethod().Name.ToString() + "</span>");
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "SymbolID symbol", symbol.ToString() });
                thisMethod.Parameters.Add(new string[] { "RelationItem relation", relation.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (SymbolID SymbolID in returnedSymbols)
                {
                    result += "{" + SymbolID.ToString() + "}";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG
            return returnedSymbols;
        }
示例#3
0
 private string ColorizeMethod(ElementMethod method)
 {
     StringBuilder result = new StringBuilder();
     //if(!string.IsNullOrEmpty(method.Result)) result.Append("======================" + "<br>" + Environment.NewLine);
     if (method.ElementClassName.Length>2) result.Append("<span class='CodeElementNamespace'>" + method.ElementNamespaceName + "</span>&gt; <span class='CodeElementClass'>" + method.ElementClassName + "</span> <span class='CodeElementMethod'>" + method.ElementName + "</span><br>" + Environment.NewLine);
     string parameters = string.Empty;
     if (method.Parameters != null)
     foreach (string[] parameter in method.Parameters)
     {
          parameters += ", <span class='CodeElementParameter'>" + parameter[0] + "</span> = " + "<span class='CodeElementValue'>" + parameter[1] + "</span>";
     }
     if (parameters.Length > 2) { result.Append("<span class='specialChaer'>(" + parameters.Substring(2) + ")" + "<br>"); }
     string res = method.Result;
     string colorRes = method.Result;
     bool beforePunctuation = false;
     if (!string.IsNullOrEmpty(res))
     for(int i = 0; i<res.Length; i++)
     {
         char c = res[i];
             
         if (!char.IsLetterOrDigit(res[i]))
         {
             if (!beforePunctuation)
             {
                 res = res.Substring(0, i) + "<span class='punctuation'>" + res.Substring(i); i = i + 26;
             }
             beforePunctuation = true;
         }
         else 
         {
             if (beforePunctuation)
             {
                 res = res.Substring(0, i) + "</span>" + res.Substring(i); i = i + 7;
             }
             beforePunctuation = false;
         }
     }
     res += "</span>";
     if (!string.IsNullOrEmpty(res)) result.Append("<span class='value'>" + res + "</span><br>" + Environment.NewLine);
     return result.ToString();
 }
示例#4
0
        private void Wrap(SToken token)
        {

            while (token != null)
            {
                //if (token.TokenType == SElementType.Symbol)
                {

                    CodeFile newCodeFile = new CodeFile();
                    ElementNamespace namespaceItem = new ElementNamespace();
                    ElementClass classItem = new ElementClass();

                    bool isNeededCodeFileCreation = true;
                    foreach (CodeFile existentCodeFile in program.CodeFiles)
                    {
                        if (existentCodeFile.FileName == ToUp(token.TokenString))
                        {
                            isNeededCodeFileCreation = false;
                            newCodeFile = existentCodeFile;
                        }
                    }
                    if (isNeededCodeFileCreation)
                    {
                        newCodeFile.FileName = ToUp(token.TokenString);
                        program.CodeFiles.Add(newCodeFile);
                        namespaceItem.Name = "GeneratedApplication";
                        newCodeFile.Namespaces.Add(namespaceItem);
                        classItem.Name = ToUp(token.TokenString);
                        namespaceItem.ElementClasses.Add(classItem);
                    }


                    if (token.TokenProperties != null)
                    {
                        SToken tokenToRead = token;
                         if (token.TokenProperties[0].TokenNodeType == SElementType.FoldOpen)
                          {
                             foreach (SToken localTokenF in token.TokenProperties[0].TokenChilds)
                              {
                                 SToken localToken = localTokenF;
                                 while (localToken != null)
                                 {
                                     Wrap(localToken);
                                     ElementProperty newProperty = new ElementProperty();
                                     switch (localToken.TokenMultiplicity)
                                     {
                                         case SElementMultiplicity.Some:
                                             newProperty.Name = ToUp(localToken.TokenString) + "s";
                                             newProperty.PropertyType = "List<" + ToUp(localToken.TokenString) + ">";
                                             break;
                                         case SElementMultiplicity.Explicit:
                                             newProperty.Name = ToUp(localToken.TokenString) + "s";
                                             newProperty.PropertyType = "" + ToUp(localToken.TokenString) + " " + token.TokenMultiplicityLevel + "";
                                             break;
                                         default:
                                             newProperty.Name = ToUp(localToken.TokenString) + "P";
                                             newProperty.PropertyType = ToUp(localToken.TokenString);
                                             break;
                                     }
                                     //newProperty.PropertyType = localToken.TokenString;
                                     newProperty.ElementClassName = ToUp(localToken.TokenString);
                                     classItem.ElementProperties.Add(newProperty);
                                     if (localToken.TokenAfter != null)
                                     {
                                         localToken = localToken.TokenAfter[0];
                                     }
                                     else
                                     {
                                         localToken = null;
                                     }
                                 }
                             }
                         }
                         else
                         foreach (SToken localToken in token.TokenProperties)
                        {

                            Wrap(localToken);
                            ElementProperty newProperty = new ElementProperty();
                            switch (localToken.TokenMultiplicity)
                            {
                                case SElementMultiplicity.Some:
                                    newProperty.Name = ToUp(localToken.TokenString) + "s";
                                    newProperty.PropertyType = "List<" + ToUp(localToken.TokenString) + ">";
                                    break;
                                case SElementMultiplicity.Explicit:
                                    newProperty.Name = ToUp(localToken.TokenString) + "s";
                                    newProperty.PropertyType = "" + ToUp(localToken.TokenString) + " " + token.TokenMultiplicityLevel + "";
                                    break;
                                default:
                                    newProperty.Name = ToUp(localToken.TokenString) + "P";
                                    newProperty.PropertyType = ToUp(localToken.TokenString);
                                    break;
                            }
                            //newProperty.PropertyType = localToken.TokenString;
                            newProperty.ElementClassName = ToUp(localToken.TokenString);
                            classItem.ElementProperties.Add(newProperty);
                        }
                    }
                    if (token.TokenActivities != null)
                     {
                        foreach (SToken localToken in token.TokenActivities)
                        {
                            Wrap(localToken);
                            ElementMethod newMethod = new ElementMethod();

                            newMethod.Name = ToUp(localToken.TokenString);
                            newMethod.ElementAccessType = ElementMethod.DataAccessType.isPublic;
                            
                            //newProperty.PropertyType = localToken.TokenString;
                            newMethod.ElementClassName = ToUp(localToken.TokenString);
                            classItem.ElementMethods.Add(newMethod);
                        }
                    }


                    List<string> influencesA = new List<string>();
                    List<string> influencesB = new List<string>();
                    List<string> influencesC = new List<string>();
                    List<string> influencesD = new List<string>();
                        
                    if (token.TokenInfluenceA != null)
                    {

                        foreach (SToken localToken in token.TokenInfluenceA)
                        {
                            /*{
                                foreach (SToken tokenA in token.TokenInfluenceA)
                                {
                                    if (token.TokenString.Equals(tokenA))
                                    {
                                        System.Windows.Forms.MessageBox.Show("No need to repeat yourself");
                                        break;
                                    }
                                }
                            }*/
                            if (!influencesA.Contains(localToken.TokenString))
                            {
                                influencesA.Add(localToken.TokenString);
                            }
                            else
                            {
                                System.Windows.Forms.MessageBox.Show("No need to repeat yourself!");
                                break;
                            }
                            if (influencesB.Contains(localToken.TokenString))
                            {
                                 System.Windows.Forms.MessageBox.Show("Your statement is inconsistent!");
                                break;
                            }
                            if (influencesD.Contains(localToken.TokenString))
                            {
                                System.Windows.Forms.MessageBox.Show("You defined a rebound effect!");
                                break;
                            }
                            
                            //Wrap(localToken);
                            ElementMethod newMethod = new ElementMethod();

                            newMethod.Name = ToUp(localToken.TokenString);
                            newMethod.ElementAccessType = ElementMethod.DataAccessType.isPublic;
                            newMethod.IsStatic = true;
                            //newProperty.PropertyType = localToken.TokenString;
                            newMethod.Name = "Increase" + ToUp(localToken.TokenString);
                            classItem.ElementMethods.Add(newMethod);
                        }
                    }

                    if (token.TokenInfluenceB != null)
                    {
                        foreach (SToken localToken in token.TokenInfluenceB)
                        {
                            if (!influencesB.Contains(localToken.TokenString))
                            {
                                influencesB.Add(localToken.TokenString);
                            }
                            else
                            {
                                System.Windows.Forms.MessageBox.Show("No need to repeat yourself!");
                                break;
                            }
                            if (influencesA.Contains(localToken.TokenString))
                            {
                                System.Windows.Forms.MessageBox.Show("Your statement is inconsistent!");
                                break;
                            }
                            if (influencesC.Contains(localToken.TokenString))
                            {
                                System.Windows.Forms.MessageBox.Show("You defined a rebound effect!");
                                break;
                            }
                            //Wrap(localToken);
                            ElementMethod newMethod = new ElementMethod();

                            newMethod.Name = ToUp(localToken.TokenString);
                            newMethod.ElementAccessType = ElementMethod.DataAccessType.isPublic;
                            newMethod.IsStatic = true;
                            
                            //newProperty.PropertyType = localToken.TokenString;
                            newMethod.Name = "Decrease" + ToUp(localToken.TokenString);
                            classItem.ElementMethods.Add(newMethod);
                        }
                    }

                    if (token.TokenInfluenceC != null)
                    {
                        foreach (SToken localToken in token.TokenInfluenceC)
                        {
                            if (!influencesC.Contains(localToken.TokenString))
                            {
                                influencesC.Add(localToken.TokenString);
                            }
                            else
                            {
                                System.Windows.Forms.MessageBox.Show("No need to repeat yourself!");
                                break;
                            }
                            if (influencesD.Contains(localToken.TokenString))
                            {
                                System.Windows.Forms.MessageBox.Show("Your statement is inconsistent!");
                                break;
                            }
                            if (influencesB.Contains(localToken.TokenString))
                            {
                                System.Windows.Forms.MessageBox.Show("You defined a rebound effect!");
                                break;
                            }
                            Wrap(localToken);
                            ElementMethod newMethod = new ElementMethod();

                            newMethod.Name = ToUp(localToken.TokenString);
                            newMethod.ElementAccessType = ElementMethod.DataAccessType.isPublic;
                            newMethod.IsStatic = true;
                            
                            //newProperty.PropertyType = localToken.TokenString;
                            newMethod.Name = "IncreasedBy" + ToUp(localToken.TokenString);
                            classItem.ElementMethods.Add(newMethod);
                        }
                    }

                    if (token.TokenInfluenceD != null)
                    {
                        foreach (SToken localToken in token.TokenInfluenceD)
                        {
                            if (!influencesD.Contains(localToken.TokenString))
                            {
                                influencesD.Add(localToken.TokenString);
                            }
                            else
                            {
                                System.Windows.Forms.MessageBox.Show("No need to repeat yourself!");
                                break;
                            }
                            if (influencesC.Contains(localToken.TokenString))
                            {
                                System.Windows.Forms.MessageBox.Show("Your statement is inconsistent!");
                                break;
                            }
                            if (influencesA.Contains(localToken.TokenString))
                            {
                                System.Windows.Forms.MessageBox.Show("You defined a rebound effect!");
                                break;
                            }
                            Wrap(localToken);
                            ElementMethod newMethod = new ElementMethod();

                            newMethod.Name = ToUp(localToken.TokenString);
                            newMethod.ElementAccessType = ElementMethod.DataAccessType.isPublic;
                            newMethod.IsStatic = true;
                            
                            //newProperty.PropertyType = localToken.TokenString;
                            newMethod.Name = "DecreasedBy" + ToUp(localToken.TokenString);
                            classItem.ElementMethods.Add(newMethod);
                        }
                    }

                }
                foreach (SToken tokenlist in token.TokenChilds)
                {
                    Wrap(tokenlist);
                }
                if (token.TokenAfter != null)
                {
                    token = token.TokenAfter[0];
                }
                else
                {
                    token = null;
                }
            }
        }
示例#5
0
        /// <summary>
        /// check if the relation is transitive
        /// </summary>
        /// <param name="path">path so far</param>
        /// <param name="operatorID">Given operator</param>
        /// <param name="symbolID1">from symbol A</param>
        /// <param name="symbolID2">to symbol B</param>
        /// <param name="limitOfResults">Maximum capacity accepted for the result set</param>
        /// <returns>the symbols succession from A to B</returns>
        public List<SymbolID> IsTransitive(List<SymbolID> path, OperatorID operatorID, SymbolID symbolID1, SymbolID symbolID2, int limitOfResults) 
        {
            System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            List<SymbolID> LocalReturnList = new List<SymbolID>();
            List<SymbolID> returnList = new List<SymbolID>();
            bool solved = false;
            try
            {
                string commandString;
                if (false) // ($t1[0]=='?x')
                {
                    commandString = "SELECT `ID`, `g`, `h` FROM `" + DB + "`.`s" + symbolID1.Location.A.ToString("") + "` WHERE `a` = " + symbolID1.Location.A + " AND `c` LIKE " + operatorID.Location.Var + " AND `e` = " + symbolID2.Location.A + " ";
                }
                else
                {
                    commandString = "SELECT `ID`, `g`, `h` FROM `" + DB + "`.`s" + symbolID1.Location.A.ToString("") + "` WHERE `a` = " + symbolID1.Location.A + " AND `c` = " + operatorID.Location.Var + " AND `e` = " + symbolID2.Location.A + " ";
                }
                if (limitOfResults > 0) { commandString += " Limit " + limitOfResults; }
                MySql.Data.MySqlClient.MySqlCommand mySqlCommand = new MySqlCommand(commandString, mySQLConnection);
                MySqlDataReader myReader = mySqlCommand.ExecuteReader();
                if (MySqlTrace) SQLView.Log(mySqlCommand.CommandText);
                if (myReader.HasRows)
                {
                    solved = true;
                    while (myReader.Read())
                    {
                        if (!string.IsNullOrEmpty(myReader.GetString(0)))
                        {
                            int[] multipplicity = new int[] {0, 0 };
                            int.TryParse(myReader.GetString(1), out multipplicity[0]);
                            int.TryParse(myReader.GetString(2), out multipplicity[1]);
                            //if (multipplicity[0] != 0 || multipplicity[1] != 0)
                            //{
                            //    ReturnList.Add(symbID);
                            //}
                            SymbolID symbID = new SymbolID();
                            symbID.Location.A = symbolID1.Location.A;
                            int.TryParse(myReader.GetString(0), out symbID.Location.A);
                            int.TryParse(myReader.GetString(1), out symbID.Location.B);
                            //int.TryParse(myReader.GetString(2), out symbID[3]);
                            if (symbID.Exists)
                            {
                                returnList.Add(symbID);
                            }
                        }
                    }
                    myReader.Close();
                }
                else
                {
                    myReader.Close();
                    if (true) // ($t1[0]=='?x')
                    {
                        commandString = "SELECT `ID`, `e`, `f`, `g`, `h` FROM `" + DB + "`.`s" + symbolID1.Location.A.ToString("") + "` WHERE `a` = " + symbolID1.Location.A + " AND `c` = " + operatorID.Location.IR + " ";
                    }
                    else
                    {
                        commandString = "SELECT `ID`, `e`, `f`, `g`, `h` FROM `" + DB + "`.`s" + symbolID1.Location.A.ToString("") + "` WHERE `a` = " + symbolID1.Location.A + " AND `c`< 5000 ";
                    }
                    if (limitOfResults > 0) { commandString += " Limit " + limitOfResults; }
                    MySql.Data.MySqlClient.MySqlCommand mySqlCommand2 = new MySqlCommand(commandString, mySQLConnection);
                    MySqlDataReader myReader2 = mySqlCommand2.ExecuteReader();
                    if (MySqlTrace) SQLView.Log(mySqlCommand2.CommandText);
                    List<SymbolID> toTry = new List<SymbolID>();
                    while (myReader2.Read())
                    {
                        if (!string.IsNullOrEmpty(myReader2.GetString(0)))
                        {
                            SymbolID symbID = new SymbolID();
                            int.TryParse(myReader2.GetString(0), out symbID.Location.A);
                            int.TryParse(myReader2.GetString(1), out symbID.Location.B);
                            //int.TryParse(myReader2.GetString(2), out symbID[2]);
                            if (symbID.Exists)
                            {
                                toTry.Add(symbID);
                            }
                        }

                    }
                    myReader2.Close();
                    for (int i = 0; i < toTry.Count; i++)
                    {
                        if (!solved)
                        {
                            foreach (SymbolID symbID in toTry)
                            {
                                if (symbID.Exists)
                                {
                                    SymbolID newSymbolID = symbID;
                                    LocalReturnList = IsTransitive(LocalReturnList, operatorID, newSymbolID, symbolID2, limitOfResults);
                                }
                                if (LocalReturnList.Count > 0)
                                {
                                    //int[] ToAdd = new int[] { a[0], symbID[0] };
                                    //ReturnList.Add(new int[] { symbID[1], symbID[2] });
                                    SymbolID newSymbolID = symbID;
                                    newSymbolID.Location.A = symbolID1.Location.A;
                                    newSymbolID.Location.B = symbID.Location.A;
                                    returnList.Add(newSymbolID);
                                    returnList.AddRange(LocalReturnList);
                                    solved = true;
                                }
                            }
                        }
                    }

                }
            }
            catch (MySqlException retrieveSymbolIndexException)
            {
                Console.WriteLine("Error: {0}", retrieveSymbolIndexException.ToString());
            }
            if (MyResultsTrace)
            {
                string ResultLog = "";
                foreach (SymbolID i in returnList)
                {
                    ResultLog += " [" + i.Location.A + ":" + i.Location.B + "]";
                }
                SQLView.LogResult(new string[] { ResultLog });
            }
            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelNumbers;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                string methodName = fr.GetMethod().ToString();
                thisMethod.ElementName = fr.GetMethod().Name;
                thisMethod.ReturnType = methodName.Substring(0, methodName.IndexOf(" "));
            }
            if (logLevel >= 2) // parameters
            {
                // , , int[] , int[] , int[] , int[] , int 
                thisMethod.Parameters.Add(new string[] { "List<int[]> path", path.ToString() });
                thisMethod.Parameters.Add(new string[] { "int[] relationID", operatorID.ToString() });
                thisMethod.Parameters.Add(new string[] { "int[] symbolID1", symbolID1.ToString() });
                thisMethod.Parameters.Add(new string[] { "int[] symbolID2", symbolID2.ToString() });
                thisMethod.Parameters.Add(new string[] { "int limitOfResults", limitOfResults.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (SymbolID symbolItem in returnList)
                {
                    result += "{" + symbolItem.ToString() + "}";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG
            return returnList;
        }
示例#6
0
        internal List<SymbolID> GetSymbolCollectionByString(string SymbolNamePart, int Mode = 0, int LimitOfResults = 10)
        {
            List<SymbolID> ReturnedSymbols = new List<SymbolID>();
            if (!string.IsNullOrWhiteSpace(SymbolNamePart))
            {
                List<SymbolID> ReturnedElements = new List<SymbolID>();
                if (ServerAccess != null)
                {
                    ReturnedElements = ServerAccess.GetSymbolsByName(SymbolNamePart, 30);
                }
               if (ReturnedElements.Count > 0)
                {
                    foreach (SymbolID ints in ReturnedElements)
                    {
                        //SymbolID ID = new SymbolID( ints.Location.A, ints.Location.B );
                        //int[] Multiplicity = { ints[2], ints[3] };
                        if (ints.Exists)
                        {
                            ints.Names = ServerAccess.GetSymbolNamesByID(ID, 10);
                            //ReturnedSymbols.Add(new SymbolID(ID, Multiplicity, Name));
                            ReturnedSymbols.Add(ints);
                        }
                    }
                }
            }
            if (ReturnedSymbols.Count < 1)
            {
                ReturnedSymbols.Add(SymbolID.Null);
            }
            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel=logingOptions.levelObjects;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                thisMethod.ElementName = stackTrace.GetFrame(0).GetMethod().ToString().Replace(stackTrace.GetFrame(0).GetMethod().Name.ToString(), "<span style='color: red'>" + stackTrace.GetFrame(0).GetMethod().Name.ToString() + "</span>");
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "SymbolNamePart", SymbolNamePart.ToString() });
                thisMethod.Parameters.Add(new string[] { "Mode", Mode.ToString() });
                thisMethod.Parameters.Add(new string[] { "LimitOfResults", LimitOfResults.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (SymbolID symbol in ReturnedSymbols)
                {
                    result += "[" + symbol.Names[0] + "]";
                }
                thisMethod.Result = result;
            }
            DataPersistency.DL.Logging.LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG

            return ReturnedSymbols;
        }
示例#7
0
        /// <summary>
        /// Find relation component. Prepare relation members
        /// </summary>
        internal List<RelationItem> SolveCurrentRelation(List<int[]> relation)
        {
            System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            List<RelationItem> returnedRelations = new List<RelationItem>();

            string loopFlag = string.Empty;
            bool relationFound = false;
            List<int[]> Temp = new List<int[]>();
            List<int[]> Preoperand = new List<int[]>();
            List<int[]> Operator = new List<int[]>();
            List<int[]> Postopperand = new List<int[]>();
            foreach (int[] token in relation)
            {
                isLoopFlag = IsLoopFlag(token);
                if (isLoopFlag > -1)
                {
                    //loopFlag = "if";
                }
                if (relationFound)
                {
                    Postopperand.Add(token);
                }
                else
                {
                    if (token.Length == 6)
                    {
                        if (token[0] != 0 || token[1] != 0 || token[2] != 50 || token[3] != 50 || token[4] != 0 || token[5] != 0)
                        {
                            Operator.Add(token);
                            relationFound = true;
                        }
                        else
                        {
                            Preoperand.Add(token);
                        }
                    }
                    else
                    {
                        Preoperand.Add(token);
                    }
                }
            }
            Temp.AddRange(Preoperand);
            List<SymbolID> preop = PrepareRelationParticipant(Temp);

            if (Preoperand.Count > 0 && Operator.Count > 0 && Postopperand.Count > 0)
            {
                //List<SymbolID> preop = PrepareRelationParticipant(Preoperand);
                List<SymbolID> postop = PrepareRelationParticipant(Postopperand);
                List<OperatorID> res = new List<OperatorID>();
                //=// res.Add(new OperatorID(Operator[0], string.Empty));
                returnedRelations = isTransitive(preop, res, postop);
                if (returnedRelations.Count < 1 && serverAccess.AcceptRelations)
                {
                    returnedRelations = createRelation(preop, res, postop);
                }
            }
            else
            {
                foreach (SymbolID item in preop)
                {
                    returnedRelations.Add(SymbolToRel(item));
                }
            }

            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelRelations;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                thisMethod.ElementName = stackTrace.GetFrame(0).GetMethod().ToString().Replace(stackTrace.GetFrame(0).GetMethod().Name.ToString(), "<span style='color: red'>" + stackTrace.GetFrame(0).GetMethod().Name.ToString() + "</span>");
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "relation", relation.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (RelationItem rl in returnedRelations)
                {
                    result += "{" + rl.ToString() + "}";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG

            return returnedRelations;
        }
示例#8
0
        public List<RelationItem> isTransitive(List<SymbolID> preoperand, List<OperatorID> relation, List<SymbolID> postoperand)
        {
                        System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            // first of all prepare solve logical opperations
            List<int[]> returnedIDs = new List<int[]>();
            List<RelationItem> returnedRelations = new List<RelationItem>();
            foreach (SymbolID preoperandItem in preoperand)
            {
                foreach (SymbolID postoperandItem in postoperand)
                {
                    if (postoperandItem.Location.A == -100 && postoperandItem.Location.B == 100)
                    {
                        //returnedIDs.AddRange(serverAccess.GetContent(relation[0].ID/*new int[] { 2, 100, 1, 0, 9998, 1 }*/, preoperandItem.Multiplicity, preoperandItem.Location, 10));
                        //returnedIDs.AddRange(serverAccess.GetContent(relation[0].ID/*new int[] { 2, 100, 1, 0, 9998, 1 }*/, preoperandItem.Multiplicity, preoperandItem.Location, 10));
                    }
                    else
                    {
                        //=// returnedIDs.AddRange(serverAccess.IsTransitive(new List<int[]>(), relation[0].ID/*new int[] { 2, 100, 1, 0, 9998, 1 }*/, preoperandItem.Location, preoperandItem.Multiplicity, postoperandItem.Location, postoperandItem.Multiplicity, 10));
                    }

                    if (returnedIDs.Count > 0)
                    {
                        /*
                        bool HaveNoSuchReference = true;
                        //find existent reference
                        List<int[]> referedSymbols = new List<int[]>();
                            //referedSymbols = serverAccess.GetValue(new int[] { 2, 100, 9998, 1 }, preoperandItem.Location, postoperandItem.Location, 10); // 4 items

                        if (referedSymbols.Count < 1)
                        {
                            //referedSymbols.Add(serverAccess.AssignValue(new int[] { 2, 100, 0, 1 }, preoperandItem.Location, postoperandItem.Location)); //r2r3
                        }
                        else
                        {
                            //referedSymbols = serverAccess.GetReferince(new int[] { 2, 100, 9998, 1 }, preoperandItem.Location, postoperandItem.Location, 10); // 4 items
                        }

                        List<int[]> ValidReferinces = new List<int[]>();
                        foreach (int[] MultiplicityReference in referedSymbols)
                        {
                            if (MultiplicityReference[2] != 0 && MultiplicityReference[3] != 0)
                            {
                                ValidReferinces.Add(MultiplicityReference);
                            }
                            else
                            {
                                HaveNoSuchReference = true;
                            }
                        }
                        if (referedSymbols.Count < 0 && HaveNoSuchReference == true)
                        {
                            //create reference
                            //referedSymbols.Add(serverAccess.ReAssignValue(new int[] { 2, 100, 1998, 0 }, candidate[0], SymbID[1]));
                            //referedSymbols.Add(serverAccess.ReAssignValue(new int[] { 2, 100, 1998, 0 }, preoperandItem.Location, postoperandItem.Location));
                        }
                        foreach (int[] MultiplicityReference in ValidReferinces)
                        {
                            result.Add(new int[] { MultiplicityReference[2], MultiplicityReference[3] });
                        }
                        */
                    }
                    else
                    {
                        //if (S
                        //serverAccess.CreateRelation(new int[] { 2, 100, 1, 0, 1998, 1 }, preoperandItem.Multiplicity, preoperandItem.Location, postoperandItem.Multiplicity, postoperandItem.Location);
                        //serverAccess.CreateRelationAsNew(new int[] { 2, 100, 1998, 1 }, SymbID[0], SymbID[1]);
                    }

                    foreach (int[] itemID in returnedIDs)
                    {
                        if (itemID.Count() > 7)
                        {
                            int offset = itemID[8];
                            int[] rel = new int[] { itemID[2], itemID[3] };
                            int[] refA = new int[] { itemID[0], itemID[1] };
                            int[] mul = new int[] { itemID[6], itemID[7] };
                            int[] refB = new int[] { itemID[4], itemID[5] };
                            //sresult.Add(new RelationItem(offset, rel, refA, refB, mul, string.Empty));
                            SymbolCollection symbolCollectionA = new SymbolCollection();
                            //=//symbolCollectionA.AddRange(IntsToSymbs(new List<int[]>() { refA }));
                            SymbolCollection symbolCollectionB = new SymbolCollection();
                            //=//symbolCollectionB.AddRange(IntsToSymbs(new List<int[]>() { refB }));
                            //=// returnedRelations.Add(new RelationItem(symbolCollectionA, new OperatorID(new int[] { }, ""), symbolCollectionB));
                        }
                    }
                }
            }

            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelRelations;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                thisMethod.ElementName = stackTrace.GetFrame(0).GetMethod().ToString().Replace(stackTrace.GetFrame(0).GetMethod().Name.ToString(), "<span style='color: red'>" + stackTrace.GetFrame(0).GetMethod().Name.ToString() + "</span>");
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "relation", relation.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (RelationItem rl in returnedRelations)
                {
                    result += "{" + rl.ToString() + "}";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG
            return returnedRelations;
        }
示例#9
0
        List<SymbolID> AggregatePossesionToLeft(List<SymbolID> simbs)
        {
            System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            List<SymbolID> initial = new List<SymbolID>();
            foreach (SymbolID ini in simbs)
            {
                initial.Add(ini);
            }
            List<SymbolID> returnedIDs = new List<SymbolID>();
            //if (simbs.Count > 1)
            //{
                int i = 1;
                while (initial.Count > 0)
                {
                    returnedIDs = new List<SymbolID>();
                    i = -1;
                    for (int j = 0; j < initial.Count; j++)
                    {
                        //=// Find if is relation or is symbol
                        //if (initial[j].Length > 4)
                        {
                           // if (initial[j].Location.A == 0 && initial[j].Location.B == 0 && initial[j][2] == 50 && initial[j][3] == 50 && initial[j][4] == 0 && initial[j][5] == 0)
                            {
                                i = j;
                            }
                        }
                    }
                    if (i > 0)
                    { // I found the right term
                        List<SymbolID> right = new List<SymbolID>();
                        right.AddRange(initial);
                        right.RemoveRange(0, i+1);
                        int z = -1;
                        for (int j = 0; j < i; j++)
                        {
                            //=//
                            //if (initial[j].Length > 4)
                            {
                                //if (initial[j].Location.A == 0 && initial[j].Location.B == 0 && initial[j][2] == 50 && initial[j][3] == 50 && initial[j][4] == 0 && initial[j][5] == 0)
                                {
                                    z = j;
                                }
                            }
                        }

                        List<SymbolID> left = new List<SymbolID>();
                        left.AddRange(initial);
                        left.RemoveRange(i, left.Count-i);
                        left.RemoveRange(0, z + 1);

                        List<SymbolID> RightLeft = new List<SymbolID>();
                        RightLeft.AddRange(right);
                        RightLeft.AddRange(left);

                        returnedIDs.AddRange(AggregatePossesionToRight(RightLeft));
                        if (z > 0)
                        {
                            initial.RemoveRange(i - 1, initial.Count -i+1);
                            initial.AddRange(returnedIDs);
                        }
                        else 
                        {
                            initial.Clear();
                        }
                    }
                    else
                    {
                        returnedIDs.AddRange(AggregatePossesionToRight(initial));
                        initial.Clear();
                    }
                }
                
            //}
                #region LOG
                //=== CUSTOM LOGGER===================================================================================
                ElementMethod thisMethod = new ElementMethod();
                int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelRelations;
                if (logLevel >= 3) // code
                {
                    System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                    thisMethod.ElementNamespaceName = this.GetType().Namespace;
                    thisMethod.ElementClassName = this.GetType().Name;
                    thisMethod.ElementName = stackTrace.GetFrame(0).GetMethod().ToString().Replace(stackTrace.GetFrame(0).GetMethod().Name.ToString(), "<span style='color: red'>" + stackTrace.GetFrame(0).GetMethod().Name.ToString() + "</span>");
                }
                if (logLevel >= 2) // parameters
                {
                    thisMethod.Parameters.Add(new string[] { "List<SymbolID> simbs", simbs.ToString() });
                }
                if (logLevel >= 1) // results
                {
                    string result = string.Empty;
                    foreach (SymbolID ID in returnedIDs)
                    {
                        result += "{" + ID.ToString() + "}";
                    }
                    thisMethod.Result = result;
                }
                LoggingSystem.LogMethod = thisMethod;

                //====================================================================================================
                #endregion LOG
                return returnedIDs;
        }
示例#10
0
        /// <summary>
        /// Create symbol by name. If duplicates are not accepted return the existent symbolID. If the name does not exist or duplicates are accepted insert the name  and return it`s symbolID
        /// </summary>
        /// <param name="symbolName">The exact name of the symbol to find</param>
        /// <param name="acceptDuplicates">True if duplicates are permitted</param>
        /// <returns>ResultSet: 1) The existent symbolID if it exists and duplicates are not permited 2) The new created symbolID</returns>
        public List<SymbolID> CreateSymbolByName(string symbolName, bool acceptDuplicates)
        {
            // TODO FLORIN: Create duplicates does not return also the existent IDs. But if not permited it will. Please check for consistency.

            // Start logging
            System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            // Prepare result set
            List<SymbolID> resultedSymbolIDs = new List<SymbolID>();
            
            if (!acceptDuplicates)
            {
                // If duplicates does not exists, check if the symbol is already in the database
                resultedSymbolIDs = GetSymbolsByName(symbolName, 0, 10);
            }

            // Because creation of duplicate symbols is not permited and there are already symbols with the given name, return the existent symbols
            if (resultedSymbolIDs.Count < 1)
            {
                SymbolID symbolID = new SymbolID();
                try
                {
                    // Add symbol name to simbs table
                    string commandString = "INSERT INTO `" + DB + "`.`simbs` (`ID`, `En`) VALUES (NULL, '" + symbolName + "');";
                    MySql.Data.MySqlClient.MySqlCommand mySqlCommand = new MySqlCommand(commandString, mySQLConnection);
                    if (MySqlTrace) SQLView.Log(mySqlCommand.CommandText);
                    mySqlCommand.ExecuteNonQuery();
                    if (mySqlCommand.LastInsertedId > 0)
                    {
                        // Update IR with the ID value
                        string commandString2 = "UPDATE `" + DB + "`.`simbs` SET `IR` = `ID` WHERE `ID` = " + (int)mySqlCommand.LastInsertedId + " ;";
                        MySql.Data.MySqlClient.MySqlCommand mySqlCommand2 = new MySqlCommand(commandString2, mySQLConnection);
                        mySqlCommand2.ExecuteNonQuery();
                        symbolID.Location.A = (int)mySqlCommand.LastInsertedId;
                        resultedSymbolIDs.Add(symbolID);
                    }
                }
                catch (MySqlException retrieveSymbolIndexException)
                {
                    Console.WriteLine("Error: {0}", retrieveSymbolIndexException.ToString());
                }

                // Create the coresponding symbol table
                CreateSymbolTable(symbolID);
            }

            if (MyResultsTrace)
            {
                string ResultLog = "";
                foreach (SymbolID itemSymbolID in resultedSymbolIDs)
                {
                    ResultLog += " [" + itemSymbolID.Location.A + ":" + "0" + "]";
                }
                SQLView.LogResult(new string[] { ResultLog });
            }

            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelNumbers;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                string methodName = fr.GetMethod().ToString();
                thisMethod.ElementName = fr.GetMethod().Name;
                thisMethod.ReturnType = methodName.Substring(0, methodName.IndexOf(" "));
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "string symbolName", symbolName.ToString() });
                thisMethod.Parameters.Add(new string[] { "bool acceptDuplicates", acceptDuplicates ? "True" : "False" });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (SymbolID itemSymbolID in resultedSymbolIDs)
                {
                    result += "{" + itemSymbolID.ToString() + "}";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG
            return resultedSymbolIDs;
        }
示例#11
0
        /// <summary>
        /// Get symbolIDs from a partial symbol name (according to search mode options). 
        /// </summary>
        /// <param name="symbolNamePart">The partial name of the symbol to find</param>
        /// <param name="searchMode">Search mode according to the related enumeration</param>
        /// <param name="limitOfResults">Maximum capacity accepted for the result set</param>
        /// <returns>The existent symbolIDs associated with the symbol name OR the new created symbol if there was no symbol and if the permissions are right</returns>
        public List<SymbolID> GetSymbolsByName(string symbolNamePart, int searchMode, int limitOfResults = 10)
        {
            // Start logging
            System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            // Prepare result set
            List<SymbolID> resultedSymbolIDs = new List<SymbolID>();

            try
            {
                string commandString;
                switch (searchMode)
                {
                    case (int)SearchMode.ExactMatch: // strict
                        commandString = "SELECT `IR` FROM `" + DB + "`.`simbs` WHERE `En` LIKE '" + symbolNamePart + "' ";
                        break;
                    case (int)SearchMode.StartWith: //
                        commandString = "SELECT `IR` FROM `" + DB + "`.`simbs` WHERE `En` LIKE '" + symbolNamePart + "%' ";
                        break;
                    case (int)SearchMode.Containing: //
                        commandString = "SELECT `IR` FROM `" + DB + "`.`simbs` WHERE `En` LIKE '%" + symbolNamePart + "%' ";
                        break;
                    case (int)SearchMode.EndingWith: //
                        commandString = "SELECT `IR` FROM `" + DB + "`.`simbs` WHERE `En` LIKE '%" + symbolNamePart + "' ";
                        break;
                    default:
                        commandString = "SELECT `IR` FROM `" + DB + "`.`simbs` WHERE `En` LIKE '" + symbolNamePart + "' ";
                        break;
                }
                if (limitOfResults != 0) { commandString += " Limit " + limitOfResults + " "; }
                MySql.Data.MySqlClient.MySqlCommand mySqlCommand = new MySqlCommand(commandString, mySQLConnection);
                if (MySqlTrace) SQLView.Log(mySqlCommand.CommandText);
                MySqlDataReader myReader = mySqlCommand.ExecuteReader();
                while (myReader.Read())
                {
                    if (!string.IsNullOrEmpty(myReader.GetString(0))) //TO DO null value
                    {
                        SymbolID symbolID = new SymbolID();
                        int.TryParse(myReader.GetString(0), out symbolID.Location.A);
                        if (symbolID.Exists)
                        {
                            resultedSymbolIDs.Add(symbolID);
                        }
                    }
                }
                myReader.Close();
            }
            catch (MySqlException retrieveSymbolIndexException)
            {
                Console.WriteLine("Error: {0}", retrieveSymbolIndexException.ToString());
            }

            // If no symbol was found and there was provided the holl name of the symbol and permisions are right then create the wanted symbol name and return it`s symbolID
            if (resultedSymbolIDs.Count < 1 && searchMode == (int)SearchMode.ExactMatch && AcceptSymbols)
            {
                resultedSymbolIDs = CreateSymbolByName(symbolNamePart, true); // set AcceptDuplicates to avoid other check for existence
            }

            if (MyResultsTrace)
            {
                string ResultLog = "";
                foreach (SymbolID itemSymbolID in resultedSymbolIDs)
                {
                    ResultLog += " [" + itemSymbolID.Location.A + ":" + "0" + "]";
                }
                SQLView.LogResult(new string[] { ResultLog });
            }

            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelNumbers;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                string methodName = fr.GetMethod().ToString();
                thisMethod.ElementName = fr.GetMethod().Name;
                thisMethod.ReturnType = methodName.Substring(0, methodName.IndexOf(" "));
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "string symbolNamePart", symbolNamePart });
                thisMethod.Parameters.Add(new string[] { "int mode", searchMode.ToString() });
                thisMethod.Parameters.Add(new string[] { "int limitOfResults", limitOfResults.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (SymbolID itemSymbolID in resultedSymbolIDs)
                {
                    result += "{" + itemSymbolID.ToString() + "}";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG
            return resultedSymbolIDs;
        }
示例#12
0
        /// <summary>
        /// Create new relation
        /// </summary>
        /// <param name="operatorID">relation type</param>
        /// <param name="symbolID1">preoperand symbol</param>
        /// <param name="symbolID2">postoperand symbol</param>
        /// <returns>ResultSet: The new created relation</returns>
        public List<SymbolID> CreateRelation(OperatorID operatorID, SymbolID symbolID1, SymbolID symbolID2)
        {
            System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            List<SymbolID> relationPositions = new List<SymbolID>();
            SymbolID relationPosition = new SymbolID();
            try
            {
                string commandString = commandString = "INSERT INTO `" + DB + "`.`s" + symbolID2.Location.A.ToString("") + "` (`a`, `b`, `c`, `d`, `e`, `f`) VALUES (" + symbolID2.Location.A + ", " + symbolID2.Location.B + "," + operatorID.Location.IR2 + ", " + operatorID.Location.Var2 + "," + symbolID1.Location.A + ", " + symbolID1.Location.A + ", " + operatorID.Location.IR2 + ", " + operatorID.Location.Var2 + " ) ;";
                //string commandString = commandString = "INSERT INTO `" + DB + "`.`s" + symbolID2[0].ToString() + "` (`a`, `b`, `c`, `d`, `e`, `f`, `g`, `h`) VALUES (" + symbolID2[0] + ", " + symbolID2[1] + "," + relationID[4] + ", " + relationID[5] + "," + symbolID1[0] + ", " + symbolID1[1] + ", " + relationID[2] + ", " + relationID[3] + " ) ;";
                MySql.Data.MySqlClient.MySqlCommand mySqlCommand = new MySqlCommand(commandString, mySQLConnection);
                //if (mySQLConnection.
                mySqlCommand.ExecuteNonQuery();
                if (MySqlTrace) SQLView.Log(mySqlCommand.CommandText);
                commandString = commandString = "INSERT INTO `" + DB + "`.`s" + symbolID1.Location.A.ToString("") + "` (`a`, `b`, `c`, `d`, `e`, `f`) VALUES (" + symbolID1.Location.A + ", " + symbolID1.Location.B + ", " + operatorID.Location.IR + ", " + operatorID.Location.Var + ", " + symbolID2.Location.A + ", " + symbolID2.Location.B + ", " + operatorID.Location.IR2 + ", " + operatorID.Location.Var2 + " ) ;";
                //commandString = commandString = "INSERT INTO `" + DB + "`.`s" + symbolID1[0].ToString() + "` (`a`, `b`, `c`, `d`, `e`, `f`, `g`, `h`) VALUES (" + symbolID1[0] + ", " + symbolID1[1] + ", " + relationID[0] + ", " + relationID[1] + ", " + symbolID2[0] + ", " + symbolID2[1] + ", " + relationID[2] + ", " + relationID[3] + " ) ;";
                mySqlCommand = new MySqlCommand(commandString, mySQLConnection);
                mySqlCommand.ExecuteNonQuery();
                if (MySqlTrace) SQLView.Log(mySqlCommand.CommandText);
                if (mySqlCommand.LastInsertedId > 0)
                {
                    relationPosition.Location.A = symbolID1.Location.A;
                    relationPosition.Location.B = (int)mySqlCommand.LastInsertedId;
                }
            }
            catch (MySqlException retrieveRelationIndexException)
            {
                Console.WriteLine("Error: {0}", retrieveRelationIndexException.ToString());
            }
            if (MyResultsTrace) SQLView.LogResult(relationPosition.ToString());
            relationPositions.Add(relationPosition);
            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelNumbers;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                string methodName = fr.GetMethod().ToString();
                thisMethod.ElementName = fr.GetMethod().Name;
                thisMethod.ReturnType = methodName.Substring(0, methodName.IndexOf(" "));
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "int[] relationID", operatorID.ToString() });
                // thisMethod.Parameters.Add(new string[] { "int[] multiplicityA", ArrayToString(multiplicityA) });
                thisMethod.Parameters.Add(new string[] { "int[] symbolID1", symbolID1.ToString() });
                // thisMethod.Parameters.Add(new string[] { "int[] multiplicityB", ArrayToString(multiplicityB) });
                thisMethod.Parameters.Add(new string[] { "int[] symbolID2", symbolID2.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (SymbolID symbolItem in relationPositions)
                {
                    result += "{" + symbolItem.Location.ToString() + "}";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG
            return relationPositions;
        }
示例#13
0
        internal List<SymbolID> GetSymbolByID(SymbolID ID)
        {
            System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            List<SymbolID> ReturnedElements = new List<SymbolID>();
            if (ID.Exists)
            {
                List<string> ReturnedStrings = serverAccess.GetSymbolNamesByID(ID, 1);
                if (ReturnedStrings.Count > 0)
                {
                    foreach (string Name in ReturnedStrings)
                    {
                        ReturnedElements.Add(new SymbolID(ID.Location, ID.Multiplicity, Name));// this.ID = ID;
                        //this.Name = ReturnedElements[0];
                    }
                }
                else
                {
                    ReturnedElements.Add(SymbolID.Null);
                }
            }
            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelRelations;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                thisMethod.ElementName = stackTrace.GetFrame(0).GetMethod().ToString().Replace(stackTrace.GetFrame(0).GetMethod().Name.ToString(), "<span style='color: red'>" + stackTrace.GetFrame(0).GetMethod().Name.ToString() + "</span>");
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "int[] ID", ID.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (SymbolID rl in ReturnedElements)
                {
                    result += "{" + rl.ToString() + "}";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG

            return ReturnedElements;
        }
示例#14
0
        internal List<SymbolID> GetSymbolCollectionByString(string SymbolNamePart, int Mode = 0, int LimitOfResults = 10)
        {
            System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            List<SymbolID> ReturnedSymbols = new List<SymbolID>();
            if (!string.IsNullOrWhiteSpace(SymbolNamePart))
            {
                List<SymbolID> ReturnedElements = new List<SymbolID>();
                if (serverAccess != null)
                {
                    ReturnedElements = serverAccess.GetSymbolsByName(SymbolNamePart, Mode, 30);
                }
               if (ReturnedElements.Count > 0)
                {
                    foreach (SymbolID ints in ReturnedElements)
                    {
                        if (ID.Exists)
                        {
                            ID.Names = serverAccess.GetSymbolNamesByID(ID, 10);
                            //ReturnedSymbols.Add(new SymbolID(ID, Multiplicity, Name));
                            ReturnedSymbols.Add(ID);
                        }
                    }
                }
            }
            if (ReturnedSymbols.Count < 1)
            {
                ReturnedSymbols.Add(SymbolID.Null);
            }
            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel=logingOptions.levelObjects;
            logLevel = 3;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                thisMethod.ElementName = stackTrace.GetFrame(0).GetMethod().ToString().Replace(stackTrace.GetFrame(0).GetMethod().Name.ToString(), "<span style='color: red'>" + stackTrace.GetFrame(0).GetMethod().Name.ToString() + "</span>");
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "string SymbolNamePart", SymbolNamePart.ToString() });
                thisMethod.Parameters.Add(new string[] { "int Mode", Mode.ToString() });
                thisMethod.Parameters.Add(new string[] { "int LimitOfResults", LimitOfResults.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (SymbolID symbol in ReturnedSymbols)
                {
                    foreach (string name in symbol.Names)
                    {
                        result += "{" + name + "}";
                    }
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG

            return ReturnedSymbols;
        }
示例#15
0
        internal List<SymbolID> GetSynonimesCollection(SymbolID symbol)
        {
            System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            List<SymbolID> ReturnedSymbols = new List<SymbolID>();
            if (symbol.Exists)
            {
                List<string> ReturnedElements = serverAccess.GetSymbolNamesByID(symbol, 0);
                if (ReturnedElements.Count > 0)
                {
                    foreach (string Name in ReturnedElements)
                    {
                        if (symbol.Exists)
                        {
                            symbol.Names.Add(Name);
                            ReturnedSymbols.Add(symbol);
                        }
                    }
                }
            }
            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelRelations;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                thisMethod.ElementName = stackTrace.GetFrame(0).GetMethod().ToString().Replace(stackTrace.GetFrame(0).GetMethod().Name.ToString(), "<span style='color: red'>" + stackTrace.GetFrame(0).GetMethod().Name.ToString() + "</span>");
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "SymbolID symbol", symbol.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (SymbolID rl in ReturnedSymbols)
                {
                    result += "{" + rl.ToString() + "}";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG
            return ReturnedSymbols;
        }
示例#16
0
        public List<SymbolID> PrepareRelationParticipant(List<int[]> symbolIDs)
        {
            System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            List<SymbolID> returnedSymbols = new List<SymbolID>();
            int currSymb = -1;
            int nextMul = 1;
                
            foreach (int[] symbID in symbolIDs)
            {
                currSymb++;
                if (symbID.Length == 1 && (symbID[0] != 0))
                {
                    if (currSymb < symbolIDs.Count)
                    {
                        //if (SymbIDs[currSymb + 1].Length>2)
                        {
                            nextMul = symbID[0];//SymbIDs[currSymb + 1][2] = symbID[0];
                        }
                    }
                    //preopedand.Add(new SymbolID(symbID, new int[] { 1, 0 }, string.Empty));
                }
                else if (symbID.Length == 2 && (symbID[0] != 0 || symbID[0] != 0))
                {
                    //=// returnedSymbols.Add(new SymbolID(symbID, new int[] { nextMul, 0 }, string.Empty));
                    nextMul = 1;
                }
                else if (!(symbID[0] != 0 || symbID[0] != 0))
                {
                    returnedSymbols.Add(new SymbolID(new Location(symbID[0])));
                }
                else
                {
                    //=// returnedSymbols.Add(new SymbolID(symbID, new int[] { 1, 0 }, "what"));
                }

            }
            if (symbolIDs.Count > 1)
            {
                List<SymbolID> preopedandIDs = AggregatePossesionToLeft(returnedSymbols);
                returnedSymbols = IntsToSymbs(preopedandIDs);
            }
            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelRelations;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                thisMethod.ElementName = stackTrace.GetFrame(0).GetMethod().ToString().Replace(stackTrace.GetFrame(0).GetMethod().Name.ToString(), "<span style='color: red'>" + stackTrace.GetFrame(0).GetMethod().Name.ToString() + "</span>");
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "List<int[]> symbolIDs", symbolIDs.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (SymbolID SymbolID in returnedSymbols)
                {
                    result += "{" + SymbolID.ToString() + "}";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG
            return returnedSymbols;
        }
示例#17
0
        List<SymbolID> IntsToSymbs(List<SymbolID> ints)
        {
            System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            List<SymbolID> returnedSymbols = new List<SymbolID>();
            foreach (SymbolID ID in ints)
            {
                //if (ID.Length > 7)
                {
                    //=// returnedSymbols.Add(new SymbolID(new int[] { ID[0], ID[8] }, new int[] { 1, ID[7] }, string.Empty));
                }
                //else
                {
                    //=// returnedSymbols.Add(new SymbolID(new int[] { ID[0], ID[1] }, new int[] { ID[2], ID[3] }, string.Empty));
                }
            }
            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelRelations;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                thisMethod.ElementName = stackTrace.GetFrame(0).GetMethod().ToString().Replace(stackTrace.GetFrame(0).GetMethod().Name.ToString(), "<span style='color: red'>" + stackTrace.GetFrame(0).GetMethod().Name.ToString() + "</span>");
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "List<int[]> ints", ints.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (SymbolID SymbolID in returnedSymbols)
                {
                    result += "{" + SymbolID.ToString() + "}";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG
            return returnedSymbols;
        }
示例#18
0
        /// <summary>
        /// Create a new alias for a given IR if the permissions are right and the given symbolID exists
        /// </summary>
        /// <param name="symbolAliasName">The new alias</param>
        /// <param name="existentID">The existent IR</param>
        /// <returns>ResultSet: 1) Empty set if IR does not exists or DB does not accept this change, 2) Existent symbol if already assigned, 3) The new symbol if DB accept this change</returns>
        public List<SymbolID> CreateSymbolAlias(string symbolAliasName, int existentID)
        {
            // Start logging
            System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            // A flag to continue with log section
            bool evaluationSuspended = false;

            // Prepare result set
            List<SymbolID> resultedSymbolIDs = new List<SymbolID>();

            // Prepare given ID as a symbol ID
            SymbolID symbolID = new SymbolID();
            symbolID.Location.A = existentID;

            // TODO FLORIN: check about symbolPosition
            int[] symbolPosition = new int[] { 0, 0, 0, 1 };

            // Check if alias exists
            if (existentID != 0)
            {
                List<string> SymbolSynonimes = GetSymbolNamesByID(symbolID, 0);
                //int[] match = new int[] { 0, 0 };
                if (SymbolSynonimes.Count < 1)
                {
                    // Return empty result set because the given symbolID does not exist
                    evaluationSuspended = true;
                }
                if ((!evaluationSuspended) && SymbolSynonimes.Contains(symbolAliasName))
                {
                    resultedSymbolIDs.Add(symbolID);
                    // Return the existent symbolID already associated with the given Name
                    evaluationSuspended = true;
                }
            }

            // If the database accepts changes (accept new symbols) create the alias as the request. The symbolID exists in the database. The new alias will have the same IR
            if ((!evaluationSuspended) && AcceptSymbols)
            {
                try
                {
                    string commandString = "INSERT INTO `" + DB + "`.`simbs` (`ID`, `IR`, `En`) VALUES (NULL, " + existentID + ", '" + symbolAliasName + "');";
                    MySql.Data.MySqlClient.MySqlCommand mySqlCommand = new MySqlCommand(commandString, mySQLConnection);
                    if (MySqlTrace) SQLView.Log(mySqlCommand.CommandText);
                    mySqlCommand.ExecuteNonQuery();
                    if (mySqlCommand.LastInsertedId > 0)
                    {
                        symbolPosition[0] = (int)mySqlCommand.LastInsertedId;
                        resultedSymbolIDs.Add(symbolID);
                    }
                }
                catch (MySqlException retrieveSymbolIndexException)
                {
                    Console.WriteLine("Error: {0}", retrieveSymbolIndexException.ToString());
                }
            }
            if (MySqlTrace) SQLView.LogResult(resultedSymbolIDs.ToString());
            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelNumbers;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                string methodName = fr.GetMethod().ToString();
                thisMethod.ElementName = fr.GetMethod().Name;
                thisMethod.ReturnType = methodName.Substring(0, methodName.IndexOf(" "));
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "string symbolAliasName", symbolAliasName.ToString() });
                thisMethod.Parameters.Add(new string[] { "int existentID", existentID.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (SymbolID itemSymbolID in resultedSymbolIDs)
                {
                    result += "{" + itemSymbolID.ToString() + "}";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG
            return resultedSymbolIDs;
        }
示例#19
0
        List<SymbolID> AggregatePossesionToRight(List<SymbolID> simbs)
        {
                        System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            if (simbs.Count > 1)
            for (int i = 1; i < simbs.Count; i++)
            {
                //while (currentIncrement.)
                //{
                //List<SymbolID> currentIncrement = SolvePossesion(new List<int[]> { new int[] { simbs[i - 1][0], simbs[i - 1][simbs[i - 1].Length-1] } }, new List<int[]> { simbs[i] });
                //if (currentIncrement.Count == 1)
                {
                    simbs.RemoveRange(i - 1, 2);
                    //simbs.Insert(i-1, currentIncrement[0]);
                    i--;
                }
                //}
            }
            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelRelations;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                thisMethod.ElementName = stackTrace.GetFrame(0).GetMethod().ToString().Replace(stackTrace.GetFrame(0).GetMethod().Name.ToString(), "<span style='color: red'>" + stackTrace.GetFrame(0).GetMethod().Name.ToString() + "</span>");
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "List<int[]> simbs", simbs.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (SymbolID rl in simbs)
                {
                    result += "{" + (rl) + "}";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG
            return simbs;
        }
示例#20
0
        /// <summary>
        /// Get all operators known
        /// </summary>
        /// <returns>ResultSet: List of all operators stored in the database</returns>
        public List<OperatorID> GetAllOperators()
        {
            // Start logging
            System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            // Prepare result set
            List<OperatorID> allRelations = new List<OperatorID>();
            try
            {
                string commandString = "SELECT `IR`, `Var`, `IR2`, `Var2` FROM `" + DB + "`.`srel` ";
                MySql.Data.MySqlClient.MySqlCommand mySqlCommand = new MySqlCommand(commandString, mySQLConnection);
                MySqlDataReader myReader = mySqlCommand.ExecuteReader();
                if (MySqlTrace) SQLView.Log(mySqlCommand.CommandText);

                //List<string[]> list = (from IDataRecord r in myReader
                //                     select (string)r["IR"]
                //    ).ToList(); 
                while (myReader.Read())
                {
                    if (!string.IsNullOrEmpty(myReader.GetString(0)))
                    {
                        OperatorLocation operatorID = new OperatorLocation();
                        int.TryParse(myReader.GetString(0), out operatorID.IR);
                        int.TryParse(myReader.GetString(1), out operatorID.Var);
                        int.TryParse(myReader.GetString(2), out operatorID.IR2);
                        int.TryParse(myReader.GetString(3), out operatorID.Var2);
                        if (operatorID.IR != 0 || operatorID.Var != 0)
                        {
                            allRelations.Add(new OperatorID(operatorID));
                        }
                    }
                }
                myReader.Close();
            }
            catch (MySqlException retrieveSymbolIndexException)
            {
                Console.WriteLine("Error: {0}", retrieveSymbolIndexException.ToString());
            }
            if (MyResultsTrace)
            {
                string ResultLog = "";
                foreach (OperatorID operatorID in allRelations)
                {
                    ResultLog += operatorID.ToString();
                }
                SQLView.LogResult(new string[] { ResultLog });
            }
            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelNumbers;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                string methodName = fr.GetMethod().ToString();
                thisMethod.ElementName = fr.GetMethod().Name;
                thisMethod.ReturnType = methodName.Substring(0, methodName.IndexOf(" "));
            }
            if (logLevel >= 2) // parameters
            {
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (OperatorID operatorID in allRelations)
                {
                    result += "{" + operatorID.ToString() + "}";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG
            return allRelations;
        }
示例#21
0
        List<int[]> IncludeA(List<int[]> simbA, List<int[]> simbB)
        {
                        System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            List<int[]> returnedIDs = new List<int[]>();
            //=// returnedIDs = serverAccess.IsTransitive(new List<int[]>(), Include, simbA[0], new int[] { 1, 0 }, simbB[0], new int[] { 1, 0 }, 10);
            if (returnedIDs.Count > 0 && (returnedIDs[0][0] != 0 && returnedIDs[0][1] != 0))
            {
                return returnedIDs;
            }
            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelRelations;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                thisMethod.ElementName = stackTrace.GetFrame(0).GetMethod().ToString().Replace(stackTrace.GetFrame(0).GetMethod().Name.ToString(), "<span style='color: red'>" + stackTrace.GetFrame(0).GetMethod().Name.ToString() + "</span>");
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "List<int[]> simbA", simbA.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (int[] rl in returnedIDs)
                {
                    result += "{" + ArrayToString(rl) + "}";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG
            return returnedIDs;
        }
示例#22
0
        /// <summary>
        /// Get the names of the given operatorIDs
        /// </summary>
        /// <param name="operatorID">OperatorIDs to look for</param>
        /// <param name="limitOfResults">Maximum capacity accepted for the result set</param>
        /// <returns>ResultSet: A List of the given operator`s names</returns>
        public List<string> GetOperatorNamesByID(OperatorID operatorID, int limitOfResults = 10)
        {
            // Start logging
            System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            // Prepare result set
            List<string> resultedOperatorNames = new List<string>();
            try
            {
                string commandString;
                commandString = "SELECT `En` FROM `" + DB + "`.`srel` WHERE `IR` = " + operatorID.Location.IR + " AND `Var` = " + operatorID.Location.Var + " AND `IR2` = " + operatorID.Location.IR2 + " AND `Var2` = " + operatorID.Location.Var2 + " ";
                if (limitOfResults != 0) { commandString += " Limit " + limitOfResults + " "; }
                MySql.Data.MySqlClient.MySqlCommand mySqlCommand = new MySqlCommand(commandString, mySQLConnection);
                if (MySqlTrace) SQLView.Log(mySqlCommand.CommandText);
                MySqlDataReader myReader = mySqlCommand.ExecuteReader();
                while (myReader.Read())
                {
                    if (!string.IsNullOrEmpty(myReader.GetString(0)))
                    {
                        string symbolName;
                        symbolName = myReader.GetString(0).ToString();
                        if (!string.IsNullOrEmpty(symbolName))
                        {
                            resultedOperatorNames.Add(symbolName);
                        }
                    }
                }
                myReader.Close();
            }
            catch (MySqlException retrieveSymbolIndexException)
            {
                Console.WriteLine("Error: {0}", retrieveSymbolIndexException.ToString());
            }
            if (MyResultsTrace)
            {
                string ResultLog = "";
                foreach (string i in resultedOperatorNames)
                {
                    ResultLog += "" + i + "";
                }
                SQLView.LogResult(new string[] { ResultLog });
            }
            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelNumbers;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                string methodName = fr.GetMethod().ToString();
                thisMethod.ElementName = fr.GetMethod().Name;
                thisMethod.ReturnType = methodName.Substring(0, methodName.IndexOf(" "));
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "int[] operatorID", operatorID.ToString() });
                thisMethod.Parameters.Add(new string[] { "int limitOfResults", limitOfResults.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (string symbolItem in resultedOperatorNames)
                {
                    result += "{" + symbolItem.ToString() + "}";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG
            return resultedOperatorNames;
        }
示例#23
0
        private List<RelationItem> createRelation(List<SymbolID> preop, List<OperatorID> res, List<SymbolID> postop)
        {
                        System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            List<int[]> resultIDs = new List<int[]>();
            List<RelationItem> sresult = new List<RelationItem>();
            //=// if (postop[0].Multiplicity[0] != 0 && postop[0].Multiplicity[1] == 0)
            {
                //res[0].ID[3] = postop[0].Multiplicity[0];
            }

            //=// resultIDs = serverAccess.CreateRelation(res[0].ID, preop[0].Multiplicity, preop[0].Location, postop[0].Multiplicity, postop[0].Location);
            foreach (int[] itemID in resultIDs)
            {
                int offset = itemID[6];
                int[] rel = new int[] { itemID[2], itemID[3] };
                int[] mul = new int[] { itemID[6], itemID[7] };
                int[] refA = new int[] { itemID[0], itemID[1] };
                int[] refB = new int[] { itemID[4], itemID[5] };
                //sresult.Add(new RelationItem(offset, rel, refA, refB, mul, string.Empty));
                //sresult.Add(new RelationItem(offset, rel, refA, refB, mul, string.Empty));
            }
            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelRelations;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                thisMethod.ElementName = stackTrace.GetFrame(0).GetMethod().ToString().Replace(stackTrace.GetFrame(0).GetMethod().Name.ToString(), "<span style='color: red'>" + stackTrace.GetFrame(0).GetMethod().Name.ToString() + "</span>");
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "List<SymbolID> preop", preop.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (RelationItem rl in sresult)
                {
                    result += "{" + rl.ToString() + "}";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG
            return sresult;
        }
示例#24
0
        /// <summary>
        /// Get operatorIDs from a partial operator name (according to search mode options).
        /// </summary>
        /// <param name="operatorNamePart">The partial name of the operator to find</param>
        /// <param name="searchMode">Search method</param>
        /// <param name="limitOfResults">Maximum capacity accepted for the result set</param>
        /// <returns>ResultSet: The existent operatorIDs associated with the operator name OR the new created operator if there was no operator and if the permissions are right</returns>
        public List<OperatorID> GetOperatorsByName(string operatorNamePart, int searchMode, int limitOfResults = 10)
        {
            // Start logging
            System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            // Prepare result set
            List<OperatorID> ResultedOperators = new List<OperatorID>();
            try
            {
                string commandString;
                switch (searchMode)
                {
                    case (int)SearchMode.ExactMatch: // strict
                        commandString = "SELECT `IR`, `Var`, `IR2`, `Var2` FROM `" + DB + "`.`srel` WHERE `En` LIKE '" + operatorNamePart + "' ";
                        break;
                    case (int)SearchMode.StartWith: //
                        commandString = "SELECT `IR`, `Var`, `IR2`, `Var2` FROM `" + DB + "`.`srel` WHERE `En` LIKE '" + operatorNamePart + "%' ";
                        break;
                    case (int)SearchMode.Containing: //
                        commandString = "SELECT `IR`, `Var`, `IR2`, `Var2` FROM `" + DB + "`.`srel` WHERE `En` LIKE '%" + operatorNamePart + "%' ";
                        break;
                    case (int)SearchMode.EndingWith: //
                        commandString = "SELECT `IR`, `Var`, `IR2`, `Var2` FROM `" + DB + "`.`srel` WHERE `En` LIKE '%" + operatorNamePart + "' ";
                        break;
                    default:
                        commandString = "SELECT `IR`, `Var`, `IR2`, `Var2` FROM `" + DB + "`.`srel` WHERE `En` LIKE '" + operatorNamePart + "' ";
                        break;
                }
                if (limitOfResults != 0) { commandString += " Limit " + limitOfResults + " "; }
                MySql.Data.MySqlClient.MySqlCommand mySqlCommand = new MySqlCommand(commandString, mySQLConnection);
                if (MySqlTrace) SQLView.Log(mySqlCommand.CommandText);
                TryToOpenConnection();
                MySqlDataReader myReader = mySqlCommand.ExecuteReader();
                while (myReader.Read())
                {
                    if (!string.IsNullOrEmpty(myReader.GetString(0)))
                    {
                        OperatorLocation relationID = new OperatorLocation();
                        int.TryParse(myReader.GetString(0), out relationID.IR);
                        int.TryParse(myReader.GetString(1), out relationID.Var);
                        int.TryParse(myReader.GetString(2), out relationID.IR2);
                        int.TryParse(myReader.GetString(3), out relationID.Var2);
                        if (relationID.IR != 0 || relationID.Var != 0)
                        {
                            ResultedOperators.Add(new OperatorID(relationID));
                        }
                    }
                }
                myReader.Close();
            }
            catch (MySqlException retrieveSymbolIndexException)
            {
                Console.WriteLine("Error: {0}", retrieveSymbolIndexException.ToString());
            }
            if (MyResultsTrace)
            {
                string ResultLog = "";
                foreach (OperatorID itemOperatorID in ResultedOperators)
                {
                    ResultLog += " [" + itemOperatorID.Location.IR + ":" + "0" + "]";
                }
                SQLView.LogResult(new string[] { ResultLog });
            }
            if (ResultedOperators.Count < 1 && searchMode == 0 && AcceptOperators)
            {
                // TODO FLORIN: Create expected Operator
                // ResultedOperators = CreateSymbolByName(OperatorNamePart, true); // set AcceptDuplicates to avoid other check for existence
            }
            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelNumbers;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                string methodName = fr.GetMethod().ToString();
                thisMethod.ElementName = fr.GetMethod().Name;
                thisMethod.ReturnType = methodName.Substring(0, methodName.IndexOf(" "));
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "string operatorNamePart", operatorNamePart.ToString() });
                thisMethod.Parameters.Add(new string[] { "int mode", searchMode.ToString() });
                thisMethod.Parameters.Add(new string[] { "int limitOfResults", limitOfResults.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (OperatorID itemOperatorID in ResultedOperators)
                {
                    result += "{" + itemOperatorID.Location.ToString() + "}";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG
            return ResultedOperators;
        }
示例#25
0
        /// <summary>
        /// Get the proprieties of a symbol restricted to a relation type if provided
        /// </summary>
        /// <param name="operatorID">The relation to restrict the resultset if provided</param>
        /// <param name="multiplicationOrder">the multiplication order requested if provided</param>
        /// <param name="symbolID">The symbolID to expore for properties</param>
        /// <param name="limitOfResults">>Maximum capacity accepted for the result set</param>
        /// <returns>ResultSet: The descriptopn of the given symbol restricted to the relation if provided</returns>
        public List<SymbolID> GetContent(OperatorID operatorID, SymbolID symbolID, int limitOfResults)
        {
            // TODO Use multiplicationOrder parameter

            // Start logging
            System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name;

            // Prepare result set
            List<SymbolID> resultedSymbolIDs = new List<SymbolID>();
            try
            {
                string commandString = string.Empty;
                if (operatorID.hasMultiplicity)
                {
                    commandString = "SELECT `e`, `f` FROM `" + DB + "`.`s" + symbolID.Location.A.ToString() + "` WHERE `a` = " + symbolID.Location.A + " AND `b` = " + symbolID.Location.B + " AND `c` = " + operatorID.Location.IR + " AND `d` = " + operatorID.Location.Var + " ";
                }
                else
                {
                    commandString = "SELECT `e`, `f` FROM `" + DB + "`.`s" + symbolID.Location.A.ToString() + "` WHERE `a` = " + symbolID.Location.A + " AND `b` = " + symbolID.Location.B + " AND `c` = " + operatorID.Location.IR +" AND `d` = " + operatorID.Location.Var + " ";
                //    commandString = "SELECT `e`, `f` FROM `" + DB + "`.`s" + symbolID.Location.A.ToString() + "` WHERE `a` = " + symbolID.Location.A + " AND `b` = " + symbolID.Location.B + " ";
                }
                if (limitOfResults != 0) { commandString += " Limit " + limitOfResults; }
                MySql.Data.MySqlClient.MySqlCommand mySqlCommand = new MySqlCommand(commandString, mySQLConnection);
                if (MySqlTrace) SQLView.Log(mySqlCommand.CommandText);
                MySqlDataReader myReader = mySqlCommand.ExecuteReader();
                while (myReader.Read())
                {
                    if (!string.IsNullOrEmpty(myReader.GetString(0)))
                    {
                        SymbolID newSymbolID = new SymbolID();
                        int.TryParse(myReader.GetString(0), out newSymbolID.Location.A);
                        try
                        {
                            int.TryParse(myReader.GetString(1), out newSymbolID.Location.B);
                        }
                        catch
                        {
                        }
                        //int.TryParse(myReader.GetString(2), out symbID[2]);
                        //int.TryParse(myReader.GetString(3), out symbID[3]);
                        if (newSymbolID.Exists)
                        {
                            resultedSymbolIDs.Add(newSymbolID);
                        }
                    }
                }
                myReader.Close();
            }
            catch (MySqlException retrieveSymbolIndexException)
            {
                Console.WriteLine("Error: {0}", retrieveSymbolIndexException.ToString());
            }
            if (MyResultsTrace)
            {
                string ResultLog = "";
                foreach (SymbolID itemSymbolID in resultedSymbolIDs)
                {
                    ResultLog += " [" + itemSymbolID.Location.A + ":" + itemSymbolID.Location.B + "]";
                }
                SQLView.LogResult(new string[] { ResultLog });
            }
            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelNumbers;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                string methodName = fr.GetMethod().ToString();
                thisMethod.ElementName = fr.GetMethod().Name;
                thisMethod.ReturnType = methodName.Substring(0, methodName.IndexOf(" "));
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "int[] relationID", operatorID.ToString() });
                thisMethod.Parameters.Add(new string[] { "int[] symbolID", symbolID.ToString() });
                thisMethod.Parameters.Add(new string[] { "int limitOfResults", limitOfResults.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (SymbolID itemSymbolID in resultedSymbolIDs)
                {
                    result += "{" + itemSymbolID.ToString() + "}";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG
            return resultedSymbolIDs;
        }
示例#26
0
        // +GetSymbolsByName(SymbolsNamePart : string = "", Method : int = 0, LimitOfResults : int = 10, ResultedSymbols : List<int[2]>)
        public List<int[]> GetSymbolsByName(string SymbolNamePart, int Mode, int LimitOfResults = 10)
        { 
            List<int[]> ResultedSymbols = new List<int[]>();
            try
            {
                string commandString;
                switch (Mode)
                {
                    case 0: // strict
                        commandString = "SELECT IR FROM " + OracleDB + ".SIMBS WHERE EN LIKE '" + SymbolNamePart + "' ";
                        break;
                    case 1: //
                        commandString = "SELECT IR FROM " + OracleDB + ".SIMBS WHERE EN LIKE '" + SymbolNamePart + "%' ";
                        break;
                    case 2: //
                        commandString = "SELECT IR FROM " + OracleDB + ".SIMBS WHERE EN LIKE '" + SymbolNamePart + "%' ";
                        break;
                    case 3: //
                        commandString = "SELECT IR FROM " + OracleDB + ".SIMBS WHERE EN LIKE '" + SymbolNamePart + "%' ";
                        break;
                    default:
                        commandString = "SELECT IR FROM " + OracleDB + ".SIMBS WHERE EN LIKE '" + SymbolNamePart + "' ";
                        break;
                }
                //if (LimitOfResults != 0) { commandString += " Limit " + LimitOfResults + " "; }
                OracleCommand OracleCommand = new OracleCommand(commandString, OracleConnection);
                OracleDataReader myReader = OracleCommand.ExecuteReader();
                if (OracleTrace) SQLView.Log(OracleCommand.CommandText);
                while (myReader.Read())
                {
                    if (!myReader.IsDBNull(0))
                    {
                        int[] symbolID = new int[] {0, 0, 0, 0};
                        //int.TryParse(myReader.GetString(0), out symbolID[0]);
                        symbolID[0] = (int)myReader.GetDecimal(0);
                        if (symbolID[0] != 0 || symbolID[1] != 0)
                        {
                            ResultedSymbols.Add(symbolID);
                        }
                    }
                myReader.Close();
                }
            }
            catch (OracleException retrieveSymbolIndexException)
            {
                Console.WriteLine("Error: {0}", retrieveSymbolIndexException.ToString());
            }
            if (MyResultsTrace)
            {
                string ResultLog = "";
                foreach (int[] i in ResultedSymbols)
                {
                    ResultLog += " [" + i[0] + ":" + "0" + "]";
                }
                SQLView.LogResult(new string[] { ResultLog });
            }
            if (ResultedSymbols.Count < 1 && Mode == 0 && AcceptSymbols)
            {
                List<int[]> CreatedSymbols = new List<int[]>();
                CreatedSymbols = CreateSymbolByName(SymbolNamePart, true); 
                ResultedSymbols = CreatedSymbols;
            }

            #region LOG
            //=== CUSTOM LOGGER===================================================================================
            ElementMethod thisMethod = new ElementMethod();
            int logLevel = logingOptions.levelNumbers;
            if (logLevel >= 3) // code
            {
                System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0);
                thisMethod.ElementNamespaceName = this.GetType().Namespace;
                thisMethod.ElementClassName = this.GetType().Name;
                thisMethod.ElementName = stackTrace.GetFrame(0).GetMethod().ToString().Replace(stackTrace.GetFrame(0).GetMethod().Name.ToString(), "<span style='color: red'>" + stackTrace.GetFrame(0).GetMethod().Name.ToString()+"</span>");
            }
            if (logLevel >= 2) // parameters
            {
                thisMethod.Parameters.Add(new string[] { "SymbolNamePart", SymbolNamePart.ToString() });
                thisMethod.Parameters.Add(new string[] { "Mode", Mode.ToString() });
                thisMethod.Parameters.Add(new string[] { "LimitOfResults", LimitOfResults.ToString() });
            }
            if (logLevel >= 1) // results
            {
                string result = string.Empty;
                foreach (int[] id in ResultedSymbols)
                {
                    result += "[";
                    string nrs = string.Empty;
                    foreach (int nr in id)
                    {
                        nrs += ":" + nr;
                    }
                    if (nrs.Length > 2)
                    {
                        result += nrs.Substring(1);
                    }
                    result += "]";
                }
                thisMethod.Result = result;
            }
            LoggingSystem.LogMethod = thisMethod;

            //====================================================================================================
            #endregion LOG

            return ResultedSymbols;
        }