示例#1
0
        public void TestAddEvent()
        {
            EventsManager eventManager = new EventsManager();
            EventsProcessor eventProcessor = new EventsProcessor(eventManager);

            DateTime date = DateTime.ParseExact("2012-03-26T09:00:00", "yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture);

            Event calendarEvent = new Event
            {
                EventDate = date,
                Title = "C# exam",
                Location = null
            };

            EventsManager eventsManager = new EventsManager();

            eventsManager.AddEvent(calendarEvent);

            string expectedTitle = "C# exam";
            string expectedLocation = null;

            IEnumerable<Event> eventsList = eventsManager.ListEvents(date, 1);
            Event testEvent = new Event();

            foreach (Event ev in eventsList)
            {
                testEvent = ev;
            }

            Assert.AreEqual(date, testEvent.EventDate);
            Assert.AreEqual(expectedTitle, testEvent.Title);
            Assert.AreEqual(expectedLocation, testEvent.Location);
        }
示例#2
0
        public void TestDeleteEventsByTitle()
        {
            EventsManager eventManager = new EventsManager();
            EventsProcessor eventProcessor = new EventsProcessor(eventManager);

            DateTime date = DateTime.ParseExact("2011-03-26T09:00:00", "yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture);

            Event calendarEvent = new Event
            {
                EventDate = date,
                Title = "C# exam",
                Location = null
            };

            EventsManager eventsManager = new EventsManager();

            eventsManager.AddEvent(calendarEvent);

            eventsManager.DeleteEventsByTitle("C# exam");

            IEnumerable<Event> eventsList = eventManager.ListEvents(date, 3);

            int expected = 0;
            int actual = 0;

            foreach (Event currentEvent in eventsList)
            {
                actual++;
            }

            Assert.AreEqual(expected, actual);
        }
示例#3
0
	void Start () {
        varManager = GetComponent<VariablesManager>();
        eventsManager = GetComponent<EventsManager>();

        ImportVariables();
        ImportEvents();
        GetComponent<TimeManager>().AddYearVariable();
    }
示例#4
0
        public void TestListEventsAll()
        {
            EventsManager eventManager = new EventsManager();
            EventsProcessor eventProcessor = new EventsProcessor(eventManager);

            DateTime firstEventDate = DateTime.ParseExact("2009-03-26T12:00:00", "yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture);

            Event firstEvent = new Event
            {
                EventDate = firstEventDate,
                Title = "C# exam",
                Location = null
            };

            DateTime secondEventDate = DateTime.ParseExact("2010-03-26T10:00:00", "yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture);

            Event secondEvent = new Event
            {
                EventDate = secondEventDate,
                Title = "C# exam",
                Location = "Gabrovo"
            };

            DateTime thirdEventDate = DateTime.ParseExact("2013-03-26T07:43:00", "yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture);

            Event thirdEvent = new Event
            {
                EventDate = thirdEventDate,
                Title = "C# exam",
                Location = null
            };

            DateTime listingDateTime = DateTime.ParseExact("2001-03-26T07:43:00", "yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture);

            EventsManager eventsManager = new EventsManager();

            eventsManager.AddEvent(firstEvent);
            eventsManager.AddEvent(secondEvent);
            eventsManager.AddEvent(thirdEvent);

            IEnumerable<Event> eventsList = eventsManager.ListEvents(listingDateTime, 3);

            int expectedEventsCount = 3;
            int actualEventsCount = 0;

            foreach (Event calendarEv in eventsList)
            {
                actualEventsCount++;
            }

            Assert.AreEqual(expectedEventsCount, actualEventsCount);
        }
        /// <summary>
        /// This is the default Action.
        /// </summary>
        public ActionResult Index()
        {
            var eventManager = new EventsManager();
            var model = new ArnobMVCEventsModel();

            if (List != Guid.Empty)
            {
                model.Events = eventManager.GetEvent(List);
            }
            else
            {
                model.Events = new ArnobMVCEventsModel().Events;
            }

            return View("Default", model);
        }
	void Awake ()
	{
		if (Instance == null)
		{
			Instance = this;

			mActiveEvents = new List<Event> ();
			mAvailableWorldEvents = Resources.LoadAll<Event> ("Events/World Events");
		}
		else
		{
			Debug.LogError("There is more than one EventsManager in the scene!");
		}

		ResourcesManager.OnTick += RandomEvent;
	}
示例#7
0
    void Start()
    {
        DOTween.Init(true, true, LogBehaviour.Verbose).SetCapacity(200, 10);

        GameObject.DontDestroyOnLoad (this);

        EventsManagerInstance = this.GetComponent<EventsManager> ();

        BaseApplication.EventsManagerInstance.OnUserDataListener += onUserData;
        BaseApplication.EventsManagerInstance.OnDataManagerListener += onDataManagerLoaded;
        BaseApplication.EventsManagerInstance.OnInitializedGameListener += onInitializedGame;

        DataManagerInstance = this.gameObject.AddComponent<DataManager> ();
        SceneManagerInstance  = this.gameObject.AddComponent<SceneManager> ();
        GameManagerInstance   = this.gameObject.AddComponent<GameManager> ();

        Invoke ("initManagers", Constants.SPLASH_TIME);
    }
        private void SelectPreviousOrDefaultEvent()
        {
            _selectedEventSkipSaving = true;
            var number = KunosCareerProgress.Instance.Entries.GetValueOrDefault(Id)?.SelectedEvent;

            SelectedEvent            = (number.HasValue ? EventsManager.GetByNumber(number.Value) : null) ?? EventsManager.GetDefault();
            _selectedEventSkipSaving = false;
        }
示例#9
0
 /// <summary>
 /// Gets a manager instance for the model.
 /// </summary>
 /// <returns>The manager.</returns>
 protected override IManager GetManager()
 {
     return(EventsManager.GetManager(this.ProviderName));
 }
示例#10
0
 protected override void RemoveEvents()
 {
     EventsManager.RemoveMethod <float>(EventAction.SendHealth, ReceiveHealth);
 }
 void OnDestroy()
 {
     EventsManager.UnsubscribeToEvent(Constants.EVENT_SHAKECAMERA, ShakeCamera);
 }
示例#12
0
 private void Awake()
 {
     EventsManager.AddInvoker(this);
     EventsManager.AddHealthEmptiedListener(HandleHealthEmptiedEvent);
 }
示例#13
0
 void Start()
 {
     _crop = this.gameObject.GetComponent <Crop>();
     _anim = this.gameObject.GetComponent <Animator>();
     EventsManager.SubscribeToEvent(EventType.GP_EndDay, CheckSprite);
 }
 private void Start()
 {
     EventsManager.StartListening("OnPlayerDeath", PlayerDeath);
     _anusAnimator = GetComponent <Animator>();
 }
 public KunosCareerEventObject GetFirstEventOrNull()
 {
     return(EventsManager.GetFirstOrNull());
 }
 public KunosCareerEventObject GetEventById([NotNull] string skinId)
 {
     return(EventsManager.GetById(skinId));
 }
 public async Task EnsureEventsLoadedAsync()
 {
     await EventsManager.EnsureLoadedAsync();
 }
 public void EnsureEventsLoaded()
 {
     EventsManager.EnsureLoaded();
 }
 void IAcManagerScanWrapper.AcManagerScan()
 {
     EventsManager.ActualScan();
     SelectPreviousOrDefaultEvent();
 }
示例#20
0
 private void OnDestroy()
 {
     EventsManager.RemoveListener(EventsManager.Events.gameEnded, destroyPhysicalPlayer);
 }
示例#21
0
 public RequestSender(EventsManager eventsManager)
 {
     EventsManager = eventsManager;
 }
示例#22
0
 /// <summary>
 /// the method is activated at the event "SceneManager.sceneLoaded":
 /// the method starts to the event that activates when there is a new scene.
 /// </summary>
 private void ReceiveNewScene(Scene scene, LoadSceneMode load)
 {
     EventsManager.CallEvent(EventAction.NewScene, GetActualLevel(scene.name));
 }
示例#23
0
 private void OnDestroy()
 {
     EventsManager.RemoveListener(EventsManager.Events.gameEnded, GameOver);
     EventsManager.RemoveListener(EventsManager.Events.died, showDeathMessage);
     EventsManager.RemoveListener(EventsManager.Events.respawned, hideDeathMessage);
 }
示例#24
0
        internal static void CreateEvents()
        {
            var manager = EventsManager.GetManager();

            //Disables the security checks and gives the current user authorization to create events.
            manager.Provider.SuppressSecurityChecks = true;

            // Gets the two calendars or throws exception if not found.
            var oddCalendar = manager.GetCalendars()
                              .Where(c => c.Title == Constants.CalendarOne)
                              .SingleOrDefault()
                              ?? throw new ArgumentNullException(Constants.NoCalendar);

            var evenCalendar = manager.GetCalendars()
                               .Where(c => c.Title == Constants.CalendarTwo)
                               .SingleOrDefault()
                               ?? throw new ArgumentNullException(Constants.NoCalendar);

            //Sets the start date for the first event.
            var startDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0, DateTimeKind.Utc);

            for (int i = 1; i <= 10; i++)
            {
                // Creates the event
                Event current = manager.CreateEvent();

                // Sets the event properties
                current.Title      = $"Event {i}";
                current.Content    = $"Teambuilding - Day {i}";
                current.EventStart = startDate.AddDays(i);
                current.EventEnd   = startDate.AddDays(i + 1);

                //Changes spaces and other symbols with "-"
                current.UrlName         = Regex.Replace(current.Title.ToLower(), @"[^\w\-\!\$\'\(\)\=\@\d_]+", "-");
                current.PublicationDate = DateTime.Today;

                //Assigns events to calendars
                if (current.EventStart.Day % 2 == 0)
                {
                    current.Parent = evenCalendar;
                }
                else
                {
                    current.Parent = oddCalendar;
                }

                //Recompiles and validates the url of the event item.
                manager.RecompileAndValidateUrls(current);

                // Save the changes
                manager.SaveChanges();

                // Publishes
                var bag = new Dictionary <string, string>();
                bag.Add("ContentType", typeof(Event).FullName);

                //Fixes the "You are not authorised to publish" issue.
                SystemManager.RunWithElevatedPrivilege(d => WorkflowManager.MessageWorkflow(current.Id, typeof(Event), null, "Publish", false, bag));
            }
            //Enables the security checks.
            manager.Provider.SuppressSecurityChecks = false;
        }
    //Vector3 velocity;

    //public float speed, xOffset, yOffset;


    // Start is called before the first frame update
    void Start()
    {
        EventsManager.SubscribeToEvent(Constants.EVENT_SHAKECAMERA, ShakeCamera);
    }
示例#26
0
        private void CreateEvents(string ProviderName)
        {
            if (string.IsNullOrEmpty(ProviderName))
            {
                ProviderName = EventsManager.GetDefaultProviderName();
            }

            var eventsCreated = App.Prepare().SetContentProvider(ProviderName).WorkWith().Events().Get().Count() > 0;
            var year          = DateTime.Now.Year;
            var rand          = new Random(DateTime.Now.Millisecond);

            if (!eventsCreated)
            {
                var title        = ProviderName + " Sample Event A";
                var content      = FILLER_TEXT;
                var month        = rand.Next(1, 12);
                var startDate    = new DateTime(year, month, 01, 18, 0, 0);
                var endDate      = new DateTime(year, month, 02, 4, 0, 0);
                var street       = "Organization";
                var city         = "123 Fake Str";
                var state        = "TX";
                var country      = "USA";
                var contactEmail = "*****@*****.**";
                var contactName  = "John Doe";
                var contactWeb   = "http://www.sitefinity.com";

                this.CreateEvent(ProviderName, title, content, startDate, endDate, street, city, state, country, contactEmail, contactName, contactWeb);

                title     = ProviderName + " Sample Event B";
                content   = FILLER_TEXT;
                month     = rand.Next(1, 12);
                startDate = new DateTime(year, month, 12, 3, 0, 0);
                endDate   = new DateTime(year, month, 12, 7, 0, 0);

                this.CreateEvent(ProviderName, title, content, startDate, endDate, street, city, state, country, contactEmail, contactName, contactWeb);

                title     = ProviderName + " Sample Event C";
                content   = FILLER_TEXT;
                month     = rand.Next(1, 12);
                startDate = new DateTime(year, month, 4, 21, 0, 0);
                endDate   = new DateTime(year, month, 4, 23, 0, 0);

                this.CreateEvent(ProviderName, title, content, startDate, endDate, street, city, state, country, contactEmail, contactName, contactWeb);

                title     = ProviderName + " Sample Event D";
                content   = FILLER_TEXT;
                month     = rand.Next(1, 12);
                startDate = new DateTime(year, month, 1, 5, 0, 0);
                endDate   = new DateTime(year, month, 1, 10, 0, 0);

                this.CreateEvent(ProviderName, title, content, startDate, endDate, street, city, state, country, contactEmail, contactName, contactWeb);

                title     = ProviderName + " Sample Event E";
                content   = FILLER_TEXT;
                month     = rand.Next(1, 12);
                startDate = new DateTime(year, month, 1, 5, 0, 0);
                endDate   = new DateTime(year, month, 1, 10, 0, 0);

                this.CreateEvent(ProviderName, title, content, startDate, endDate, street, city, state, country, contactEmail, contactName, contactWeb);

                title     = ProviderName + " Sample Event F";
                content   = FILLER_TEXT;
                month     = rand.Next(1, 12);
                startDate = new DateTime(year, month, 1, 5, 0, 0);
                endDate   = new DateTime(year, month, 1, 10, 0, 0);

                this.CreateEvent(ProviderName, title, content, startDate, endDate, street, city, state, country, contactEmail, contactName, contactWeb);

                title     = ProviderName + " Sample Event G";
                content   = FILLER_TEXT;
                month     = rand.Next(1, 12);
                startDate = new DateTime(year, month, 1, 5, 0, 0);
                endDate   = new DateTime(year, month, 1, 10, 0, 0);

                this.CreateEvent(ProviderName, title, content, startDate, endDate, street, city, state, country, contactEmail, contactName, contactWeb);
            }
        }
示例#27
0
 protected override void SubscribeEvents()
 {
     EventsManager.AddMethod <float>(EventAction.SendHealth, ReceiveHealth);
 }
示例#28
0
 private void OnDestroy()
 {
     EventsManager.RemoveListener <GameOverEventType>(OnGameOver);
     EventsManager.RemoveListener <GameWinEventType>(OnGameWin);
     EventsManager.RemoveListener <LoadMenuEventType>(OnLoadMenu);
 }
示例#29
0
 public virtual void OnClick()
 {
     EventsManager.AsteroidDestroyed( );
     StartCoroutine(Explode( ));
 }
示例#30
0
 void Start()
 {
     em = this.GetComponent<EventsManager> ();
     msgBox = Instantiate<MessagesBox>(msgBox);
     map = ground.GetComponent<GroundGenerator> ();
     eggs = new List<Egg> ();
     teams = new List<Team> ();
     functions = new Dictionary<string, System.Action<string>> ();
     functions.Add ("BIENVENUE", ft_bienvenue);
     functions.Add("msz", ft_mapsize);
     functions.Add("bct", ft_content_map);
     functions.Add("tna", ft_team_name);
     functions.Add("pnw", ft_new_player);
     functions.Add("ppo", ft_player_position);
     functions.Add("plv", ft_player_level);
     functions.Add("pin", ft_player_inventory);
     functions.Add("pex", ft_player_expulse);
     functions.Add("pbc", ft_player_broadcast);
     functions.Add("pic", ft_player_incantation);
     functions.Add("pie", ft_player_end_incantation);
     functions.Add("pfk", ft_player_lays);
     functions.Add("pdr", ft_player_vomit);
     functions.Add("pgt", ft_player_picks);
     functions.Add("pdi", ft_player_died);
     functions.Add("enw", ft_new_egg_pos);
     functions.Add("eht", ft_egg_born);
     functions.Add("edi", ft_egg_died);
     functions.Add("ebo", ft_player_replaces_egg);
     functions.Add("sgt", timeUnit);
     functions.Add("seg", ft_end);
     functions.Add("smg", recMessage);
     functions.Add("suc", unknownCommand);
     functions.Add("sbp", badArgs);
 }
示例#31
0
 private void Awake()
 {
     EventsManager.SuscribeToEvent("RePlan", RePlan);
     player = FindObjectOfType <Player>();
     manaImage.fillAmount = maxMana / 50;
 }
示例#32
0
 public void Shoot()
 {
     Animator.SetTrigger("Shoot");
     EventsManager.Broadcast(EventsType.CopShot, this);
 }
示例#33
0
 private void OnGameOver()
 {
     EventsManager.CallEvent <ShowGameOverScreenEventType>();
 }
示例#34
0
 public void CopClicked()
 {
     EventsManager.Broadcast(EventsType.CopClicked, this);
 }
示例#35
0
 public SearchTests(ITestOutputHelper output, DynamicsWebAppFixture fixture) : base(output, fixture)
 {
     manager = Services.GetRequiredService <EventsManager>();
 }
        public void OnBeforeTestsStarts()
        {
            var  templateId = ServerOperations.Templates().GetTemplateIdByTitle(TemplateTitle);
            Guid pageId     = ServerOperations.Pages().CreatePage(PageTitle, templateId);
            var  pageNodeId = ServerOperations.Pages().GetPageNodeId(pageId);

            ServerOperationsFeather.Pages().AddCalendarWidgetToPage(pageNodeId, PlaceHolderId);

            var basicCurrentEventStartTime = DateTime.Now;
            var currentEventStartTime      = new DateTime(basicCurrentEventStartTime.Year, basicCurrentEventStartTime.Month, basicCurrentEventStartTime.Day, basicCurrentEventStartTime.Hour, basicCurrentEventStartTime.Minute, basicCurrentEventStartTime.Second);
            var basicCurrentEventEndTime   = DateTime.Now.AddHours(1);
            var currentEventEndTime        = new DateTime(basicCurrentEventEndTime.Year, basicCurrentEventEndTime.Month, basicCurrentEventEndTime.Day, basicCurrentEventEndTime.Hour, basicCurrentEventEndTime.Minute, basicCurrentEventEndTime.Second);

            ServerOperations.Events().CreateEvent(CurrentEventTitle, string.Empty, false, currentEventStartTime, currentEventEndTime);
            var currentEventExpectedStartTime = this.FormatTime(currentEventStartTime);
            var currentEventExpectedEndTime   = this.FormatTime(currentEventEndTime);

            ServerArrangementContext.GetCurrent().Values.Add("currentEventStartTime", currentEventExpectedStartTime);
            ServerArrangementContext.GetCurrent().Values.Add("currentEventEndTime", currentEventExpectedEndTime);

            var currentEventItem = EventsManager.GetManager().GetEvents().Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live &&
                                                                                        ni.Title == CurrentEventTitle).FirstOrDefault();

            ServerArrangementContext.GetCurrent().Values.Add("currentEventId", currentEventItem.Id.ToString());

            var basicBasePastInOneDayEventStartTime = DateTime.Now.AddDays(-1);
            var basePastInOneDayEventStartTime      = new DateTime(basicBasePastInOneDayEventStartTime.Year, basicBasePastInOneDayEventStartTime.Month, basicBasePastInOneDayEventStartTime.Day, basicBasePastInOneDayEventStartTime.Hour, basicBasePastInOneDayEventStartTime.Minute, basicBasePastInOneDayEventStartTime.Second);
            var basicBasePastInOneDayEventEndTime   = DateTime.Now.AddDays(-1);
            var basePastInOneDayEventEndTime        = new DateTime(basicBasePastInOneDayEventEndTime.Year, basicBasePastInOneDayEventEndTime.Month, basicBasePastInOneDayEventEndTime.Day, basicBasePastInOneDayEventEndTime.Hour, basicBasePastInOneDayEventEndTime.Minute, basicBasePastInOneDayEventEndTime.Second);

            ServerOperations.Events().CreateEvent(BasePastInOneDayEventTitle, string.Empty, false, basePastInOneDayEventStartTime, basePastInOneDayEventEndTime);
            var basePastInOneDayEventExpectedStartTime = this.FormatTime(basePastInOneDayEventStartTime);
            var basePastInOneDayEventExpectedEndTime   = this.FormatTime(basePastInOneDayEventEndTime);

            ServerArrangementContext.GetCurrent().Values.Add("basePastInOneDayEventStartTime", basePastInOneDayEventExpectedStartTime);
            ServerArrangementContext.GetCurrent().Values.Add("basePastInOneDayEventEndTime", basePastInOneDayEventExpectedEndTime);

            var pastEventItem = EventsManager.GetManager().GetEvents().Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live &&
                                                                                     ni.Title == BasePastInOneDayEventTitle).FirstOrDefault();

            ServerArrangementContext.GetCurrent().Values.Add("pastEventId", pastEventItem.Id.ToString());

            var basicBaseUpcomingInOneDayEventStartTime = DateTime.Now.AddDays(1);
            var baseUpcomingInOneDayEventStartTime      = new DateTime(basicBaseUpcomingInOneDayEventStartTime.Year, basicBaseUpcomingInOneDayEventStartTime.Month, basicBaseUpcomingInOneDayEventStartTime.Day, basicBaseUpcomingInOneDayEventStartTime.Hour, basicBaseUpcomingInOneDayEventStartTime.Minute, basicBaseUpcomingInOneDayEventStartTime.Second);
            var basicBaseUpcomingInOneDayEventEndTime   = DateTime.Now.AddDays(1);
            var baseUpcomingInOneDayEventEndTime        = new DateTime(basicBaseUpcomingInOneDayEventEndTime.Year, basicBaseUpcomingInOneDayEventEndTime.Month, basicBaseUpcomingInOneDayEventEndTime.Day, basicBaseUpcomingInOneDayEventEndTime.Hour, basicBaseUpcomingInOneDayEventEndTime.Minute, basicBaseUpcomingInOneDayEventEndTime.Second);

            ServerOperations.Events().CreateEvent(BaseUpcomingInOneDayEventTitle, string.Empty, false, baseUpcomingInOneDayEventStartTime, baseUpcomingInOneDayEventEndTime);
            var baseUpcomingInOneDayEventExpectedStartTime = this.FormatTime(baseUpcomingInOneDayEventStartTime);
            var baseUpcomingInOneDaytExpectedEndTime       = this.FormatTime(baseUpcomingInOneDayEventEndTime);

            ServerArrangementContext.GetCurrent().Values.Add("baseUpcomingInOneDayEventStartTime", baseUpcomingInOneDayEventExpectedStartTime);
            ServerArrangementContext.GetCurrent().Values.Add("baseUpcomingInOneDayEventEndTime", baseUpcomingInOneDaytExpectedEndTime);

            var upcomingEventItem = EventsManager.GetManager().GetEvents().Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live &&
                                                                                         ni.Title == BaseUpcomingInOneDayEventTitle).FirstOrDefault();

            ServerArrangementContext.GetCurrent().Values.Add("upcomingEventId", upcomingEventItem.Id.ToString());

            ServerArrangementContext.GetCurrent().Values.Add("timezoneId", TimeZoneInfo.Utc.ToString());
        }
    //---------------------------------------------------
    void Awake()
    {
        main = this;

        MouseClick += DoubleClickCheck;
    }
示例#38
0
 public EventsPageViewModel(INavigationService navigationService) : base(navigationService)
 {
     eventsManager = new EventsManager();
     // _events = eventsManager.Events;
     RefreshCommand = new DelegateCommand(OnRefreshCommandExecuted);
 }
	void Start () {
        timeManager = GetComponent<TimeManager>();
        eventsManager = GetComponent<EventsManager>();
	}
示例#40
0
 public void UpdateSkin()
 {
     EventsManager.UpdateSkin(skin);
 }