예제 #1
0
        public PacketItem(string fileName, PacketItemNameEnhance nameEnhance)
        {
            Match m = NameRegex.Match(fileName);

            if (!m.Success)
            {
                IsValid = false;
                return;
            }

            this.FileName = fileName;

            this.PacketNum = Convert.ToInt32(m.Groups["num"].Value);
            this.Direction = m.Groups["direction"].Value;
            this.EMsg      = Convert.ToInt32(m.Groups["emsg"].Value);
            this.Name      = m.Groups["name"].Value;

            if (nameEnhance != null)
            {
                var emsg = (SteamKit2.EMsg)EMsg;
                this.Name = nameEnhance(emsg, this.Name, fileName);
            }

            this.IsValid = true;

            this.Text = this.PacketNum.ToString();
            this.SubItems.Add(this.Direction);
            this.SubItems.Add(this.Name);
        }
예제 #2
0
파일: Packet.cs 프로젝트: JustHev/SteamKit
        public PacketItem( string fileName, PacketItemNameEnhance nameEnhance )
        {
            Match m = NameRegex.Match( fileName );

            if ( !m.Success )
            {
                IsValid = false;
                return;
            }

            this.FileName = fileName;

            this.PacketNum = Convert.ToInt32( m.Groups[ "num" ].Value );
            this.Direction = m.Groups[ "direction" ].Value;
            this.EMsg = Convert.ToInt32( m.Groups[ "emsg" ].Value );
            this.Name = m.Groups[ "name" ].Value;

            if ( nameEnhance != null )
            {
                var emsg = (SteamKit2.EMsg)EMsg;
                this.Name = nameEnhance( emsg, this.Name, fileName );
            }

            this.IsValid = true;

            this.Text = this.PacketNum.ToString();
            this.SubItems.Add( this.Direction );
            this.SubItems.Add( this.Name );
        }