예제 #1
0
        private void OnLogItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (this.LogElementsChanged == null)
            {
                return;
            }

            IEnumerable<ILogItem> newLogItems = e.NewItems.Cast<ILogItem>();
            NotifyLogElementsChangedEventArgs notifyLogElementsChangedEventArgs = new NotifyLogElementsChangedEventArgs(newLogItems);
            this.LogElementsChanged(this, notifyLogElementsChangedEventArgs);
        }
 private void UpdateLog(object sender, NotifyLogElementsChangedEventArgs e)
 {
     object[] logElements = e.ChangedLogElements.Select(delegate(ILogItem le) { return le.ToString(); }).ToArray<object>();
     this.logListBox.Items.AddRange(logElements);
 }