Ejemplo n.º 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();
		}
Ejemplo n.º 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);
			}
		}
Ejemplo n.º 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);
			}
		}
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 7
0
 public void BindBaseList(System.Web.UI.WebControls.BaseDataList bdl_object, DataTable dt)
 {
     bdl_object.DataSource = dt;
     bdl_object.DataBind();
 }
Ejemplo n.º 8
0
 public void BindBaseList(System.Web.UI.WebControls.BaseDataList bdl_object, DataSet ds, string tbName)
 {
     bdl_object.DataSource = ds.Tables[tbName];
     bdl_object.DataBind();
 }
Ejemplo n.º 9
0
		protected void GHTBuildUnboundSampleDataList(BaseDataList ctl)
		{
			DataList lst = (DataList)ctl;
			lst.ItemTemplate = new MyItemTemplate();
		}			  
Ejemplo n.º 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);
		}
Ejemplo n.º 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();

		}
Ejemplo n.º 12
0
		protected void GHTBuildSampleDataList(BaseDataList ctl)
		{
			DataList lst = (DataList)ctl;
			lst.ItemTemplate = new MyItemTemplate();
			lst.DataSource = GHTGetSampleDataSource();
			lst.DataBind();
		}