コード例 #1
0
        ///<summary>
        /// Gets the Habanero AutoCompleteMode equivalent to the provided System.Windows.AutoCompleteMode
        ///</summary>
        ///<param name="autoCompleteMode">A System.Windows.Forms AutoCompleteMode.</param>
        ///<returns>The equivalent Habanero AutoCompleteMode.</returns>
        public static Base.AutoCompleteMode GetAutoCompleteMode(System.Windows.Forms.AutoCompleteMode autoCompleteMode)
        {
            switch (autoCompleteMode)
            {
            case System.Windows.Forms.AutoCompleteMode.None: return(Base.AutoCompleteMode.None);

            case System.Windows.Forms.AutoCompleteMode.Append: return(Base.AutoCompleteMode.Append);

            case System.Windows.Forms.AutoCompleteMode.Suggest: return(Base.AutoCompleteMode.Suggest);

            case System.Windows.Forms.AutoCompleteMode.SuggestAppend: return(Base.AutoCompleteMode.SuggestAppend);
            }
            return((Base.AutoCompleteMode)autoCompleteMode);
        }
コード例 #2
0
 internal void SetAutoComplete(bool reset)
 {
     if ((!this.Multiline && (this.passwordChar == '\0')) && (!this.useSystemPasswordChar && (this.AutoCompleteSource != System.Windows.Forms.AutoCompleteSource.None)))
     {
         if (this.AutoCompleteMode != System.Windows.Forms.AutoCompleteMode.None)
         {
             if (!this.fromHandleCreate)
             {
                 System.Windows.Forms.AutoCompleteMode autoCompleteMode = this.AutoCompleteMode;
                 this.autoCompleteMode = System.Windows.Forms.AutoCompleteMode.None;
                 base.RecreateHandle();
                 this.autoCompleteMode = autoCompleteMode;
             }
             if (this.AutoCompleteSource == System.Windows.Forms.AutoCompleteSource.CustomSource)
             {
                 if (base.IsHandleCreated && (this.AutoCompleteCustomSource != null))
                 {
                     if (this.AutoCompleteCustomSource.Count == 0)
                     {
                         this.ResetAutoComplete(true);
                     }
                     else if (this.stringSource != null)
                     {
                         this.stringSource.RefreshList(this.GetStringsForAutoComplete());
                     }
                     else
                     {
                         this.stringSource = new StringSource(this.GetStringsForAutoComplete());
                         if (!this.stringSource.Bind(new HandleRef(this, base.Handle), (int) this.AutoCompleteMode))
                         {
                             throw new ArgumentException(System.Windows.Forms.SR.GetString("AutoCompleteFailure"));
                         }
                     }
                 }
             }
             else
             {
                 try
                 {
                     if (base.IsHandleCreated)
                     {
                         int num = 0;
                         if (this.AutoCompleteMode == System.Windows.Forms.AutoCompleteMode.Suggest)
                         {
                             num |= -1879048192;
                         }
                         if (this.AutoCompleteMode == System.Windows.Forms.AutoCompleteMode.Append)
                         {
                             num |= 0x60000000;
                         }
                         if (this.AutoCompleteMode == System.Windows.Forms.AutoCompleteMode.SuggestAppend)
                         {
                             num |= 0x10000000;
                             num |= 0x40000000;
                         }
                         System.Windows.Forms.SafeNativeMethods.SHAutoComplete(new HandleRef(this, base.Handle), ((int) this.AutoCompleteSource) | num);
                     }
                 }
                 catch (SecurityException)
                 {
                 }
             }
         }
         else if (reset)
         {
             this.ResetAutoComplete(true);
         }
     }
 }
コード例 #3
0
 internal void SetAutoComplete(bool reset)
 {
     if ((!this.Multiline && (this.passwordChar == '\0')) && (!this.useSystemPasswordChar && (this.AutoCompleteSource != System.Windows.Forms.AutoCompleteSource.None)))
     {
         if (this.AutoCompleteMode != System.Windows.Forms.AutoCompleteMode.None)
         {
             if (!this.fromHandleCreate)
             {
                 System.Windows.Forms.AutoCompleteMode autoCompleteMode = this.AutoCompleteMode;
                 this.autoCompleteMode = System.Windows.Forms.AutoCompleteMode.None;
                 base.RecreateHandle();
                 this.autoCompleteMode = autoCompleteMode;
             }
             if (this.AutoCompleteSource == System.Windows.Forms.AutoCompleteSource.CustomSource)
             {
                 if (base.IsHandleCreated && (this.AutoCompleteCustomSource != null))
                 {
                     if (this.AutoCompleteCustomSource.Count == 0)
                     {
                         this.ResetAutoComplete(true);
                     }
                     else if (this.stringSource != null)
                     {
                         this.stringSource.RefreshList(this.GetStringsForAutoComplete());
                     }
                     else
                     {
                         this.stringSource = new StringSource(this.GetStringsForAutoComplete());
                         if (!this.stringSource.Bind(new HandleRef(this, base.Handle), (int)this.AutoCompleteMode))
                         {
                             throw new ArgumentException(System.Windows.Forms.SR.GetString("AutoCompleteFailure"));
                         }
                     }
                 }
             }
             else
             {
                 try
                 {
                     if (base.IsHandleCreated)
                     {
                         int num = 0;
                         if (this.AutoCompleteMode == System.Windows.Forms.AutoCompleteMode.Suggest)
                         {
                             num |= -1879048192;
                         }
                         if (this.AutoCompleteMode == System.Windows.Forms.AutoCompleteMode.Append)
                         {
                             num |= 0x60000000;
                         }
                         if (this.AutoCompleteMode == System.Windows.Forms.AutoCompleteMode.SuggestAppend)
                         {
                             num |= 0x10000000;
                             num |= 0x40000000;
                         }
                         System.Windows.Forms.SafeNativeMethods.SHAutoComplete(new HandleRef(this, base.Handle), ((int)this.AutoCompleteSource) | num);
                     }
                 }
                 catch (SecurityException)
                 {
                 }
             }
         }
         else if (reset)
         {
             this.ResetAutoComplete(true);
         }
     }
 }
