本文整理汇总了C#中ModelType类的典型用法代码示例。如果您正苦于以下问题:C# ModelType类的具体用法?C# ModelType怎么用?C# ModelType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModelType类属于命名空间,在下文中一共展示了ModelType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IModelo2D
/// <summary>
/// Initializes a new instance of the <see cref="IModelo2D"/> class.
/// </summary>
/// <param name="ModelType">Type of the model.</param>
public IModelo2D(ModelType ModelType)
{
this.ModelType = ModelType;
LayerDepth = 0;
SourceRectangle = null;
Rotation = 0;
}
示例2: MyModel
public MyModel(Project1Game game, VertexPositionColor[] shapeArray, String textureName)
{
this.vertices = Buffer.Vertex.New(game.GraphicsDevice, shapeArray);
this.inputLayout = VertexInputLayout.New<VertexPositionColor>(0);
vertexStride = Utilities.SizeOf<VertexPositionColor>();
modelType = ModelType.Colored;
}
示例3: GenConvertToModel
public static void GenConvertToModel(StringBuilder builder, ModelType Model)
{
string ModelName = Model.Name.Value;
builder.AppendLine(GeneratorUtil.TabString(1) + @"public static " + ModelName + " " + GetConvertName(Model.Name.Value) + "(DataRow row )");
builder.AppendLine(GeneratorUtil.TabString(1) + "{");
builder.AppendLine(GeneratorUtil.TabString(2) + ModelName + " info = new " + ModelName + "();");
foreach (FieldType field in Model.MyFields)
{
string systemType = field.SystemType.Value;
string fieldName = field.Name.Value;
string columnName = field.ColumnName.Value;
builder.AppendLine(GeneratorUtil.TabString(2) + "if ( row[\"" + columnName + "\"] == DBNull.Value)");
builder.AppendLine(GeneratorUtil.TabString(2) + "{");
if (!field.NullAble.Value)
{
builder.AppendLine(GeneratorUtil.TabString(3) + "info." + fieldName + " = default(" + systemType + ");");
}
builder.AppendLine(GeneratorUtil.TabString(2) + "}");
builder.AppendLine(GeneratorUtil.TabString(2) + "else");
builder.AppendLine(GeneratorUtil.TabString(2) + "{");
builder.AppendLine(GeneratorUtil.TabString(3) + "info." + fieldName + " = (" + systemType + ")row[\"" + columnName + "\"];");
builder.AppendLine(GeneratorUtil.TabString(2) + "}");
}
builder.AppendLine(GeneratorUtil.TabString(2) + "return info;");
builder.AppendLine(GeneratorUtil.TabString(1) + "}");
}
示例4: HandRepresentation
public HandRepresentation(int handID, Hand hand, Chirality chirality, ModelType modelType) {
HandID = handID;
this.MostRecentHand = hand;
this.RepChirality = chirality;
this.RepType = modelType;
}
示例5: NewDbContextTemplateModel
public NewDbContextTemplateModel(string dbContextName, ModelType modelType)
{
if (dbContextName == null)
{
throw new ArgumentNullException(nameof(dbContextName));
}
if (modelType == null)
{
throw new ArgumentNullException(nameof(modelType));
}
var modelNamespace = modelType.Namespace;
ModelTypeName = modelType.Name;
RequiredNamespaces = new HashSet<string>();
var classNameModel = new ClassNameModel(dbContextName);
DbContextTypeName = classNameModel.ClassName;
DbContextNamespace = classNameModel.NamespaceName;
if (!string.IsNullOrEmpty(modelNamespace) &&
!string.Equals(modelNamespace, DbContextNamespace, StringComparison.Ordinal))
{
RequiredNamespaces.Add(modelNamespace);
}
}
示例6: JsonInstance
internal JsonInstance(ModelType type, string id)
{
this.Type = type;
this.Id = id;
this.instance = new ModelInstance(this);
instanceProperties = new object[Type.Properties.Count];
}
示例7: IsASupportedModelType
public static bool IsASupportedModelType(ModelType modelType)
{
switch(modelType)
{
case ModelType.Truss1D:
return false;
case ModelType.Beam1D:
return true;
case ModelType.Truss2D:
return false;
case ModelType.Frame2D:
return true;
case ModelType.Slab2D:
return true;
case ModelType.Membrane2D:
return false;
case ModelType.Truss3D:
return false;
case ModelType.Membrane3D:
return false;
case ModelType.MultiStorey2DSlab:
return true;
case ModelType.Full3D:
return true;
default:
throw new NotImplementedException(string.Format(
System.Globalization.CultureInfo.InvariantCulture,
"Linear3DBeam.IsSupportedModelType(ModelType) has not been defined for a model type of {0}",
modelType));
}
}
示例8: LoadData
private async void LoadData(Uri location, ModelType modelType = ModelType.Line)
{
if (HttpClient != null)
{
_httpClient.BaseAddress = location;
var response = await _httpClient.GetAsync(_httpClient.BaseAddress);
response.EnsureSuccessStatusCode();
var jsonResult = response.Content.ReadAsStringAsync().Result;
var resultArray = JsonConvert.DeserializeObject(jsonResult);
var result = resultArray as JArray;
switch (modelType)
{
case ModelType.Line:
foreach (JObject jsonObj in result)
{
Line line = JsonConvert.DeserializeObject<Line>(jsonObj.ToString());
Lines.Add(line);
}
break;
case ModelType.Stop:
foreach (var jsonObj in result)
{
var stop = JsonConvert.DeserializeObject<Stop>(jsonObj.ToString());
Stops.Add(stop);
}
break;
default:
break;
}
}
}
示例9: MakeHandRepresentation
public override HandRepresentation MakeHandRepresentation(Leap.Hand hand, ModelType modelType)
{
HandRepresentation handRep = null;
for (int i = 0; i < ModelPool.Count; i++) {
IHandModel model = ModelPool[i];
bool isCorrectHandedness;
if(model.Handedness == Chirality.Either) {
isCorrectHandedness = true;
} else {
Chirality handChirality = hand.IsRight ? Chirality.Right : Chirality.Left;
isCorrectHandedness = model.Handedness == handChirality;
}
bool isCorrectModelType;
isCorrectModelType = model.HandModelType == modelType;
if(isCorrectHandedness && isCorrectModelType) {
ModelPool.RemoveAt(i);
handRep = new HandProxy(this, model, hand);
break;
}
}
return handRep;
}
示例10: MyModel
public MyModel(LabGame game, VertexPositionColor[] shapeArray, String textureName, float collisionRadius)
{
this.vertices = Buffer.Vertex.New(game.GraphicsDevice, shapeArray);
this.inputLayout = VertexInputLayout.New<VertexPositionColor>(0);
vertexStride = Utilities.SizeOf<VertexPositionColor>();
modelType = ModelType.Colored;
this.collisionRadius = collisionRadius;
}
示例11: ModelMethodParameter
protected ModelMethodParameter(ModelMethod method, string name, Type parameterType, ModelType referenceType, bool isList)
{
this.Method = method;
this.Name = name;
this.ParameterType = parameterType;
this.ReferenceType = referenceType;
this.IsList = isList;
}
示例12: SaveResearchInfo
private void SaveResearchInfo(Guid researchID,
string researchName,
ResearchType rType,
ModelType mType,
int realizationCount)
{
throw new NotImplementedException();
}
示例13: DisplaySetServiceArgumentInfo
/// <summary>
/// Constructor
/// </summary>
/// <param name="dsElementName"></param>
/// <param name="dataType"></param>
/// <param name="alias"></param>
/// <param name="allowsNull"></param>
public DisplaySetServiceArgumentInfo(string name, string dsElementName, ModelType dataType, string alias, bool allowsNull)
{
mName = name;
mDSElementName = dsElementName;
mDataType = dataType;
mAlias = alias;
mAllowsNull = allowsNull;
}
示例14: HandProxy
public HandProxy(HandPool parent, Hand hand, Chirality repChirality, ModelType repType) :
base(hand.Id, hand, repChirality, repType)
{
this.parent = parent;
this.RepChirality = repChirality;
this.RepType = repType;
this.MostRecentHand = hand;
}
示例15: ModelInfo
/// <summary>
/// Constructor
/// </summary>
public ModelInfo(string projectId, string modelId, List<Guid> elementIds, ModelType modelType)
{
ProjectId = projectId;
ModelId = modelId;
ElementIds = elementIds;
ModelType = modelType;
_controller = DataController.Instance;
}