本文整理汇总了C#中IField类的典型用法代码示例。如果您正苦于以下问题:C# IField类的具体用法?C# IField怎么用?C# IField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IField类属于命名空间,在下文中一共展示了IField类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OrderBy
public static SqlQuery OrderBy(this SqlQuery query, IField field, bool desc = false)
{
if (field == null)
throw new ArgumentNullException("field");
return query.OrderBy(field.Expression, desc);
}
示例2: PrintGameField
/// <summary>
/// Prints the game field.
/// </summary>
/// <param name="gameField">The field to be printed.</param>
/// <param name="hasBoomed">check if player has explode</param>
public void PrintGameField(IField gameField, bool hasBoomed)
{
if (gameField == null)
{
throw new ArgumentNullException("Game field is null!");
}
string[,] fieldMatrix = gameField.Matrix;
Console.WriteLine();
Console.WriteLine(" 0 1 2 3 4 5 6 7 8 9");
Console.WriteLine(" ---------------------");
for (int row = 0; row < gameField.Rows; row++)
{
Console.Write("{0} | ", row);
for (int col = 0; col < gameField.Cols; col++)
{
string currentSymbol = fieldMatrix[row, col];
PrintCurrentSymbol(currentSymbol, hasBoomed);
}
Console.WriteLine("|");
}
Console.WriteLine(" ---------------------");
}
示例3: GenericAccountFieldViewModel
public GenericAccountFieldViewModel(IField field)
{
FieldName = field.Name;
FieldValue = field.Value as string;
CopyButtonText = "copy " + FieldName;
IsCopyButtonVisible = true;
}
示例4: GroupBy
public static SqlQuery GroupBy(this SqlQuery query, IField field)
{
if (field == null)
throw new ArgumentNullException("field");
return query.GroupBy(field.Expression);
}
示例5: Criteria
/// <summary>
/// Creates a new criteria that contains field name of the metafield.</summary>
/// <param name="field">
/// Field (required).</param>
public Criteria(IField field)
{
if (field == null)
throw new ArgumentNullException("field");
this.expression = field.Expression;
}
示例6: FieldCondition
public FieldCondition(Range operand, IField field)
: base(operand, field)
{
// Field can't be null when using a range
if (field == null)
throw new ArgumentNullException("field");
}
示例7: AddNewField
private void AddNewField(IField field)
{
var newFields = new IField[_fields.Length + 1];
newFields[_fields.Length] = field;
Array.Copy(_fields, 0, newFields, 0, _fields.Length);
_fields = newFields;
}
示例8: GetDefaultValueForField
public static object GetDefaultValueForField(IRow row, IField fld)
{
object defaultValue = DBNull.Value;
if (!fld.IsNullable)
defaultValue = string.Empty;
if (row != null && fld != null)
{
IClass cls = row.Table;
if (HasSubtype(cls))
{
ISubtypes subTypes = (ISubtypes)cls;
string subTypeFieldName = GetSubTypeFieldName(cls);
if (string.IsNullOrEmpty(subTypeFieldName) == false)
{
object o = GetFieldValue(row, subTypeFieldName);
int subTypeCode = ToInteger(o, -1);
if (subTypeCode != -1)
defaultValue = subTypes.get_DefaultValue(subTypeCode, fld.Name);
}
}
if (defaultValue == DBNull.Value && fld.Type == esriFieldType.esriFieldTypeDate)
defaultValue = fld.DefaultValue;
}
return defaultValue;
}
示例9: GameMechanics
public GameMechanics(IField field, IBlockFactory blockFactory)
{
this.field = field;
this.blockFactory = blockFactory;
this.currentBlock = blockFactory.MakeBlock();
field.SetBlock(currentBlock, new Vector2(0, 0));
}
示例10: CompareTo
public virtual int CompareTo(IField field)
{
int cmp;
cmp = base.CompareTo((IDecoration)field);
if (cmp != 0) {
return cmp;
}
if (FullyQualifiedName != null) {
cmp = FullyQualifiedName.CompareTo(field.FullyQualifiedName);
if (cmp != 0) {
return cmp;
}
}
if (FullyQualifiedName != null) {
cmp = FullyQualifiedName.CompareTo(field.FullyQualifiedName);
if (cmp != 0) {
return cmp;
}
}
if (ReturnType != null) {
cmp = ReturnType.CompareTo(field.ReturnType);
if (cmp != 0) {
return cmp;
}
}
if (Region != null) {
return Region.CompareTo(field.Region);
}
return 0;
}
示例11: AddChildProperties
/// <summary>
/// Adds any child properties that are linked to the field.
/// </summary>
/// <param name="child">The child whose properties are being added.</param>
public override void AddChildProperties(IField child)
{
base.AddChildProperties(child);
// Position the child within the grid.
if (_positions.Columns != null)
{
Tuple<int, int> rowAndColumn = _positions.GetNextRowAndColumn();
int column = rowAndColumn.Item2;
int row = rowAndColumn.Item1;
child.AddTypedProperty("Grid.Column", column);
child.AddTypedProperty("Grid.Row", row);
IList<IProperty> properties = child.Element.Properties.Find("Across");
_positions.MakeItemUsed(row, column);
if (properties != null && properties.Count > 0)
{
IProperty across = properties[0];
if (across != null)
{
int columns = across.IntValue;
for (int i = 1; i < columns; ++i)
_positions.MakeItemUsed(row, column + i);
child.AddTypedProperty("Grid.ColumnSpan", columns);
if (properties.Count > 1)
{
int rows = properties[1].IntValue;
child.AddTypedProperty("Grid.RowSpan", rows);
for (int col = 0; col < columns; ++col)
for (int i = 0; i < rows; ++i)
_positions.MakeItemUsed(row + i, column + col);
}
}
}
}
}
示例12: resolve
public FieldInfo resolve(IField fieldRef)
{
var resolver = getTypeResolver(fieldRef.DeclaringType);
if (resolver != null)
return resolver.resolve(fieldRef);
return resolveGlobalField(fieldRef);
}
示例13: MoveableField
/// <summary>
/// Initializes a new instance of the MoveableField class.
/// </summary>
/// <param name="field"> The field.</param>
/// <param name="movement">(optional) The movement.</param>
public MoveableField(IField field, IMovement movement = null)
{
Validation.ThrowIfNull(field);
this._field = field;
this._movement = movement ?? new BackwardMovement(field);
}
示例14: AlterRasterFieldSR
public static IField AlterRasterFieldSR(IField pField, ISpatialReference sr)
{
IFieldEdit2 pEdit = pField as IFieldEdit2;
IRasterDef pRDef = pEdit.RasterDef;
pRDef.SpatialReference = sr;
return pField;
}
示例15: Validate
public void Validate(IField field)
{
var thisHindrRecMes = new KeyData<Rectangle, string>(
Rect,
"hindrance (" + ToString() + ")");
if (!field.Rect.Contains(thisHindrRecMes.Key))
throw new RectIsNotInsideAnotherRectException(
thisHindrRecMes.Data,
string.Format("field (Panel with Size = ({0}, {1}))", field.Size.Width, field.Size.Height)
);
var anotherRectMes = new KeyData<Rectangle, string>();
foreach (var tank in field.Tanks)
{
anotherRectMes.Key = tank.Rect;
anotherRectMes.Data = "tank (" + tank.ToString() + ")";
rectValidator.Validate(thisHindrRecMes, anotherRectMes);
}
foreach (var hindr in field.Hindrances)
if (ID != hindr.ID)
{
anotherRectMes.Key = hindr.Rect;
anotherRectMes.Data = "hindrance (" + hindr.ToString() + ")";
rectValidator.Validate(thisHindrRecMes, anotherRectMes);
}
}