コード例 #4
0
 private void SetAutoComplete(bool reset, bool recreate)
 {
     if (base.IsHandleCreated && (this.childEdit != null))
     {
         if (this.AutoCompleteMode != System.Windows.Forms.AutoCompleteMode.None)
         {
             if ((!this.fromHandleCreate && recreate) && base.IsHandleCreated)
             {
                 System.Windows.Forms.AutoCompleteMode autoCompleteMode = this.AutoCompleteMode;
                 this.autoCompleteMode = System.Windows.Forms.AutoCompleteMode.None;
                 base.RecreateHandle();
                 this.autoCompleteMode = autoCompleteMode;
             }
             if (this.AutoCompleteSource == System.Windows.Forms.AutoCompleteSource.CustomSource)
             {
                 if (this.AutoCompleteCustomSource != null)
                 {
                     if (this.AutoCompleteCustomSource.Count == 0)
                     {
                         int flags = -1610612736;
                         System.Windows.Forms.SafeNativeMethods.SHAutoComplete(new HandleRef(this, this.childEdit.Handle), flags);
                     }
                     else if (this.stringSource != null)
                     {
                         this.stringSource.RefreshList(this.GetStringsForAutoComplete(this.AutoCompleteCustomSource));
                     }
                     else
                     {
                         this.stringSource = new StringSource(this.GetStringsForAutoComplete(this.AutoCompleteCustomSource));
                         if (!this.stringSource.Bind(new HandleRef(this, this.childEdit.Handle), (int) this.AutoCompleteMode))
                         {
                             throw new ArgumentException(System.Windows.Forms.SR.GetString("AutoCompleteFailure"));
                         }
                     }
                 }
             }
             else if (this.AutoCompleteSource == System.Windows.Forms.AutoCompleteSource.ListItems)
             {
                 if (this.DropDownStyle == ComboBoxStyle.DropDownList)
                 {
                     int num3 = -1610612736;
                     System.Windows.Forms.SafeNativeMethods.SHAutoComplete(new HandleRef(this, this.childEdit.Handle), num3);
                 }
                 else if (this.itemsCollection != null)
                 {
                     if (this.itemsCollection.Count == 0)
                     {
                         int num2 = -1610612736;
                         System.Windows.Forms.SafeNativeMethods.SHAutoComplete(new HandleRef(this, this.childEdit.Handle), num2);
                     }
                     else if (this.stringSource != null)
                     {
                         this.stringSource.RefreshList(this.GetStringsForAutoComplete(this.Items));
                     }
                     else
                     {
                         this.stringSource = new StringSource(this.GetStringsForAutoComplete(this.Items));
                         if (!this.stringSource.Bind(new HandleRef(this, this.childEdit.Handle), (int) this.AutoCompleteMode))
                         {
                             throw new ArgumentException(System.Windows.Forms.SR.GetString("AutoCompleteFailureListItems"));
                         }
                     }
                 }
             }
             else
             {
                 try
                 {
                     int num4 = 0;
                     if (this.AutoCompleteMode == System.Windows.Forms.AutoCompleteMode.Suggest)
                     {
                         num4 |= -1879048192;
                     }
                     if (this.AutoCompleteMode == System.Windows.Forms.AutoCompleteMode.Append)
                     {
                         num4 |= 0x60000000;
                     }
                     if (this.AutoCompleteMode == System.Windows.Forms.AutoCompleteMode.SuggestAppend)
                     {
                         num4 |= 0x10000000;
                         num4 |= 0x40000000;
                     }
                     System.Windows.Forms.SafeNativeMethods.SHAutoComplete(new HandleRef(this, this.childEdit.Handle), ((int) this.AutoCompleteSource) | num4);
                 }
                 catch (SecurityException)
                 {
                 }
             }
         }
         else if (reset)
         {
             int num5 = -1610612736;
             System.Windows.Forms.SafeNativeMethods.SHAutoComplete(new HandleRef(this, this.childEdit.Handle), num5);
         }
     }
 }