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

C# MetaModel类代码示例

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

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



MetaModel类属于命名空间,在下文中一共展示了MetaModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            MetaModel model = new MetaModel();
            model.RegisterContext(() => new YAWAMT.DataClassesDataContext(new Config().ConnectionString), new ContextConfiguration() { ScaffoldAllTables = false });

            routes.Add(new DynamicDataRoute("Data/{table}/ListDetails.aspx")
            {
                Action = PageAction.List,
                ViewName = "ListDetails",
                Model = model
            });
            routes.Add(new DynamicDataRoute("Data/{table}/ListDetails.aspx")
            {
                Action = PageAction.Details,
                ViewName = "ListDetails",
                Model = model
            });

            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            //routes.Add(new DynamicDataRoute("Data/{table}/{action}.aspx")
            //{
            //    Constraints = new RouteValueDictionary(new { action = "List|Details|Edit|Insert" }),
            //    Model = model
            //});

            routes.MapRoute(
                "Default",                                              // Route name
                "{controller}/{action}/{id}",                           // URL with parameters
                new { controller = "Home", action = "Index", id = "" }  // Parameter defaults
            );
        }
开发者ID:overeemm,项目名称:yawamt,代码行数:32,代码来源:Global.asax.cs


示例2: Water

 public Water(Map.Map map)
 {
     MainGraphic = new MetaModel
     {
         AlphaRef = 0,
         HasAlpha = true,
         IsWater = true,
         Texture = new TextureFromFile("Models/Props/Sky1.png"),
         SpecularTexture = new TextureFromFile("Models/Props/WaterSpecular1.png"),
         ReceivesAmbientLight = Priority.Never,
         ReceivesDiffuseLight = Priority.Never,
         ReceivesSpecular = Priority.Never,
         SpecularExponent = 3,
         TextureAddress = SlimDX.Direct3D9.TextureAddress.Wrap,
         XMesh = new MeshConcretize
         {
             MeshDescription = new Graphics.Software.Meshes.IndexedPlane
             {
                 Position = Common.Math.ToVector3(map.Settings.Position) +
                     Vector3.UnitZ * map.Settings.WaterHeight,
                 Size = new Vector2(map.Ground.Size.Width, map.Ground.Size.Height),
                 UVMin = Vector2.Zero,
                 UVMax = new Vector2(1, 1),
                 Facings = Facings.Frontside
             },
             Layout = global::Graphics.Software.Vertex.PositionNormalTexcoord.Instance
         },
     };
     //VisibilityLocalBounding = new BoundingBox(new Vector3(-1000, -1000, -1000), new Vector3(1000, 1000, 1000))
     VisibilityLocalBounding = new Common.Bounding.NonfittableBounding(new BoundingBox(new Vector3(-1000, -1000, -1000), new Vector3(1000, 1000, 1000)), false, true);
 }
开发者ID:ChristianMarchiori,项目名称:DeadMeetsLead,代码行数:31,代码来源:Water.cs


示例3: BoxBlocker

 public BoxBlocker()
 {
     Vector3 minPoint = new Vector3(-1, -1, 0);
     Vector3 maxPoint = new Vector3(1, 1, 2);
     MainGraphic = new MetaModel
     {
         XMesh = new MeshConcretize
         {
             MeshDescription =
                 new global::Graphics.Software.Meshes.BoxMesh(minPoint, maxPoint, Facings.Frontside, false),
             Layout = global::Graphics.Software.Vertex.PositionNormalTexcoord.Instance
         },
         HasAlpha = true,
         Texture = new TextureFromFile("Models/Effects/Blue1.png"),
         ReceivesAmbientLight = Priority.Never,
         ReceivesDiffuseLight = Priority.Never,
     };
     PickingLocalBounding = VisibilityLocalBounding = new MetaBoundingBox
     {
         Mesh = ((MetaModel)MainGraphic).XMesh,
         Transformation = ((MetaModel)MainGraphic).World
     };
     //PhysicsLocalBounding = CreatePhysicsMeshBounding((MetaModel)MainGraphic);
     PhysicsLocalBounding = new Common.Bounding.Box { LocalBoundingBox = new BoundingBox(minPoint, maxPoint) };
 }
