/*
* Box Socialâ„¢
* http://boxsocial.net/
* Copyright © 2007, David Lachlan Smith
*
* $Id:$
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Text.RegularExpressions;
using BoxSocial.IO;
namespace BoxSocial.Internals
{
public sealed class PageHandle : IComparable
{
private AppPrimitives primitives;
private int order;
private string expression;
///
/// The function that gets executed if a match
///
private Core.PageHandler handler;
public AppPrimitives Primitives
{
get
{
return primitives;
}
}
public string Expression
{
get
{
return expression;
}
}
public string MethodName
{
get
{
return handler.Method.Name;
}
}
public PageHandle(AppPrimitives primitives, string expression, Core.PageHandler pageHandle, int order)
{
this.order = order;
this.handler = pageHandle;
this.expression = expression;
this.primitives = primitives;
}
public void Execute(Core core, object sender)
{
this.handler(core, sender);
}
public int CompareTo(object obj)
{
if (!(obj is PageHandle)) return -1;
return order.CompareTo(((PageHandle)obj).order);
}
}
}