예제 #1
0
		internal void fireItemPasted(ChartObject item)
		{
			switch (item.getType())
			{
				case ItemType.Box:
					if (BoxPasted != null)
					{
						Box box = item as Box;
						BoxEventArgs args = new BoxEventArgs(box);
						BoxPasted(this, args);
					}
					break;
				case ItemType.ControlHost:
					if (ControlHostPasted != null)
					{
						ControlHost host = item as ControlHost;
						ControlHostEventArgs args = new ControlHostEventArgs(host);
						ControlHostPasted(this, args);
					}
					break;
				case ItemType.Table:
					if (TablePasted != null)
					{
						Table table = item as Table;
						TableEventArgs args = new TableEventArgs(table);
						TablePasted(this, args);
					}
					break;
				case ItemType.Arrow:
					if (ArrowPasted != null)
					{
						Arrow arrow = item as Arrow;
						ArrowEventArgs args = new ArrowEventArgs(arrow);
						ArrowPasted(this, args);
					}
					break;
			}
		}
예제 #2
0
        private void flowChart1_BoxDeleted(object sender, BoxEventArgs e)
        {
            Box box = e.Box;
            if (MainFormExt.StartElements.Contains(box))
            {
                //for (int i = MainFormExt.StartElements.IndexOf(box) + 1; i < MainFormExt.StartElements.Count; i++)
                //{
                //    MainFormExt.StartElements[i].Text ="S"+ (Convert.ToInt32(MainFormExt.StartElements[i].Text.Remove(0,1)) - 1).ToString();
                //}
                MainFormExt.StartElements.Remove(box);
            }
            else if (MainFormExt.EndElements.Contains(box))
            {

                //for (int i = MainFormExt.EndElements.IndexOf(box)+1; i < MainFormExt.EndElements.Count; i++)
                //{
                //    MainFormExt.EndElements[i].Text ="E"+ (Convert.ToInt32(MainFormExt.EndElements[i].Text.Remove(0, 1)) - 1).ToString();
                //}
                MainFormExt.EndElements.Remove(box);
            }
            else if(MainFormExt.ConnectorElements.Contains(box))
            {
                //for (int i = MainFormExt.ConnectorElements.IndexOf(box) + 1; i < MainFormExt.ConnectorElements.Count; i++)
                //{
                //    MainFormExt.ConnectorElements[i].Text ="C"+ (Convert.ToInt32(MainFormExt.ConnectorElements[i].Text.Remove(0, 1)) - 1).ToString();
                //}
                MainFormExt.ConnectorElements.Remove(box);
            }
            else if (MainFormExt.ComponentElements.Contains(box))
            {
                //for (int i = MainFormExt.ComponentElements.IndexOf(box) + 1; i < MainFormExt.ComponentElements.Count; i++)
                //{
                //    MainFormExt.ComponentElements[i].Text = (Convert.ToInt32(MainFormExt.ComponentElements[i].Text) - 1).ToString();
                //}
                MainFormExt.ComponentElements.Remove(box);
            }
        }
예제 #3
0
		internal void raiseInitEvent(ChartObject item)
		{
			switch (item.getType())
			{
			case ItemType.Box:
				if (InitializeBox != null)
				{
					BoxEventArgs args = new BoxEventArgs(item as Box);
					InitializeBox(this, args);
				}
				break;
			case ItemType.ControlHost:
				if (InitializeControlHost != null)
				{
					ControlHostEventArgs args = new ControlHostEventArgs(item as ControlHost);
					InitializeControlHost(this, args);
				}
				break;
			case ItemType.Table:
				if (InitializeTable != null)
				{
					TableEventArgs args = new TableEventArgs(item as Table);
					InitializeTable(this, args);
				}
				break;
			case ItemType.Arrow:
				if (InitializeArrow != null)
				{
					ArrowEventArgs args = new ArrowEventArgs(item as Arrow);
					InitializeArrow(this, args);
				}
				break;
			}
		}
예제 #4
0
파일: Ruler.cs 프로젝트: ChrisMoreton/Test3
		private void OnDocumentBoxDeleted(object sender, BoxEventArgs e)
		{
			RefreshScales();
		}