本文整理汇总了C#中ParameterType类的典型用法代码示例。如果您正苦于以下问题:C# ParameterType类的具体用法?C# ParameterType怎么用?C# ParameterType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParameterType类属于命名空间,在下文中一共展示了ParameterType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InvocationParameterInfo
public InvocationParameterInfo(string name, int index, Type type, ParameterType parameterType)
{
Name = name;
Index = index;
Type = type;
ParameterType = parameterType;
}
示例2: Parameter
public Parameter(ParameterType parType, TokenTypes tokType, object column, object value)
{
this.TokType = tokType;
this.ParType = parType;
this.Column = column.ToString();
this.Value = value;
}
示例3: DrawGUI
public override void DrawGUI(IntelligenceState parentState, Intelligence intelligence, CallbackCollection callbacks)
{
#if UNITY_EDITOR
UnityEditor.EditorGUILayout.BeginHorizontal();
UnityEngine.GUILayout.Label("Method name:");
methodName = UnityEditor.EditorGUILayout.TextField(methodName);
UnityEditor.EditorGUILayout.EndHorizontal();
useTargetVar = UnityEditor.EditorGUILayout.Toggle("Use other target", useTargetVar);
if (useTargetVar)
{
UnityEditor.EditorGUILayout.BeginHorizontal();
UnityEngine.GUILayout.Label("Target var name:");
targetVarName = UnityEditor.EditorGUILayout.TextField(targetVarName);
UnityEditor.EditorGUILayout.EndHorizontal();
}
paramType = (ParameterType)UnityEditor.EditorGUILayout.EnumPopup("Parameter:", paramType);
if (paramType == ParameterType.VarValue)
{
UnityEditor.EditorGUILayout.BeginHorizontal();
UnityEngine.GUILayout.Label("Var name:");
paramTypeValue = UnityEditor.EditorGUILayout.TextField(paramTypeValue);
UnityEditor.EditorGUILayout.EndHorizontal();
}
if (paramType == ParameterType.String)
{
UnityEditor.EditorGUILayout.BeginHorizontal();
UnityEngine.GUILayout.Label("Value:");
paramTypeValue = UnityEditor.EditorGUILayout.TextField(paramTypeValue);
UnityEditor.EditorGUILayout.EndHorizontal();
}
#endif
}
示例4: PersistedParameterInfo
public PersistedParameterInfo(string name, ParameterType parameterType, bool nullable, string defaultValue)
{
Name = name;
ParameterType = parameterType;
Nullable = nullable;
DefaultValue = defaultValue;
}
示例5: ProcedureParameter
public ProcedureParameter(string name, ParameterType type, object value, int size)
{
Name = name;
Type = type;
Value = value;
Size = size;
}
示例6: ParameterDefinition
public ParameterDefinition(string name, ParameterType type, int min, int max)
{
this.name = name;
this.type = type;
this.min = min;
this.max = max;
}
示例7: Parameter
public Parameter(ParameterInfo parameterInfo, object value, ParameterType parameterType)
{
ParameterInfo = parameterInfo;
ParameterValue = value;
ParameterType = parameterType;
Type = value.GetType();
}
示例8: Parameter
public Parameter(string name, ParameterType type, string minValue, string maxValue)
{
this.nameField = name;
this.typeField = type;
this.minValueField = minValue;
this.maxValueField = maxValue;
}
示例9: Parameter
public Parameter(string name, ParameterType type, string desc, int value = 0)
{
Name = name;
ParameterType = type;
Description = desc;
Value = value;
}
示例10: ParameterControl
public ParameterControl(ArticleRecord article, ParameterType type, int batchNumber)
: this()
{
Article = article;
_parameterType = type;
InitPropertiesByType(type);
BatchNumber = batchNumber;
NewMeasurementsDataGrid.ItemsSource = _batch;
InitUpdateMeasuredValueTimer();
_inputDevice.DataReceived += inputDevice_DataReceived;
_inputDevice.ErrorReceived += inputDevice_ErrorReceived;
_bwloader.DoWork += bwloader_DoWork;
_bwloader.RunWorkerCompleted += bwloader_RunWorkerCompleted;
//MeasuringValueBG1.Minimum = MeasuringValueBG2.Minimum = _nominalValue;
//MeasuringValueBG2.Maximum = _maxValue + 3;
//_difference = _nominalValue - _minValue;
//MeasuringValueBG1.Maximum = _nominalValue + _difference +3;
MeasuringValueBG1.Minimum = MeasuringValueBG2.Minimum = _nominalValue;
MeasuringValueBG2.Maximum = 14;
_difference = _nominalValue - _minValue;
MeasuringValueBG1.Maximum = 14;
_bwloader.RunWorkerAsync();
}
示例11: GetParameterType
private static Anito.Data.ParameterType GetParameterType(ParameterType parameterType)
{
switch (parameterType)
{
case ParameterType.Binary:
return Anito.Data.ParameterType.Binary;
case ParameterType.Boolean:
return Anito.Data.ParameterType.Boolean;
case ParameterType.Byte:
return Anito.Data.ParameterType.Byte;
case ParameterType.Currency:
return Anito.Data.ParameterType.Currency;
case ParameterType.DateTime:
return Anito.Data.ParameterType.DateTime;
case ParameterType.Decimal:
return Anito.Data.ParameterType.Decimal;
case ParameterType.Double:
return Anito.Data.ParameterType.Double;
case ParameterType.Int16:
return Anito.Data.ParameterType.Int16;
case ParameterType.Int32:
return Anito.Data.ParameterType.Int32;
case ParameterType.Int64:
return Anito.Data.ParameterType.Int64;
case ParameterType.Single:
return Anito.Data.ParameterType.Single;
case ParameterType.String:
return Anito.Data.ParameterType.String;
case ParameterType.UId:
return Anito.Data.ParameterType.UId;
default:
return Anito.Data.ParameterType.String;
}
}
示例12: ToParameters
/// <summary>
/// Converts the object to an array of RestSharp parameters.
/// </summary>
/// <returns>The array of RestSharp parameters.</returns>
public IEnumerable<Parameter> ToParameters(ParameterType type)
{
List<Parameter> output = new List<Parameter>();
//Inspiration for this code from https://github.com/jaymedavis/stripe.net
foreach (PropertyInfo property in GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance))
{
object value = property.GetValue(this, null);
string propName = property.Name;
if (value == null)
{
continue;
}
if (property.CustomAttributes.Any(x => x.AttributeType == typeof(JsonPropertyAttribute)))
{
//Get the JsonPropertyAttribute for this property, which will give us its JSON name
JsonPropertyAttribute attribute = property.GetCustomAttributes(typeof(JsonPropertyAttribute), false).Cast<JsonPropertyAttribute>().FirstOrDefault();
propName = attribute != null ? attribute.PropertyName : property.Name;
}
var parameter = ToSingleParameter(propName, value, property, type);
output.Add(parameter);
}
return output;
}
示例13: WrongParameterTypeException
internal WrongParameterTypeException(string parameterName, ParameterType oldParameterType, ParameterType newParameterType)
{
mParameterName = parameterName;
mOldParameterType = oldParameterType;
mNewParameterType = newParameterType;
}
示例14: GetParameter
/// <summary>
/// Returns shared or built-in parameter of the specified name. parameter.IsShared property identifies the type.
/// If it does not exist it is created in the shared parameters file with specified name in the specified group. That must be defined in advance
/// using SetDefinitionFile() function.
/// </summary>
/// <param name="paramType">Type of the parameter (simplified to base data types)</param>
/// <param name="groupName">Name of the group of the shared parameters</param>
/// <param name="parameterName">Name of the parameter</param>
/// <param name="group">Revit built in parameter group where the parameter is to be created if it doesn't exist</param>
/// <returns>Existing or new parameter</returns>
public static Parameter GetParameter(this Element element, ParameterType paramType, string parameterName, BuiltInParameterGroup group)
{
Parameter parameter = element.get_Parameter(parameterName);
if (parameter != null)
{
//check type and throw error if the type is different
if (parameter.Definition.ParameterType == paramType)
return parameter; //returns existing parameter (it could be any type of parameter not only shared parameter)
else
throw new Exception(String.Format("Parameter type mismatch for pID '{0}': existing type: {1}, desired type {2}.", parameterName, parameter.Definition.ParameterType, paramType));
}
// Create a category set and insert category of wall to it
CategorySet myCategories = element.Document.Application.Create.NewCategorySet();
// Use BuiltInCategory to get category of wall
Category myCategory = element.Category;
myCategories.Insert(myCategory);
bool success = SetNewSharedParameter(element, paramType, myCategories, parameterName, group);
if (!success)
{
Debug.WriteLine("Parameter creation not successfull.\nParameter name: " + parameterName + "\n Existing parameters:");
foreach (Parameter par in element.Parameters)
{
Debug.WriteLine("Parameter name: " + par.Definition.Name + ", group: " + Enum.GetName(typeof(BuiltInParameterGroup), par.Definition.ParameterGroup));
}
throw new Exception("Parameter creation failed.");
}
parameter = element.get_Parameter(parameterName);
return parameter;
}
示例15: JConnect
public JConnect(IDbConnection connection)
{
this.connection = connection;
commandTimeout = 30;
Type type = connection.GetType();
if (type == typeof(System.Data.Odbc.OdbcConnection))
{
typeOfParameter = ParameterType.QuestionMark;
typeOfVendor = VendorType.Odbc;
}
else if (type == typeof(System.Data.OleDb.OleDbConnection))
{
typeOfParameter = ParameterType.QuestionMark;
typeOfVendor = VendorType.OleDb;
}
else if (type == typeof(System.Data.SqlClient.SqlConnection))
{
typeOfParameter = ParameterType.AtSymbol;
typeOfVendor = VendorType.SqlServer;
GetReturningProc += new GetReturningHandler(SqlServerReturning);
}
else
{
typeOfParameter = ParameterType.Colon;
typeOfVendor = VendorType.Oracle;
GetReturningProc += new GetReturningHandler(OracleReturning);
}
GetTimeStampProc += new GetTimeStampHandler(DefaultGetTimeStampProc);
}