コード例 #1
0
        /// <summary>
        ///  Constructor.
        /// </summary>
        public StringSource(string[] strings)
        {
            Array.Clear(strings, 0, size);

            if (strings != null)
            {
                this.strings = strings;
            }
            current = 0;
            size    = (strings == null) ? 0 : strings.Length;

            Guid    iid_iunknown = typeof(UnsafeNativeMethods.IAutoComplete2).GUID;
            HRESULT hr           = Ole32.CoCreateInstance(
                ref autoCompleteClsid,
                IntPtr.Zero,
                Ole32.CLSCTX.INPROC_SERVER,
                ref iid_iunknown,
                out object obj);

            if (!hr.Succeeded())
            {
                throw Marshal.GetExceptionForHR((int)hr);
            }

            autoCompleteObject2 = (UnsafeNativeMethods.IAutoComplete2)obj;
        }
コード例 #2
0
 public void ReleaseAutoComplete()
 {
     if (autoCompleteObject2 != null)
     {
         Marshal.ReleaseComObject(autoCompleteObject2);
         autoCompleteObject2 = null;
     }
 }
コード例 #3
0
 public void ReleaseAutoComplete()
 {
     if (this.autoCompleteObject2 != null)
     {
         Marshal.ReleaseComObject(this.autoCompleteObject2);
         this.autoCompleteObject2 = null;
     }
 }
コード例 #4
0
 public StringSource(string[] strings)
 {
     Array.Clear(strings, 0, this.size);
     if (strings != null)
     {
         this.strings = strings;
     }
     this.current = 0;
     this.size = (strings == null) ? 0 : strings.Length;
     Guid gUID = typeof(UnsafeNativeMethods.IAutoComplete2).GUID;
     object obj2 = UnsafeNativeMethods.CoCreateInstance(ref autoCompleteClsid, null, 1, ref gUID);
     this.autoCompleteObject2 = (UnsafeNativeMethods.IAutoComplete2) obj2;
 }
コード例 #5
0
        /// <include file='doc\StringSource.uex' path='docs/doc[@for="StringSource.StringSource"]/*' />
        /// <devdoc>
        ///    <para> 
        ///       Constructor.
        ///    </para>
        /// </devdoc>
        public StringSource(string[] strings) {
            Array.Clear(strings,0, size);
    
            if (strings != null) {
                this.strings = strings;
            }
            current = 0;
            size = (strings == null ) ? 0 : strings.Length;

            Guid iid_iunknown = typeof(UnsafeNativeMethods.IAutoComplete2).GUID;
            object obj = UnsafeNativeMethods.CoCreateInstance(ref autoCompleteClsid, null, NativeMethods.CLSCTX_INPROC_SERVER, ref iid_iunknown);

            autoCompleteObject2 = (UnsafeNativeMethods.IAutoComplete2)obj;
        }
コード例 #6
0
        public StringSource(string[] strings)
        {
            Array.Clear(strings, 0, this.size);
            if (strings != null)
            {
                this.strings = strings;
            }
            this.current = 0;
            this.size    = (strings == null) ? 0 : strings.Length;
            Guid   gUID = typeof(UnsafeNativeMethods.IAutoComplete2).GUID;
            object obj2 = UnsafeNativeMethods.CoCreateInstance(ref autoCompleteClsid, null, 1, ref gUID);

            this.autoCompleteObject2 = (UnsafeNativeMethods.IAutoComplete2)obj2;
        }
コード例 #7
0
        /// <summary>
        ///  Constructor.
        /// </summary>
        public StringSource(string[] strings)
        {
            Array.Clear(strings, 0, size);

            if (strings != null)
            {
                this.strings = strings;
            }
            current = 0;
            size    = (strings == null) ? 0 : strings.Length;

            Guid   iid_iunknown = typeof(UnsafeNativeMethods.IAutoComplete2).GUID;
            object obj          = UnsafeNativeMethods.CoCreateInstance(ref autoCompleteClsid, null, NativeMethods.CLSCTX_INPROC_SERVER, ref iid_iunknown);

            autoCompleteObject2 = (UnsafeNativeMethods.IAutoComplete2)obj;
        }