예제 #1
0
            public Task ApplyAsync(IDocumentSession session, EventPage page, CancellationToken token)
            {
                foreach (var pageEvent in page.Events)
                {
                    Observed.Add(pageEvent.Sequence);
                }

                return(Task.CompletedTask);
            }
            public Task ApplyAsync(IDocumentSession session, IReadOnlyList <StreamAction> streams, CancellationToken cancellation)
            {
                foreach (var pageEvent in streams.SelectMany(x => x.Events))
                {
                    Observed.Add(pageEvent.Sequence);
                }

                return(Task.CompletedTask);
            }
예제 #3
0
        private void AddNode(NodeInfoCollection c, NodeInfo parent, MemberInfo mi, object instance)
        {
            // FIXME: there has to be a cleaner way than this...
            // Don't add node if we don't want to display them.
            bool quit = false;

            switch (mi.MemberType)
            {
            case MemberTypes.Constructor:
                quit = !ShowConstructors;
                break;

            case MemberTypes.Event:
                quit = !ShowEvents;
                break;

            case MemberTypes.Field:
                quit = !ShowFields;
                break;

            case MemberTypes.Method:
                quit = !ShowMethods;
                break;

            case MemberTypes.Property:
                quit = !ShowProperties;
                break;

            case MemberTypes.TypeInfo:
                // either a Base type or an Interface
                // this is bound to produce buggy behavior...
                quit = !ShowBase && !ShowInterfaces;
                break;

                // case MemberTypes.NestedType
                // we don't break out nested types yet
            }

            if (quit)
            {
                return;
            }

            if (!seenReflectionObjects.Found(mi))
            {
                seenReflectionObjects.Add(mi);
                NodeInfo n = new NodeInfo(parent, mi, instance);
                c.Add(n);
            }
            else
            {
                NodeInfo n = new NodeInfo(parent, "Seen: " + mi.ToString());
                n.NodeType = NodeTypes.Alias;
                c.Add(n);
            }
        }
예제 #4
0
파일: HMM.cs 프로젝트: weiguang3100/iveely
 /// <summary>
 /// 添加观察序列
 /// </summary>
 /// <param name="observer"> </param>
 public void AddObserver(string observer)
 {
     Observed.Add(observer);
 }