本文整理汇总了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();
};
}
示例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);
}
}
示例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;
}
示例4: Store
public Store(IUserInterface userInterface)
{
this.userInterface = userInterface;
this.myChashRegisterModule = new CashRegister(1.95583m, 1.53m);
this.myStorageModule = new Storage();
this.myStorageModule.LoadDB();
}
示例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();
};
}
示例6: LoadViewStateConfiguration
public void LoadViewStateConfiguration(IViewStateConfiguration viewStateConfiguration, IUserInterface userInterface)
{
this.ViewStateConfiguration = viewStateConfiguration;
viewStates = viewStateConfiguration.ViewStateList;
this._UI = userInterface;
this.DefaultViewState = viewStateConfiguration.DefaultViewState;
}
示例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);
}
示例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();
};
}
示例9: Engine
public Engine(PlayerType playerType, IUserInterface inputInterface)
{
this.PlayerType = playerType;
this.rnd = new Random();
this.inputInterface = inputInterface;
this.AllObjects = new List<WorldObject>();
}
示例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;
}
示例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;
}
示例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
}
示例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);
}
示例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>();
}
示例15: SetView
public void SetView(IUserInterface userinterface)
{
foreach (IUser user in users)
{
user.SetView(userinterface);
}
invalidUser.SetView(userinterface);
}