当前位置: 首页>>代码示例>>C#>>正文


C# ObjectModel.ObservableCollection类代码示例

本文整理汇总了C#中System.Collections.ObjectModel.System.Collections.ObjectModel.ObservableCollection的典型用法代码示例。如果您正苦于以下问题:C# System.Collections.ObjectModel.ObservableCollection类的具体用法?C# System.Collections.ObjectModel.ObservableCollection怎么用?C# System.Collections.ObjectModel.ObservableCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


System.Collections.ObjectModel.ObservableCollection类属于System.Collections.ObjectModel命名空间,在下文中一共展示了System.Collections.ObjectModel.ObservableCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Settings_SettingsLoaded

 void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
 {
     if (FixedDownloadPathHistory == null)
     {
         FixedDownloadPathHistory = new System.Collections.ObjectModel.ObservableCollection<string>();
     }
 }
开发者ID:iejeecee,项目名称:mediaviewer,代码行数:7,代码来源:Settings.cs

示例2: LinePatternViewer

        public void LinePatternViewer()
        {
            LPMainWindow main_win = null;
            try
            {
                Document theDoc = this.ActiveUIDocument.Document;
                System.Collections.ObjectModel.ObservableCollection<LinePattern> data =
                    new System.Collections.ObjectModel.ObservableCollection<LinePattern>();

                //Collect all line pattern elements
                FilteredElementCollector collector = new FilteredElementCollector(theDoc);
                IList<Element> linepatternelements = collector.WherePasses(new ElementClassFilter(typeof(LinePatternElement))).ToElements();
                foreach (LinePatternElement lpe in linepatternelements)
                {
                    data.Add(lpe.GetLinePattern());
                }
                //start main window
                main_win = new LinePatternMacro.LPMainWindow(data);
                System.Windows.Interop.WindowInteropHelper x = new System.Windows.Interop.WindowInteropHelper(main_win);
                x.Owner = Process.GetCurrentProcess().MainWindowHandle;
                main_win.ShowDialog();
            }
            catch (Exception err)
            {
                Debug.WriteLine(new string('*', 100));
                Debug.WriteLine(err.ToString());
                Debug.WriteLine(new string('*', 100));
                if (main_win != null && main_win.IsActive)
                    main_win.Close();
            }
        }
开发者ID:kfpopeye,项目名称:LinePatternViewerWpfControl,代码行数:31,代码来源:macro.cs

示例3: LoadData

        private void LoadData()
        {
            loadbar.Start();
            int pageCount = 0;
            string filter = "";
            System.Collections.ObjectModel.ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>();


            TextBox txtEmpName = Utility.FindChildControl<TextBox>(expander, "txtEmpName");
            if (txtEmpName != null)
            {
                if (!string.IsNullOrEmpty(txtEmpName.Text))
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    // filter += "[email protected]" + paras.Count().ToString();
                    filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEENAME)";
                    paras.Add(txtEmpName.Text.Trim());
                }
            }
            client.EmployeeCheckPagingAsync(dataPager.PageIndex, dataPager.PageSize, "BEREGULARDATE", filter,
                paras, pageCount, Checkstate, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
        }
开发者ID:JuRogn,项目名称:OA,代码行数:25,代码来源:EmployeeCheck.xaml.cs

示例4: LoadData

        private void LoadData()
        {
            loadbar.Start();
            int pageCount = 0;
            string filter = "";
            System.Collections.ObjectModel.ObservableCollection<string> paras = new System.Collections.ObjectModel.ObservableCollection<string>();

            if (!string.IsNullOrEmpty(txtEmpName.Text))
            {

                // filter += "[email protected]" + paras.Count().ToString();
                filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEECNAME)";
                paras.Add(txtEmpName.Text.Trim());
            }
            if (!string.IsNullOrEmpty(txtEmpCode.Text))
            {
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }
             
                filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEECODE)";
                paras.Add(txtEmpCode.Text.Trim());
            }
            string sType = treeOrganization.sType, sValue = treeOrganization.sValue;
            client.GetEmployeeViewsPagingAsync(dataPager.PageIndex, dataPager.PageSize, "EMPLOYEECNAME", filter,
                paras, pageCount, sType, sValue, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
        }
开发者ID:JuRogn,项目名称:OA,代码行数:28,代码来源:PersonControl.xaml.cs

