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


C# System.Collections.ObjectModel.ObservableCollection.Where方法代码示例

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


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

示例1: client_GetDepartmentDictionaryAllCompleted

        void client_GetDepartmentDictionaryAllCompleted(object sender, GetDepartmentDictionaryAllCompletedEventArgs e)
        {
            if (Department.T_HR_COMPANY != null || Department != null)
            {
                //判断状态是否为修改
                T_HR_COMPANY ent = Department.T_HR_COMPANY;

                tempList = e.Result;
                var entity = tempList.Where(s => s.DEPARTMENTTYPE == "-1" || s.DEPARTMENTTYPE == ent.COMPANYTYPE);
                entity = entity.Count() > 0 ? entity.ToList() : null;

                List<SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY> dicts = Application.Current.Resources["SYS_DICTIONARY"] as List<SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY>;
                dicts = dicts.Where(s => s.DICTIONCATEGORY == "COMPANYTYPE").OrderBy(s => s.DICTIONARYVALUE).ToList();

                foreach (T_HR_DEPARTMENTDICTIONARY diction in entity)
                {
                    decimal dptype = Convert.ToDecimal(diction.DEPARTMENTTYPE);
                    var tmp = dicts.Where(s => s.DICTIONARYVALUE == dptype).FirstOrDefault();
                    if (tmp != null)
                    {
                        diction.OWNERPOSTID = diction.DEPARTMENTNAME;//暂存部门名称
                        diction.DEPARTMENTNAME = diction.DEPARTMENTNAME + "(" + tmp.DICTIONARYNAME + ")";

                    }
                }

                //cbxDepartMent.ItemsSource = entity;
                //cbxDepartMent.DisplayMemberPath = "DEPARTMENTNAME";
                acbDepName.ItemsSource = entity;
                acbDepName.ValueMemberPath = "DEPARTMENTNAME";
                string deptName = string.Empty;
                if (Department.T_HR_DEPARTMENTDICTIONARY != null)
                {
                    foreach (var item in acbDepName.ItemsSource)
                    {
                        T_HR_DEPARTMENTDICTIONARY dict = item as T_HR_DEPARTMENTDICTIONARY;
                        if (dict != null)
                        {
                            if (dict.DEPARTMENTDICTIONARYID == Department.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTDICTIONARYID)
                            {
                                //cbxDepartMent.SelectedItem = item;
                                acbDepName.SelectedItem = item;
                                deptName = dict.DEPARTMENTNAME;
                                break;
                            }
                        }
                    }
                }
                acbDepName.IsEnabled = true;
                //acbDepName.ToggleButton.IsEnabled = false;
                //acbDepName.TxtLookUp.IsReadOnly = true;
                ToolTipService.SetToolTip(this.acbDepName.TxtLookUp, deptName);
            }
        }
开发者ID:JuRogn,项目名称:OA,代码行数:54,代码来源:DepartmentForm.xaml.cs

示例2: OnNavigatedTo

        // 使用者巡覽至這個頁面時執行。
        protected  async override void OnNavigatedTo(NavigationEventArgs e)
        {

            db = new slSecure.Web.SecureDBContext();
            var q = from n in db.GetTblEngineRoomConfigQuery() select n;
                   
           
                     

            var res=await  db.LoadAsync<slSecure.Web.tblEngineRoomConfig>(q );
             roomInfos = (from n in res
                            select new ControlRoomInfo()
                            {
                                 ERID=n.ERID,
                                Type = "C",
                                AlarmStatus = 0,
                                Name = n.ERName,
                                X = n.GPSX,
                                Y = n.GPSY
                            }).ToArray();

            foreach (ControlRoomInfo info in roomInfos)
            {
                mapctl.AddControllRoomPin(info);
              
            }

            //var q1 = from n in db.GetTblERPlaneQuery() select n;
            //var res1= await db.LoadAsync<tblERPlane>(q1);

            //planeInfos = (from n in res1
            //             select new PlaneInfo()
            //             {
            //                  ERID=n.ERID,
            //                   AlarmStatus=0,
            //                    Name=n.PlaneName,
            //                    PlaneID=n.PlaneID,
            //                     Type="EP"
                                  
            //             }).ToArray();

            
                client = new MyClient("CustomBinding_ISecureService", false);
          
            client.SecureService.GetAllPlaneInfoCompleted += (s, a) =>
                {
                    if (a.Error != null)
                        return;
                  lstMenu.ItemsSource =   PlaneDegreeInfos=a.Result;

                  if (roomInfos != null)
                      foreach (ControlRoomInfo info in roomInfos)
                      {
                          try
                          {
                              info.AlarmStatus = PlaneDegreeInfos.Where(n => n.ERID == info.ERID).Max(n => n.AlarmStatus);

                          }
                          catch { ;}
                      }

                };
            if (!IsExit)
            {
                client.SecureService.GetAllPlaneInfoAsync();


                tmr.Interval = TimeSpan.FromSeconds(10);
                tmr.Tick += tmr_Tick;

                tmr.Start();
            }
          //  client.OnItemValueChangedEvent += client_OnItemValueChangedEvent;
        }
开发者ID:ufjl0683,项目名称:slSecureAndPD,代码行数:75,代码来源:Monitor.xaml.cs


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