Exemple #1
0
        public static sMessage ValueOf(string msgStr)
        {
            sMessage      msg      = new sMessage();
            List <string> contents = new List <string> (msgStr.Split('\n'));

            if (contents [0].StartsWith("//"))
            {
                msg.nameCn = contents [0].Replace("//", string.Empty).Trim();
                contents.RemoveAt(0);
            }
            if (contents [0].StartsWith("message"))
            {
                msg.nameEn = Regex.Matches(contents [0], "[^ ].\\w+[^ ]", RegexOptions.Multiline) [1].Value;
                contents.RemoveAt(0);
            }
            for (int i = 0; i < contents.Count; i++)
            {
                if (contents [i].Trim().Length == 1 || contents [i].Trim().StartsWith("//"))
                {
                    continue;
                }
                msg.varList.Add(sVariable.ValueOf(contents[i]));
            }
            return(msg);
        }
Exemple #2
0
 public ProtoTreeViewItem(sModel model, sCommand command, sMessage message)
 {
     Type             = eType.message;
     this._model      = model;
     this._command    = command;
     this._message    = message;
     this.id          = int.Parse(message.modelId) * 10000 + int.Parse(message.commandId) * 100 + int.Parse(message.id);
     this.depth       = 2;
     this.displayName = message.nameEn;
 }
Exemple #3
0
        public void CollectMsgDependent(sMessage scrMsg, List <sMessage> destMsgList)
        {
            List <string> msgDependentList = scrMsg.GetTypeDependent();

            for (int i = 0; i < msgDependentList.Count; i++)
            {
                sMessage msg = commonMsgList.Find(a => a.nameEn.Equals(msgDependentList[i]));
                if (msg != null)
                {
                    CollectMsgDependent(msg, destMsgList);
                    if (!destMsgList.Exists(a => a.nameEn.Equals(msg.nameEn)))
                    {
                        destMsgList.Add(msg);
                    }
                }
            }
        }