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


C# IUserInterface类代码示例

本文整理汇总了C#中IUserInterface的典型用法代码示例。如果您正苦于以下问题:C# IUserInterface类的具体用法?C# IUserInterface怎么用?C# IUserInterface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IUserInterface类属于命名空间,在下文中一共展示了IUserInterface类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandlePlayerTwoControls

        private static void HandlePlayerTwoControls(IUserInterface keyboard, Engine engine)
        {
            keyboard.OnUpPressedPlayerTwo += (sender, eventInfo) =>
            {
                Console.SetCursorPosition(startRow, startCol);
                Console.WriteLine("Player2, make a move please!");
                engine.MovePlayerTwoUp();
            };

            keyboard.OnDownPressedPlayerTwo += (sender, eventInfo) =>
            {
                Console.SetCursorPosition(startRow, startCol);
                Console.WriteLine("Player2, make a move please!");
                engine.MovePlayerTwoDown();
            };

            keyboard.OnLeftPressedPlayerTwo += (sender, eventInfo) =>
            {
                Console.SetCursorPosition(startRow, startCol);
                Console.WriteLine("Player2, make a move please!");
                engine.MovePlayerTwoLeft();
            };

            keyboard.OnRightPressedPlayerTwo += (sender, eventInfo) =>
            {
                Console.SetCursorPosition(startRow, startCol);
                Console.WriteLine("Player2, make a move please!");
                engine.MovePlayerTwoRight();
            };
        }
开发者ID:RosenTodorov,项目名称:MyProjects,代码行数:30,代码来源:FruitWarMain.cs

示例2: Display

        public void Display(IUserInterface userInterface, IServiceResult serviceResult)
        {
            if (userInterface == null)
            {
                throw new ArgumentNullException("userInterface");
            }

            if (serviceResult == null)
            {
                return;
            }

            if (serviceResult.Status == ServiceResultType.NoResult)
            {
                return;
            }

            if (string.IsNullOrWhiteSpace(serviceResult.Message))
            {
                return;
            }

            if (serviceResult.InnerResult != null)
            {
                this.Display(userInterface, serviceResult.InnerResult);
            }

            string resultTypeLabel = Resources.ServiceResultVisualizer.ResourceManager.GetString("ServiceResultType" + serviceResult.Status);
            userInterface.WriteLine(resultTypeLabel + ": " + serviceResult.Message);

            if (!string.IsNullOrWhiteSpace(serviceResult.ResultArtefact))
            {
                userInterface.WriteLine(Resources.ServiceResultVisualizer.ReturnValue + ": " + serviceResult.ResultArtefact);
            }
        }
开发者ID:andreaskoch,项目名称:NuDeploy,代码行数:35,代码来源:ConsoleServiceResultVisualizer.cs

示例3: Program

        public Program(ApplicationInformation applicationInformation, IUserInterface userInterface, IActionLogger logger, ICommandLineArgumentInterpreter commandLineArgumentInterpreter, IHelpCommand helpCommand)
        {
            if (applicationInformation == null)
            {
                throw new ArgumentNullException("applicationInformation");
            }

            if (userInterface == null)
            {
                throw new ArgumentNullException("userInterface");
            }

            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            if (commandLineArgumentInterpreter == null)
            {
                throw new ArgumentNullException("commandLineArgumentInterpreter");
            }

            if (helpCommand == null)
            {
                throw new ArgumentNullException("helpCommand");
            }

            this.applicationInformation = applicationInformation;
            this.userInterface = userInterface;
            this.logger = logger;
            this.commandLineArgumentInterpreter = commandLineArgumentInterpreter;
            this.helpCommand = helpCommand;
        }
开发者ID:andreaskoch,项目名称:NuDeploy,代码行数:33,代码来源:Program.cs

示例4: Store

 public Store(IUserInterface userInterface)
 {
     this.userInterface = userInterface;
     this.myChashRegisterModule = new CashRegister(1.95583m, 1.53m);
     this.myStorageModule = new Storage();
     this.myStorageModule.LoadDB();
 }
开发者ID:HansS,项目名称:TelerikAcademy-homework,代码行数:7,代码来源:Store.cs

