System.Web.DynamicData.DynamicDataExtensions.FindMetaTable C# (CSharp) Method

FindMetaTable() public static method

public static FindMetaTable ( this current ) : System.Web.DynamicData.MetaTable
current this
return System.Web.DynamicData.MetaTable
		public static MetaTable FindMetaTable (this Control current)
		{
			// .NET doesn't perform the check, we will
			if (current == null)
				throw new NullReferenceException ();

			while (current != null) {
				DataBoundControl dbc = current as DataBoundControl;
				if (dbc != null) {
					IDynamicDataSource dds = dbc.DataSourceObject as IDynamicDataSource;
					if (dds != null)
						return dds.GetTable ();
				}

				current = current.NamingContainer;
			}

			return null;
		}