Ejemplo n.º 1
0
        public virtual XElement GetDiagnosticInfo(string argument)
        {
            XElement xelement = new XElement("context");

            if (this.ServerName != null || this.ServerVersion != null)
            {
                xelement.Add(new XElement("server", new object[]
                {
                    new XAttribute("guid", (this.ServerGuid != null) ? this.ServerGuid.Value.ToString() : "null"),
                    new XAttribute("name", this.ServerName ?? "null"),
                    new XAttribute("role", this.ServerRole ?? "null"),
                    new XAttribute("version", (this.ServerVersion != null) ? this.ServerVersion.ToString() : "null")
                }));
            }
            if (this.ProcessName != null)
            {
                xelement.Add(new XElement("process", new XAttribute("name", this.ProcessName)));
            }
            if (this.DagOrServerGuid != null)
            {
                xelement.Add(new XElement("dagorserver", new XAttribute("guid", this.DagOrServerGuid.Value.ToString())));
            }
            if (this.DatabaseName != null || this.DatabaseVersion != null)
            {
                xelement.Add(new XElement("database", new object[]
                {
                    new XAttribute("guid", (this.DatabaseGuid != null) ? this.DatabaseGuid.Value.ToString() : "null"),
                    new XAttribute("name", this.DatabaseName ?? "null"),
                    new XAttribute("version", (this.DatabaseVersion != null) ? this.DatabaseVersion.ToString() : "null")
                }));
            }
            if (this.OrganizationName != null || this.OrganizationVersion != null)
            {
                xelement.Add(new XElement("organization", new object[]
                {
                    new XAttribute("name", this.OrganizationName ?? "null"),
                    new XAttribute("version", (this.OrganizationVersion != null) ? this.OrganizationVersion.ToString() : "null")
                }));
            }
            if (this.MailboxGuid != null)
            {
                xelement.Add(new XElement("mailbox", new XAttribute("guid", this.MailboxGuid)));
            }
            IDiagnosableObject nextContext = this.NextContext;

            if (nextContext != null)
            {
                XElement diagnosticInfo = nextContext.GetDiagnosticInfo(argument);
                diagnosticInfo.Name = "nextContext";
                xelement.Add(diagnosticInfo);
            }
            return(xelement);
        }
 public DiagnosableServiceIssue(IDiagnosableObject diagnosableObject, string error) : base(error)
 {
     this.DiagnosableObject = diagnosableObject;
 }