• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ModelType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ModelType的典型用法代码示例。如果您正苦于以下问题:C# ModelType类的具体用法?C# ModelType怎么用?C# ModelType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ModelType类属于命名空间,在下文中一共展示了ModelType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:11,代码来源:IModelo2D.cs


示例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;
 }
开发者ID:KaiminHuang,项目名称:Graphics,代码行数:7,代码来源:MyModel.cs


示例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) + "}");
        }
开发者ID:koksaver,项目名称:CodeHelper,代码行数:28,代码来源:SqlGenTableDAL.cs


示例4: HandRepresentation

    public HandRepresentation(int handID, Hand hand, Chirality chirality, ModelType modelType) {
      HandID = handID;
      this.MostRecentHand = hand;
      this.RepChirality = chirality;
      this.RepType = modelType;

    }
开发者ID:WilliamRADFunk,项目名称:vedic,代码行数:7,代码来源:HandRepresentation.cs


示例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);
            }
        }
开发者ID:leloulight,项目名称:Scaffolding,代码行数:28,代码来源:NewDbContextTemplateModel.cs


示例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];
 }
开发者ID:vc3,项目名称:ExoModel,代码行数:7,代码来源:JsonInstance.cs


示例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));
     }
 }
开发者ID:iainsproat,项目名称:SharpFE,代码行数:31,代码来源:Linear3DBeam.cs


示例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;
                }
            }
        }
开发者ID:lanedraex,项目名称:easybus-xamarin,代码行数:35,代码来源:EasyBus.cs


示例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;
        }
开发者ID:VRWizards,项目名称:VR-Project,代码行数:25,代码来源:HandPool.cs


示例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;
 }
开发者ID:georgecai904,项目名称:mazeball,代码行数:8,代码来源:MyModel.cs


示例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;
 }
开发者ID:vc3,项目名称:ExoModel,代码行数:8,代码来源:ModelMethodParameter.cs


示例12: SaveResearchInfo

 private void SaveResearchInfo(Guid researchID, 
     string researchName,
     ResearchType rType,
     ModelType mType,
     int realizationCount)
 {
     throw new NotImplementedException();
 }
开发者ID:aramazhari,项目名称:complexnetwork,代码行数:8,代码来源:SQLResultStorage.cs


示例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;
 }
开发者ID:sgon1853,项目名称:UPM_MDD_Thesis,代码行数:15,代码来源:DisplaySetServiceArgumentInfo.cs


示例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;
 }
开发者ID:WilliamRADFunk,项目名称:vedic,代码行数:8,代码来源:HandProxy.cs


示例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;
        }
开发者ID:corneliuspreidel,项目名称:TUM.CMS.VPLControl,代码行数:12,代码来源:ModelInfo.cs


示例16: ApplyDisplayFormat

        /// <summary>
        /// Apply display format by default for all data types
        /// All the values will be shown using those formats
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="dataType">Data type.</param>
        /// <returns>string.</returns>
        public static string ApplyDisplayFormat(object value, ModelType dataType)
        {
            if (value == null)
            {
                return string.Empty;
            }
            try
            {
                string format = GetDefaultDisplayMask(dataType);
                switch (dataType)
                {
                    case ModelType.Date:
                        DateTime DateAux = System.Convert.ToDateTime(value, CultureManager.Culture);
                        return DateAux.ToString(format);

                    case ModelType.DateTime:
                        DateTime DateTimeAux = System.Convert.ToDateTime(value, CultureManager.Culture);
                        return DateTimeAux.ToString(format);

                    case ModelType.Time:
                        DateTime TimeAux = System.Convert.ToDateTime(value.ToString(), CultureManager.Culture);
                        return TimeAux.ToString(format);

                    case ModelType.Autonumeric:
                    case ModelType.Int:
                        int IntAux = System.Convert.ToInt32(value);
                        return IntAux.ToString(format);

                    case ModelType.Nat:
                        UInt32 NatAux = System.Convert.ToUInt32(value);
                        return NatAux.ToString(format);

                    case ModelType.Real:
                        Decimal RealAux = System.Convert.ToDecimal(value);
                        return RealAux.ToString(format);

                    case ModelType.String:
                    case ModelType.Password:
                    case ModelType.Blob:
                    case ModelType.Text:
                        string StringAux = System.Convert.ToString(value);
                        return StringAux.ToString(CultureManager.Culture);

                    case ModelType.Bool:
                        bool BoolAux = System.Convert.ToBoolean(value);
                        return BoolAux.ToString(CultureManager.Culture);

                    default:
                        return value.ToString();
                }
            }
            catch
            {
                return value.ToString();
            }
        }
