Beispiel #1
0
        //Fired when a group or top level row is added to the table
        private void TableItems_InsertItem(object sender, TableItemsEventArgs e)
        {
            TableItem item = e.Value;

            //Set common values and event handlers for row or group
            item.SetTable(this);
            item.Backcolor = GradientColor;

            //If is a row then set the indent
            if (item is TableRow)
            {
                item.SetIndent(Indent);
            }

            if (item is TableGroup)
            {
                TableGroup group = (TableGroup)item;
                group.HeightChanged   += new EventHandler(TableGroup_HeightChanged);
                group.ExpandedChanged += new ExpandedChangedEventHandler(TableGroup_ExpandedChanged);

                //Set all the table references correctly
                group.SetTable();
            }

            item.TableItemInvalid += new EventHandler(TableItems_TableItemInvalid);

            SetHeight();

            //Make sure diagram is redrawn
            OnElementInvalid();
        }
Beispiel #2
0
        //Handles events for rows and groups
        private void TableItems_InsertItem(object sender, TableItemsEventArgs e)
        {
            //Check isnt same group
            if (e.Value == this)
            {
                throw new TableItemsException("Cannot add a TableGroup to itself.");
            }

            if (Table != null)
            {
                e.Value.SetTable(Table);
                e.Value.SetIndent(Indent + Table.Indent);
            }
            e.Value.SetParent(this);
            e.Value.TableItemInvalid += new EventHandler(TableItem_TableItemInvalid);

            if (e.Value is TableGroup)
            {
                TableGroup group = (TableGroup)e.Value;

                group.ExpandedChanged += new ExpandedChangedEventHandler(TableGroup_ExpandedChanged);
                group.HeightChanged   += new EventHandler(TableGroup_HeightChanged);
            }

            OnHeightChanged(this, EventArgs.Empty);
            OnTableItemInvalid();
        }
Beispiel #3
0
        private void TableItems_RemoveItem(object sender, TableItemsEventArgs e)
        {
            TableItem item = e.Value;

            //Remove handlers
            if (item is TableGroup)
            {
                TableGroup group = (TableGroup)item;
                group.HeightChanged   -= new EventHandler(TableGroup_HeightChanged);
                group.ExpandedChanged -= new ExpandedChangedEventHandler(TableGroup_ExpandedChanged);
            }
            item.TableItemInvalid -= new EventHandler(TableItems_TableItemInvalid);

            SetHeight();
            OnElementInvalid();
        }
Beispiel #4
0
        private void TableItems_RemoveItem(object sender, TableItemsEventArgs e)
        {
            //Remove handlers
            if (e.Value != null)
            {
                e.Value.TableItemInvalid -= new EventHandler(TableItem_TableItemInvalid);

                if (e.Value is TableGroup)
                {
                    TableGroup group = (TableGroup)e.Value;

                    group.ExpandedChanged -= new ExpandedChangedEventHandler(TableGroup_ExpandedChanged);
                    group.HeightChanged   -= new EventHandler(TableGroup_HeightChanged);
                }
            }

            OnHeightChanged(this, EventArgs.Empty);
            OnTableItemInvalid();
        }
Beispiel #5
0
		private void TableItems_RemoveItem(object sender, TableItemsEventArgs e)
		{
			TableItem item = e.Value;

			//Remove handlers
			if (item is TableGroup)
			{
				TableGroup group = (TableGroup) item;
				group.HeightChanged -=new EventHandler(TableGroup_HeightChanged);
				group.ExpandedChanged -= new ExpandedChangedEventHandler(TableGroup_ExpandedChanged);
			}
			item.TableItemInvalid -=new EventHandler(TableItems_TableItemInvalid);

			SetHeight();
			OnElementInvalid();
		}
Beispiel #6
0
		//Fired when a group or top level row is added to the table
		private void TableItems_InsertItem(object sender, TableItemsEventArgs e)
		{
			TableItem item = e.Value;

			//Set common values and event handlers for row or group
			item.SetTable(this);
			item.Backcolor = GradientColor;

			//If is a row then set the indent
			if (item is TableRow) item.SetIndent(Indent);

			if (item is TableGroup)
			{
				TableGroup group = (TableGroup) item;
				group.HeightChanged +=new EventHandler(TableGroup_HeightChanged);
				group.ExpandedChanged += new ExpandedChangedEventHandler(TableGroup_ExpandedChanged);

				//Set all the table references correctly
				group.SetTable();
			}

			item.TableItemInvalid +=new EventHandler(TableItems_TableItemInvalid);

			SetHeight();

			//Make sure diagram is redrawn
			OnElementInvalid();
		}
		private void TableItems_RemoveItem(object sender, TableItemsEventArgs e)
		{
			//Remove handlers
			if (e.Value != null)
			{
				e.Value.TableItemInvalid -=new EventHandler(TableItem_TableItemInvalid);

				if (e.Value is TableGroup)
				{
					TableGroup group = (TableGroup) e.Value;

					group.ExpandedChanged -=new ExpandedChangedEventHandler(TableGroup_ExpandedChanged);
					group.HeightChanged -=new EventHandler(TableGroup_HeightChanged);
				}
			}

			OnHeightChanged(this, EventArgs.Empty);
			OnTableItemInvalid();
		}
		//Handles events for rows and groups
		private void TableItems_InsertItem(object sender, TableItemsEventArgs e)
		{
			//Check isnt same group
			if (e.Value == this) throw new TableItemsException("Cannot add a TableGroup to itself.");

			e.Value.SetTable(Table);
			e.Value.SetIndent(Indent + Table.Indent);
			e.Value.SetParent(this);
			e.Value.TableItemInvalid +=new EventHandler(TableItem_TableItemInvalid);

			if (e.Value is TableGroup)
			{
				TableGroup group = (TableGroup) e.Value;

				group.ExpandedChanged +=new ExpandedChangedEventHandler(TableGroup_ExpandedChanged);
				group.HeightChanged +=new EventHandler(TableGroup_HeightChanged);
			}
			
			OnHeightChanged(this, EventArgs.Empty);
			OnTableItemInvalid();
		}