示例#1
0
 void T_Defaults()
 {
     _WatermarkText         = string.Empty;
     _UseSystemPasswordChar = false;
     _ReadOnly               = false;
     _MaxLength              = 32767;
     _TextAlign              = HorizontalAlignment.Left;
     State                   = MouseMode.Normal;
     _AutoCompleteMode       = AutoCompleteMode.None;
     _AutoCompleteSource     = AutoCompleteSource.None;
     _Lines                  = null;
     _Multiline              = false;
     T.Multiline             = _Multiline;
     T.Cursor                = Cursors.IBeam;
     T.BackColor             = BackColor;
     T.ForeColor             = ForeColor;
     T.BorderStyle           = BorderStyle.None;
     T.Location              = new Point(7, 8);
     T.Font                  = Font;
     T.UseSystemPasswordChar = UseSystemPasswordChar;
     if (Multiline)
     {
         T.Height = Height - 11;
     }
     else
     {
         Height = T.Height + 11;
     }
 }
示例#2
0
 public YoutubeTextbox()
 {
     SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);
     DoubleBuffered = true;
     UpdateStyles();
     _textAlign             = HorizontalAlignment.Left;
     _maxLength             = 32767;
     _readOnly              = false;
     _useSystemPasswordChar = false;
     _watermarkText         = string.Empty;
     _image = null;
     _state = HelperMethods.MouseMode.Normal;
     _autoCompleteSource = AutoCompleteSource.None;
     _autoCompleteMode   = AutoCompleteMode.None;
     _multiline          = false;
     _lines                  = null;
     Font                    = new Font("Segoe UI", 10);
     T.Multiline             = false;
     T.Cursor                = Cursors.IBeam;
     T.BackColor             = Colors.White;
     T.ForeColor             = Colors.Silver;
     T.BorderStyle           = BorderStyle.None;
     T.Location              = new Point(7, 8);
     T.Font                  = Font;
     T.UseSystemPasswordChar = UseSystemPasswordChar;
     Size                    = new Size(135, 30);
     if (Multiline)
     {
         T.Height = Height - 11;
     }
     else
     {
         Height = T.Height + 11;
     }
 }
示例#3
0
 public DGV_TextBoxCell()
     : base()
 {
     pAC = null;
       pACMode = AutoCompleteMode.None;
       pACSource = AutoCompleteSource.None;
 }
示例#4
0
 public void AutCompleteAddItems(string[] items, AutoCompleteMode autoCompleteMode)
 {
     this.Items.AddRange(items);
     this.TextBox.AutoCompleteMode   = autoCompleteMode;
     this.TextBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
     this.TextBox.AutoCompleteCustomSource.AddRange(items);
 }
        private void AutoCompleteModeLayout()
        {
            /*******************
             **AutoCompleteMode**
             ********************/
            TextView autoCompleteModeLabel = new TextView(context);

            autoCompleteModeLabel.Text     = "AutoComplete Mode";
            autoCompleteModeLabel.TextSize = 20;
            autoCompleteModeLabel.Gravity  = GravityFlags.Left;

            //SpaceTExt
            TextView textSpacing = new TextView(context);

            propertylayout.AddView(textSpacing);
            autoCompleteModeSpinner = new Spinner(context, SpinnerMode.Dialog);
            propertylayout.AddView(autoCompleteModeLabel);
            propertylayout.AddView(autoCompleteModeSpinner);

            //AutoCompleteModeList
            List <String> autoCompleteModeList = new List <String>();

            autoCompleteModeList.Add("Suggest");
            autoCompleteModeList.Add("SuggestAppend");
            autoCompleteModeList.Add("Append");
            autoCompleteModeDataAdapter = new ArrayAdapter <String>(context, Android.Resource.Layout.SimpleSpinnerItem, autoCompleteModeList);
            autoCompleteModeDataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            autoCompleteModeSpinner.Adapter = autoCompleteModeDataAdapter;

            //autoCompleteModeSpinner ItemSelected Listener
            autoCompleteModeSpinner.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => {
                String selectedItem = autoCompleteModeDataAdapter.GetItem(e.Position);
                if (selectedItem.Equals("Suggest"))
                {
                    autoCompleteMode = AutoCompleteMode.Suggest;
                }
                else if (selectedItem.Equals("SuggestAppend"))
                {
                    autoCompleteMode = AutoCompleteMode.SuggestAppend;
                }
                else if (selectedItem.Equals("Append"))
                {
                    autoCompleteMode = AutoCompleteMode.Append;
                }
            };

            //Separator
            SeparatorView separate1 = new SeparatorView(context, width * 2);

            separate1.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
            LinearLayout.LayoutParams autoCompleteModeLayoutParams = new LinearLayout.LayoutParams(width * 2, 5);
            autoCompleteModeLayoutParams.SetMargins(0, 20, 0, 0);
            propertylayout.SetPadding(5, 0, 5, 0);

            //autoCompleteModeSeparator
            SeparatorView autoCompleteModeSeparate = new SeparatorView(context, width * 2);

            autoCompleteModeSeparate.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
            //propertylayout.AddView(autoCompleteModeSeparate, autoCompleteModeLayoutParams);
        }
示例#6
0
        private void AutoCompleteModeLayout()
        {
            /*******************
             **AutoCompleteMode**
             ********************/
            TextView autoCompleteModeLabel = new TextView(context);

            autoCompleteModeLabel.LayoutParameters = new FrameLayout.LayoutParams((int)(totalWidth * 0.33), ViewGroup.LayoutParams.WrapContent, GravityFlags.Center);
            autoCompleteModeLabel.Text             = "AutoComplete Mode";
            autoCompleteModeLabel.TextSize         = 15;
            autoCompleteModeLabel.Gravity          = GravityFlags.Left;

            //autoCompleteModeSpinner
            autoCompleteModeSpinner = new Spinner(context, SpinnerMode.Dialog);
            autoCompleteModeSpinner.LayoutParameters = new FrameLayout.LayoutParams((int)(totalWidth * 0.33), ViewGroup.LayoutParams.WrapContent, GravityFlags.Center);
            List <String> autoCompleteModeList = new List <String>();

            autoCompleteModeList.Add("Suggest");
            autoCompleteModeList.Add("SuggestAppend");
            autoCompleteModeList.Add("Append");

            //autoCompleteModeDataAdapter
            autoCompleteModeDataAdapter = new ArrayAdapter <String>(context, Android.Resource.Layout.SimpleSpinnerItem, autoCompleteModeList);
            autoCompleteModeDataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            autoCompleteModeSpinner.Adapter = autoCompleteModeDataAdapter;
            autoCompleteModeSpinner.SetSelection(autoCompletModePosition);

            //autoCompleteModeSpinner ItemSelected Listener
            autoCompleteModeSpinner.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => {
                autoCompletModePosition = e.Position;
                String selectedItem = autoCompleteModeDataAdapter.GetItem(e.Position);
                if (selectedItem.Equals("Suggest"))
                {
                    autoCompleteMode = AutoCompleteMode.Suggest;
                }
                else if (selectedItem.Equals("SuggestAppend"))
                {
                    autoCompleteMode = AutoCompleteMode.SuggestAppend;
                }
                else if (selectedItem.Equals("Append"))
                {
                    autoCompleteMode = AutoCompleteMode.Append;
                }
                ApplyChanges();
            };

            LinearLayout autoCompleteModeLayout = new LinearLayout(context);

            autoCompleteModeLayout.Orientation = Android.Widget.Orientation.Horizontal;
            autoCompleteModeLayout.AddView(autoCompleteModeLabel);
            autoCompleteModeLayout.AddView(autoCompleteModeSpinner);

            proprtyOptionsLayout.AddView(autoCompleteModeLayout);
            TextView spaceText3 = new TextView(context);

            spaceText3.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 38, GravityFlags.Center);
            proprtyOptionsLayout.AddView(spaceText3);
        }
