1 // System.Diagnostics.EventLogInstaller.cs
4 // Gert Driesen (drieseng@users.sourceforge.net)
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using System.Collections;
32 using System.ComponentModel;
33 using System.Configuration.Install;
34 using System.Runtime.InteropServices;
36 namespace System.Diagnostics
38 public class EventLogInstaller : ComponentInstaller
40 public EventLogInstaller ()
47 public int CategoryCount {
48 get { throw new NotImplementedException (); }
49 set { throw new NotImplementedException (); }
53 [Editor ("System.Windows.Forms.Design.FileNameEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing )]
54 [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
56 public string CategoryResourceFile {
57 get { return _categoryResourceFile; }
58 set { _categoryResourceFile = value; }
62 [Editor ("System.Windows.Forms.Design.FileNameEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing )]
63 [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
65 public string MessageResourceFile {
66 get { return _messageResourceFile; }
67 set { _messageResourceFile = value; }
71 [Editor ("System.Windows.Forms.Design.FileNameEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing )]
72 [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
74 public string ParameterResourceFile {
75 get { return _parameterResourceFile; }
76 set { _parameterResourceFile = value; }
81 public override void CopyFromComponent (IComponent component)
83 throw new NotImplementedException ();
87 public override void Install (IDictionary stateSaver)
89 throw new NotImplementedException ();
93 public override bool IsEquivalentInstaller (ComponentInstaller otherInstaller)
95 throw new NotImplementedException ();
99 public override void Rollback (IDictionary savedState)
101 throw new NotImplementedException ();
105 public override void Uninstall (IDictionary savedState)
107 throw new NotImplementedException ();
110 [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
113 if (_log == null && _source != null)
114 _log = EventLog.LogNameFromSourceName (_source, ".");
123 [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
124 public string Source {
133 [DefaultValue (UninstallAction.Remove)]
134 public UninstallAction UninstallAction {
136 return _uninstallAction;
139 if (!Enum.IsDefined(typeof(UninstallAction), value))
140 // LAMESPEC, the docs do not mention this, but
141 // this exception is indeed thrown for invalid
143 throw new InvalidEnumArgumentException("value",
144 (int) value, typeof(UninstallAction));
146 _uninstallAction = value;
151 private string _source;
152 private UninstallAction _uninstallAction = UninstallAction.Remove;
154 private string _categoryResourceFile;
155 private string _messageResourceFile;
156 private string _parameterResourceFile;