Пример #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;
     }
 }
 public void ReleaseAutoComplete()
 {
     if (this.autoCompleteObject2 != null)
     {
         Marshal.ReleaseComObject(this.autoCompleteObject2);
         this.autoCompleteObject2 = null;
     }
 }
 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;
        }
        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;
        }