• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# SessionBase类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SessionBase的典型用法代码示例。如果您正苦于以下问题:C# SessionBase类的具体用法?C# SessionBase怎么用?C# SessionBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SessionBase类属于命名空间,在下文中一共展示了SessionBase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ObjectViewModel

 public ObjectViewModel(object obj, FieldViewModel parentView, int arrayIndex, bool encodedOid, SessionBase session)
   : base(parentView, true)
 {
   m_session = session;
   if (encodedOid)
   {
     if (obj.GetType() == typeof(UInt64))
     {
       m_objectId = (UInt64)obj;
       m_objectAsString = "[" + arrayIndex.ToString() + "] " + new Oid(m_objectId).ToString();
     }
     else
     {
       Oid oid = new Oid(parentView.ParentId);
       oid = new Oid(oid.Database, (UInt32)obj);
       m_objectId = oid.Id;
       m_objectAsString = "[" + arrayIndex.ToString() + "] " + new OidShort(oid.IdShort).ToString();
     }
   }
   else
   {
     IOptimizedPersistable pObj = obj as IOptimizedPersistable;
     if (pObj == null)
       session.GlobalObjWrapperGet(obj, out pObj);
     if (pObj != null)
       m_objectId = pObj.Id;
     m_session = session;
     if (pObj != null && pObj.WrappedObject != obj)
       m_objectAsString = "[" + arrayIndex.ToString() + "] " + pObj.WrappedObject.ToString() + " " + new Oid(pObj.Id);
     else
       m_objectAsString = "[" + arrayIndex.ToString() + "] " + obj.ToString();
   }
 }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:33,代码来源:ObjectViewModel.cs


示例2: CustomerContact

 public CustomerContact(string company, string firstName, string lastName, string email, string address,
                        string addressLine2, string city, string zipCode, string state, string country, string countryCode, string phone, string fax,
                        string mobile, string skypeName, string webSite, string userName, string password, string howFoundOther, int howFoundChoice,
                        SessionBase session)
 {
   this.company = company;
   this.firstName = firstName;
   this.lastName = lastName;
   this.email = email;
   this.address = address;
   this.addressLine2 = addressLine2;
   this.city = city;
   this.zipCode = zipCode;
   this.state = state;
   this.country = country;
   this.countryCode = countryCode;
   this.phone = phone;
   this.fax = fax;
   this.mobile = mobile;
   this.skypeName = skypeName;
   this.webSite = webSite;
   this.userName = userName;
   this.password = password;
   this.howFoundOther = howFoundOther;
   this.howFoundVelocityDb = (HowFound) howFoundChoice;
   priorVerifiedEmailSet = new SortedSetAny<string>();
 }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:27,代码来源:CustomerContact.cs


示例3: ImdbRoot

 public ImdbRoot(SessionBase session)
 {   
   actorSet = new BTreeSet<Actor>(null, session);
   actressSet = new BTreeSet<Actress>(null, session);
   actingByNameSet = new BTreeSet<ActingPerson>(actingByNameComparer, session);
   movieSet = new BTreeSet<Movie>(movieNameHashComparer, session, 10000, sizeof(Int32));
 }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:7,代码来源:ImdbRoot.cs


示例4: FederationViewModel

 public FederationViewModel(IList<Database> databases, SessionBase session)
 {
   _databases = new ReadOnlyCollection<DatabaseViewModel>(
     (from database in databases
      select new DatabaseViewModel(database, session))
      .ToList());
 }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:7,代码来源:FederationViewModel.cs


示例5: PageViewModel

 public PageViewModel(Page page, DatabaseViewModel parentDatabase, SessionBase session)
   : base(parentDatabase, true)
 {
   m_dbNum = page.Database.DatabaseNumber;
   m_pageNum = page.PageNumber;
   m_session = session;
 }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:7,代码来源:PageViewModel.cs


示例6: Plug

        public void Plug(IOThread ioThread, SessionBase session)
        {
            m_session = session;
            m_encoder.SetMsgSource(session);

            // get the first message from the session because we don't want to send identities
            var msg = new Msg();
            msg.InitEmpty();

            bool ok = session.PullMsg(ref msg);

            if (ok)
            {
                msg.Close();
            }

            AddSocket(m_socket);            

            if (!m_delayedStart)
            {
                StartConnecting();
            }
            else
            {
                m_state = State.Delaying;                
                AddTimer(GetNewReconnectIvl(), ReconnectTimerId);
            }
        }
开发者ID:NetMQ,项目名称:NetMQ3-x,代码行数:28,代码来源:PgmSender.cs


示例7: 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


示例8: Unpersist

 public override void Unpersist(SessionBase session)
 {
   m_folder.Files.Remove(this);
   if (m_fileContent != null)
     Content.Unpersist(session);
   base.Unpersist(session);
 }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:7,代码来源:FileInDb.cs


