private static string ApplyTitle(ITitled item)
        {
            var subItem = item as ISubTitled;

            return(string.IsNullOrEmpty(subItem?.SubTitle)
                ? item.Title
                : $"{item.Title}{Environment.NewLine}{subItem.SubTitle}");
        }
Exemple #2
0
        /// <summary>
        /// Displays properties of specified object in ID Editor using Wrappers
        /// </summary>
        /// <param name="o">Object which properties should be displayed</param>
        private void DisplayProperties([CanBeNull] ITitled o)
        {
            if (o is OrganizationType)
            {
                o = Course.Manifest;
            }
            var it = o as ItemType;

            Forms.PropertyEditor.SetContext(NodesWrappers.Wrap(o),
                                            it != null && it.PageType == PageType.Question ?
                                            _pageEditor.GetScope()
                : null, _pageEditor.PropertyEditorSelectedObjectChanged);
        }
Exemple #3
0
 public static ITitled Wrap(ITitled node)
 {
     if (node != null)
     {
         var item = node as ItemType;
         if (item != null && item.PageType == PageType.Question)
         {
             return(ExaminationWrapper.Wrap(item));
         }
         return(Wraper <ITitled> .Wrap(node));
     }
     return(null);
 }
Exemple #4
0
 public static void AddTitledItem([NotNull] this ComboBox.ObjectCollection items, [NotNull] ITitled value)
 {
     items.Add(new ComboBoxItem(value));
 }
Exemple #5
0
 public ComboBoxItem([NotNull] ITitled value)
 {
     Value = value;
 }