开发者ID:ChristianMarchiori,项目名称:DeadMeetsLead,代码行数:25,代码来源:Props.cs


示例4: Point

 public Point()
 {
     MainGraphic = new MetaModel
     {
         XMesh = new MeshConcretize
         {
             MeshDescription =
                 new global::Graphics.Software.Meshes.BoxMesh(new Vector3(-0.1f, -0.1f, 0), new Vector3(0.1f, 0.1f, 0.2f), Facings.Frontside, false),
             Layout = global::Graphics.Software.Vertex.PositionNormalTexcoord.Instance
         },
         Texture = new TextureConcretizer
         {
             TextureDescription = new global::Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.Blue)
         },
         ReceivesAmbientLight = Priority.Never,
         ReceivesDiffuseLight = Priority.Never,
     };
     PickingLocalBounding = VisibilityLocalBounding = new MetaBoundingBox
     {
         Mesh = ((MetaModel)MainGraphic).XMesh,
         Transformation = ((MetaModel)MainGraphic).World
     };
     VisibleInGame = false;
     Dynamic = false;
 }
开发者ID:ChristianMarchiori,项目名称:DeadMeetsLead,代码行数:25,代码来源:Point.cs


示例5: Insert

 public void Insert(Content.Model9 model, Entity e, MetaModel metaResource, string metaName)
 {
     RenderSplatMesh m;
     if (!SplatMeshes.TryGetValue(model.XMesh, out m))
         SplatMeshes[model.XMesh] = m = new RenderSplatMesh();
     m.Insert(model, e, metaResource, metaName);
 }
开发者ID:ChristianMarchiori,项目名称:DeadMeetsLead,代码行数:7,代码来源:RenderSplatTechnique.cs


示例6: PropertiesOptimization

 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="metaModel"></param>
 /// <param name="modelContext"></param>
 public PropertiesOptimization(MetaModel metaModel, LibraryModelContext modelContext)
     : base(metaModel, modelContext)
 {
     InvolvedProperties = new List<DomainProperty>();
     this.CreateIntermediate = false;
     this.IsInheritance = false;
 }
开发者ID:apoorv-vijay-joshi,项目名称:FSE-2011-PDE,代码行数:12,代码来源:PropertiesOptimization.cs


示例7: Projectile

        public Projectile()
        {
            MainGraphic = new MetaModel
            {
                XMesh = new MeshConcretize
                {
                    MeshDescription = new Graphics.Software.Meshes.IndexedPlane
                    {
                        Position = Vector3.Zero,
                        Size = new Vector2(1, 1),
                        UVMin = new Vector2(0, 0),
                        UVMax = new Vector2(1, 1),
                        Facings = global::Graphics.Facings.Frontside
                    },
                    Layout = global::Graphics.Software.Vertex.PositionNormalTexcoord.Instance,
                },
                World = Matrix.Translation(-0.5f, -1, 0) * Matrix.Scaling(0.08f, 1.0f, 1)
                    //* Matrix.RotationZ((float)Math.PI/2f)
                    * Matrix.RotationX(-(float)Math.PI/2f)
                    ,
                Texture = new TextureFromFile("Models/Effects/Trajectory1.png"),
                HasAlpha = true,
                Opacity = 0.5f
            };
            VisibilityLocalBounding = new Common.Bounding.NonfittableBounding(Vector3.Zero, false, true);
            PickingLocalBounding = new MetaBoundingBox
            {
                Mesh = ((MetaModel)MainGraphic).XMesh,
                Transformation = ((MetaModel)MainGraphic).World
            };
            PhysicsLocalBounding = Vector3.Zero;

            TimeToLive = 0.4f;
            Updateable = true;
        }
