本文整理汇总了C#中PathInfo类的典型用法代码示例。如果您正苦于以下问题:C# PathInfo类的具体用法?C# PathInfo怎么用?C# PathInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PathInfo类属于命名空间,在下文中一共展示了PathInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: TryReadPageDefinition
private bool TryReadPageDefinition(out IPageViewDefinition viewDefinition, PathInfo fileName)
{
using (var reader = new JsonTextReader(new StreamReader(_fileSystem.OpenRead(fileName))))
{
viewDefinition = Deserialize(reader);
if (viewDefinition == null)
return false;
viewDefinition.Id = fileName.ToString();
return true;
}
}
开发者ID:namics,项目名称:TerrificNet,代码行数:14,代码来源:TerrificViewDefinitionRepository.cs
示例17: Delete
public void Delete(Uri path)
{
var pathInfo = new PathInfo(path);
if (pathInfo.Path.IsNullOrEmpty())
{
throw new InvalidOperationException("An attempt was made to delete a container. Containers can not be deleted via this API.");
}
this.AssertIsValidWabsUri(pathInfo);
StorageSimulatorItem item = this.GetItem(pathInfo, true);
if (item.IsNotNull() && item.Items.ContainsKey(pathInfo.PathParts[pathInfo.PathParts.Length - 1]))
{
item.Items.Remove(pathInfo.PathParts[pathInfo.PathParts.Length - 1]);
}
}
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:16,代码来源:StorageAccountSimulator.cs
示例18: GetPathID
public Int32 GetPathID(PathInfo path)
{
if (null == path)
return -1;
if (null == path.Name) // user password can be null
return -1;
String pathName = path.Name.Trim();
if (pathName.Length == 0)
return -1;
String pathPwd = "";
if (null != path.Password)
pathPwd = path.Password;
return mDataAccesser.GetPathID(pathName, pathPwd);
//return 5;
}
开发者ID:JeffreyZksun,项目名称:gpstranslator,代码行数:18,代码来源:GPSManager.cs
示例19: SearchAStar
public SearchAStar(SparseGraph<NavGraphNode, GraphEdge> graph
, int source
, int target
, bool isignorewall
, float strickdistance
, float hcostpercentage
, bool drawexplorepath
, float explorepathremaintime)
{
mGraph = graph;
mPQ = new PriorityQueue<int, float>((int)Mathf.Sqrt(mGraph.NumNodes()));
mGCosts = new List<float>(graph.NumNodes());
mFCosts = new List<Pair<int, float>>(graph.NumNodes());
mShortestPathTree = new List<GraphEdge>(graph.NumNodes());
mSearchFrontier = new List<GraphEdge>(graph.NumNodes());
//Init G cost and F cost and Cost value
for (int i = 0; i < graph.NumNodes(); i++)
{
mGCosts.Add(0.0f);
mFCosts.Add(new Pair<int, float>(i, 0.0f));
mShortestPathTree.Add(new GraphEdge());
mSearchFrontier.Add(new GraphEdge());
}
mISource = source;
mITarget = target;
mOriginalTarget = target;
Assert.IsTrue(hcostpercentage >= 0);
mHCostPercentage = hcostpercentage;
mBDrawExplorePath = drawexplorepath;
mExplorePathRemainTime = explorepathremaintime;
mAStarPathInfo = new PathInfo();
mIsIgnoreWall = isignorewall;
mStrickDistance = strickdistance;
//Search(mStrickDistance, mIsIgnoreWall);
//GeneratePathToTargetInfo();
}
开发者ID:TonyTang1990,项目名称:PathFinding,代码行数:44,代码来源:SearchAStar.cs
示例20: List
public Task<IEnumerable<Uri>> List(Uri path, bool recursive)
{
var items = new List<Uri>();
var queue = new Queue<StorageSimulatorItem>();
var pathInfo = new PathInfo(path);
this.AssertIsValidWabsUri(pathInfo);
StorageSimulatorItem item = this.GetItem(pathInfo, pathInfo.Path.IsNullOrEmpty());
if (item.IsNotNull())
{
queue.Enqueue(item);
while (queue.Count > 0)
{
item = queue.Remove();
queue.AddRange(item.Items.Values);
items.Add(item.Path);
}
}
return Task.FromResult((IEnumerable<Uri>)items);
}
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:19,代码来源:StorageAccountSimulator.cs
注:本文中的PathInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论