- mullivan.sharepoint.zip
- Build
- Features
- AdUserInfoUpdate
- Reminder
- gacutil.exe
- Images
- ReminderSettings.gif
- Layouts
- Mullivan.Extensibility.dll
- Mullivan.Extensibility.dll.config
- Mullivan.Extensibility.pdb
- Mullivan.Shared.dll
- Mullivan.Shared.pdb
- Mullivan.SharePoint.dll
- Mullivan.SharePoint.Pages.dll
- Mullivan.SharePoint.Pages.pdb
- Mullivan.SharePoint.pdb
- Mullivan.SharePoint.Reminders.dll
- Mullivan.SharePoint.Reminders.pdb
- Mullivan.SharePoint.Remote.dll
- Mullivan.SharePoint.Remote.dll.config
- Mullivan.SharePoint.Remote.pdb
- Mullivan.SharePoint.WebParts.dll
- Mullivan.SharePoint.WebParts.pdb
- Update SharePoint.bat
- WebpartFiles
- LibraryNavigationWebPart.webpart
- ListQueryResultsWebPart.webpart
- ListQueryWebPart.webpart
- MostViewedWebPart.webpart
- WeatherWebPart.webpart
- Mullivan.Shared
- Collections
- Generic
- Cryptography
- Logging
- Mullivan.Shared.csproj
- Mullivan.Shared.csproj.user
- Mullivan.snk
- Properties
- Security
- Serialization
- Mullivan.SharePoint.Pages
- Mullivan.SharePoint.Reminders
- Mullivan.SharePoint.Remote
- Mullivan.SharePoint.sln
- Mullivan.SharePoint.WebParts
- Mullivan.SharePoint
|
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Mullivan.Collections.Generic;
using Mullivan.SharePoint.Reminders;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.Utilities;
using System.Collections.Generic;
namespace Mullivan.SharePoint.Pages
{
public partial class _ReminderSettings : Microsoft.SharePoint.WebControls.LayoutsPageBase
{
private List<RmdConfiguration> _rmdConfigs;
private SPWeb _spWeb = null;
private SPList _spList = null;
private SPBaseType _baseType;
private SPListTemplateType _templateType;
private string _strDefaultViewUrl;
// Properties
protected override SPBasePermissions RightsRequired
{
get
{
return (SPBasePermissions.EmptyMask | SPBasePermissions.ManageLists);
}
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
ClientScriptManager csm = this.Page.ClientScript;
Type lnType = typeof(_ReminderSettings);
ibtnEdit.ImageUrl = "~" + ResolveUrl(csm.GetWebResourceUrl(lnType, "Mullivan.SharePoint.Pages.Images.Edit.png"));
ibtnAdd.ImageUrl = "~" + ResolveUrl(csm.GetWebResourceUrl(lnType, "Mullivan.SharePoint.Pages.Images.Add.png"));
ibtnDelete.ImageUrl = "~" + ResolveUrl(csm.GetWebResourceUrl(lnType, "Mullivan.SharePoint.Pages.Images.Remove.png"));
ibtnMoveUp.ImageUrl = "~" + ResolveUrl(csm.GetWebResourceUrl(lnType, "Mullivan.SharePoint.Pages.Images.ArrowUp.png"));
ibtnMoveDown.ImageUrl = "~" + ResolveUrl(csm.GetWebResourceUrl(lnType, "Mullivan.SharePoint.Pages.Images.ArrowDown.png"));
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
ThrowIfNoListQueryString();
_spWeb = SPControl.GetContextWeb(HttpContext.Current);
_spList = _spWeb.Lists.GetList(new Guid(this.Request.QueryString.GetValues("List")[0]), true);
_rmdConfigs = RmdUtil.GetRmdConfigs(_spList);
if (_rmdConfigs == null)
_rmdConfigs = new List<RmdConfiguration>();
_baseType = this._spList.BaseType;
_templateType = this._spList.BaseTemplate;
_strDefaultViewUrl = this._spList.DefaultViewUrl;
if (_templateType == SPListTemplateType.UserInformation)
{
if (!(base.Web.ServerRelativeUrl == "/"))
_strDefaultViewUrl = base.Web.ServerRelativeUrl + "/_layouts/people.aspx";
else
_strDefaultViewUrl = base.Web.ServerRelativeUrl + "_layouts/people.aspx";
}
if (!Page.IsPostBack)
{
LoadRemindersListBox();
}
base.PageTarget = this._spList;
this.onetidListEditTitleLink.NavigateUrl = SPHttpUtility.UrlPathEncode(this._strDefaultViewUrl, true);
this.onetidListEditTitleLink.Text = SPHttpUtility.HtmlEncode(this._spList.Title);
}
private void LoadRemindersListBox()
{
lboxReminders.Items.Clear();
foreach (RmdConfiguration rmdConfig in _rmdConfigs)
{
lboxReminders.Items.Add(new ListItem(rmdConfig.DisplayName, rmdConfig.Id.ToString()));
}
}
protected void ibtnEdit_Click(object sender, ImageClickEventArgs e)
{
Guid guidSelectedRmd = Guid.Empty;
if (string.IsNullOrEmpty(lboxReminders.SelectedValue))
return;
else
guidSelectedRmd = new Guid(lboxReminders.SelectedValue);
string url = string.Format("~{0}/_layouts/EditReminderSettings.aspx?List={1}&Reminder={2}",
base.Web.ServerRelativeUrl, this._spList.ID, guidSelectedRmd);
Response.Redirect(url);
}
protected void ibtnAdd_Click(object sender, ImageClickEventArgs e)
{
string url = string.Format("~{0}/_layouts/EditReminderSettings.aspx?List={1}&Reminder={2}",
base.Web.ServerRelativeUrl, this._spList.ID, Guid.Empty);
Response.Redirect(url);
}
protected void ibtnDelete_Click(object sender, ImageClickEventArgs e)
{
Guid guidSelectedRmd = Guid.Empty;
if (string.IsNullOrEmpty(lboxReminders.SelectedValue))
return;
else
guidSelectedRmd = new Guid(lboxReminders.SelectedValue);
RmdConfiguration rmdConfig = RmdUtil.FindReminder(guidSelectedRmd, _rmdConfigs);
if (rmdConfig != null)
{
_rmdConfigs.Remove(rmdConfig);
RmdUtil.SetRmdConfigs(_spList, _rmdConfigs);
LoadRemindersListBox();
}
}
protected void ibtnMoveUp_Click(object sender, ImageClickEventArgs e)
{
Guid guidSelectedRmd = Guid.Empty;
if (string.IsNullOrEmpty(lboxReminders.SelectedValue))
return;
else
guidSelectedRmd = new Guid(lboxReminders.SelectedValue);
RmdConfiguration rmdConfig = RmdUtil.FindReminder(guidSelectedRmd, _rmdConfigs);
int idx = _rmdConfigs.IndexOf(rmdConfig);
if (rmdConfig != null && idx > 0)
{
_rmdConfigs.Remove(rmdConfig);
_rmdConfigs.Insert(idx - 1, rmdConfig);
RmdUtil.SetRmdConfigs(_spList, _rmdConfigs);
LoadRemindersListBox();
lboxReminders.SelectedValue = guidSelectedRmd.ToString();
}
}
protected void ibtnMoveDown_Click(object sender, ImageClickEventArgs e)
{
Guid guidSelectedRmd = Guid.Empty;
if (string.IsNullOrEmpty(lboxReminders.SelectedValue))
return;
else
guidSelectedRmd = new Guid(lboxReminders.SelectedValue);
RmdConfiguration rmdConfig = RmdUtil.FindReminder(guidSelectedRmd, _rmdConfigs);
int idx = _rmdConfigs.IndexOf(rmdConfig);
if (rmdConfig != null && idx < _rmdConfigs.Count - 1)
{
_rmdConfigs.Remove(rmdConfig);
_rmdConfigs.Insert(idx + 1, rmdConfig);
RmdUtil.SetRmdConfigs(_spList, _rmdConfigs);
LoadRemindersListBox();
lboxReminders.SelectedValue = guidSelectedRmd.ToString();
}
}
public static void ThrowIfNoListQueryString()
{
string[] values = HttpContext.Current.Request.QueryString.GetValues("List");
if ((values == null) || (values.Length == 0))
{
throw new SPException(SPResource.GetString("InvalidQueryString", new object[] { "List" }));
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.