Exemple #1
0
 protected override void ProcessOptions()
 {
     XmlDocFile = RemainingArguments.Single();
     if (!File.Exists(XmlDocFile))
     {
         throw new ArgumentException(String.Format("The specified file '{0}' does not exist.", XmlDocFile));
     }
 }
Exemple #2
0
        protected override void ProcessOptions()
        {
            base.ProcessOptions();
            ExcludedWriters = new HashSet <string>(StringComparer.OrdinalIgnoreCase);
            IncludedWriters = new HashSet <string>(StringComparer.OrdinalIgnoreCase);
            FileName        = RemainingArguments.Single();
            if (!File.Exists(FileName))
            {
                throw new ArgumentException(String.Format("The specified file '{0}' does not exist.", FileName));
            }

            if (HasOption(CommonOptions.OptExcludeWriter))
            {
                foreach (string writerName in GetOptionValues <string>(CommonOptions.OptExcludeWriter))
                {
                    if (ExcludedWriters.Add(writerName))
                    {
                        Host.WriteLine("(Option: Excluding writer/component '{0}')", writerName);
                    }
                }
            }

            if (HasOption(CommonOptions.OptVerifyWriterIncluded))
            {
                foreach (string writerName in GetOptionValues <string>(CommonOptions.OptVerifyWriterIncluded))
                {
                    if (ExcludedWriters.Contains(writerName))
                    {
                        throw new ArgumentException(String.Format("A writer cannot be both included and excluded: '{0}'.", writerName));
                    }

                    if (IncludedWriters.Add(writerName))
                    {
                        Host.WriteLine("(Option: Verifying inclusion of writer/component '{0}')", writerName);
                    }
                }
            }

            Simulate = HasOption(OptSimulated);
        }