示例#7
0
        private void Factura_Load_1(object sender, EventArgs e)
        {
            AutoCompleteMode DataCollection = new AutoCompleteMode();

            AutoCompletarTxt(DataCollection);

            MaximizeBox = false;
            MinimizeBox = false;
        }
示例#8
0
        private void RegistroEmpleada_Load(object sender, EventArgs e)
        {
            AutoCompleteMode DataCollection = new AutoCompleteMode();

            AutoCompletarTxt(DataCollection);

            MaximizeBox = false;
            MinimizeBox = false;
        }
 /// <summary>
 /// Fill Autocomplete
 /// </summary>
 /// <param name="textbox"></param>
 /// <param name="items"></param>
 /// <param name="mode"></param>
 public static void fillAutocomplete(this TextBox textbox, string[] items, AutoCompleteMode mode = AutoCompleteMode.Suggest)
 {
     if ((null != textbox) && (null != items))
     {
         textbox.AutoCompleteCustomSource.Clear();
         textbox.AutoCompleteCustomSource.AddRange(items);
         textbox.AutoCompleteSource = AutoCompleteSource.CustomSource;
         textbox.AutoCompleteMode   = mode;
     }
 }
示例#10
0
 private void OnRadDropDownListAutoCompleteModeSelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
 {
     if (this.radDropDownListAutoCompleteMode.SelectedItem != null)
     {
         string           text = this.radDropDownListAutoCompleteMode.SelectedItem.Text;
         AutoCompleteMode mode = (AutoCompleteMode)Enum.Parse(typeof(AutoCompleteMode), text);
         this.radAutoCompleteBox1.AutoCompleteMode = mode;
         this.radAutoCompleteBox2.AutoCompleteMode = mode;
     }
 }
示例#11
0
 public static ComboBox SetComboBox(ComboBox cbo, String DisplayMember, String ValueMember,
                                    AutoCompleteSource AutoSource, AutoCompleteMode AutoMode, ComboBoxStyle DropStyle)
 {
     cbo.ValueMember        = ValueMember;
     cbo.DisplayMember      = DisplayMember;
     cbo.AutoCompleteSource = AutoSource;
     cbo.AutoCompleteMode   = AutoMode;
     cbo.DropDownStyle      = DropStyle;
     return(cbo);
 }
示例#12
0
 public static void SetComboBox(this ComboBox cbo, DataTable dt, string DisplayMember, string ValueMember, AutoCompleteSource AutoSource = AutoCompleteSource.ListItems,
                                AutoCompleteMode AutoMode = AutoCompleteMode.SuggestAppend, ComboBoxStyle DropStyle = ComboBoxStyle.DropDownList)
 {
     cbo.DisplayMember      = DisplayMember;
     cbo.ValueMember        = ValueMember;
     cbo.AutoCompleteSource = AutoSource;
     cbo.AutoCompleteMode   = AutoMode;
     cbo.DropDownStyle      = DropStyle;
     cbo.DataSource         = dt;
     cbo.SelectedIndex      = -1;
 }
		public static void MakeAutoComplete(
			ComboBoxEdit comboBoxEdit,
			AutoCompleteMode autoCompleteMode,
			AutoCompleteSource autoCompleteSource)
		{
			// http://community.devexpress.com/forums/p/81601/280039.aspx

			var tx = comboBoxEdit.MaskBox;
			tx.AutoCompleteSource = autoCompleteSource;
			tx.AutoCompleteMode = autoCompleteMode;
		}
示例#14
0
 /// <summary>
 /// Sets the automatic complete mode.
 /// </summary>
 /// <param name="textBox">The text box.</param>
 /// <param name="value">The value.</param>
 public static void SetAutoCompleteMode(this TextBox textBox, AutoCompleteMode value)
 {
     if (textBox.InvokeRequired)
     {
         textBox.BeginInvoke(new MethodInvoker(() => textBox.SetAutoCompleteMode(value)));
     }
     else
     {
         textBox.AutoCompleteMode = value;
         textBox.Refresh();
     }
 }
示例#15
0
        public static void MakeAutoComplete(
            ComboBoxEdit comboBoxEdit,
            AutoCompleteMode autoCompleteMode,
            AutoCompleteSource autoCompleteSource)
        {
            // http://community.devexpress.com/forums/p/81601/280039.aspx

            var tx = comboBoxEdit.MaskBox;

            tx.AutoCompleteSource = autoCompleteSource;
            tx.AutoCompleteMode   = autoCompleteMode;
        }
 public DataFilterComboDescriptorItem(
     string propertyName,
     System.Type propertyType,
     object dataSource,
     string displayMember,
     string valueMember,
     RadDropDownStyle dropDownStyle,
     AutoCompleteMode autoCompleteMode)
     : this(propertyName, propertyType, dataSource, displayMember, valueMember)
 {
     this.dropDownStyle    = dropDownStyle;
     this.autoCompleteMode = autoCompleteMode;
 }
示例#17
0
 public void AutoCompleteMode(AutoCompleteMode autoCompleteMode)
 {
     if (_comboBox != null)
     {
         if (_comboBox.InvokeRequired)
         {
             delegateAutoCompleteMode deleg = new delegateAutoCompleteMode(AutoCompleteMode);
             _comboBox.Invoke(deleg, new object[] { autoCompleteMode });
         }
         else
         {
             _comboBox.AutoCompleteMode = autoCompleteMode;
         }
     }
 }
示例#18
0
        void ReleaseDesignerOutlets()
        {
            if (acmField != null)
            {
                acmField.Dispose();
                acmField = null;
            }

            if (AutoCompleteMode != null)
            {
                AutoCompleteMode.Dispose();
                AutoCompleteMode = null;
            }

            if (clearSwitch != null)
            {
                clearSwitch.Dispose();
                clearSwitch = null;
            }

            if (CustomDropdown != null)
            {
                CustomDropdown.Dispose();
                CustomDropdown = null;
            }

            if (FilterDropdown != null)
            {
                FilterDropdown.Dispose();
                FilterDropdown = null;
            }

            if (HighlightDropdown != null)
            {
                HighlightDropdown.Dispose();
                HighlightDropdown = null;
            }

            if (ShowClearButton != null)
            {
                ShowClearButton.Dispose();
                ShowClearButton = null;
            }
        }
