• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ObjectModel.ObservableCollection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: GetData

        //加载数据
        private void GetData(int pageIndex, string checkState)
        {
            if (cmbVehicleInfo != null && cmbVehicleInfo.Items.Count > 0)
            {
                int pageCount = 0;
                ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>();   //参数值     
                paras.Add((cmbVehicleInfo.SelectionBoxItem as T_OA_VEHICLE).ASSETID);
                paras.Add(dtiStartDate.DateTimeValue);

                SMT.SaaS.OA.UI.SmtOACommonAdminService.LoginUserInfo loginInfo = new SMT.SaaS.OA.UI.SmtOACommonAdminService.LoginUserInfo();
                vehicleManager.Gets_VDCheckedAsync(pageIndex, dataPager.PageSize, "CREATEDATE", "", paras, pageCount, loginInfo);
            }
        }
开发者ID:JuRogn,项目名称:OA,代码行数:14,代码来源:VehicleDispatchForm_sel.xaml.cs


示例17: MainWindow

        //委托的声明
        //public delegate void Debug_Event_Handler(object sender, String msg);
        //public event Debug_Event_Handler Debug_Event;

        public MainWindow()
        {
            System.Windows.Media.RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly;

            InitializeComponent();

            distime = new disTime(this, this.RemoveAllMediaTextBlock);

            initWL();

            personalInfoList = new System.Collections.ObjectModel.ObservableCollection<slaveList>();

            this.iplistView.ItemsSource = personalInfoList;
        }
开发者ID:Season02,项目名称:MK2.0,代码行数:18,代码来源:MainWindow.xaml.cs


示例18: LoadData

        public void LoadData()
        {
            RefreshUI(RefreshedTypes.ShowProgressBar);
            int pageCount = 0;
            string filter = "";
            int sType = 0;
            string sValue = "";
            DateTime? starttimes;
            DateTime? endtimes = DateTime.Now.Date;
            starttimes = new DateTime(DateTime.Now.Year - 2, 1, 1);
            endtimes = new DateTime(DateTime.Now.Year, 12, 1);

            System.Collections.ObjectModel.ObservableCollection<string> paras = new System.Collections.ObjectModel.ObservableCollection<string>();
            TextBox txtEmpName = Utility.FindChildControl<TextBox>(expander, "txtEmpName");
            if (!string.IsNullOrEmpty(treeOrganization.sType))
            {
                string IsTag = treeOrganization.sType;
                sValue = treeOrganization.sValue;
                switch (IsTag)
                {
                    case "0":
                        sType = 0;
                        break;
                    case "1":
                        sType = 1;
                        break;
                    case "2":
                        sType = 2;
                        break;
                }
            }
            else
            {
                RefreshUI(RefreshedTypes.HideProgressBar);
                return;
            }

            if (!string.IsNullOrEmpty(txtEmpName.Text.Trim()))
            {
                // filter += "[email protected]" + paras.Count().ToString();
                //filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEENAME)";
                filter += " EMPLOYEENAME.Contains(@" + paras.Count().ToString() + ")";
                paras.Add(txtEmpName.Text.Trim());
            }

            client.GetResignAsync(dataPager.PageIndex, dataPager.PageSize, "EMPLOYEEID", filter, paras, pageCount, Convert.ToDateTime(starttimes), Convert.ToDateTime(endtimes), userID, sType, sValue);

        }
开发者ID:JuRogn,项目名称:OA,代码行数:48,代码来源:ResignForm.xaml.cs


示例19: GetData

        //加载数据
        private void GetData(string checkState)
        {
            string filter = "";    //查询过滤条件
            ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>();   //查询过滤条件   
            RefreshUI(RefreshedTypes.ShowProgressBar);
            if (!string.IsNullOrEmpty(filter))
            {
                filter += " and ";
            }
            filter += "OWNERID == @" + paras.Count().ToString();
            paras.Add(strOwnerID);

            decimal dCheckStates = 0, dIsRepaied = 1;
            decimal.TryParse(checkState, out dCheckStates);
            client.GetBorrowApplyMasterListForRepayAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, dIsRepaied, dCheckStates, filter, paras);
        }
开发者ID:JuRogn,项目名称:OA,代码行数:17,代码来源:BorrowApp_sel.xaml.cs


示例20: LoadData

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

            //TextBox txtName = Utility.FindChildControl<TextBox Style="{StaticResource TextBoxStyle}">(expander, "txtName");
            //if (txtName != null && !string.IsNullOrEmpty(txtName.Text.Trim()))
            //{
            //    filter += "[email protected]" + paras.Count().ToString();
            //    paras.Add(txtName.Text.Trim());
            //}

            client.GetSalaryLevelPagingAsync(dataPager.PageIndex, dataPager.PageSize, "SALARYLEVELID", filter, paras, pageCount,SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
        }
开发者ID:JuRogn,项目名称:OA,代码行数:16,代码来源:SalaryLevel.xaml.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Specialized.BitVector32类代码示例发布时间:2022-05-26
下一篇:
C# Generic.List类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap