Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Administration / ProviderBase.cs / 1 / ProviderBase.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Administration { using System; using System.Diagnostics; using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Reflection; using System.ServiceModel.Channels; abstract class ProviderBase : IWmiProvider { public static void FillCollectionInfo(ICollection info, IWmiInstance instance, string propertyName) { DiagnosticUtility.DebugAssert(null != info, ""); DiagnosticUtility.DebugAssert(null != instance, ""); //warning 56507 : Prefer 'string.IsNullOrEmpty(action)' over checks for null and/or emptiness. #pragma warning suppress 56507 //[....]; Asserting non-null object for marshalling reasons. Empty string may be valid input. DiagnosticUtility.DebugAssert(null != propertyName, ""); string[] data = new string[info.Count]; int i = 0; foreach (object o in info) { data[i++] = o.ToString(); } instance.SetProperty(propertyName, data); } public static void FillCollectionInfo(IEnumerable info, IWmiInstance instance, string propertyName) { DiagnosticUtility.DebugAssert(null != info, ""); DiagnosticUtility.DebugAssert(null != instance, ""); //warning 56507 : Prefer 'string.IsNullOrEmpty(action)' over checks for null and/or emptiness. #pragma warning suppress 56507 //[....]; Asserting non-null object for marshalling reasons. Empty string may be valid input. DiagnosticUtility.DebugAssert(null != propertyName, ""); int i = 0; foreach (object o in info) { i++; } string[] data = new string[i]; i = 0; foreach (object o in info) { data[i++] = o.ToString(); } instance.SetProperty(propertyName, data); } void IWmiProvider.EnumInstances(IWmiInstances instances) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WbemNotSupportedException()); } bool IWmiProvider.GetInstance(IWmiInstance contract) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WbemNotSupportedException()); } bool IWmiProvider.PutInstance(IWmiInstance instance) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WbemNotSupportedException()); } bool IWmiProvider.DeleteInstance(IWmiInstance instance) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WbemNotSupportedException()); } bool IWmiProvider.InvokeMethod(IWmiMethodContext method) { method.ReturnParameter = 0; throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WbemNotSupportedException()); } } } // 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
- Application.cs
- KeySplineConverter.cs
- ApplicationDirectory.cs
- OdbcPermission.cs
- IIS7UserPrincipal.cs
- UserMapPath.cs
- PreviousTrackingServiceAttribute.cs
- UIElementParaClient.cs
- PropertyChangedEventArgs.cs
- CTreeGenerator.cs
- WorkflowRuntimeService.cs
- EntitySqlQueryCacheEntry.cs
- UiaCoreProviderApi.cs
- StructuralCache.cs
- SmtpDigestAuthenticationModule.cs
- MemberMemberBinding.cs
- SerialPort.cs
- SqlRewriteScalarSubqueries.cs
- DecoderNLS.cs
- AdornerPresentationContext.cs
- KeySplineConverter.cs
- SQLMembershipProvider.cs
- xmlsaver.cs
- ImageListStreamer.cs
- DetailsViewCommandEventArgs.cs
- ImmutableAssemblyCacheEntry.cs
- MimeReturn.cs
- Mappings.cs
- ConsoleKeyInfo.cs
- SqlUtils.cs
- WaitHandle.cs
- TableRowCollection.cs
- parserscommon.cs
- SqlFormatter.cs
- AttachmentService.cs
- PublisherIdentityPermission.cs
- ReferencedAssembly.cs
- XmlEntity.cs
- Assembly.cs
- SignatureHelper.cs
- PassportAuthenticationModule.cs
- DataTableCollection.cs
- Focus.cs
- OleDbRowUpdatedEvent.cs
- StreamBodyWriter.cs
- ObjectDisposedException.cs
- RTTrackingProfile.cs
- PropertyDescriptors.cs
- RectangleF.cs
- AutomationTextAttribute.cs
- xmlsaver.cs
- MailSettingsSection.cs
- RuntimeConfig.cs
- CorePropertiesFilter.cs
- ControlBuilderAttribute.cs
- ScrollViewerAutomationPeer.cs
- RSAPKCS1SignatureFormatter.cs
- DataServiceRequest.cs
- SecurityMode.cs
- GraphicsContext.cs
- DBSqlParser.cs
- AssemblyEvidenceFactory.cs
- ImageCollectionEditor.cs
- TypeUtils.cs
- AsnEncodedData.cs
- DataBindingExpressionBuilder.cs
- XslException.cs
- KeySpline.cs
- SpeakCompletedEventArgs.cs
- XamlContextStack.cs
- Membership.cs
- NativeMethodsCLR.cs
- Helpers.cs
- SelectionChangedEventArgs.cs
- HttpCapabilitiesBase.cs
- BamlLocalizableResource.cs
- InOutArgument.cs
- TextSegment.cs
- RtfToken.cs
- MethodToken.cs
- TagMapInfo.cs
- ExpressionLexer.cs
- PolicyChain.cs
- ZoneLinkButton.cs
- PropertyPathConverter.cs
- WindowsTokenRoleProvider.cs
- LingerOption.cs
- ClockController.cs
- ModifiableIteratorCollection.cs
- FlowDocument.cs
- AVElementHelper.cs
- EntityViewGenerationAttribute.cs
- OleDbPropertySetGuid.cs
- ItemPager.cs
- BamlCollectionHolder.cs
- XpsFontSubsetter.cs
- StyleSelector.cs
- HostingEnvironmentException.cs
- QilTernary.cs
- _StreamFramer.cs