本文整理汇总了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();
}
示例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;
}
示例3: RequestModel
public static Model RequestModel(string hash)
{
var model = new Model(hash);
while (!model.IsLoaded)
{
model.Load();
model.LoadCollision();
GameFiber.Yield();
}
return model;
}
示例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;
}
示例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;
}
示例6: Load
public void Load()
{
Model model = new Model(Model);
model.Load();
}
示例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));
}
}
示例8: Init
public void Init( Microsoft.Xna.Framework.Game game )
{
_model = new Model( (Game1) game );
_model.Load( GameStatePlayMenu.MapToPlay );
_model.Start();
}