private void InitializeTextArea() { Position consoleCenter = Position.ConsoleCenter(); this.TextArea = this.textAreaFactory.CreateTextArea(this.reader, consoleCenter.Left - 18, consoleCenter.Top - 7); }
private void InitializeTextArea() { Position consoleCenter = Position.ConsoleCenter(); int top = consoleCenter.Top - (topOffset + this.post.Content.Length) + 5; this.TextArea = this.textAreaFactory.CreateTextArea(this.reader, consoleCenter.Left - 18, top, false); }
private void InitializeTextArea() { var consoleCenter = Position.ConsoleCenter(); var top = consoleCenter.Top - (TOP_OFFSET + this.post.Content.Length) + 5; this.TextArea = this.textAreaFactory.CreateTextArea(this.reader, consoleCenter.Left - 18, top, false); }
public ITextInputArea CreateTextArea(IForumReader reader, int x, int y, bool isPost = true) { Assembly assembly = Assembly.GetExecutingAssembly(); Type commandType = assembly.GetTypes().FirstOrDefault(t => typeof(ITextInputArea).IsAssignableFrom(t)); if (commandType == null) { throw new InvalidOperationException("TextArea not found!"); } object[] args = new object[] { reader, x, y, isPost }; ITextInputArea commandInstance = (ITextInputArea)Activator.CreateInstance(commandType, args); return(commandInstance); }
public ITextInputArea CreateTextArea(IForumReader reader, int x, int y, bool isPost = true) { Type commandType = Assembly .GetExecutingAssembly() .GetTypes() .Where(t => t.GetInterfaces() .Contains(typeof(ITextInputArea)) && !t.IsAbstract) .FirstOrDefault(); if (commandType == null) { throw new InvalidOperationException("TextArea not found!"); } object[] args = new object[] { reader, x, y, isPost }; ITextInputArea commandInstance = (ITextInputArea)Activator.CreateInstance(commandType, args); return(commandInstance); }