Exemplo n.º 1
0
 public void LoadWithOldDict(Dictionary <string, string> OldDict)
 {
     if (string.IsNullOrEmpty(VariableNameWithoutNum) == false &&
         OldDict.TryGetValue(VariableNameWithoutNum, out string outvalue) &&
         string.IsNullOrEmpty(outvalue) == false)
     {
         oldeng = YMLTools.RegexGetValue(outvalue);
     }
     else
     {
         oldeng = string.Empty;
     }
 }
Exemplo n.º 2
0
 public YML(string LineTo) : this()
 {
     LineCHN                = LineTo;
     LineENG                = string.Empty;
     variablename           = YMLTools.RegexGetName(LineTo);
     variablenamewithoutnum = YMLTools.RegexGetNameOnly(variablename);
     vchn = YMLTools.RegexGetValue(LineTo);
     if (HasError())
     {
         FixError();
     }
     oldeng = string.Empty;
 }
Exemplo n.º 3
0
 public bool IsAllQoute(string text)
 {
     if (text != "")
     {
         text = YMLTools.RemoveSpace(text);
         if (text.Length > 0)
         {
             char fst = text[0];
             char end = text[text.Length - 1];
             if (fst == '$' && end == '$')
             {
                 return(true);
             }
             if (fst == '[' && end == ']')
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Exemplo n.º 4
0
        public YML(string LineFrom, Dictionary <string, string> DictForTo) : this()
        {
            LineENG                = LineFrom;
            variablename           = YMLTools.RegexGetName(LineFrom);
            variablenamewithoutnum = YMLTools.RegexGetNameOnly(variablename);
            veng = YMLTools.RegexGetValue(LineFrom);

            if (string.IsNullOrEmpty(VariableNameWithoutNum) == false &&
                DictForTo.TryGetValue(VariableNameWithoutNum, out string outvalue) &&
                string.IsNullOrEmpty(outvalue) == false)
            {
                LineCHN = outvalue;
            }
            else
            {
                LineCHN = LineFrom;
            }

            if (HasError())
            {
                FixError();
            }
            oldeng = string.Empty;
        }
Exemplo n.º 5
0
 public bool OldNewisDifferent()
 {
     return(YMLTools.RemoveSpace(oldeng) != YMLTools.RemoveSpace(veng));
 }
Exemplo n.º 6
0
 private string TestComment()
 {
     return(YMLTools.RegexGetName(LineCHN) + "\"" + YMLTools.RegexGetValue(LineCHN) + "\"");
 }
Exemplo n.º 7
0
 public bool IsEditable()
 {
     return((IsSpaceLine() || YMLTools.RemoveSpace(LineCHN) == "l_english:" || IsComment()) == false);
 }
Exemplo n.º 8
0
 private bool IsComment()
 {
     return(YMLTools.RemoveSpace(LineCHN).Length > 0 && YMLTools.RemoveSpace(LineCHN)[0] == '#');
 }