Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Administration / WbemException.cs / 1 / WbemException.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Administration { using System; using System.ComponentModel; using System.Diagnostics; internal class WbemException : Win32Exception { internal WbemException(WbemNative.WbemStatus hr) : base((int)hr) { } internal WbemException(int hr) : base(hr) { } internal WbemException(int hr, string message) : base(hr, message) { } internal static void Throw(WbemNative.WbemStatus hr) { switch (hr) { case WbemNative.WbemStatus.WBEM_E_NOT_FOUND: throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WbemInstanceNotFoundException()); case WbemNative.WbemStatus.WBEM_E_INVALID_PARAMETER: throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WbemInvalidParameterException()); case WbemNative.WbemStatus.WBEM_E_NOT_SUPPORTED: throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WbemNotSupportedException()); case WbemNative.WbemStatus.WBEM_E_INVALID_METHOD: throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WbemInvalidMethodException()); default: throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WbemException(hr)); } } internal static void ThrowIfFail(int hr) { if (hr < 0) { Throw((WbemNative.WbemStatus)hr); } } } internal class WbemInstanceNotFoundException : WbemException { internal WbemInstanceNotFoundException() : base(WbemNative.WbemStatus.WBEM_E_NOT_FOUND) { } } internal class WbemInvalidParameterException : WbemException { internal WbemInvalidParameterException(string name) : base((int)WbemNative.WbemStatus.WBEM_E_INVALID_PARAMETER, name) { } internal WbemInvalidParameterException() : base(WbemNative.WbemStatus.WBEM_E_INVALID_PARAMETER) { } } internal class WbemNotSupportedException : WbemException { internal WbemNotSupportedException() : base(WbemNative.WbemStatus.WBEM_E_NOT_SUPPORTED) { } } internal class WbemInvalidMethodException : WbemException { internal WbemInvalidMethodException() : base(WbemNative.WbemStatus.WBEM_E_INVALID_METHOD) { } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WebPartZoneCollection.cs
- IPGlobalProperties.cs
- MemberDomainMap.cs
- ParseChildrenAsPropertiesAttribute.cs
- X509Certificate.cs
- DropShadowBitmapEffect.cs
- FileEnumerator.cs
- webeventbuffer.cs
- ConnectionStringSettingsCollection.cs
- DragEventArgs.cs
- ResourcesGenerator.cs
- SmtpNetworkElement.cs
- ToolStripPanelRenderEventArgs.cs
- precedingsibling.cs
- SortAction.cs
- MetafileHeaderEmf.cs
- AuthenticationService.cs
- _MultipleConnectAsync.cs
- DataSet.cs
- TagPrefixInfo.cs
- MailWebEventProvider.cs
- ConstructorNeedsTagAttribute.cs
- PeerCustomResolverElement.cs
- FileUpload.cs
- ConfigXmlAttribute.cs
- FixedElement.cs
- FormViewInsertedEventArgs.cs
- MenuItemStyle.cs
- ObjectAnimationBase.cs
- ListDictionaryInternal.cs
- ToolboxControl.cs
- WebContext.cs
- ReferenceEqualityComparer.cs
- ProxyElement.cs
- ParallelEnumerable.cs
- DataSet.cs
- FileUtil.cs
- TableLayoutRowStyleCollection.cs
- TTSEngineProxy.cs
- ZoneLinkButton.cs
- SoapConverter.cs
- Perspective.cs
- SelectionItemPatternIdentifiers.cs
- ToolStripDropTargetManager.cs
- TableLayoutColumnStyleCollection.cs
- Positioning.cs
- ActivityInstanceReference.cs
- GeneratedContractType.cs
- RoleBoolean.cs
- HitTestDrawingContextWalker.cs
- Compress.cs
- ObjectContextServiceProvider.cs
- ProcessHostMapPath.cs
- WebPartDesigner.cs
- Debugger.cs
- TypeUsage.cs
- CellTreeNodeVisitors.cs
- EntityDataSourceChangedEventArgs.cs
- arabicshape.cs
- LicenseContext.cs
- UInt64.cs
- Barrier.cs
- RealProxy.cs
- DataColumnCollection.cs
- ExpressionBinding.cs
- JpegBitmapDecoder.cs
- TargetException.cs
- ActivityDesignerHelper.cs
- StrokeDescriptor.cs
- securitycriticaldata.cs
- DbConnectionInternal.cs
- BufferBuilder.cs
- MimeObjectFactory.cs
- ShaderEffect.cs
- GridViewUpdatedEventArgs.cs
- StylusButton.cs
- ChannelSinkStacks.cs
- cookieexception.cs
- NotifyCollectionChangedEventArgs.cs
- DrawListViewColumnHeaderEventArgs.cs
- ModuleElement.cs
- ChangeTracker.cs
- DefaultValidator.cs
- StorageModelBuildProvider.cs
- AttachedProperty.cs
- DecoderReplacementFallback.cs
- GeometryGroup.cs
- Mappings.cs
- InputMethodStateTypeInfo.cs
- PassportAuthenticationEventArgs.cs
- CategoryGridEntry.cs
- Int16Storage.cs
- TraceSection.cs
- QilStrConcat.cs
- ImagingCache.cs
- WebPart.cs
- TypeConverterAttribute.cs
- Point3D.cs
- AuthenticationModuleElementCollection.cs
- MetafileHeaderEmf.cs