本文整理汇总了C#中MonoDevelop.Projects.FileFormat类的典型用法代码示例。如果您正苦于以下问题:C# FileFormat类的具体用法?C# FileFormat怎么用?C# FileFormat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FileFormat类属于MonoDevelop.Projects命名空间,在下文中一共展示了FileFormat类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ExportSolutionDialog
public ExportSolutionDialog(WorkspaceItem item, FileFormat selectedFormat)
{
this.Build();
labelNewFormat.Text = item.FileFormat.Name;
formats = Services.ProjectService.FileFormats.GetFileFormatsForObject (item);
foreach (FileFormat format in formats)
comboFormat.AppendText (format.Name);
int sel = Array.IndexOf (formats, selectedFormat);
if (sel == -1) sel = 0;
comboFormat.Active = sel;
if (formats.Length < 2) {
table.Remove (newFormatLabel);
newFormatLabel.Destroy ();
newFormatLabel = null;
table.Remove (comboFormat);
comboFormat.Destroy ();
comboFormat = null;
}
//auto height
folderEntry.WidthRequest = 380;
Resize (1, 1);
folderEntry.Path = item.ItemDirectory;
UpdateControls ();
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:30,代码来源:ExportSolutionDialog.cs
示例2: GetDefaultTargetFrameworkForFormat
public override TargetFrameworkMoniker GetDefaultTargetFrameworkForFormat (FileFormat format)
{
// Note: This value is used only when serializing the TargetFramework to the .csproj file.
// Any component of the TargetFramework that is different from this base TargetFramework
// value will be serialized.
//
// Therefore, if we only specify the TargetFrameworkIdentifier, then both the
// TargetFrameworkVersion and TargetFrameworkProfile values will be serialized.
return new TargetFrameworkMoniker (".NETPortable", "1.0");
}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:10,代码来源:PortableDotNetProject.cs
示例3: GetDefaultTargetFrameworkForFormat
public override TargetFrameworkMoniker GetDefaultTargetFrameworkForFormat (FileFormat format)
{
switch (format.Id) {
case "MSBuild05":
return TargetFrameworkMoniker.NET_2_0;
case "MSBuild08":
return TargetFrameworkMoniker.NET_2_0;
case "MSBuild10":
return TargetFrameworkMoniker.NET_4_0;
}
return Services.ProjectService.DefaultTargetFramework.Id;
}
开发者ID:nieve,项目名称:monodevelop,代码行数:12,代码来源:DotNetAssemblyProject.cs
示例4: SupportsFormat
public override bool SupportsFormat (FileFormat format)
{
int version;
if (!format.Id.StartsWith ("MSBuild"))
return false;
if (!int.TryParse (format.Id.Substring ("MSBuild".Length), out version))
return false;
return version >= 10;
}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:12,代码来源:PortableDotNetProject.cs
示例5: ExportProjectDialog
public ExportProjectDialog (IWorkspaceObject entry, FileFormat selectedFormat)
{
this.Build();
FileFormat f = entry is WorkspaceItem ? ((WorkspaceItem)entry).FileFormat : ((SolutionEntityItem)entry).FileFormat;
labelNewFormat.Text = f.Name;
formats = Services.ProjectService.FileFormats.GetFileFormatsForObject (entry);
foreach (FileFormat format in formats)
comboFormat.AppendText (format.Name);
int sel = Array.IndexOf (formats, selectedFormat);
if (sel == -1) sel = 0;
comboFormat.Active = sel;
folderEntry.Path = entry.ItemDirectory;
UpdateControls ();
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:18,代码来源:ExportProjectDialog.cs
示例6: SourcesZipEditorWidget
public SourcesZipEditorWidget (PackageBuilder target, FileFormat selectedFormat)
{
this.Build();
this.target = (SourcesZipPackageBuilder) target;
loading = true;
if (target.RootSolutionItem is SolutionFolder)
formats = Services.ProjectService.FileFormats.GetFileFormatsForObject (target.Solution);
else
formats = Services.ProjectService.FileFormats.GetFileFormatsForObject (target.RootSolutionItem);
if (selectedFormat == null) selectedFormat = this.target.FileFormat;
if (selectedFormat == null)
selectedFormat = formats [0];
int sel = 0;
for (int n=0; n<formats.Length; n++) {
comboFormat.AppendText (formats[n].Name);
if (formats[n].Name == selectedFormat.Name)
sel = n;
}
comboFormat.Active = sel;
this.target.FileFormat = formats [sel];
string[] archiveFormats = DeployService.SupportedArchiveFormats;
int zel = 1;
for (int n=0; n<archiveFormats.Length; n++) {
comboZip.AppendText (archiveFormats [n]);
if (this.target.TargetFile.EndsWith (archiveFormats [n]))
zel = n;
}
if (!string.IsNullOrEmpty (this.target.TargetFile)) {
string ext = archiveFormats [zel];
folderEntry.Path = System.IO.Path.GetDirectoryName (this.target.TargetFile);
entryZip.Text = System.IO.Path.GetFileName (this.target.TargetFile.Substring (0, this.target.TargetFile.Length - ext.Length));
comboZip.Active = zel;
}
loading = false;
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:41,代码来源:SourcesZipEditorWidget.cs
示例7: 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;
}
开发者ID:hduregger,项目名称:monodevelop,代码行数:21,代码来源:ProjectService.cs
示例8: GetDefaultTargetFrameworkForFormat
/// <summary>
/// Returns the default framework for a given format
/// </summary>
/// <returns>
/// The default target framework for the format.
/// </returns>
/// <param name='format'>
/// A format
/// </param>
/// <remarks>
/// This method is used to determine what's the correct target framework for a project
/// deserialized using a specific format.
/// </remarks>
public virtual TargetFrameworkMoniker GetDefaultTargetFrameworkForFormat (FileFormat format)
{
return GetDefaultTargetFrameworkId ();
}
开发者ID:John-Colvin,项目名称:monodevelop,代码行数:17,代码来源:DotNetProject.cs
示例9: ReadFile
object ReadFile (IProgressMonitor monitor, string file, Type expectedType, out FileFormat format)
{
FileFormat[] formats = formatManager.GetFileFormats (file, expectedType);
if (formats.Length == 0)
throw new InvalidOperationException ("Unknown file format: " + file);
format = formats [0];
object obj = format.Format.ReadFile (file, expectedType, monitor);
if (obj == null)
throw new InvalidOperationException ("Invalid file format: " + file);
return obj;
}
开发者ID:hduregger,项目名称:monodevelop,代码行数:14,代码来源:ProjectService.cs
示例10: SupportsFormat
public override bool SupportsFormat (FileFormat format)
{
return format.Id == "MSBuild10";
}
开发者ID:Poiros,项目名称:monodevelop,代码行数:4,代码来源:MonoMacProject.cs
示例11: SetClosestSupportedTargetFramework
static void SetClosestSupportedTargetFramework (FileFormat format, DotNetProject project)
{
// If the solution format can't write this project due to an unsupported framework, try finding the
// closest valid framework. DOn't worry about whether it's installed, that's up to the user to correct.
TargetFramework curFx = project.TargetFramework;
var candidates = Runtime.SystemAssemblyService.GetTargetFrameworks ()
.Where (fx =>
//only frameworks with the same ID, else version comparisons are meaningless
fx.Id.Identifier == curFx.Id.Identifier &&
//don't consider profiles, only full frameworks
fx.Id.Profile == null &&
//and the project and format must support the framework
project.SupportsFramework (fx) && format.SupportsFramework (fx))
//FIXME: string comparisons aren't a valid way to compare profiles, but it works w/released .NET versions
.OrderBy (fx => fx.Id.Version)
.ToList ();
TargetFramework newFx =
candidates.FirstOrDefault (fx => string.CompareOrdinal (fx.Id.Version, curFx.Id.Version) > 0)
?? candidates.LastOrDefault ();
if (newFx != null)
project.TargetFramework = newFx;
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:24,代码来源:ProjectDescriptor.cs
示例12: TryFixingFramework
public void TryFixingFramework (FileFormat format, DotNetProject item)
{
// If the solution format can't write this project it may be due to an unsupported
// framework. Try finding a compatible framework.
TargetFramework curFx = item.TargetFramework;
foreach (TargetFramework fx in Runtime.SystemAssemblyService.GetTargetFrameworks ()) {
item.TargetFramework = fx;
if (format.CanWrite (item))
return;
}
item.TargetFramework = curFx;
}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:13,代码来源:ProjectDescriptor.cs
示例13: ProjectService
internal ProjectService ()
{
extensionChainSlot = Thread.AllocateDataSlot ();
AddinManager.AddExtensionNodeHandler (FileFormatsExtensionPath, OnFormatExtensionChanged);
AddinManager.AddExtensionNodeHandler (SerializableClassesExtensionPath, OnSerializableExtensionChanged);
AddinManager.AddExtensionNodeHandler (ExtendedPropertiesExtensionPath, OnPropertiesExtensionChanged);
AddinManager.AddExtensionNodeHandler (ProjectBindingsExtensionPath, OnProjectsExtensionChanged);
AddinManager.ExtensionChanged += OnExtensionChanged;
defaultFormat = formatManager.GetFileFormat ("MSBuild05");
}
开发者ID:hduregger,项目名称:monodevelop,代码行数:11,代码来源:ProjectService.cs
示例14: ProjectService
internal ProjectService ()
{
AddinManager.AddExtensionNodeHandler (FileFormatsExtensionPath, OnFormatExtensionChanged);
AddinManager.AddExtensionNodeHandler (SerializableClassesExtensionPath, OnSerializableExtensionChanged);
AddinManager.AddExtensionNodeHandler (ExtendedPropertiesExtensionPath, OnPropertiesExtensionChanged);
AddinManager.AddExtensionNodeHandler (ProjectBindingsExtensionPath, OnProjectsExtensionChanged);
AddinManager.ExtensionChanged += OnExtensionChanged;
defaultFormat = formatManager.GetFileFormat (MSBuildProjectService.DefaultFormat);
}
开发者ID:riverans,项目名称:monodevelop,代码行数:10,代码来源:ProjectService.cs
示例15: 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;
}
开发者ID:jgranick,项目名称:haxedevelop,代码行数:21,代码来源:ProjectService.cs
示例16: Export
string Export (IProgressMonitor monitor, IWorkspaceFileObject obj, string[] includedChildIds, string targetPath, FileFormat format)
{
string rootSourceFile = obj.FileName;
string sourcePath = Path.GetFullPath (Path.GetDirectoryName (rootSourceFile));
targetPath = Path.GetFullPath (targetPath);
if (sourcePath != targetPath) {
if (!CopyFiles (monitor, obj, obj.GetItemFiles (true), targetPath, true))
return null;
string newFile = Path.Combine (targetPath, Path.GetFileName (rootSourceFile));
if (IsWorkspaceItemFile (rootSourceFile))
obj = ReadWorkspaceItem (monitor, newFile);
else
obj = (SolutionEntityItem) ReadSolutionItem (monitor, newFile);
using (obj) {
List<FilePath> oldFiles = obj.GetItemFiles (true);
ExcludeEntries (obj, includedChildIds);
if (format != null)
obj.ConvertToFormat (format, true);
obj.Save (monitor);
List<FilePath> newFiles = obj.GetItemFiles (true);
foreach (FilePath f in newFiles) {
if (!f.IsChildPathOf (targetPath)) {
if (obj is Solution)
monitor.ReportError ("The solution '" + obj.Name + "' is referencing the file '" + f.FileName + "' which is located outside the root solution directory.", null);
else
monitor.ReportError ("The project '" + obj.Name + "' is referencing the file '" + f.FileName + "' which is located outside the project directory.", null);
}
oldFiles.Remove (f);
}
// Remove old files
foreach (FilePath file in oldFiles) {
if (File.Exists (file)) {
File.Delete (file);
// Exclude empty directories
FilePath dir = file.ParentDirectory;
if (Directory.GetFiles (dir).Length == 0 && Directory.GetDirectories (dir).Length == 0) {
try {
Directory.Delete (dir);
} catch (Exception ex) {
monitor.ReportError (null, ex);
}
}
}
}
return obj.FileName;
}
}
else {
using (obj) {
ExcludeEntries (obj, includedChildIds);
if (format != null)
obj.ConvertToFormat (format, true);
obj.Save (monitor);
return obj.FileName;
}
}
}
开发者ID:hduregger,项目名称:monodevelop,代码行数:63,代码来源:ProjectService.cs
示例17: InitializeSettings
public override void InitializeSettings (SolutionItem entry)
{
targetFile = Path.Combine (entry.BaseDirectory, entry.Name) + ".tar.gz";
if (entry.ParentSolution != null)
fileFormat = entry.ParentSolution.FileFormat;
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:6,代码来源:SourcesZipPackageBuilder.cs
示例18: GetDefaultTargetFrameworkForFormat
public override TargetFrameworkMoniker GetDefaultTargetFrameworkForFormat (FileFormat format)
{
switch (format.Id) {
case "MSBuild08":
return new TargetFrameworkMoniker ("Silverlight", "3.0");
default:
return new TargetFrameworkMoniker ("Silverlight", "4.0");
}
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:9,代码来源:MoonlightProject.cs
示例19: RegisterFileFormat
public void RegisterFileFormat (IFileFormat format, string id, string name)
{
FileFormat f = new FileFormat (format, id, name);
fileFormats.Add (f);
}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:5,代码来源:FileFormatManager.cs
示例20: GetDefaultTargetFrameworkForFormat
public override TargetFrameworkMoniker GetDefaultTargetFrameworkForFormat(FileFormat format)
{
//Keep default version invalid(1.0) or MonoDevelop will omit from serialization
return new TargetFrameworkMoniker(".NETMicroFramework", "1.0");
}
开发者ID:Roddoric,项目名称:Monkey.Robotics,代码行数:5,代码来源:MicroFrameworkProject.cs
注:本文中的MonoDevelop.Projects.FileFormat类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论