本文整理汇总了C#中IMember.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IMember.GetType方法的具体用法?C# IMember.GetType怎么用?C# IMember.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMember
的用法示例。
在下文中一共展示了IMember.GetType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Install
/// <summary>
/// 安装某个app
/// </summary>
/// <param name="appType">必须事先IApp的类型,比如ForumApp</param>
/// <param name="owner"></param>
/// <param name="creator"></param>
/// <param name="appName">app名称</param>
/// <returns></returns>
public virtual IMemberApp Install( Type appType, IMember owner, User creator, String appName ) {
IApp objApp = ObjectContext.Create<IApp>( appType );
objApp.OwnerId = owner.Id;
objApp.OwnerType = owner.GetType().FullName;
objApp.OwnerUrl = owner.Url;
db.insert( objApp );
AppInstaller info = GetByType( appType );
IMemberApp mApp = ObjectContext.Create<IMemberApp>( getMemberAppType( owner ) );
mApp.Creator = creator;
mApp.CreatorUrl = creator.Url;
mApp.AppInfoId = info.Id;
mApp.AppOid = objApp.Id;
mApp.Name = appName;
if (mApp.GetType().IsSubclassOf( typeof( CacheObject ) )) {
cdb.insert( (CacheObject)mApp );
}
else {
db.insert( mApp );
}
return mApp;
}
示例2: getFriendlyUrls
protected virtual List<String> getFriendlyUrls( MvcContext ctx, IMember owner, String rawUrl )
{
List<String> furls = new List<String>();
List<IMenu> list = InitHelperFactory.GetHelper( owner.GetType(), ctx ).GetMenus( owner );
foreach (IMenu menu in list) {
if (strUtil.EqualsIgnoreCase( rawUrl, getFullUrl( menu.RawUrl ) )) {
String urlKey = "/" + menu.Url + MvcConfig.Instance.UrlExt;
furls.Add( urlKey );
if (menu.Url == "default") { // 在静态页面的时候,有多种结果:/和/Default.aspx
furls.Add( "/" );
furls.Add( "/default" + MvcConfig.Instance.UrlExt );
furls.Add( "/Default" + MvcConfig.Instance.UrlExt );
}
}
}
return furls;
}
示例3: GetById
public virtual ForumLink GetById(long id, IMember owner) {
return db.find<ForumLink>( "Id=:id and OwnerId=:ownerId and OwnerType=:type" )
.set( "id", id )
.set( "ownerId", owner.Id )
.set( "type", owner.GetType().FullName )
.first();
}
示例4: GetCategoryById
public virtual PageCategory GetCategoryById( int categoryId, IMember owner )
{
PageCategory category = db.findById<PageCategory>( categoryId );
if (category != null) {
if (category.OwnerType != owner.GetType().FullName || category.OwnerId != owner.Id) return null;
}
return category;
}
示例5: getAppById
private static IApp getAppById( Type appType, int appId, IMember owner )
{
IApp app = ndb.findById( appType, appId ) as IApp;
if (app == null) return null;
if (app.OwnerId != owner.Id || owner.GetType().FullName.Equals( app.OwnerType ) == false) return null;
return app;
}
示例6: clearUrl
//------------------------------------------------------------------------------------------------------------------------------------------
public static String clearUrl( IMemberApp app, MvcContext ctx, IMember owner )
{
String appUrl = alink.ToUserAppFull( app );
String ownerPath = Link.GetMemberPathPrefix( owner.GetType().FullName, owner.Url );
ownerPath = ownerPath.TrimStart( '/' );
return clearUrl( appUrl, ownerPath, ctx );
}
示例7: CanAppAdmin
public static bool CanAppAdmin(IUser user, IMember owner, Type appType, long appInstanceId)
{
long roleId = ((User)user).RoleId;
IMemberAppService appService = ServiceMap.GetUserAppService( owner.GetType() );
IMemberApp app = appService.GetByApp( appType, appInstanceId );
return IsRoleInApp( roleId, app.Id );
}
示例8: isCustomHome
private Boolean isCustomHome( IMember owner )
{
Boolean homepageCustom = false;
if (owner.GetType() == typeof( User )) {
return homepageCustom;
}
return true;
}
示例9: GetById
public virtual ForumTopic GetById(long id, IMember owner) {
ForumTopic topic = GetById( id );
if (topic == null) return null;
if (topic.OwnerId != owner.Id) return null;
if (topic.OwnerType.Equals( owner.GetType().FullName ) == false) return null;
if (topic.Status == (int)TopicStatus.Delete) return null;
return topic;
}
示例10: CreateTemp
//--------------------------------------------------------------------------------------------------------------
public virtual Result CreateTemp( ContentAttachmentTemp a, User user, IMember owner ) {
a.OwnerId = owner.Id;
a.OwnerType = owner.GetType().FullName;
a.OwnerUrl = owner.Url;
a.Creator = user;
a.CreatorUrl = user.Url;
a.Guid = Guid.NewGuid().ToString();
return db.insert( a );
}
示例11: CreateApp
private static IApp CreateApp( AppInstaller appInfo, IMember owner, AccessStatus accessStatus )
{
IApp app = Entity.New( appInfo.TypeFullName ) as IApp;
app.OwnerId = owner.Id;
app.OwnerUrl = owner.Url;
app.OwnerType = owner.GetType().FullName;
db.insert( app );
UpdateAccessStatus( app, accessStatus );
return app;
}
示例12: getMemberAppType
private Type getMemberAppType( IMember owner ) {
foreach (KeyValuePair<String, Type> kv in ObjectContext.Instance.TypeList) {
if (rft.IsInterface( kv.Value, typeof( IMemberApp ) )) {
IMemberApp obj = ObjectContext.Create<IMemberApp>( kv.Value );
if (obj.OwnerType == owner.GetType().FullName) return kv.Value;
}
}
return null;
}
示例13: Create
public virtual Result Create( ContentAttachment a, User user, IMember owner )
{
a.OwnerId = owner.Id;
a.OwnerType = owner.GetType().FullName;
a.OwnerUrl = owner.Url;
a.Creator = user;
a.CreatorUrl = user.Url;
a.Guid = Guid.NewGuid().ToString();
Result result = db.insert( a );
refreshAttachmentCount( a );
return result;
}
示例14: Upload
private Result Upload( TempUploadFile tfile, User user, IMember owner )
{
if (owner != null) {
tfile.OwnerId = owner.Id;
tfile.OwnerType = owner.GetType().FullName;
tfile.OwnerUrl = owner.Url;
}
if (user != null) {
tfile.Creator = user;
tfile.CreatorUrl = user.Url;
}
tfile.Guid = Guid.NewGuid().ToString();
return db.insert( tfile );
}
示例15: Create
public virtual Result Create( Attachment a, User user, IMember owner )
{
a.OwnerId = owner.Id;
a.OwnerType = owner.GetType().FullName;
a.OwnerUrl = owner.Url;
a.Creator = user;
a.CreatorUrl = user.Url;
a.Guid = Guid.NewGuid().ToString();
ForumTopicService topicService = new ForumTopicService();
ForumPost post = topicService.GetPostByTopic( a.TopicId );
a.PostId = post.Id;
Result result = db.insert( a );
refreshTopicCount( a );
return result;
}