示例#1
0
        public void AppList(
            GlobalTemplateMembers.CannotDoTemplate cannotDo
            , GlobalTemplateMembers.NodataTemplate nodata
            , AppListHeadFootTemplate head
            , AppListHeadFootTemplate foot
            , AppListItemTemplate item)
        {
            AppBaseCollection apps = AppManager.GetAllApps();

            int i = 0;

            head();

            foreach (AppBase app in apps)
            {
                item(i++, app);
            }

            if (apps.Count == 0)
            {
                nodata();
            }

            foot();
        }
示例#2
0
        public void FeedTemplateList(string appID
                                     , GlobalTemplateMembers.CannotDoTemplate canNotDo
                                     , FeedTemplateHeadFootItemTemplate head
                                     , FeedTemplateHeadFootItemTemplate foot
                                     , FeedTemplateListItemTemplate item)
        {
            Guid currentAppID;

            try
            {
                currentAppID = new Guid(appID);
            }
            catch
            {
                currentAppID = new BasicApp().AppID;
                //throw new Exception("非法的AppID");
            }


            FeedTemplateCollection feedTemplates;

            using (ErrorScope errorScope = new ErrorScope())
            {
                feedTemplates = FeedBO.Instance.GetFeedTemplates(currentAppID);
                errorScope.CatchError <ErrorInfo>(delegate(ErrorInfo error)
                {
                    canNotDo(error.Message);
                    return;
                });
            }

            int totalCount = feedTemplates.Count;

            AppBase currentApp = AppManager.GetApp(currentAppID);

            head(totalCount > 0, totalCount, currentApp);

            int i = 0;

            foreach (FeedTemplate feedTemplate in feedTemplates)
            {
                item(i++, feedTemplate, currentApp);
            }

            foot(totalCount > 0, totalCount, currentApp);
        }
示例#3
0
        public void AppActionList(
            AppBase app
            , GlobalTemplateMembers.CannotDoTemplate cannotDo
            , GlobalTemplateMembers.NodataTemplate nodata
            , AppActionListHeadFootTemplate head
            , AppActionListHeadFootTemplate foot
            , AppActionListItemTemplate item)
        {
            AppActionCollection appActions = app.AppActions;

            head();

            int j = 0;

            foreach (AppAction appAction in appActions)
            {
                if (FeedBO.Instance.IsSiteFeed(app.AppID, appAction.ActionType))
                {
                    continue;
                }

                bool display = true;
                foreach (FeedSendItem tempItem in AllSettings.Current.PrivacySettings.FeedSendItems)
                {
                    if ((tempItem.DefaultSendType == FeedSendItem.SendType.ForceSend || tempItem.DefaultSendType == FeedSendItem.SendType.ForceNotSend) &&
                        tempItem.AppID == app.AppID && tempItem.ActionType == appAction.ActionType)
                    {
                        display = false;
                    }
                }

                if (display)
                {
                    item(j++, appAction);
                }
            }

            if (appActions.Count == 0)
            {
                nodata();
            }

            foot();
        }