[extensions]
hgext.convert=
hg convert http://fluent-nhibernate.googlecode.com/svn/trunk/
Some .NET programming stuff I couldn't find anywhere else on Google.
[extensions]
hgext.convert=
hg convert http://fluent-nhibernate.googlecode.com/svn/trunk/
<namespaces>
<add namespace="System.Web.Mvc"/>
<add namespace="System.Web.Mvc.Ajax"/>
<add namespace="System.Web.Mvc.Html"/>
<add namespace="System.Web.Routing"/>
<add namespace="System.Linq"/>
<add namespace="System.Collections.Generic"/></namespaces>
<add name="RegisterRoutesModule" type="RegisterRoutesModule"/>
<add assembly="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<%@ WebHandler Language="C#" Class="mvc" %>
using System.Web;
using System.Web.Mvc;
public class mvc : MvcHttpHandler
{
protected override void ProcessRequest(HttpContext httpContext)
{
string originalPath = httpContext.Request.Path;
string newPath = httpContext.Request.QueryString["mvcRoute"];
if (string.IsNullOrEmpty(newPath))
newPath = "/";
HttpContext.Current.RewritePath(newPath, false);
base.ProcessRequest(HttpContext.Current);
HttpContext.Current.RewritePath(originalPath, false);
}
}
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
public class RegisterRoutesModule : IHttpModule
{
public void Init(HttpApplication application)
{
RegisterRoutes(RouteTable.Routes);
}
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default",
"{controller}.aspx/{action}/{id}",
new { action = "Index", id = "" }
);
routes.MapRoute(
"Root",
"",
new { controller = "Home", action = "Index", id = "" }
);
}
public void Dispose()
{
}
}
<add name="MVC_Home_Rewrite"
virtualUrl="^~/Home.aspx/(.*)"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="~/mvc.ashx?mvcRoute=/Home.aspx/$1"
ignoreCase="true" />
<add name="MVC_Account_Rewrite"
virtualUrl="^~/Account.aspx/(.*)"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="~/mvc.ashx?mvcRoute=/Account.aspx/$1"
ignoreCase="true" />
var myNode = new Document(id);Unpublish
myNode.Publish(umbraco.helper.GetCurrentUmbracoUser());
umbraco.library.UpdateDocumentCache(myNode.Id);
var myNode = new Document(id);Delete
myNode.UnPublish();
umbraco.library.UnPublishSingleNode(myNode.Id);
var myNode = new Document(id);Rename
myNode.delete();
umbraco.library.RefreshContent();
var myNode = new Document(id);
var versions = myNode.GetVersions();
if (versions != null && versions.Length > 1)
{
var previousVersion = versions[versions.Length - 2];
if (myNode.Text != previousVersion.Text)
{
// This is a rename, as an example I will just make sure the new name is lower case...
myNode.Text = myNode.Text.ToLower();
if (myNode.Published)
{
myNode.Publish(umbraco.helper.GetCurrentUmbracoUser());
umbraco.library.UpdateDocumentCache(myNode.Id);
}
}
}
public IAction[] ReturnActions()
{
return new IAction[] {
ActionPublish.Instance,
ActionDelete.Instance,
ActionUnPublish.Instance,
ActionUpdate.Instance
};
}