开发者ID:ChristianMarchiori,项目名称:DeadMeetsLead,代码行数:35,代码来源:Projectiles.cs


示例8: GroundSplatterDecal

        public GroundSplatterDecal()
        {
            var size = new Vector2(5 * ((float)Game.Random.NextDouble() * 0.2f + 0.4f), 5 * ((float)Game.Random.NextDouble() * 0.2f + 0.4f));
            var gridPosition = Common.Math.ToVector3(-size / 2f);
            MainGraphic = new MetaModel
            {
                AlphaRef = 0,
                HasAlpha = true,
                Texture = new TextureFromFile("Models/Effects/Bloodsplatter3.png"),
                SpecularTexture = new TextureFromFile("Models/Effects/BloodsplatterSpecular3.png"),
                DontSort = true,
#if USE_OLD_GROUND_DECALS
                World = Matrix.Translation(0, 0, 0.01f),
#else
                World = Matrix.Scaling(size.X, size.Y, 1) * Matrix.Translation(gridPosition.X, gridPosition.Y, 0.01f),
#endif
                TextureAddress = SlimDX.Direct3D9.TextureAddress.Clamp,
                ReceivesSpecular = Priority.Medium,
                ReceivesShadows = Priority.High,
                SpecularExponent = 10,
            };
            RotateUV = true;
            Orientation = (float)Game.Random.NextDouble() *
                    (float)Math.PI * 2.0f;
            SnapPositionToHeightmap = DecalSnapping.SnapAndUVAntiSnap;
#if USE_OLD_GROUND_DECALS
            SnapSizeToHeightmap = true;
            Size = size;
            GridPosition = gridPosition;
#else
            SnapSizeToHeightmap = DecalSnapping.Snap;
#endif
            Dynamic = false;
        }
开发者ID:ChristianMarchiori,项目名称:DeadMeetsLead,代码行数:34,代码来源:Decals.cs


示例9: Rotten

        public Rotten()
        {
            HitPoints = MaxHitPoints = 40;
            RunSpeed = MaxRunSpeed = 2.5f;
            HeadOverBarHeight = 1.25f;
            SilverYield = 1;
            SplatRequiredDamagePerc = 0;
            RageYield = 6f;

            MainGraphic = new MetaModel
            {
                SkinnedMesh = new SkinnedMeshFromFile("Models/Units/Rotten1.x"),
                Texture = new TextureFromFile("Models/Units/Rotten1.png"),
                SpecularTexture = new TextureFromFile("Models/Units/RottenSpecular1.png"),
                World = SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.Scaling(0.1f, 0.1f, 0.1f),
                AlphaRef = 254,
                CastShadows = global::Graphics.Content.Priority.High,
                ReceivesShadows = global::Graphics.Content.Priority.High,
                ReceivesSpecular = global::Graphics.Content.Priority.High,
                SpecularExponent = 6,
            };
            VisibilityLocalBounding = CreateBoundingBoxFromModel((MetaModel)MainGraphic);
            PickingLocalBounding = CreateBoundingMeshFromModel((MetaModel)MainGraphic);

            AddAbility(new RottenThrust());
        }
开发者ID:ChristianMarchiori,项目名称:DeadMeetsLead,代码行数:26,代码来源:Rotten.cs


