当前位置: 首页>>代码示例>>C#>>正文


C# Emitter.Emit方法代码示例

本文整理汇总了C#中Emitter.Emit方法的典型用法代码示例。如果您正苦于以下问题:C# Emitter.Emit方法的具体用法?C# Emitter.Emit怎么用?C# Emitter.Emit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Emitter的用法示例。


在下文中一共展示了Emitter.Emit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestHostedInstance

 public void TestHostedInstance()
 {
     var r = GetRealSink();
     var emitter = new Emitter(r);
     var evt = CreateIdSrvEvent(DateTimeOffset.UtcNow);
     emitter.Emit(evt);
 }
开发者ID:Xamarui,项目名称:IdentityServer3.Contrib.ElasticSearchEventService,代码行数:7,代码来源:EmitterTests.cs

示例2: Map

 public void Map(IDictionary<string, object> document, Emitter emitter)
 {
     bool vacant = (bool)document.Get("vacant");
     string name = (string)document.Get("name");
     if (vacant && name != null)
     {
         emitter.Emit(name, vacant);
     }
 }
开发者ID:jonlipsky,项目名称:couchbase-lite-net,代码行数:9,代码来源:Test12_IndexView.cs

示例3: Map

 public void Map(IDictionary<string, object> document, Emitter emitter)
 {
     if (Profile.DocType.Equals(document.Get("type")))
     {
         if (ignoreUserId == null || (ignoreUserId != null && !ignoreUserId.Equals(document
             .Get("user_id"))))
         {
             emitter.Emit(document.Get("name"), document);
         }
     }
 }
开发者ID:jonlipsky,项目名称:couchbase-lite-net,代码行数:11,代码来源:Profile.cs

示例4: Off

        public void Off()
        {
            var log = LogManager.GetLogger(Global.CallerName());
            log.Info("Start");

            var emitter = new Emitter();
            var calls = new List<object>();

            var listener3 = new TestListener3(calls);
            emitter.On("foo", listener3);

            var listener4 = new TestListener4(calls);
            emitter.On("foo", listener4);
            emitter.Off("foo", listener4);

            emitter.Emit("foo");

            var expected = new Object[] {"one"};
            CollectionAssert.AreEqual(expected, calls.ToArray());
        }
开发者ID:mattleibow,项目名称:EngineIoClientDotNet,代码行数:20,代码来源:EmitterTests.cs

示例5: TestTimedRemoval

        public void TestTimedRemoval()
        {
            Emitter emitter = new Emitter();
            emitter.RemovalEvent = Emitter.RemovalEventType.Timed;
            emitter.SecondsLasting = 1000;

            SpriteList sprites = new SpriteList(); ;
            emitter.Emit(sprites);
            SpriteManager.RemoveSprite(sprites[0]);


            if (SpriteManager.NumberOfTimedRemovalObjects != 0)
            {
                throw new Exception("Timed removal is not being cleared out when removing particles");
            }




        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:20,代码来源:EmitterTests.cs

示例6: Off

        public void Off()
        {
            LogManager.SetupLogManager();
            var log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod());
            log.Info("Start");

            var emitter = new Emitter();
            var calls = new List<object>();

            var listener3 = new TestListener3(calls);
            emitter.On("foo", listener3);

            var listener4 = new TestListener4(calls);
            emitter.On("foo", listener4);
            emitter.Off("foo", listener4);

            emitter.Emit("foo");

            var expected = new Object[] {"one"};
            Assert.Equal(expected, calls.ToArray());
        }
开发者ID:Quobject,项目名称:EngineIoClientDotNet,代码行数:21,代码来源:EmitterTests.cs

示例7: Map

			public void Map(IDictionary<string, object> document, Emitter emitter)
			{
				string name = (string)document.Get("name");
				if (name != null)
				{
					emitter.Emit(Sharpen.Runtime.Substring(name, 0, 1), 1);
				}
			}
开发者ID:Redth,项目名称:couchbase-lite-net,代码行数:8,代码来源:ViewsTest.cs

示例8: Map

			public void Map(IDictionary<string, object> document, Emitter emitter)
			{
				emitter.Emit(document.Get("sequence"), new object[] { "_id", document.Get("prev")
					 });
			}
