/// <summary> /// Creates an iView.NET slide show file at the specified location with the specified parameters. /// </summary> /// <param name="sFilePath">Specifies the full path of the slide show file.</param> /// <param name="Descriptor">Specifies a slide show file descriptor that will be written to the file.</param> /// <param name="sEntries">Specifies the file path entries to write to the file.</param> /// <exception cref="System.ArgumentException"></exception> /// <exception cref="System.UnauthorizedAccessException"></exception> /// <exception cref="System.Security.SecurityException"></exception> /// <exception cref="System.IO.FileNotFoundException"></exception> /// <exception cref="System.IO.IOException"></exception> public void Create(string sFilePath, SSFDescriptor Descriptor, string[] sEntries) { if (string.IsNullOrEmpty(sFilePath)) throw new ArgumentException("The specified string cannot be null, empty or just white space.", "sFilePath"); try { using (Stream oStream = new FileStream(sFilePath, FileMode.Create, FileAccess.Write)) { using (BinaryWriter oWriter = new BinaryWriter(oStream, Encoding.Default)) { // Write the file descriptor values. oWriter.Write(SSF_FILE_ID); oWriter.Write(Descriptor.Version); oWriter.Write(Descriptor.EntryCount); oWriter.Write(Descriptor.Date); // Padding. oWriter.Write((byte)0); // Write the slide show values. oWriter.Write(Descriptor.WaitInterval); oWriter.Write((int)Descriptor.TransitionMode); oWriter.Write(Descriptor.FadeSpeed); // Padding. oWriter.Write((byte)0); // Pack and add the entries. oWriter.Write(PackEntries(sEntries)); } } } catch (UnauthorizedAccessException e) { throw new UnauthorizedAccessException(e.Message, e); } catch (System.Security.SecurityException e) { throw new System.Security.SecurityException(e.Message, e); } catch (FileNotFoundException e) { throw new FileNotFoundException(e.Message, e); } catch (IOException e) { throw new IOException(e.Message, e); } }
/// <summary> /// Creates a new instance of the SlideShowDocument class initialized with default values. /// </summary> public SlideShowDocument() { m_Descriptor = SSFDescriptor.Empty; m_sEntries = new List<string>(); }