private IEnumerable<Event> SelectLines(EventPattern<EntryWrittenEventArgs> arg)
    {
        dynamic ev = new Event(Type, Alias, arg.EventArgs.Entry.TimeGenerated);

        ev.Message = arg.EventArgs.Entry.Message;
        yield return ev;
    }
Example #2
0
 IEnumerable<Event> ParserText(EventPattern<StrEventArgs> e)
 {
    
     Event item=new Event();
     item.SetMember("str", e.EventArgs.Text);
     return new List<Event>() { item };
 }
Example #3
0
        protected virtual void OnNext(EventPattern<FileSystemEventArgs> newFileEvent)
        {
            var fullPath = newFileEvent.EventArgs.FullPath;

            RetryScheduler.Schedule(0, TimeSpan.Zero, (state, recurse) =>
                {
                    Stream stream;
                    try
                    {
                        stream = File.OpenRead(fullPath);
                    }
                    catch (Exception ex)
                    {
                        Interlocked.Increment(ref state);
                        if (state < RetryCount)
                        {
                            recurse(state, Interval);
                            return;
                        }
                        fileHandler.ReportError(fullPath, ex);
                        return;
                    }
                    try
                    {
                        fileHandler.ProcessFile(fullPath, stream);
                    }
                    catch (Exception ex)
                    {
                        fileHandler.ReportError(fullPath, ex);
                    }
                    finally
                    {
                        stream.Dispose();
                    }
                });
        }
Example #4
0
        IEnumerable<FileSystemEventArgs> GetDirectoryChangedEventArgs(
            EventPattern<RenamedEventArgs> eventPattern, bool bubble, string rootPath)
        {
            return GetDirectoryChangedEventArgs(
                new EventPattern<FileSystemEventArgs>(eventPattern.Sender, eventPattern.EventArgs),
                bubble, rootPath);

            // bubble to parents
        }
Example #5
0
 private void OnDataContextPropertyChanged(PChartView instance, EventPattern<PropertyChangedEventArgs> handler)
 {
     if (handler.EventArgs.PropertyName.Contains("Show"))
         UpdateDataPointTemplates(instance);
     if (handler.EventArgs.PropertyName == "AverageLimits")
         UpdateControlLimits(instance.DataContext as ChartBase);
 }
Example #6
0
        IEnumerable<FileSystemEventArgs> GetDirectoryChangedEventArgs(
            EventPattern<FileSystemEventArgs> eventPattern, bool bubble, string rootPath)
        {
            yield return eventPattern.EventArgs;

            if (!bubble) yield break;

            // bubble to parents
            foreach (var directory in  _fileSystemInfoProvider
                .GetParentDirectories(eventPattern.EventArgs.FullPath))
            {
                var parentDirectory = Path.GetDirectoryName(directory);
                if (parentDirectory != null)
                    yield return new FileSystemEventArgs(
                        WatcherChangeTypes.Changed,
                        parentDirectory,
                        Path.GetFileName(directory) + "\\");

                if (rootPath.Length > directory.Length) yield break;
            }
        }
 private void UpdatePoints(HistogramChartView instance, EventPattern<PropertyChangedEventArgs> handler)
 {
     if (((ChartBase)instance.DataContext).DataSource.Count > 0)
     {
         if (handler.EventArgs.PropertyName == "LSL")
         {
             instance.LslData = PerSampleControlLimitsHelper.BuildHistogramControlLimit(((ChartBase)instance.DataContext).ParentPanel.LSL);
             OnPropertyChanged("LslData");
         }
         if (handler.EventArgs.PropertyName == "USL")
         {
             instance.UslData = PerSampleControlLimitsHelper.BuildHistogramControlLimit(((ChartBase)instance.DataContext).ParentPanel.USL);
             OnPropertyChanged("UslData");    
         }
         if (handler.EventArgs.PropertyName.Contains("Show"))
             OnPropertyChanged("ShowSpecsCheckbox");
     }
 }
 private void OnDataContextPropertyChanged(HistogramChartView instance, EventPattern<PropertyChangedEventArgs> handler)
 {
     if (handler.EventArgs.PropertyName == "DataSource")
         AdjustLabelsAndTicks(instance.HistogramChart, (ChartBase) DataContext);
     if (handler.EventArgs.PropertyName == "BellCurveData")
         OnPropertyChanged("BellCurvePeak");
 }
 void PerformOnDispatcher(EventPattern<KeyEventArgs> eventPattern)
 {
     //Dispatcher.BeginInvoke(DispatcherPriority.Background,new Action(()=>PerfromAction(eventPattern.EventArgs)));
 }
        public void PriceChanged(EventPattern<PriceChangedEventArgs> e)
        {
            var displayRate = DisplayStockPrices.First(
                rate => rate.Symbol == e.EventArgs.Price.Symbol);

            if (displayRate != null)
                displayRate.Update(e.EventArgs.Price);
        }
 private void FieldFilterEditorCreatedHandler(EventPattern<EditorCreatedEventArgs> args){
     var column = args.EventArgs.Column;
     var editor = args.EventArgs.Editor;
     IsPopupOpen.OnNext(true);
     TracePopupCreationValues(MethodBase.GetCurrentMethod()
         .Name);
     CustomFilterInstance.FilterEditor = editor;
 }
