本文整理汇总了C#中SessionBase类的典型用法代码示例。如果您正苦于以下问题:C# SessionBase类的具体用法?C# SessionBase怎么用?C# SessionBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SessionBase类属于命名空间,在下文中一共展示了SessionBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
}
示例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>();
}
示例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));
}
示例4: FederationViewModel
public FederationViewModel(IList<Database> databases, SessionBase session)
{
_databases = new ReadOnlyCollection<DatabaseViewModel>(
(from database in databases
select new DatabaseViewModel(database, session))
.ToList());
}
示例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;
}
示例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);
}
}
示例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();
}
示例8: Unpersist
public override void Unpersist(SessionBase session)
{
m_folder.Files.Remove(this);
if (m_fileContent != null)
Content.Unpersist(session);
base.Unpersist(session);
}
示例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);
}
示例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;
}
示例11: createDatabaseLocations
public void createDatabaseLocations(SessionBase session)
{
session.BeginUpdate();
Person person = new Person("Mats", "Persson", 54);
session.Persist(person);
session.Commit();
verifyDatabaseLocations(session);
}
示例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);
}
示例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;
}
示例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));
}
示例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();
}