Ejemplo n.º 1
0
        public PropertyValue(PropertyItem item)
        {
            if (item.Property == null)
            {
                throw new NotSupportedException("You cannot create a property value from item without property.");
            }

            _item = item;

            _display = new PropertyDisplay(_item.Property);
        }
Ejemplo n.º 2
0
        public List <DocumentTypeDisplay> GetDisplays(IEnumerable <DocumentType> docTypes)
        {
            var dtds = new List <DocumentTypeDisplay>();

            foreach (var docType in docTypes)
            {
                var dtd = new DocumentTypeDisplay(docType);

                foreach (var prop in docType.Properties)
                {
                    var pd = new PropertyDisplay(prop);

                    var dts = DocumentTypeSettings.SingleOrDefault(dt => dt.Id == docType.Id);

                    if (dts != null)
                    {
                        var ps = dts.PropertyDisplays.SingleOrDefault(p => p.Property.Id == prop.Id);

                        if (ps != null)
                        {
                            pd.IsLastViewFavorite = ps.IsLastViewFavorite;
                            pd.IsRequired         = ps.IsRequired;
                            pd.IsVisible          = ps.IsVisible;
                            pd.IsIdentifier       = ps.IsIdentifier;
                            pd.Order = ps.Order;
                        }
                    }

                    dtd.PropertyDisplays.Add(pd);
                }

                dtds.Add(dtd);
            }

            return(dtds);
        }