/// <summary>
        /// Ons the create.
        /// </summary>
        /// <returns>The create.</returns>
        /// <param name="bundle">Bundle.</param>
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.ChatView);

            var metrics = Resources.DisplayMetrics;

            _width = (int)((metrics.WidthPixels) / Resources.DisplayMetrics.Density);

            _scrollViewInnerLayout = FindViewById <LinearLayout>(Resource.Id.scrollViewInnerLayout);
            _editText = FindViewById <EditText>(Resource.Id.chatField);

            var sendButton = FindViewById <Button>(Resource.Id.sendButton);

            sendButton.Touch += HandleSendButton;

            var app = ChatApplication.GetApplication(this);

            app.CurrentActivity = this;

            _presenter = app.Presenter as ChatPresenter;
            _presenter.SetView(this);
            app.CurrentActivity = this;
        }
示例#2
0
        private void Start()
        {
            var view      = gameObject.GetComponent <IChatView>();
            var presenter = new ChatPresenter(view);

            var chatClient = new ChatClient(new UnityConsoleLogger());

            var useCase = new ChatUseCase(presenter, chatClient);
        }
示例#3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var view      = new ChatForm();
            var logger    = new ChatLogger(view);
            var service   = new ChatService(logger);
            var presenter = new ChatPresenter(view, service, logger);

            service.InitHook(presenter);
            presenter.Run();
        }
示例#4
0
        private void Init()
        {
            this.canScreenshot      = true;
            this.canDisconnect      = true;
            this.canDownloadExecute = true;
            this.canRemoteShell     = true;

            this.remoteShellPresenter = new RemoteShellPresenter(this);
            this.screenShotPresenter  = new ScreenshotPresenter(this);
            this.chatPresenter        = new ChatPresenter(this);

            this.CmdDisconnect      = new CommandHandler(() => this.Disconnect(), this.CanDisconnect);
            this.CmdScreenshot      = new CommandHandler(() => this.Screenshot(), this.CanScreenshot);
            this.CmdDownloadExecute = new CommandHandler(() => this.DownloadExecute(), this.CanDownloadExecute);
            this.CmdRemoteShell     = new CommandHandler(() => this.RemoteShell(), this.CanRemoteShell);
            this.CmdChat            = new CommandHandler(() => this.Chat(), this.CanChat);
        }
示例#5
0
 //looks dirty
 public void InitHook(ChatPresenter chatPresenter)
 {
     comPort.DataReceived += new SerialDataReceivedEventHandler(chatPresenter.comPort_DataReceived);
 }
示例#6
0
 public void SetChatPresenter(ChatPresenter chatPresenter)
 {
     this.chatPresenter = chatPresenter;
 }
示例#7
0
 /// <summary>
 /// Constructor with Chat Data Access Object for MVPVM handling
 /// </summary>
 /// <param name="dao"></param>
 public ChatView(ChatDao dao) : this()
 {
     Logger.debug("Initializing Chat Presenter.", origin: "ChatMail.ChatView");
     m_presenter = new ChatPresenter(this, dao);
 }
示例#8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Chat.iOS.Views.ChatViewController"/> class.
 /// </summary>
 /// <param name="presenter">Presenter.</param>
 public ChatViewController(ChatPresenter presenter)
 {
     _presenter = presenter;
 }