本文整理汇总了C#中System.Web.UI.WebControls.WebParts.WebPartManager类的典型用法代码示例。如果您正苦于以下问题:C# WebPartManager类的具体用法?C# WebPartManager怎么用?C# WebPartManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WebPartManager类属于System.Web.UI.WebControls.WebParts命名空间,在下文中一共展示了WebPartManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: WebPartChrome
public WebPartChrome(WebPartZoneBase zone, WebPartManager manager) {
if (zone == null) {
throw new ArgumentNullException("zone");
}
_zone = zone;
_page = zone.Page;
_designMode = zone.DesignMode;
_manager = manager;
if (_designMode) {
// Consider personalization to be enabled at design-time
_personalizationEnabled = true;
}
else {
_personalizationEnabled = (manager != null && manager.Personalization.IsModifiable);
}
if (manager != null) {
_personalizationScope = manager.Personalization.Scope;
}
else {
// Consider scope to be shared at design-time
_personalizationScope = PersonalizationScope.Shared;
}
}
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:25,代码来源:WebPartChrome.cs
示例2: IsEnabled
public virtual new bool IsEnabled (WebPartManager webPartManager)
{
Contract.Requires (webPartManager != null);
Contract.Requires (webPartManager.Personalization != null);
return default(bool);
}
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:7,代码来源:System.Web.UI.WebControls.WebParts.WebPartDisplayMode.cs
示例3: PersonalizationState
/// <devdoc>
/// </devdoc>
protected PersonalizationState(WebPartManager webPartManager) {
if (webPartManager == null) {
throw new ArgumentNullException("webPartManager");
}
_webPartManager = webPartManager;
}
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:9,代码来源:PersonalizationState.cs
示例4: LoadPersonalizationBlobs
protected override void LoadPersonalizationBlobs(WebPartManager webPartManager, string path, string userName,
ref byte[] sharedDataBlob, ref byte[] userDataBlob)
{
PageBase page = webPartManager.Page as PageBase;
if (page != null && page.CurrentUserSession != null)
{
userName = page.CurrentUserSession.Username;
User user = User.Load(userName);
PersonalizationInfo info = user.PersonalizationInfo;
if (info != null)
{
string key = String.Format("{0}_{1}_{2}", webPartManager.ID, path, userName);
byte[] data = null;
try
{
if (info.userPersonalizationData.ContainsKey(key))
data = info.userPersonalizationData[key];
}
catch (KeyNotFoundException)
{
//info is somehow corrupted
//user.ResetPersonalization();
}
if (data != null)
{
userDataBlob = data;
}
}
}
}
开发者ID:haimon74,项目名称:Easy-Fixup,代码行数:33,代码来源:Personalization.cs
示例5: IsEnabled
public virtual bool IsEnabled(WebPartManager webPartManager)
{
if (this.RequiresPersonalization)
{
return webPartManager.Personalization.IsModifiable;
}
return true;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:WebPartDisplayMode.cs
示例6: WebPartPersonalization
/// <devdoc>
/// </devdoc>
public WebPartPersonalization(WebPartManager owner) {
if (owner == null) {
throw new ArgumentNullException("owner");
}
_owner = owner;
_enabled = true;
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:11,代码来源:WebPartPersonalization.cs
示例7: OnInit
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
_wpm = WebPartManager.GetCurrentWebPartManager(this.Page);
if (this.Page is BasePage)
((BasePage)this.Page).ToolboxPanel = pnlToolboxMain;
ltlInfo.Text = String.Format("MonoX v{0} [{1}], DB v{2}", MonoSoftware.MonoX.Utilities.MonoXUtility.AssemblyVersion, MonoSoftware.MonoX.Utilities.MonoXUtility.AssemblyDate.ToString(CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern), MonoSoftware.MonoX.Utilities.MonoXUtility.DBVersion);
SetRefreshCacheUrl();
CheckCacheRefresh();
}
开发者ID:MonoSoftware,项目名称:MonoX-Demo-Pages,代码行数:10,代码来源:MonoX.master.cs
示例8: BuildCommand
private SqlCommand BuildCommand(IConfigurationElement commandElement, IBinder binder, WebPartManager manager)
{
SqlCommand command = new SqlCommand();
foreach (IConfigurationElementAttribute attribute in commandElement.Attributes.Values)
{
ReflectionServices.SetValue(command, attribute.ConfigKey, attribute.Value);
}
IBindingItemsCollection bindingParams = binder.NewBindingItemCollectionInstance();
binder.BindingSet.Add(commandElement.ConfigKey, bindingParams);
foreach (IConfigurationElement parameterElement in commandElement.Elements.Values)
{
SqlParameter parameter = new SqlParameter();
foreach (IConfigurationElementAttribute parameterAttribute in parameterElement.Attributes.Values)
{
if ("bind" == parameterAttribute.ConfigKey)
{
string bindstring = parameterAttribute.Value.ToString();
bool isOutput = parameterElement.Attributes.ContainsKey("Direction") &&
("Output" == parameterElement.GetAttributeReference("Direction").Value.ToString() ||
"InputOutput" == parameterElement.GetAttributeReference("Direction").Value.ToString());
if (bindstring.Contains("."))
{
string sourcestring = bindstring.Substring(0, bindstring.IndexOf("."));
IBindingItem bindingItem = binder.NewBindingItemInstance();
if (!isOutput)
{
bindingItem.Source = manager.FindControl(sourcestring);
bindingItem.SourceProperty = bindstring.Substring(sourcestring.Length + 1);
bindingItem.Target = parameter;
bindingItem.TargetProperty = "Value";
}
else
{
bindingItem.Target = manager.FindControl(sourcestring);
bindingItem.TargetProperty = bindstring.Substring(sourcestring.Length + 1);
bindingItem.Source = parameter;
bindingItem.SourceProperty = "Value";
}
bindingParams.Add(bindingItem);
}
}
else
{
ReflectionServices.SetValue(parameter, parameterAttribute.ConfigKey, parameterAttribute.Value);
}
}
if (null == parameter.Value)
{
parameter.Value = DBNull.Value;
}
command.Parameters.Add(parameter);
}
return command;
}
开发者ID:t1b1c,项目名称:lwas,代码行数:54,代码来源:SqlDataBridgeConfigurationParser.cs
示例9: BlobPersonalizationState
/// <devdoc>
/// </devdoc>
public BlobPersonalizationState(WebPartManager webPartManager) : base(webPartManager) {
//
// Note that we don't use the IsPostBack property of Page because that
// is based on the presence of view state, which could be on the query string
// in a non-POST request as well. Instead we use the actual verb associated
// with the request.
// Note that there are other types of HttpVerb besides GET and POST. We only
// save personalization data for POST requests. (VSWhidbey 423433)
_isPostRequest = (webPartManager.Page.Request.HttpVerb == HttpVerb.POST);
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:14,代码来源:BlobPersonalizationState.cs
示例10: LoadPersonalizationBlobs
/// <summary>
/// Loads the personalization data bytes.
/// </summary>
/// <param name="webPartManager"></param>
/// <param name="path"></param>
/// <param name="userName"></param>
/// <param name="sharedDataBlob"></param>
/// <param name="userDataBlob"></param>
protected override void LoadPersonalizationBlobs(WebPartManager webPartManager, string path, string userName, ref byte[] sharedDataBlob, ref byte[] userDataBlob)
{
userName = Workflow.CurrentUser.UserBase.LoginName;
OUserWebPartsPersonalization p = OUserWebPartsPersonalization.GetPersonalization("", path, userName);
if (p != null)
{
if (String.IsNullOrEmpty(userName))
sharedDataBlob = p.Bytes;
else
userDataBlob = p.Bytes;
}
}
开发者ID:vinhdoan,项目名称:Angroup.demo,代码行数:21,代码来源:WebPartPersonalizationProvider.cs
示例11: Create
public override void Create(Control container, IConfigurationType config, ITemplatable templatable, IEnumerable registry, IBinder binder, WebPartManager manager)
{
if (null == container)
{
throw new ArgumentNullException("container");
}
if (null == config)
{
throw new ArgumentNullException("config");
}
if (!(config is IConfigurationSection))
{
throw new ArgumentException("config must be an IConfigurationSection");
}
if (!(registry is ITemplatingItemsCollection))
{
throw new ArgumentException("registry must be an ITemplatingItemsCollection");
}
ITemplatingItemsCollection filters = registry as ITemplatingItemsCollection;
IDictionary<string, IConfigurationElement> itemElements = (config as IConfigurationSection).Elements;
if (itemElements.ContainsKey("filter"))
{
Table table;
if (container is Table)
{
table = (container as Table);
}
else
{
table = new Table();
table.ID = container.ID + "filter";
}
table.ApplyStyle(templatable.FilterStyle);
for (int i = 0; i < filters.Count; i++)
{
foreach (IConfigurationElement element in itemElements["filter"].Elements.Values)
{
string prefix = "filter" + element.ConfigKey + i.ToString();
this.DisplayItem(table, element, prefix, binder, filters[i], templatable.FilterRowStyle, templatable.InvalidItemStyle, manager);
}
}
if (!(container is Table))
{
container.Controls.Add(table);
}
}
}
开发者ID:t1b1c,项目名称:lwas,代码行数:47,代码来源:FiltersTemplate.cs
示例12: Create
public override void Create(Control container, IConfigurationType config, ITemplatable templatable, IEnumerable registry, WebPartManager manager)
{
if (null == container)
{
throw new ArgumentNullException("container");
}
if (null == config)
{
throw new ArgumentNullException("config");
}
if (!(config is IConfigurationSection))
{
throw new ArgumentException("config must be an IConfigurationSection");
}
if (!(registry is Dictionary<string, Control>))
{
throw new ArgumentException("registry must be a Dictionary<string,Control>");
}
Dictionary<string, Control> commanders = registry as Dictionary<string, Control>;
commanders.Clear();
IDictionary<string, IConfigurationElement> itemElements = (config as IConfigurationSection).Elements;
if (itemElements.ContainsKey("commanders"))
{
Table table;
if (container is Table)
{
table = (container as Table);
}
else
{
table = new Table();
}
if (string.IsNullOrEmpty(table.ID))
{
table.ID = container.ID + "commanders";
}
table.ApplyStyle(templatable.CommandersStyle);
foreach (IConfigurationElement element in itemElements["commanders"].Elements.Values)
{
this.DisplayItem(table, element, element.ConfigKey, null, null, templatable.CommandersRowStyle, templatable.InvalidItemStyle, commanders, manager);
}
if (!(container is Table))
{
container.Controls.Add(table);
}
}
}
开发者ID:t1b1c,项目名称:lwas,代码行数:47,代码来源:CommandersTemplate.cs
示例13: SavePersonalizationBlob
/// <summary>
/// Saves the personalization data into the database.
/// </summary>
/// <param name="webPartManager"></param>
/// <param name="path"></param>
/// <param name="userName"></param>
/// <param name="dataBlob"></param>
protected override void SavePersonalizationBlob(WebPartManager webPartManager, string path, string userName, byte[] dataBlob)
{
using (Connection c = new Connection())
{
userName = Workflow.CurrentUser.UserBase.LoginName;
OUserWebPartsPersonalization p = OUserWebPartsPersonalization.GetPersonalization("", path, userName);
if (p == null)
p = TablesLogic.tUserWebPartsPersonalization.Create();
p.ApplicationName = "";
p.Path = path;
p.UserName = userName;
p.Bytes = dataBlob;
p.Save();
c.Commit();
}
}
开发者ID:vinhdoan,项目名称:Angroup.demo,代码行数:24,代码来源:WebPartPersonalizationProvider.cs
示例14: LoadPersonalizationBlobs
public static void LoadPersonalizationBlobs(
SiteSettings siteSettings,
WebPartManager webPartManager,
string path,
string userName,
ref byte[] sharedDataBlob,
ref byte[] userDataBlob)
{
if (siteSettings != null)
{
if ((userName != null) && (userName.Length > 0))
{
SiteUser siteUser = new SiteUser(siteSettings, userName);
Guid userID = Guid.Empty;
if (siteUser.UserId > 0)
{
userID = siteUser.UserGuid;
}
if (userID != Guid.Empty)
{
userDataBlob = SitePersonalization.GetPersonalizationBlob(
siteSettings.SiteId,
path,
userID);
siteUser.UpdateLastActivityTime();
sharedDataBlob = SitePersonalization.GetPersonalizationBlobAllUsers(
siteSettings.SiteId,
path);
}
}
else
{
//TODO: tracking/personalization for unauthenticated users?
sharedDataBlob = SitePersonalization.GetPersonalizationBlobAllUsers(
siteSettings.SiteId,
path);
}
}
}
开发者ID:joedavis01,项目名称:mojoportal,代码行数:46,代码来源:PersonalizationHelper.cs
示例15: DetermineUserCapabilities
public override IDictionary DetermineUserCapabilities(WebPartManager webPartManager)
{
//return base.DetermineUserCapabilities(webPartManager);
ICollection supportedUserCapabilities = CreateSupportedUserCapabilities();
if ((supportedUserCapabilities != null) && (supportedUserCapabilities.Count != 0))
{
IDictionary capabilities = new HybridDictionary();
foreach (WebPartUserCapability capability in supportedUserCapabilities)
{
capabilities[capability] = capability;
}
return capabilities;
}
else return new HybridDictionary();
}
开发者ID:haimon74,项目名称:Easy-Fixup,代码行数:17,代码来源:Personalization.cs
示例16: GetPersonalizationBlobs
private DataTable GetPersonalizationBlobs(WebPartManager webPartManager, string username)
{
//
// Verifies if still has a DataTable loaded
//
DataTable personalizationBlobs = null;
if (HttpContext.Current.Items[cookiesName] != null)
return HttpContext.Current.Items[cookiesName] as DataTable;
switch (GetScope(webPartManager, username))
{
case PersonalizationScope.User:
HttpCookie cookie = webPartManager.Page.Request.Cookies[cookiesName];
if (cookie != null)
{
personalizationBlobs = cookie.Value.Deserialize() as DataTable;
}
break;
case PersonalizationScope.Shared:
personalizationBlobs = webPartManager.Page.Cache[cookiesName] as DataTable;
if (personalizationBlobs == null)
{
if (File.Exists(xmlFile))
{
DataSet ds = new DataSet();
ds.ReadXml(xmlFile);
personalizationBlobs = ds.Tables[cookiesName];
ds.Tables.Remove(personalizationBlobs); ;
}
}
break;
}
if (personalizationBlobs == null)
personalizationBlobs = CreatePersonalizationBlobs();
HttpContext.Current.Items[cookiesName] = personalizationBlobs;
return personalizationBlobs;
}
开发者ID:sidneylimafilho,项目名称:InfoControl,代码行数:40,代码来源:CookiesPersonalizationProvider.cs
示例17: Create
public override void Create(Control container, IConfigurationType config, ITemplatable templatable, WebPartManager manager)
{
if (null == container)
{
throw new ArgumentNullException("container");
}
if (null == config)
{
throw new ArgumentNullException("config");
}
if (!(config is IConfigurationSection))
{
throw new ArgumentException("config must be an IConfigurationSection");
}
IDictionary<string, IConfigurationElement> itemElements = (config as IConfigurationSection).Elements;
if (itemElements.ContainsKey("header"))
{
Table table;
if (container is Table)
{
table = (container as Table);
}
else
{
table = new Table();
table.ID = container.ID + "header";
}
table.ApplyStyle(templatable.HeaderStyle);
foreach (IConfigurationElement element in itemElements["header"].Elements.Values)
{
this.DisplayItem(table, element, "header-" + element.ConfigKey, null, null, templatable.HeaderRowStyle, templatable.InvalidItemStyle, manager);
}
if (!(container is Table))
{
container.Controls.Add(table);
}
}
}
开发者ID:t1b1c,项目名称:lwas,代码行数:38,代码来源:HeaderTemplate.cs
示例18: Create
public override void Create(Control container, IConfigurationType config, ITemplatable templatable, IBinder binder, ITemplatingItem item, int itemIndex, WebPartManager manager)
{
if (null == container)
{
throw new ArgumentNullException("container");
}
if (null == config)
{
throw new ArgumentNullException("config");
}
if (!(config is IConfigurationSection))
{
throw new ArgumentException("config must be an IConfigurationSection");
}
if ((config as IConfigurationSection).Elements.ContainsKey("totals"))
{
Table table;
if (container is Table)
{
table = (container as Table);
}
else
{
table = new Table();
table.ApplyStyle(templatable.TotalsStyle);
}
IConfigurationElement element = (config as IConfigurationSection).GetElementReference("totals");
foreach (IConfigurationElement rowElement in element.Elements.Values)
{
this.DisplayItem(table, rowElement, "totals" + itemIndex.ToString(), binder, item, templatable.TotalsRowStyle, templatable.InvalidItemStyle, manager);
}
if (!(container is Table))
{
container.Controls.Add(table);
}
}
}
开发者ID:t1b1c,项目名称:lwas,代码行数:37,代码来源:TotalsTemplate.cs
示例19: WebPartManagerControlCollection
public WebPartManagerControlCollection(WebPartManager owner) : base(owner)
{
this._manager = owner;
base.SetCollectionReadOnly("WebPartManager_CannotModify");
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:5,代码来源:WebPartManager.cs
示例20: DetermineUserCapabilities
public override IDictionary DetermineUserCapabilities(
WebPartManager webPartManager)
{
return base.DetermineUserCapabilities(webPartManager);
}
开发者ID:joedavis01,项目名称:mojoportal,代码行数:5,代码来源:mojoPersonalizationProvider.cs
注:本文中的System.Web.UI.WebControls.WebParts.WebPartManager类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论