public void FiltratedAppList( AppListHeadFootTemplate head , AppListHeadFootTemplate foot , AppListItemTemplate item) { List <Guid> appIDs = new List <Guid>(); foreach (FeedFilter feedFilter in UserFeedFilters) { if (feedFilter.AppID != Guid.Empty && feedFilter.FriendUserID == null && !appIDs.Contains(feedFilter.AppID)) { appIDs.Add(feedFilter.AppID); } } AppBaseCollection apps = AppManager.GetApps(appIDs); int i = 0; head(); foreach (AppBase app in apps) { item(i++, app); } foot(); }
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(); }
public static AppBaseCollection GetApps(IEnumerable<Guid> appIDs) { AppBaseCollection tempApps = new AppBaseCollection(); foreach (Guid appID in appIDs) { AppBase app = GetApp(appID); if (app != null) tempApps.Add(app); } return tempApps; }
public void AppList(AppsTemplate template) { AppBaseCollection apps = AppManager.GetAllApps(); int i = 0; foreach (AppBase app in apps) { template(i++, app); } }
public static AppBaseCollection GetApps(IEnumerable <Guid> appIDs) { AppBaseCollection tempApps = new AppBaseCollection(); foreach (Guid appID in appIDs) { AppBase app = GetApp(appID); if (app != null) { tempApps.Add(app); } } return(tempApps); }
private bool SaveFeedPrivacy() { MessageDisplay msgDisplay = CreateMessageDisplay("feedprivacy"); int userID = MyUserID; AppBaseCollection apps = AppManager.GetAllApps(); //所有动作都加入动态的应用 //string appIDString = _Request.Get("apps", Method.Post); //string[] appIDs; //if (!string.IsNullOrEmpty(appIDString)) //{ // appIDs = appIDString.Split(','); //} //else // appIDs = new string[] { }; UserNoAddFeedAppCollection userNoAddFeedApps = new UserNoAddFeedAppCollection(); foreach (AppBase app in apps) { //bool isAddAllAction = false; //foreach (string appID in appIDs) //{ // if (app.AppID.ToString() == appID)//该应用的所有动作都加入动态 // { // isAddAllAction = true; // break; // } //} //if (!isAddAllAction) //{ //加入动态的动作 string actionIDString = _Request.Get("app_" + app.AppID.ToString() + "_Actions", Method.Post); string[] actionIDs; if (!string.IsNullOrEmpty(actionIDString)) { actionIDs = actionIDString.Split(','); } else { actionIDs = new string[] { } }; foreach (AppAction appAction in app.AppActions) { bool isAddFeed = false; foreach (string actionType in actionIDs) { if (appAction.ActionType.ToString() == actionType) { isAddFeed = true; break; } } UserNoAddFeedApp userNoAddFeedApp = new UserNoAddFeedApp(); userNoAddFeedApp.AppID = app.AppID; userNoAddFeedApp.ActionType = appAction.ActionType; userNoAddFeedApp.UserID = MyUserID; userNoAddFeedApp.Send = isAddFeed; userNoAddFeedApps.Add(userNoAddFeedApp); } //} } try { FeedBO.Instance.SetUserNoAddFeedApps(userID, userNoAddFeedApps); //msgDisplay.ShowInfo(this); //ShowSuccess(); } catch (Exception ex) { msgDisplay.AddException(ex); return(false); } return(true); }