public XenStoreStringArray(uint Num, XenStoreStringArrayHandle strings) { System.IntPtr[] valuePointers = this.strings.GetValues(Num); this.stringHandles = System.Linq.Enumerable.ToArray<XenStoreStringHandle>( System.Linq.Enumerable.Select<System.IntPtr, XenStoreStringHandle>(valuePointers, CreateXenStoreStringHandle) ); this.Num = Num; this.strings = strings; }
public XenStoreStringArray(uint Num, XenStoreStringArrayHandle strings) { System.IntPtr[] valuePointers = this.strings.GetValues(Num); this.stringHandles = System.Linq.Enumerable.ToArray<XenStoreStringHandle>( System.Linq.Enumerable.Select<System.IntPtr, XenStoreStringHandle>(valuePointers, CreateXenStoreStringHandle) ); this.Num = Num; this.strings = strings; }
/// <summary> /// Friendly version of xs2_directory wrapping up results. /// </summary> /// <param name="handle">XenStore handle.</param> /// <param name="path">XenStore path</param> /// <returns>XenStoreStringArray which can read out the string values.</returns> public static XenStoreStringArray xs2_directory(XenStoreHandle handle, string path) { XenStoreStringArray result = null; uint num; XenStoreStringArrayHandle directory = xs2_directory_impl(handle, path, out num); result = new XenStoreStringArray(num, directory); return result; }
public void Dispose() { XenStoreStringHandle[] cleanupStringHandles = this.stringHandles; XenStoreStringArrayHandle cleanupStrings = this.strings; this.stringHandles = null; this.strings = null; // Managed code cleanup. if (cleanupStringHandles != null) { // Free the XenStore strings. foreach (XenStoreStringHandle stringArrayHandle in cleanupStringHandles) { //stringArrayHandle.Dispose(); } } if (cleanupStrings != null) { // Free the XenStore string array. //cleanupStrings.Dispose(); } }
public void Dispose() { XenStoreStringHandle[] cleanupStringHandles = this.stringHandles; XenStoreStringArrayHandle cleanupStrings = this.strings; this.stringHandles = null; this.strings = null; // Managed code cleanup. if (cleanupStringHandles != null) { // Free the XenStore strings. foreach (XenStoreStringHandle stringArrayHandle in cleanupStringHandles) { //stringArrayHandle.Dispose(); } } if (cleanupStrings != null) { // Free the XenStore string array. //cleanupStrings.Dispose(); } }