4 using System
.Collections
.Generic
;
11 /// Interface for event template databases.
13 public interface IEventTemplateDB
16 /// An enumerable containing the names of defined events.
18 IEnumerable
<string> EventNames
24 /// Indicates whether the template db has been initialized.
32 /// Gets the named event template.
34 /// <param name="evName">the event name</param>
35 /// <returns>the event template for the named event</returns>
36 /// <exception cref="ArgumentOutOfRangeException">thrown if the event is not defined in the DB</exception>
37 EventTemplate
GetEventTemplate(string evName
);
40 /// Initilizes the template db by reading ESF files at <paramref name="filePath"/>.
42 /// <param name="filePath">a path containing ESF (*.esf) files</param>
43 /// <param name="includeSubdirectories">indicates whether subdirectories should be included</param>
44 /// <exception cref="InvalidOperationException">thrown if the template db has already been initalized</exception>
45 /// <exception cref="ArgumentNullException">thrown if <paramref name="filePath"/> is null</exception>
46 void InitializeFromFilePath(string filePath
, bool includeSubdirectories
);
49 /// Initializes the template db by reading ESF templates from the <paramref name="esfStream"/>.
51 /// <param name="esfStream">a stream containing ESF template definitions</param>
52 /// <exception cref="InvalidOperationException">thrown if the template db has already been initalized</exception>
53 /// <exception cref="ArgumentNullException">thrown if <paramref name="esfStream"/> is null</exception>
54 void InitializeFromStream(Stream esfStream
);
57 /// Checks to see if a named event template exists.
59 /// <param name="eventName">the event name</param>
60 /// <returns><em>true</em> if the template with the <paramref name="eventName"/> exists;
61 /// otherwise <em>false</em>.</returns>
62 bool TemplateExists(string eventName
);
65 /// Tries to create the named event.
67 /// <param name="evName">event name</param>
68 /// <param name="ev">reference to a variable that contains the event upon success</param>
69 /// <param name="performValidation">whether the event should perform validation</param>
70 /// <param name="enc">the encoding used for the event</param>
71 /// <returns><em>true</em> if the named event is created; otherwise <em>false</em></returns>
72 bool TryCreateEvent(string evName
, out Event ev
, bool performValidation
, SupportedEncoding enc
);
75 /// Tries to get the named event template.
77 /// <param name="evName">the event's name</param>
78 /// <param name="template">reference to a variable that will contain the template upon success</param>
79 /// <returns><em>true</em> if the named event is retreived; otherwise <em>false</em></returns>
80 bool TryGetEventTemplate(string evName
, out EventTemplate template
);