Beispiel #1
0
 public SimSelection(string title, ICollection <SimDescription> sims, ObjectPickerDialogEx.CommonHeaderInfo <SimDescription> auxillary)
     : base(title, null, sims, true, false)
 {
     if (auxillary != null)
     {
         AddColumn(auxillary);
     }
 }
Beispiel #2
0
 public void ReplaceColumn(ObjectPickerDialogEx.CommonHeaderInfo <T> oldColumn, ObjectPickerDialogEx.CommonHeaderInfo <T> newColumn)
 {
     for (int i = 0; i < mColumns.Count; i++)
     {
         if (mColumns[i] == oldColumn)
         {
             mColumns[i] = newColumn;
             break;
         }
     }
 }
Beispiel #3
0
        private SimSelection(string title, IMiniSimDescription me, SimFromList simsFromList, ICollection <IMiniSimDescription> sims, bool lastFirst, bool addAll)
            : base(title, me, sims, lastFirst, addAll)
        {
            mSimFromList = simsFromList;

            ObjectPickerDialogEx.CommonHeaderInfo <IMiniSimDescription> column = null;

            if (mSimFromList != null)
            {
                column = mSimFromList.GetAuxillaryColumn();
            }

            if (column == null)
            {
                column = new SimAgeColumn();
            }

            AddColumn(column);
        }
Beispiel #4
0
 private QualitySelection(string title, ICollection <Item> items, ObjectPickerDialogEx.CommonHeaderInfo <Item> auxillary)
     : base(title, null, items, auxillary)
 {
 }
Beispiel #5
0
 protected void AddColumn(ObjectPickerDialogEx.CommonHeaderInfo <T> column)
 {
     mColumns.Add(column);
 }
Beispiel #6
0
        public CommonSelection(string title, string subTitle, ICollection <T> items, int widthDelta, ObjectPickerDialogEx.CommonHeaderInfo <T> auxillary)
            : base(title, subTitle, items)
        {
            int valueWidth = 40;

            bool hasSize = false;

            int digits = 1;

            bool useThumbnail = false, useCount = false, useValue = false, useBoolean = false, dontUseBoolean = false;

            foreach (T item in items)
            {
                if (item == null)
                {
                    AllOnNull = true;
                    continue;
                }

                if (string.IsNullOrEmpty(item.Name))
                {
                    continue;
                }

                if (item.Thumbnail != ThumbnailKey.kInvalidThumbnailKey)
                {
                    useThumbnail = true;
                }

                if (item.DisplayValue != null)
                {
                    useValue = true;
                }

                if (item.UsingCount)
                {
                    useCount = true;

                    digits = Math.Max(digits, item.Count.ToString().Length);

                    if (item.Count > 1)
                    {
                        dontUseBoolean = true;
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(item.DisplayKey))
                        {
                            useBoolean = true;
                        }
                    }
                }

                if (item.ValueWidth > 0)
                {
                    valueWidth = item.ValueWidth;
                }

                hasSize = true;
            }

            if (dontUseBoolean)
            {
                useBoolean = false;
            }

            if (!hasSize)
            {
                mItems = null;
            }

            int nameWidth = DefaultNameWidth - widthDelta;

            if ((useBoolean) || (useCount) || (useValue))
            {
                nameWidth -= valueWidth;
            }

            if (auxillary != null)
            {
                nameWidth -= auxillary.Width;
            }

            AddColumn(new NameColumn(useThumbnail, nameWidth));

            if (auxillary != null)
            {
                AddColumn(auxillary);
            }

            if (useBoolean)
            {
                AddColumn(new BooleanColumn(valueWidth));
            }
            else if (useCount)
            {
                AddColumn(new CountColumn(digits, valueWidth));
            }
            else if (useValue)
            {
                AddColumn(new ValueColumn(valueWidth));
            }
        }
Beispiel #7
0
 public CommonSelection(string title, string subTitle, ICollection <T> items, ObjectPickerDialogEx.CommonHeaderInfo <T> auxillary)
     : this(title, subTitle, items, 0, auxillary)
 {
 }