Пример #1
0
        public GridControl(int width, int height, ArrayList column_items, int scrollbarmode)
        {
            this.ChooseItem      = null;
            this.DoubleClickItem = null;
            base.Width           = width;
            base.Height          = height;
            int num     = height - 20;
            int expr_2C = num;

            this.GridCore = new GridControlCore(width, expr_2C, expr_2C, scrollbarmode);
            Point location = new Point(0, 20);

            this.GridCore.Location = location;
            IEnumerator enumerator = column_items.GetEnumerator();
            float       proportion = 1f / (float)column_items.Count;

            if (enumerator.MoveNext())
            {
                do
                {
                    ColumnItem columnItem = enumerator.Current as ColumnItem;
                    ColumnData columnData = new ColumnData(columnItem.Name, (int)((double)columnItem.MinWidth));
                    columnData.Proportion = proportion;
                    this.ColumnDatas.Add(columnData);
                }while (enumerator.MoveNext());
            }
            this.GridHeader        = new HeaderControl(this.GridCore);
            this.GridHeader.Width  = this.GridCore.GetViewControlWidth();
            this.GridHeader.Height = 20;
            this.GridHeader.RecalcColumnDatas();
            this.OwnControls.Add(this.GridHeader);
            this.OwnControls.Add(this.GridCore);
            this.GridCore.ChooseItem      += new GridControlCore.__Delegate_ChooseItem(this.GridCoreChooseItem);
            this.GridCore.DoubleClickItem += new GridControlCore.__Delegate_DoubleClickItem(this.GridCoreDoubleClickItem);
        }
Пример #2
0
        public unsafe PropertyTree(int descriptionlines, NewAssetPicker.ObjectType objecttype, NPropertyClipboard *clipboard)
        {
            this.ItemChanged          = null;
            this.SelectedIndexChanged = null;
            this.TrackSelected        = null;
            Color backColor = Color.FromKnownColor(KnownColor.Window);

            this.BackColor           = backColor;
            this.PropTreeDescription = new Label();
            Color backColor2 = Color.FromKnownColor(KnownColor.Control);

            this.PropTreeDescription.BackColor = backColor2;
            Color foreColor = Color.FromKnownColor(KnownColor.ControlText);

            this.PropTreeDescription.ForeColor   = foreColor;
            this.PropTreeDescription.BorderStyle = BorderStyle.Fixed3D;
            this.PropTreeDescription.Width       = base.Width;
            this.PropTreeDescription.Height      = (this.Font.Height + 2) * descriptionlines;
            this.PropTreeDescription.Dock        = DockStyle.Bottom;
            this.PropTreeCore = new PropertyTreeCore(base.Width, base.Height, base.Height, 2, this.PropTreeDescription, objecttype, clipboard);
            Point location = new Point(0, 20);

            this.PropTreeCore.Location = location;
            ArrayList arrayList = new ArrayList();

            arrayList.Add(new ColumnItem(new string((sbyte *)(& < Module >.?? _C@_07CKMABNOK@Setting?$AA@)), 90));
            arrayList.Add(new ColumnItem(new string((sbyte *)(& < Module >.?? _C@_05LPIJGKJ@Value?$AA@)), 70));
            IEnumerator enumerator = arrayList.GetEnumerator();
            float       proportion = 1f / (float)arrayList.Count;

            if (enumerator.MoveNext())
            {
                do
                {
                    ColumnItem columnItem = enumerator.Current as ColumnItem;
                    ColumnData columnData = new ColumnData(columnItem.Name, (int)((double)columnItem.MinWidth));
                    columnData.Proportion = proportion;
                    this.ColumnDatas.Add(columnData);
                }while (enumerator.MoveNext());
            }
            this.PropTreeHeader        = new HeaderControl(this.PropTreeCore);
            this.PropTreeHeader.Width  = this.PropTreeCore.GetViewControlWidth();
            this.PropTreeHeader.Height = 20;
            this.PropTreeCorner        = new Control();
            Point location2 = new Point(this.PropTreeHeader.Width, 0);

            this.PropTreeCorner.Location = location2;
            this.PropTreeCorner.Width    = base.Width - this.PropTreeHeader.Width;
            this.PropTreeCorner.Height   = 20;
            Color backColor3 = Color.FromKnownColor(KnownColor.Control);

            this.PropTreeCorner.BackColor = backColor3;
            int num = base.Height - this.PropTreeHeader.Height;

            this.PropTreeCore.Height = num - this.PropTreeDescription.Height;
            this.PropTreeHeader.RecalcColumnDatas();
            this.PropTreeHeader.Refresh();
            this.PropTreeCore.Refresh();
            this.OwnControls.Add(this.PropTreeHeader);
            this.OwnControls.Add(this.PropTreeCorner);
            this.OwnControls.Add(this.PropTreeCore);
            this.OwnControls.Add(this.PropTreeDescription);
            this.PropTreeCore.ItemChanged          += new PropertyTreeCore.__Delegate_ItemChanged(this.PropTreeCore_ItemChanged);
            this.PropTreeCore.SelectedIndexChanged += new PropertyTreeCore.__Delegate_SelectedIndexChanged(this.PropTreeCore_SelectedIndexChanged);
            this.PropTreeCore.TrackSelected        += new PropertyTreeCore.TrackSelectedHandler(this.PropTreeCore_TrackSelected);
        }