Example #1
0
 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;
 }
Example #2
0
 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;
 }
Example #3
0
        /// <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;
        }
Example #4
0
        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();
            }
        }
Example #5
0
        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();
            }
        }