示例9: Artist

        public Artist(Link link, SessionBase session, bool browse = false)
        {
            this.Handle = libspotify.sp_link_as_artist(link.Handle);
            this._session = session;

            Init(browse);
        }
开发者ID:razims,项目名称:Spoti,代码行数:7,代码来源:Artist.cs


示例10: SearchGeoHashIndex

 public static HashSet<GeoObj> SearchGeoHashIndex(SessionBase session, double lat, double lon, double radius)
 {
   HashSet<GeoObj> resultSet = new HashSet<GeoObj>();
   WGS84Point center = new WGS84Point(lat, lon);
   GeoHashCircleQuery query = new GeoHashCircleQuery(center, radius); // radius in meters
   BoundingBox bbox = query.BoundingBox;
   var btreeSet = session.AllObjects<BTreeSet<GeoObj>>().FirstOrDefault();
   foreach (GeoHash hash in query.SearchHashes)
   {
     var itr = btreeSet.Iterator();
     itr.GoTo(new GeoObj(hash.LongValue));
     var current = itr.Current();
     while (current != null)
     {
       GeoHash geoHash = GeoHash.FromLongValue(current.GeoHash);
       if ((geoHash.SignificantBits >= hash.SignificantBits && geoHash.Within(hash)) || (geoHash.SignificantBits < hash.SignificantBits && hash.Within(geoHash)))
       {
         if (!(current.Latitude < bbox.MinLat || current.Latitude > bbox.MaxLat || current.Longitude < bbox.MinLon || current.Longitude > bbox.MaxLon))
           resultSet.Add(current);
         current = itr.Next();
       }
       else
         break;
     }
   }
   return resultSet;
 }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:27,代码来源:GeoHashQuery.cs


示例11: createDatabaseLocations

 public void createDatabaseLocations(SessionBase session)
 {
   session.BeginUpdate();
   Person person = new Person("Mats", "Persson", 54);
   session.Persist(person);
   session.Commit();
   verifyDatabaseLocations(session);
 }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:8,代码来源:MoveDatabaseLocations.cs


示例12: AspNetIdentity

 public AspNetIdentity(SessionBase session)
 {
   m_adapterMap = new BTreeMap<string, UserLoginInfoAdapter>(null, session);
   m_userSet = new BTreeSet<IdentityUser>(null, session);
   m_roleSet = new BTreeSet<IdentityRole>(null, session);
   m_emailToId = new BTreeMap<string, ulong>(null, session);
   m_userNameToId = new BTreeMap<string, ulong>(null, session);
 }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:8,代码来源:AspNetIdentity.cs


示例13: Root

 public Root(SessionBase session, ushort maxEntriesPerNode)
 { 
   CompareCustomerEmail compareCustomerEmail = new CompareCustomerEmail();
   CompareCustomerUserName compareCustomerUserName = new CompareCustomerUserName();
   customersByEmail = new BTreeSet<CustomerContact>(compareCustomerEmail, session, maxEntriesPerNode);
   customersByUserName = new BTreeSet<CustomerContact>(compareCustomerUserName, session, maxEntriesPerNode);
   lastCustomerIdNumber = 0;     
 }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:8,代码来源:Root.cs


示例14: Document

    public Document(UInt64 id): base(id) {} // for lookups

    public Document(string url, IndexRoot indexRoot, SessionBase session)
    {
      this.url = url;
      HashCodeComparer<Word> hashCodeComparer = new HashCodeComparer<Word>();
      m_wordHit = new BTreeMapOidShort<Word, WordHit>(null, session);
      m_wordHit.TransientBatchSize = 10000;
      wordSet = new BTreeSetOidShort<Word>(hashCodeComparer, session, 1500, sizeof(int));
    }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:10,代码来源:Document.cs


示例15: FederationViewModel

 public FederationViewModel(FederationInfo federationInfo) : base(null, true)
 {
   m_federationInfo = federationInfo;
   if (m_federationInfo.UsesServerClient || (SessionBase.IsSameHost(m_federationInfo.HostName, SessionBase.LocalHost) == false))
     m_session = new ServerClientSession(m_federationInfo.SystemDbsPath, m_federationInfo.HostName, m_federationInfo.WaitForMilliSeconds, m_federationInfo.UsePessimisticLocking == false);
   else
     m_session = new SessionNoServer(m_federationInfo.SystemDbsPath, m_federationInfo.WaitForMilliSeconds, m_federationInfo.UsePessimisticLocking == false);
   m_session.BeginRead();
 }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:9,代码来源:FederationViewModel.cs


