private void UpdateMonths() { int gapping = 2; int calendarsX = Convert.ToInt32(Math.Max(Math.Floor((double)ClientSize.Width / (double)(MonthSize.Width + gapping)), 1.0)); int calendarsY = Convert.ToInt32(Math.Max(Math.Floor((double)ClientSize.Height / (double)(MonthSize.Height + gapping)), 1.0)); int calendars = calendarsX * calendarsY; int monthsWidth = (calendarsX * MonthSize.Width) + (calendarsX - 1) * gapping; int monthsHeight = (calendarsY * MonthSize.Height) + (calendarsY - 1) * gapping; int startX = (ClientSize.Width - monthsWidth) / 2; int startY = (ClientSize.Height - monthsHeight) / 2; int curX = startX; int curY = startY; _forwardMonthIndex = calendarsX - 1; _months = new MonthViewMonth[calendars]; for (int i = 0; i < Months.Length; i++) { Months[i] = new MonthViewMonth(this, ViewStart.AddMonths(i)); Months[i].SetLocation(new Point(curX, curY)); curX += gapping + MonthSize.Width; if ((i + 1) % calendarsX == 0) { curX = startX; curY += gapping + MonthSize.Height; } } MonthViewMonth first = Months[0]; MonthViewMonth last = Months[_forwardMonthIndex]; SetBackwardButtonBounds(new Rectangle(first.Bounds.Left + ItemPadding.Left, first.Bounds.Top + ItemPadding.Top, DaySize.Height - ItemPadding.Horizontal, DaySize.Height - ItemPadding.Vertical)); SetForwardButtonBounds(new Rectangle(first.Bounds.Right - ItemPadding.Right - BackwardButtonBounds.Width, first.Bounds.Top + ItemPadding.Top, BackwardButtonBounds.Width, BackwardButtonBounds.Height)); }
/// <summary> /// Moves the view one month backward /// </summary> public void GoBackward() { ViewStart = ViewStart.AddMonths(-1); }
/// <summary> /// Moves the view one month forward /// </summary> public void GoForward() { ViewStart = ViewStart.AddMonths(1); }
public MainViewModel( Profile profile, Server server, ViewStart viewStart, ViewTroupList viewTroupList, RankingPlayerView viewRankingPlayer, RankingAllyView viewRankingAlly, ConquerView viewConquer, ViewPlaner viewPlaner, ServerSelection serverSelection) { _profile = profile; _server = server; var MenuItems = new[] { new MainMenuItem() { Group = "Start", Title = "Start", Image = "", Content = viewStart }, new MainMenuItem() { Group = "Start", Title = "Server Auswahl", Image = "", Content = serverSelection }, new MainMenuItem() { Group = "Allgemein", Title = "Karte", Image = "/Venom;component/Assets/Images/map2.png", Content = null }, new MainMenuItem() { Group = "Allgemein", Title = "Truppenliste", Image = "", Content = viewTroupList }, new MainMenuItem() { Group = "Ranglisten", Title = "Rangliste Spieler", Image = "", Content = viewRankingPlayer }, new MainMenuItem() { Group = "Ranglisten", Title = "Rangliste Stämme", Image = "", Content = viewRankingAlly }, new MainMenuItem() { Group = "Ranglisten", Title = "Eroberungen", Image = "/Venom;component/Assets/Images/unit_snob.png", Content = viewConquer }, new MainMenuItem() { Group = "Planer", Title = "Angriffsplaner", Image = "/Venom;component/Assets/Images/unit_axe.png", Content = viewPlaner } }; MenuCollection = CollectionViewSource.GetDefaultView(MenuItems); MenuCollection.GroupDescriptions.Add(new PropertyGroupDescription("Group")); }
private void TransformViewsViewStart(SmartAppInfo manifest) { var template = new ViewStart(manifest); _writingService.WriteFile(Path.Combine(_context.BasePath, template.OutputPath), template.TransformText()); }