开发者ID:sgon1853,项目名称:UPM_MDD_Thesis,代码行数:63,代码来源:DefaultFormats.cs


示例17: GH_Model

 public GH_Model(ModelType modelType)
 {
     this.ModelType = modelType;
     this.Model = new FiniteElementModel(ModelType);
     this.Nodes = new List<FiniteElementNode>();
     this.Points = new List<Point3d>();
     this.Results = null;
     this.Elements = new List<GH_Element>();
     this.Loads = new List<GH_Load>();
     this.Supports = new List<GH_Support>();
 }
开发者ID:AndreasBak,项目名称:GrasshopperSharpFE,代码行数:11,代码来源:GH_Model.cs


示例18: ModelSource

        /// <summary>
        /// Creates a new <see cref="ModelSource"/> for the specified root type and path.
        /// </summary>
        /// <param name="rootType">The root type name, which is required for instance paths</param>
        /// <param name="path">The source path, which is either an instance path or a static path</param>
        public ModelSource(ModelType rootType, string path)
        {
            // Raise an error if the specified path is not valid
            if (!pathValidation.IsMatch(path))
                throw new ArgumentException("The specified path, '" + path + "', was not valid path syntax.");

            // Raise an error if the specified path is not valid
            ModelProperty property;
            if (!InitializeFromTypeAndPath(rootType, path, out property))
                throw new ArgumentException("The specified path, '" + path + "', was not valid for the root type of '" + rootType.Name + "'.", "path");
        }
开发者ID:vc3,项目名称:ExoModel,代码行数:16,代码来源:ModelSource.cs


示例19: GetAvailableAnalyzeOptions

        /// <summary>
        /// Retrieves available analyze options for specified research type and model type.
        /// </summary>
        /// <param name="rt">Research type.</param>
        /// <param name="mt">Model type.</param>
        /// <returns>Available analyze options.</returns>
        /// <note>Analyze option is available for research, if it is available 
        /// both for research type and model type.</note>
        public static AnalyzeOption GetAvailableAnalyzeOptions(ResearchType rt, ModelType mt)
        {
            ResearchTypeInfo[] rInfo = (ResearchTypeInfo[])rt.GetType().GetField(rt.ToString()).GetCustomAttributes(typeof(ResearchTypeInfo), false);
            Type researchType = Type.GetType(rInfo[0].Implementation, true);

            AvailableAnalyzeOption rAvailableOptions = ((AvailableAnalyzeOption[])researchType.GetCustomAttributes(typeof(AvailableAnalyzeOption), true))[0];

            ModelTypeInfo[] mInfo = (ModelTypeInfo[])mt.GetType().GetField(mt.ToString()).GetCustomAttributes(typeof(ModelTypeInfo), false);
            Type modelType = Type.GetType(mInfo[0].Implementation, true);

            AvailableAnalyzeOption mAvailableOptions = ((AvailableAnalyzeOption[])modelType.GetCustomAttributes(typeof(AvailableAnalyzeOption), true))[0];

            return rAvailableOptions.Options & mAvailableOptions.Options;
        }
开发者ID:kocharyan-ani,项目名称:random_networks_explorer,代码行数:22,代码来源:StatSessionManager.cs


示例20: GetModelTypeInfo

        public ModelTypeInfo GetModelTypeInfo(ModelType type)
        {
            // Create the set of type instance information if not initialized
            if (Instances == null)
                Instances = new Dictionary<string, ModelTypeInfo>();

            // Get or initialize the model type instance information store
            ModelTypeInfo typeInfo;
            if (!Instances.TryGetValue(type.Name, out typeInfo))
                Instances[type.Name] = typeInfo = new ModelTypeInfo();

            // Return the requested value
            return typeInfo;
        }
开发者ID:vc3,项目名称:ExoWeb,代码行数:14,代码来源:ServiceResponse.cs



注:本文中的ModelType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ModelUser类代码示例发布时间:2022-05-24
下一篇:
C# ModelStateDictionary类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap