コード例 #1
0
ファイル: PacketParser.cs プロジェクト: kkhrebtov/MyEnkTests
        public static List <OpenSpanClose> GetAllCloseEvents(string pathToDecryptedPacket)
        {
            var          CloseEventsStore = new List <OpenSpanClose>();
            const string nameTag          = "event-dump";
            const string eventCategory    = "WorkUnitStateChange:Close";

            var content = SystemSettings.GetContentOfXml(pathToDecryptedPacket);

            var listTags = content.GetElementsByTagName(nameTag);

            foreach (XmlElement tag in listTags)
            {
                if (tag.GetAttribute("category") == eventCategory)
                {
                    var tempClose = new OpenSpanClose();
                    tempClose.trigger = tag.GetAttribute("trigger");
                    if (tag.ChildNodes[0] != null)
                    {
                        //TODO: Looks suspicious, XPath would be better solution
                        tempClose.application_id = tag.ChildNodes[0].Attributes[1].Value;
                    }

                    CloseEventsStore.Add(tempClose);
                }
            }

            return(CloseEventsStore);
        }
コード例 #2
0
ファイル: PacketParser.cs プロジェクト: kkhrebtov/MyEnkTests
        public static List <OpenSpanClose> GetAllScreen_7_DestroyEvents(string pathToDecryptedPacket)
        {
            Console.WriteLine("Execute GetAllScreen_7_DestroyEvents");
            var          CloseEventsStore = new List <OpenSpanClose>();
            const string nameTag          = "event-dump";
            const string eventCategory    = "screen_7_destroying";

            var content = SystemSettings.GetContentOfXml(pathToDecryptedPacket);

            var listTags = content.GetElementsByTagName(nameTag);

            foreach (XmlElement tag in listTags)
            {
                if (tag.GetAttribute("category") == eventCategory)
                {
                    var tempClose = new OpenSpanClose();
                    tempClose.trigger = tag.GetAttribute("trigger");
                    if (tag.ChildNodes[0] != null)
                    {
                        //TODO: Looks suspicious, XPath would be better solution
                        tempClose.document_id           = tag.ChildNodes[0].Attributes[1].Value;
                        tempClose.pend_reason_code      = tag.ChildNodes[3].Attributes[1].Value;
                        tempClose.work_unit_status_code = tag.ChildNodes[1].Attributes[1].Value;
                    }

                    CloseEventsStore.Add(tempClose);
                }
            }

            return(CloseEventsStore);
        }