예제 #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;
     }
 }
예제 #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;
 }
예제 #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);
 }
예제 #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;
        }
예제 #5
0
 public bool OldNewisDifferent()
 {
     return(YMLTools.RemoveSpace(oldeng) != YMLTools.RemoveSpace(veng));
 }
예제 #6
0
 private string TestComment()
 {
     return(YMLTools.RegexGetName(LineCHN) + "\"" + YMLTools.RegexGetValue(LineCHN) + "\"");
 }
예제 #7
0
 public bool IsEditable()
 {
     return((IsSpaceLine() || YMLTools.RemoveSpace(LineCHN) == "l_english:" || IsComment()) == false);
 }
예제 #8
0
 private bool IsComment()
 {
     return(YMLTools.RemoveSpace(LineCHN).Length > 0 && YMLTools.RemoveSpace(LineCHN)[0] == '#');
 }