Trace() private method

private Trace ( System exception ) : void
exception System
return void
Esempio n. 1
0
        public virtual void CreateDirectory(string newName)
        {
            if (String.IsNullOrEmpty(newName))
            {
                throw new ArgumentException(SR.GetString(SR.ParameterCannotBeNullOrEmpty, CultureInfo.CurrentUICulture), "newName");
            }

            try
            {
                // on a new dir && enter, we get called with the same name (so do nothing if name is the same
                char[] dummy = new char[1];
                dummy[0] = Path.DirectorySeparatorChar;
                string oldDir = this.Url;
                oldDir = oldDir.TrimEnd(dummy);
                string strNewDir = Path.Combine(Path.GetDirectoryName(oldDir), newName);

                if (!String.Equals(strNewDir, oldDir, StringComparison.OrdinalIgnoreCase))
                {
                    if (Directory.Exists(strNewDir))
                    {
                        throw new InvalidOperationException(SR.GetString(SR.DirectoryExistError, CultureInfo.CurrentUICulture));
                    }
                    Directory.CreateDirectory(strNewDir);
                }
            }
            //TODO - this should not digest all exceptions.
            catch (System.Exception e)
            {
                CciTracing.Trace(e);
                throw;
            }
        }
Esempio n. 2
0
 public virtual void CreateDirectory()
 {
     try
     {
         if (Directory.Exists(this.Url) == false)
         {
             Directory.CreateDirectory(this.Url);
         }
     }
     //TODO - this should not digest all exceptions.
     catch (System.Exception e)
     {
         CciTracing.Trace(e);
         throw;
     }
 }