示例#19
0
        private void AutoCompletarTxt(AutoCompleteMode AuMode)
        {
            BeautyCenterDb db = new BeautyCenterDb();

            ServicioTextBox.AutoCompleteMode   = AutoCompleteMode.Suggest;
            ServicioTextBox.AutoCompleteSource = AutoCompleteSource.CustomSource;

            AutoCompleteStringCollection aColl = new AutoCompleteStringCollection();


            var ser = from obj in db.Servicio
                      select obj.TipoServicio;

            foreach (string cad in ser)
            {
                aColl.Add(cad);
            }
            ServicioTextBox.AutoCompleteCustomSource = aColl;
        }
示例#20
0
        /// <summary>
        /// Inserts a hidden form field for bots to fill out.
        /// <para>Validate using <see cref="ValidateGhostFieldAttribute"/>.</para>
        /// </summary>
        /// <param name="html"></param>
        /// <param name="name">Optionally override input name and wrapper class name.
        /// If overridden the same name must be provided in <see cref="ValidateGhostFieldAttribute"/>.</param>
        /// <param name="autoCompleteMode">Includes an autocomplete attribute.</param>
        public static MvcHtmlString AddAntiSpamGhostField(this HtmlHelper html, string name = "remarks",
                                                          AutoCompleteMode autoCompleteMode = AutoCompleteMode.NewPassword)
        {
            var autoCompletePart = "";

            if (autoCompleteMode == AutoCompleteMode.Off)
            {
                autoCompletePart = " autocomplete=\"off\"";
            }
            else if (autoCompleteMode == AutoCompleteMode.NewPassword)
            {
                autoCompletePart = " autocomplete=\"new-password\"";
            }

            var style   = "position: fixed; transform: translateX(100vw);";
            var content = $"<div class=\"{name}--wrapper\" style=\"{style}\"><label>Remarks</label><input class=\"remark--input\" name=\"{name}\" placeholder=\"[email protected]\" tabindex=\"-1\"{autoCompletePart}></div>";

            return(new MvcHtmlString(content));
        }
示例#21
0
        private void AutoCompletarTxt(AutoCompleteMode AuMode)
        {
            BeautyCenterDb db = new BeautyCenterDb();

            NombreClienteTextBox.AutoCompleteMode   = AutoCompleteMode.Suggest;
            NombreClienteTextBox.AutoCompleteSource = AutoCompleteSource.CustomSource;

            AutoCompleteStringCollection aColl = new AutoCompleteStringCollection();


            var cl = from obj in db.Cliente
                     select obj.Nombre;

            foreach (string c in cl)
            {
                aColl.Add(c);
            }
            NombreClienteTextBox.AutoCompleteCustomSource = aColl;
        }
        /// <summary>
        /// Constructor for the KryptonDataGridViewComboBoxCell cell type
        /// </summary>
        public KryptonDataGridViewComboBoxCell()
        {
            // Create a thread specific KryptonComboBox control used for the painting of the non-edited cells
            if (_paintingComboBox == null)
            {
                _paintingComboBox = new KryptonComboBox();
                _paintingComboBox.SetLayoutDisplayPadding(new Padding(0, 1, 1, 0));
                _paintingComboBox.StateCommon.ComboBox.Border.Width = 0;
                _paintingComboBox.StateCommon.ComboBox.Border.Draw  = InheritBool.False;
            }

            _dropDownStyle      = ComboBoxStyle.DropDown;
            _maxDropDownItems   = 8;
            _dropDownHeight     = 200;
            _dropDownWidth      = 121;
            _autoCompleteMode   = AutoCompleteMode.None;
            _autoCompleteSource = AutoCompleteSource.None;
            _displayMember      = string.Empty;
            _valueMember        = string.Empty;
        }
示例#23
0
        /// <include file='doc\TextBox.uex' path='docs/doc[@for="TextBox.SetAutoComplete"]/*' />
        /// <devdoc>
        ///     Sets the AutoComplete mode in TextBox.
        /// </devdoc>
        internal void SetAutoComplete(bool reset)
        {
            //Autocomplete Not Enabled for Password enabled and MultiLine Textboxes.
            if (Multiline || passwordChar != 0 || useSystemPasswordChar || AutoCompleteSource == AutoCompleteSource.None)
            {
                return;
            }

            if (AutoCompleteMode != AutoCompleteMode.None)
            {
                if (!fromHandleCreate)
                {
                    //RecreateHandle to avoid Leak.
                    // notice the use of member variable to avoid re-entrancy
                    AutoCompleteMode backUpMode = this.AutoCompleteMode;
                    autoCompleteMode = AutoCompleteMode.None;
                    RecreateHandle();
                    autoCompleteMode = backUpMode;
                }

                if (AutoCompleteSource == AutoCompleteSource.CustomSource)
                {
                    if (IsHandleCreated && AutoCompleteCustomSource != null)
                    {
                        if (AutoCompleteCustomSource.Count == 0)
                        {
                            ResetAutoComplete(true);
                        }
                        else
                        {
                            if (stringSource == null)
                            {
                                stringSource = new StringSource(GetStringsForAutoComplete());
                                if (!stringSource.Bind(new HandleRef(this, Handle), (int)AutoCompleteMode))
                                {
                                    throw new ArgumentException(SR.AutoCompleteFailure);
                                }
                            }
                            else
                            {
                                stringSource.RefreshList(GetStringsForAutoComplete());
                            }
                        }
                    }
                }
                else
                {
                    try {
                        if (IsHandleCreated)
                        {
                            int mode = 0;
                            if (AutoCompleteMode == AutoCompleteMode.Suggest)
                            {
                                mode |= NativeMethods.AUTOSUGGEST | NativeMethods.AUTOAPPEND_OFF;
                            }
                            if (AutoCompleteMode == AutoCompleteMode.Append)
                            {
                                mode |= NativeMethods.AUTOAPPEND | NativeMethods.AUTOSUGGEST_OFF;
                            }
                            if (AutoCompleteMode == AutoCompleteMode.SuggestAppend)
                            {
                                mode |= NativeMethods.AUTOSUGGEST;
                                mode |= NativeMethods.AUTOAPPEND;
                            }
                            int ret = SafeNativeMethods.SHAutoComplete(new HandleRef(this, Handle), (int)AutoCompleteSource | mode);
                        }
                    }
                    catch (System.Security.SecurityException) {
                        // If we don't have full trust, degrade gracefully. Allow the control to
                        // function without auto-complete. Allow the app to continue running.
                    }
                }
            }
            else if (reset)
            {
                ResetAutoComplete(true);
            }
        }
示例#24
0
        public static DataGridViewComboBoxExColumn setGridComboBox(DataTable dt, String DisplayMember,
                                                                   String ValueMember, AutoCompleteSource AutoSource, AutoCompleteMode AutoMode, ComboBoxStyle DropStyle)
        {
            DataGridViewComboBoxExColumn cboCol = new DataGridViewComboBoxExColumn();

            cboCol.DataSource         = dt;
            cboCol.DisplayMember      = DisplayMember;
            cboCol.ValueMember        = ValueMember;
            cboCol.AutoCompleteSource = AutoSource;
            cboCol.AutoCompleteMode   = AutoMode;
            cboCol.DropDownStyle      = DropStyle;
            return(cboCol);
        }
示例#25
0
 public void AddColumn(string pName, string pDBFieldName = "", string pSPAdd = "", string pSPUpp = "", string pSPDel = "", bool pSortable = false,
                       bool pIsFlag = false, bool pLocked = false, string pQuery = "", int pWidth = 0, string pAlignment = "", string pAttr = "", AutoCompleteMode aMode = AutoCompleteMode.None, AutoCompleteSource aSource = AutoCompleteSource.None, string aQuery = "", bool pPrint = false, bool pVisible = true)
 {
     if (pQuery == "")
     {
         var _Col = new CtlVSTextBoxColumn()
         {
             Name       = pName,
             HeaderText = pName,
             //Colnumber = pColnumber,
             DBField          = pDBFieldName == "" ? pName : pDBFieldName,
             DataPropertyName = pName,
             Parent           = this,
             Attr             = pAttr,
             Add                = pSPAdd != "",
             Upp                = pSPUpp != "",
             Del                = pSPDel != "",
             SPAddParamName     = pSPAdd,
             SPDelParamName     = pSPDel,
             SPUppParamName     = pSPUpp,
             IsFlag             = pIsFlag,
             Locked             = pLocked,
             ReadOnly           = pLocked,
             Width              = pWidth,
             Alignment          = pAlignment,
             Sortable           = pSortable,
             LinkedControl      = null,
             AutoSizeMode       = pWidth == 0 ? DataGridViewAutoSizeColumnMode.DisplayedCells : DataGridViewAutoSizeColumnMode.None,
             AutoCompleteMode   = aMode,
             AutoCompleteSource = aSource,
             AutoCompleteQuery  = aQuery,
             Print              = pPrint,
             Visible            = pVisible
         };
         _Col.SetQuery(pQuery);
         Columns.Add(_Col);
     }
     else
     {
         var _Col = new CtlVSComboColumn()
         {
             Name       = pName,
             HeaderText = pName,
             //Colnumber = pColnumber,
             DBField          = pDBFieldName == "" ? pName : pDBFieldName,
             DataPropertyName = pName,
             Parent           = this,
             CellTemplate     = new DataGridViewComboBoxCell(),
             Attr             = pAttr,
             Add                = pSPAdd != "",
             Upp                = pSPUpp != "",
             Del                = pSPDel != "",
             SPAddParamName     = pSPAdd,
             SPDelParamName     = pSPDel,
             SPUppParamName     = pSPUpp,
             IsFlag             = pIsFlag,
             Locked             = pLocked,
             ReadOnly           = pLocked,
             Width              = pWidth,
             Alignment          = pAlignment,
             Sortable           = pSortable,
             LinkedControl      = null,
             AutoSizeMode       = pWidth == 0 ? DataGridViewAutoSizeColumnMode.DisplayedCells : DataGridViewAutoSizeColumnMode.None,
             DisplayStyle       = DataGridViewComboBoxDisplayStyle.DropDownButton,
             AutoComplete       = true,
             AutoCompleteMode   = aMode,
             AutoCompleteSource = aSource,
             AutoCompleteQuery  = aQuery,
             Print              = pPrint,
             Visible            = pVisible
         };
         _Col.SetQuery(pQuery);
         Columns.Add(_Col);
     }
 }
示例#26
0
文件: TextBox.cs 项目: JianwenSun/cc
        /// <include file='doc\TextBox.uex' path='docs/doc[@for="TextBox.SetAutoComplete"]/*' />
        /// <devdoc>
        ///     Sets the AutoComplete mode in TextBox.
        /// </devdoc>
        internal void SetAutoComplete(bool reset)
        {
            //Autocomplete Not Enabled for Password enabled and MultiLine Textboxes.
            if (Multiline || passwordChar != 0 || useSystemPasswordChar || AutoCompleteSource == AutoCompleteSource.None) {
                return;
            }

            if (AutoCompleteMode != AutoCompleteMode.None) {
                if (!fromHandleCreate)
                {
                    //RecreateHandle to avoid Leak.
                    // notice the use of member variable to avoid re-entrancy
                    AutoCompleteMode backUpMode = this.AutoCompleteMode;
                    autoCompleteMode = AutoCompleteMode.None;
                    RecreateHandle();
                    autoCompleteMode = backUpMode;
                }
                
                if (AutoCompleteSource == AutoCompleteSource.CustomSource) {
                    if (IsHandleCreated && AutoCompleteCustomSource != null) {
                        if (AutoCompleteCustomSource.Count == 0) {
                            ResetAutoComplete(true);
                        }
                        else {
                            if (stringSource == null)
                            {
                                stringSource = new StringSource(GetStringsForAutoComplete());
                                if (!stringSource.Bind(new HandleRef(this, Handle), (int)AutoCompleteMode))
                                {
                                   throw new ArgumentException(SR.GetString(SR.AutoCompleteFailure));
                                }
                            }
                            else
                            {
                                stringSource.RefreshList(GetStringsForAutoComplete());
                            }
                        }
                    }
        
                }
                else {
                    try {
                        if (IsHandleCreated) {
                            int mode = 0;
                            if (AutoCompleteMode == AutoCompleteMode.Suggest) {
                                mode |=  NativeMethods.AUTOSUGGEST | NativeMethods.AUTOAPPEND_OFF;
                            }
                            if (AutoCompleteMode == AutoCompleteMode.Append) {
                                mode |=  NativeMethods.AUTOAPPEND | NativeMethods.AUTOSUGGEST_OFF;
                            }
                            if (AutoCompleteMode == AutoCompleteMode.SuggestAppend) {
                                mode |=  NativeMethods.AUTOSUGGEST;
                                mode |=  NativeMethods.AUTOAPPEND;
                            }
                            int ret = SafeNativeMethods.SHAutoComplete(new HandleRef(this, Handle) , (int)AutoCompleteSource | mode);
                        }
                    }
                    catch (SecurityException) {
                        // If we don't have full trust, degrade gracefully. Allow the control to
                        // function without auto-complete. Allow the app to continue running.
                    }
                }
            }
            else if (reset) {
                ResetAutoComplete(true);
            }
        }
