예제 #1
0
        public void Add(Program prog, Program.LogEntry entry)
        {
            ProgramList.ID id = entry.mID;

            Tuple <Program, List <Program.LogEntry> > list;

            if (!mEvents.TryGetValue(id, out list))
            {
                list = new Tuple <Program, List <Program.LogEntry> >(prog, new List <Program.LogEntry>());
                mEvents.Add(id, list);
                mEventList.Add(id);
            }

            list.Item2.Add(entry);

            if (curIndex >= mEventList.Count)
            {
                curIndex = mEventList.Count - 1;
            }

            UpdateIndex();

            int index = mEventList.FindIndex((x) => { return(id.CompareTo(x) == 0); });

            if (curIndex == index)
            {
                LoadCurrent();
            }
        }
예제 #2
0
 internal void Update(Program.LogEntry new_args)
 {
     if (entry.Update(new_args))
     {
         NotifyPropertyChanged("DestAddress");
     }
     // The rest can't change
 }
예제 #3
0
 public void NotifyActivity(Guid guid, Program.LogEntry entry)
 {
     Application.Current.Dispatcher.BeginInvoke(new Action(() => {
         ActivityNotification?.Invoke(this, new Firewall.NotifyArgs()
         {
             guid = guid, entry = entry
         });
     }));
 }
예제 #4
0
            public LogItem(Program.LogEntry entry, string name)
            {
                this.entry = entry;
                this.name  = name != null ? name : "[unknown progream]";

                this.IsLocal = NetFunc.IsLocalHost(entry.FwEvent.RemoteAddress);
                this.IsMulti = NetFunc.IsMultiCast(entry.FwEvent.RemoteAddress);
                this.IsLan   = FirewallRule.MatchAddress(entry.FwEvent.RemoteAddress, FirewallRule.AddrKeywordLocalSubnet);
            }
예제 #5
0
        public void Add(Program prog, Program.LogEntry entry)
        {
            ProgramList.ID id = entry.mID;

            Tuple <Program, List <Program.LogEntry> > list;

            if (!mEvents.TryGetValue(id, out list))
            {
                list = new Tuple <Program, List <Program.LogEntry> >(prog, new List <Program.LogEntry>());
                mEvents.Add(id, list);
                mEventList.Add(id);
            }

            list.Item2.Add(entry);

            int oldIndex = curIndex;

            if (curIndex < 0)
            {
                curIndex = 0;
            }
            else if (curIndex >= mEventList.Count)
            {
                curIndex = mEventList.Count - 1;
            }

            UpdateIndex();

            // don't update if the event is for a different entry
            int index = mEventList.FindIndex((x) => { return(id.CompareTo(x) == 0); });

            if (curIndex != index)
            {
                return;
            }

            LoadCurrent(oldIndex == curIndex);
        }
예제 #6
0
 public ConEntry(Program.LogEntry entry)
 {
     Entry = entry;
 }
예제 #7
0
 public void NotifyActivity(Guid guid, Program.LogEntry entry)
 {
     SendPushNotification("ActivityNotification", new object[] { guid, entry });
 }
예제 #8
0
 public LogItem(Program.LogEntry entry, string name)
 {
     this.entry = entry;
     this.name  = name != null ? name : "[unknown progream]";
 }