示例5: getRecipes

        public static System.Collections.ObjectModel.ObservableCollection<Recipe> getRecipes(string path)
        {
            System.Collections.ObjectModel.ObservableCollection<Recipe> allRecipes = new System.Collections.ObjectModel.ObservableCollection<Recipe>();

            System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
            doc.Load(path);
            System.Xml.XmlNode RecipeList = doc.SelectSingleNode("RecipeBook");
            System.Xml.XmlNodeList allRecipiesXML = RecipeList.SelectNodes("Recipe");
            foreach (System.Xml.XmlNode nowRecipe in allRecipiesXML)
            {
                //string category_name = Convert.ToString(rec.Attributes.GetNamedItem("name").Value);
                //System.Xml.XmlNodeList currentRecipes = category.SelectNodes("Recipe");
                //allRecipes.Add(new Tuple<string, List<Recipe>>(category_name, new List<Recipe>()));
                //foreach(System.Xml.XmlNode nowRecipe in currentRecipes)
                //{
                Recipe recipe = new Recipe();
                recipe.Category = nowRecipe.SelectSingleNode("Category").InnerText;
                recipe.Title = nowRecipe.SelectSingleNode("Title").InnerText;
                recipe.Ingredients = nowRecipe.SelectSingleNode("Ingredients").InnerText;
                recipe.WayToCook = nowRecipe.SelectSingleNode("WayToCook").InnerText;
                System.Xml.XmlNode ttc = nowRecipe.SelectSingleNode("TimeToCook");
                if (ttc != null)
                    recipe.TimeToCook = ttc.InnerText;
                System.Xml.XmlNode aut = nowRecipe.SelectSingleNode("Author");
                if (aut != null)
                    recipe.Author = aut.InnerText;

                allRecipes.Add(recipe);
                //}
            }

            return allRecipes;
        }
开发者ID:TwoOfDiamonds,项目名称:DiamondRecipes,代码行数:33,代码来源:Utilities.cs

示例6: LibraryWindowViewModel

        public LibraryWindowViewModel() 
        {
            view = CollectionViewSource.GetDefaultView(LibraryItems);

            LibraryItems = new System.Collections.ObjectModel.ObservableCollection<string>(iservice.Files);
            iservice.Start();
            iservice.FilesUpdated += new EventHandler<EventArgs<IList<string>>>(iservice_FilesUpdated);

            this.PropertyChanged += (s, ea) => 
                System.Diagnostics.Debug.WriteLine(ea.PropertyName + " changed to " + 
                    this.GetType().GetProperty(ea.PropertyName).GetValue(this,null));

            Observable.FromEventPattern<System.ComponentModel.PropertyChangedEventArgs>(this, "PropertyChanged")
                .Where(et => et.EventArgs.PropertyName == "SearchString")
                .Throttle(TimeSpan.FromMilliseconds(250))
                .Subscribe(_ => {
                    System.Diagnostics.Debug.WriteLine("search string changed");
                    
                    if (SearchString.Trim() == string.Empty)
                        view.Filter = null;
                    else
                        view.Filter = o => Regex.IsMatch(o as string, SearchString, RegexOptions.IgnoreCase);
                        
                    view.Refresh();
                    FilteredLibraryItemsCount = LibraryItems.Where(o => Regex.IsMatch(o as string, SearchString, RegexOptions.IgnoreCase)).Count();
                });

            //Observable.FromEventPattern<System.ComponentModel.PropertyChangedEventArgs>(this, "PropertyChanged")
            //    .Where(et => et.EventArgs.PropertyName == "LibraryItems")
            //    .Do(et => view = CollectionViewSource.GetDefaultView(LibraryItems));
            
            

        }
开发者ID:jrwren,项目名称:XBMCRemote,代码行数:34,代码来源:LibraryWindow.xaml.cs

示例7: GetData

 //加载数据
 private void GetData(int pageIndex, string checkState)
 {
     int pageCount = 0;
     ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>();   //查询过滤条件             
     paras.Add(dtiStartDate.DateTimeValue);
     paras.Add(dtiEndDate.DateTimeValue);
     vehicleManager.GetCanUseVehicleUseAppInfoListAsync(pageIndex, dataPager.PageSize, "UPDATEDATE", "", paras, pageCount, Common.CurrentLoginUserInfo.UserPosts[0].CompanyID, Common.CurrentLoginUserInfo.EmployeeID);
 }
开发者ID:JuRogn,项目名称:OA,代码行数:9,代码来源:VehicleUseAppForm_sel.xaml.cs

示例8: GetRightCharFunction

 public GetRightCharFunction()
 {
     Name = "Строка справа";
     SelectedParameter = FunctionParameters.CellName;
     Parameters = new System.Collections.ObjectModel.ObservableCollection<Parameter>
     {
         new Parameter{Name="Длинна", Value=0, ExpectedValueType = typeof(int)}
     };
 }
开发者ID:kblc,项目名称:ExcelConverter,代码行数:9,代码来源:GetRightCharFunction.cs

示例9: StringContainsFunction

 public StringContainsFunction()
 {
     Name = FunctionName;
     SelectedParameter = FunctionParameters.CellName;
     Parameters = new System.Collections.ObjectModel.ObservableCollection<Parameter>
     {
         new Parameter{Name="Текст", ExpectedValueType = typeof(string)}
     };
 }
开发者ID:kblc,项目名称:ExcelConverter,代码行数:9,代码来源:StringContainsFunction.cs

