Exemple #1
0
 public void AddCodeInfo(CodeInfo codeInfo)
 {
     lock (_codeInfos)
     {
         int capacity = 1;
         if (_codeInfos != null)
         {
             capacity = _codeInfos.Length + 1;
         }
         CodeInfo[] tmp = new CodeInfo[capacity];
         if (_codeInfos != null)
         {
             _codeInfos.CopyTo(tmp, 0);
         }
         tmp[capacity - 1] = codeInfo;
         _codeInfos        = tmp;
     }
 }
Exemple #2
0
        internal bool TrySetCode(object item)
        {
            bool result = false;
            code code   = item as code;

            if (code != null)
            {
                result = true;
                StringBuilder txt = new StringBuilder();
                code.Text.Each(s =>
                {
                    txt.Append(s);
                });

                CodeInfo info = new CodeInfo();
                info.Code     = txt.ToString();
                info.Language = code.language;
            }

            return(result);
        }