예제 #1
0
        //Layout Preis
        public static int DefaultPreis(this LayoutUnitType layoutType)
        {
            FieldInfo fieldInfo = layoutType.GetType().GetField(layoutType.ToString());

            DefaultPreisValueAttribute[] attrs =
                fieldInfo.GetCustomAttributes(typeof(DefaultPreisValueAttribute), false) as DefaultPreisValueAttribute[];

            return(attrs.Length > 0 ? attrs[0].DefaultPreisValue : 0);
        }
예제 #2
0
파일: Row.cs 프로젝트: Zebra/iFactr-iOS
        /// <summary>
        /// Initializes a new instance of the <see cref="iFactr.UI.Row"/> structure.
        /// </summary>
        /// <param name="height">The height of the row, expressed in units specified by <paramref name="unitType"/>.</param>
        /// <param name="unitType">The type of unit that the <paramref name="height"/> value represents.</param>
        /// <exception cref="ArgumentOutOfRangeException">Thrown when <paramref name="height"/> is less than zero.</exception>
        public Row(double height, LayoutUnitType unitType)
        {
            if (height < 0 && unitType != LayoutUnitType.Auto)
            {
                throw new ArgumentOutOfRangeException("height", "Value must be no less than 0 when using Star or Absolute unit types.");
            }

            ActualHeight = 0;
            Height       = height;
            UnitType     = unitType;
        }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="iFactr.UI.Column"/> structure.
        /// </summary>
        /// <param name="width">The width of the column, expressed in units specified by <paramref name="unitType"/>.</param>
        /// <param name="unitType">The type of unit that the <paramref name="width"/> value represents.</param>
        /// <exception cref="ArgumentOutOfRangeException">Thrown when <paramref name="width"/> is less than 0.</exception>
        public Column(double width, LayoutUnitType unitType)
        {
            if (width < 0 && unitType != LayoutUnitType.Auto)
            {
                throw new ArgumentOutOfRangeException("width", "Value must be no less than 0 when using Star or Absolute unit types.");
            }

            ActualWidth = 0;
            Width       = width;
            UnitType    = unitType;
        }
예제 #4
0
 public LayoutUnit(LayoutUnitType type, bool isnachkauf = false, int nachkaufpreis = 500000) : this()
 {
     this.Type              = type;
     this.Name              = Type.ToString();
     this.IsNachKauf        = isnachkauf;
     this.NachkaufUnitPreis = nachkaufpreis;
     this.UnitPreis         = Type.DefaultPreis() + UnitPreisChange + (IsNachKauf ? 1 : 0) * NachkaufUnitPreis;
     this.EndKosten         = UnitPreis + SaeulenKosten;
     //Set Saulen()  // Todo
     //this.AvailableUnit = GetAvailableUnit(LayoutStatus);
     //this.AvailableArea = AvailableUnit * UnitArea;
 }
예제 #5
0
파일: Row.cs 프로젝트: Zebra/iFactr-iOS
 internal Row(Row row, double actualHeight)
 {
     ActualHeight = actualHeight;
     Height       = row.Height;
     UnitType     = row.UnitType;
 }
예제 #6
0
파일: Row.cs 프로젝트: Zebra/iFactr-iOS
 /// <summary>
 /// Inserts a <see cref="iFactr.UI.Row"/> object into the collection at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which the item should be inserted.</param>
 /// <param name="height">The height of the row, expressed in units specified by <paramref name="unitType"/>.</param>
 /// <param name="unitType">The type of unit that the <paramref name="height"/> value represents.</param>
 public void Insert(int index, double height, LayoutUnitType unitType)
 {
     Insert(index, new Row(height, unitType));
 }
예제 #7
0
파일: Row.cs 프로젝트: Zebra/iFactr-iOS
 /// <summary>
 /// Adds a <see cref="iFactr.UI.Row"/> object to the end of the collection.
 /// </summary>
 /// <param name="height">The height of the row, expressed in units specified by <paramref name="unitType"/>.</param>
 /// <param name="unitType">The type of unit that the <paramref name="height"/> value represents.</param>
 public void Add(double height, LayoutUnitType unitType)
 {
     Add(new Row(height, unitType));
 }
예제 #8
0
 internal Column(Column column, double actualWidth)
 {
     ActualWidth = actualWidth;
     Width       = column.Width;
     UnitType    = column.UnitType;
 }
예제 #9
0
 /// <summary>
 /// Inserts a <see cref="iFactr.UI.Column"/> object into the collection at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which the item should be inserted.</param>
 /// <param name="width">The width of the column, expressed in units specified by <paramref name="unitType"/>.</param>
 /// <param name="unitType">The type of unit that the <paramref name="width"/> value represents.</param>
 public void Insert(int index, double width, LayoutUnitType unitType)
 {
     Insert(index, new Column(width, unitType));
 }
예제 #10
0
 /// <summary>
 /// Adds a <see cref="iFactr.UI.Column"/> object to the end of the collection.
 /// </summary>
 /// <param name="width">The width of the column, expressed in units specified by <paramref name="unitType"/>.</param>
 /// <param name="unitType">The type of unit that the <paramref name="width"/> value represents.</param>
 public void Add(double width, LayoutUnitType unitType)
 {
     Add(new Column(width, unitType));
 }