- 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.Generic;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using System.Web;
namespace Mullivan.SharePoint.WebParts
{
public class LibNavLinksEditor : EditorPart
{
private TextBox _tboxViewState;
private Literal _litHtml;
private string _startUpScriptName;
public LibNavLinksEditor(string webPartId)
{
this.ID = webPartId + "_LibNavLinksEditor";
_startUpScriptName = this.ID + "_Init";
}
protected override void OnInit(EventArgs e)
{
_tboxViewState = new TextBox();
_tboxViewState.ID = "lnwpEditorViewState";
_tboxViewState.Style[HtmlTextWriterStyle.Visibility] = "hidden";
_tboxViewState.Style[HtmlTextWriterStyle.Display] = "none";
_litHtml = new Literal();
_litHtml.Text = Properties.Resources.LibraryNavigation;
this.Style[HtmlTextWriterStyle.TextAlign] = "left";
base.OnInit(e);
}
protected override void CreateChildControls()
{
base.CreateChildControls();
this.Controls.Add(_tboxViewState);
this.Controls.Add(_litHtml);
}
protected override void OnLoad(EventArgs e)
{
ClientScriptManager csm = this.Page.ClientScript;
Type lnType = this.GetType();
string strEditUrl = csm.GetWebResourceUrl(lnType, "Mullivan.SharePoint.WebParts.Images.Edit.png");
string strAddUrl = csm.GetWebResourceUrl(lnType, "Mullivan.SharePoint.WebParts.Images.Add.png");
string strRemoveUrl = csm.GetWebResourceUrl(lnType, "Mullivan.SharePoint.WebParts.Images.Remove.png");
string strArrowUpUrl = csm.GetWebResourceUrl(lnType, "Mullivan.SharePoint.WebParts.Images.ArrowUp.png");
string strArrowDownUrl = csm.GetWebResourceUrl(lnType, "Mullivan.SharePoint.WebParts.Images.ArrowDown.png");
EnsureChildControls();
_litHtml.Text = string.Format(_litHtml.Text,
this.ClientID,
_tboxViewState.ClientID,
strAddUrl,
strRemoveUrl,
strArrowUpUrl,
strArrowDownUrl,
strEditUrl,
SPContext.Current.Web.ServerRelativeUrl.Replace("/", "\\u002f"));
base.OnLoad(e);
}
protected override void OnPreRender(EventArgs e)
{
ClientScriptManager csm = this.Page.ClientScript;
Type lnType = this.GetType();
//Register our Javascript file
if (!csm.IsClientScriptIncludeRegistered(@"Mullivan.SharePoint.WebParts.JS.Utility.js"))
{
string url = csm.GetWebResourceUrl(lnType, @"Mullivan.SharePoint.WebParts.JS.Utility.js");
csm.RegisterClientScriptInclude(lnType, "Mullivan.SharePoint.WebParts.JS.Utility.js", ResolveClientUrl(url));
}
if (!csm.IsClientScriptIncludeRegistered(@"PickerTreeDialog"))
{
string url = @"/_layouts/1033/PickerTreeDialog.js";
csm.RegisterClientScriptInclude(lnType, "PickerTreeDialog", url);
}
if (!csm.IsClientScriptIncludeRegistered(@"QueryBuilderDialog"))
{
string url = @"/_layouts/1033/QueryBuilder.js";
csm.RegisterClientScriptInclude(lnType, "QueryBuilderDialog", url);
}
if (!csm.IsStartupScriptRegistered(_startUpScriptName))
{
csm.RegisterStartupScript(lnType, _startUpScriptName, GenerateStartScript());
}
base.OnPreRender(e);
}
private string GenerateStartScript()
{
return string.Format(@"
<script type=""text/javascript"">
LPNW_InitConfiguration('{0}', '{1}');
</script>"
,_tboxViewState.ClientID, this.ClientID);
}
public override bool ApplyChanges()
{
EnsureChildControls();
LibraryNavigationWebPart lnwp = this.WebPartToEdit as LibraryNavigationWebPart;
if (lnwp != null)
lnwp.LinksConfiguration = this._tboxViewState.Text;
return true;
}
public override void SyncChanges()
{
EnsureChildControls();
LibraryNavigationWebPart lnwp = this.WebPartToEdit as LibraryNavigationWebPart;
if (lnwp == null)
this._tboxViewState.Text = "<Links></Links>";
else
this._tboxViewState.Text = lnwp.LinksConfiguration;
}
}
}
|
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.