Example #1
0
 internal Logger(clsGeneralSetting @params, string pfilename, string pEventSource)
 {
     this.LogInFile           = false;
     this.LogInEventSource    = false;
     this.LogInADO            = false;
     this.LogInMail           = false;
     this.MailLog             = new StringBuilder();
     this.LogInSBOTOOLS       = false;
     this.AutoManaged         = false;
     this.AutoManaged         = true;
     this.LogInEventSource    = @params.LogInWinEvents;
     this.LogEventSourceLevel = @params.LogInWinEvents_Level;
     this.LogInFile           = @params.LogInFile;
     this.LogInFileLevel      = @params.LogInFile_Level;
     this.LogInMail           = @params.ErrToMail;
     this.LogInMailLevel      = @params.ErrToMail_Level;
     this.LogInSBOTOOLS       = @params.LogInSBOTools;
     this.LogInADOLevel       = @params.LogInADO_Level;
     this.LogInADO            = @params.LogInADO;
     this.LogDirectory        = @params.LogInFile_Directory;
     this.reloadEventsVars(pEventSource);
     this.reloadFileVars(pfilename);
     //if (this.LogInADO)
     //{
     //    this.ADOCN = @params[@params.LogInADO_DBName].GetADOcnx(false);
     //}
 }
Example #2
0
        //public bool DBExists(string pName)
        //{
        //    int dBCount = checked(this.DBCount - 1);
        //    for (int i = 0; i <= dBCount; i = checked(i + 1))
        //    {
        //        if (Operators.CompareString(this[i].name, pName, false) == 0)
        //        {
        //            return true;
        //        }
        //    }
        //    return false;
        //}

        public static clsGeneralSetting FromXML(string sXML)
        {
            clsGeneralSetting _clsGeneralSetting;

            try
            {
                SoapFormatter soapFormatter = new SoapFormatter();
                byte[]        numArray      = new byte[checked (checked (sXML.Length * 2) + 1)];
                Encoding.UTF8.GetBytes(sXML, 0, sXML.Length, numArray, 0);
                MemoryStream memoryStream = new MemoryStream(numArray);
                soapFormatter.TypeFormat = FormatterTypeStyle.XsdString;
                _clsGeneralSetting       = (clsGeneralSetting)soapFormatter.Deserialize(memoryStream);
            }
            catch (Exception exception)
            {
                ProjectData.SetProjectError(exception);
                _clsGeneralSetting = new clsGeneralSetting();
                ProjectData.ClearProjectError();
            }
            return(_clsGeneralSetting);
        }