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); }
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 ); }