Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1048 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
16 changed files with 371 additions and 96 deletions
@ -0,0 +1,107 @@
@@ -0,0 +1,107 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Daniel Grunwald |
||||
* Date: 29.01.2006 |
||||
* Time: 15:33 |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
using ICSharpCode.Core; |
||||
|
||||
namespace ICSharpCode.FiletypeRegisterer |
||||
{ |
||||
public class FiletypeAssociation |
||||
{ |
||||
string id; |
||||
string icon; |
||||
string text; |
||||
bool isDefault; |
||||
|
||||
public FiletypeAssociation(string id, string icon, string text, bool isDefault) |
||||
{ |
||||
this.id = id; |
||||
this.icon = icon; |
||||
this.text = text; |
||||
this.isDefault = isDefault; |
||||
} |
||||
|
||||
public string Extension { |
||||
get { |
||||
return id; |
||||
} |
||||
} |
||||
|
||||
public string Icon { |
||||
get { |
||||
return icon; |
||||
} |
||||
} |
||||
|
||||
public string Text { |
||||
get { |
||||
return text; |
||||
} |
||||
} |
||||
|
||||
public bool IsDefault { |
||||
get { |
||||
return isDefault; |
||||
} |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Creates FiletypeAssociation instances.
|
||||
/// </summary>
|
||||
/// <attribute name="id" use="required">
|
||||
/// The extension (without dot) to be registered.
|
||||
/// </attribute>
|
||||
/// <attribute name="icon" use="required">
|
||||
/// The full path to a .ico file on the disk.
|
||||
/// </attribute>
|
||||
/// <attribute name="text" use="required">
|
||||
/// The description text.
|
||||
/// </attribute>
|
||||
/// <attribute name="autoRegister" use="optional">
|
||||
/// Boolean value that specifies if the file type is registered on every startup, even if another
|
||||
/// application has already registered it. Default=false
|
||||
/// </attribute>
|
||||
/// <returns>
|
||||
/// A FiletypeAssociation describing the specified values.
|
||||
/// </returns>
|
||||
public class FiletypeAssociationDoozer : IDoozer |
||||
{ |
||||
public static List<FiletypeAssociation> GetList() |
||||
{ |
||||
List<FiletypeAssociation> list = new List<FiletypeAssociation>(); |
||||
foreach (FiletypeAssociation ass in AddInTree.BuildItems("/AddIns/FileTypeRegisterer/FileTypes", null, true)) { |
||||
list.Add(ass); |
||||
} |
||||
return list; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets if the doozer handles codon conditions on its own.
|
||||
/// If this property return false, the item is excluded when the condition is not met.
|
||||
/// </summary>
|
||||
public bool HandleConditions { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Creates an item with the specified sub items. And the current
|
||||
/// Condition status for this item.
|
||||
/// </summary>
|
||||
public object BuildItem(object caller, Codon codon, ArrayList subItems) |
||||
{ |
||||
return new FiletypeAssociation(codon.Id, |
||||
StringParser.Parse(codon.Properties["icon"]), |
||||
StringParser.Parse(codon.Properties["text"]), |
||||
bool.TrueString.Equals(codon.Properties["autoRegister"], StringComparison.OrdinalIgnoreCase)); |
||||
} |
||||
} |
||||
} |
@ -1,17 +0,0 @@
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" ?> |
||||
<Filetypes> |
||||
<Filetype ext="cmbx" icon="cmbx.ico">SharpDevelop 1.x Combine</Filetype> |
||||
<Filetype ext="prjx" icon="prjx.ico">SharpDevelop 1.x ${res:ICSharpCode.FiletypeRegisterer.Project}</Filetype> |
||||
<Filetype ext="sln" icon="cmbx.ico">${res:ICSharpCode.FiletypeRegisterer.SolutionFileAssozisation}</Filetype> |
||||
<Filetype ext="csproj" icon="prjx.ico">C# ${res:ICSharpCode.FiletypeRegisterer.Project}</Filetype> |
||||
<Filetype ext="vbproj" icon="prjx.ico">VB ${res:ICSharpCode.FiletypeRegisterer.Project}</Filetype> |
||||
<Filetype ext="booproj" icon="prjx.ico">Boo ${res:ICSharpCode.FiletypeRegisterer.Project}</Filetype> |
||||
<Filetype ext="sdaddin" icon="addin.ico">SharpDevelop ${res:AddInManager.FileAssociation}</Filetype> |
||||
<Filetype ext="cs" icon="cs.ico">${res:ICSharpCode.FiletypeRegisterer.CSharpSourceFileAssozisation}</Filetype> |
||||
<Filetype ext="vb" icon="vb.ico">${res:ICSharpCode.FiletypeRegisterer.VBNetSourceFileAssozisation}</Filetype> |
||||
<!--<Filetype ext="java" icon="java.ico">${res:ICSharpCode.FiletypeRegisterer.JavaSourceFileAssozisation}</Filetype>--> |
||||
<Filetype ext="xfrm" icon="xfrm.ico">${res:ICSharpCode.FiletypeRegisterer.XMLFormFileAssozisation}</Filetype> |
||||
<Filetype ext="resx" icon="resx.ico">${res:ICSharpCode.FiletypeRegisterer.ResXResourceFilesFileAssozisation}</Filetype> |
||||
<Filetype ext="resources" icon="resx.ico">${res:ICSharpCode.FiletypeRegisterer.BinaryResourceFilesFileAssozisation}</Filetype> |
||||
<Filetype ext="xml" icon="xml.ico">${res:ICSharpCode.FiletypeRegisterer.XmlFileAssozisation}</Filetype> |
||||
</Filetypes> |
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections; |
||||
|
||||
namespace ICSharpCode.Core |
||||
{ |
||||
/// <summary>
|
||||
/// Creates a string.
|
||||
/// </summary>
|
||||
/// <attribute name="text" use="required">
|
||||
/// The string to return.
|
||||
/// </attribute>
|
||||
/// <returns>
|
||||
/// The string specified by 'text', passed through the StringParser.
|
||||
/// </returns>
|
||||
public class StringDoozer : IDoozer |
||||
{ |
||||
/// <summary>
|
||||
/// Gets if the doozer handles codon conditions on its own.
|
||||
/// If this property return false, the item is excluded when the condition is not met.
|
||||
/// </summary>
|
||||
public bool HandleConditions { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public object BuildItem(object caller, Codon codon, ArrayList subItems) |
||||
{ |
||||
return StringParser.Parse(codon.Properties["text"]); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue