本文整理汇总了C#中FileName.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# FileName.ToString方法的具体用法?C# FileName.ToString怎么用?C# FileName.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileName
的用法示例。
在下文中一共展示了FileName.ToString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
/// <summary>
/// Retrieves the file contents for the specified project items.
/// </summary>
public ITextBuffer Create(FileName fileName)
{
foreach (FileName name in viewContentFileNamesCollection) {
if (FileUtility.IsEqualFileName(name, fileName))
return WorkbenchSingleton.SafeThreadFunction(ParserService.GetParseableFileContent, fileName.ToString());
}
try {
return new StringTextBuffer(ICSharpCode.AvalonEdit.Utils.FileReader.ReadFileContent(fileName, ParserService.DefaultFileEncoding));
} catch (IOException) {
return null;
} catch (UnauthorizedAccessException) {
return null;
}
}
示例2: CreateParseInformation
ParseInformation IVbpProjectSymbolCache.GetAndReparse(FileName fileName, ITextSource fileContent)
{
string fn = fileName.ToString();
_cache[fn] = CreateParseInformation(fn, fileContent, _project);
return _cache[fn];
}
示例3: ToResourceName
string ToResourceName(FileName fileName)
{
return prefix + fileName.ToString().Replace('\\', '.');
}
示例4: GetCacheFileName
string GetCacheFileName(FileName assemblyFileName)
{
if (DomPersistencePath == null)
return null;
string cacheFileName = Path.GetFileNameWithoutExtension(assemblyFileName);
if (cacheFileName.Length > 32)
cacheFileName = cacheFileName.Substring(cacheFileName.Length - 32); // use 32 last characters
cacheFileName = Path.Combine(DomPersistencePath, cacheFileName + "." + assemblyFileName.ToString().ToUpperInvariant().GetStableHashCode().ToString("x8") + ".dat");
return cacheFileName;
}
示例5: CanCreateContentForFile
public bool CanCreateContentForFile(FileName fileName)
{
return fileName.ToString().StartsWith("ilspy://", StringComparison.OrdinalIgnoreCase);
}
示例6: IsPreferredBindingForFile
public bool IsPreferredBindingForFile(FileName fileName)
{
return fileName.ToString().StartsWith("ilspy://", StringComparison.OrdinalIgnoreCase);
}
示例7: GetCacheFileName
static string GetCacheFileName(FileName projectFileName)
{
string persistencePath = SD.AssemblyParserService.DomPersistencePath;
if (persistencePath == null)
return null;
string cacheFileName = Path.GetFileNameWithoutExtension(projectFileName);
if (cacheFileName.Length > 32)
cacheFileName = cacheFileName.Substring(cacheFileName.Length - 32); // use 32 last characters
cacheFileName = Path.Combine(persistencePath, cacheFileName + "." + projectFileName.ToString().GetStableHashCode().ToString("x8") + ".prj");
return cacheFileName;
}
示例8: AreFileNamesEqual
bool AreFileNamesEqual(FileName lhs, string rhs)
{
return FileUtility.IsEqualFileName(lhs.ToString(), rhs);
}