本文整理汇总了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;
}
}
示例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++;
}
}
}
示例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;
}