Exemplo n.º 1
0
 /// <summary>
 /// Output an array of all info.
 /// </summary>
 /// <returns>An array of all info.</returns>
 public TiffInfo[] toInfoArray()
 {
     TiffInfo[] array = new TiffInfo[allInfo.Count];
     for (int i = 0; i < array.Length; i++)
     {
         array[i] = allInfo.Values[i].Clone() as TiffInfo;
     }
     return(array);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Add a piece of new info to the collection. If the info already exists, does nothing.
 /// </summary>
 /// <param name="info">New info to be added.</param>
 /// <returns>True if the info was added. False if the same info already exists.</returns>
 public bool add(TiffInfo info)
 {
     if (allInfo.ContainsKey(info.Tag))
     {
         return(false);
     }
     allInfo.Add(info.Tag, info);
     return(true);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Directly get the data of the info with the given tag.
        /// </summary>
        /// <param name="tag">Tag of the info.</param>
        /// <returns>Content of the info data. Empty array if nonexistent.</returns>
        public Array getOneInfoData(ushort tag)
        {
            TiffInfo info = getOneInfo(tag);

            if (info == null)
            {
                return(Array.CreateInstance(typeof(object), 0));
            }
            return(info.Data.getContent());
        }
Exemplo n.º 4
0
 /// <summary>
 /// Add a piece of new info to the collection.If the info already exists, overwrite.
 /// </summary>
 /// <param name="info">New info to be added.</param>
 public void forceAdd(TiffInfo info)
 {
     this.remove(info.Tag);
     allInfo.Add(info.Tag, info);
 }
Exemplo n.º 5
0
        /// <summary>
        /// Does deep copy.
        /// </summary>
        /// <returns>A deep copy of this instance.</returns>
        public object Clone()
        {
            TiffInfo temp = new TiffInfo(this.tag, this.name, this.data);

            return(temp);
        }