本文整理汇总了C#中Root.Initialize方法的典型用法代码示例。如果您正苦于以下问题:C# Root.Initialize方法的具体用法?C# Root.Initialize怎么用?C# Root.Initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Root
的用法示例。
在下文中一共展示了Root.Initialize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Server
public Server (Root root, Uri url)
{
if (root == null) {
throw new ArgumentNullException ("root");
}
this.root = root;
if (url == null) {
url = MakeUrl ();
}
var serializer = Helper.Get<XmlSerializer> (static_serializer);
root.Initialize (serializer, url);
// FIXME this is a test
description_server = new DataServer (serializer.GetBytes (root), @"text/xml", url);
ssdp_server = new SsdpServer (url.ToString ());
ssdp_server.Announce ("upnp:rootdevice", root.RootDevice.Udn + "::upnp:rootdevice", false);
AnnounceDevice (root.RootDevice);
}
示例2: CreateWindow
/// <summary>
/// Creates the window.
/// </summary>
/// <param name="root">The root.</param>
protected virtual void CreateWindow(Root root)
{
Configuration config = Configuration;
RenderWindow window;
if (Configuration.Ogre.UseOgreConfig) {
if (!root.RestoreConfig()) {
if (!root.ShowConfigDialog()) {
Console.WriteLine("Could not show the config dialog for Ogre");
Exit();
return;
}
root.SaveConfig();
}
window = root.Initialize(true, Configuration.Game.Name);
} else {
if (config.Ogre.RenderWindowParameters != null) {
Dictionary<string, string> parameters = config.Ogre.RenderWindowParameters.ToDictionary(
item => item.Name,
item => item.Value);
window = root.CreateRenderWindow(
"OgreRoot",
config.Screen.Width,
config.Screen.Height,
config.Screen.Fullscreen,
new RenderWindowParameters(parameters));
} else {
window = root.CreateRenderWindow(
"OgreRoot",
config.Screen.Width,
config.Screen.Height,
config.Screen.Fullscreen);
}
}
Variables.Ogre.RenderWindow = window;
}