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


C# ObservableCollection.Count方法代码示例

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


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

示例1: HandleGamesResponse

        private void HandleGamesResponse(ObservableCollection<GameData> gamesCollection, Exception exception)
        {
            if (exception != null)
            {

            }
            else
            {
                ObservableCollection<GameData> temp = new ObservableCollection<GameData>(gamesCollection.OrderBy(g => g.UK_Name.Trim()));

                //var games = from game in temp
                //               group game by game.UK_Name.Trim().ToLower().Substring(0, 1) into c
                //               orderby c.Key
                //               select new Group<GameData>(c.Key, c);



                this.GamesList = temp;
                this.HaveGames = temp.Count() > 0;
            }
        }
开发者ID:Giulio-Ladu,项目名称:GameHub,代码行数:21,代码来源:PlatformGamesViewmodel.cs

示例2: TestService

        private void TestService()
        {
            Gurock.SmartInspect.SiAuto.Main.LogMessage("Start TEST Service");
            Gurock.SmartInspect.SiAuto.Main.LogMessage("FTPCORE MODE = "+FTPONLY.ToString());
            Boolean allok = true;
            try
            {
                //DAL.UserCollection _users = new DAL.UserCollection();
                ObservableCollection<User> _users = new ObservableCollection<User>();
                _users = proxy.CollectUsers();
                Gurock.SmartInspect.SiAuto.Main.LogMessage("USERS COLLECTED");
                try
                {
                    Gurock.SmartInspect.SiAuto.Main.LogMessage("USER COUNT = " + _users.Count());
                }
                catch (System.Exception x)
                {
                    si.six(x);
                }
                
                if (_users.Count <= 0 && FTPONLY == false)
                {
                    allok = false;
                    Gurock.SmartInspect.SiAuto.Main.LogMessage("FALSE");
                }
            }
            catch (Exception ex)
            {
                allok = false;
            }

            if (File.Exists(@"c:\tmp\schedule.xml") || (Boolean)Properties.Settings.Default.FTPCoreMode == true ) allok = true;

            if (allok == false)
            {
                tbClientID.Text = Properties.Settings.Default.ClientID;
                tbServiceAddress.Text = Properties.Settings.Default.ServiceAddress;
                tbPort.Text = Properties.Settings.Default.Port;
                tbWeatherLocation.Text = Properties.Settings.Default.WeatherLocation;
                cbFTPCore.IsChecked = (Boolean)Properties.Settings.Default.FTPCoreMode;
                tbGroupID.Text = Properties.Settings.Default.FTPCoreModeGroupID;
                if (cbFTPCore.IsChecked == true)
                {
                    spGroupID.Visibility = Visibility.Visible;
                } else
                {
                    spGroupID.Visibility = Visibility.Hidden;
                }
                borderConfiguration.Visibility = Visibility.Visible;
            }
            else
            {
                Gurock.SmartInspect.SiAuto.Main.LogMessage("Register Display Client with Core");
                try
                {
                    if (FTPONLY)
                    {
                        //_GROUPID = DeSerializeGroupID(@"c:\tmp\group.xml");
                        _GROUPID = Properties.Settings.Default.FTPCoreModeGroupID;
                        Gurock.SmartInspect.SiAuto.Main.LogMessage("FTPONLY MODE - collecting gid from xml:" + _GROUPID);
                    } else
                    {
                        si.sii("Attempting Registration");
                        _GROUPID = RegisterDisplayClientWithCore();
                        SerializeGroupID(@"c:\tmp\group.xml", _GROUPID);    
                    }
                }
                catch (Exception)
                {
                    _GROUPID = DeSerializeGroupID(@"c:\tmp\group.xml");
                    Gurock.SmartInspect.SiAuto.Main.LogMessage("Exception Register Display Client with Core - collecting gid="+_GROUPID);
                }
                Gurock.SmartInspect.SiAuto.Main.LogMessage("Done Register Display Client with Core");
                if (Properties.Settings.Default.Diagnostic == true)
                {
                    si.sii("Starting Service Check Timer");
                    StartServiceCheckTimer();
                }
                else
                {
                    si.sii("All OK - Starting Minute Timer");
                    minuteTimer.Start();
                    KeepAliveTicker++;
                }
            }
        }
开发者ID:keyanmca,项目名称:_Signage,代码行数:86,代码来源:MainWindow.xaml.cs

示例3: DelMasterDataById

 public bool DelMasterDataById(ObservableCollection<string> masterList)
 {
     bool flag = false;
     if ((masterList != null) && (masterList.Count() > 0))
     {
         BorrowApplyMasterBLL bll = new BorrowApplyMasterBLL();
         flag = bll.DelMasterDataById(masterList);
     }
     else
     {
         flag = false;
     }
     return flag;
 }
开发者ID:JuRogn,项目名称:OA,代码行数:14,代码来源:BorrowApply.cs


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