|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
namespace DBOMSqlSharp
{
public class SqlUnary : SqlExpression
{
SqlExpression expression;
protected SqlUnary()
: base()
{
}
protected SqlUnary(SqlExpression expression)
: this()
{
this.expression = expression;
}
public override object Clone()
{
SqlUnary unary = (SqlUnary)this.MemberwiseClone();
return unary;
}
public override bool Equals(BaseSqlObject other)
{
bool b = base.Equals(other);
SqlUnary o = (SqlUnary)other;
return b
&& SqlComparer.EqualObjects(this.Expression, o.Expression);
}
public SqlExpression Expression
{
get
{
return this.expression;
}
}
public virtual string Operator
{
get
{
throw new NotImplementedException();
}
}
public override List<SqlParameter> SqlParameters
{
get
{
return BaseSqlObject.SqlParametersOf(this.Expression);
}
}
public override SqlTreeNode SqlNode
{
get
{
SqlTreeNode n = new SqlTreeNode(null, this);
this.Nodes.Add(n);
n.AddChild(this.Expression.SqlNode);
return n;
}
}
public override string SqlString
{
get
{
this.OnSqlStringIn(this, EventArgs.Empty);
string s = this.Operator + this.Expression.SqlString;
this.OnSqlStringOut(this, EventArgs.Empty);
return s;
}
}
public override string HtmlString
{
get
{
return "";
}
}
}
public class SqlPositive : SqlUnary
{
public SqlPositive(SqlExpression expression)
: base(expression)
{
}
public override string Operator
{
get
{
return "+";
}
}
}
public class SqlNegative : SqlUnary
{
public SqlNegative(SqlExpression expression)
: base(expression)
{
}
public override string Operator
{
get
{
return "-";
}
}
}
public class SqlBitNot : SqlUnary
{
public SqlBitNot(SqlExpression expression)
: base(expression)
{
}
public override string Operator
{
get
{
return "~";
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.