コード例 #1
0
 private void AddColumn(
     DataTable table, AsyncDataViewModelPreset templatePreset,
     ColumnViewModelPreset preset, DataColumn column)
 {
     column.Id            = preset.Id;
     column.Name          = preset.Name;
     column.Width         = preset.Width;
     column.IsVisible     = preset.IsVisible;
     column.TextAlignment = preset.TextAlignment;
     column.IsResizable   = true;
     table.Add(column);
     templatePreset.ConfigurableColumns.Add(preset);
 }
コード例 #2
0
 public GenericEventsViewModelSource()
 {
     providerIdPreset =
         new ColumnViewModelPreset {
         Id        = ProviderIdColumnId,
         Name      = "Provider Id",
         IsVisible = false,
         Width     = 100
     }.EnsureFrozen();
     providerNamePreset =
         new ColumnViewModelPreset {
         Id        = ProviderNameColumnId,
         Name      = "Provider",
         IsVisible = true,
         Width     = 150
     }.EnsureFrozen();
     idPreset =
         new ColumnViewModelPreset {
         Id        = IdColumnId,
         Name      = "Id",
         IsVisible = true,
         Width     = 50
     }.EnsureFrozen();
     versionPreset =
         new ColumnViewModelPreset {
         Id        = VersionColumnId,
         Name      = "Version",
         IsVisible = false,
         Width     = 80
     }.EnsureFrozen();
     channelPreset =
         new ColumnViewModelPreset {
         Id        = ChannelColumnId,
         Name      = "Channel",
         IsVisible = false,
         Width     = 80
     }.EnsureFrozen();
     channelNamePreset =
         new ColumnViewModelPreset {
         Id        = ChannelNameColumnId,
         Name      = "Channel Name",
         IsVisible = false,
         Width     = 80
     }.EnsureFrozen();
     levelPreset =
         new ColumnViewModelPreset {
         Id        = LevelColumnId,
         Name      = "Level",
         IsVisible = false,
         Width     = 80
     }.EnsureFrozen();
     levelNamePreset =
         new ColumnViewModelPreset {
         Id        = LevelNameColumnId,
         Name      = "Level Name",
         IsVisible = false,
         Width     = 80
     }.EnsureFrozen();
     taskPreset =
         new ColumnViewModelPreset {
         Id        = TaskColumnId,
         Name      = "Task",
         IsVisible = false,
         Width     = 80
     }.EnsureFrozen();
     taskNamePreset =
         new ColumnViewModelPreset {
         Id        = TaskNameColumnId,
         Name      = "Task Name",
         IsVisible = true,
         Width     = 80
     }.EnsureFrozen();
     opcodeOrTypePreset =
         new ColumnViewModelPreset {
         Id        = OpcodeColumnId,
         Name      = "Opcode/Type",
         IsVisible = false,
         Width     = 80
     }.EnsureFrozen();
     opcodeNamePreset =
         new ColumnViewModelPreset {
         Id        = OpcodeNameColumnId,
         Name      = "Opcode Name",
         IsVisible = true,
         Width     = 80
     }.EnsureFrozen();
     keywordPreset =
         new ColumnViewModelPreset {
         Id            = KeywordColumnId,
         Name          = "Keywords",
         IsVisible     = false,
         Width         = 115,
         TextAlignment = TextAlignment.Right,
         CellFormat    = "X"
     }.EnsureFrozen();
     keywordNamePreset =
         new ColumnViewModelPreset {
         Id        = KeywordNameColumnId,
         Name      = "Keywords Name",
         IsVisible = false,
         Width     = 115,
     }.EnsureFrozen();
     messagePreset =
         new ColumnViewModelPreset {
         Id        = MessageColumnId,
         Name      = "Message",
         IsVisible = true,
         Width     = 500
     }.EnsureFrozen();
     eventNamePreset =
         new ColumnViewModelPreset {
         Id        = new Guid(0xB82277B9, 0x7066, 0x4938, 0xA9, 0x59, 0xEA, 0xBF, 0x0C, 0x68, 0x90, 0x87),
         Name      = "Event Name",
         IsVisible = false,
         Width     = 100
     }.EnsureFrozen();
     eventTypePreset =
         new ColumnViewModelPreset {
         Id        = new Guid(0xAC2A6011, 0xBCB3, 0x4721, 0xBE, 0xF1, 0xE1, 0xDE, 0xC5, 0x0C, 0x07, 0x3D),
         Name      = "Event Type",
         IsVisible = false,
         Width     = 100
     }.EnsureFrozen();
     symbolPreset =
         new ColumnViewModelPreset {
         Id        = new Guid(0x79423887, 0x739E, 0x4DFF, 0x90, 0x45, 0x3D, 0xCF, 0x24, 0x3E, 0x29, 0x22),
         Name      = "Symbol",
         IsVisible = false,
         Width     = 100
     }.EnsureFrozen();
     cpuPreset =
         new ColumnViewModelPreset {
         Id        = new Guid(0x452A05E3, 0xA1C0, 0x4686, 0xBB, 0x6B, 0xC3, 0x9A, 0xFF, 0x2F, 0x24, 0xBE),
         Name      = "CPU",
         IsVisible = false,
         Width     = 30
     }.EnsureFrozen();
     threadIdPreset =
         new ColumnViewModelPreset {
         Id            = ThreadIdColumnId,
         Name          = "TID",
         IsVisible     = true,
         Width         = 40,
         TextAlignment = TextAlignment.Right,
         HelpText      = "Thread ID",
         CellFormat    = NumericalFormatProvider.Decimal
     }.EnsureFrozen();
     processIdPreset =
         new ColumnViewModelPreset {
         Id            = ProcessIdColumnId,
         Name          = "PID",
         IsVisible     = true,
         Width         = 40,
         TextAlignment = TextAlignment.Right,
         HelpText      = "Process ID (0 = PID Not Found)",
         CellFormat    = NumericalFormatProvider.Decimal
     }.EnsureFrozen();
     userDataPreset =
         new ColumnViewModelPreset {
         Id        = new Guid(0x2E47C924, 0x663F, 0x422A, 0x92, 0x32, 0xB1, 0xBC, 0xB1, 0x60, 0x22, 0x80),
         Name      = "UserData",
         IsVisible = false,
         Width     = 200
     }.EnsureFrozen();
     userDataLengthPreset =
         new ColumnViewModelPreset {
         Id        = new Guid(0x813F4638, 0x8D41, 0x4EAD, 0x94, 0xDD, 0x9A, 0x4A, 0xFF, 0xEF, 0xA7, 0x01),
         Name      = "UserData (Bytes)",
         IsVisible = false,
         Width     = 30
     }.EnsureFrozen();
     activityIdPreset =
         new ColumnViewModelPreset {
         Id        = new Guid(0x21695563, 0xAC1B, 0x4953, 0x9B, 0x9B, 0x99, 0x13, 0x53, 0xDB, 0xC0, 0x82),
         Name      = "etw:ActivityId",
         IsVisible = false,
         Width     = 60
     }.EnsureFrozen();
     relatedActivityIdPreset =
         new ColumnViewModelPreset {
         Id        = new Guid(0x83B1BF6F, 0x5E8D, 0x4143, 0xA8, 0x4B, 0x8C, 0x16, 0xED, 0x1E, 0xF6, 0xBD),
         Name      = "etw:Related ActivityId",
         IsVisible = false,
         Width     = 60
     }.EnsureFrozen();
     userSecurityIdentifierPreset =
         new ColumnViewModelPreset {
         Id        = new Guid(0xF979E52D, 0xEE1B, 0x4A7E, 0x95, 0x0F, 0x28, 0x10, 0x39, 0x90, 0xD1, 0x1B),
         Name      = "etw:UserSid",
         IsVisible = false,
         Width     = 60
     }.EnsureFrozen();
     sessionIdPreset =
         new ColumnViewModelPreset {
         Id        = new Guid(0x84FC6D0C, 0x5FFD, 0x40D9, 0x8C, 0x3B, 0xF0, 0xEB, 0x8F, 0x8F, 0x2D, 0x1B),
         Name      = "etw:SessionId",
         IsVisible = false,
         Width     = 60
     }.EnsureFrozen();
     eventKeyPreset =
         new ColumnViewModelPreset {
         Id        = new Guid(0x4F0679D2, 0xB5E7, 0x4AB1, 0xAD, 0xF7, 0xFC, 0xDE, 0xBE, 0xEF, 0x80, 0x1B),
         Name      = "etw:EventKey",
         IsVisible = false,
         Width     = 80
     }.EnsureFrozen();
     timePointGeneratorPreset =
         new ColumnViewModelPreset {
         Id            = new Guid(0x9C75AA69, 0x046E, 0x42AE, 0xB5, 0x94, 0xB4, 0xAD, 0x24, 0x33, 0x5A, 0x0A),
         Name          = "Time (Raw)",
         IsVisible     = false,
         Width         = 145,
         TextAlignment = TextAlignment.Right,
         CellFormat    = TimePointFormatter.FormatSecondsGrouped
     }.EnsureFrozen();
     timeAbsoluteGeneratorPreset =
         new ColumnViewModelPreset {
         Id         = TimeAbsoluteColumnId,
         Name       = "Time",
         IsVisible  = false,
         Width      = 100,
         CellFormat = "HH:mm:ss.fffffff"
     }.EnsureFrozen();
     timeRelativeGeneratorPreset =
         new ColumnViewModelPreset {
         Id         = TimeRelativeColumnId,
         Name       = "Time Elapsed",
         IsVisible  = true,
         Width      = 120,
         CellFormat = "HH:mm:ss.fffffff"
     }.EnsureFrozen();
     decodingSourcePreset =
         new ColumnViewModelPreset {
         Id    = DecodingSourceColumnId,
         Name  = "Decoding Source",
         Width = 150,
     }.EnsureFrozen();
     modernProcessDataPreset =
         new ColumnViewModelPreset {
         Id        = new Guid(0xDC7E68B0, 0xE753, 0x47DF, 0x83, 0x57, 0x61, 0xBE, 0xC0, 0x93, 0xE4, 0x05),
         Name      = "Process",
         IsVisible = true,
         Width     = 150
     }.EnsureFrozen();
     processNamePreset =
         new ColumnViewModelPreset {
         Id        = new Guid(0xBB09F706, 0xFE79, 0x43AA, 0xA1, 0x03, 0x12, 0x08, 0x01, 0xDA, 0xC2, 0x8F),
         Name      = "Process Name",
         IsVisible = true,
         Width     = 150
     }.EnsureFrozen();
     stackTopPreset =
         new ColumnViewModelPreset {
         Id        = new Guid(0xD55383F4, 0xD0ED, 0x404B, 0x98, 0xA8, 0xDC, 0x9C, 0xF4, 0x53, 0x3F, 0xBF),
         Name      = "Stack",
         IsVisible = false,
         Width     = 100
     }.EnsureFrozen();
     threadStartModulePreset =
         new ColumnViewModelPreset {
         Id        = new Guid(0xD58C42B0, 0x818D, 0x4D83, 0xBD, 0x99, 0x9D, 0xA8, 0x72, 0xE7, 0x7B, 0x54),
         Name      = "Thread Start Module",
         IsVisible = false,
         Width     = 100
     }.EnsureFrozen();
     threadStartFunctionPreset =
         new ColumnViewModelPreset {
         Id        = new Guid(0x125BB527, 0x34C6, 0x4A33, 0x82, 0xB8, 0x05, 0xE3, 0xB0, 0xC7, 0xA5, 0x91),
         Name      = "Thread Start Function",
         IsVisible = false,
         Width     = 100
     }.EnsureFrozen();
 }
