Interaction logic for PlayTimeStatisticDialog.xaml
        public GameTimeBarGraph2(List <GameTimeSummary> g, string subtitle, GraphType type, List <GameTimeSummary> otherTitles = null)
        {
            glist = new ObservableCollection <GameTimeSummary>();
            InitializeComponent();
            if (Properties.Settings.Default.disableGlowBrush)
            {
                this.GlowBrush = null;
            }
            int totalTime = 0;

            chart.Series.Clear();

            g.ForEach(it => {
                totalTime += it.t;
                glist.Add(it);
                chart.Series.Add(new ChartSeries {
                    SeriesTitle   = it.Game,
                    DisplayMember = "Description",
                    ValueMember   = "PlayTime",
                    ItemsSource   = new ObservableCollection <GameTimeSummary> {
                        it
                    },
                });
            });

            string otherString = "";

            int gameCount = g.Count;

            if (otherTitles != null)
            {
                otherString += "その他:";
                otherTitles.ForEach(it => {
                    otherString += $"「{ it.Game }」";
                });
                gameCount = g.Count + otherTitles.Count - 1;
            }

            DataContext = new Graph2Context {
                Hint = otherString
            };

            chart.SelectedBrush = null;


            TimeSummary summary = new TimeSummary("1970-01-01", totalTime);

            chart.ChartSubTitle = $"{ subtitle }\r\nトータルプレイ時間:{ summary.TimeString }、合計{ gameCount }本";
            if (type == GraphType.Yearly)
            {
                chart.ChartTitle = "タイトル別プレイ時間(hours)";
            }
        }
Beispiel #2
0
        public GameTimeGraph(List <GameTimeSummary> g, string subtitle, GraphType type, int othersNum = 0)
        {
            glist = g;
            InitializeComponent();
            if (Properties.Settings.Default.disableGlowBrush)
            {
                this.GlowBrush = null;
            }
            int totalTime = 0;

            g.ForEach(it => {
                totalTime += it.t;
            });
            chart.SelectedBrush = null;
            TimeSummary summary = new TimeSummary("1970-01-01", totalTime);

            chart.ChartSubTitle = $"{ subtitle }\r\nトータルプレイ時間:{ summary.TimeString }、合計{ g.Count + othersNum - 1 }本";
            if (type == GraphType.Yearly)
            {
                chart.ChartTitle = "タイトル別プレイ時間(hours)";
            }
            crt.ItemsSource = glist;
        }
        public GameTimeStatisticDialog(List <TimeSummary> t, string g)
        {
            tlist     = new ObservableCollection <TimeSummary>();
            this.game = g;
            InitializeComponent();
            if (Properties.Settings.Default.disableGlowBrush)
            {
                this.GlowBrush = null;
            }

            int totalTime = 0;

            t.Reverse();

            chart.Series.Clear();
            t.ForEach(it => {
                totalTime += it.time;
                tlist.Add(it);
                chart.Series.Add(new ChartSeries {
                    SeriesTitle   = it.MonthDayString,
                    DisplayMember = "Description",
                    ValueMember   = "PlayTime",
                    ItemsSource   = new ObservableCollection <TimeSummary> {
                        it
                    },
                });
            });

            TimeSummary summary = new TimeSummary("1970-01-01", totalTime);

            chart.ChartTitle    = game;
            chart.ChartSubTitle = $"トータルプレイ時間:{ summary.TimeString }";
            chart.SelectedBrush = null;

            //PlayTimeListView.ItemsSource = tlist;
        }