示例#27
0
 internal void SetAutoComplete(bool reset)
 {
     if (this.Multiline || (int) this.passwordChar != 0 || (this.useSystemPasswordChar || this.AutoCompleteSource == AutoCompleteSource.None))
     return;
       if (this.AutoCompleteMode != AutoCompleteMode.None)
       {
     if (!this.fromHandleCreate)
     {
       AutoCompleteMode autoCompleteMode = this.AutoCompleteMode;
       this.autoCompleteMode = AutoCompleteMode.None;
       this.RecreateHandle();
       this.autoCompleteMode = autoCompleteMode;
     }
     if (this.AutoCompleteSource == AutoCompleteSource.CustomSource)
     {
       if (!this.IsHandleCreated || this.AutoCompleteCustomSource == null)
     return;
       if (this.AutoCompleteCustomSource.Count == 0)
     this.ResetAutoComplete(true);
       else if (this.stringSource == null)
       {
     this.stringSource = new StringSource(this.GetStringsForAutoComplete());
     if (!this.stringSource.Bind(new HandleRef((object) this, this.Handle), (int) this.AutoCompleteMode))
       throw new ArgumentException(System.Windows.Forms.SR.GetString("AutoCompleteFailure"));
       }
       else
     this.stringSource.RefreshList(this.GetStringsForAutoComplete());
     }
     else
     {
       try
       {
     if (!this.IsHandleCreated)
       return;
     int num = 0;
     if (this.AutoCompleteMode == AutoCompleteMode.Suggest)
       num |= -1879048192;
     if (this.AutoCompleteMode == AutoCompleteMode.Append)
       num |= 1610612736;
     if (this.AutoCompleteMode == AutoCompleteMode.SuggestAppend)
       num = num | 268435456 | 1073741824;
     System.Windows.Forms.SafeNativeMethods.SHAutoComplete(new HandleRef((object) this, this.Handle), (int) (this.AutoCompleteSource | (AutoCompleteSource) num));
       }
       catch (SecurityException ex)
       {
       }
     }
       }
       else
       {
     if (!reset)
       return;
     this.ResetAutoComplete(true);
       }
 }
示例#28
0
 public static ComboBoxEx SetComboBoxEx(ComboBoxEx cbo, DataTable dt, String DropDownColumns, String DisplayMember,
                                        String ValueMember, AutoCompleteSource AutoSource, AutoCompleteMode AutoMode, ComboBoxStyle DropStyle)
 {
     cbo.DataSource         = dt;
     cbo.DisplayMember      = DisplayMember;
     cbo.DropDownColumns    = DropDownColumns;
     cbo.ValueMember        = ValueMember;
     cbo.AutoCompleteSource = AutoSource;
     cbo.AutoCompleteMode   = AutoMode;
     cbo.DropDownStyle      = DropStyle;
     return(cbo);
 }
 protected override void InitializeFields()
 {
     base.InitializeFields();
     this.dropDownStyle    = RadDropDownStyle.DropDownList;
     this.autoCompleteMode = AutoCompleteMode.None;
 }
示例#30
0
        /// <summary>
        /// Fill Autocomplete
        /// </summary>
        /// <param name="textbox"></param>
        /// <param name="items"></param>
        /// <param name="mode"></param>
        public static void fillAutocomplete(this TextBox textbox, DataTable table, string field, AutoCompleteMode mode = AutoCompleteMode.Suggest)
        {
            if ((null != textbox) && (null != table))
            {
                string[] items = table.Rows.Cast <DataRow> ().Select(x => x.Field <object> (field).ToString()).ToArray();

                textbox.fillAutocomplete(items, mode);
            }
        }
