SetEditValue() public method

Sets the value ( as either Page.Guid,PageRoute.Guid or just Page.Guid if not specific to a route )
public SetEditValue ( System control, ConfigurationValue>.Dictionary configurationValues, string value ) : void
control System The control.
configurationValues ConfigurationValue>.Dictionary The configuration values.
value string The value.
return void
        /// <summary>
        /// Shows the settings.
        /// </summary>
        protected override void ShowSettings()
        {
            pnlEditModal.Visible = true;
            upnlContent.Update();
            mdEdit.Show();

            var rockContext = new RockContext();
            ddlChannel.DataSource = new ContentChannelService( rockContext ).Queryable()
                .OrderBy( c => c.Name )
                .Select( c => new { c.Guid, c.Name } )
                .ToList();
            ddlChannel.DataBind();
            ddlChannel.Items.Insert( 0, new ListItem( "", "" ) );
            ddlChannel.SetValue( GetAttributeValue( "Channel" ) );
            ChannelGuid = ddlChannel.SelectedValue.AsGuidOrNull();

            foreach ( string status in GetAttributeValue( "Status" ).SplitDelimitedValues() )
            {
                var li = cblStatus.Items.FindByValue( status );
                if ( li != null )
                {
                    li.Selected = true;
                }
            }

            cbDebug.Checked = GetAttributeValue( "EnableDebug" ).AsBoolean();
            cbMergeContent.Checked = GetAttributeValue( "MergeContent" ).AsBoolean();
            cbSetRssAutodiscover.Checked = GetAttributeValue( "RssAutodiscover" ).AsBoolean();
            cbSetPageTitle.Checked = GetAttributeValue( "SetPageTitle" ).AsBoolean();
            ceTemplate.Text = GetAttributeValue( "Template" );
            nbCount.Text = GetAttributeValue( "Count" );
            nbCacheDuration.Text = GetAttributeValue( "CacheDuration" );
            hfDataFilterId.Value = GetAttributeValue( "FilterId" );
            cbQueryParamFiltering.Checked = GetAttributeValue( "QueryParameterFiltering" ).AsBoolean();

            var ppFieldType = new PageReferenceFieldType();
            ppFieldType.SetEditValue( ppDetailPage, null, GetAttributeValue( "DetailPage" ) );

            var directions = new Dictionary<string, string>();
            directions.Add( "", "" );
            directions.Add( SortDirection.Ascending.ConvertToInt().ToString(), "Ascending" );
            directions.Add( SortDirection.Descending.ConvertToInt().ToString(), "Descending" );
            kvlOrder.CustomValues = directions;
            kvlOrder.Value = GetAttributeValue( "Order" );
            kvlOrder.Required = true;


            ShowEdit();

            upnlContent.Update();
        }
Beispiel #2
0
        /// <summary>
        /// Shows the settings.
        /// </summary>
        protected override void ShowSettings()
        {
            pnlEditModal.Visible = true;
            upnlContent.Update();
            mdEdit.Show();

            var rockContext = new RockContext();
            var groupTypes = new GroupTypeService( rockContext )
                .Queryable().AsNoTracking().ToList();

            BindGroupType( gtpGroupType, groupTypes, "GroupType" );
            BindGroupType( gtpGeofenceGroupType, groupTypes, "GeofencedGroupType" );

            string scheduleFilters = GetAttributeValue( "ScheduleFilters" );
            if ( !string.IsNullOrEmpty( scheduleFilters ) )
            {
                foreach ( string val in scheduleFilters.SplitDelimitedValues() )
                {
                    var li = cblSchedule.Items.FindByValue( val );
                    if ( li != null )
                    {
                        li.Selected = true;
                    }
                }
            }

            SetGroupTypeOptions();
            foreach ( string attr in GetAttributeValue( "AttributeFilters" ).SplitDelimitedValues() )
            {
                var li = cblAttributes.Items.FindByValue( attr );
                if ( li != null )
                {
                    li.Selected = true;
                }
            }

            cbShowMap.Checked = GetAttributeValue( "ShowMap" ).AsBoolean();
            ddlMapStyle.BindToDefinedType( DefinedTypeCache.Read( Rock.SystemGuid.DefinedType.MAP_STYLES.AsGuid() ) );
            ddlMapStyle.SetValue( GetAttributeValue( "MapStyle" ) );
            nbMapHeight.Text = GetAttributeValue( "MapHeight" );
            cbShowFence.Checked = GetAttributeValue( "ShowFence" ).AsBoolean();
            vlPolygonColors.Value = GetAttributeValue( "PolygonColors" );
            ceMapInfo.Text = GetAttributeValue( "MapInfo" );
            cbMapInfoDebug.Checked = GetAttributeValue( "MapInfoDebug" ).AsBoolean();

            cbShowLavaOutput.Checked = GetAttributeValue( "ShowLavaOutput" ).AsBoolean();
            ceLavaOutput.Text = GetAttributeValue( "LavaOutput" );
            cbLavaOutputDebug.Checked = GetAttributeValue( "LavaOutputDebug" ).AsBoolean();

            cbShowGrid.Checked = GetAttributeValue( "ShowGrid" ).AsBoolean();
            cbShowSchedule.Checked = GetAttributeValue( "ShowSchedule" ).AsBoolean();
            cbShowDescription.Checked = GetAttributeValue( "ShowDescription" ).AsBoolean();
            cbProximity.Checked = GetAttributeValue( "ShowProximity" ).AsBoolean();
            cbSortByDistance.Checked = GetAttributeValue( "SortByDistance" ).AsBoolean();
            tbPageSizes.Text = GetAttributeValue( "PageSizes" );
            cbShowCount.Checked = GetAttributeValue( "ShowCount" ).AsBoolean();
            cbShowAge.Checked = GetAttributeValue( "ShowAge" ).AsBoolean();
            foreach ( string attr in GetAttributeValue( "AttributeColumns" ).SplitDelimitedValues() )
            {
                var li = cblGridAttributes.Items.FindByValue( attr );
                if ( li != null )
                {
                    li.Selected = true;
                }
            }
            var ppFieldType = new PageReferenceFieldType();
            ppFieldType.SetEditValue( ppGroupDetailPage, null, GetAttributeValue( "GroupDetailPage" ) );
            ppFieldType.SetEditValue( ppRegisterPage, null, GetAttributeValue( "RegisterPage" ) );

            upnlContent.Update();
        }
        /// <summary>
        /// Shows the settings.
        /// </summary>
        protected override void ShowSettings()
        {
            cbDisplayProgressBar.Checked = GetAttributeValue( "DisplayProgressBar" ).AsBoolean();
            ddlSaveValues.SetValue( GetAttributeValue( "SaveValues" ) );

            Guid? wtGuid = GetAttributeValue( "Workflow" ).AsGuidOrNull();
            if ( wtGuid.HasValue )
            {
                using ( var rockContext = new RockContext() )
                {
                    wtpWorkflow.SetValue( new WorkflowTypeService( rockContext ).Get( wtGuid.Value ) );
                }
            }
            else
            {
                wtpWorkflow.SetValue( null );
            }

            var ppFieldType = new PageReferenceFieldType();
            ppFieldType.SetEditValue( ppDonePage, null, GetAttributeValue( "DonePage" ) );

            string json = GetAttributeValue( "Forms" );
            if ( string.IsNullOrWhiteSpace( json ) )
            {
                FormState = new List<AttributeForm>();
                FormState.Add( new AttributeForm { Expanded = true } );
            }
            else
            {
                FormState = JsonConvert.DeserializeObject<List<AttributeForm>>( json );
            }

            BuildEditControls( true );

            pnlEdit.Visible = true;
            pnlView.Visible = false;

            _mode = "EDIT";

            upnlContent.Update();
        }