treereportarcomboitem.cs

来自「树形逻辑报表程序源码,能根居元数据定义拖拉开发新的报表.」· CS 代码 · 共 63 行

CS
63
字号
using System;
using DataDynamics.ActiveReports;
using System.Collections;

namespace TreeReportApp
{
	/// <summary>
	/// 对报表及控件对象重包装.
	/// </summary>
	public class ARComboItem
	{
		private object item;
		
		public ARComboItem(ActiveReport rpt)
		{
			this.item = rpt;
		}

		public ARComboItem(ARControl ctl)
		{
			this.item = ctl;
		}

		public ARComboItem(DataDynamics.ActiveReports.Section sec)
		{
			this.item = sec;
		}

		public object Item
		{
			get{return item;}
		}
		
		public override string ToString()
		{
			if (this.item is ActiveReport)
			{
				ActiveReport rpt = this.item as ActiveReport;

				return rpt.Document.Name;
			}
			if (this.item is ARControl)
			{
				ARControl ctl = this.item as ARControl;
				return ctl.Name;
			}
			if (this.item is Section)
			{
				Section sec = this.item as Section;
				return sec.Name;
			}
			else 
			{
				return item.ToString();
			}
			

		}


	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?