コード例 #3
0
        public static AsyncDataViewModelPreset CreateDefaultPreset()
        {
            var providerIdPreset =
                new ColumnViewModelPreset {
                Id        = ProviderIdColumnId,
                Name      = "Provider Id",
                IsVisible = false,
                Width     = 100
            }.EnsureFrozen();
            var providerNamePreset =
                new ColumnViewModelPreset {
                Id        = ProviderNameColumnId,
                Name      = "Provider",
                IsVisible = true,
                Width     = 150
            }.EnsureFrozen();
            var idPreset =
                new ColumnViewModelPreset {
                Id        = IdColumnId,
                Name      = "Id",
                IsVisible = true,
                Width     = 50
            }.EnsureFrozen();
            var versionPreset =
                new ColumnViewModelPreset {
                Id        = VersionColumnId,
                Name      = "Version",
                IsVisible = false,
                Width     = 80
            }.EnsureFrozen();
            var channelPreset =
                new ColumnViewModelPreset {
                Id        = ChannelColumnId,
                Name      = "Channel",
                IsVisible = false,
                Width     = 80
            }.EnsureFrozen();
            var channelNamePreset =
                new ColumnViewModelPreset {
                Id        = ChannelNameColumnId,
                Name      = "Channel Name",
                IsVisible = false,
                Width     = 80
            }.EnsureFrozen();
            var levelPreset =
                new ColumnViewModelPreset {
                Id        = LevelColumnId,
                Name      = "Level",
                IsVisible = false,
                Width     = 80
            }.EnsureFrozen();
            var levelNamePreset =
                new ColumnViewModelPreset {
                Id        = LevelNameColumnId,
                Name      = "Level Name",
                IsVisible = false,
                Width     = 80
            }.EnsureFrozen();
            var taskPreset =
                new ColumnViewModelPreset {
                Id        = TaskColumnId,
                Name      = "Task",
                IsVisible = false,
                Width     = 80
            }.EnsureFrozen();
            var taskNamePreset =
                new ColumnViewModelPreset {
                Id        = TaskNameColumnId,
                Name      = "Task Name",
                IsVisible = true,
                Width     = 80
            }.EnsureFrozen();
            var opcodeOrTypePreset =
                new ColumnViewModelPreset {
                Id        = OpcodeColumnId,
                Name      = "Opcode/Type",
                IsVisible = false,
                Width     = 80
            }.EnsureFrozen();
            var opcodeNamePreset =
                new ColumnViewModelPreset {
                Id        = OpcodeNameColumnId,
                Name      = "Opcode Name",
                IsVisible = true,
                Width     = 80
            }.EnsureFrozen();
            var keywordPreset =
                new ColumnViewModelPreset {
                Id            = KeywordColumnId,
                Name          = "Keywords",
                IsVisible     = false,
                Width         = 115,
                TextAlignment = TextAlignment.Right,
                CellFormat    = "X"
            }.EnsureFrozen();
            var messagePreset =
                new ColumnViewModelPreset {
                Id        = MessageColumnId,
                Name      = "Message",
                IsVisible = true,
                Width     = 500
            }.EnsureFrozen();
            var processIdPreset =
                new ColumnViewModelPreset {
                Id            = ProcessIdColumnId,
                Name          = "PID",
                IsVisible     = true,
                Width         = 40,
                TextAlignment = TextAlignment.Right,
                HelpText      = "Process ID",
                CellFormat    = NumericalFormatProvider.Decimal
            }.EnsureFrozen();
            var threadIdPreset =
                new ColumnViewModelPreset {
                Id            = ThreadIdColumnId,
                Name          = "TID",
                IsVisible     = true,
                Width         = 40,
                TextAlignment = TextAlignment.Right,
                HelpText      = "Thread ID",
                CellFormat    = NumericalFormatProvider.Decimal
            }.EnsureFrozen();
            var timeAbsoluteGeneratorPreset =
                new ColumnViewModelPreset {
                Id         = TimeAbsoluteColumnId,
                Name       = "Time",
                IsVisible  = false,
                Width      = 120,
                CellFormat = "HH:mm:ss.fffffff"
            }.EnsureFrozen();
            var timeRelativeGeneratorPreset =
                new ColumnViewModelPreset {
                Id         = TimeRelativeColumnId,
                Name       = "Time Elapsed",
                IsVisible  = true,
                Width      = 120,
                CellFormat = "G"
            }.EnsureFrozen();

            var preset = new AsyncDataViewModelPreset {
                Name = "Default",
                LeftFrozenColumnCount = 2,
                ConfigurableColumns   =
                {
                    timeAbsoluteGeneratorPreset,
                    timeRelativeGeneratorPreset,
                    providerIdPreset,
                    providerNamePreset,
                    idPreset,
                    versionPreset,
                    channelPreset,
                    channelNamePreset,
                    taskPreset,
                    taskNamePreset,
                    opcodeNamePreset,
                    opcodeOrTypePreset,
                    levelPreset,
                    levelNamePreset,
                    keywordPreset,
                    processIdPreset,
                    threadIdPreset,
                    messagePreset,
                }
            };

            preset.Freeze();

            return(preset);
        }