Beispiel #1
0
 /// <summary>
 /// IshFolder creation through an ishfolder xml element.
 /// </summary>
 /// <param name="xmlIshFolder">One ishfolder xml.</param>
 public IshFolder(XmlElement xmlIshFolder)
 {
     _ishFolderRef = -1;
     long.TryParse(xmlIshFolder.Attributes["ishfolderref"].Value, out _ishFolderRef);
     _ishFolderType = (Enumerations.IshFolderType)Enum.Parse(typeof(Enumerations.IshFolderType), xmlIshFolder.Attributes["ishfoldertype"].Value);
     _ishFields     = new IshFields((XmlElement)xmlIshFolder.SelectSingleNode("ishfields"));
 }
Beispiel #2
0
 /// <summary>
 /// Convert a folderType to an enumeration value
 /// </summary>
 /// <param name="folderType">The folder type that needs to be converted.</param>
 /// <returns>eISHFolderType enumeration value.</returns>
 public static TResult ToFolderType <TResult>(Enumerations.IshFolderType folderType)
 {
     if (!typeof(TResult).IsEnum)
     {
         throw new NotSupportedException("TResult must be an Enum");
     }
     return((TResult)Enum.Parse(typeof(TResult), folderType.ToString(), true));
 }
Beispiel #3
0
 /// <summary>
 /// IshFolder creation through explicitly listing all fields.
 /// </summary>
 /// <param name="ishFolderRef">Folder reference in the InfoShare</param>
 /// <param name="ishFolderType">Folder type</param>
 /// <param name="ishFields">????</param>
 public IshFolder(long ishFolderRef, Enumerations.IshFolderType ishFolderType, IshFields ishFields)
 {
     _ishFolderRef  = ishFolderRef;
     _ishFolderType = ishFolderType;
     _ishFields     = ishFields ?? new IshFields();
 }