Пример #1
0
        void CbNdefTypeSelectedIndexChanged(object sender, EventArgs e)
        {
            if (control != null)
            {
                pMain.Controls.Remove(control);
                control.Dispose();
                control = null;
            }

            switch (cbNdefType.SelectedIndex)
            {
            case 0:
                /* Text */
                control = new RtdTextControl();
                break;

            case 1:
                /* URI */
                control = new RtdUriControl();
                break;

            case 2:
                /* SmartPoster */
                control = new RtdSmartPosterControl();
                break;

            case 3:
                /* vCard */
                control = new RtdVCardControl();
                break;

            case 4:
                /* Arbitrary MIME Media (text) */
                control = new RtdMediaControl();
                break;

            case 5:
                /* WifiHandover */
                control = new RtdWifiHandoverControl();
                break;

            default:
                break;
            }

            if (control != null)
            {
                control.Dock = DockStyle.Fill;
                pMain.Controls.Add(control);
            }
        }
Пример #2
0
        void Unselect()
        {
            if (control != null)
            {
                pMain.Controls.Remove(control);
                control.Dispose();
                control = null;
            }

            SmartPosterButton.SetSelected(false);
            UriButton.SetSelected(false);
            TextButton.SetSelected(false);
            VCardButton.SetSelected(false);
            MediaButton.SetSelected(false);
            //WifiHandoverButton.SetSelected(false);
        }