diff options
author | lbsa71 | 2009-02-19 14:16:22 +0000 |
---|---|---|
committer | lbsa71 | 2009-02-19 14:16:22 +0000 |
commit | e36c452d4e891073768fd70915a65531f806f831 (patch) | |
tree | 40f7ec86c6813a7221f39f4e4483f81337b13158 /Prebuild/src/Core/Nodes/DataNode.cs | |
parent | * Ignored some bins (diff) | |
download | opensim-SC_OLD-e36c452d4e891073768fd70915a65531f806f831.zip opensim-SC_OLD-e36c452d4e891073768fd70915a65531f806f831.tar.gz opensim-SC_OLD-e36c452d4e891073768fd70915a65531f806f831.tar.bz2 opensim-SC_OLD-e36c452d4e891073768fd70915a65531f806f831.tar.xz |
* Reverted Prebuild commit due to strange run-time errors.
Diffstat (limited to 'Prebuild/src/Core/Nodes/DataNode.cs')
-rw-r--r-- | Prebuild/src/Core/Nodes/DataNode.cs | 59 |
1 files changed, 12 insertions, 47 deletions
diff --git a/Prebuild/src/Core/Nodes/DataNode.cs b/Prebuild/src/Core/Nodes/DataNode.cs index 763e6c3..60ed122 100644 --- a/Prebuild/src/Core/Nodes/DataNode.cs +++ b/Prebuild/src/Core/Nodes/DataNode.cs | |||
@@ -23,24 +23,31 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O | |||
23 | */ | 23 | */ |
24 | #endregion | 24 | #endregion |
25 | 25 | ||
26 | #region CVS Information | ||
27 | /* | ||
28 | * $Source$ | ||
29 | * $Author: jendave $ | ||
30 | * $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $ | ||
31 | * $Revision: 71 $ | ||
32 | */ | ||
33 | #endregion | ||
34 | |||
26 | using System; | 35 | using System; |
27 | using System.Xml; | 36 | using System.Xml; |
28 | 37 | ||
29 | using Prebuild.Core.Attributes; | 38 | using Prebuild.Core.Attributes; |
30 | using Prebuild.Core.Interfaces; | 39 | using Prebuild.Core.Interfaces; |
31 | using System.IO; | ||
32 | 40 | ||
33 | namespace Prebuild.Core.Nodes | 41 | namespace Prebuild.Core.Nodes |
34 | { | 42 | { |
35 | /// <summary> | 43 | /// <summary> |
36 | /// | 44 | /// |
37 | /// </summary> | 45 | /// </summary> |
38 | public abstract class DataNode : IDataNode | 46 | public class DataNode : IDataNode |
39 | { | 47 | { |
40 | #region Fields | 48 | #region Fields |
41 | 49 | ||
42 | private IDataNode parent; | 50 | private IDataNode parent; |
43 | string[] m_WebTypes = new string[] { "aspx", "ascx", "master", "ashx", "asmx" }; | ||
44 | 51 | ||
45 | #endregion | 52 | #endregion |
46 | 53 | ||
@@ -61,10 +68,7 @@ namespace Prebuild.Core.Nodes | |||
61 | parent = value; | 68 | parent = value; |
62 | } | 69 | } |
63 | } | 70 | } |
64 | public string[] WebTypes | 71 | |
65 | { | ||
66 | get { return m_WebTypes; } | ||
67 | } | ||
68 | /// <summary> | 72 | /// <summary> |
69 | /// Parses the specified node. | 73 | /// Parses the specified node. |
70 | /// </summary> | 74 | /// </summary> |
@@ -72,46 +76,7 @@ namespace Prebuild.Core.Nodes | |||
72 | public virtual void Parse(XmlNode node) | 76 | public virtual void Parse(XmlNode node) |
73 | { | 77 | { |
74 | } | 78 | } |
75 | public BuildAction GetBuildActionByFileName(string fileName) | 79 | |
76 | { | ||
77 | string extension = Path.GetExtension(fileName).ToLower(); | ||
78 | foreach (string type in WebTypes) | ||
79 | { | ||
80 | if (extension == type) | ||
81 | return BuildAction.Content; | ||
82 | } | ||
83 | return BuildAction.Compile; | ||
84 | } | ||
85 | /// <summary> | ||
86 | /// Parses the file type to figure out what type it is | ||
87 | /// </summary> | ||
88 | /// <returns></returns> | ||
89 | public SubType GetSubTypeByFileName(string fileName) | ||
90 | { | ||
91 | string extension = System.IO.Path.GetExtension(fileName).ToLower(); | ||
92 | string designer = String.Format(".designer{0}", extension); | ||
93 | string path = fileName.ToLower(); | ||
94 | if (extension == ".resx") | ||
95 | { | ||
96 | return SubType.Designer; | ||
97 | } | ||
98 | else if (path.EndsWith(".settings")) | ||
99 | { | ||
100 | return SubType.Settings; | ||
101 | } | ||
102 | else | ||
103 | { | ||
104 | |||
105 | foreach (string type in WebTypes) | ||
106 | { | ||
107 | if (path.EndsWith(string.Format("{0}{1}", type, extension))) | ||
108 | { | ||
109 | return SubType.CodeBehind; | ||
110 | } | ||
111 | } | ||
112 | } | ||
113 | return SubType.Code; | ||
114 | } | ||
115 | #endregion | 80 | #endregion |
116 | } | 81 | } |
117 | } | 82 | } |