本文整理汇总了C#中Bundle.GetLocalizedPointerValue方法的典型用法代码示例。如果您正苦于以下问题:C# Bundle.GetLocalizedPointerValue方法的具体用法?C# Bundle.GetLocalizedPointerValue怎么用?C# Bundle.GetLocalizedPointerValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bundle
的用法示例。
在下文中一共展示了Bundle.GetLocalizedPointerValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBundleInitViewModel
private BundleUpdateViewModel GetBundleInitViewModel(Bundle selectedBundle)
{
var model = new BundleUpdateViewModel();
var retriever = CategoryRetrieverFactory.GetInstance(_worldId);
var categories = retriever.GetCategories();
using (var repository = RepositoryFactory.GetInstance(Session))
{
var newStatus = repository.FindClipStatuses().Single(x => x.Status == LessonStatus.New);
var stringManager = new StringsManager(repository);
var status = selectedBundle != null ? selectedBundle.Status.ObjectId : newStatus.ObjectId;
var clipStatusName = selectedBundle.GetLocalizedPointerValue("status", "status");
var teacherPublishingStatus = Session.GetLoggedInUser().GetPointerValue<ParseObject>("adminData", "userPublishingStatus").ObjectId;
model.CategoryName1 = categories[0].Label;
model.CategoryName2 = categories[1].Label;
model.CategoryName3 = categories[2].Label;
model.CategoryName4 = categories[3].Label;
var emptyValue = new CategoryValuesDto
{
Value_en_us = MyMentorResources.phSelecteCategory,
Value_he_il = MyMentorResources.phSelecteCategory,
Key = string.Empty
};
categories[0].Values.Insert(0, emptyValue);
categories[1].Values.Insert(0, emptyValue);
categories[2].Values.Insert(0, emptyValue);
categories[3].Values.Insert(0, emptyValue);
model.Category1Values = categories[0].Values.ToArray();
model.Category2Values = categories[1].Values.ToArray();
model.Category3Values = categories[2].Values.ToArray();
model.Category4Values = categories[3].Values.ToArray();
model.BundleTitleMask = stringManager.GetTemplate(_worldId, StringTemplates.BundleTitlePattern,Language.CurrentLanguageCode);
model.LessonsExplanation = stringManager.GetLocalizedString(Strings.BundleLessonExplanation);
model.StatusValues =repository.FindStatusOptionsByTeacherPublishingStatusAndClipStatus(teacherPublishingStatus, status,Session.GetLoggedInUserRoleName() == RoleNames.ADMINISTRATORS);
if (selectedBundle != null)
{
if (!model.StatusValues.Any(item => item.Key == selectedBundle.Status.ObjectId))
{
var statusValuesList = new List<KeyValuePair<string, string>>(model.StatusValues);
statusValuesList.Insert(0,
new KeyValuePair<string, string>(selectedBundle.Status.ObjectId, clipStatusName));
model.StatusValues = statusValuesList.ToArray();
}
}
return model;
}
}