protected override void Exporting(FidelityUserPart part, global::Orchard.ContentManagement.Handlers.ExportContentContext context)
        {
            var root = context.Element(part.PartDefinition.Name);

            root.SetAttributeValue("FidelityUsername", part.FidelityUsername);
            root.SetAttributeValue("FidelityPassword", part.FidelityPassword);
            root.SetAttributeValue("CustomerId", part.CustomerId);
        }
        protected override void Exporting(ActivityPart part, global::Orchard.ContentManagement.Handlers.ExportContentContext context)
        {
            var root = context.Element(part.PartDefinition.Name);

            root.SetAttributeValue("AllDay", part.AllDay);
            root.SetAttributeValue("DateTimeEnd", part.DateTimeEnd.HasValue ? part.DateTimeEnd.Value.ToString(CultureInfo.InvariantCulture) : null);
            root.SetAttributeValue("DateTimeStart", part.DateTimeStart.HasValue ? part.DateTimeStart.Value.ToString(CultureInfo.InvariantCulture) : null);
            root.SetAttributeValue("Repeat", part.Repeat);
            root.SetAttributeValue("RepeatDetails", part.RepeatDetails);
            root.SetAttributeValue("RepeatEnd", part.RepeatEnd);
            root.SetAttributeValue("RepeatEndDate", part.RepeatEndDate.HasValue ? part.RepeatEndDate.Value.ToString(CultureInfo.InvariantCulture) : null);
            root.SetAttributeValue("RepeatType", part.RepeatType);
            root.SetAttributeValue("RepeatValue", part.RepeatValue);
        }
Exemple #3
0
        // scommentare il metodo seguente nella versione 1.10.x e commentare la parte corrispondente in Importing
        //protected override void ImportCompleted(ProjectionPart part, ImportContentContext context) {
        //    var query = context.Attribute(part.PartDefinition.Name, "Query");
        //    if (query != null) {
        //        part.Record.QueryPartRecord = context.GetItemFromSession(query).As<QueryPart>().Record;
        //        var layoutIndex = context.Attribute(part.PartDefinition.Name, "LayoutIndex");
        //        int layoutIndexValue;
        //        if (layoutIndex != null
        //            && Int32.TryParse(layoutIndex, out layoutIndexValue)
        //            && layoutIndexValue >= 0
        //            && part.Record.QueryPartRecord.Layouts.Count > layoutIndexValue) {
        //            part.Record.LayoutRecord = part.Record.QueryPartRecord.Layouts[Int32.Parse(layoutIndex)];
        //        }
        //    }
        //}
        protected override void Exporting(CalendarPart part, global::Orchard.ContentManagement.Handlers.ExportContentContext context)
        {
            var root = context.Element(part.PartDefinition.Name);

            root.SetAttributeValue("CalendarShape", part.CalendarShape);
            root.SetAttributeValue("DisplayPager", part.DisplayPager);
            root.SetAttributeValue("ItemsPerPage", part.ItemsPerPage);
            root.SetAttributeValue("NumDays", part.NumDays);
            root.SetAttributeValue("PagerSuffix", part.PagerSuffix);
            root.SetAttributeValue("StartDate", part.StartDate);
            if (part.QueryPartRecord != null && part.QueryPartRecord.Id > 0)
            {
                var query = _orchardServices.ContentManager.Get(part.QueryPartRecord.Id);
                root.SetAttributeValue("Query", _orchardServices.ContentManager.GetItemMetadata(query).Identity.ToString());
                root.SetAttributeValue("LayoutIndex", part.Record.QueryPartRecord.Layouts.IndexOf(part.Record.LayoutRecord));
            }
        }
Exemple #4
0
 protected override void Exporting(FaqTypePart part, global::Orchard.ContentManagement.Handlers.ExportContentContext context)
 {
     context.Element(part.PartDefinition.Name)
     .SetAttributeValue("FaqTypeTitle", part.Title);
 }