当前位置: 首页>>代码示例>>C#>>正文


C# Path.Append方法代码示例

本文整理汇总了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;
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:19,代码来源:AbstractActionModelTreeLeafSeparator.cs

示例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;
		}
开发者ID:nhannd,项目名称:Xian,代码行数:27,代码来源:AbstractActionModelTreeLeafAction.cs

示例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;
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:14,代码来源:ContextMenuLayoutTool.cs


注:本文中的Path.Append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。