示例10: Commander

        public Commander()
        {
            HitPoints = MaxHitPoints = 240;
            SplatRequiredDamagePerc = 160 / (float)MaxHitPoints;
            SilverYield = 5;
            MainGraphic = new MetaModel
            {
                SkinnedMesh = new SkinnedMeshFromFile("Models/Units/Zombie1.x"),
                Texture = new TextureFromFile("Models/Units/Commander1.png"),
                SpecularTexture = new TextureFromFile("Models/Units/CommanderSpecular1.png"),
                World = SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.Scaling(0.12f, 0.12f, 0.12f),
                AlphaRef = 254,
                CastShadows = global::Graphics.Content.Priority.High,
                ReceivesShadows = global::Graphics.Content.Priority.High,
                ReceivesSpecular = Priority.High,
                SpecularExponent = 6,
            };
            VisibilityLocalBounding = CreateBoundingBoxFromModel((MetaModel)MainGraphic);
            PickingLocalBounding = CreateBoundingMeshFromModel((MetaModel)MainGraphic);

            //AddAbility(new FrenzyScream());
            AddAbility(new GruntThrust());
            AddAbility(new FrenzyScreamAOE());
            //AddBuff(new FrenzyScreamAOE(), this, this);
        }
开发者ID:ChristianMarchiori,项目名称:DeadMeetsLead,代码行数:25,代码来源:Commander.cs


示例11: RegisterModelRoutes

        public static void RegisterModelRoutes(RouteCollection routes, MetaModel model, string prefix, bool useSeperatePages) {
            if (useSeperatePages) {
                // The following statement supports separate-page mode, where the List, Detail, Insert, and 
                // Update tasks are performed by using separate pages. To enable this mode, uncomment the following 
                // route definition, and comment out the route definitions in the combined-page mode section that follows.
                routes.Add(new DynamicDataRoute(prefix + "/{table}/{action}.aspx") {
                    Constraints = new RouteValueDictionary(new { action = "List|Details|Edit|Insert" }),
                    Model = model
                });
            } else {

                // The following statements support combined-page mode, where the List, Detail, Insert, and
                // Update tasks are performed by using the same page. To enable this mode, uncomment the
                // following routes and comment out the route definition in the separate-page mode section above.
                routes.Add(new DynamicDataRoute("{table}/ListDetails.aspx") {
                    Action = PageAction.List,
                    ViewName = "ListDetails",
                    Model = model
                });

                routes.Add(new DynamicDataRoute("{table}/ListDetails.aspx") {
                    Action = PageAction.Details,
                    ViewName = "ListDetails",
                    Model = model
                });
            }
        }
开发者ID:sanyaade-mobiledev,项目名称:ASP.NET-Mvc-2,代码行数:27,代码来源:Global.asax.cs


示例12: Item

 public Item(MetaModel metaModel, MetaItem metaItem, Guid itemId, string itemName)
     : base(metaModel, itemId)
 {
     this.metaItem = metaItem;
     this.itemId = itemId;
     this.itemName = itemName;
 }
开发者ID:Stephanvs,项目名称:MetaStudio,代码行数:7,代码来源:Item.cs


示例13: CreateCategorizedVMWithoutImported

        public static CategorizedSelectionViewModel CreateCategorizedVMWithoutImported(MetaModel model, ViewModelStore store, SelectionHelperTarget target)
        {
            // categories for main meta model as well as imported ones
            List<CategorizedAdvSelectableViewModel> modelCategoryVMs = new List<CategorizedAdvSelectableViewModel>();
            CategorizedAdvSelectableViewModel modelCategoryVM = CreateCategorizedAdvSelectableVM(model, model.Name, store, target);
            modelCategoryVMs.Add(modelCategoryVM);

            return new CategorizedSelectionViewModel(store, modelCategoryVMs);
        }
开发者ID:apoorv-vijay-joshi,项目名称:FSE-2011-PDE,代码行数:9,代码来源:SelectionHelper.cs


示例14: CreateCategorizedVM

        public static CategorizedSelectionViewModel CreateCategorizedVM(MetaModel model, ViewModelStore store, SelectionHelperTarget target)
        {
            // categories for main meta model as well as imported ones
            List<MetaModel> handledMetaModels = new List<MetaModel>();
            List<CategorizedAdvSelectableViewModel> modelCategoryVMs = new List<CategorizedAdvSelectableViewModel>();
            CreateCategorizedVM(model, store, target, handledMetaModels, modelCategoryVMs);

            return new CategorizedSelectionViewModel(store, modelCategoryVMs);
        }
