Exemplo n.º 1
0
        public static PropertyListViewItem[] Create(PropertySet propertySet)
        {
            PropertyIDMap propertyIDMap;

            if (propertySet.IsDocumentSummaryInformation)
            {
                propertyIDMap = PropertyIDMap.DocumentSummaryInformationProperties;
            }
            else if (propertySet.IsSummaryInformation)
            {
                propertyIDMap = PropertyIDMap.SummaryInformationProperties;
            }
            else
            {
                propertyIDMap = new PropertyIDMap(new Hashtable());
            }

            var length = propertySet.Properties.Length;
            var propertyListViewItems = new PropertyListViewItem[length];

            for (int i = 0; i < length; i++)
            {
                var property = propertySet.Properties[i];

                //TODO:: filter empty name items
                PropertyListViewItem tmp = new PropertyListViewItem(property, propertyIDMap);

                propertyListViewItems[i] = tmp;
            }

            Array.Sort(propertyListViewItems);

            return(propertyListViewItems);
        }
Exemplo n.º 2
0
        private PropertyListViewItem(Property property, PropertyIDMap propertyIDMap)
            : base(new string[] {
            property.ID.ToString(),
            propertyIDMap.ContainsKey(property.ID) ?
            propertyIDMap[property.ID].ToString() : string.Empty,
            property.Type.ToString(),
            property.Value.ToString()
        })
        {
            this.Property = property;

            this.ImageKey = "Property";
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns the property ID string that is associated with a
        /// given property ID in a section format ID's namespace.
        /// </summary>
        /// <param name="sectionFormatID">Each section format ID has its own name
        /// space of property ID strings and thus must be specified.</param>
        /// <param name="pid">The property ID</param>
        /// <returns>The well-known property ID string associated with the
        /// property ID pid in the name space spanned by sectionFormatID If the pid
        /// sectionFormatID combination is not well-known, the
        /// string "[undefined]" is returned.
        /// </returns>
        public static String GetPIDString(byte[] sectionFormatID,
                                          long pid)
        {
            PropertyIDMap m = GetInstance().Get(sectionFormatID);

            if (m == null)
            {
                return(UNDEFINED);
            }
            else
            {
                String s = (String)m.Get(pid);
                if (s == null)
                {
                    return(UNDEFINED);
                }
                return(s);
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Associates a section format ID with a {@link
 /// PropertyIDMap}.
 /// </summary>
 /// <param name="sectionFormatID">the section format ID</param>
 /// <param name="propertyIDMap">The property ID map.</param>
 /// <returns></returns>
 public Object Put(byte[] sectionFormatID,
                   PropertyIDMap propertyIDMap)
 {
     return(this[sectionFormatID] = propertyIDMap);
 }