开发者ID:Redth,项目名称:couchbase-lite-net,代码行数:5,代码来源:ApiTest.cs

示例9: Emit_InvalidOpCodeWithConstructorInfo_ThrowsNotSupportedException

 public void Emit_InvalidOpCodeWithConstructorInfo_ThrowsNotSupportedException()
 {
     var emitter = new Emitter(null, new Type[] {});
     ExceptionAssert.Throws<NotSupportedException>(() => emitter.Emit(OpCodes.Ldarg_0, (ConstructorInfo)null));            
 }
开发者ID:vitamink,项目名称:LightInject,代码行数:5,代码来源:EmitterTests.cs

示例10: On

        public void On()
        {
            LogManager.SetupLogManager();
            var log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod());
            log.Info("Start");

            var emitter = new Emitter();
            var calls = new List<object>();

            var listener1 = new TestListener1(calls);
            emitter.On("foo", listener1);

            var listener2 = new TestListener2(calls);
            emitter.On("foo", listener2);

            emitter.Emit("foo", 1);
            emitter.Emit("bar", 1);
            emitter.Emit("foo", 2);

            var expected = new Object[] {"one", 1, "two", 1, "one", 2, "two", 2};
            Assert.Equal(expected, calls.ToArray());
        }
开发者ID:Quobject,项目名称:EngineIoClientDotNet,代码行数:22,代码来源:EmitterTests.cs

示例11: Map

			public void Map(IDictionary<string, object> document, Emitter emitter)
			{
				if (document["parentId"].Equals("12345"))
				{
					emitter.Emit(document["parentId"], document);
				}
			}
开发者ID:Redth,项目名称:couchbase-lite-net,代码行数:7,代码来源:RouterTest.cs

示例12: Once

        public void Once()
        {
            var log = LogManager.GetLogger(Global.CallerName());
            log.Info("Start");

            var emitter = new Emitter();
            var calls = new List<object>();

            var listener1 = new TestListener1(calls);
            emitter.Once("foo", listener1);

            emitter.Emit("foo", 1);
            emitter.Emit("foo", 2);
            emitter.Emit("foo", 3);
            emitter.Emit("bar", 1);

            var expected = new Object[] {"one", 1};
            CollectionAssert.AreEqual(expected, calls.ToArray());
        }
开发者ID:mattleibow,项目名称:EngineIoClientDotNet,代码行数:19,代码来源:EmitterTests.cs

示例13: OffWhenCalledfromEvent

        public void OffWhenCalledfromEvent()
        {
            var log = LogManager.GetLogger(Global.CallerName());
            log.Info("Start");

            var emitter = new Emitter();
            var called = new List<bool>() {false};

            var listener5 = new TestListener5(called);
            var listener6 = new TestListener6(emitter, listener5);
            emitter.On("tobi", listener6);

            emitter.Once("tobi", listener5);
            emitter.Emit("tobi");
            Assert.AreEqual(true, called[0]);
            called[0] = false;
            emitter.Emit("tobi");
            Assert.AreEqual(false, called[0]);
        }
开发者ID:mattleibow,项目名称:EngineIoClientDotNet,代码行数:19,代码来源:EmitterTests.cs

示例14: OffWhenCalledfromEvent

        public void OffWhenCalledfromEvent()
        {
            LogManager.SetupLogManager();
            var log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod());
            log.Info("Start");

            var emitter = new Emitter();
            var called = new List<bool>() {false};

            var listener5 = new TestListener5(called);
            var listener6 = new TestListener6(emitter, listener5);
            emitter.On("tobi", listener6);

            emitter.Once("tobi", listener5);
            emitter.Emit("tobi");
            Assert.Equal(true, called[0]);
            called[0] = false;
            emitter.Emit("tobi");
            Assert.Equal(false, called[0]);
        }
开发者ID:Quobject,项目名称:EngineIoClientDotNet,代码行数:20,代码来源:EmitterTests.cs

示例15: Map

			public void Map(IDictionary<string, object> document, Emitter emitter)
			{
				string id = (string)document.Get("_id");
				emitter.Emit(id, null);
			}
开发者ID:Redth,项目名称:couchbase-lite-net,代码行数:5,代码来源:AttachmentsTest.cs


注:本文中的Emitter.Emit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。