当前位置: 首页>>代码示例>>C#>>正文


C# Model.Load方法代码示例

本文整理汇总了C#中Model.Load方法的典型用法代码示例。如果您正苦于以下问题:C# Model.Load方法的具体用法?C# Model.Load怎么用?C# Model.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Model的用法示例。


在下文中一共展示了Model.Load方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Window1_Loaded

        void Window1_Loaded(object sender, RoutedEventArgs e)
        {
            Logging.Setup();
            Logging.AddToAuthorun();
            ShowInTaskbar = false;
            RegisterHotkey();
            
            _Model = new Model();
            this.DataContext = _Model;
            foreach (string s in Environment.GetCommandLineArgs())
            {
                if (File.Exists(s) && System.IO.Path.GetExtension(s) != ".exe")
                {
                    _Model.Open(s);
                }
            }
            if (!_Model._Loaded) _Model.Load();
            KeyDown += new KeyEventHandler(Window1_KeyDown);
            Closed += new EventHandler(Window1_Closed);
            
            Closing += new System.ComponentModel.CancelEventHandler(Window1_Closing);
            App.Current.Deactivated += new EventHandler(Current_Deactivated);
            _RitchTextBox.Focus();
            _RitchTextBox.TextChanged += new TextChangedEventHandler(RitchTextBox_TextChanged);

            new DispatcherTimer().StartRepeatMethod(60 * 10, Update);
            this.Show(); 
           
            
        }
开发者ID:ConnectDeveloper01,项目名称:dorumon,代码行数:30,代码来源:Window1.xaml.cs

示例2: CreateVehicle

        public static Vehicle CreateVehicle(Model model, Vector3 position)
        {
            model.Load();
            var car = Internal.Function.Call<Vehicle>(0x00a5, model, position);
            model.Release();

            return car;
        }
开发者ID:Debug-,项目名称:gtadotnet,代码行数:8,代码来源:World.cs

示例3: RequestModel

 public static Model RequestModel(string hash)
 {
     var model = new Model(hash);
     while (!model.IsLoaded)
     {
         model.Load();
         model.LoadCollision();
         GameFiber.Yield();
     }
     return model;
 }
开发者ID:LordRevan2,项目名称:MissionCreator,代码行数:11,代码来源:Util.cs

示例4: CreatePickup

        public static Pickup CreatePickup(Vector3 position, Model model, PickupType type)
        {
            model.Load();

            var retval = Internal.Function.Call<Pickup>(0x0213, model, (int)type, position);
            PickupHandler.Register(retval);

            model.Release();

            retval._origPos = position;
            return retval;
        }
开发者ID:Debug-,项目名称:gtadotnet,代码行数:12,代码来源:Pickup.cs

示例5: CreatePed

        public static Ped CreatePed(Model model, Vector3 position, int pedtype)
        {
            if (model.ID >= 290 && model.ID <= 299)
            {
                return Internal.Function.Call<Ped>(0x009a, pedtype, model, position);
            }

            model.Load();
            var ped = Internal.Function.Call<Ped>(0x009a, pedtype, model, position);
            model.Release();

            return ped;
        }
开发者ID:Debug-,项目名称:gtadotnet,代码行数:13,代码来源:World.cs

示例6: Load

 public void Load()
 {
     Model model = new Model(Model);
     model.Load();
 }
开发者ID:Debug-,项目名称:gtadotnet,代码行数:5,代码来源:Weapons.cs

示例7: Main


//.........这里部分代码省略.........

                            break;
                        case "-o":
                        case "--output":
                            if (index >= args.Length || args[index][0] == '-')
                                ShowUsageAndExit("Output must be specified.");

                            var destination = args[index++];
                            if (Destination != null ||
                                (index < args.Length && args[index][0] != '-'))
                                ShowUsageAndExit("Only one output");

                            Destination = destination;
                            break;
                        case "-f":
                        case "--format":
                            if (index >= args.Length || args[index][0] == '-')
                                ShowUsageAndExit("Format must be specified.");

                            var format = args[index++];
                            if (Format != null ||
                                (index < args.Length && args[index][0] != '-'))
                                ShowUsageAndExit("Only one format");

                            Format = format;
                            break;
                        case "-n":
                        case "--namespace":
                            if (index >= args.Length || args[index][0] == '-')
                                ShowUsageAndExit("Namespace must be specified.");

                            var ns = args[index++];
                            if (Namespace != null ||  //already set by previex --platform
                                (index < args.Length && args[index][0] != '-')) //if the next argument is not a command
                                ShowUsageAndExit("Only one namespace");

                            Namespace = ns;
                            break;
                    }

                }

                if (Builder == null)
                    ShowUsageAndExit("Platform must be specified.");

                if (Sources.Count <= 0)
                    ShowUsageAndExit("Source must be specified.");

                // Get Model
                Model = new Model();

                foreach (var source in Sources)
                {
                    var modelFile = source.TrimEnd('/');

                    if (modelFile.EndsWith("/spml/all", StringComparison.CurrentCultureIgnoreCase))
                    {
                        using (var client = new HttpClient())
                        {
                            var result = client.GetAsync(modelFile).Result;
                            if (result.IsSuccessStatusCode)
                            {
                                var protocols = result.Content.ReadAsStringAsync().Result.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                                if (protocols.Length > 0)
                                {
                                    var baseUrl = modelFile.Substring(0, modelFile.Length - 4);
                                    foreach (var protocol in protocols)
                                    {
                                        Console.WriteLine("Building Protocol: " + protocol + "...");
                                        Model.Load(string.Format("{0}?file={1}", baseUrl, protocol));
                                    }
                                }
                                else
                                    ShowUsageAndExit("No Protocols");
                            }
                            else
                                ShowUsageAndExit("Host unreachable");
                        }
                    }
                    else
                        Model.Load(modelFile);
                }

                Builder.Build(Model,Destination,Format);
            }
            catch (Exception ex)
            {
            #if DEBUG
                if (System.Diagnostics.Debugger.IsAttached)
                    System.Diagnostics.Debugger.Break();
            #endif

                if (ex is ProtocolMalformedException)
                    Program.ShowUsageAndExit(ex.Message);
                if (ex is FileNotFoundException)
                    Program.ShowUsageAndExit(ex.Message);

                Program.ShowUsageAndExit(string.Format("An unexpected error has occured : {0}", ex.StackTrace));
            }
        }
开发者ID:niravpatel2008,项目名称:spike-build,代码行数:101,代码来源:Program.cs

示例8: Init

 public void Init( Microsoft.Xna.Framework.Game game )
 {
     _model = new Model( (Game1) game );
     _model.Load( GameStatePlayMenu.MapToPlay );
     _model.Start();
 }
开发者ID:BGCX261,项目名称:zombeeswarm-svn-to-git,代码行数:6,代码来源:GameStatePlay.cs


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