/// <summary> /// The dispose function which is called by the finalizer and when you dispose the instance manually by calling /// [instanceName.Dispose()]. This is needed because we don't want that this class will be disposed when it is /// called by the finalizer. /// </summary> /// <param name="disposing">Dispose all members of this class? (object instances), finalizer (false), manually (true)</param> protected virtual void Dispose(bool disposing) { // <summary> // Was dispose already called once? // </summary> if (disposed) return; // <summary> // Free all managed resources (all classes which inherits [IDisposable].) // </summary> if (disposing) { // <summary> // Free the [LibraryLogger] resource. // </summary> if (this.LibraryLogger != null) { this.LibraryLogger.Dispose(); this.LibraryLogger = null; } // <summary> // Free all native resources. // </summary> this.LibraryLog = null; // <summary> // Set object as disposed. // </summary> this.disposed = true; } }
/// <summary> /// [LoggingConfiguration] is the constructor to initilize this class and /// sets all private members of it. /// </summary> protected Logging() { // <summary> // Create the [LibraryLogger] and add the // [LibraryLog] to the logger. // </summary> LibraryLogger = new Wiesend.Logging.Logger(); LibraryLogger.AddLog("LibraryLog"); LibraryLog = (Wiesend.Logging.Log)LibraryLogger.GetLog("LibraryLog"); }