forked from fdorg/flashdevelop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFakeClasses.cs
More file actions
80 lines (71 loc) · 2.42 KB
/
Copy pathFakeClasses.cs
File metadata and controls
80 lines (71 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.IO;
namespace PluginCore.Localization
{
// These exist because we want to decorate some of our compiler option classes
// with localized descriptions for the PropertyGrid, but we don't want fdbuild
// to have to reference PluginCore.
class LocalizedDescriptionAttribute : Attribute
{
public LocalizedDescriptionAttribute(string fake) { }
}
class LocalizedCategoryAttribute : Attribute
{
public LocalizedCategoryAttribute(string fake) { }
}
}
namespace PluginCore
{
interface IProject { }
}
namespace ProjectManager.Controls
{
public class PropertiesDialog { }
}
namespace ProjectManager.Controls.AS2
{
public class AS2PropertiesDialog : ProjectManager.Controls.PropertiesDialog { }
}
namespace ProjectManager.Controls.AS3
{
public class AS3PropertiesDialog : ProjectManager.Controls.PropertiesDialog { }
}
namespace ProjectManager.Helpers
{
/// <summary>
/// Can be extended at runtime by a FlashDevelop plugin, but not in the command line
/// </summary>
class ProjectCreator
{
private static Hashtable projectTypes = new Hashtable();
private static bool projectTypesSet = false;
private static void SetInitialProjectHash()
{
projectTypes["project.fdp"] = typeof(ProjectManager.Projects.AS2.AS2Project);
projectTypes["project.as2proj"] = typeof(ProjectManager.Projects.AS2.AS2Project);
projectTypes["project.as3proj"] = typeof(ProjectManager.Projects.AS3.AS3Project);
projectTypes["project.hxproj"] = typeof(ProjectManager.Projects.Haxe.HaxeProject);
projectTypes["project.fdproj"] = typeof(ProjectManager.Projects.Generic.GenericProject);
projectTypesSet = true;
}
public static bool IsKnownProject(string ext)
{
if (!projectTypesSet) SetInitialProjectHash();
return projectTypes.ContainsKey("project" + ext);
}
public static Type GetProjectType(string key)
{
if (!projectTypesSet) SetInitialProjectHash();
if (projectTypes.ContainsKey(key))
return (Type)projectTypes[key];
return null;
}
public static string KeyForProjectPath(string path)
{
return "project" + Path.GetExtension(path).ToLower();
}
}
}