本文整理汇总了C#中IWmiInstance.SetProperty方法的典型用法代码示例。如果您正苦于以下问题:C# IWmiInstance.SetProperty方法的具体用法?C# IWmiInstance.SetProperty怎么用?C# IWmiInstance.SetProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWmiInstance
的用法示例。
在下文中一共展示了IWmiInstance.SetProperty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillBehaviorInfo
private static void FillBehaviorInfo(IContractBehavior behavior, IWmiInstance existingInstance, out IWmiInstance instance)
{
instance = null;
if (behavior is DeliveryRequirementsAttribute)
{
instance = existingInstance.NewInstance("DeliveryRequirementsAttribute");
DeliveryRequirementsAttribute attribute = (DeliveryRequirementsAttribute) behavior;
instance.SetProperty("QueuedDeliveryRequirements", attribute.QueuedDeliveryRequirements.ToString());
instance.SetProperty("RequireOrderedDelivery", attribute.RequireOrderedDelivery);
if (null != attribute.TargetContract)
{
instance.SetProperty("TargetContract", attribute.TargetContract.ToString());
}
}
else if (behavior is IWmiInstanceProvider)
{
IWmiInstanceProvider provider = (IWmiInstanceProvider) behavior;
instance = existingInstance.NewInstance(provider.GetInstanceType());
provider.FillInstance(instance);
}
else
{
instance = existingInstance.NewInstance("Behavior");
}
if (instance != null)
{
instance.SetProperty("Type", behavior.GetType().FullName);
}
}
示例2: FillAddressInfo
private static void FillAddressInfo(System.ServiceModel.Administration.EndpointInfo endpoint, IWmiInstance instance)
{
string[] info = new string[endpoint.Headers.Count];
int num = 0;
foreach (AddressHeader header in endpoint.Headers)
{
PlainXmlWriter writer = new PlainXmlWriter();
header.WriteAddressHeader(writer);
info[num++] = writer.ToString();
}
ProviderBase.FillCollectionInfo(info, instance, "AddressHeaders");
instance.SetProperty("Address", (endpoint.Address == null) ? string.Empty : endpoint.Address.ToString());
instance.SetProperty("ListenUri", (endpoint.ListenUri == null) ? string.Empty : endpoint.ListenUri.ToString());
instance.SetProperty("AddressIdentity", (endpoint.Identity == null) ? string.Empty : endpoint.Identity.ToString());
}
示例3: FillAppDomainInfo
internal static void FillAppDomainInfo(IWmiInstance instance)
{
Fx.Assert(null != instance, "");
AppDomainInfo domainInfo = AppDomainInfo.Current;
instance.SetProperty(AdministrationStrings.Name, domainInfo.Name);
instance.SetProperty(AdministrationStrings.AppDomainId, domainInfo.Id);
instance.SetProperty(AdministrationStrings.PerformanceCounters, PerformanceCounters.Scope.ToString());
instance.SetProperty(AdministrationStrings.IsDefault, domainInfo.IsDefaultAppDomain);
instance.SetProperty(AdministrationStrings.ProcessId, domainInfo.ProcessId);
instance.SetProperty(AdministrationStrings.TraceLevel, DiagnosticUtility.Level.ToString());
instance.SetProperty(AdministrationStrings.LogMalformedMessages, MessageLogger.LogMalformedMessages);
instance.SetProperty(AdministrationStrings.LogMessagesAtServiceLevel, MessageLogger.LogMessagesAtServiceLevel);
instance.SetProperty(AdministrationStrings.LogMessagesAtTransportLevel, MessageLogger.LogMessagesAtTransportLevel);
instance.SetProperty(AdministrationStrings.ServiceConfigPath, AspNetEnvironment.Current.ConfigurationPath);
FillListenersInfo(instance);
}
示例4: FillOperation
static void FillOperation(IWmiInstance operation, OperationDescription operationDescription)
{
operation.SetProperty(AdministrationStrings.Name, operationDescription.Name);
operation.SetProperty(AdministrationStrings.Action, FixWildcardAction(operationDescription.Messages[0].Action));
if (operationDescription.Messages.Count > 1)
{
operation.SetProperty(AdministrationStrings.ReplyAction, FixWildcardAction(operationDescription.Messages[1].Action));
}
operation.SetProperty(AdministrationStrings.IsOneWay, operationDescription.IsOneWay);
operation.SetProperty(AdministrationStrings.IsInitiating, operationDescription.IsInitiating);
operation.SetProperty(AdministrationStrings.IsTerminating, operationDescription.IsTerminating);
operation.SetProperty(AdministrationStrings.AsyncPattern, null != operationDescription.BeginMethod);
if (null != operationDescription.SyncMethod)
{
if (null != operationDescription.SyncMethod.ReturnType)
{
operation.SetProperty(AdministrationStrings.ReturnType, operationDescription.SyncMethod.ReturnType.Name);
}
operation.SetProperty(AdministrationStrings.MethodSignature, operationDescription.SyncMethod.ToString());
ParameterInfo[] parameterInfo = operationDescription.SyncMethod.GetParameters();
string[] parameterTypes = new string[parameterInfo.Length];
for (int i = 0; i < parameterInfo.Length; i++)
{
parameterTypes[i] = parameterInfo[i].ParameterType.ToString();
}
operation.SetProperty(AdministrationStrings.ParameterTypes, parameterTypes);
}
operation.SetProperty(AdministrationStrings.IsCallback, operationDescription.Messages[0].Direction == MessageDirection.Output);
FillBehaviorsInfo(operation, operationDescription.Behaviors);
}
示例5: FillCollectionInfo
public static void FillCollectionInfo(ICollection info, IWmiInstance instance, string propertyName)
{
string[] strArray = new string[info.Count];
int num = 0;
foreach (object obj2 in info)
{
strArray[num++] = obj2.ToString();
}
instance.SetProperty(propertyName, strArray);
}
示例6: FillContract
static void FillContract(IWmiInstance contract, ContractDescription contractDescription)
{
Fx.Assert(null != contractDescription, "contractDescription cannot be null");
contract.SetProperty(AdministrationStrings.Type, contractDescription.ContractType.Name);
if (null != contractDescription.CallbackContractType)
{
contract.SetProperty(AdministrationStrings.CallbackContract, ContractReference(contractDescription.CallbackContractType.Name));
}
contract.SetProperty(AdministrationStrings.Name, contractDescription.Name);
contract.SetProperty(AdministrationStrings.Namespace, contractDescription.Namespace);
contract.SetProperty(AdministrationStrings.SessionMode, contractDescription.SessionMode.ToString());
IWmiInstance[] operations = new IWmiInstance[contractDescription.Operations.Count];
for (int j = 0; j < operations.Length; ++j)
{
OperationDescription operationDescription = contractDescription.Operations[j];
Fx.Assert(operationDescription.Messages.Count > 0, "");
IWmiInstance operation = contract.NewInstance(AdministrationStrings.Operation);
FillOperation(operation, operationDescription);
operations[j] = operation;
}
contract.SetProperty(AdministrationStrings.Operations, operations);
FillBehaviorsInfo(contract, contractDescription.Behaviors);
}
示例7: FillCollectionInfo
public static void FillCollectionInfo(ICollection info, IWmiInstance instance, string propertyName)
{
Fx.Assert(null != info, "");
Fx.Assert(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.
Fx.Assert(null != propertyName, "");
string[] data = new string[info.Count];
int i = 0;
foreach (object o in info)
{
data[i++] = o.ToString();
}
instance.SetProperty(propertyName, data);
}
示例8: FillEndpointInfo
internal static void FillEndpointInfo(System.ServiceModel.Administration.EndpointInfo endpoint, IWmiInstance instance)
{
instance.SetProperty("CounterInstanceName", PerformanceCounters.PerformanceCountersEnabled ? EndpointPerformanceCountersBase.CreateFriendlyInstanceName(endpoint.ServiceName, endpoint.Contract.Name, endpoint.Address.AbsoluteUri.ToUpperInvariant()) : string.Empty);
instance.SetProperty("Name", endpoint.Name);
instance.SetProperty("ContractName", endpoint.Contract.Name);
FillAddressInfo(endpoint, instance);
FillContractInfo(endpoint, instance);
FillBindingInfo(endpoint, instance);
FillBehaviorsInfo(endpoint, instance);
}
示例9: FillContractInfo
private static void FillContractInfo(System.ServiceModel.Administration.EndpointInfo endpoint, IWmiInstance instance)
{
instance.SetProperty("Contract", ContractInstanceProvider.ContractReference(endpoint.Contract.Name));
}
示例10: FillBehaviorInfo
static void FillBehaviorInfo(IEndpointBehavior behavior, IWmiInstance existingInstance, out IWmiInstance instance)
{
Fx.Assert(null != existingInstance, "");
Fx.Assert(null != behavior, "");
instance = null;
if (behavior is ClientCredentials)
{
instance = existingInstance.NewInstance("ClientCredentials");
ClientCredentials specificBehavior = (ClientCredentials)behavior;
instance.SetProperty(AdministrationStrings.SupportInteractive, specificBehavior.SupportInteractive);
if (specificBehavior.ClientCertificate != null && specificBehavior.ClientCertificate.Certificate != null)
{
instance.SetProperty(AdministrationStrings.ClientCertificate, specificBehavior.ClientCertificate.Certificate.ToString());
}
if (specificBehavior.IssuedToken != null)
{
string result = String.Format(CultureInfo.InvariantCulture,
"{0}: {1}",
AdministrationStrings.CacheIssuedTokens, specificBehavior.IssuedToken.CacheIssuedTokens);
instance.SetProperty(AdministrationStrings.IssuedToken, result);
}
if (specificBehavior.HttpDigest != null)
{
string result = String.Format(CultureInfo.InvariantCulture,
"{0}: {1}",
AdministrationStrings.AllowedImpersonationLevel, specificBehavior.HttpDigest.AllowedImpersonationLevel.ToString());
instance.SetProperty(AdministrationStrings.HttpDigest, result);
}
if (specificBehavior.Peer != null && specificBehavior.Peer.Certificate != null)
{
instance.SetProperty(AdministrationStrings.Peer, specificBehavior.Peer.Certificate.ToString(true));
}
if (specificBehavior.UserName != null)
{
instance.SetProperty(AdministrationStrings.UserName, "********");
}
if (specificBehavior.Windows != null)
{
#pragma warning disable 618 // To suppress AllowNtlm warning.
string result = String.Format(CultureInfo.InvariantCulture,
"{0}: {1}, {2}: {3}",
AdministrationStrings.AllowedImpersonationLevel,
specificBehavior.Windows.AllowedImpersonationLevel.ToString(),
AdministrationStrings.AllowNtlm,
specificBehavior.Windows.AllowNtlm);
#pragma warning restore 618
instance.SetProperty(AdministrationStrings.Windows, result);
}
}
else if (behavior is MustUnderstandBehavior)
{
instance = existingInstance.NewInstance("MustUnderstandBehavior");
}
else if (behavior is SynchronousReceiveBehavior)
{
instance = existingInstance.NewInstance("SynchronousReceiveBehavior");
}
else if (behavior is DispatcherSynchronizationBehavior)
{
instance = existingInstance.NewInstance("DispatcherSynchronizationBehavior");
}
else if (behavior is TransactedBatchingBehavior)
{
instance = existingInstance.NewInstance("TransactedBatchingBehavior");
instance.SetProperty(AdministrationStrings.MaxBatchSize, ((TransactedBatchingBehavior)behavior).MaxBatchSize);
}
else if (behavior is ClientViaBehavior)
{
instance = existingInstance.NewInstance("ClientViaBehavior");
instance.SetProperty(AdministrationStrings.Uri, ((ClientViaBehavior)behavior).Uri.ToString());
}
else if (behavior is IWmiInstanceProvider)
{
IWmiInstanceProvider instanceProvider = (IWmiInstanceProvider)behavior;
instance = existingInstance.NewInstance(instanceProvider.GetInstanceType());
instanceProvider.FillInstance(instance);
}
else
{
instance = existingInstance.NewInstance("Behavior");
}
if (null != instance)
{
instance.SetProperty(AdministrationStrings.Type, behavior.GetType().FullName);
}
}
示例11: FillContract
private static void FillContract(IWmiInstance contract, ContractDescription contractDescription)
{
contract.SetProperty("Type", contractDescription.ContractType.Name);
if (null != contractDescription.CallbackContractType)
{
contract.SetProperty("CallbackContract", ContractReference(contractDescription.CallbackContractType.Name));
}
contract.SetProperty("Name", contractDescription.Name);
contract.SetProperty("Namespace", contractDescription.Namespace);
contract.SetProperty("SessionMode", contractDescription.SessionMode.ToString());
IWmiInstance[] instanceArray = new IWmiInstance[contractDescription.Operations.Count];
for (int i = 0; i < instanceArray.Length; i++)
{
OperationDescription operationDescription = contractDescription.Operations[i];
IWmiInstance operation = contract.NewInstance("Operation");
FillOperation(operation, operationDescription);
instanceArray[i] = operation;
}
contract.SetProperty("Operations", instanceArray);
FillBehaviorsInfo(contract, contractDescription.Behaviors);
}
示例12: FillBehaviorInfo
private static void FillBehaviorInfo(IEndpointBehavior behavior, IWmiInstance existingInstance, out IWmiInstance instance)
{
instance = null;
if (behavior is ClientCredentials)
{
instance = existingInstance.NewInstance("ClientCredentials");
ClientCredentials credentials = (ClientCredentials) behavior;
instance.SetProperty("SupportInteractive", credentials.SupportInteractive);
if ((credentials.ClientCertificate != null) && (credentials.ClientCertificate.Certificate != null))
{
instance.SetProperty("ClientCertificate", credentials.ClientCertificate.Certificate.ToString());
}
if (credentials.IssuedToken != null)
{
string str = string.Format(CultureInfo.InvariantCulture, "{0}: {1}", new object[] { "CacheIssuedTokens", credentials.IssuedToken.CacheIssuedTokens });
instance.SetProperty("IssuedToken", str);
}
if (credentials.HttpDigest != null)
{
string str2 = string.Format(CultureInfo.InvariantCulture, "{0}: {1}", new object[] { "AllowedImpersonationLevel", credentials.HttpDigest.AllowedImpersonationLevel.ToString() });
instance.SetProperty("HttpDigest", str2);
}
if ((credentials.Peer != null) && (credentials.Peer.Certificate != null))
{
instance.SetProperty("Peer", credentials.Peer.Certificate.ToString(true));
}
if (credentials.UserName != null)
{
instance.SetProperty("UserName", "********");
}
if (credentials.Windows != null)
{
string str3 = string.Format(CultureInfo.InvariantCulture, "{0}: {1}, {2}: {3}", new object[] { "AllowedImpersonationLevel", credentials.Windows.AllowedImpersonationLevel.ToString(), "AllowNtlm", credentials.Windows.AllowNtlm });
instance.SetProperty("Windows", str3);
}
}
else if (behavior is MustUnderstandBehavior)
{
instance = existingInstance.NewInstance("MustUnderstandBehavior");
}
else if (behavior is SynchronousReceiveBehavior)
{
instance = existingInstance.NewInstance("SynchronousReceiveBehavior");
}
else if (behavior is DispatcherSynchronizationBehavior)
{
instance = existingInstance.NewInstance("DispatcherSynchronizationBehavior");
}
else if (behavior is TransactedBatchingBehavior)
{
instance = existingInstance.NewInstance("TransactedBatchingBehavior");
instance.SetProperty("MaxBatchSize", ((TransactedBatchingBehavior) behavior).MaxBatchSize);
}
else if (behavior is ClientViaBehavior)
{
instance = existingInstance.NewInstance("ClientViaBehavior");
instance.SetProperty("Uri", ((ClientViaBehavior) behavior).Uri.ToString());
}
else if (behavior is IWmiInstanceProvider)
{
IWmiInstanceProvider provider = (IWmiInstanceProvider) behavior;
instance = existingInstance.NewInstance(provider.GetInstanceType());
provider.FillInstance(instance);
}
else
{
instance = existingInstance.NewInstance("Behavior");
}
if (instance != null)
{
instance.SetProperty("Type", behavior.GetType().FullName);
}
}
示例13:
void IWmiInstanceProvider.FillInstance(IWmiInstance wmiInstance)
{
wmiInstance.SetProperty("CachedInstanceExpiration", this.CachedInstanceExpiration.ToString());
}
示例14:
void IWmiInstanceProvider.FillInstance(IWmiInstance wmiInstance)
{
wmiInstance.SetProperty("SaveStateInOperationTransaction", this.saveStateInOperationTransaction);
}
示例15:
void IWmiInstanceProvider.FillInstance(IWmiInstance wmiInstance)
{
wmiInstance.SetProperty("AddressFilterMode", this.AddressFilterMode.ToString());
wmiInstance.SetProperty("ConfigurationName", this.ConfigurationName);
wmiInstance.SetProperty("IgnoreExtensionDataObject", this.IgnoreExtensionDataObject);
wmiInstance.SetProperty("IncludeExceptionDetailInFaults", this.IncludeExceptionDetailInFaults);
wmiInstance.SetProperty("MaxItemsInObjectGraph", this.MaxItemsInObjectGraph);
wmiInstance.SetProperty("Name", this.Name);
wmiInstance.SetProperty("Namespace", this.Namespace);
wmiInstance.SetProperty("UseSynchronizationContext", this.UseSynchronizationContext);
wmiInstance.SetProperty("ValidateMustUnderstand", this.ValidateMustUnderstand);
wmiInstance.SetProperty("WorkflowType", this.workflowDefinitionContext.WorkflowName);
wmiInstance.SetProperty("WorkflowDefinitionPath", this.workflowDefinitionPath);
wmiInstance.SetProperty("WorkflowRulesPath", this.workflowRulesPath);
}