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


C# IMember.GetType方法代码示例

本文整理汇总了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;
        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:35,代码来源:AppInstallerService.cs

示例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;
        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:25,代码来源:CorePageCache.cs

示例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();
 }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:7,代码来源:ForumLinkService.cs

示例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;
 }
开发者ID:naroate,项目名称:wojilu,代码行数:8,代码来源:PageService.cs

示例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;
        }
开发者ID:LeoLcy,项目名称:cnblogsbywojilu,代码行数:9,代码来源:AppInit.cs

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

示例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 );
        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:9,代码来源:AppAdminRole.cs

示例8: isCustomHome

        private Boolean isCustomHome( IMember owner )
        {
            Boolean homepageCustom = false;

            if (owner.GetType() == typeof( User )) {
                return homepageCustom;
            }

            return true;
        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:10,代码来源:OwnerInit.cs

示例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;
        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:10,代码来源:ForumTopicService.cs

示例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 );
        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:15,代码来源:AttachmentService.cs

示例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;
        }
开发者ID:LeoLcy,项目名称:cnblogsbywojilu,代码行数:12,代码来源:AppFactory.cs

示例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;
        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:15,代码来源:AppInstallerService.cs

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

示例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 );
        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:17,代码来源:TempUploadFileService.cs

示例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;
        }
开发者ID:LeoLcy,项目名称:cnblogsbywojilu,代码行数:20,代码来源:AttachmentService.cs


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