コード例 #1
0
        public void RoundtripCriticalBuildMessageEventArgs()
        {
            var args = new CriticalBuildMessageEventArgs(
                "Subcategory",
                "Code",
                "File",
                1,
                2,
                3,
                4,
                "Message",
                "Help",
                "SenderName",
                DateTime.Parse("12/12/2015 06:11:56 PM"));

            Roundtrip(args,
                      e => e.Code,
                      e => e.ColumnNumber.ToString(),
                      e => e.EndColumnNumber.ToString(),
                      e => e.EndLineNumber.ToString(),
                      e => e.File,
                      e => e.LineNumber.ToString(),
                      e => e.Message,
                      e => e.ProjectFile,
                      e => e.Subcategory);
        }
コード例 #2
0
        private BuildEventArgs ReadCriticalBuildMessageEventArgs()
        {
            BuildEventArgsFields fields = ReadBuildEventArgsFields();

            /*(MessageImportance)*/ ReadInt32();

            CriticalBuildMessageEventArgs e = new CriticalBuildMessageEventArgs(
                fields.Subcategory,
                fields.Code,
                fields.File,
                fields.LineNumber,
                fields.ColumnNumber,
                fields.EndLineNumber,
                fields.EndColumnNumber,
                fields.Message,
                fields.HelpKeyword,
                fields.SenderName,
                fields.Timestamp)
            {
                BuildEventContext = fields.BuildEventContext,
                ProjectFile       = fields.ProjectFile
            };

            return(e);
        }
コード例 #3
0
        public void EventArgsCtors()
        {
            CriticalBuildMessageEventArgs cbmea = new CriticalBuildMessageEventArgs2();

            cbmea = new CriticalBuildMessageEventArgs("Subcategory", "Code", "File", 1, 2, 3, 4, "Message", "HelpKeyword", "Sender");
            cbmea = new CriticalBuildMessageEventArgs("Subcategory", "Code", "File", 1, 2, 3, 4, "Message", "HelpKeyword", "Sender", DateTime.Now);
            cbmea = new CriticalBuildMessageEventArgs("Subcategory", "Code", "File", 1, 2, 3, 4, "{0}", "HelpKeyword", "Sender", DateTime.Now, "Message");
            cbmea = new CriticalBuildMessageEventArgs(null, null, null, 0, 0, 0, 0, null, null, null);
            cbmea = new CriticalBuildMessageEventArgs(null, null, null, 0, 0, 0, 0, null, null, null, DateTime.Now);
            cbmea = new CriticalBuildMessageEventArgs(null, null, null, 0, 0, 0, 0, null, null, null, DateTime.Now, null);
        }
コード例 #4
0
 private void Write(CriticalBuildMessageEventArgs e)
 {
     Write(BinaryLogRecordKind.CriticalBuildMessage);
     WriteMessageFields(e);
 }