示例10: LoadData

        private void LoadData()
        {
            loadbar.Start();
            int pageCount = 0;
            string filter = "";
            System.Collections.ObjectModel.ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>();

            client.ImportSetMasterPagingAsync(pageMaster.PageIndex, pageMaster.PageSize, "ENTITYNAME", filter,
                paras, pageCount, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
        }
开发者ID:JuRogn,项目名称:OA,代码行数:10,代码来源:ImportSetMaster.xaml.cs

示例11: StringPositionFunction

 public StringPositionFunction()
 {
     Name = "Подстрока";
     SelectedParameter = FunctionParameters.CellName;
     Parameters = new System.Collections.ObjectModel.ObservableCollection<Parameter>
     {
         new Parameter{Name="Начало", ExpectedValueType = typeof(int)},
         new Parameter{Name="Длинна", ExpectedValueType = typeof(int)}
     };
 }
开发者ID:kblc,项目名称:ExcelConverter,代码行数:10,代码来源:StringPositionFunction.cs

示例12: GetData

 //加载数据
 private void GetData(int pageIndex, string checkState)
 {
     int pageCount = 0;
     ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>();   //查询过滤条件  
    
     paras.Add(DateTime.Parse(DateStart.Text));
     paras.Add(DateTime.Parse(DateEnd.Text));
     paras.Add((cmbVehicleInfo.SelectedItem as T_OA_VEHICLE).ASSETID);
     _VM.Get_VMAppCheckedAsync(pageIndex, dataPager.PageSize, "UPDATEDATE", "", paras, pageCount, Common.CurrentLoginUserInfo.UserPosts[0].CompanyID, Common.CurrentLoginUserInfo.EmployeeID, "2");
 }
开发者ID:JuRogn,项目名称:OA,代码行数:11,代码来源:MaintenanceApp_sel.xaml.cs

示例13: LoadData

        private void LoadData()
        {
            loadbar.Start();
            int pageCount = 0;
            string filter = "";
            System.Collections.ObjectModel.ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>();

            TextBox txtDepID = Utility.FindChildControl<TextBox>(expander, "txtDepCode");
            if (txtDepID != null)
            {
                if (!string.IsNullOrEmpty(txtDepID.Text))
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    //filter += "[email protected]" + paras.Count().ToString();
                    filter += " @" + paras.Count().ToString() + ".Contains(DEPARTMENTCODE)";
                    paras.Add(txtDepID.Text.Trim());
                }
            }
            TextBox txtDepName = Utility.FindChildControl<TextBox>(expander, "txtDepName");
            if (txtDepName != null)
            {
                if (!string.IsNullOrEmpty(txtDepName.Text))
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    //  filter += "[email protected]" + paras.Count().ToString();
                    filter += " @" + paras.Count().ToString() + ".Contains(DEPARTMENTNAME)";
                    paras.Add(txtDepName.Text.Trim());
                }
            }
            ComboBox txtDepType = Utility.FindChildControl<ComboBox>(expander, "cbxDepType");
            if (txtDepType != null)
            {
                if (txtDepType.SelectedIndex > 0)
                {
                    if (!string.IsNullOrEmpty((txtDepType.SelectedItem as T_SYS_DICTIONARY).DICTIONARYID))
                    {
                        if (!string.IsNullOrEmpty(filter))
                        {
                            filter += " and ";
                        }
                        filter += "[email protected]" + paras.Count().ToString();
                        // paras.Add(txtDepType.SelectedValue.Trim());
                        paras.Add((txtDepType.SelectedItem as T_SYS_DICTIONARY).DICTIONARYVALUE.ToString());
                    }
                }
            }
            svc.DepartmentDictionaryPagingAsync(dataPager.PageIndex, dataPager.PageSize, "DEPARTMENTCODE", filter,
                paras, pageCount, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, Checkstate);
        }
开发者ID:JuRogn,项目名称:OA,代码行数:55,代码来源:DepartmentDictionary.xaml.cs

示例14: StringLengthFunction

 public StringLengthFunction()
 {
     Name = FunctionName;
     SelectedParameter = FunctionParameters.CellName;
     Parameters = new System.Collections.ObjectModel.ObservableCollection<Parameter>
     {
         new Parameter{Name="Больше", ExpectedValueType = typeof(int)},
         new Parameter{Name="Меньше", ExpectedValueType = typeof(int)},
         new Parameter{Name="Равно",  ExpectedValueType = typeof(int)},
     };
 }
开发者ID:kblc,项目名称:ExcelConverter,代码行数:11,代码来源:StringLengthFunction.cs

示例15: GetData

        //加载数据
        private void GetData(int pageIndex, string checkState)
        {         
                int pageCount = 0;
                ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>();   //参数值     

                paras.Add(DateStart.Text);
                paras.Add(DateEnd.Text);
                SMT.SaaS.OA.UI.SmtOACommonAdminService.LoginUserInfo loginInfo = new SMT.SaaS.OA.UI.SmtOACommonAdminService.LoginUserInfo();
                loginInfo.companyID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                loginInfo.userID = Common.CurrentLoginUserInfo.EmployeeID;
                _VM.Get_SSurveyCheckedAsync(pageIndex, dataPager.PageSize, "RequireMaster.CREATEDATE", "", paras, pageCount, Common.CurrentLoginUserInfo.UserPosts[0].CompanyID, Common.CurrentLoginUserInfo.EmployeeID, "2");
           
        }
开发者ID:JuRogn,项目名称:OA,代码行数:14,代码来源:Satisfaction_sel.xaml.cs


注:本文中的System.Collections.ObjectModel.System.Collections.ObjectModel.ObservableCollection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。