예제 #1
0
        InitializeDefaultDrives()
        {
            var type = typeof(T);

            var attr = (from DriveInfoAttribute a in type.GetCustomAttributes(typeof(DriveInfoAttribute), true)
                        select a
                        ).FirstOrDefault();

            if (null == attr)
            {
                throw new InvalidOperationException("DriveInfoAttribute is not available on the specified model");
            }

            var drive =
                new Drive <T>(new PSDriveInfo(attr.DriveName, this.ProviderInfo, attr.ProviderDriveRoot,
                                              attr.ProviderDescription, null));

            return(new Collection <PSDriveInfo> {
                drive
            });
        }
예제 #2
0
 public RootNodeFactory(Drive <T> drive, string name)
 {
     _drive = drive;
     _name  = name;
 }
예제 #3
0
 public RootNodeFactory(Drive <T> drive) : this(drive, drive.RootNodeName)
 {
 }