本文整理匯總了C#中MonoDevelop.Projects.FileFormat.GetValidFileName方法的典型用法代碼示例。如果您正苦於以下問題:C# FileFormat.GetValidFileName方法的具體用法?C# FileFormat.GetValidFileName怎麽用?C# FileFormat.GetValidFileName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MonoDevelop.Projects.FileFormat
的用法示例。
在下文中一共展示了FileFormat.GetValidFileName方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: WriteFile
string WriteFile (IProgressMonitor monitor, string file, object item, FileFormat format)
{
if (format == null) {
if (defaultFormat.CanWrite (item))
format = defaultFormat;
else {
FileFormat[] formats = formatManager.GetFileFormatsForObject (item);
format = formats.Length > 0 ? formats [0] : null;
}
if (format == null)
return null;
file = format.GetValidFileName (item, file);
}
if (!FileService.RequestFileEdit (file))
throw new UserException (GettextCatalog.GetString ("The project could not be saved"), GettextCatalog.GetString ("Write permission has not been granted for file '{0}'", file));
format.Format.WriteFile (file, item, monitor);
return file;
}
示例2: WriteFile
FilePath WriteFile (IProgressMonitor monitor, FilePath file, object item, FileFormat format)
{
if (format == null) {
if (defaultFormat.CanWrite (item))
format = defaultFormat;
else {
FileFormat[] formats = formatManager.GetFileFormatsForObject (item);
format = formats.Length > 0 ? formats [0] : null;
}
if (format == null)
return null;
file = format.GetValidFileName (item, file);
}
FileService.RequestFileEdit (file);
format.Format.WriteFile (file, item, monitor);
return file;
}