本文整理汇总了C#中Factory.Build方法的典型用法代码示例。如果您正苦于以下问题:C# Factory.Build方法的具体用法?C# Factory.Build怎么用?C# Factory.Build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Factory
的用法示例。
在下文中一共展示了Factory.Build方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoSetup
public void DoSetup()
{
mFactory = new Factory(new DefaultModuleConfiguration(), new ITModuleConfiguration());
mObserver = (RecordingObserver)mFactory.Build<IMessageObserver>();
mApp = mFactory.Build<IApp>();
mFile = new DotNetFile();
}
示例2: DoSetup
public void DoSetup()
{
mFactory = new Factory(new DefaultModuleConfiguration(), new ITModuleConfiguration());
mObserver = (RecordingObserver)mFactory.Build<IMessageObserver>();
mApp = mFactory.Build<IApp>();
mFile = new DotNetFile();
mApp.Execute("setCredentials", "val1", "val2");
}
示例3: TestHelpCommandIsSentCorrectly
public void TestHelpCommandIsSentCorrectly()
{
var factory = new Factory(new DefaultModuleConfiguration(), new ITModuleConfiguration());
var messageObserver = (RecordingObserver)factory.Build<IMessageObserver>();
var app = factory.Build<IApp>();
app.Execute("help");
Assert.That(messageObserver.GetMessages(), Is.EqualTo(BA("Goul Document Uploader Version 0.1",
"Commands:",
"setcredentials xClient_IDx xClient_Secretx | Sets the client id and the client secret to a local .txt file",
"listcredentials | lists the credentials",
"clearcredentials | deletes ALL of the credential files")));
}
示例4: KeyboardListener
//Listens to input from mouse and keyboard and carries out appropriate actions
public void KeyboardListener(KeyboardState CurrentKeyboardState, KeyboardState LastKeyboardState, MouseState CurrentMouseState, MouseState LastMouseState)
{
//Creates an instance of a building at the position of the mouse when B is held down and left mouse button clicked
if ((CurrentMouseState.LeftButton == ButtonState.Released && LastMouseState.LeftButton == ButtonState.Pressed) &&
(CurrentKeyboardState.IsKeyDown(Keys.T)))
{
BaseBuilding newBuilding;
newBuilding = new Tower();
newBuilding.Build(new Vector2(CurrentMouseState.X, CurrentMouseState.Y));
mBuildings.Add(newBuilding);
}
if ((CurrentMouseState.LeftButton == ButtonState.Released && LastMouseState.LeftButton == ButtonState.Pressed) &&
(CurrentKeyboardState.IsKeyDown(Keys.W)))
{
BaseBuilding newBuilding;
newBuilding = new Wall();
newBuilding.Build(new Vector2(CurrentMouseState.X, CurrentMouseState.Y));
mBuildings.Add(newBuilding);
}
if ((CurrentMouseState.LeftButton == ButtonState.Released && LastMouseState.LeftButton == ButtonState.Pressed) &&
(CurrentKeyboardState.IsKeyDown(Keys.F)))
{
BaseBuilding newBuilding;
newBuilding = new Factory();
newBuilding.Build(new Vector2(CurrentMouseState.X, CurrentMouseState.Y));
mBuildings.Add(newBuilding);
}
}