Пример #1
0
        public void Parse(object obj, AssemblyClassInfo assemblyClassInfo, MainForm mainForm)
        {
            mainForm.ClearDataGrid();
            if (obj == null)
            {
                return;
            }
            Type t = obj.GetType();

            foreach (var item in t.GetProperties())
            {
                mainForm.SetDataGridValue(item);
            }
            return;
        }
Пример #2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            LogManager.inst.Init(this);

            PathExt.InitPath();
            InitXml();
            LoadXml();
            if (bIsAssembly)
            {
                if (ParseInit())
                {
                    msgApi = new AssemblyProtoMsg();
                }
            }
            else
            {
                msgApi = new ProtoMsg();
            }
            if (msgApi == null)
            {
                Log.ErrorLine("msgApi is null");
                return;
            }
            msgApi.BindMsgId();
            msgApi.BindParser();
            Connect();

            AssemblyHandler handler;
            AssemblyResult  result;

            AssemblyParser.GetAsseblyResult(out handler, out result);
            if (result == null)
            {
                Log.ErrorLine("AssemblyResult is null");
            }
            foreach (var item in result.ClassList)
            {
                if (item.Value.Contains("Message") && item.Key.Contains("MSG_CG"))
                {
                    AssemblyClassInfo classInfo = handler.GetClassInfo(ConstData.ClientMsgDll, item.Value);
                    list.Add(classInfo.ClassName, classInfo);
                    comboBox2.Items.Add(classInfo.ClassName);
                }
            }
        }