本文整理汇总了C#中SessionBase.DatabaseNumberOf方法的典型用法代码示例。如果您正苦于以下问题:C# SessionBase.DatabaseNumberOf方法的具体用法?C# SessionBase.DatabaseNumberOf怎么用?C# SessionBase.DatabaseNumberOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SessionBase
的用法示例。
在下文中一共展示了SessionBase.DatabaseNumberOf方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: processsMovies
void processsMovies(SessionBase session)
{
UInt32 actorDbNum = session.DatabaseNumberOf(typeof(Actor));
foreach (Movie movie in unchasedMovie)
{
if (chasedMovie.Contains(movie.ShortId) == false)
{
chasedMovie.Add(movie.ShortId);
foreach (ActingPerson acting in movie.Cast)
{
if (acting.DatabaseNumber == actorDbNum)
{
if (chasedActor.Contains(acting.ShortId) == false)
{
unchasedPerson.Add(acting);
chasedActor.Add(acting.ShortId);
resultArray[bacon]++;
}
}
else
if (chasedActress.Contains(acting.ShortId) == false)
{
unchasedPerson.Add(acting);
chasedActress.Add(acting.ShortId);
resultArray[bacon]++;
}
}
}
}
unchasedMovie.Clear();
}
示例2: loadCities
void loadCities(SessionBase session)
{
Database db = session.OpenDatabase(session.DatabaseNumberOf(typeof(City)));
if (db != null)
{
var src = from City city in db.AllObjects<City>() select city;
CityName.ItemsSource = src;
Country.ItemsSource = src;
Latitude.ItemsSource = src;
Longitude.ItemsSource = src;
//State.ItemsSource = src;
//Population.ItemsSource = src;
CreateDatabasePanel.Visibility = System.Windows.Visibility.Collapsed;
HelpLabel.Visibility = System.Windows.Visibility.Collapsed;
}
}
示例3: calculateNumbers
void calculateNumbers(SessionBase session)
{
ImdbRoot imdbRoot = (ImdbRoot)session.Open(session.DatabaseNumberOf(typeof(ImdbRoot)), 2, 1, false);
ActingPerson kevin = new Actor("Bacon, Kevin (I)", session);
if (!imdbRoot.ActingByNameSet.TryGetKey(kevin, ref kevin))
Console.WriteLine("Couldn't find actor Kevin Bacon!");
else
{
unchasedMovie = kevin.InMovieAs.ToList<Movie>();
resultArray[bacon]++; // Kevin Bacon himself
while (unchasedMovie.Count > 0)
{
bacon++;
processsMovies(session);
foreach (ActingPerson acting in unchasedPerson)
{
foreach (Movie movie in (IEnumerable<Movie>)acting.InMovieAs)
if (chasedMovie.Contains(movie.ShortId) == false)
unchasedMovie.Add(movie);
}
}
}
}