コード例 #1
0
        public static string ToJson(ExtendOperator extendOperator, bool indented = false)
        {
            var jset = new JsonSerializerSettings()
            {
                TypeNameHandling = TypeNameHandling.All
            };
            string json = JsonConvert.SerializeObject(extendOperator, Formatting.Indented, jset);

            return(json);
        }
コード例 #2
0
        public static ExtendOperator ToExtendOperator(string args)
        {
            var jset = new JsonSerializerSettings()
            {
                TypeNameHandling = TypeNameHandling.All
            };
            ExtendOperator extendOperator = (ExtendOperator)JsonConvert.DeserializeObject(args, jset);

            return(extendOperator);
        }
コード例 #3
0
        public static IObservable <IDictionary <string, object> > Extend(this IObservable <IDictionary <string, object> > source, string expression)
        {
            var extend = new ExtendOperator(expression);

            return(Observable.Create <IDictionary <string, object> >(
                       observer => source.Subscribe(e =>
            {
                try
                {
                    var r = extend.Extend(e);
                    observer.OnNext(r);
                }
                catch (Exception ex)
                {
                    RxKqlEventSource.Log.LogException(ex.ToString());
                    observer.OnError(ex);
                }
            })));
        }