本文整理汇总了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);
}
示例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");
}
示例3: ValidTemplateRouteConstraint
public ValidTemplateRouteConstraint(ITemplateRepository templateRepository, IFileSystem fileSystem,
ITerrificNetConfig configuration)
{
_templateRepository = templateRepository;
_fileSystem = fileSystem;
_viewPathInfo = configuration.ViewPath;
}
示例4: FileProjectItem
public FileProjectItem(string kind, IFileInfo fileInfo, IFileSystem fileSystem, PathInfo subPath)
: base(subPath.ToString(), kind)
{
_subPath = subPath;
_fileSystem = fileSystem;
FileInfo = fileInfo;
}
示例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;
}
示例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));
}
}
}
示例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);
}
}
示例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);
}
示例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());
}
示例10: TerrificViewDefinitionRepository
public TerrificViewDefinitionRepository(IFileSystem fileSystem,
ITerrificNetConfig configuration,
ITemplateRepository templateRepository,
IModelTypeProvider typeProvider)
{
_fileSystem = fileSystem;
_templateRepository = templateRepository;
_typeProvider = typeProvider;
_viewPathInfo = configuration.ViewPath;
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
}
示例15: FileSystem
public FileSystem(string basePath)
{
if (string.IsNullOrEmpty(basePath))
basePath = Environment.CurrentDirectory;
_basePath = PathInfo.Create(basePath);
_basePathConverted = basePath;
Initialize();
InitializeWatcher();
}