ExceptionSummary() public static method

Logs a summary info about an exception.
public static ExceptionSummary ( Exception ex ) : void
ex System.Exception The logged exception.
return void
コード例 #1
0
ファイル: LoginData.cs プロジェクト: xwiki-attic/xwiki-office
        /// <summary>
        /// Gets the last used credentials.
        /// </summary>
        /// <returns>Array of strings containing the last used credentials</returns>
        public String[] GetCredentials()
        {
            String[]                  credentials = new String[3];
            IsolatedStorageFile       isFile      = null;
            IsolatedStorageFileStream stream      = null;
            StreamReader              reader      = null;

            try
            {
                isFile = IsolatedStorageFile.GetUserStoreForAssembly();
                stream = new IsolatedStorageFileStream(filename, FileMode.Open, isFile);
                reader = new StreamReader(stream);
                int i = 0;
                while (!reader.EndOfStream)
                {
                    String s = reader.ReadLine();
                    credentials[i] = s;
                    i++;
                }
            }
            catch (Exception ex)
            {
                Log.ExceptionSummary(ex);
                credentials = null;
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                if (stream != null)
                {
                    stream.Close();
                }
                if (isFile != null)
                {
                    isFile.Dispose();
                    isFile.Close();
                }
            }
            return(credentials);
        }
コード例 #2
0
ファイル: LoginData.cs プロジェクト: xwiki-attic/xwiki-office
        /// <summary>
        /// Erases the last saved credentials form isolated storage.
        /// </summary>
        public void ClearCredentials()
        {
            IsolatedStorageFile isFile = null;

            try
            {
                isFile = IsolatedStorageFile.GetUserStoreForAssembly();
                isFile.DeleteFile(filename);
            }
            catch (IsolatedStorageException ex)
            {
                Log.ExceptionSummary(ex);
            }
            finally
            {
                if (isFile != null)
                {
                    isFile.Dispose();
                    isFile.Close();
                }
            }
        }