本文整理汇总了C#中Manager.Register方法的典型用法代码示例。如果您正苦于以下问题:C# Manager.Register方法的具体用法?C# Manager.Register怎么用?C# Manager.Register使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Manager
的用法示例。
在下文中一共展示了Manager.Register方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UseMessageBoxTest
public void UseMessageBoxTest(char decoChar, string message)
{
Manager manager = new Manager ();
MessageBox mbox = new MessageBox (decoChar);
manager.Register (message, mbox);
Product wbox = manager.Create (message);
wbox.Use ("Hello World");
}
示例2: UsePrototypeWithUnderLinePenTest
public void UsePrototypeWithUnderLinePenTest(char ulchar, string message)
{
Manager manager = new Manager ();
UnderLinePen upen = new UnderLinePen (ulchar);
manager.Register (message, upen);
Product p1 = manager.Create (message);
p1.Use ("Hello World");
}
示例3: UseBothPrototype
public void UseBothPrototype()
{
Manager manager = new Manager ();
UnderLinePen upen = new UnderLinePen ('-');
MessageBox mbox = new MessageBox ('*');
MessageBox sbox = new MessageBox ('/');
UnderLinePen hpen = new UnderLinePen ('~');
manager.Register ("strong message", upen);
manager.Register ("warning box", mbox);
manager.Register ("slash box", sbox);
manager.Register ("strong message2", hpen);
Product p1 = manager.Create ("warning box");
Product p2 = manager.Create ("strong message2");
Product p3 = manager.Create ("slash box");
Product p4 = manager.Create ("strong message");
p1.Use ("Hello Warld");
p2.Use ("Hello Warld");
p3.Use ("Hello Warld");
p4.Use ("Hello Warld");
}
示例4: Initialize
/// <summary>
/// Allows the app to perform any initialization it needs to before starting to run.
/// This is where it can query for any required services and load any non-graphic
/// related content. Calling base.Initialize will enumerate through any components
/// and initialize them as well.
/// </summary>
protected override void Initialize()
{
// TODO: Add your initialization logic here
IsMouseVisible = true; // easier for debugging not to "lose" mouse
SetWindowOnSurface();
InitializeSurfaceInput();
// Set the application's orientation based on the orientation at launch
currentOrientation = ApplicationServices.InitialOrientation;
// Subscribe to surface window availability events
ApplicationServices.WindowInteractive += OnWindowInteractive;
ApplicationServices.WindowNoninteractive += OnWindowNoninteractive;
ApplicationServices.WindowUnavailable += OnWindowUnavailable;
// Setup the UI to transform if the UI is rotated.
// Create a rotation matrix to orient the screen so it is viewed correctly
// when the user orientation is 180 degress different.
Matrix inverted = Matrix.CreateRotationZ(MathHelper.ToRadians(180)) *
Matrix.CreateTranslation(graphics.GraphicsDevice.Viewport.Width,
graphics.GraphicsDevice.Viewport.Height,
0);
if (currentOrientation == UserOrientation.Top)
{
screenTransform = inverted;
}
screenWidth = Program.WindowSize.Width;
screenHeight = Program.WindowSize.Height;
manager = new Manager();
manager.Initialize(this, touchTarget, Manager.SelectionMode.MONO);
manager.Behaviour = new BehaviourPlane(screenWidth, screenHeight, _serverIP);
aircraftCarrier = new Sprite("aircraftCarrier", "aircraftCarrier");
aircraftCarrier.Initialize(touchTarget);
aircraftCarrier.Touchable = false;
manager.Register(aircraftCarrier);
plane1 = new enib.pa.Plane("plane1");
plane1.Initialize(touchTarget);
plane1.Scale = 0.13f;
plane1.Weight = 1;
plane1.Rotation = -(float)0;
plane1.ShowBoundingRect = true;
plane1.Dragable = false;
manager.Register(plane1);
plane2 = new enib.pa.Plane("plane2");
plane2.Initialize(touchTarget);
plane2.Scale = 0.13f;
plane2.Weight = 1;
plane2.Rotation = (float)Math.PI /2;
plane2.ShowBoundingRect = true;
plane2.Dragable = false;
manager.Register(plane2);
plane3 = new enib.pa.Plane("plane3");
plane3.Initialize(touchTarget);
plane3.Scale = 0.13f;
plane3.Weight = 1;
plane3.Rotation = (float)Math.PI;
plane3.ShowBoundingRect = true;
plane3.Dragable = false;
manager.Register(plane3);
plane4 = new enib.pa.Plane("plane4");
plane4.Initialize(touchTarget);
plane4.Scale = 0.13f;
plane4.Weight = 1;
plane4.Rotation = -(float)Math.PI / 2;
plane4.ShowBoundingRect = true;
plane4.Dragable = false;
manager.Register(plane4);
menu_pt1 = new Plane_Menu_Elevator("ascenseur1");
menu_pt1.setPlaneur(plane1);
menu_pt2 = new Plane_Menu_Catapulte1("catapulte1");
menu_pt2.setPlaneur(plane1);
menu_pt3 = new Plane_Menu_Catapulte2("catapulte2");
menu_pt3.setPlaneur(plane1);
menu = new Enib.SurfaceLib.Menu(manager, plane1);
menu.Initialize(touchTarget);
menu.addMenuEntry(menu_pt1);
menu.addMenuEntry(menu_pt2);
menu.addMenuEntry(menu_pt3);
menu.Hide();
base.Initialize();
//.........这里部分代码省略.........