コード例 #1
0
        private void Database_Load(object sender, EventArgs e)
        {
            mAutoMennu_DM_Intent_Type.SetAutocompleteItems(DM_Intent_Type.GetDefaultList(0).Select(p => new AutoData(p.DM_Intent_TypeName, p.DM_Intent_TypeID.ToString())).ToList());
            mAutoMennu_DM_Intent_Type.ComboboxMode = true;
            mAutoMennu_DM_Intent_Type.MaximumSize  = new System.Drawing.Size(txtType.Width - 4, 300);
            mAutoMennu_DM_Intent_Type.SetAutocompleteMenu(txtType);
            txtType.KeyDown += Control_KeyDown;

            mAutoMennu_DM_Entity_Type.SetAutocompleteItems(DM_Entity_Type.GetDefaultList(0).Select(p => new AutoData(p.DM_Entity_TypeName, p.DM_Entity_TypeID.ToString())).ToList());
            mAutoMennu_DM_Entity_Type.ComboboxMode = true;
            mAutoMennu_DM_Entity_Type.MaximumSize  = new System.Drawing.Size(txtEntity.Width - 4, 300);
            mAutoMennu_DM_Entity_Type.SetAutocompleteMenu(txtEntity);
            txtEntity.KeyDown += Control_KeyDown;

            mAutoMennu_DM_Intent_Type_Current.SetAutocompleteItems(DM_Intent_Type.GetDefaultList(0).Select(p => new AutoData(p.DM_Intent_TypeName, p.DM_Intent_TypeID.ToString())).ToList());
            mAutoMennu_DM_Intent_Type_Current.ComboboxMode = true;
            mAutoMennu_DM_Intent_Type_Current.MaximumSize  = new System.Drawing.Size(txtType_Current.Width - 4, 300);
            mAutoMennu_DM_Intent_Type_Current.SetAutocompleteMenu(txtType_Current);
            txtType_Current.KeyDown += Control_KeyDown;

            mAutoMennu_DM_Entity_Type_Current.SetAutocompleteItems(DM_Entity_Type.GetDefaultList(0).Select(p => new AutoData(p.DM_Entity_TypeName, p.DM_Entity_TypeID.ToString())).ToList());
            mAutoMennu_DM_Entity_Type_Current.ComboboxMode = true;
            mAutoMennu_DM_Entity_Type_Current.MaximumSize  = new System.Drawing.Size(txtEntity_Current.Width - 4, 300);
            mAutoMennu_DM_Entity_Type_Current.SetAutocompleteMenu(txtEntity_Current);
            txtEntity_Current.KeyDown += Control_KeyDown;

            txtName.Text           = mIntent_Request.Data;
            txtType.Text           = DM_Intent_Type.GetDefault(mIntent_Request.DM_Intent_TypeID).DM_Intent_TypeName;
            txtEntity.Text         = DM_Entity_Type.GetDefault(mIntent_Request.DM_Entity_TypeID).DM_Entity_TypeName;
            txtType_Current.Text   = DM_Intent_Type.GetDefault(mIntent_Request.Current_DM_Intent_TypeID).DM_Intent_TypeName;
            txtEntity_Current.Text = DM_Entity_Type.GetDefault(mIntent_Request.Current_DM_Entity_TypeID).DM_Entity_TypeName;
        }
コード例 #2
0
ファイル: Sandbox.cs プロジェクト: Akshat122/Texditor
        public Sandbox()
        {
            InitializeComponent();

            menu = new AutocompleteMenu();
            //triggers
            MyMethodItem.Triggers = new char[] { '.', ':' };
            menu.SearchPattern    = @"[\w" + Regex.Escape(new string(MyMethodItem.Triggers)) + "]";

            //create items
            items = new List <AutocompleteItem>();
            items.Add(new MyMethodItem("ToString"));

            //assign items to the menu
            menu.SetAutocompleteItems(items);

            //
            var tb = new RichTextBox()
            {
                Parent = this, Dock = DockStyle.Fill
            };

            menu.SetAutocompleteMenu(tb, menu);

            var f = new Form();

            f.Show();
            (menu.ListView as Control).Parent.VisibleChanged += (o, e) =>
            {
                (menu.ListView as Control).Parent.Top = 100;
            };
        }
コード例 #3
0
 private void Database_Load(object sender, EventArgs e)
 {
     mAutoMennu_DM_Intent_Type.SetAutocompleteItems(DM_Intent_Type.GetDefaultList(0).Select(p => new AutoData(p.DM_Intent_TypeName, p.DM_Intent_TypeID.ToString())).ToList());
     mAutoMennu_DM_Intent_Type.ComboboxMode = true;
     mAutoMennu_DM_Intent_Type.MaximumSize  = new System.Drawing.Size(txtChuDe.Width - 4, 300);
     mAutoMennu_DM_Intent_Type.SetAutocompleteMenu(txtChuDe);
     txtChuDe.KeyDown += txtChuDe_KeyDown;
 }
コード例 #4
0
 private void Database_Load(object sender, EventArgs e)
 {
     mAutoMennu_User.SetAutocompleteItems(MyVar.mListUser.Select(p => new AutoData(p.UserName, p.UserID.ToString())).ToList());
     mAutoMennu_User.ComboboxMode = true;
     mAutoMennu_User.MaximumSize  = new System.Drawing.Size(txtUser.Width - 4, 300);
     mAutoMennu_User.SetAutocompleteMenu(txtUser);
     txtUser.KeyDown += Control_KeyDown;
 }
コード例 #5
0
 private static void SetAutoComplete(IEnumerable <AutocompleteItem> items, AutocompleteMenu completemenu,
                                     Control tb)
 {
     completemenu.SetAutocompleteMenu(tb, completemenu);
     completemenu.SetAutocompleteItems(items);
 }