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


C# SessionBase.DatabaseNumberOf方法代码示例

本文整理汇总了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();
 }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:31,代码来源:KevinBaconNumbers.cs

示例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;
   }
 }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:16,代码来源:WorldCities.xaml.cs

示例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);
       }
     }
   }
 }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:23,代码来源:KevinBaconNumbers.cs


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