public Win32StreamInfo(FileStreamType type, FileStreamAttributes attributes, Int64 size, String name) { StreamType = type; StreamAttributes = attributes; StreamSize = size; StreamName = name; }
/// <summary> /// Initializes a new instance of the <see cref="AlternateDataStreamInfo"/> class. /// </summary> /// <param name="filePath"> /// The full path of the file. /// This argument must not be <see langword="null"/>. /// </param> /// <param name="info"> /// The <see cref="SafeNativeMethods.Win32StreamInfo"/> containing the stream information. /// </param> internal AlternateDataStreamInfo(string filePath, SafeNativeMethods.Win32StreamInfo info) { _filePath = filePath; _streamName = info.StreamName; _streamType = info.StreamType; _attributes = info.StreamAttributes; _size = info.StreamSize; _exists = true; _fullPath = SafeNativeMethods.BuildStreamPath(_filePath, _streamName); }
/// <summary> /// Initializes a new instance of the <see cref="AlternateDataStreamInfo"/> class. /// </summary> /// <param name="filePath"> /// The full path of the file. /// This argument must not be <see langword="null"/>. /// </param> /// <param name="streamName"> /// The name of the stream /// This argument must not be <see langword="null"/>. /// </param> /// <param name="fullPath"> /// The full path of the stream. /// If this argument is <see langword="null"/>, it will be generated from the /// <paramref name="filePath"/> and <paramref name="streamName"/> arguments. /// </param> /// <param name="exists"> /// <see langword="true"/> if the stream exists; /// otherwise, <see langword="false"/>. /// </param> internal AlternateDataStreamInfo(string filePath, string streamName, string fullPath, bool exists) { if (string.IsNullOrEmpty(fullPath)) { fullPath = SafeNativeMethods.BuildStreamPath(filePath, streamName); } _streamType = FileStreamType.AlternateDataStream; _filePath = filePath; _streamName = streamName; _fullPath = fullPath; _exists = exists; if (_exists) { _size = SafeNativeMethods.GetFileSize(_fullPath); } }