private void checkNewItem(Exceptable <T1> items, ExceptionItem <T1> item, string name, List <int> sortOrders, List <Guid> roleIDs, MessageDisplay msgDisplay) { if (item != null) { if (item.SortOrder == -1) { int maxSortOrder = 0; foreach (int sortOrder in sortOrders) { if (sortOrder > maxSortOrder) { maxSortOrder = sortOrder; } } item.SortOrder = maxSortOrder + 1; } else if (sortOrders.Contains(item.SortOrder) && msgDisplay.HasAnyError() == false) { msgDisplay.AddError("new_" + name, "排序数字不能重复"); } if (item.RoleID != Guid.Empty && roleIDs.Contains(item.RoleID)) { msgDisplay.AddError("new_" + name, "已经存在对用户组“" + AllSettings.Current.RoleSettings.GetRole(item.RoleID).Name + "”的例外设置,不能重复设置"); } else { if (item.RoleID != Guid.Empty) { roleIDs.Add(item.RoleID); } } items.Add(item); } }
public BlogSettings() { EnableBlogFunction = true; AllowHtml = new Exceptable<bool>(false); AllowUbb = new Exceptable<bool>(true); FunctionName = "日志"; }
private void checkItem(Exceptable <T1> items, ExceptionItem <T1> item, string name, int id, List <int> sortOrders, List <Guid> roleIDs, MessageDisplay msgDisplay) { if (item != null) { //msgDisplay.HasAnyError == false 是为避免 有两个SortOrder 不为数字出错了(这时都为0) 而这里又提示重复 if (id != 0 && sortOrders.Contains(item.SortOrder) && msgDisplay.HasAnyError() == false) { msgDisplay.AddError(name, id, "排序数字不能重复"); } else { if (id != 0) { sortOrders.Add(item.SortOrder); } //items.Add(item); } if (item.RoleID != Guid.Empty && roleIDs.Contains(item.RoleID)) { msgDisplay.AddError(name, id, "已经存在对用户组“" + AllSettings.Current.RoleSettings.GetRole(item.RoleID).Name + "”的例外设置,不能重复设置"); } else { if (item.RoleID != Guid.Empty) { roleIDs.Add(item.RoleID); } items.Add(item); } } }
public AlbumSettings() { EnableAlbumFunction = true; MaxAlbumCapacity = new Exceptable<long>(1024 * 1024 * 50); MaxPhotoFileSize = new Exceptable<long>(1024 * 300); FunctionName = "相册"; }
public DoingSettings() { EnableDoingFunction = true; EveryDayPostLimit = new Exceptable<int>(100); FunctionName = "记录"; }
public ForumExtendedAttribute() { SigninForumWithoutPassword = new Exceptable <bool>(false); LinkOpenByNewWidow = false; TitleAttach = string.Empty; MetaKeywords = string.Empty; MetaDescription = string.Empty; }
public ForumExtendedAttribute() { SigninForumWithoutPassword = new Exceptable<bool>(false); LinkOpenByNewWidow = false; TitleAttach = string.Empty; MetaKeywords = string.Empty; MetaDescription = string.Empty; }
public EmoticonSettings() { ThumbImageHeight = 24; ThumbImageWidth = 24; EnableUserEmoticons = true; MaxEmoticonCount = new Exceptable<int>(200); //最大表情数限制200个 MaxEmoticonFileSize = new Exceptable<long>(100 * 1024); //最大文件限制100K MaxEmoticonSpace = new Exceptable<long>(5 * 1024 * 1024);//最大空间限制5M Import = new Exceptable<bool>(true); Export = new Exceptable<bool>(true); }
public Exceptable <T1> GetExceptable(string name, MessageDisplay msgDisplay) { int[] tempIds = StringUtil.Split <int>(_Request.Get("id_" + name, Method.Post, string.Empty)); List <int> sortOrdes = new List <int>(); Exceptable <T1> items = new Exceptable <T1>(default(T1)); ExceptionItem <T1> item; List <Guid> roleIDs = new List <Guid>(); foreach (int id in tempIds) { item = GetExceptionItem(name, id, false, msgDisplay); checkItem(items, item, name, id, sortOrdes, roleIDs, msgDisplay); } item = GetExceptionItem(name, 0, true, msgDisplay); checkNewItem(items, item, name, sortOrdes, roleIDs, msgDisplay); return(items); }
public BbsSettings() { RssShowThreadCount = 20; this.PostsPageSize = 10; this.ThreadsPageSize = 20; this.HotThreadRequireReplies = 20; this.AllowQuicklyCreateThread = true; this.AllowQuicklyReply = true; this.DisplaySignature = new Exceptable<bool>(true); this.DisplayAvatar = true; this.NewThreadTime = 3600; this.NewThreadPageCount = 10; this.ShowMarksCount = 5; this.DisplaySubforumsInIndexpage = true; this.EnableGuestNickName = true; //this.SearchPageSize = 20; //this.SearchType = SearchType.LikeStatement; //this.HighlightColor = "#FF0000"; MaxAttachmentCountInDay = new Exceptable<int>(10); MaxTotalAttachmentsSizeInDay = new Exceptable<long>(1024 * 1024 * 20); DisplaySideBar = true; DefaultTextMode = true; MaxPollItemCount = 10; EnableShowLoginDialog = true; StickSortType = StickSortType.StickDate; GloableStickSortType = StickSortType.StickDate; }
public SearchSettings() { this.SearchPageSize = 20; this.SearchType = SearchType.LikeStatement; this.HighlightColor = "#FF0000"; EnableSearch = new Exceptable<bool>(true); CanSearchTopicContent = new Exceptable<bool>(true); CanSearchAllPost = new Exceptable<bool>(true); CanSearchUserTopic = new Exceptable<bool>(true); CanSearchUserPost = new Exceptable<bool>(true); EnableGuestSearch = false; GuestCanSearchTopicContent = false; GuestCanSearchAllPost = false; GuestCanSearchUserPost = false; GuestCanSearchUserTopic = false; MaxResultCount = new Exceptable<int>(500); SearchTime = new Exceptable<int>(15); GuestSearchTime = 30; GuestMaxResultCount = 500; }