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


C# PathInfo类代码示例

本文整理汇总了C#中PathInfo的典型用法代码示例。如果您正苦于以下问题:C# PathInfo类的具体用法?C# PathInfo怎么用?C# PathInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PathInfo类属于命名空间,在下文中一共展示了PathInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update

    void Update()
    {
        //		List<Vector3> pathPos = new List<Vector3>();
        //		for (int n = 0; n < animPath.keyframes.Length; n++){
        //			Vector3 pos = animPath.keyframes[n].position;
        //			pathPos.Add(pos);
        //		}
        //		path = pathPos.ToArray();

        if(path == null || path.Length < 1){ return; }

        Shape sp = new Shape();

        sp.moveTo( path[0] );
        for(int n = 1; n < path.Length-1; n++)
        {
            Vector3 pos = Vector3.Lerp( path[n], path[n+1], 0.5f);
            sp.curveTo( path[n],  pos );
        }

        Vector3 posC = Vector3.Lerp( path[path.Length-2], path[path.Length-1], 0.5f);
        Vector3 posEnd = path[path.Length-1];
        sp.curveTo( posC,  posEnd );

        pathInfo = new PathInfo(sp.commands, sp.data);

        DrawLinePoints();

        //
        Point3D _p3d = pathInfo.lengthToPoint(t_length);
        p3D = new Vector3(_p3d.x, _p3d.y, _p3d.z);
    }
开发者ID:inoook,项目名称:BezierPath,代码行数:32,代码来源:ShapePathLineRenderer.cs

示例2: ZipFileSystem

 public ZipFileSystem(string filePath, string rootPath)
 {
     _filePath = PathInfo.Create(filePath);
     _rootPath = PathInfo.Create(rootPath);
     _file = new ZipFile(filePath);
     _etag = new FileInfo(filePath).LastWriteTimeUtc.Ticks.ToString("X8");
 }
开发者ID:TerrificNet,项目名称:TerrificNet,代码行数:7,代码来源:ZipFileSystem.cs

示例3: ValidTemplateRouteConstraint

	    public ValidTemplateRouteConstraint(ITemplateRepository templateRepository, IFileSystem fileSystem,
			ITerrificNetConfig configuration)
		{
	        _templateRepository = templateRepository;
			_fileSystem = fileSystem;
	        _viewPathInfo = configuration.ViewPath;
		}
开发者ID:namics,项目名称:TerrificNet,代码行数:7,代码来源:ValidTemplateRouteConstraint.cs

示例4: FileProjectItem

 public FileProjectItem(string kind, IFileInfo fileInfo, IFileSystem fileSystem, PathInfo subPath) 
     : base(subPath.ToString(), kind)
 {
     _subPath = subPath;
     _fileSystem = fileSystem;
     FileInfo = fileInfo;
 }
开发者ID:TerrificNet,项目名称:TerrificNet,代码行数:7,代码来源:FileProjectItem.cs

示例5: WritePath

        public static bool WritePath(Path3D pathInSpace, string pathName, string pathDescription = null, string outputFolderName = null, string ouputFolderPath = null)
        {
            outputFolderName = outputFolderName ?? DefaultFolderName;
            ouputFolderPath = ouputFolderPath ?? DefaultFolderPath;

            var directory = Directory.CreateDirectory(Path.Combine(ouputFolderPath, outputFolderName)); //if it doesn't exist create directory
            string filePath = Path.Combine(ouputFolderPath, outputFolderName, pathName + "." + FileExtension);

            if (string.IsNullOrWhiteSpace(pathName) || File.Exists(filePath))
                return false;

            var pathInfo = new PathInfo()
            {
                PathName = pathName,
                PathDescription = pathDescription ?? DefaultPathDetails,
                Path = pathInSpace.Points
            };

            string obj = JsonConvert.SerializeObject(pathInfo, Formatting.Indented);

            using (StreamWriter writer = new StreamWriter(filePath))
                writer.Write(obj);

            return true;
        }
开发者ID:nadiahristova,项目名称:OOP,代码行数:25,代码来源:Storage.cs

示例6: EnsurePathInfo

            public static PathInfo EnsurePathInfo(string path)
            {
                PathInfo pathInfo = (PathInfo)pathCache[path];
                if (pathInfo != null)
                {
                    return pathInfo;
                }

                lock (writeLock)
                {
                    pathInfo = (PathInfo)pathCache[path];
                    if (pathInfo != null)
                    {
                        return pathInfo;
                    }

                    if (HostingEnvironment.VirtualPathProvider.FileExists(path))
                    {
                        pathInfo = new PathInfo();
                        pathCache.Add(path, pathInfo);
                        return pathInfo;
                    }
                    else
                    {
                        throw FxTrace.Exception.AsError(new HttpException((int)HttpStatusCode.NotFound, SR.ResourceNotFound));
                    }
                }
            }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:28,代码来源:XamlHttpHandlerFactory.cs

