Files
Orchard/src/Orchard/Commands/CommandHostEnvironment.cs
Renaud Paquay 768037b659 Tweaking notification messages
--HG--
branch : dev
2010-07-24 15:03:13 -07:00

50 lines
1.6 KiB
C#

using System;
using System.Linq;
using System.Runtime.Serialization;
using System.Web.Hosting;
using Orchard.Environment;
using Orchard.Localization;
namespace Orchard.Commands {
public class OrchardCommandHostRetryException : OrchardCoreException {
public OrchardCommandHostRetryException(LocalizedString message)
: base(message) {
}
public OrchardCommandHostRetryException(LocalizedString message, Exception innerException)
: base(message, innerException) {
}
protected OrchardCommandHostRetryException(SerializationInfo info, StreamingContext context)
: base(info, context) {
}
}
public class CommandHostEnvironment : IHostEnvironment {
public CommandHostEnvironment() {
T = NullLocalizer.Instance;
}
public Localizer T { get; set; }
public bool IsFullTrust {
get { return AppDomain.CurrentDomain.IsFullyTrusted; }
}
public string MapPath(string virtualPath) {
return HostingEnvironment.MapPath(virtualPath);
}
public bool IsAssemblyLoaded(string name) {
return AppDomain.CurrentDomain.GetAssemblies().Any(a => a.GetName().Name == name);
}
public void RestartAppDomain() {
ResetSiteCompilation();
}
public void ResetSiteCompilation() {
throw new OrchardCommandHostRetryException(T("A change of configuration requires the session to be restarted."));
}
}
}