开发者ID:apoorv-vijay-joshi,项目名称:FSE-2011-PDE,代码行数:9,代码来源:SelectionHelper.cs


示例15: Insert

 public void Insert(Content.Model9 model, Entity e, MetaModel metaResource, string metaName)
 {
     if (model.Texture != null)
     {
         RenderLeaf r;
         if (!Textures.TryGetValue(model.Texture, out r))
             Textures[model.Texture] = r = new RenderLeaf();
         r.Insert(model, e, metaResource, metaName);
     }
 }
开发者ID:ChristianMarchiori,项目名称:DeadMeetsLead,代码行数:10,代码来源:RenderSkinnedMesh.cs


示例16: ClericBoss

        public ClericBoss()
        {
            HitPoints = MaxHitPoints = 5500;
            RunSpeed = MaxRunSpeed = 1;

            MainGraphic = new MetaModel
            {
                AlphaRef = 254,
                SkinnedMesh = new SkinnedMeshFromFile("Models/Units/VoodooPriest1.x"),
                Texture = new TextureConcretizer
                {
                    TextureDescription = new global::Graphics.Software.Textures.SingleColorTexture(
                        System.Drawing.Color.White)
                },
                World = SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.Scaling(0.1f, 0.1f, 0.1f),
                IsBillboard = false,
                CastShadows = global::Graphics.Content.Priority.High,
                ReceivesShadows = global::Graphics.Content.Priority.High,
            };
            VisibilityLocalBounding = new MetaBoundingBox
            {
                Mesh = ((MetaModel)MainGraphic).SkinnedMesh,
                Transformation = ((MetaModel)MainGraphic).World
            };
            PickingLocalBounding = new Common.Bounding.Chain
            {
                Boundings = new object[]
                {
                    VisibilityLocalBounding,
                    new BoundingMetaMesh
                    {
                        SkinnedMeshInstance = MetaEntityAnimation,
                        Transformation = ((MetaModel)MainGraphic).World
                    }
                },
                Shallow = true
            };

            AddAbility(new ClericRaiseDead());
            AddAbility(new IceBreath());
            AddAbility(new BossIncinerateApplyBuff());
            //AddAbility(new ScourgedEarth());

            if (Program.Instance != null)
            {
                var sm = Program.Instance.SoundManager;
                var idleSound = sm.GetSoundResourceGroup(sm.GetSFX(SFX.ClericIdle1), sm.GetSFX(SFX.ClericIdle2), sm.GetSFX(SFX.ClericIdle3));
                idle = idleSound.PlayLoopedWithIntervals(5, 15, 3f + (float)Game.Random.NextDouble() * 3.0f, new Sound.PlayArgs
                {
                    GetPosition = () => { return Position; },
                    GetVelocity = () => { if (MotionNPC != null) return MotionNPC.Velocity; else return Vector3.Zero; }
                });
            }
        }
开发者ID:ChristianMarchiori,项目名称:DeadMeetsLead,代码行数:54,代码来源:ClericBoss.cs


示例17: CreateCategorizedAdvSelectableVM

 private static CategorizedAdvSelectableViewModel CreateCategorizedAdvSelectableVM(MetaModel model, string categoryName, ViewModelStore store, SelectionHelperTarget target)
 {
     List<CategorizedSelectableViewModel> vms = new List<CategorizedSelectableViewModel>();
     foreach (BaseModelContext m in model.ModelContexts)
     {
         if (m is LibraryModelContext)
         {
             vms.Add(CreateCategorizedSelectableVM(m as LibraryModelContext, m.Name, store, target));
         }
     }
     return new CategorizedAdvSelectableViewModel(store, categoryName, vms);
 }
开发者ID:apoorv-vijay-joshi,项目名称:FSE-2011-PDE,代码行数:12,代码来源:SelectionHelper.cs