示例5: ProcessKeyboardEvents

        private static void ProcessKeyboardEvents(IUserInterface keyboard, ConsoleEngine engine)
        {
            keyboard.OnUpPressed += (sender, eventInfo) =>
            {
                engine.MovementManager.MovePlayerUp();
            };

            keyboard.OnDownPressed += (sender, eventInfo) =>
            {
                engine.MovementManager.MovePlayerDown();
            };

            keyboard.OnLeftPressed += (sender, eventInfo) =>
            {
                engine.MovementManager.MovePlayerLeft();
            };

            keyboard.OnUpLeftPressed += (sender, eventInfo) =>
            {
                engine.MovementManager.MovePlayerUpLeft();
            };

            keyboard.OnRightPressed += (sender, eventInfo) =>
            {
                engine.MovementManager.MovePlayerRight();
            };

            keyboard.OnUpRightPressed += (sender, eventInfo) =>
            {
                engine.MovementManager.MovePlayerUpRight();
            };
        }
开发者ID:aleks-todorov,项目名称:CSharp-Projects,代码行数:32,代码来源:Application.cs

示例6: LoadViewStateConfiguration

		public void LoadViewStateConfiguration(IViewStateConfiguration viewStateConfiguration, IUserInterface userInterface)
		{
			this.ViewStateConfiguration = viewStateConfiguration;
			viewStates = viewStateConfiguration.ViewStateList;
			this._UI = userInterface;
			this.DefaultViewState = viewStateConfiguration.DefaultViewState;
		}
开发者ID:juiceboxatx,项目名称:ActiveStateMachine,代码行数:7,代码来源:ViewManager.cs

示例7: ZProcessor

        private int stackPtr; //Pointer to next address to write to

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Creates a new z processor
        /// </summary>
        /// <param name="buf">memory buffer</param>
        /// <param name="ui">interface with the rest of the world</param>
        protected ZProcessor(MemoryBuffer buf, IUserInterface ui)
        {
            //Validate params
            if (buf == null)
            {
                throw new ArgumentNullException("buf");
            }
            else if (ui == null)
            {
                throw new ArgumentNullException("ui");
            }

            //Cache global vars offset
            globalVarsOffset = buf.GetUShort(0xC) - 0x10;

            //Globals vars must be higher than the header (security)
            if (globalVarsOffset + 0x10 < 64)
            {
                throw new ZMachineException("global variables table must not reside in the header");
            }

            //Set dynamic limit
            buf.DynamicLimit = Math.Min((int) buf.GetUShort(0xE), 64);

            //Store memory buffer and ui
            memBuf = buf;
            zUi = ui;

            //Create encoder and object tree
            zEncoder = new ZTextEncoder(buf);
            objectTree = new ZObjectTree(buf);
        }
开发者ID:jcowgill,项目名称:zmachine,代码行数:43,代码来源:ZProcessor.cs

示例8: HandlePlayerControls

        private static void HandlePlayerControls(IUserInterface keyboard, Engine engine)
        {
            keyboard.OnUpPressed += (sender, eventInfo) =>
            {
                engine.MoveCruiserUp();
            };

            keyboard.OnDownPressed += (sender, eventInfo) =>
            {
                engine.MoveCruiserDown();
            };

            keyboard.OnLeftPressed += (sender, eventInfo) =>
            {
                engine.MoveCruiserLeft();
            };

            keyboard.OnRightPressed += (sender, eventInfo) =>
            {
                engine.MoveCruiserRight();
            };

            keyboard.OnActionPressed += (sender, eventInfo) =>
            {
                engine.CruiserShoot();
            };
        }
开发者ID:NikolovNikolay,项目名称:Space_Destroyer_OOP_Game_Project,代码行数:27,代码来源:SpaceDestroyerMain.cs

示例9: Engine

 public Engine(PlayerType playerType, IUserInterface inputInterface)
 {
     this.PlayerType = playerType;
     this.rnd = new Random();
     this.inputInterface = inputInterface;
     this.AllObjects = new List<WorldObject>();
 }
开发者ID:Team-Pina-Colada,项目名称:AcademyMaze,代码行数:7,代码来源:Engine.cs

