Пример #1
0
        private void InitializeTextArea()
        {
            Position consoleCenter = Position.ConsoleCenter();

            this.TextArea =
                this.textAreaFactory.CreateTextArea(this.reader, consoleCenter.Left - 18, consoleCenter.Top - 7);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
    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);
    }