Ejemplo n.º 1
0
 void SelectMedia()
 {
     Unselect();
     MediaButton.SetSelected(true);
     control      = new RtdMediaControl();
     control.Dock = DockStyle.Fill;
     pMain.Controls.Add(control);
 }
Ejemplo n.º 2
0
 void SelectWifiHandover()
 {
     Unselect();
     //WifiHandoverButton.SetSelected(true);
     control      = new RtdWifiHandoverControl();
     control.Dock = DockStyle.Fill;
     pMain.Controls.Add(control);
 }
Ejemplo n.º 3
0
 void SelectVCard()
 {
     Unselect();
     VCardButton.SetSelected(true);
     control      = new RtdVCardControl();
     control.Dock = DockStyle.Fill;
     pMain.Controls.Add(control);
 }
Ejemplo n.º 4
0
 void SelectSmartPoster()
 {
     Unselect();
     SmartPosterButton.SetSelected(true);
     control      = new RtdSmartPosterControl();
     control.Dock = DockStyle.Fill;
     pMain.Controls.Add(control);
 }
Ejemplo n.º 5
0
 void SelectText()
 {
     Unselect();
     TextButton.SetSelected(true);
     control      = new RtdTextControl();
     control.Dock = DockStyle.Fill;
     pMain.Controls.Add(control);
 }
Ejemplo n.º 6
0
 void SelectUri()
 {
     Unselect();
     UriButton.SetSelected(true);
     control      = new RtdUriControl();
     control.Dock = DockStyle.Fill;
     pMain.Controls.Add(control);
 }
Ejemplo n.º 7
0
        public void SetNdef(Ndef ndef)
        {
            /* Display the NDEF as raw data in the hexBox */
            /* ------------------------------------------ */

            Trace.WriteLine("SetNdef");

            byte[] b = ndef.GetBytes();
            DynamicByteProvider p = new DynamicByteProvider(b);

            hexBox.ByteProvider = p;

            /* Try to recognize the NDEF, to display it in a user-friendly control */
            /* ------------------------------------------------------------------- */

            RtdControl control = null;

            if (ndef is RtdSmartPoster)
            {
                lbDecodedType.Text = "SmartPoster";
                control            = new RtdSmartPosterControl();
                control.SetContent(ndef);
            }
            else if (ndef is RtdUri)
            {
                lbDecodedType.Text = "URI";
                control            = new RtdUriControl();
                control.SetContent(ndef);
            }
            else if (ndef is RtdText)
            {
                lbDecodedType.Text = "Text";
                control            = new RtdControl();
                control.SetContent(ndef);
            }
            else if (ndef is RtdVCard)
            {
                lbDecodedType.Text = "VCard";
                control            = new RtdVCardControl();
                control.SetContent(ndef);
            }
            else if (ndef is RtdMedia)
            {
                lbDecodedType.Text = "Media (MIME)";
                control            = new RtdMediaControl();
                control.SetContent(ndef);
            }

            if (control != null)
            {
                pDecoded.Controls.Clear();
                control.Dock = DockStyle.Fill;
                pDecoded.Controls.Add(control);
            }
        }
Ejemplo n.º 8
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);
            }
        }
Ejemplo n.º 9
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);
        }