// Use this for initialization
    void Start()
    {
        //이벤트만 남기기
        AppEventManager.sendAppEvent("이벤트 이름");

        //이벤트와 함께 값도 남기기
        Dictionary <string, object> param = new Dictionary <string, object>();

        param["user_name"] = "게임잼";
        param["score"]     = 1024768;

        AppEventManager.sendAppEvent("이벤트 이름", param);
    }
        public void test_putTimeEvents()
        {
            IAppStrategyManager stgManager    = getAppStrategyManager_for_putEvents();
            AppEventManager     eventManager  = new AppEventManager(stgManager);
            DateTime            afterSetTime  = new DateTime(2015, 11, 21, 9, 15, 55, DateTimeKind.Local);
            DateTime            afterSetTime2 = new DateTime(2015, 11, 21, 9, 16, 0, DateTimeKind.Local);

            eventManager.putTimeEvents(afterSetTime);
            eventManager.putTimeEvents(afterSetTime2);
            Assert.AreEqual(2, eventManager.storeEventQueue["S1_RND1"].Count);
            Assert.AreEqual(0, eventManager.storeEventQueue["S2_RBREAK_REVERSE1"].Count);
            Assert.AreEqual(2, eventManager.storeEventQueue["S3_RBREAK_TREND1"].Count);
            Assert.AreEqual(2, stgManager.getAppMainteanceManager().storeEventQueue.Count);
        }
示例#3
0
        static void Main(string[] args)
        {
            String[] stgNames = { "stratey1", "stratey2", "stratey3" };
            ConcurrentDictionary <String, String> activeStgNamesMap = new ConcurrentDictionary <String, String>();

            activeStgNamesMap.TryAdd("stratey2", "stratey2");
            activeStgNamesMap.TryAdd("stratey3", "stratey3");
            IAppStrategyManager strategyManager = new AppStrategyManager(null);

            strategyManager.injectActiveStgNamesMap(activeStgNamesMap);
            strategyManager.injectStgNames(stgNames);
            IAppEventManager eventManager = new AppEventManager(strategyManager);

            eventManager.startGenerateTimeEvents();
            Console.ReadLine();
        }
        public void test_putTickPriceEvents()
        {
            IAppStrategyManager stgManager   = getAppStrategyManager_for_putEvents();
            AppEventManager     eventManager = new AppEventManager(stgManager);

            TickPriceMessage tickMessage1 = new TickPriceMessage(200001, 4, 22000, 0);
            TickPriceMessage tickMessage2 = new TickPriceMessage(200002, 1, 22100, 0);

            MarketDataMessage dataMessage = (MarketDataMessage)tickMessage1;

            eventManager.putTickPriceEvents(tickMessage1, dataMessage);
            dataMessage = (MarketDataMessage)tickMessage2;
            eventManager.putTickPriceEvents(tickMessage2, dataMessage);
            Assert.AreEqual(2, eventManager.storeEventQueue["S1_RND1"].Count);
            Assert.AreEqual(0, eventManager.storeEventQueue["S2_RBREAK_REVERSE1"].Count);
            Assert.AreEqual(2, eventManager.storeEventQueue["S3_RBREAK_TREND1"].Count);
            Assert.AreEqual(0, stgManager.getAppMainteanceManager().storeEventQueue.Count);
        }
示例#5
0
 protected void Application_Start(object sender, EventArgs e)
 {
     AppEventManager.ExecuteHandler(AppEventType.App_Start);
 }
示例#6
0
 private void sendAppEvent(string name)
 {
     AppEventManager.sendAppEvent(name);
 }