示例7: Update

		private Task Update(object content, PathInfo filePath)
		{
			using (var stream = new StreamWriter(_fileSystem.OpenWrite(filePath)))
			{
				var value = JsonConvert.SerializeObject(content, Formatting.Indented);
				return stream.WriteAsync(value);
			}
		}
开发者ID:namics,项目名称:TerrificNet,代码行数:8,代码来源:JsonModelProvider.cs

示例8: OpenRead

		public Stream OpenRead(PathInfo filePath)
		{
			string resourceName;
			if (!_names.TryGetValue(filePath, out resourceName))
				throw new ArgumentException("Invalid file path");

			return _assembly.GetManifestResourceStream(resourceName);
		}
开发者ID:TerrificNet,项目名称:TerrificNet,代码行数:8,代码来源:EmbeddedResourceFileSystem.cs

示例9: Exists

        public Task<bool> Exists(Uri path)
        {
            var pathInfo = new PathInfo(path);
            this.AssertIsValidWabsUri(pathInfo);

            StorageSimulatorItem result = this.GetItem(pathInfo);
            return Task.FromResult(result.IsNotNull());
        }
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:8,代码来源:StorageAccountSimulator.cs

示例10: TerrificViewDefinitionRepository

 public TerrificViewDefinitionRepository(IFileSystem fileSystem, 
     ITerrificNetConfig configuration,
     ITemplateRepository templateRepository,
     IModelTypeProvider typeProvider)
 {
     _fileSystem = fileSystem;
     _templateRepository = templateRepository;
     _typeProvider = typeProvider;
     _viewPathInfo = configuration.ViewPath;
 }
开发者ID:namics,项目名称:TerrificNet,代码行数:10,代码来源:TerrificViewDefinitionRepository.cs

示例11: GetSchema

        private async Task<JSchema> GetSchema(PathInfo path)
        {
            string content = null;
            using (var reader = new StreamReader(_fileSystem.OpenRead(path)))
            {
                content = await reader.ReadToEndAsync().ConfigureAwait(false);
            }

            return JsonConvert.DeserializeObject<JSchema>(content);
        }
开发者ID:TerrificNet,项目名称:TerrificNet,代码行数:10,代码来源:FileSystemSchemaProvider.cs

示例12: CreateContainerIfNotExists

        public Task CreateContainerIfNotExists(string containerName)
        {
            containerName.ArgumentNotNullOrEmpty("containerName");
            var containerUri = new Uri(string.Format("{0}://{1}@{2}", Constants.WabsProtocol, containerName, this.Account.Host));
            var pathInfo = new PathInfo(containerUri);
            this.AssertIsValidWabsUri(pathInfo);
            this.CreateTree(pathInfo);

            return Task.Delay(0);
        }
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:10,代码来源:StorageAccountSimulator.cs

示例13: AddPath

    public int AddPath(PathInfo newPath)
    {
        // add the struct 
        // get the value added at and then return

        //special case as trees are not walkable so
        if (!Walkable(Map, newPath.End))
            newPath.End = ClosestWalkable(newPath.End);
        Paths.Add(Paths.Count,newPath);
        return Paths.Count - 1;
    }
开发者ID:nathn123,项目名称:Ai-RTS-Game,代码行数:11,代码来源:PathPlanning.cs

示例14: GetModelFromPathAsync

	    private async Task<object> GetModelFromPathAsync(PathInfo filePath)
        {
            if (!_fileSystem.FileExists(filePath))
                return null;

            using (var stream = new StreamReader(_fileSystem.OpenRead(filePath)))
            {
                var content = await stream.ReadToEndAsync().ConfigureAwait(false);
                return JsonConvert.DeserializeObject(content);
            }
        }
开发者ID:namics,项目名称:TerrificNet,代码行数:11,代码来源:JsonModelProvider.cs

示例15: FileSystem

		public FileSystem(string basePath)
		{
			if (string.IsNullOrEmpty(basePath))
				basePath = Environment.CurrentDirectory;

			_basePath = PathInfo.Create(basePath);
			_basePathConverted = basePath;

			Initialize();
			InitializeWatcher();
		}
开发者ID:namics,项目名称:TerrificNet,代码行数:11,代码来源:FileSystem.cs


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