示例#31
0
	    public void AutCompleteAddItems(string[] items, AutoCompleteMode autoCompleteMode) {
		   this.Items.AddRange(items);
		   this.TextBox.AutoCompleteMode = autoCompleteMode;
		   this.TextBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
		   this.TextBox.AutoCompleteCustomSource.AddRange(items);
	    }
        public override View GetPropertyWindowLayout(Android.Content.Context context)
        {
            int width = context.Resources.DisplayMetrics.WidthPixels / 2;

            propertylayout             = new LinearLayout(context);
            propertylayout.Orientation = Orientation.Vertical;
            LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
                width * 2, 5);
            layoutParams.SetMargins(0, 20, 0, 0);
            //SuggestionMode
            TextView textView1 = new TextView(context);

            textView1.Text     = "Suggestion Mode";
            textView1.TextSize = 20;
            textView1.Gravity  = GravityFlags.Left;
            TextView textview2 = new TextView(context);

            propertylayout.AddView(textview2);
            spinner1 = new Spinner(context);
            //spinner1.Gravity  = GravityFlags.Left;
            propertylayout.AddView(textView1);
            propertylayout.AddView(spinner1);
            List <String> list = new List <String>();

            list.Add("StartsWith");
            list.Add("StartsWithCaseSensitive");
            list.Add("Contains");
            list.Add("ContainsWithCaseSensitive");
            list.Add("EndsWith");
            list.Add("EndsWithCaseSensitive");
            list.Add("Equals");
            list.Add("EqualsWithCaseSensitive");
            //list.add("None");

            dataAdapter = new ArrayAdapter <String> (context, Android.Resource.Layout.SimpleSpinnerItem, list);
            dataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);

            spinner1.Adapter = dataAdapter;

            spinner1.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => {
                String selectedItem = dataAdapter.GetItem(e.Position);

                if (selectedItem.Equals("StartsWith"))
                {
                    suggestionModes = SuggestionMode.StartsWith;
                }
                else if (selectedItem.Equals("StartsWithCaseSensitive"))
                {
                    suggestionModes = SuggestionMode.StartsWithCaseSensitive;
                }
                else if (selectedItem.Equals("Contains"))
                {
                    suggestionModes = SuggestionMode.Contains;
                }
                else if (selectedItem.Equals("ContainsWithCaseSensitive"))
                {
                    suggestionModes = SuggestionMode.ContainsWithCaseSensitive;
                }
                else if (selectedItem.Equals("EndsWith"))
                {
                    suggestionModes = SuggestionMode.EndsWith;
                }
                else if (selectedItem.Equals("EndsWithCaseSensitive"))
                {
                    suggestionModes = SuggestionMode.EndsWithCaseSensitive;
                }
                else if (selectedItem.Equals("Equals"))
                {
                    suggestionModes = SuggestionMode.Equals;
                }
                else if (selectedItem.Equals("EqualsWithCaseSensitive"))
                {
                    suggestionModes = SuggestionMode.EqualsWithCaseSensitive;
                }
            };
            //Separator 1
            SeparatorView separate = new SeparatorView(context, width * 2);

            separate.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
            LinearLayout.LayoutParams layoutParam1 = new LinearLayout.LayoutParams(
                width * 2, 5);
            layoutParam1.SetMargins(0, 20, 0, 0);
            propertylayout.AddView(separate, layoutParam1);

            //AutoCompleteMode
            TextView textV1 = new TextView(context);

            textV1.Text     = "AutoComplete Mode";
            textV1.TextSize = 20;
            textV1.Gravity  = GravityFlags.Left;
            TextView textv2 = new TextView(context);

            propertylayout.AddView(textv2);
            text3 = new Spinner(context);
            propertylayout.AddView(textV1);
            propertylayout.AddView(text3);
            List <String> list1 = new List <String>();

            list1.Add("Suggest");
            list1.Add("SuggestAppend");
            list1.Add("Append");

            dataadapter1 = new ArrayAdapter <String> (context, Android.Resource.Layout.SimpleSpinnerItem, list1);
            dataadapter1.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);

            text3.Adapter = dataadapter1;

            text3.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => {
                String selectedItem = dataadapter1.GetItem(e.Position);
                if (selectedItem.Equals("Suggest"))
                {
                    autoCompleteMode = AutoCompleteMode.Suggest;
                }
                else if (selectedItem.Equals("SuggestAppend"))
                {
                    autoCompleteMode = AutoCompleteMode.SuggestAppend;
                }
                else if (selectedItem.Equals("Append"))
                {
                    autoCompleteMode = AutoCompleteMode.Append;
                }
            };

            //Separator 2
            SeparatorView separate1 = new SeparatorView(context, width * 2);

            separate1.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);

            LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(
                width * 2, 5);
            layoutParams2.SetMargins(0, 20, 0, 0);
            propertylayout.SetPadding(15, 0, 15, 0);

            //Separator 2
            SeparatorView separate2 = new SeparatorView(context, width * 2);

            separate2.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
            propertylayout.AddView(separate2, layoutParams2);

            //Min Prefix Character
            TextView textView7 = new TextView(context);

            textView7.Text = "Min Prefix Character";
            textView7.SetWidth(400);
            textView7.TextSize  = 20;
            etext1              = new EditText(context);
            etext1.Text         = "1";
            etext1.TextSize     = 16;
            etext1.InputType    = Android.Text.InputTypes.ClassPhone;
            etext1.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) =>
            {
                if (etext1.Text.Length > 0)
                {
                    minimum = Convert.ToInt32(e.Text.ToString());
                }
                else
                {
                    minimum = 1;
                }
            };

            LinearLayout.LayoutParams layoutParams7 = new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
            layoutParams7.SetMargins(0, 10, 0, 0);
            LinearLayout.LayoutParams layoutParams8 = new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.WrapContent, 55);
            layoutParams8.SetMargins(0, 10, 0, 0);
            stackView2 = new LinearLayout(context);
            stackView2.AddView(textView7, layoutParams8);
            stackView2.AddView(etext1, layoutParams7);
            stackView2.Orientation = Orientation.Horizontal;
            propertylayout.AddView(stackView2);
            SeparatorView separate4 = new SeparatorView(context, width * 2);

            separate4.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
            LinearLayout.LayoutParams layoutParams6 = new LinearLayout.LayoutParams(width * 2, 5);
            layoutParams6.SetMargins(0, 20, 15, 0);
            propertylayout.AddView(separate4, layoutParams6);

            //max DropDown height
            TextView textView8 = new TextView(context);

            textView8.Text = "Max DropDown Height";
            textView8.SetWidth(400);
            textView8.TextSize  = 20;
            etext2              = new EditText(context);
            etext2.Text         = "200";
            etext2.TextSize     = 16;
            etext2.InputType    = Android.Text.InputTypes.ClassPhone;
            etext2.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) =>
            {
                if (etext2.Text.Length > 0)
                {
                    maximum = Convert.ToInt32(e.Text.ToString());
                }
                else
                {
                    maximum = 200;
                }
            };

            LinearLayout.LayoutParams layoutParams9 = new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
            layoutParams9.SetMargins(0, 10, 0, 0);
            LinearLayout.LayoutParams layoutParams10 = new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.WrapContent, 55);
            layoutParams10.SetMargins(0, 10, 0, 0);
            stackView3 = new LinearLayout(context);
            stackView3.AddView(textView8, layoutParams10);
            stackView3.AddView(etext2, layoutParams9);
            stackView3.Orientation = Orientation.Horizontal;
            propertylayout.AddView(stackView3);
            SeparatorView separate5 = new SeparatorView(context, width * 2);

            separate5.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
            LinearLayout.LayoutParams layoutParams11 = new LinearLayout.LayoutParams(width * 2, 5);
            layoutParams11.SetMargins(0, 20, 15, 0);
            propertylayout.AddView(separate5, layoutParams11);

            //Popup Delay
            TextView textView9 = new TextView(context);

            textView9.Text = "PopUp Delay";
            textView9.SetWidth(400);
            textView9.TextSize = 20;
            etext3             = new EditText(context);
            etext3.Text        = "100";
            etext3.TextSize    = 16;
            etext3.InputType   = Android.Text.InputTypes.ClassPhone;
            etext1.SetWidth(50);
            etext2.SetWidth(50);
            etext3.SetWidth(50);

            etext3.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) =>
            {
                if (etext3.Text.Length > 0)
                {
                    popupdelay = Convert.ToInt32(e.Text.ToString());
                }
                else
                {
                    popupdelay = 100;
                }
            };
            LinearLayout.LayoutParams layoutParams12 = new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
            layoutParams12.SetMargins(0, 10, 0, 0);
            LinearLayout.LayoutParams layoutParams13 = new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.WrapContent, 55);
            layoutParams13.SetMargins(0, 10, 0, 0);
            stackView4 = new LinearLayout(context);
            stackView4.AddView(textView9, layoutParams13);
            stackView4.AddView(etext3, layoutParams12);
            stackView4.Orientation = Orientation.Horizontal;
            propertylayout.AddView(stackView4);
            SeparatorView separate6 = new SeparatorView(context, width * 2);

            separate6.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
            LinearLayout.LayoutParams layoutParams14 = new LinearLayout.LayoutParams(width * 2, 5);
            layoutParams14.SetMargins(0, 20, 15, 0);
            propertylayout.AddView(separate6, layoutParams14);

            return(propertylayout);
        }
示例#33
0
 /// <summary>
 /// Auto complete text box
 /// </summary>
 /// <param name="textBox"></param>
 /// <param name="items"></param>
 /// <param name="mode"></param>
 public static void fillAutocomplete(this TextBox textBox, Common.Models.ComboItemModel [] items, AutoCompleteMode mode = AutoCompleteMode.SuggestAppend)
 {
     textBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
     textBox.AutoCompleteCustomSource.Clear();
     textBox.AutoCompleteMode = mode;
     if (null != items)
     {
         foreach (Common.Models.ComboItemModel item in items)
         {
             textBox.AutoCompleteCustomSource.Add(item.key);
         }
     }
 }
