Inheritance: System.Web.UI.WebControls.CompositeControl, IRockControl
コード例 #1
0
ファイル: DistanceFromFilter.cs プロジェクト: NewSpring/Rock
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            LocationPicker locationPicker = new LocationPicker();
            locationPicker.ID = filterControl.ID + "_0";
            locationPicker.Label = "Location";

            filterControl.Controls.Add( locationPicker );

            NumberBox numberBox = new NumberBox();
            numberBox.ID = filterControl.ID + "_1";
            numberBox.NumberType = ValidationDataType.Double;
            numberBox.Label = "Miles";
            numberBox.AddCssClass( "number-box-miles" );
            filterControl.Controls.Add( numberBox );

            return new Control[2] { locationPicker, numberBox };
        }
コード例 #2
0
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <param name="parentControl"></param>
        /// <returns></returns>
        public override System.Web.UI.Control[] CreateChildControls( System.Web.UI.Control parentControl )
        {
            LocationPicker locationPicker = new LocationPicker();
            locationPicker.ID = parentControl.ID + "_0";
            locationPicker.Label = "Location";
            parentControl.Controls.Add( locationPicker );

            RockDropDownList locationTypeList = new RockDropDownList();
            locationTypeList.Items.Clear();
            foreach ( var value in DefinedTypeCache.Read( Rock.SystemGuid.DefinedType.GROUP_LOCATION_TYPE.AsGuid() ).DefinedValues.OrderBy( a => a.Order ).ThenBy( a => a.Value ) )
            {
                locationTypeList.Items.Add( new ListItem( value.Value, value.Guid.ToString() ) );
            }

            locationTypeList.Items.Insert( 0, Rock.Constants.None.ListItem );

            locationTypeList.ID = parentControl.ID + "_grouplocationType";
            locationTypeList.Label = "Address Type";
            parentControl.Controls.Add( locationTypeList );

            return new System.Web.UI.Control[] { locationPicker, locationTypeList };
        }
コード例 #3
0
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            lp = new LocationPicker();
            lp.ID = filterControl.ID + "_lp";
            lp.Label = "Location";
            lp.AllowedPickerModes = LocationPickerMode.Named | LocationPickerMode.Polygon;
            lp.CurrentPickerMode = lp.GetBestPickerModeForLocation( null );
            filterControl.Controls.Add( lp );

            return new Control[1] { lp };
        }
コード例 #4
0
ファイル: DistanceFromFilter.cs プロジェクト: azturner/Rock
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            RockDropDownList groupLocationTypeList = new RockDropDownList();
            groupLocationTypeList.Items.Clear();
            foreach ( var value in Rock.Web.Cache.DefinedTypeCache.Read( Rock.SystemGuid.DefinedType.GROUP_LOCATION_TYPE.AsGuid() ).DefinedValues.OrderBy( a => a.Order ).ThenBy( a => a.Value ) )
            {
                groupLocationTypeList.Items.Add( new ListItem( value.Value, value.Guid.ToString() ) );
            }

            groupLocationTypeList.Items.Insert( 0, Rock.Constants.None.ListItem );

            groupLocationTypeList.ID = filterControl.ID + "_groupLocationTypeList";
            groupLocationTypeList.Label = "Location Type";
            filterControl.Controls.Add( groupLocationTypeList );

            LocationPicker locationPicker = new LocationPicker();
            locationPicker.ID = filterControl.ID + "_locationPicker";
            locationPicker.Label = "Location";

            filterControl.Controls.Add( locationPicker );

            NumberBox numberBox = new NumberBox();
            numberBox.ID = filterControl.ID + "_numberBox";
            numberBox.NumberType = ValidationDataType.Double;
            numberBox.Label = "Miles";
            numberBox.AddCssClass( "number-box-miles" );
            filterControl.Controls.Add( numberBox );

            return new Control[3] { groupLocationTypeList, locationPicker, numberBox };
        }