示例10: VersionCheckerViewModel

        public VersionCheckerViewModel(VersionChecker versionChecker, FileDownloader fileDownloader,
            IUserInterface userInterface, IVersionCheckerConfig config, IVersionCheckerUserInterface versionCheckerUserInterface)
        {
            if (versionChecker == null) throw new ArgumentNullException("versionChecker");
            if (fileDownloader == null) throw new ArgumentNullException("fileDownloader");
            if (userInterface == null) throw new ArgumentNullException("userInterface");
            if (config == null) throw new ArgumentNullException("config");
            if (versionCheckerUserInterface == null) throw new ArgumentNullException("versionCheckerUserInterface");

            this.versionChecker = versionChecker;
            this.fileDownloader = fileDownloader;
            this.userInterface = userInterface;
            this.config = config;
            this.versionCheckerUserInterface = versionCheckerUserInterface;

            CheckAgainCommand = new RelayCommand(p => true, CheckAgainClicked);
            DownloadCommand = new RelayCommand(p => true, DownloadClicked);
            OpenDownloadedFileCommand = new RelayCommand(p => true, OpenDownloadedFileClicked);
            CheckAtStartupCommand = new RelayCommand(p => true, CheckAtStartupChanged);
            CloseCommand = new RelayCommand(p => true, CloseClicked);

            ChangeStateToEmpty();

            versionChecker.CheckStarting += HandleVersionCheckStarting;
            versionChecker.CheckCompleted += HandleCheckCompleted;

            this.fileDownloader.DownloadFileStarting += HandleDownloadFileStarting;
            this.fileDownloader.DownloadProgressChanged += HandleDownloadProgressChanged;
            this.fileDownloader.DownloadFileCompleted += HandleDownloadFileCompleted;

            config.CheckAtStartUpChanged += HandleOptionsCheckAtStartupChanged;

            CheckAtStartupEnabled = true;
            CheckAtStartupValue = config.CheckAtStartUp;
        }
开发者ID:lastunicorn,项目名称:Acarus,代码行数:35,代码来源:VersionCheckerViewModel.cs

示例11: SelfUpdateService

        public SelfUpdateService(IUserInterface userInterface, ApplicationInformation applicationInformation, IPackageRepositoryBrowser packageRepositoryBrowser, IFilesystemAccessor filesystemAccessor)
        {
            if (userInterface == null)
            {
                throw new ArgumentNullException("userInterface");
            }

            if (applicationInformation == null)
            {
                throw new ArgumentNullException("applicationInformation");
            }

            if (packageRepositoryBrowser == null)
            {
                throw new ArgumentNullException("packageRepositoryBrowser");
            }

            if (filesystemAccessor == null)
            {
                throw new ArgumentNullException("filesystemAccessor");
            }

            this.userInterface = userInterface;
            this.applicationInformation = applicationInformation;
            this.packageRepositoryBrowser = packageRepositoryBrowser;
            this.filesystemAccessor = filesystemAccessor;
        }
开发者ID:andreaskoch,项目名称:NuDeploy,代码行数:27,代码来源:SelfUpdateService.cs

示例12: Engine

 private Engine(CommandExecuter executor, IUserInterface userIo)
 {
     this.executor = executor;
     this.userIO = userIo;
     //// DI: Added IUserInterface and ConsoleIo types
     //// and made the constructor take an user interface usin DI
 }
开发者ID:EBojilova,项目名称:CSharpHQC,代码行数:7,代码来源:Engine.cs

示例13: ConsoleEngine

 public ConsoleEngine(IUserInterface userInterface, int sleepTime)
 {
     this.userInterface = userInterface;
     this.SleepTime = sleepTime;
     this.MovementManager = new MovementManager();
     CurrentLevel = OutsideLevel.AboveGround;
     Player = new Mario(new MatrixCoordinates(Console.WindowHeight - 7, 0), MarioImages.RightProfile);
 }
开发者ID:aleks-todorov,项目名称:CSharp-Projects,代码行数:8,代码来源:ConsoleEngine.cs

示例14: Engine

        private readonly IUserInterface userInterface; // the user control on the console via keyboard.

        #endregion Fields

        #region Constructors

        // constructor - creates an on object of the Engine type
        public Engine(IRenderer renderer, IUserInterface userInterface)
        {
            this.renderer = renderer;
            this.userInterface = userInterface;
            this.AllObjects = new List<WorldObject>();
            this.MovingObjects = new List<MovableObject>();
            this.StaticObjects = new List<StaticObject>();
        }
开发者ID:hinkah,项目名称:CharlesDikensTeam,代码行数:15,代码来源:Engine.cs

示例15: SetView

 public void SetView(IUserInterface userinterface)
 {
     foreach (IUser user in users)
     {
         user.SetView(userinterface);
     }
     invalidUser.SetView(userinterface);
 }
开发者ID:imarcu,项目名称:EvidentaInvatamant,代码行数:8,代码来源:UserRepository.cs


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