Class Disk
Inheritance
System.Object
Disk
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Cosmos.System.FileSystem
Assembly: Cosmos.System2.dll
Syntax
public class Disk
Constructors
| Improve this Doc View SourceDisk(BlockDevice)
Declaration
public Disk(BlockDevice mainBlockDevice)
Parameters
Type | Name | Description |
---|---|---|
BlockDevice | mainBlockDevice |
Fields
| Improve this Doc View SourceHost
Main blockdevice that has all of the partitions.
Declaration
public BlockDevice Host
Field Value
Type | Description |
---|---|
BlockDevice |
Properties
| Improve this Doc View SourceIsMBR
Declaration
public bool IsMBR { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Partitions
List of partitions
Declaration
public List<ManagedPartition> Partitions { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<ManagedPartition> |
Size
The size of the disk in bytes.
Declaration
public long Size { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Type
Declaration
public BlockDeviceType Type { get; }
Property Value
Type | Description |
---|---|
BlockDeviceType |
Methods
| Improve this Doc View SourceClear()
Deletes all partitions on the disk.
Declaration
public void Clear()
CreatePartition(Int32)
Create Partition.
Declaration
public void CreatePartition(int size)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | size | Size in MB. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | Thrown if start / end is smaller then 0. |
System.ArgumentException | Thrown if end is smaller or equal to start. |
System.NotImplementedException | Thrown if partition type is GPT. |
DeletePartition(Int32)
Deletes a partition
Declaration
public void DeletePartition(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Partition index starting from 0 |
DisplayInformation()
Display information about the disk.
Declaration
public void DisplayInformation()
FormatPartition(Int32, String, Boolean)
Declaration
public void FormatPartition(int index, string format, bool quick = true)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | |
System.String | format | |
System.Boolean | quick |
Mount()
Mounts all of the partitions in the disk
Declaration
public void Mount()
MountPartition(Int32)
Mounts a partition
Declaration
public void MountPartition(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Partiton index |