Ejemplo n.º 1
0
        public static string Identify(SubjectEntityViewModelBase subjectModel)
        {
            if (subjectModel is AborigenDecoratorViewModel aborigen)
            {
                return(aborigen.AborigenReadOnly.GetId());
            }

            if (subjectModel is FlatViewModel flat)
            {
                return($"{ FlatPrefix }_{ flat.Number }");
            }

            if (subjectModel is FloorViewModel floor)
            {
                return($"{ FloorPrefix }_{ floor.FloorNumber }_{ floor.Section }");
            }

            if (subjectModel is FurnitureSectionPlanViewModel)
            {
                return($"{ SectionPrefix }_{ SectionType.Furniture }");
            }

            if (subjectModel is HospitalSectionPlanViewModel)
            {
                return($"{ SectionPrefix }_{ SectionType.Hospital }");
            }

            if (subjectModel is HouseViewModel)
            {
                return(HousePrefix);
            }

            throw new NotImplementedException();
        }
        /// <summary>
        /// Задать субъекта-владельца данной вьюмодели. То есть ему принадлежит данный аттач.
        /// </summary>
        /// <param name="subject">Вьюмодель субъекта-владельца данного аттача.</param>
        public override void SetOwnerSubject(SubjectEntityViewModelBase subject)
        {
            base.SetOwnerSubject(subject);

            EditableAttachmentViewModel.SetOwnerSubject(subject);
            ReadonlyAttachmentViewModel.SetOwnerSubject(subject);
        }
Ejemplo n.º 3
0
 private static void ShowPhotosImpl(SubjectEntityViewModelBase owner)
 {
     owner.Publish(new MessageShowPhotos <SubjectEntityViewModelBase>(owner));
 }