Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4068 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
7 changed files with 112 additions and 37 deletions
@ -0,0 +1,47 @@
@@ -0,0 +1,47 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.DefaultEditor.Codons; |
||||
|
||||
namespace PythonBinding.Tests.Utils |
||||
{ |
||||
public class AddInHelper |
||||
{ |
||||
AddInHelper() |
||||
{ |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets the codon with the specified extension path and name.
|
||||
/// </summary>
|
||||
public static Codon GetCodon(AddIn addin, string extensionPath, string name) |
||||
{ |
||||
if (addin.Paths.ContainsKey(extensionPath)) { |
||||
ExtensionPath path = addin.Paths[extensionPath]; |
||||
return GetCodon(path.Codons, name); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets the codon with the specified name.
|
||||
/// </summary>
|
||||
public static Codon GetCodon(List<Codon> codons, string name) |
||||
{ |
||||
foreach (Codon codon in codons) { |
||||
if (codon.Id == name) { |
||||
return codon; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue