void GenerateMonthData() { DayWiseShortDataInfo[] l_dayWiseData = CalendarHandler.GetSpecificMonthData(new DateTime(2018, month, 01)); for (int count = 0; count < m_maxDateCells; count++) { m_dateCells[count].AssignData(l_dayWiseData[count]); } }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { ViewModel = ((CalendarVm)(MainGrid.DataContext)); handler = ViewModel.handler; CalendarItems = handler.CalendarDictionary; InitializeCalendarDate(); initAnimations(); }
private void Loaded(object sender, RoutedEventArgs e) { ViewModel = ((CalendarVm)(MainGrid.DataContext)); handler = ViewModel.handler; this.CurrentDate = DateTime.Today; CalendarItems = handler.CalendarDictionary; InitializeCalendar(); initAnimations(); }
protected override void Establish_context() { PostRepository = MockRepository.GenerateStub <ICategorizedPostRepository <IEventPluginConfigurationProvider> >(); CalendarItemRepository = MockRepository.GenerateStub <ICalendarItemRepository>(); _sut = new CalendarHandler(PostRepository, CalendarItemRepository, MockRepository.GenerateMock <ILogger>()); Request = CreateRequest(); }
public const int DAYS_PER_CYCLE = 10; //number of days in each cycle // Use this for initialization void Awake() { if (firstTimeAwake) { //initialize variables class instances Text[] components = transform.FindChild("Canvas").FindChild("Calendar").GetComponentsInChildren <Text>(); //get text components calendar = new CalendarHandler(this, DAY_LENGTH, components[0], components[1]); events = new EventHandler(DAY_LENGTH); //scrollingText = new ScrollingTextHandler(this); highlightText = GameObject.Find("HighlightText").GetComponent <Text>(); stateText = GameObject.Find("StateText").GetComponent <Text>(); System.Random r = new System.Random(); //seed rng outside of loop (otherwise, each rng will be seeded with the same or close to the same values -> not random AT ALL) for (int i = 0; i < states.Length; i++) { states[i] = new State(i.ToString(), r); //iniatialize each state and seed it randomly } changeState(1); //display first state } else { GetComponent <AudioSource>().Stop(); PopularityManager.currentState++; if (PopularityManager.currentState >= 10) //end of game { timeIsActive = false; int totalPossibleDelegates = 0; for (int i = 0; i < states.Length; i++) { totalPossibleDelegates += states[i].numDelegates; } if ((float)events.delegates / (float)totalPossibleDelegates > 0.5f) { //win GameObject.Find("Won").SetActive(true); } else { //lose GameObject.Find("Lost").SetActive(false); } } calendar.sceneTimerTime = GameObject.Find("TimeUntil").gameObject.GetComponent <Text>(); calendar.sceneTimerDays = GameObject.Find("DaysUntil").gameObject.GetComponent <Text>(); calendar.calendarDayText = GameObject.Find("DayText").GetComponent <Text>(); calendar.calendarMonthText = GameObject.Find("MonthText").GetComponent <Text>(); //scrollingText = new ScrollingTextHandler(this); highlightText = GameObject.Find("HighlightText").GetComponent <Text>(); stateText = GameObject.Find("StateText").GetComponent <Text>(); changeState(PopularityManager.currentState); //display first state calendar.numDays = 0; events.UpdateMoney(this); //update money events.popularity.UpdatePopularity(this, GetPolicyValues(), 1f); //UpdatePolicyValues(); GameObject.Find("BackgroundMusic").GetComponent <AudioSource>().Play(); } }
//--------------------------------------------------------Set-, Get- Metoden:---------------------------------------------------------\\ #region --Set-, Get- Metode-- #endregion //--------------------------------------------------------Sonstige Metoden:-----------------------------------------------------------\\ #region --Sonstige Metoden (Public)-- #endregion #region --Sonstige Metoden (Private)-- #endregion #region --Sonstige Metoden (Protected)-- #endregion //--------------------------------------------------------Events:---------------------------------------------------------------------\\ #region --Events-- private void Page_Loaded(object sender, RoutedEventArgs e) { CalendarHandler.getCalendarList(); StringDataEntity data = CalendarHandler.getNextEntry(); if (data != null) { lecturName_lbl.Text = data.entry; lecturTime_lbl.Text = data.date.ToString(); } }
public List <CalendarEntry> GetCalendarEntries([FromForm] int utcOffset) { ProMaUser user = DataController.LoggedInUser; if (user == null) { throw new NotLoggedInException(); } return(CalendarHandler.GetCalendarEntriesForUser(user.UserId, utcOffset)); }
private void Loaded(object sender, RoutedEventArgs e) { ViewModel = ((CalendarVm)(MainGrid.DataContext)); handler = ViewModel.handler; handler.RefreshCalendarDictionary(); CalendarItems = handler.CalendarDictionary; InitializeCalendarDate(); initAnimations(); BottomBarCalendarDate.ButtonShowEvent += new EventHandler(ShowCalendarItem); BottomBarCalendarDate.ButtonDeleteEvent += new EventHandler(DeleteCalendarItem); ViewCalendarItem.ButtonCloseEvent += new EventHandler(CloseCalendarItem); }
/// <summary> /// Moves the arms on the analogue clock /// </summary> private void UpdateAnalogueClock() { try { List <double> angles = clockHandler.GetAllRotations(CalendarHandler.GetDate()); secondHand.Angle = angles[0]; minuteHand.Angle = angles[1]; hourHand.Angle = angles[2]; } catch (Exception error) { DataValidation.SaveError(error.ToString()); } }
//--------------------------------------------------------Events:---------------------------------------------------------------------\\ #region --Events-- private void Page_Loaded(object sender, RoutedEventArgs e) { //CalendarHandler.getCalendarList(); StringDataEntity data = CalendarHandler.getNextEntry(); if (data == null) { return; } TravelDataEntity entity = TravelDataManager.getTravelData(data.date); populateDiagramm(entity); }
private void Dispatcher_Elapsed(object sender, object e) { //Correctly update layout on start if (counter == 0) { UpdateUiContent(); UpdateUiContent(); } //Update clock UpdateAnalogueClock(); TBlockTime.Text = CalendarHandler.GetStringDate("HH:mm:ss"); if (counter % 20 == 0) //20 seconds { WeatherAndComicToggle(); //News if (counter % 30 == 0) //30 seconds { if (rSSFeedHandler.NewsList.Count > 0) { SetNews(); NewsTextFormatting(); } else //If empty { rSSFeedHandler.GetFeed(); } } } //Time between global update : 5 min. if (counter >= 300) { //Update static model for all handlers dbHandler.UpdateModel(); //Update User Interface UpdateUiContent(); //Update IP //UpdateIp(); counter = 1; } else { counter++; } }
public MainPage() { this.InitializeComponent(); lunchPlanHandler = new LunchPlanHandler(); mealHandler = new MealHandler(); dbHandler = new DBHandler(); messageHandler = new MessageHandler(); imageHandler = new ImageHandler(); rSSFeedHandler = new RSSFeedHandler("http://feeds.tv2.dk/nyhederne_seneste/rss"); iPHandler = new IPHandler(); clockHandler = new ClockHandler(); Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().Title = CalendarHandler.GetStringDate("dd/MM/yyyy") + " - Uge : " + CalendarHandler.GetWeekNumber(); UpdateIp(); counter = 0; SetDpTimer(); }
public void DeleteCalendar([FromForm] int calendarId) { ProMaUser user = DataController.LoggedInUser; if (user == null) { throw new NotLoggedInException(); } CalendarEntry toDelete = CalendarHandler.GetEntry(calendarId); if (toDelete.UserId != user.UserId) { throw new Exception("Created by someone else"); } CalendarHandler.DeleteCalendar(calendarId); }
public void AddCalendar([FromBody] AddCalendarRequestObject requestObject) { ProMaUser user = DataController.LoggedInUser; if (user == null) { throw new NotLoggedInException(); } CalendarEntry newEntry = new CalendarEntry(); newEntry.CalendarName = requestObject.newItemName; newEntry.Yearly = requestObject.yearly; newEntry.ForDate = new DateTimeOffset(requestObject.year, requestObject.month, requestObject.day, 0, 0, 0, new TimeSpan()); newEntry.UserId = user.UserId; CalendarHandler.AddCalendar(newEntry); }
static void Main(string[] args) { CalendarService service = InitializeCalendarService(); //var calendarHandler = new CalendarHandler(service); var calendarEventHandler = new CalendarEventHandler(service); var calendarHandler = new CalendarHandler(service); calendarEventHandler.GetEvents("primary"); calendarEventHandler.CreateEvent(calendarEventHandler.GenerateEvent(), "primary"); calendarEventHandler.DeleteEvent("primary", "f31umtjtvun4msldkmq8poacck"); calendarEventHandler.UpdateEvent(calendarEventHandler.GenerateEvent(), "primary", "no3m5085sv4ju67lqmbhu49tl0"); calendarHandler.CreateCalendar(); //https://calendar.google.com/calendar/[email protected] calendarHandler.DeleteCalendar("*****@*****.**"); Console.ReadLine(); }
/// <summary> /// Retrieves the meals for the week and set GUI elements. /// </summary> private void GetMealPlan() { try { menu = lunchPlanHandler.GetMealsForWeek(CalendarHandler.GetWeekNumber()); foreach (var item in menu) { //Checks against application autogenerated values switch (item.Weekday.ToLower()) { case "monday": TBlockMondayMeal.Text = item.Meal; break; case "tuesday": TBlockTuesdayMeal.Text = item.Meal; break; case "wednesday": TBlockWednesdayMeal.Text = item.Meal; break; case "thursday": TBlockThursdayMeal.Text = item.Meal; break; case "friday": TBlockFridayMeal.Text = item.Meal; break; default: break; } } } catch (Exception error) { DataValidation.SaveError(error.ToString()); } }