示例#34
0
文件: ComboBox.cs 项目: mind0n/hive
        private void SetAutoComplete(bool reset, bool recreate) {
            if (!IsHandleCreated || childEdit == null) {
                return;
            }

            if (AutoCompleteMode != AutoCompleteMode.None) {
                if (!fromHandleCreate && recreate && IsHandleCreated)
                {
                    //RecreateHandle to avoid Leak.
                    // notice the use of member variable to avoid re-entrancy
                    AutoCompleteMode backUpMode = this.AutoCompleteMode;
                    autoCompleteMode = AutoCompleteMode.None;
                    RecreateHandle();
                    autoCompleteMode = backUpMode;
                }
                
                if (AutoCompleteSource == AutoCompleteSource.CustomSource) {
                    if (AutoCompleteCustomSource != null) {
                        if (AutoCompleteCustomSource.Count == 0) {
                            int mode = NativeMethods.AUTOSUGGEST_OFF | NativeMethods.AUTOAPPEND_OFF;
                            SafeNativeMethods.SHAutoComplete(new HandleRef(this, childEdit.Handle), mode);
                        }
                        else {

                            if (stringSource == null)
                            {
                                stringSource = new StringSource(GetStringsForAutoComplete(AutoCompleteCustomSource));
                                if (!stringSource.Bind(new HandleRef(this, childEdit.Handle), (int)AutoCompleteMode)) {
                                    throw new ArgumentException(SR.GetString(SR.AutoCompleteFailure));
                                }
                            }
                            else
                            {
                                stringSource.RefreshList(GetStringsForAutoComplete(AutoCompleteCustomSource));
                            }
                            
                        }
                    }
                }
                else if (AutoCompleteSource == AutoCompleteSource.ListItems) {
                    if (DropDownStyle != ComboBoxStyle.DropDownList) {
                        if (itemsCollection != null) {
                            if (itemsCollection.Count == 0) {
                                int mode = NativeMethods.AUTOSUGGEST_OFF | NativeMethods.AUTOAPPEND_OFF;
                                SafeNativeMethods.SHAutoComplete(new HandleRef(this, childEdit.Handle), mode);
                            }
                            else {

                                if (stringSource == null)
                                {
                                    stringSource = new StringSource(GetStringsForAutoComplete(Items));
                                    if (!stringSource.Bind(new HandleRef(this, childEdit.Handle), (int)AutoCompleteMode)) {
                                        throw new ArgumentException(SR.GetString(SR.AutoCompleteFailureListItems));
                                    }
                                }
                                else
                                {
                                    stringSource.RefreshList(GetStringsForAutoComplete(Items));
                                }
                                
                            }
                        }
                    }
                    else {
                        // Drop Down List special handling
                        Debug.Assert(DropDownStyle == ComboBoxStyle.DropDownList);
                        int mode = NativeMethods.AUTOSUGGEST_OFF | NativeMethods.AUTOAPPEND_OFF;
                        SafeNativeMethods.SHAutoComplete(new HandleRef(this, childEdit.Handle), mode);
                    }
                }
                else {
                    try {
                        int mode = 0;

                        if (AutoCompleteMode == AutoCompleteMode.Suggest) {
                            mode |= NativeMethods.AUTOSUGGEST | NativeMethods.AUTOAPPEND_OFF;
                        }
                        if (AutoCompleteMode == AutoCompleteMode.Append) {
                            mode |= NativeMethods.AUTOAPPEND | NativeMethods.AUTOSUGGEST_OFF;
                        }
                        if (AutoCompleteMode == AutoCompleteMode.SuggestAppend) {
                            mode |= NativeMethods.AUTOSUGGEST;
                            mode |= NativeMethods.AUTOAPPEND;
                        }
                        int ret = SafeNativeMethods.SHAutoComplete(new HandleRef(this, childEdit.Handle), (int)AutoCompleteSource | mode);
                    }
                    catch (SecurityException) {
                        // If we don't have full trust, degrade gracefully. Allow the control to
                        // function without auto-complete. Allow the app to continue running.
                    }
                }
            }
            else if (reset) {
                int mode = NativeMethods.AUTOSUGGEST_OFF | NativeMethods.AUTOAPPEND_OFF;
                SafeNativeMethods.SHAutoComplete(new HandleRef(this, childEdit.Handle), mode);
            }
        }
示例#35
0
 public AutoCompleteBuilder <TModel, TValue> Mode(AutoCompleteMode mode)
 {
     _mode = mode;
     return(this);
 }
