Example #1
0
        /// <summary>
        /// <para>Reset the file attributes of a file so it can be overwritten.</para>
        /// </summary>
        /// <param name="filePath">
        /// <para>The fully qualified path to the file.</para>
        /// </param>
        public static void ChangeFileAttributesToWritable(string filePath)
        {
            ArgumentValidation.CheckForNullReference(filePath, "filePath");

            if (!File.Exists(filePath))
            {
                return;
            }
            FileAttributes attributes = File.GetAttributes(filePath);
            FileAttributes attr       = attributes | FileAttributes.ReadOnly;

            if (attr == attributes)
            {
                attributes ^= FileAttributes.ReadOnly;
                File.SetAttributes(filePath, attributes);
            }
        }
Example #2
0
 /// <summary>
 /// <para>Removes the entry with the specified <paramref name="name"/> from the collection.</para>
 /// </summary>
 /// <param name="name">
 /// <para>The name of the item to remove.</para>
 /// </param>
 /// <exception cref="ArgumentNullException">
 /// <para><paramref name="name"/> is a <see langword="null"/> reference (Nothing in Visual Basic).</para>
 /// </exception>
 public void Remove(string name)
 {
     ArgumentValidation.CheckForNullReference(name, "name");
     BaseRemove(name);
 }