private XmlDocument GetSelectedExceptions()
 {
     var objXML = new XmlDocument();
     try
     {
         var s = Request.Form["Exception"];
         if (s != null)
         {
             string[] excPositions = null;
             if (s.LastIndexOf(",") > 0)
             {
                 excPositions = s.Split(Convert.ToChar(","));
             }
             else if (!String.IsNullOrEmpty(s))
             {
                 excPositions = new[] {s};
             }
             var objLoggingController = new LogController();
             objXML.LoadXml("<LogEntries></LogEntries>");
             if (excPositions != null)
             {
                 var j = excPositions.Length;
                 for (var i = 0; i < excPositions.Length; i++)
                 {
                     j -= 1;
                     var excKey = excPositions[j].Split(Convert.ToChar("|"));
                     var objLogInfo = new LogInfo {LogGUID = excKey[0], LogFileID = excKey[1]};
                     var objNode = objXML.ImportNode((XmlNode) objLoggingController.GetSingleLog(objLogInfo, LoggingProvider.ReturnType.XML), true);
                     if (objXML.DocumentElement != null)
                     {
                         objXML.DocumentElement.AppendChild(objNode);
                     }
                 }
             }
         }
     }
     catch (Exception exc)
     {
         Exceptions.ProcessModuleLoadException(this, exc);
     }
     return objXML;
 }
Esempio n. 2
0
        private XmlDocument GetSelectedExceptions()
        {
            XmlDocument objXML = new XmlDocument();
            try
            {
                
                string s = Request.Form["Exception"];
                if( s != null )
                {
                    string[] arrExcPositions = new string[0];
                    if( s.LastIndexOf( "," ) > 0 )
                    {
                        arrExcPositions = s.Split( Convert.ToChar( "," ) );
                    }
                    else if( s.Length > 0 )
                    {
                        arrExcPositions = new string[1];
                        arrExcPositions[0] = s;
                    }

                    LogController objLoggingController = new LogController();

                    objXML.LoadXml( "<LogEntries></LogEntries>" );

                    int i;
                    int j = arrExcPositions.Length;
                    for( i = 1; i <= arrExcPositions.Length; i++ )
                    {
                        j--;
                        string[] excKey;
                        excKey = arrExcPositions[j].Split( Convert.ToChar( "|" ) );
                        LogInfo objLogInfo = new LogInfo();
                        objLogInfo.LogGUID = excKey[0];
                        objLogInfo.LogFileID = excKey[1];
                        XmlNode objNode;
                        objNode = objXML.ImportNode( ( (XmlNode)objLoggingController.GetSingleLog( objLogInfo, LoggingProvider.ReturnType.XML ) ), true );
                        objXML.DocumentElement.AppendChild( objNode );
                    }
                }
            }
            catch( Exception exc )
            {
                Exceptions.ProcessModuleLoadException( this, exc );
            }
            return objXML;
        }