protected bool OnAdding(CompilerWarning warning)
        {
            EventHandler <CompilerWarningEventArgs> adding = Adding;

            if (null == adding)
            {
                return(true);
            }
            var args = new CompilerWarningEventArgs(warning);

            adding(this, args);
            return(!args.IsCancelled);
        }
예제 #2
0
        void OnCompilerWarning(object o, CompilerWarningEventArgs args)
        {
            CompilerWarning warning = args.Warning;

            if (Parameters.NoWarn || Parameters.DisabledWarnings.Contains(warning.Code))
            {
                args.Cancel();
            }
            if (Parameters.WarnAsError || Parameters.WarningsAsErrors.Contains(warning.Code))
            {
                Errors.Add(new CompilerError(warning.Code, warning.LexicalInfo, warning.Message, null));
                args.Cancel();
            }
        }