示例18: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes) {
            L2Smodel = new MetaModel();
            L2Smodel.DynamicDataFolderVirtualPath = "~/DynamicDataL2S";
            L2Smodel.RegisterContext(typeof(NorthwindDataContext), new ContextConfiguration() { ScaffoldAllTables = true });
            L2Smodel.RegisterContext(typeof(InheritanceDataContext), new ContextConfiguration() { ScaffoldAllTables = true });
            RegisterModelRoutes(routes, L2Smodel, "L2S", true);

            EFmodel = new MetaModel();
            EFmodel.DynamicDataFolderVirtualPath = "~/DynamicDataEF";
            EFmodel.RegisterContext(typeof(DynamicDataEFProject.NORTHWNDEntities), new ContextConfiguration() { ScaffoldAllTables = true });
            EFmodel.RegisterContext(typeof(DynamicDataEFProject.InheritanceEntities), new ContextConfiguration() { ScaffoldAllTables = true });
            RegisterModelRoutes(routes, EFmodel, "EF", true);
        }
开发者ID:sanyaade-mobiledev,项目名称:ASP.NET-Mvc-2,代码行数:13,代码来源:Global.asax.cs


示例19: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            MetaModel model = new MetaModel();

            
            model.RegisterContext(typeof(TrackerDataContext), new ContextConfiguration() { ScaffoldAllTables = false});

            routes.Add(new DynamicDataRoute("{table}/{action}.aspx")
            {
                Constraints = new RouteValueDictionary(new { action = "List|Details|Edit|Insert" }),
                Model = model
            });
        }
开发者ID:codesmithtools,项目名称:Framework-Samples,代码行数:13,代码来源:Global.asax.cs


示例20: Deserialize

        public INode Deserialize(string nodePath)
        {
            string nodeName = Path.GetFileName(nodePath);

            INode node;
            using (var fs = _fileSystem.Open(Path.Combine(nodePath, "Properties.txt"), FileMode.Open, FileAccess.Read, FileShare.Read))
            using (var reader = new StreamReader(fs))
            {
                string type = reader.ReadLine().Split(':')[1].Trim();
                node = (INode)Activator.CreateInstance("Ghandi", type).Unwrap();
                node.Name = nodeName;

                while (!reader.EndOfStream)
                {
                    Parse(node, reader.ReadLine());
                }
            }

            var metaModel = new MetaModel(node, nodePath);

            foreach (var s in metaModel.Properties)
            {
                string path = Path.Combine(nodePath, s.Name.SanitizeUrl() + ".txt");
                using (var fs = _fileSystem.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read))
                using (var reader = new StreamReader(fs))
                {
                    s.Property.SetValue(node, Convert.ChangeType(reader.ReadToEnd(), s.Property.PropertyType), new object[0]);
                }
            }

            foreach (var s in metaModel.XmlProperties)
            {
                string path = Path.Combine(nodePath, s.Name.SanitizeUrl() + ".xml");
                s.Property.SetValue(node, XDocument.Load(path), new object[0]);
            }

            foreach (var s in metaModel.SerializableOfStringProperties)
            {
                string path = Path.Combine(nodePath, s.Name.SanitizeUrl() + "." + s.Property.PropertyType.Name);
                using (var fs = _fileSystem.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read))
                using (var reader = new StreamReader(fs))
                {
                    string stringValue = reader.ReadToEnd();
                    ISerializable<string> propertyValue = (ISerializable<string>)Activator.CreateInstance(s.Property.PropertyType);
                    propertyValue.Deserialize(stringValue);
                    s.Property.SetValue(node, propertyValue, new object[0]);
                }
            }

            return node;
        }
开发者ID:skovsboll,项目名称:Gandhi,代码行数:51,代码来源:NodeToFolderSerializer.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Metadata类代码示例发布时间:2022-05-24
下一篇:
C# MetaMethod类代码示例发布时间: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