本文整理汇总了C#中System.Web.SiteMapNode.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# SiteMapNode.ToString方法的具体用法?C# SiteMapNode.ToString怎么用?C# SiteMapNode.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.SiteMapNode
的用法示例。
在下文中一共展示了SiteMapNode.ToString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddNode
protected internal override void AddNode(SiteMapNode node, SiteMapNode parentNode)
{
if (node == null)
{
throw new ArgumentNullException("node");
}
if (parentNode == null)
{
throw new ArgumentNullException("parentNode");
}
SiteMapProvider provider = node.Provider;
SiteMapProvider provider2 = parentNode.Provider;
if (provider != this)
{
throw new ArgumentException(System.Web.SR.GetString("XmlSiteMapProvider_cannot_add_node", new object[] { node.ToString() }), "node");
}
if (provider2 != this)
{
throw new ArgumentException(System.Web.SR.GetString("XmlSiteMapProvider_cannot_add_node", new object[] { parentNode.ToString() }), "parentNode");
}
lock (base._lock)
{
this.RemoveNode(node);
this.AddNodeInternal(node, parentNode, null);
}
}
示例2: RemoveNode
/// <summary>
/// Removes the specified <see cref="T:System.Web.SiteMapNode"/> object from all site map node collections that are tracked by the site map provider.
/// </summary>
/// <param name="node">The site map node to remove from the site map node collections.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="node"/> is null.
/// </exception>
protected override void RemoveNode(SiteMapNode node)
{
if (node == null)
throw new ArgumentNullException("node");
var provider = node.Provider;
if (provider != this)
for (var parentProvider = provider.ParentProvider; parentProvider != this; parentProvider = parentProvider.ParentProvider)
if (parentProvider == null)
throw new InvalidOperationException(string.Format("StaticSiteMapProviderEx_cannot_remove_node", node.ToString(), Name, provider.Name));
if (node.Equals(provider.RootNode))
throw new InvalidOperationException("StaticSiteMapProviderEx_cannot_remove_root_node");
if (provider != this)
_providerRemoveNode.Invoke(provider, new[] { node });
base.RemoveNode(node);
}
示例3: AddProvider
/// <summary>
/// Adds the provider.
/// </summary>
/// <param name="providerName">Name of the provider.</param>
/// <param name="parentNode">The parent node.</param>
/// <param name="rebaseAction">The rebase action.</param>
public void AddProvider(string providerName, SiteMapNode parentNode, Action<SiteMapNode> rebaseAction)
{
if (parentNode == null)
throw new ArgumentNullException("parentNode");
if (parentNode.Provider != this)
throw new ArgumentException(string.Format("StaticSiteMapProviderEx_cannot_add_node", parentNode.ToString()), "parentNode");
var rootNode = GetNodeFromProvider(providerName, rebaseAction);
AddNode(rootNode, parentNode);
}
示例4: RemoveNode
protected internal override void RemoveNode(SiteMapNode node) {
if (node == null) {
throw new ArgumentNullException("node");
}
SiteMapProvider ownerProvider = node.Provider;
if (ownerProvider != this) {
// Only nodes defined in this provider tree can be removed.
SiteMapProvider parentProvider = ownerProvider.ParentProvider;
while (parentProvider != this) {
if (parentProvider == null) {
// Cannot remove nodes defined in other providers
throw new InvalidOperationException(
SR.GetString(SR.XmlSiteMapProvider_cannot_remove_node, node.ToString(),
this.Name, ownerProvider.Name));
}
parentProvider = parentProvider.ParentProvider;
}
}
if (node.Equals(ownerProvider.GetRootNodeCore())) {
throw new InvalidOperationException(SR.GetString(SR.SiteMapProvider_cannot_remove_root_node));
}
if (ownerProvider != this) {
// Remove node from the owner provider.
ownerProvider.RemoveNode(node);
}
base.RemoveNode(node);
}
示例5: AddProvider
protected virtual void AddProvider(string providerName, SiteMapNode parentNode) {
if (parentNode == null) {
throw new ArgumentNullException("parentNode");
}
if (parentNode.Provider != this) {
throw new ArgumentException(SR.GetString(SR.XmlSiteMapProvider_cannot_add_node, parentNode.ToString()), "parentNode");
}
SiteMapNode node = GetNodeFromProvider(providerName);
AddNodeInternal(node, parentNode, null);
}
示例6: AddNode
protected internal override void AddNode(SiteMapNode node, SiteMapNode parentNode) {
if (node == null) {
throw new ArgumentNullException("node");
}
if (parentNode == null) {
throw new ArgumentNullException("parentNode");
}
SiteMapProvider ownerProvider = node.Provider;
SiteMapProvider parentOwnerProvider = parentNode.Provider;
if (ownerProvider != this) {
throw new ArgumentException(SR.GetString(SR.XmlSiteMapProvider_cannot_add_node, node.ToString()), "node");
}
if (parentOwnerProvider != this) {
throw new ArgumentException(SR.GetString(SR.XmlSiteMapProvider_cannot_add_node, parentNode.ToString()), "parentNode");
}
lock (_lock) {
// First remove it from its current location.
RemoveNode(node);
AddNodeInternal(node, parentNode, null);
}
}
示例7: RemoveNode
protected internal override void RemoveNode(SiteMapNode node)
{
if (node == null)
{
throw new ArgumentNullException("node");
}
SiteMapProvider provider = node.Provider;
if (provider != this)
{
for (SiteMapProvider provider2 = provider.ParentProvider; provider2 != this; provider2 = provider2.ParentProvider)
{
if (provider2 == null)
{
throw new InvalidOperationException(System.Web.SR.GetString("XmlSiteMapProvider_cannot_remove_node", new object[] { node.ToString(), this.Name, provider.Name }));
}
}
}
if (node.Equals(provider.GetRootNodeCore()))
{
throw new InvalidOperationException(System.Web.SR.GetString("SiteMapProvider_cannot_remove_root_node"));
}
if (provider != this)
{
provider.RemoveNode(node);
}
base.RemoveNode(node);
}
示例8: AddProvider
protected virtual void AddProvider(string providerName, SiteMapNode parentNode)
{
if (parentNode == null)
{
throw new ArgumentNullException("parentNode");
}
if (parentNode.Provider != this)
{
throw new ArgumentException(System.Web.SR.GetString("XmlSiteMapProvider_cannot_add_node", new object[] { parentNode.ToString() }), "parentNode");
}
SiteMapNode nodeFromProvider = this.GetNodeFromProvider(providerName);
this.AddNodeInternal(nodeFromProvider, parentNode, null);
}