Show / Hide Table of Contents

Class FileInfoExtension

Extend the System.IO.FileInfo class with methods for testing, setting, and clearing file attribute flags, including the ability to save and restore flags to their initial states.

Inheritance
System.Object
FileInfoExtension
Namespace: WizardWrx
Assembly: WizardWrx.Core.dll
Syntax
public class FileInfoExtension : object

Constructors

| Improve this Doc View Source

FileInfoExtension(String)

We insist on a file name.

Declaration
public FileInfoExtension(string pstrFileName)
Parameters
Type Name Description
System.String pstrFileName

String containing the name of a file to process. This string must point to an existing file.

Remarks

Because of its intended use, this class is designed without a public default constructor. I believe that it is extremely unlikely that a user would need to serialize an instance of this class.

Properties

| Improve this Doc View Source

Archive

This property returns the current state of the Archive attribute.

Declaration
public bool Archive { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Compressed

This property returns the current state of the Compressed attribute.

Declaration
public bool Compressed { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Encrypted

This property returns the current state of the Encrypted attribute.

Declaration
public bool Encrypted { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Hidden

This property returns the current state of the Hidden attribute.

Declaration
public bool Hidden { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

NotContentIndexed

This property returns the current state of the NotContentIndexed attribute.

Declaration
public bool NotContentIndexed { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Offline

This property returns the current state of the Offline attribute.

Declaration
public bool Offline { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

ReadOnly

This property returns the current state of the ReadOnly attribute.

Declaration
public bool ReadOnly { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

System

This property returns the current state of the System attribute.

Declaration
public bool System { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Temporary

This property returns the current state of the Temporary attribute.

Declaration
public bool Temporary { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

TheFile

Return the underlying FileInfo object, which is initialized by the constructor.

Declaration
public FileInfo TheFile { get; }
Property Value
Type Description
FileInfo
| Improve this Doc View Source

WasArchive

Return the initial state of the Archive flag.

Declaration
public FileInfoExtension.enmInitialStatus WasArchive { get; }
Property Value
Type Description
FileInfoExtension.enmInitialStatus
Remarks

The value of this property is meaningless after the ArchiveReinstate method is called, and before either ArchiveClear or ArchiveSet has been called on an instance.

| Improve this Doc View Source

WasHidden

Return the initial state of the Hidden flag.

Declaration
public FileInfoExtension.enmInitialStatus WasHidden { get; }
Property Value
Type Description
FileInfoExtension.enmInitialStatus
Remarks

The value of this property is meaningless after the HiddenReinstate method is called, and before either HiddenClear or HiddenSet has been called on an instance.

| Improve this Doc View Source

WasReadOnly

Return the initial state of the ReadOnly flag.

Declaration
public FileInfoExtension.enmInitialStatus WasReadOnly { get; }
Property Value
Type Description
FileInfoExtension.enmInitialStatus
Remarks

The value of this property is meaningless after the ReadOnlyReinstate method is called, and before either ReadOnlyClear or ReadOnlySet has been called on an instance.

| Improve this Doc View Source

WasSystem

Return the initial state of the System flag.

Declaration
public FileInfoExtension.enmInitialStatus WasSystem { get; }
Property Value
Type Description
FileInfoExtension.enmInitialStatus
Remarks

The value of this property is meaningless after the SystemReinstate method is called, and before either SystemClear or SystemSet has been called on an instance.

Methods

| Improve this Doc View Source

ArchiveClear()

Clear the Archive flag.

Declaration
public FileInfoExtension.enmInitialStatus ArchiveClear()
Returns
Type Description
FileInfoExtension.enmInitialStatus

Previous state of the Archive flag.

Remarks

Since the initial state of the flag is preserved internally by the class, and can be read from the WasArchive property, callers may safely ignore or discard the return value.

| Improve this Doc View Source

ArchiveReinstate()

Restore the initial state of the Archive flag.

Declaration
public FileInfoExtension.enmInitialStatus ArchiveReinstate()
Returns
Type Description
FileInfoExtension.enmInitialStatus

Previous state of the Archive flag.

Remarks

Since the return value is strictly informational, callers may safely ignore or discard it.

| Improve this Doc View Source

ArchiveSet()

Set the Archive flag.

Declaration
public FileInfoExtension.enmInitialStatus ArchiveSet()
Returns
Type Description
FileInfoExtension.enmInitialStatus

Previous state of the Archive flag.

Remarks

Since the initial state of the flag is preserved internally by the class, and can be read from the WasArchive property, callers may safely ignore or discard the return value.

| Improve this Doc View Source

HiddenClear()

Clear the Hidden flag.

Declaration
public FileInfoExtension.enmInitialStatus HiddenClear()
Returns
Type Description
FileInfoExtension.enmInitialStatus

Previous state of the Hidden flag.

Remarks

Since the initial state of the flag is preserved internally by the class, and can be read from the WasHidden property, callers may safely ignore or discard the return value.

| Improve this Doc View Source

HiddenReinstate()

Restore the initial state of the Hidden flag.

Declaration
public FileInfoExtension.enmInitialStatus HiddenReinstate()
Returns
Type Description
FileInfoExtension.enmInitialStatus

Previous state of the Hidden flag.

Remarks

Since the return value is strictly informational, callers may safely ignore or discard it.

| Improve this Doc View Source

HiddenSet()

Set the Hidden flag.

Declaration
public FileInfoExtension.enmInitialStatus HiddenSet()
Returns
Type Description
FileInfoExtension.enmInitialStatus

Previous state of the Hidden flag.

Remarks

Since the initial state of the flag is preserved internally by the class, and can be read from the WasHidden property, callers may safely ignore or discard the return value.

| Improve this Doc View Source

ReadOnlyClear()

Clear the Read ONly flag.

Declaration
public FileInfoExtension.enmInitialStatus ReadOnlyClear()
Returns
Type Description
FileInfoExtension.enmInitialStatus

Previous state of the Read ONly flag.

Remarks

Since the initial state of the flag is preserved internally by the class, and can be read from the WasReadOnly property, callers may safely ignore or discard the return value.

| Improve this Doc View Source

ReadOnlyReinstate()

Restore the initial state of the Read Only flag.

Declaration
public FileInfoExtension.enmInitialStatus ReadOnlyReinstate()
Returns
Type Description
FileInfoExtension.enmInitialStatus

Previous state of the Read ONly flag.

Remarks

Since the return value is strictly informational, callers may safely ignore or discard it.

| Improve this Doc View Source

ReadOnlySet()

Set the Read Only flag.

Declaration
public FileInfoExtension.enmInitialStatus ReadOnlySet()
Returns
Type Description
FileInfoExtension.enmInitialStatus

Previous state of the Read ONly flag.

Remarks

Since the initial state of the flag is preserved internally by the class, and can be read from the WasReadOnly property, callers may safely ignore or discard the return value.

| Improve this Doc View Source

SystemClear()

Clear the System flag.

Declaration
public FileInfoExtension.enmInitialStatus SystemClear()
Returns
Type Description
FileInfoExtension.enmInitialStatus

Previous state of the System flag.

Remarks

Since the initial state of the flag is preserved internally by the class, and can be read from the WasSystem property, callers may safely ignore or discard the return value.

| Improve this Doc View Source

SystemReinstate()

Restore the initial state of the System flag.

Declaration
public FileInfoExtension.enmInitialStatus SystemReinstate()
Returns
Type Description
FileInfoExtension.enmInitialStatus

Previous state of the System flag.

Remarks

Since the return value is strictly informational, callers may safely ignore or discard it.

| Improve this Doc View Source

SystemSet()

Set the System flag.

Declaration
public FileInfoExtension.enmInitialStatus SystemSet()
Returns
Type Description
FileInfoExtension.enmInitialStatus

Previous state of the System flag.

Remarks

Since the initial state of the flag is preserved internally by the class, and can be read from the WasSystem property, callers may safely ignore or discard the return value.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX