Exemplo n.º 1
0
    private void LoadTargetContentConfiguration(WidgetData targetContentWidget)
    {
        TargetedContent tcManager = new TargetedContent(_contentApi.RequestInformationRef);
        TargetedContentData targetContentData =
            (_targetContentId > 0 ? tcManager.GetItem(_targetContentId) : new TargetedContentData());

        if (_targetContentId == 0)
        {
            targetContentData.PageData = PageData.Restore(string.Format("<PageData xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"PB\"><IsMasterLayout>false</IsMasterLayout><masterID>0</masterID><pageID>0</pageID><languageID>0</languageID><Zones><DropZoneData><isMasterZone>false</isMasterZone><Columns><ColumnData><Guid>{0}</Guid><Display>false</Display><columnID>-1</columnID><width>100</width><unit>percent</unit></ColumnData></Columns></DropZoneData></Zones><Widgets /></PageData>", _columnGuid));
            targetContentData.Segments.Add(new SegmentData());
        }

        if (targetContentData != null)
        {

            txtName.Text = targetContentData.Name;
            PageBuilder pb = Page as PageBuilder;

            pb.Pagedata.Widgets.AddRange(targetContentData.PageData.Widgets);
            pb.Pagedata.Zones[0].Columns.AddRange(targetContentData.PageData.Zones[0].Columns);

            targetContentWidget.ChildColumns = targetContentData.PageData.Zones[0].Columns;

            pb.ClearView(layoutVersion.Staged, false);
            pb.Status = Mode.Editing;
            pb.viewType = layoutVersion.Staged;
            pb.View(pb.Pagedata);
        }
    }
Exemplo n.º 2
0
    private void Bind()
    {
        BindToolbars();

        if (txtName.Text == "" && _targetContentId != 0)
        {
            TargetedContent tcManager = new TargetedContent(_contentApi.RequestInformationRef);
            TargetedContentData targetContentData = tcManager.GetItem(_targetContentId);

            if (targetContentData != null)
            {
                txtName.Text = targetContentData.Name;
            }
        }
    }