示例#36
0
        public void AddColumn(string pName, EspackFormControl pLinkedControl, string pSPAdd = "", string pSPUpp = "", string pSPDel = "", AutoCompleteMode aMode = AutoCompleteMode.None, AutoCompleteSource aSource = AutoCompleteSource.None, string aQuery = "", bool pPrint = false, bool pVisible = true)
        {
            var _Col = new CtlVSTextBoxColumn()
            {
                Name       = pName,
                HeaderText = pName,
                //Colnumber = pColnumber,
                DBField          = pName,
                DataPropertyName = pName,
                CellTemplate     = new DataGridViewTextBoxCell(),
                Attr             = "",
                Add                = pSPAdd != "",
                Upp                = pSPUpp != "",
                Del                = pSPDel != "",
                SPAddParamName     = pSPAdd,
                SPDelParamName     = pSPDel,
                SPUppParamName     = pSPUpp,
                IsFlag             = false,
                Locked             = true,
                ReadOnly           = true,
                Width              = 0,
                Alignment          = "",
                Sortable           = false,
                LinkedControl      = pLinkedControl,
                AutoSizeMode       = DataGridViewAutoSizeColumnMode.DisplayedCells,
                AutoCompleteMode   = aMode,
                AutoCompleteSource = aSource,
                AutoCompleteQuery  = aQuery,
                Print              = pPrint,
                Visible            = pVisible
            };

            _Col.SetQuery("");
            Columns.Add(_Col);
        }
		public override View GetPropertyWindowLayout (Android.Content.Context context)
		{
			int width = context.Resources.DisplayMetrics.WidthPixels / 2;
			propertylayout = new LinearLayout(context);
			propertylayout.Orientation = Orientation.Vertical;
			LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
				width * 2, 5);
			layoutParams.SetMargins(0, 20, 0, 0);
			//SuggestionMode
			TextView textView1 = new TextView(context);
			textView1.Text = "Suggestion Mode";
			textView1.TextSize=20;
			textView1.Gravity  = GravityFlags.Left;
			TextView textview2 = new TextView(context);
			propertylayout.AddView(textview2);
			spinner1 = new Spinner(context);
			//spinner1.Gravity  = GravityFlags.Left;
			propertylayout.AddView(textView1);
			propertylayout.AddView(spinner1);
			List<String> list = new List<String>();
			list.Add("StartsWith");
			list.Add("StartsWithCaseSensitive");
			list.Add("Contains");
			list.Add("ContainsWithCaseSensitive");
			list.Add("EndsWith");
			list.Add("EndsWithCaseSensitive");
			list.Add("Equals");
			list.Add("EqualsWithCaseSensitive");
			//list.add("None");

			dataAdapter = new ArrayAdapter<String> (context, Android.Resource.Layout.SimpleSpinnerItem, list);
			dataAdapter.SetDropDownViewResource (Android.Resource.Layout.SimpleSpinnerDropDownItem);

			spinner1.Adapter = dataAdapter;

			spinner1.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => {
				String selectedItem = dataAdapter.GetItem (e.Position);
				
				if (selectedItem.Equals ("StartsWith")) {
					suggestionModes = SuggestionMode.StartsWith;
									
				} else if (selectedItem.Equals ("StartsWithCaseSensitive")) {
					suggestionModes = SuggestionMode.StartsWithCaseSensitive;
										
				} else if (selectedItem.Equals ("Contains")) {
					suggestionModes = SuggestionMode.Contains;
									
				} else if (selectedItem.Equals ("ContainsWithCaseSensitive")) {
					suggestionModes = SuggestionMode.ContainsWithCaseSensitive;
										
				} else if (selectedItem.Equals ("EndsWith")) {
					suggestionModes = SuggestionMode.EndsWith;
										
				} else if (selectedItem.Equals ("EndsWithCaseSensitive")) {
					suggestionModes = SuggestionMode.EndsWithCaseSensitive;
										
				} else if (selectedItem.Equals ("Equals")) {
					suggestionModes = SuggestionMode.Equals;
										
				} else if (selectedItem.Equals ("EqualsWithCaseSensitive")) {
					suggestionModes = SuggestionMode.EqualsWithCaseSensitive;
										
				}
			};
			//Separator 1
			SeparatorView separate = new SeparatorView(context, width * 2);
			separate.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
			LinearLayout.LayoutParams layoutParam1 = new LinearLayout.LayoutParams(
				width * 2, 5);
			layoutParam1.SetMargins(0, 20, 0, 0);
			propertylayout.AddView(separate,layoutParam1);

			//AutoCompleteMode
			TextView textV1 = new TextView(context);
			textV1.Text = "AutoComplete Mode";
			textV1.TextSize=20;
			textV1.Gravity = GravityFlags.Left;
			TextView textv2 = new TextView(context);
			propertylayout.AddView(textv2);
			text3 = new Spinner(context);
			propertylayout.AddView(textV1);
			propertylayout.AddView(text3);
			List<String> list1 = new List<String>();
			list1.Add("Suggest");
			list1.Add("SuggestAppend");
			list1.Add("Append");

			dataadapter1 = new ArrayAdapter<String> (context, Android.Resource.Layout.SimpleSpinnerItem, list1);
			dataadapter1.SetDropDownViewResource (Android.Resource.Layout.SimpleSpinnerDropDownItem);

			text3.Adapter = dataadapter1;

			text3.ItemSelected+= (object sender, AdapterView.ItemSelectedEventArgs e) => {
				String selectedItem = dataadapter1.GetItem(e.Position);
									if (selectedItem.Equals("Suggest")) {
										autoCompleteMode = AutoCompleteMode.Suggest;
										
									} else if (selectedItem.Equals("SuggestAppend")) {
										autoCompleteMode = AutoCompleteMode.SuggestAppend;
										
									} else if (selectedItem.Equals("Append")) {
										autoCompleteMode = AutoCompleteMode.Append;
										
									}
			};

			//Separator 2
			SeparatorView separate1 = new SeparatorView(context, width * 2);
			separate1.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);

			LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(
				width * 2, 5);
			layoutParams2.SetMargins(0, 20, 0, 0);
			propertylayout.SetPadding(15, 0, 15, 0);

			//Separator 2
			SeparatorView separate2 = new SeparatorView(context, width * 2);
			separate2.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
			propertylayout.AddView(separate2, layoutParams2);

			//Min Prefix Character
			TextView textView7 = new TextView(context);
			textView7.Text = "Min Prefix Character";
			textView7.SetWidth(400);
			textView7.TextSize=20;
			etext1 = new EditText(context);
			etext1.Text = "1";
			etext1.TextSize=16;
			etext1.InputType = Android.Text.InputTypes.ClassPhone;
			etext1.TextChanged+= (object sender, Android.Text.TextChangedEventArgs e) => 
			{
				if(etext1.Text.Length > 0)
					minimum =  Convert.ToInt32(e.Text.ToString());
				else
					minimum = 1;
			};

			LinearLayout.LayoutParams layoutParams7 = new LinearLayout.LayoutParams(
				ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
			layoutParams7.SetMargins(0, 10, 0, 0);
			LinearLayout.LayoutParams layoutParams8 = new LinearLayout.LayoutParams(
				ViewGroup.LayoutParams.WrapContent, 55);
			layoutParams8.SetMargins(0, 10, 0, 0);
			stackView2 = new LinearLayout(context);
			stackView2.AddView(textView7,layoutParams8);
			stackView2.AddView(etext1, layoutParams7);
			stackView2.Orientation = Orientation.Horizontal;
			propertylayout.AddView(stackView2);
			SeparatorView separate4 = new SeparatorView(context, width * 2);
			separate4.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
			LinearLayout.LayoutParams layoutParams6 = new LinearLayout.LayoutParams(width * 2, 5);
			layoutParams6.SetMargins(0, 20, 15, 0);
			propertylayout.AddView(separate4, layoutParams6);

			//max DropDown height
			TextView textView8 = new TextView(context);
			textView8.Text = "Max DropDown Height";
			textView8.SetWidth(400);
			textView8.TextSize=20;
			etext2 = new EditText(context);
			etext2.Text = "200";
			etext2.TextSize=16;
			etext2.InputType = Android.Text.InputTypes.ClassPhone;
			etext2.TextChanged+= (object sender, Android.Text.TextChangedEventArgs e) => 
			{
				if(etext2.Text.Length>0)
					maximum =  Convert.ToInt32(e.Text.ToString());
				else
					maximum = 200;
			};

			LinearLayout.LayoutParams layoutParams9 = new LinearLayout.LayoutParams(
				ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
			layoutParams9.SetMargins(0, 10, 0, 0);
			LinearLayout.LayoutParams layoutParams10 = new LinearLayout.LayoutParams(
				ViewGroup.LayoutParams.WrapContent, 55);
			layoutParams10.SetMargins(0, 10, 0, 0);
			stackView3 = new LinearLayout(context);
			stackView3.AddView(textView8,layoutParams10);
			stackView3.AddView(etext2, layoutParams9);
			stackView3.Orientation = Orientation.Horizontal;
			propertylayout.AddView(stackView3);
			SeparatorView separate5 = new SeparatorView(context, width * 2);
			separate5.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
			LinearLayout.LayoutParams layoutParams11 = new LinearLayout.LayoutParams(width * 2, 5);
			layoutParams11.SetMargins(0, 20, 15, 0);
			propertylayout.AddView(separate5, layoutParams11);

			//Popup Delay
			TextView textView9 = new TextView(context);
			textView9.Text = "PopUp Delay";
			textView9.SetWidth(400);
			textView9.TextSize=20;
			etext3 = new EditText(context);
			etext3.Text = "100";
			etext3.TextSize=16;
			etext3.InputType = Android.Text.InputTypes.ClassPhone;
			etext1.SetWidth(50);
			etext2.SetWidth(50);
			etext3.SetWidth(50);

			etext3.TextChanged+= (object sender, Android.Text.TextChangedEventArgs e) => 
			{
				if(etext3.Text.Length>0)
					popupdelay=  Convert.ToInt32(e.Text.ToString());
				else
					popupdelay = 100;
			};
			LinearLayout.LayoutParams layoutParams12 = new LinearLayout.LayoutParams(
				ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
			layoutParams12.SetMargins(0, 10, 0, 0);
			LinearLayout.LayoutParams layoutParams13 = new LinearLayout.LayoutParams(
				ViewGroup.LayoutParams.WrapContent, 55);
			layoutParams13.SetMargins(0, 10, 0, 0);
			stackView4 = new LinearLayout(context);
			stackView4.AddView(textView9,layoutParams13);
			stackView4.AddView(etext3, layoutParams12);
			stackView4.Orientation = Orientation.Horizontal;
			propertylayout.AddView(stackView4);
			SeparatorView separate6 = new SeparatorView(context, width * 2);
			separate6.LayoutParameters=new ViewGroup.LayoutParams(width * 2, 5);
			LinearLayout.LayoutParams layoutParams14 = new LinearLayout.LayoutParams(width * 2, 5);
			layoutParams14.SetMargins(0, 20, 15, 0);
			propertylayout.AddView(separate6, layoutParams14);

			return propertylayout;

		}
示例#38
0
 public AutoCompleteItem(string label, AutoCompleteMode mode)
 {
     Label = label;
     Mode = mode;
 }