예제 #1
0
        public XElement GetDiagnosticInfo(DiagnosableParameters parameters)
        {
            base.CheckDisposed();
            XElement xelement = new XElement(this.GetDiagnosticComponentName(), new XAttribute("name", this.schema.Name));

            xelement.Add(new XAttribute("LastUpdated", this.LastUpdated));
            ConfigDiagnosticArgument configDiagnosticArgument = new ConfigDiagnosticArgument(parameters.Argument);
            SettingsContextBase      settingsContextBase      = new DiagnosticSettingsContext(this.schema, configDiagnosticArgument);

            xelement.Add(settingsContextBase.GetDiagnosticInfo(parameters.Argument));
            if (configDiagnosticArgument.HasArgument("configname"))
            {
                string argument = configDiagnosticArgument.GetArgument <string>("configname");
                xelement.Add(new XElement("EffectiveSetting", new object[]
                {
                    new XAttribute("name", argument),
                    new XAttribute("value", this.GetConfig <string>(settingsContextBase, argument))
                }));
            }
            for (int i = 0; i < this.configDrivers.Count; i++)
            {
                IConfigDriver configDriver = this.configDrivers[i];
                xelement.Add(configDriver.GetDiagnosticInfo(parameters.Argument));
            }
            return(xelement);
        }
예제 #2
0
 private static ExchangeObjectVersion GetExchangeObjectVersion(ConfigDiagnosticArgument argument, string argumentName)
 {
     if (!argument.HasArgument(argumentName))
     {
         return(null);
     }
     return(ExchangeObjectVersion.Parse(argument.GetArgument <string>(argumentName)));
 }
예제 #3
0
 private static ServerVersion GetServerVersion(ConfigDiagnosticArgument argument, string argumentName)
 {
     if (!argument.HasArgument(argumentName))
     {
         return(null);
     }
     return(ServerVersion.ParseFromSerialNumber(argument.GetArgument <string>(argumentName)));
 }
예제 #4
0
 public DiagnosticSettingsContext(IConfigSchema schema, ConfigDiagnosticArgument argument) : base(null)
 {
     this.serverName          = argument.GetArgumentOrDefault <string>("servername", null);
     this.serverVersion       = DiagnosticSettingsContext.GetServerVersion(argument, "serverversion");
     this.processName         = argument.GetArgumentOrDefault <string>("processname", null);
     this.databaseName        = argument.GetArgumentOrDefault <string>("dbname", null);
     this.databaseVersion     = DiagnosticSettingsContext.GetServerVersion(argument, "dbversion");
     this.organizationName    = argument.GetArgumentOrDefault <string>("orgname", null);
     this.organizationVersion = DiagnosticSettingsContext.GetExchangeObjectVersion(argument, "orgversion");
     this.mailboxGuid         = argument.GetArgumentOrDefault <Guid?>("mailboxguid", null);
     if (argument.HasArgument("genericscope"))
     {
         this.propertyName  = argument.GetArgument <string>("genericscope");
         this.propertyValue = argument.GetArgumentOrDefault <string>("genericscopevalue", null);
         if (!argument.HasArgument("force"))
         {
             this.propertyValue = schema.ParseAndValidateScopeValue(this.propertyName, this.propertyValue);
         }
     }
 }