public static PublicationTargetResult From(PublicationTargetData item) { var result = new PublicationTargetResult { Description = TextEntry.From(item.Description, Resources.LabelDescription), TargetLanguage = TextEntry.From(item.TargetLanguage, Resources.LabelTargetLanguage) }; if (item.DefaultCodePage != null) { string codePage = "System Default"; if (item.DefaultCodePage > 0) { var encoding = Encoding.GetEncodings().FirstOrDefault(e => e.CodePage == item.DefaultCodePage); if (encoding != null) { codePage = encoding.DisplayName; } } result.DefaultCodePage = TextEntry.From(codePage, Resources.LabelDefaultCodePage); } if (item.Priority != null) { string priority = Resources.PriorityMedium; switch (item.Priority.Value) { case PublishPriority.High: priority = Resources.PriorityHigh; break; case PublishPriority.Low: priority = Resources.PriorityLow; break; } result.Priority = TextEntry.From(priority, Resources.LabelPriority); } var destinations = item.Destinations.Select( destination => string.Format(Resources.PublicationTargetDestination, destination.Title, destination.ProtocolSchema.Title) ).ToList(); result.Destinations = TextEntry.From(string.Join(", ", destinations), Resources.LabelDestinations); AddCommonProperties(item, result); return(result); }
public static PublicationTargetResult From(PublicationTargetData item) { var result = new PublicationTargetResult { Description = TextEntry.From(item.Description, Resources.LabelDescription), TargetLanguage = TextEntry.From(item.TargetLanguage, Resources.LabelTargetLanguage) }; if (item.DefaultCodePage != null) { string codePage = "System Default"; if (item.DefaultCodePage > 0) { var encoding = Encoding.GetEncodings().FirstOrDefault(e => e.CodePage == item.DefaultCodePage); if (encoding != null) { codePage = encoding.DisplayName; } } result.DefaultCodePage = TextEntry.From(codePage, Resources.LabelDefaultCodePage); } if (item.Priority != null) { string priority = Resources.PriorityMedium; switch (item.Priority.Value) { case PublishPriority.High: priority = Resources.PriorityHigh; break; case PublishPriority.Low: priority = Resources.PriorityLow; break; } result.Priority = TextEntry.From(priority, Resources.LabelPriority); } var destinations = item.Destinations.Select( destination => string.Format(Resources.PublicationTargetDestination, destination.Title, destination.ProtocolSchema.Title) ).ToList(); result.Destinations = TextEntry.From(string.Join(", ", destinations), Resources.LabelDestinations); AddCommonProperties(item, result); return result; }