示例#1
0
        /// <summary>
        /// On load set the config as per the chat application
        /// </summary>
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            //Remove the keyboard on a tap gesture
            var tap = new UITapGestureRecognizer();

            tap.AddTarget(() =>
            {
                this.View.EndEditing(true);
            });
            this.View.AddGestureRecognizer(tap);

            //Get a reference to the chat application
            ChatAppiOS chatApplication = ChatWindow.ChatApplication;

            //Update the settings based on previous values
            LocalServerEnabled.SetState(chatApplication.LocalServerEnabled, false);
            MasterIP.Text   = chatApplication.ServerIPAddress;
            MasterPort.Text = chatApplication.ServerPort.ToString();
            LocalName.Text  = chatApplication.LocalName;
            EncryptionEnabled.SetState(chatApplication.EncryptionEnabled, false);

            //Set the correct segment on the connection mode toggle
            ConnectionMode.SelectedSegment = (chatApplication.ConnectionType == ConnectionType.TCP ? 0 : 1);
        }
        void ReleaseDesignerOutlets()
        {
            if (MasterIP != null)
            {
                MasterIP.Dispose();
                MasterIP = null;
            }

            if (MasterPort != null)
            {
                MasterPort.Dispose();
                MasterPort = null;
            }

            if (LocalName != null)
            {
                LocalName.Dispose();
                LocalName = null;
            }

            if (ConnectionMode != null)
            {
                ConnectionMode.Dispose();
                ConnectionMode = null;
            }

            if (EncryptionEnabled != null)
            {
                EncryptionEnabled.Dispose();
                EncryptionEnabled = null;
            }

            if (LocalServerEnabled != null)
            {
                LocalServerEnabled.Dispose();
                LocalServerEnabled = null;
            }
        }