From e9c793cede28639507670943f1c22fedaf26782e Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Wed, 22 Aug 2012 05:57:34 +0600 Subject: [PATCH] Fixed difficult merge --- .../Dynamics/ExtensionMethodFinder.cs | 2 +- .../IO/IMediaFileSystemExtensions.cs | 1 + src/Umbraco.Core/ObjectExtensions.cs | 43 +++++++-------- src/Umbraco.Core/TypeExtensions.cs | 53 ++++++++----------- src/Umbraco.Core/Umbraco.Core.csproj | 15 +++--- src/umbraco.cms/businesslogic/Content.cs | 2 +- .../tinyMCE3/webcontrol/TinyMCEWebControl.cs | 10 ++-- .../tinymce/tinyMCEImageHelper.cs | 2 +- src/umbraco.sln | 1 - src/umbraco.webservices/media/mediaService.cs | 6 +-- .../umbraco.webservices.csproj | 2 +- 11 files changed, 61 insertions(+), 76 deletions(-) diff --git a/src/Umbraco.Core/Dynamics/ExtensionMethodFinder.cs b/src/Umbraco.Core/Dynamics/ExtensionMethodFinder.cs index 024c39fef5..3bb90e47d8 100644 --- a/src/Umbraco.Core/Dynamics/ExtensionMethodFinder.cs +++ b/src/Umbraco.Core/Dynamics/ExtensionMethodFinder.cs @@ -34,7 +34,7 @@ namespace Umbraco.Core.Dynamics candidates = candidates.Concat(typeof(IEnumerable).GetMethods(BindingFlags.Static | BindingFlags.Public)); //} - //filter by name + //filter by name var methodsByName = candidates.Where(m => m.Name == name); var isGenericAndRightParamCount = methodsByName.Where(m => m.GetParameters().Length == argumentCount + (argsContainsThis ? 0 : 1)); diff --git a/src/Umbraco.Core/IO/IMediaFileSystemExtensions.cs b/src/Umbraco.Core/IO/IMediaFileSystemExtensions.cs index 5201923dbf..c3c02f1ad6 100644 --- a/src/Umbraco.Core/IO/IMediaFileSystemExtensions.cs +++ b/src/Umbraco.Core/IO/IMediaFileSystemExtensions.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; +using Umbraco.Core.Configuration; using umbraco; namespace Umbraco.Core.IO diff --git a/src/Umbraco.Core/ObjectExtensions.cs b/src/Umbraco.Core/ObjectExtensions.cs index d6edae5dd4..01bafd2f8e 100644 --- a/src/Umbraco.Core/ObjectExtensions.cs +++ b/src/Umbraco.Core/ObjectExtensions.cs @@ -1,27 +1,3 @@ -namespace Umbraco.Core -{ - public static class ObjectExtensions - { - internal static T As(this object realObject) where T : class - { - if (realObject is T) - return realObject as T; - - return DynamicWrapper.CreateWrapper(realObject); - } - - internal static T AsReal(this object wrapper) where T : class - { - if (wrapper is T) - return wrapper as T; - - if (wrapper is DynamicWrapper.DynamicWrapperBase) - return (T)(wrapper as DynamicWrapper.DynamicWrapperBase).RealObject; - - return null; - } - } -} using System; using System.Collections; using System.Collections.Concurrent; @@ -41,6 +17,25 @@ namespace Umbraco.Core { internal static class ObjectExtensions { + internal static T As(this object realObject) where T : class + { + if (realObject is T) + return realObject as T; + + return DynamicWrapper.CreateWrapper(realObject); + } + + internal static T AsReal(this object wrapper) where T : class + { + if (wrapper is T) + return wrapper as T; + + if (wrapper is DynamicWrapper.DynamicWrapperBase) + return (T)(wrapper as DynamicWrapper.DynamicWrapperBase).RealObject; + + return null; + } + //private static readonly ConcurrentDictionary> ObjectFactoryCache = new ConcurrentDictionary>(); public static IEnumerable AsEnumerableOfOne(this T input) diff --git a/src/Umbraco.Core/TypeExtensions.cs b/src/Umbraco.Core/TypeExtensions.cs index a1e605001d..47d573dccf 100644 --- a/src/Umbraco.Core/TypeExtensions.cs +++ b/src/Umbraco.Core/TypeExtensions.cs @@ -19,14 +19,6 @@ namespace Umbraco.Core ? Activator.CreateInstance(t) : null; } -using System.Collections.Generic; -using System.Linq; -using System.Reflection; - -namespace Umbraco.Core -{ - public static class TypeExtensions - { internal static MethodInfo GetGenericMethod(this Type type, string name, params Type[] parameterTypes) { var methods = type.GetMethods().Where(method => method.Name == name); @@ -112,8 +104,7 @@ namespace Umbraco.Core from method in type.GetMethods() select method; } - } -} + /// /// true if the specified type is enumerable; otherwise, false. /// @@ -228,27 +219,27 @@ namespace Umbraco.Core return TypeHelper.IsTypeAssignableFrom(actualType); } - public static string GetCacheKeyFromParameters(this MemberInfo info) - { - var methodInfo = info as MethodInfo; - if (methodInfo != null) - return GetCacheKeyFromParameters(methodInfo.GetParameters()); - return string.Empty; - } + //internal static string GetCacheKeyFromParameters(this MemberInfo info) + //{ + // var methodInfo = info as MethodInfo; + // if (methodInfo != null) + // return GetCacheKeyFromParameters(methodInfo.GetParameters()); + // return string.Empty; + //} - public static string GetCacheKeyFromParameters(IEnumerable parameters) - { - var sb = new StringBuilder(); - sb.Append("("); - foreach (var parameter in parameters) - { - sb.Append(parameter.ParameterType); - sb.Append(" "); - sb.Append(parameter.Name); - sb.Append(","); - } - sb.Append(")"); - return sb.ToString(); - } + //internal static string GetCacheKeyFromParameters(IEnumerable parameters) + //{ + // var sb = new StringBuilder(); + // sb.Append("("); + // foreach (var parameter in parameters) + // { + // sb.Append(parameter.ParameterType); + // sb.Append(" "); + // sb.Append(parameter.Name); + // sb.Append(","); + // } + // sb.Append(")"); + // return sb.ToString(); + //} } } \ No newline at end of file diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 3ceef93175..736d64d396 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -31,8 +31,8 @@ 4 - - ..\Umbraco.Web\bin\businesslogic.dll + + ..\packages\log4net.2.0.0\lib\net40-full\log4net.dll @@ -82,6 +82,11 @@ + + + + + @@ -138,20 +143,14 @@ - - - - - - diff --git a/src/umbraco.cms/businesslogic/Content.cs b/src/umbraco.cms/businesslogic/Content.cs index f404a06772..ebdd411892 100644 --- a/src/umbraco.cms/businesslogic/Content.cs +++ b/src/umbraco.cms/businesslogic/Content.cs @@ -581,7 +581,7 @@ namespace umbraco.cms.businesslogic { if (p.PropertyType.DataTypeDefinition.DataType.Id == uploadField.Id && p.Value.ToString() != "" - && File.Exists(IOHelper.MapPath(p.Value.ToString()))) + && File.Exists(global::Umbraco.Core.IO.IOHelper.MapPath(p.Value.ToString()))) { isUploadField = true; } diff --git a/src/umbraco.editorControls/tinyMCE3/webcontrol/TinyMCEWebControl.cs b/src/umbraco.editorControls/tinyMCE3/webcontrol/TinyMCEWebControl.cs index 94b076c208..1d0ca96464 100644 --- a/src/umbraco.editorControls/tinyMCE3/webcontrol/TinyMCEWebControl.cs +++ b/src/umbraco.editorControls/tinyMCE3/webcontrol/TinyMCEWebControl.cs @@ -73,7 +73,7 @@ namespace umbraco.editorControls.tinyMCE3.webcontrol base.Attributes.Add("style", "visibility: hidden"); config.Add("mode", "exact"); config.Add("theme", "umbraco"); - config.Add("umbraco_path", IOHelper.ResolveUrl(SystemDirectories.Umbraco)); + config.Add("umbraco_path", global::Umbraco.Core.IO.IOHelper.ResolveUrl(global::Umbraco.Core.IO.SystemDirectories.Umbraco)); CssClass = "tinymceContainer"; plugin.ConfigSection configSection = (plugin.ConfigSection)System.Web.HttpContext.Current.GetSection("TinyMCE"); @@ -218,8 +218,8 @@ namespace umbraco.editorControls.tinyMCE3.webcontrol suffix = "_" + this.mode; outURI = this.InstallPath + "/tiny_mce_src" + suffix + ".js"; - if (!File.Exists(IOHelper.MapPath(outURI))) - throw new Exception("Could not locate TinyMCE by URI:" + outURI + ", Physical path:" + IOHelper.MapPath(outURI) + ". Make sure that you configured the installPath to a valid location in your web.config. This path should be an relative or site absolute URI to where TinyMCE is located."); + if (!File.Exists(global::Umbraco.Core.IO.IOHelper.MapPath(outURI))) + throw new Exception("Could not locate TinyMCE by URI:" + outURI + ", Physical path:" + global::Umbraco.Core.IO.IOHelper.MapPath(outURI) + ". Make sure that you configured the installPath to a valid location in your web.config. This path should be an relative or site absolute URI to where TinyMCE is located."); // Collect themes, languages and plugins and build gzip URI // TODO: Make sure gzip is re-enabled @@ -332,7 +332,7 @@ namespace umbraco.editorControls.tinyMCE3.webcontrol // Find the original filename, by removing the might added width and height // NH, 4.8.1 - above replaced by loading the right media file from the db later! orgSrc = - IOHelper.ResolveUrl(orgSrc.Replace("%20", " ")); + global::Umbraco.Core.IO.IOHelper.ResolveUrl(orgSrc.Replace("%20", " ")); // Check for either id or guid from media string mediaId = getIdFromSource(orgSrc, rootMediaUrl); @@ -364,7 +364,7 @@ namespace umbraco.editorControls.tinyMCE3.webcontrol // Format the tag tempTag = tempTag + " rel=\"" + imageMedia.getProperty("umbracoWidth").Value.ToString() + "," + - imageMedia.getProperty("umbracoHeight").Value.ToString() + "\" src=\"" + IOHelper.ResolveUrl(imageMedia.getProperty("umbracoFile").Value.ToString()) + + imageMedia.getProperty("umbracoHeight").Value.ToString() + "\" src=\"" + global::Umbraco.Core.IO.IOHelper.ResolveUrl(imageMedia.getProperty("umbracoFile").Value.ToString()) + "\""; tempTag += "/>"; diff --git a/src/umbraco.editorControls/tinymce/tinyMCEImageHelper.cs b/src/umbraco.editorControls/tinymce/tinyMCEImageHelper.cs index f4e31e55bd..aa6cec62fd 100644 --- a/src/umbraco.editorControls/tinymce/tinyMCEImageHelper.cs +++ b/src/umbraco.editorControls/tinymce/tinyMCEImageHelper.cs @@ -122,7 +122,7 @@ namespace umbraco.editorControls.tinymce { string src = helper.FindAttribute(ht, "src"); //get the media folder, minus the starting '~' - string mediaRoot = SystemDirectories.Media.Replace("~", string.Empty); + string mediaRoot = global::Umbraco.Core.IO.SystemDirectories.Media.Replace("~", string.Empty); // update orgSrc to remove umbraco reference int mediaRootIndex = src.IndexOf(mediaRoot); diff --git a/src/umbraco.sln b/src/umbraco.sln index 8867ca9346..7464b07fd9 100644 --- a/src/umbraco.sln +++ b/src/umbraco.sln @@ -12,7 +12,6 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{2849E9D4-3B4E-40A3-A309-F3CB4F0E125F}" ProjectSection(SolutionItems) = preProject ..\build\Build.bat = ..\build\Build.bat - ..\build\Build.proj = ..\build\Build.proj umbraco.presentation.targets = umbraco.presentation.targets EndProjectSection EndProject diff --git a/src/umbraco.webservices/media/mediaService.cs b/src/umbraco.webservices/media/mediaService.cs index d9fc7df114..434e281da7 100644 --- a/src/umbraco.webservices/media/mediaService.cs +++ b/src/umbraco.webservices/media/mediaService.cs @@ -122,9 +122,9 @@ namespace umbraco.webservices.media { Authenticate(username, password); - filename = filename.Replace("/", IOHelper.DirSepChar.ToString()); - filename = filename.Replace(@"\", IOHelper.DirSepChar.ToString()); - filename = filename.Substring(filename.LastIndexOf(IOHelper.DirSepChar) + 1, filename.Length - filename.LastIndexOf(IOHelper.DirSepChar) - 1).ToLower(); + filename = filename.Replace("/", global::Umbraco.Core.IO.IOHelper.DirSepChar.ToString()); + filename = filename.Replace(@"\", global::Umbraco.Core.IO.IOHelper.DirSepChar.ToString()); + filename = filename.Substring(filename.LastIndexOf(global::Umbraco.Core.IO.IOHelper.DirSepChar) + 1, filename.Length - filename.LastIndexOf(global::Umbraco.Core.IO.IOHelper.DirSepChar) - 1).ToLower(); Media m = new Media(id); diff --git a/src/umbraco.webservices/umbraco.webservices.csproj b/src/umbraco.webservices/umbraco.webservices.csproj index d3843988c0..443a24042d 100644 --- a/src/umbraco.webservices/umbraco.webservices.csproj +++ b/src/umbraco.webservices/umbraco.webservices.csproj @@ -121,7 +121,7 @@ umbraco.cms - {31785bc3-256c-4613-b2f5-a1b0bdded8c1} + {31785BC3-256C-4613-B2F5-A1B0BDDED8C1} Umbraco.Core