Esempio n. 1
0
        /// <summary>
        /// 安装程序和菜单
        /// </summary>
        /// <param name="user"></param>
        /// <param name="UserInitApp">从 home,blog,photo,microblog,friend,visitor,forumpost,about,feedback 中选择若干项</param>
        public void InstallAppAndMenu( User user, String UserInitApp )
        {
            if (strUtil.IsNullOrEmpty( UserInitApp )) return;
            List<String> menus = new List<string>();
            String[] arr = UserInitApp.Split( ',' );
            foreach (String app in arr) {
                if (strUtil.IsNullOrEmpty( app )) continue;
                menus.Add( app.Trim() );
            }

            if (menus.Contains( "home" )) {
                UserHomeEasyInstaller installer = new UserHomeEasyInstaller();
                installer.Install( user, wojilu.Common.AppBase.AccessStatus.Public );
            }

            if (menus.Contains( "blog" )) {
                addApp( user, "博客", 2, "wojilu.Apps.Blog.Domain.BlogApp" );
            }

            if (menus.Contains( "photo" )) {
                addApp( user, "相册", 3, "wojilu.Apps.Photo.Domain.PhotoApp" );
            }

            if (menus.Contains( "microblog" )) {
                addMenu( user, "微博", "t/" + user.Url, false );
            }

            if (menus.Contains( "share" )) {
                addMenu( user, "转帖", "Users/Share/Index", false );
            }

            if (menus.Contains( "friend" )) {
                addMenu( user, "好友", "Users/Friend/FriendList", false );
            }

            if (menus.Contains( "visitor" )) {
                addMenu( user, "访客", "Users/Visitor/Index", false );
            }

            if (menus.Contains( "forumpost" )) {
                addMenu( user, "论坛帖子", "Users/Forum/Topic", false );
            }

            if (menus.Contains( "about" )) {
                addMenu( user, "关于我", "Users/Profile/Main", false );
            }

            if (menus.Contains( "feedback" )) {
                addMenu( user, "留言", "Users/Feedback/List", false );
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 安装程序和菜单
        /// </summary>
        /// <param name="user"></param>
        /// <param name="UserInitApp">从 home,blog,photo,microblog,friend,visitor,forumpost,about,feedback 中选择若干项</param>
        public void InstallAppAndMenu(User user, String UserInitApp)
        {
            if (strUtil.IsNullOrEmpty(UserInitApp))
            {
                return;
            }
            List <String> menus = new List <string>();

            String[] arr = UserInitApp.Split(',');
            foreach (String app in arr)
            {
                if (strUtil.IsNullOrEmpty(app))
                {
                    continue;
                }
                menus.Add(app.Trim());
            }

            if (menus.Contains("home"))
            {
                UserHomeEasyInstaller installer = new UserHomeEasyInstaller();
                installer.Install(user, wojilu.Common.AppBase.AccessStatus.Public);
            }

            if (menus.Contains("blog"))
            {
                addApp(user, "博客", 2, "wojilu.Apps.Blog.Domain.BlogApp");
            }

            if (menus.Contains("photo"))
            {
                addApp(user, "相册", 3, "wojilu.Apps.Photo.Domain.PhotoApp");
            }

            if (menus.Contains("microblog"))
            {
                addMenu(user, "微博", "t/" + user.Url, false);
            }

            if (menus.Contains("share"))
            {
                addMenu(user, "转帖", "Users/Share/Index", false);
            }

            if (menus.Contains("friend"))
            {
                addMenu(user, "好友", "Users/Friend/FriendList", false);
            }

            if (menus.Contains("visitor"))
            {
                addMenu(user, "访客", "Users/Visitor/Index", false);
            }

            if (menus.Contains("forumpost"))
            {
                addMenu(user, "论坛帖子", "Users/Forum/Topic", false);
            }

            if (menus.Contains("about"))
            {
                addMenu(user, "关于我", "Users/Profile/Main", false);
            }

            if (menus.Contains("feedback"))
            {
                addMenu(user, "留言", "Users/Feedback/List", false);
            }
        }