Exemple #1
0
        //Filter all the CodeSnippeds by the asigned Values
        public void FilterCodeSnippeds()
        {
            var bc = new BrushConverter();

            //Give all filter values and recieve a list with Items
            List <SnippetInfo> snippets = DbSnippets.GetFilteredSnippeds(
                SearchBox.Text,
                Language.SelectedItem.ToString(),
                Converter.StringToDateFilter(DateType.SelectedItem.ToString()),
                Converter.StringToTypefilter(SearchType.SelectedItem.ToString())
                );

            List <SnippetUI> items = new List <SnippetUI>();

            for (int i = 0; i < snippets.Count; i++)
            {
                items.Add(new SnippetUI(snippets[i]._Name, DbCodeLanguage.ToString(snippets[i]._LanguageID)));
            }


            Page.Containerr.Children.Clear();
            foreach (SnippetInfo i in snippets)
            {
                SnippetItem item = new SnippetItem(i, Page, this)
                {
                    Width = Page.Containerr.Width
                };
                Page.Containerr.Children.Add(item);
            }
            Page.ViewMode = false;
        }
        //Filter all the CodeSnippeds by the asigned Values
        private void FilterCodeSnippeds()
        {
            //Give all filter values and recieve a list with Items
            List <SnippetInfo> snippets = DbSnippets.GetFilteredSnippeds(
                SearchBox_Mysnipped_txb.Text,
                MySnipped_Languages_Cmb.SelectedItem.ToString(),
                Converter.StringToDateFilter(MySnipped_Date_Cmb.SelectedItem.ToString()),
                Converter.StringToTypefilter(MySnipped_Type_Cmb.SelectedItem.ToString())
                );

            //Clear RichTextBox
            Results.Document.Blocks.Clear();


            List <SnippetUI> items = new List <SnippetUI>();

            for (int i = 0; i < snippets.Count; i++)
            {
                items.Add(new SnippetUI(snippets[i]._Name, DbCodeLanguage.ToString(snippets[i]._LanguageID)));
            }

            CodeSnippetsCintainer.ItemsSource = items;
        }