Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Diagnostics / Eventing / Reader / EventLogInformation.cs / 1305376 / EventLogInformation.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
/*============================================================
**
** Class: EventLogInformation
**
** Purpose:
** The objects of this class allow access to the run-time
** properties of logs and external log files. An instance of this
** class is obtained from EventLogSession.
**
============================================================*/
using System;
using System.Runtime.InteropServices;
using Microsoft.Win32;
namespace System.Diagnostics.Eventing.Reader {
///
/// Describes the run-time properties of logs and external log files. An instance
/// of this class is obtained from EventLogSession.
///
[System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
public sealed class EventLogInformation {
DateTime? creationTime;
DateTime? lastAccessTime;
DateTime? lastWriteTime;
long? fileSize;
int? fileAttributes;
long? recordCount;
long? oldestRecordNumber;
bool? isLogFull;
[System.Security.SecuritySafeCritical]
internal EventLogInformation(EventLogSession session, string channelName, PathType pathType) {
EventLogPermissionHolder.GetEventLogPermission().Demand();
EventLogHandle logHandle = NativeWrapper.EvtOpenLog(session.Handle, channelName, pathType);
using (logHandle) {
creationTime = (DateTime?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogCreationTime);
lastAccessTime = (DateTime?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogLastAccessTime);
lastWriteTime = (DateTime?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogLastWriteTime);
fileSize = (long?)((ulong?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogFileSize));
fileAttributes = (int?)((uint?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogAttributes));
recordCount = (long?)((ulong?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogNumberOfLogRecords));
oldestRecordNumber = (long?)((ulong?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogOldestRecordNumber));
isLogFull = (bool?)NativeWrapper.EvtGetLogInfo(logHandle, UnsafeNativeMethods.EvtLogPropertyId.EvtLogFull);
}
}
public DateTime? CreationTime { get { return creationTime; } }
public DateTime? LastAccessTime { get { return lastAccessTime; } }
public DateTime? LastWriteTime { get { return lastWriteTime; } }
public long? FileSize { get { return fileSize; } }
public int? Attributes { get { return fileAttributes; } }
public long? RecordCount { get { return recordCount; } }
public long? OldestRecordNumber { get { return oldestRecordNumber; } }
public bool? IsLogFull { get { return isLogFull; } }
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Update.cs
- IFlowDocumentViewer.cs
- ScrollEvent.cs
- ToolStripSplitStackLayout.cs
- PartitionedStream.cs
- SoapProtocolReflector.cs
- RegistryKey.cs
- IntPtr.cs
- CombinedGeometry.cs
- XPathConvert.cs
- GlyphingCache.cs
- safex509handles.cs
- RuntimeDelegateArgument.cs
- parserscommon.cs
- ProxyWebPartManagerDesigner.cs
- ParseHttpDate.cs
- WebPartConnectionCollection.cs
- SingleObjectCollection.cs
- ReadOnlyCollection.cs
- SelectionWordBreaker.cs
- Queue.cs
- XmlException.cs
- Constraint.cs
- _emptywebproxy.cs
- GeneralTransform3DTo2DTo3D.cs
- SwitchAttribute.cs
- FrameDimension.cs
- SpecialFolderEnumConverter.cs
- WsiProfilesElement.cs
- PersonalizationStateInfoCollection.cs
- MaterialGroup.cs
- ToolStripPanelRow.cs
- WindowsSlider.cs
- XmlQueryRuntime.cs
- RuleEngine.cs
- CqlErrorHelper.cs
- DetailsViewPageEventArgs.cs
- HyperlinkAutomationPeer.cs
- ConfigViewGenerator.cs
- HtmlEncodedRawTextWriter.cs
- HostingEnvironmentWrapper.cs
- ElementNotEnabledException.cs
- Lasso.cs
- TypeHelper.cs
- TileModeValidation.cs
- XamlInterfaces.cs
- CornerRadius.cs
- DataGridViewRowConverter.cs
- WebBrowsableAttribute.cs
- StringSource.cs
- SmtpDigestAuthenticationModule.cs
- QuadraticBezierSegment.cs
- SystemIPGlobalProperties.cs
- ParagraphResult.cs
- LinkedResource.cs
- IgnoreFileBuildProvider.cs
- Metafile.cs
- activationcontext.cs
- HtmlImage.cs
- AsyncContentLoadedEventArgs.cs
- ToolStripDropDown.cs
- CallSiteOps.cs
- FormatterServices.cs
- _UriSyntax.cs
- OdbcException.cs
- CmsInterop.cs
- BuildProviderUtils.cs
- CodeTypeDeclarationCollection.cs
- IPipelineRuntime.cs
- ChangeTracker.cs
- HwndStylusInputProvider.cs
- StandardOleMarshalObject.cs
- AddInBase.cs
- UnsafeNativeMethods.cs
- DataBindEngine.cs
- AbstractSvcMapFileLoader.cs
- ScriptingJsonSerializationSection.cs
- RegistryExceptionHelper.cs
- TypedDatasetGenerator.cs
- TrackingStringDictionary.cs
- MenuEventArgs.cs
- TreeNodeCollection.cs
- DataGridTextBoxColumn.cs
- HttpRuntime.cs
- VirtualDirectoryMappingCollection.cs
- Fx.cs
- ComPlusInstanceContextInitializer.cs
- TypedServiceChannelBuilder.cs
- Dispatcher.cs
- Int32KeyFrameCollection.cs
- WebPartConnectionCollection.cs
- SecurityKeyUsage.cs
- UserControlAutomationPeer.cs
- GeometryDrawing.cs
- MultilineStringConverter.cs
- HashCodeCombiner.cs
- AvTraceDetails.cs
- OutOfProcStateClientManager.cs
- Propagator.Evaluator.cs
- InstancePersistence.cs