示例16: moveDatabaseLocations

 public void moveDatabaseLocations(SessionBase session, string updatedHostName, string newPath)
 {
     session.BeginUpdate(false);
     DatabaseLocation bootLocation = session.DatabaseLocations.LocationForDb(0);
     DatabaseLocation locationNew = new DatabaseLocation(updatedHostName, newPath, bootLocation.StartDatabaseNumber, bootLocation.EndDatabaseNumber, session,
         bootLocation.CompressPages, bootLocation.PageEncryption, bootLocation.IsBackupLocation, bootLocation.BackupOfOrForLocation);
     bootLocation = session.NewLocation(locationNew);
     session.Commit(false);
 }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:9,代码来源:MoveDatabaseLocations.cs


示例17: IndexRoot

    //public BTreeMap<Word, UInt32> globalWordCount;

    public IndexRoot(ushort nodeSize, SessionBase session)
    {
      hashCodeComparer = new HashCodeComparer<Word>();
      lexicon = new Lexicon(nodeSize, hashCodeComparer, session);
      lexicon.Persist(session, lexicon);
      repository = new Repository(nodeSize, session);
      repository.Persist(session, repository, true);
      //globalWordCount = new BTreeMap<Word, uint>(null, session);
    }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:11,代码来源:IndexRoot.cs


示例18: FieldViewModel

 public FieldViewModel(IOptimizedPersistable parentObj, DataMember member, ObjectViewModel parentObject, SessionBase session)
   : base(parentObject, true)
 {
   _session = session;
   page = parentObj.Page;
   memberObj = member.GetMemberValue(parentObj.WrappedObject);
   isEncodedOidArray = (parentObj as BTreeNode) != null && memberObj != null && (memberObj as Array) != null && (member.Field.Name == "keysArray" || member.Field.Name == "valuesArray");
   fieldAsString = OptimizedPersistable.ToStringDetails(member, parentObj.WrappedObject, parentObj, parentObj.Page, true);
 }
开发者ID:MerlinBrasil,项目名称:VelocityDB,代码行数:9,代码来源:FieldViewModel.cs


示例19: Initialize

 void Initialize()
 {
   SessionBase.BaseDatabasePath = Properties.Settings.Default.BaseDatabasePath;
   m_session = new SessionNoServer(Properties.Settings.Default.DatabaseManagerDirectory);
   try
   {
     m_session.BeginUpdate();
     List<FederationViewModel> federationInfos = new List<FederationViewModel>();
     List<FederationInfo> federationInfosToRemove = new List<FederationInfo>();
     foreach (FederationInfo info in m_session.AllObjects<FederationInfo>())
     {
       try
       {
         federationInfos.Add(new FederationViewModel(info));
       }
       catch (Exception ex)
       {
         if (MessageBox.Show(ex.Message + " for " + info.HostName + " " + info.SystemDbsPath + " Remove this Database?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
           federationInfosToRemove.Add(info);
       }
     }
     foreach (FederationInfo info in federationInfosToRemove)
       info.Unpersist(m_session);
     if (federationInfos.Count() == 0)
     {
       string host = Properties.Settings.Default.DatabaseManagerHost;
       if (host == null || host.Length == 0)
         host = Dns.GetHostName();
       FederationInfo info = new FederationInfo(host,
         Properties.Settings.Default.DatabaseManagerDirectory,
         Properties.Settings.Default.TcpIpPortNumber,
         Properties.Settings.Default.DoWindowsAuthentication,
         null,
         Properties.Settings.Default.WaitForLockMilliseconds,
         Properties.Settings.Default.UseClientServer,
         "Database Manager");
       m_session.Persist(info);
       m_session.Commit();
       federationInfos.Add(new FederationViewModel(info));
     }
     if (m_session.InTransaction)
       m_session.Commit();
     m_federationViews = federationInfos;
   }
   catch (Exception ex)
   {
     if (m_session.InTransaction)
       m_session.Abort();
     if (MessageBox.Show(ex.Message + " for " + SessionBase.LocalHost + " " + Properties.Settings.Default.DatabaseManagerDirectory + " Remove this Database?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
     {
       DirectoryInfo dir = new DirectoryInfo(Properties.Settings.Default.DatabaseManagerDirectory);
       dir.Delete(true);
       Initialize();
     }
   }
 }
开发者ID:VelocityDB,项目名称:VelocityDB,代码行数:56,代码来源:AllFederationsViewModel+.cs


示例20: Call

 /// <summary>
 /// 调用函数.
 /// </summary>
 /// <param name="session"></param>
 /// <param name="msg"></param>
 /// <returns></returns>
 public Result Call(SessionBase session, APIMessage msg)
 {
     Result result = null;
     MessageHandler handler;
     _messageApilist.TryGetValue(msg.Type, out handler);
     if (handler == null)
         return result;
     result = handler(session, msg.Parameters);
     return result;
 }
开发者ID:guoruichao,项目名称:c-_Project,代码行数:16,代码来源:MessageListener.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SessionData类代码示例发布时间:2022-05-24
下一篇:
C# Session类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap