本文整理汇总了C#中RuntimeDefinedParameterDictionary.Add方法的典型用法代码示例。如果您正苦于以下问题:C# RuntimeDefinedParameterDictionary.Add方法的具体用法?C# RuntimeDefinedParameterDictionary.Add怎么用?C# RuntimeDefinedParameterDictionary.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RuntimeDefinedParameterDictionary
的用法示例。
在下文中一共展示了RuntimeDefinedParameterDictionary.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateVirtualMachineOSImageGetDetailsDynamicParameters
protected object CreateVirtualMachineOSImageGetDetailsDynamicParameters()
{
dynamicParameters = new RuntimeDefinedParameterDictionary();
var pImageName = new RuntimeDefinedParameter();
pImageName.Name = "ImageName";
pImageName.ParameterType = typeof(System.String);
pImageName.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 1,
Mandatory = true
});
pImageName.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ImageName", pImageName);
var pArgumentList = new RuntimeDefinedParameter();
pArgumentList.Name = "ArgumentList";
pArgumentList.ParameterType = typeof(object[]);
pArgumentList.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByStaticParameters",
Position = 2,
Mandatory = true
});
pArgumentList.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ArgumentList", pArgumentList);
return dynamicParameters;
}
示例2: CreateHostedServiceListExtensionsDynamicParameters
protected object CreateHostedServiceListExtensionsDynamicParameters()
{
dynamicParameters = new RuntimeDefinedParameterDictionary();
var pServiceName = new RuntimeDefinedParameter();
pServiceName.Name = "ServiceName";
pServiceName.ParameterType = typeof(System.String);
pServiceName.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 1,
Mandatory = true
});
pServiceName.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ServiceName", pServiceName);
var pArgumentList = new RuntimeDefinedParameter();
pArgumentList.Name = "ArgumentList";
pArgumentList.ParameterType = typeof(object[]);
pArgumentList.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByStaticParameters",
Position = 2,
Mandatory = true
});
pArgumentList.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ArgumentList", pArgumentList);
return dynamicParameters;
}
示例3: CreateExtensionImageRegisterDynamicParameters
protected object CreateExtensionImageRegisterDynamicParameters()
{
dynamicParameters = new RuntimeDefinedParameterDictionary();
var pParameters = new RuntimeDefinedParameter();
pParameters.Name = "ExtensionImageRegisterParameters";
pParameters.ParameterType = typeof(Microsoft.WindowsAzure.Management.Compute.Models.ExtensionImageRegisterParameters);
pParameters.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 1,
Mandatory = true
});
pParameters.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ExtensionImageRegisterParameters", pParameters);
var pArgumentList = new RuntimeDefinedParameter();
pArgumentList.Name = "ArgumentList";
pArgumentList.ParameterType = typeof(object[]);
pArgumentList.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByStaticParameters",
Position = 2,
Mandatory = true
});
pArgumentList.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ArgumentList", pArgumentList);
return dynamicParameters;
}
示例4: CreateVirtualMachineScaleSetListDynamicParameters
protected object CreateVirtualMachineScaleSetListDynamicParameters()
{
dynamicParameters = new RuntimeDefinedParameterDictionary();
var pResourceGroupName = new RuntimeDefinedParameter();
pResourceGroupName.Name = "ResourceGroupName";
pResourceGroupName.ParameterType = typeof(string);
pResourceGroupName.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 1,
Mandatory = true
});
pResourceGroupName.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ResourceGroupName", pResourceGroupName);
var pArgumentList = new RuntimeDefinedParameter();
pArgumentList.Name = "ArgumentList";
pArgumentList.ParameterType = typeof(object[]);
pArgumentList.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByStaticParameters",
Position = 2,
Mandatory = true
});
pArgumentList.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ArgumentList", pArgumentList);
return dynamicParameters;
}
示例5: CreateVirtualMachineScaleSetVMListNextDynamicParameters
protected object CreateVirtualMachineScaleSetVMListNextDynamicParameters()
{
dynamicParameters = new RuntimeDefinedParameterDictionary();
var pNextPageLink = new RuntimeDefinedParameter();
pNextPageLink.Name = "NextPageLink";
pNextPageLink.ParameterType = typeof(string);
pNextPageLink.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 1,
Mandatory = true
});
pNextPageLink.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("NextPageLink", pNextPageLink);
var pArgumentList = new RuntimeDefinedParameter();
pArgumentList.Name = "ArgumentList";
pArgumentList.ParameterType = typeof(object[]);
pArgumentList.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByStaticParameters",
Position = 2,
Mandatory = true
});
pArgumentList.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ArgumentList", pArgumentList);
return dynamicParameters;
}
示例6: NewDriveDynamicParameters
protected override object NewDriveDynamicParameters()
{
try{
WriteVerbose("TmxProvider::NewDriveDynamicParameters()");
dynamicParameters =
new RuntimeDefinedParameterDictionary();
var atts1 = new Collection<Attribute>();
var parameterAttribute1 = new ParameterAttribute {Mandatory = true};
//ParameterAttribute parameterAttribute1 = new ParameterAttribute();
//parameterAttribute1.Mandatory = true;
//parameterAttribute2.ParameterSetName = "WindowNameParameterSet";
atts1.Add(parameterAttribute1);
var attr1 = new AllowEmptyStringAttribute();
atts1.Add(attr1);
dynamicParameters.Add(
"windowName",
new RuntimeDefinedParameter(
"windowName",
typeof(string),
atts1));
var atts2 = new Collection<Attribute>();
var parameterAttribute2 = new ParameterAttribute {Mandatory = true};
//ParameterAttribute parameterAttribute2 = new ParameterAttribute();
//parameterAttribute2.Mandatory = true;
//parameterAttribute2.ParameterSetName = "ProcessNameParameterSet";
atts2.Add(parameterAttribute2);
var attr2 = new AllowEmptyStringAttribute();
atts2.Add(attr2);
dynamicParameters.Add(
"processName",
new RuntimeDefinedParameter(
"processName",
typeof(string),
atts2));
var atts3 = new Collection<Attribute>();
var parameterAttribute3 = new ParameterAttribute {Mandatory = true};
//ParameterAttribute parameterAttribute3 = new ParameterAttribute();
//parameterAttribute3.Mandatory = true;
//parameterAttribute3.ParameterSetName = "ProcessIdParameterSet";
atts3.Add(parameterAttribute3);
var attr3 = new AllowEmptyStringAttribute();
atts3.Add(attr3);
dynamicParameters.Add(
"processId",
new RuntimeDefinedParameter(
"processId",
typeof(int),
atts3));
return dynamicParameters;
}
catch (Exception e) {
WriteVerbose(e.Message);
WriteVerbose("TmxProvider::NewDriveDynamicParameters()");
return null;
}
}
示例7: CreateExtensionImageUnregisterDynamicParameters
protected object CreateExtensionImageUnregisterDynamicParameters()
{
dynamicParameters = new RuntimeDefinedParameterDictionary();
var pProviderNamespace = new RuntimeDefinedParameter();
pProviderNamespace.Name = "ProviderNamespace";
pProviderNamespace.ParameterType = typeof(System.String);
pProviderNamespace.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 1,
Mandatory = true
});
pProviderNamespace.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ProviderNamespace", pProviderNamespace);
var pType = new RuntimeDefinedParameter();
pType.Name = "Type";
pType.ParameterType = typeof(System.String);
pType.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 2,
Mandatory = true
});
pType.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("Type", pType);
var pVersion = new RuntimeDefinedParameter();
pVersion.Name = "Version";
pVersion.ParameterType = typeof(System.String);
pVersion.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 3,
Mandatory = true
});
pVersion.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("Version", pVersion);
var pArgumentList = new RuntimeDefinedParameter();
pArgumentList.Name = "ArgumentList";
pArgumentList.ParameterType = typeof(object[]);
pArgumentList.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByStaticParameters",
Position = 4,
Mandatory = true
});
pArgumentList.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ArgumentList", pArgumentList);
return dynamicParameters;
}
示例8: CreateContainerServiceCreateOrUpdateDynamicParameters
protected object CreateContainerServiceCreateOrUpdateDynamicParameters()
{
dynamicParameters = new RuntimeDefinedParameterDictionary();
var pResourceGroupName = new RuntimeDefinedParameter();
pResourceGroupName.Name = "ResourceGroupName";
pResourceGroupName.ParameterType = typeof(string);
pResourceGroupName.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 1,
Mandatory = true
});
pResourceGroupName.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ResourceGroupName", pResourceGroupName);
var pContainerServiceName = new RuntimeDefinedParameter();
pContainerServiceName.Name = "Name";
pContainerServiceName.ParameterType = typeof(string);
pContainerServiceName.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 2,
Mandatory = true
});
pContainerServiceName.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("Name", pContainerServiceName);
var pParameters = new RuntimeDefinedParameter();
pParameters.Name = "ContainerService";
pParameters.ParameterType = typeof(ContainerService);
pParameters.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 3,
Mandatory = true
});
pParameters.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ContainerService", pParameters);
var pArgumentList = new RuntimeDefinedParameter();
pArgumentList.Name = "ArgumentList";
pArgumentList.ParameterType = typeof(object[]);
pArgumentList.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByStaticParameters",
Position = 4,
Mandatory = true
});
pArgumentList.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ArgumentList", pArgumentList);
return dynamicParameters;
}
示例9: CreateVirtualMachineStartRolesDynamicParameters
protected object CreateVirtualMachineStartRolesDynamicParameters()
{
dynamicParameters = new RuntimeDefinedParameterDictionary();
var pServiceName = new RuntimeDefinedParameter();
pServiceName.Name = "ServiceName";
pServiceName.ParameterType = typeof(System.String);
pServiceName.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 1,
Mandatory = true
});
pServiceName.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ServiceName", pServiceName);
var pDeploymentName = new RuntimeDefinedParameter();
pDeploymentName.Name = "DeploymentName";
pDeploymentName.ParameterType = typeof(System.String);
pDeploymentName.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 2,
Mandatory = true
});
pDeploymentName.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("DeploymentName", pDeploymentName);
var pParameters = new RuntimeDefinedParameter();
pParameters.Name = "VirtualMachineStartRolesParameters";
pParameters.ParameterType = typeof(Microsoft.WindowsAzure.Management.Compute.Models.VirtualMachineStartRolesParameters);
pParameters.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 3,
Mandatory = true
});
pParameters.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("VirtualMachineStartRolesParameters", pParameters);
var pArgumentList = new RuntimeDefinedParameter();
pArgumentList.Name = "ArgumentList";
pArgumentList.ParameterType = typeof(object[]);
pArgumentList.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByStaticParameters",
Position = 4,
Mandatory = true
});
pArgumentList.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ArgumentList", pArgumentList);
return dynamicParameters;
}
示例10: CreateVirtualMachineRestartDynamicParameters
protected object CreateVirtualMachineRestartDynamicParameters()
{
dynamicParameters = new RuntimeDefinedParameterDictionary();
var pServiceName = new RuntimeDefinedParameter();
pServiceName.Name = "ServiceName";
pServiceName.ParameterType = typeof(System.String);
pServiceName.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 1,
Mandatory = true
});
pServiceName.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ServiceName", pServiceName);
var pDeploymentName = new RuntimeDefinedParameter();
pDeploymentName.Name = "DeploymentName";
pDeploymentName.ParameterType = typeof(System.String);
pDeploymentName.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 2,
Mandatory = true
});
pDeploymentName.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("DeploymentName", pDeploymentName);
var pVirtualMachineName = new RuntimeDefinedParameter();
pVirtualMachineName.Name = "VirtualMachineName";
pVirtualMachineName.ParameterType = typeof(System.String);
pVirtualMachineName.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 3,
Mandatory = true
});
pVirtualMachineName.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("VirtualMachineName", pVirtualMachineName);
var pArgumentList = new RuntimeDefinedParameter();
pArgumentList.Name = "ArgumentList";
pArgumentList.ParameterType = typeof(object[]);
pArgumentList.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByStaticParameters",
Position = 4,
Mandatory = true
});
pArgumentList.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ArgumentList", pArgumentList);
return dynamicParameters;
}
示例11: CreateForNewItem
public RuntimeDefinedParameterDictionary CreateForNewItem()
{
var parameters = new RuntimeDefinedParameterDictionary();
var attrs = from row in _columns
let nullable = (bool)row["IS_NULLABLE"]
let primaryKey = (bool)row["PRIMARY_KEY"]
let columnName = row["COLUMN_NAME"].ToString()
let dataType = ConvertSqliteTypeToType( row["DATA_TYPE"].ToString() )
select new RuntimeDefinedParameter(
columnName,
dataType,
new Collection<Attribute>
{
new ParameterAttribute()
{
Mandatory = ! nullable && ! primaryKey,
ValueFromPipelineByPropertyName = true,
},
}
);
attrs.ToList().ForEach(attr => parameters.Add(attr.Name, attr));
return parameters;
}
示例12: CreateVirtualMachineExtensionListVersionsDynamicParameters
protected object CreateVirtualMachineExtensionListVersionsDynamicParameters()
{
dynamicParameters = new RuntimeDefinedParameterDictionary();
var pPublisherName = new RuntimeDefinedParameter();
pPublisherName.Name = "PublisherName";
pPublisherName.ParameterType = typeof(System.String);
pPublisherName.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 1,
Mandatory = true
});
pPublisherName.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("PublisherName", pPublisherName);
var pExtensionName = new RuntimeDefinedParameter();
pExtensionName.Name = "ExtensionName";
pExtensionName.ParameterType = typeof(System.String);
pExtensionName.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 2,
Mandatory = true
});
pExtensionName.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ExtensionName", pExtensionName);
var pArgumentList = new RuntimeDefinedParameter();
pArgumentList.Name = "ArgumentList";
pArgumentList.ParameterType = typeof(object[]);
pArgumentList.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByStaticParameters",
Position = 3,
Mandatory = true
});
pArgumentList.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ArgumentList", pArgumentList);
return dynamicParameters;
}
示例13: CreateVirtualMachineVMImageDeleteDynamicParameters
protected object CreateVirtualMachineVMImageDeleteDynamicParameters()
{
dynamicParameters = new RuntimeDefinedParameterDictionary();
var pVMImageName = new RuntimeDefinedParameter();
pVMImageName.Name = "VMImageName";
pVMImageName.ParameterType = typeof(System.String);
pVMImageName.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 1,
Mandatory = true
});
pVMImageName.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("VMImageName", pVMImageName);
var pDeleteFromStorage = new RuntimeDefinedParameter();
pDeleteFromStorage.Name = "DeleteFromStorage";
pDeleteFromStorage.ParameterType = typeof(System.Boolean);
pDeleteFromStorage.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByDynamicParameters",
Position = 2,
Mandatory = true
});
pDeleteFromStorage.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("DeleteFromStorage", pDeleteFromStorage);
var pArgumentList = new RuntimeDefinedParameter();
pArgumentList.Name = "ArgumentList";
pArgumentList.ParameterType = typeof(object[]);
pArgumentList.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByStaticParameters",
Position = 3,
Mandatory = true
});
pArgumentList.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ArgumentList", pArgumentList);
return dynamicParameters;
}
示例14: CreateOperatingSystemListDynamicParameters
protected object CreateOperatingSystemListDynamicParameters()
{
dynamicParameters = new RuntimeDefinedParameterDictionary();
var pArgumentList = new RuntimeDefinedParameter();
pArgumentList.Name = "ArgumentList";
pArgumentList.ParameterType = typeof(object[]);
pArgumentList.Attributes.Add(new ParameterAttribute
{
ParameterSetName = "InvokeByStaticParameters",
Position = 1,
Mandatory = true
});
pArgumentList.Attributes.Add(new AllowNullAttribute());
dynamicParameters.Add("ArgumentList", pArgumentList);
return dynamicParameters;
}
示例15: Create
public object Create()
{
var type = _metadata.GetMappedClass(EntityMode.Poco);
var parameters = new RuntimeDefinedParameterDictionary();
var attrs = from prop in type.GetProperties()
// where prop.Name != _metadata.IdentifierPropertyName
select new RuntimeDefinedParameter(
prop.Name,
prop.PropertyType,
new Collection<Attribute>
{
new ParameterAttribute()
}
);
attrs.ToList().ForEach(attr => parameters.Add(attr.Name, attr));
return parameters;
}