Пример #1
0
        public static ListViewItem AsListViewItem(this NetHookItem item)
        {
            var lvi = new ListViewItem(item.Name)
            {
                Tag = item
            };

            lvi.SubItems.Add(new ListViewItem.ListViewSubItem
            {
                Name = "#",
                Text = item.Sequence.ToString(),
            });

            lvi.SubItems.Add(new ListViewItem.ListViewSubItem
            {
                Name = "Direction",
                Text = item.Direction.ToString().ToLowerInvariant(),
            });

            lvi.SubItems.Add(new ListViewItem.ListViewSubItem
            {
                Name = "Message",
                Text = item.Name,
            });

            lvi.SubItems.Add(new ListViewItem.ListViewSubItem
            {
                Name = "Inner Message",
                Text = item.InnerMessageName,
            });

            return(lvi);
        }
Пример #2
0
 TreeNode BuildTree(NetHookItem item)
 {
     return(new NetHookItemTreeBuilder(item)
     {
         Specializations = specializations
     }.BuildTree());
 }
Пример #3
0
 TreeNode BuildTree(NetHookItem item)
 {
     return(new NetHookItemTreeBuilder(item)
     {
         Specializations = specializations
     }.BuildTree(showAllCheckBox.Checked));
 }
Пример #4
0
        public NetHookItem AddItemFromPath(string path)
        {
            var fileInfo = new FileInfo(path);
            var item     = new NetHookItem();

            if (!item.LoadFromFile(fileInfo))
            {
                return(null);
            }

            items.Add(item);
            return(item);
        }
Пример #5
0
        public void LoadFromDirectory(string directory)
        {
            items.Clear();

            var directoryInfo = new DirectoryInfo(directory);
            var itemFiles     = directoryInfo.EnumerateFiles("*.bin", SearchOption.TopDirectoryOnly);

            foreach (var itemFile in itemFiles)
            {
                var item = new NetHookItem();
                if (item.LoadFromFile(itemFile))
                {
                    items.Add(item);
                }
            }
        }
Пример #6
0
        public static ListViewItem AsListViewItem(this NetHookItem item)
        {
            var lvi = new ListViewItem(item.EMsg.ToString())
            {
                Tag = item
            };

            lvi.SubItems.Add(new ListViewItem.ListViewSubItem
            {
                Name = "#",
                Text = item.Sequence.ToString(),
            });

            lvi.SubItems.Add(new ListViewItem.ListViewSubItem
            {
                Name = "Timestamp",
                Text = item.Timestamp.ToString(CultureInfo.CurrentUICulture),
            });

            lvi.SubItems.Add(new ListViewItem.ListViewSubItem
            {
                Name = "Direction",
                Text = item.Direction.ToString().ToLowerInvariant(),
            });

            lvi.SubItems.Add(new ListViewItem.ListViewSubItem
            {
                Name = "Message",
                Text = item.EMsg.ToString(),
            });

            lvi.SubItems.Add(new ListViewItem.ListViewSubItem
            {
                Name = "Inner Message",
                Text = item.InnerMessageName,
            });

            return(lvi);
        }
Пример #7
0
 public NetHookItemTreeBuilder(NetHookItem item)
 {
     this.item = item;
 }
Пример #8
0
 public static TreeNode BuildTree(this NetHookItem item)
 {
     return(new NetHookItemTreeBuilder(item).BuildTree());
 }