Ejemplo n.º 1
0
        private ComparisonRecordInfoWrapper GetWrappedRecordInfo(ComparisonRecordInfo comparisonRecordInfo)
        {
            var wrappedRecordInfo = new ComparisonRecordInfoWrapper(comparisonRecordInfo,
                                                                    ComparisonModel, ComparisonLShapeCollection);

            return(wrappedRecordInfo);
        }
        public ComparisonRecordInfoWrapper(ComparisonRecordInfo info, ComparisonViewModel viewModel)
        {
            WrappedRecordInfo = info;
            _viewModel        = viewModel;

            _setFileRecordInfoExternalEvent =
                viewModel.EventAggregator.GetEvent <PubSubEvent <ViewMessages.SetFileRecordInfoExternal> >();

            RemoveCommand    = new DelegateCommand(OnRemove);
            MouseDownCommand = new DelegateCommand(OnMouseDown);
        }
Ejemplo n.º 3
0
        private ComparisonRecordInfoWrapper GetWrappedRecordInfo(ComparisonRecordInfo comparisonRecordInfo)
        {
            var wrappedComparisonRecordInfo = new ComparisonRecordInfoWrapper(comparisonRecordInfo, this);

            var color = _comparisonColorManager.GetNextFreeColor();

            wrappedComparisonRecordInfo.Color = color;
            wrappedComparisonRecordInfo.FrametimeGraphColor = color.Color;

            return(wrappedComparisonRecordInfo);
        }
Ejemplo n.º 4
0
        internal ChartLabel GetChartLabel(ComparisonRecordInfo record)
        {
            var firstContext  = GetLabelForContext(record, SelectedComparisonContext);
            var secondContext = GetLabelForContext(record, SelectedSecondComparisonContext);

            var gameName = record.Game;
            var context  = string.Join(Environment.NewLine, new string[][] { firstContext, secondContext }.Select(labelLines =>
            {
                return(string.Join(Environment.NewLine, labelLines.Select(line => line.PadRight(PART_LENGTH))));
            }).Where(line => !string.IsNullOrWhiteSpace(line)));

            return(new ChartLabel()
            {
                GameName = gameName,
                Context = context
            });
        }
Ejemplo n.º 5
0
        private string[] GetLabelForContext(ComparisonRecordInfo record, EComparisonContext context)
        {
            switch (context)
            {
            case EComparisonContext.CPU:
                return(GetLabelLines(record.FileRecordInfo.ProcessorName));

            case EComparisonContext.GPU:
                return(GetLabelLines(record.FileRecordInfo.GraphicCardName));

            case EComparisonContext.SystemRam:
                return(GetLabelLines(record.FileRecordInfo.SystemRamInfo));

            case EComparisonContext.DateTime:
                return(GetLabelLines($"{record.FileRecordInfo.CreationDate} { record.FileRecordInfo.CreationTime}"));

            case EComparisonContext.Custom:
                return(GetLabelLines(record.FileRecordInfo.Comment));

            default:
                return(Array.Empty <string>());
            }
        }