/// <summary> /// Returns the number of keys in the volume with the specified state value /// </summary> /// /// <param name="KeyState">The state to search</param> /// /// <returns>The number of keys with that state</returns> public int KeyCount(VolumeKeyStates KeyState = VolumeKeyStates.Unassigned) { int count = 0; for (int i = 0; i < Count; i++) { if (State[i] == (byte)KeyState) { count++; } } return(count); }
/// <summary> /// Returns the number of keys in the volume with the specified state value /// </summary> /// /// <param name="KeyStream">The stream containing the VolumeKey</param> /// <param name="KeyState">The state to search</param> /// /// <returns>The number of keys with that state</returns> public static int KeyCount(Stream KeyStream, VolumeKeyStates KeyState = VolumeKeyStates.Unassigned) { // get the header VolumeKey vkey = new VolumeKey(KeyStream); int count = 0; for (int i = 0; i < vkey.Count; i++) { if (vkey.State[i] == (byte)KeyState) { count++; } } return(count); }
/// <summary> /// Returns the number of keys in the volume with the specified state value /// </summary> /// /// <param name="KeyState">The state to search</param> /// /// <returns>The number of keys with that state</returns> public int KeyCount(VolumeKeyStates KeyState = VolumeKeyStates.Unassigned) { int count = 0; for (int i = 0; i < Count; i++) { if (State[i] == (byte)KeyState) count++; } return count; }
/// <summary> /// Returns the number of keys in the volume with the specified state value /// </summary> /// /// <param name="KeyStream">The stream containing the VolumeKey</param> /// <param name="KeyState">The state to search</param> /// /// <returns>The number of keys with that state</returns> public static int KeyCount(Stream KeyStream, VolumeKeyStates KeyState = VolumeKeyStates.Unassigned) { // get the header VolumeKey vkey = new VolumeKey(KeyStream); int count = 0; for (int i = 0; i < vkey.Count; i++) { if (vkey.State[i] == (byte)KeyState) count++; } return count; }