本文整理汇总了C#中Path.Append方法的典型用法代码示例。如果您正苦于以下问题:C# Path.Append方法的具体用法?C# Path.Append怎么用?C# Path.Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Path
的用法示例。
在下文中一共展示了Path.Append方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSeparatorPath
internal Path GetSeparatorPath()
{
Stack<PathSegment> stack = new Stack<PathSegment>();
stack.Push(new PathSegment(Guid.NewGuid().ToString()));
AbstractActionModelTreeNode current = this.Parent;
while (current != null)
{
stack.Push(current.PathSegment);
current = current.Parent;
}
Path path = new Path(stack.Pop());
while (stack.Count > 0)
{
path = path.Append(stack.Pop());
}
return path;
}
示例2: BuildAction
internal IAction BuildAction()
{
IAction action = AbstractAction.Create(_action);
Stack<PathSegment> stack = new Stack<PathSegment>();
AbstractActionModelTreeNode current = this;
do
{
stack.Push(current.PathSegment);
current = current.Parent;
} while (current != null);
Path path = new Path(stack.Pop()); // the first path segment is the site, which is never processed through the resource resolver
while (stack.Count > 0)
{
// for each subsequent segment, ensure the action's resolver will resolve the string in the expected way
PathSegment pathSegment = stack.Pop();
string localizedString = action.ResourceResolver.LocalizeString(pathSegment.ResourceKey);
if (localizedString == pathSegment.LocalizedText)
path = path.Append(pathSegment);
else
path = path.Append(new PathSegment(pathSegment.LocalizedText, pathSegment.LocalizedText));
}
action.Path = new ActionPath(path.ToString(), action.ResourceResolver);
return action;
}
示例3: CreateLoadingPriorsAction
private static IClickAction CreateLoadingPriorsAction(ActionPlaceholder actionPlaceholder, string basePath, int number)
{
const string actionIdPrefix = "loadingPriors";
Path pathSuffix = new Path(basePath);
pathSuffix = pathSuffix.SubPath(1, pathSuffix.Segments.Count - 1);
pathSuffix = pathSuffix.Append(new PathSegment(actionIdPrefix));
string actionId = actionIdPrefix + number;
var action = actionPlaceholder.CreateMenuAction(actionId, pathSuffix.ToString(), ClickActionFlags.None, null);
action.Label = SR.LabelLoadingPriors;
action.SetClickHandler(delegate { });
return action;
}