예제 #1
0
		private void TestControls(BaseDataList ctl)
		{
			this.GHTSubTestBegin("BaseDataList_" + ctl.GetType().Name + "_Controls1");
			base.GHTActiveSubTest.Controls.Add(ctl);
			try
			{
				ControlCollection collection1 = ctl.Controls;
			}
			catch (Exception exception2)
			{
				this.GHTSubTestUnexpectedExceptionCaught(exception2);
			}
			this.GHTSubTestEnd();
		}
예제 #2
0
		private void TestCellSpacingError(BaseDataList ctl, GHTSubTest SubTest, int CellSpacing)
		{
			try
			{
				base.GHTActiveSubTest = SubTest;
				ctl.DataBind();
				ctl.DataSource = GHTDataListBase.GHTGetSampleDataSource();
				ctl.CellSpacing = CellSpacing;
				this.GHTSubTestExpectedExceptionNotCaught("ArgumentException");
			}
			catch (ArgumentException exception3)
			{
				this.GHTSubTestExpectedExceptionCaught(exception3);
			}
			catch (Exception exception4)
			{
				this.GHTSubTestUnexpectedExceptionCaught(exception4);
			}
		}
예제 #3
0
		private void TestCellSpacing(BaseDataList ctl, GHTSubTest SubTest, int CellSpacing)
		{
			try
			{
				base.GHTActiveSubTest = SubTest;
				ctl.DataSource = GHTDataListBase.GHTGetSampleDataSource();
				ctl.DataBind();
				ctl.CellSpacing = CellSpacing;
			}
			catch (Exception exception2)
			{
				this.GHTSubTestUnexpectedExceptionCaught(exception2);
			}
		}
예제 #4
0
        private void PrepareUserList(ICollection<KeyValuePair<string, double>> topUsers, 
            BaseDataList dlTopUsers)
        {
            var dtTopUsers = new DataTable();
            dtTopUsers.Columns.Add("Username");
            dtTopUsers.Columns.Add("ImageId", typeof(int));
            dtTopUsers.Columns.Add("Rating", typeof(double));
            if (topUsers != null && topUsers.Count > 0)
            {
                foreach (var topUser in topUsers)
                {
                    int imageId;
                    try
                    {
                        imageId = Photo.GetPrimary(topUser.Key).Id;
                    }
                    catch (NotFoundException)
                    {
                        imageId = ImageHandler.GetPhotoIdByGender(Gender);
                    }

                    dtTopUsers.Rows.Add(
                        new object[]
                            {
                                topUser.Key, imageId
                            });
                }
            }

            dlTopUsers.DataSource = dtTopUsers;
            dlTopUsers.DataBind();
        }
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if ((base.Component != null) && (base.Component.Site != null))
         {
             if (base.RootDesigner != null)
             {
                 base.RootDesigner.LoadComplete -= new EventHandler(this.OnDesignerLoadComplete);
             }
             IComponentChangeService service = (IComponentChangeService) base.Component.Site.GetService(typeof(IComponentChangeService));
             if (service != null)
             {
                 service.ComponentAdded -= new ComponentEventHandler(this.OnComponentAdded);
                 service.ComponentRemoving -= new ComponentEventHandler(this.OnComponentRemoving);
                 service.ComponentRemoved -= new ComponentEventHandler(this.OnComponentRemoved);
                 service.ComponentChanged -= new ComponentChangedEventHandler(this.OnAnyComponentChanged);
             }
         }
         this.bdl = null;
         if (this._dataSourceDesigner != null)
         {
             this._dataSourceDesigner.DataSourceChanged -= new EventHandler(this.DataSourceChanged);
             this._dataSourceDesigner.SchemaRefreshed -= new EventHandler(this.SchemaRefreshed);
             this._dataSourceDesigner = null;
         }
     }
     base.Dispose(disposing);
 }
 public override void Initialize(IComponent component)
 {
     ControlDesigner.VerifyInitializeArgument(component, typeof(BaseDataList));
     this.bdl = (BaseDataList) component;
     base.Initialize(component);
     base.SetViewFlags(ViewFlags.DesignTimeHtmlRequiresLoadComplete, true);
     if (base.RootDesigner != null)
     {
         if (base.RootDesigner.IsLoading)
         {
             base.RootDesigner.LoadComplete += new EventHandler(this.OnDesignerLoadComplete);
         }
         else
         {
             this.OnDesignerLoadComplete(null, EventArgs.Empty);
         }
     }
     IComponentChangeService service = (IComponentChangeService) component.Site.GetService(typeof(IComponentChangeService));
     if (service != null)
     {
         service.ComponentAdded += new ComponentEventHandler(this.OnComponentAdded);
         service.ComponentRemoving += new ComponentEventHandler(this.OnComponentRemoving);
         service.ComponentRemoved += new ComponentEventHandler(this.OnComponentRemoved);
         service.ComponentChanged += new ComponentChangedEventHandler(this.OnAnyComponentChanged);
     }
 }
예제 #7
0
파일: CSharpControl.cs 프로젝트: ridgew/fmq
 public void BindBaseList(System.Web.UI.WebControls.BaseDataList bdl_object, DataTable dt)
 {
     bdl_object.DataSource = dt;
     bdl_object.DataBind();
 }
예제 #8
0
파일: CSharpControl.cs 프로젝트: ridgew/fmq
 public void BindBaseList(System.Web.UI.WebControls.BaseDataList bdl_object, DataSet ds, string tbName)
 {
     bdl_object.DataSource = ds.Tables[tbName];
     bdl_object.DataBind();
 }
예제 #9
0
		protected void GHTBuildUnboundSampleDataList(BaseDataList ctl)
		{
			DataList lst = (DataList)ctl;
			lst.ItemTemplate = new MyItemTemplate();
		}			  
예제 #10
0
		// helper utility to create a new sub test
		private void GHTDataListSubTestBegin(Type ctrlType, string description)
		{
			mActiveDataList = (BaseDataList)GHTElementClone(ctrlType);
			GHTSubTestBegin(description);
			GHTActiveSubTest.Controls.Add(mActiveDataList);
		}
예제 #11
0
		protected void GHTBuildSampleDataGrid(BaseDataList ctl)
		{
			DataGrid grid = (DataGrid)ctl;
			BoundColumn col = new BoundColumn();
			col.DataField = "colA";
			grid.Columns.Add(col);

			col = new BoundColumn();
			col.DataField = "colB";
			grid.Columns.Add(col);

			col = new BoundColumn();
			col.DataField = "colC";
			grid.Columns.Add(col);

			grid.AutoGenerateColumns =false;
			col = new BoundColumn();
			grid.DataSource = GHTGetSampleDataSource();
			grid.DataBind();

		}
예제 #12
0
		protected void GHTBuildSampleDataList(BaseDataList ctl)
		{
			DataList lst = (DataList)ctl;
			lst.ItemTemplate = new MyItemTemplate();
			lst.DataSource = GHTGetSampleDataSource();
			lst.DataBind();
		}