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


C# Factory.Build方法代码示例

本文整理汇总了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();
 }
开发者ID:asipe,项目名称:Goul,代码行数:7,代码来源:SetCredentialsTest.cs

示例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");
 }
开发者ID:asipe,项目名称:Goul,代码行数:8,代码来源:ListCredentialsTest.cs

示例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")));
 }
开发者ID:asipe,项目名称:Goul,代码行数:12,代码来源:ConsoleHelpTests.cs

示例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);
            }
        }
开发者ID:ArtificialIntelligenceApproximations,项目名称:AIA,代码行数:31,代码来源:BuildingManager.cs


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