/// <summary> /// Gets a properties value. /// </summary> /// <param name="keyName">The key name to look up.</param> /// <returns>The keys value on success; Otherwise, null.</returns> public string GetCFPropertyString(string keyName) { string value = null; IOKitFramework.GetCFPropertyString(this, keyName, out value); return(value); }
/// <summary> /// Iterates one step forward. /// </summary> /// <returns>A <see cref="IOObject"/> instance on success; Null if the iterator has reached it's end.</returns> public IOObject Next() { if (disposedValue) { throw new ObjectDisposedException("handle"); } if (handle == IntPtr.Zero) { throw new InvalidOperationException("Can not iterate over uninitialized objects."); } return(IOKitFramework.IOIteratorNext(this)); }
/// <summary> /// Frees managed and unmanaged resources. /// </summary> /// <param name="disposing">True if called from user space; Otherwise, false.</param> protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { // dispose managed state (managed objects). } if (handle != IntPtr.Zero) { IOKitFramework.CFRelease(this); handle = IntPtr.Zero; } disposedValue = true; } }
/// <summary> /// Gets a properties value. /// </summary> /// <param name="keyName">The key name to look up.</param> /// <returns>The keys value on success; Otherwise, null.</returns> public int GetCFPropertyInt(string keyName) { return(IOKitFramework.GetCFPropertyInt(this, keyName)); }