Example #12
0
        private void UpdatePoints(RunChartView instance, EventPattern<PropertyChangedEventArgs> handler)
        {
            if (((ChartBase)DataContext).DataSource.Count > 0)
            {
                if (handler.EventArgs.PropertyName == "USL" || handler.EventArgs.PropertyName == "LSL")
                    UpdateDataPointTemplates(instance);

                if (handler.EventArgs.PropertyName.Contains("Show"))
                    OnPropertyChanged("ShowSpecsCheckbox");
            }
        }
Example #13
0
 private static string PathFromEventArgs(EventPattern<object> a)
 {
     return Path.GetFullPath(((FileSystemEventArgs)a.EventArgs).FullPath);
 }
Example #14
0
 private static ZeroconfRecord ProcessMessage(EventPattern<DatagramSocketMessageReceivedEventArgs> eventPattern)
 {
     var dr = eventPattern.EventArgs.GetDataReader();
     var byteCount = dr.UnconsumedBufferLength;
     Debug.WriteLine("IP: {0} Bytes:{1}", eventPattern.EventArgs.RemoteAddress.DisplayName, byteCount);
     var msg = ReadDnsMessage(dr);
     return DnsToZeroconf(msg);
 }
 private static void OnComboBoxSelectionChanged(ProcessFilterDetailsView target, EventPattern<SelectionChangedEventArgs> handler)
 {
     OnComboBoxSelectionChanged(handler.Sender, handler.EventArgs);
 }
 private static void Static(DataCollectProcessViewConfigurator target, EventPattern<NotifyCollectionChangedEventArgs> handler)
 {
     target.RaiseConfigurationChanged();
 }
 private void UpdateAvailability(EventPattern<PropertyChangedEventArgs> ev)
 {
     Execute.OnUIThread(() => context.Message.UpdateAvailability());
 }
Example #18
0
        private void OnAddNativeBehavior(RunChartView currentControl, EventPattern<EventArgs> eventPattern)
        {
            Dispatcher.BeginInvoke(() =>
            {
                var nativeBehavior = ((TrackballBehavior)eventPattern.Sender);

                Observable.FromEventPattern<EventHandler<TrackBallInfoEventArgs>, TrackBallInfoEventArgs>(
                    handler => nativeBehavior.TrackInfoUpdated += handler,
                    handler => nativeBehavior.TrackInfoUpdated -= handler
                ).SubscribeWeakly(this, (target, handler) => target.ChartTrackBallBehavior_TrackInfoUpdated(handler.Sender, handler.EventArgs));

                try
                {
                    currentControl.RunChart.Behaviors.Add(nativeBehavior);
                    nativeBehavior.Parents.Add(currentControl.RunChart);
                }
                catch (InvalidOperationException){}
            });

            _isObsolete = true;
        }
Example #19
0
 private static void OnComboBoxSelectionChanged(FilterSetupView target, EventPattern<SelectionChangedEventArgs> handler)
 {
     target.ComboBoxOnSelectionChanged(handler.Sender, handler.EventArgs);
 }
Example #20
0
 private void OnDataContextPropertyChanged(RunChartView instance, EventPattern<PropertyChangedEventArgs> handler)
 {
     if (handler.EventArgs.PropertyName.Contains("Show"))
         UpdateDataPointTemplates(instance);
 }
Example #21
0
        /// <summary>
        /// Obtain the track history parameters from the labels.
        /// </summary>
        /// <param name="e"></param>
        private void ProcessLabels(EventPattern<LabelChangedEventArgs> e)
        {
            var label = e.EventArgs.Label;

            if (!(string.IsNullOrEmpty(label) 
                || label.StartsWith("Data." + Model.Id) 
                || string.Equals(label, "UserIdentity", StringComparison.InvariantCultureIgnoreCase))) return;
            UpdateInfoFromLabels();
        }
        public void PriceUpdate(EventPattern<PriceUpdateEventArgs> e)
        {
            var displayRate = DisplayFxRates.First(rate => rate.Ccy == e.EventArgs.LatestPrice.Ccy);

            if (displayRate != null)
              displayRate.Update(e.EventArgs.LatestPrice);
        }
Example #23
0
        private void OnNextItemChange(EventPattern<NotifyCollectionChangedEventArgs> eventData)
        {
            var children = (ITemplatedList<IElement>)this.ItemsPanel.Children;
            switch (eventData.EventArgs.Action)
            {
                case NotifyCollectionChangedAction.Add:
                    foreach (object newItem in eventData.EventArgs.NewItems)
                    {
                        children.Add(newItem, this.ItemTemplate);
                    }

                    break;
                case NotifyCollectionChangedAction.Remove:
                    {
                        int startingIndex = eventData.EventArgs.OldStartingIndex;
                        for (int index = startingIndex;
                             index < startingIndex + eventData.EventArgs.OldItems.Count;
                             index++)
                        {
                            children.RemoveAt(index);
                        }

                        break;
                    }

                case NotifyCollectionChangedAction.Replace:
                    {
                        int startingIndex = eventData.EventArgs.NewStartingIndex;

                        foreach (object newItem in eventData.EventArgs.NewItems)
                        {
                            this.ItemsPanel.Children.RemoveAt(startingIndex);
                            children.Insert(startingIndex, newItem, this.ItemTemplate);
                            startingIndex++;
                        }

                        break;
                    }

#if !WINDOWS_PHONE
                case NotifyCollectionChangedAction.Move:
                    children.Move(eventData.EventArgs.OldStartingIndex, eventData.EventArgs.NewStartingIndex);

                    break;
#endif
                case NotifyCollectionChangedAction.Reset:
                    this.PopulatePanelFromItemsSource();
                    break;
            }
        }