Beispiel #1
0
		public Issue886 ()
		{
			var isScrollEnabledSwitch = new Switch {
				IsToggled = true
			};
			var isScrollEnabledLabel = new Label {
				Text = "Scroll Enabled"
			};
			var isScrollEnabledLabelOn = new Label {
				Text = isScrollEnabledSwitch.IsToggled.ToString ()
			};

			var isZoomEnabledSwitch = new Switch {
				IsToggled = true
			};
			var isZoomEnabledLabel = new Label {
				Text = "Zoom Enabled"
			};
			var isZoomEnabledLabelOn = new Label {
				Text = isZoomEnabledSwitch.IsToggled.ToString ()
			};

			var map = new Map ();
			isScrollEnabledSwitch.Toggled += (sender, e) => {
				isScrollEnabledLabelOn.Text = e.Value.ToString ();
				map.HasScrollEnabled = e.Value;
			};

			isZoomEnabledSwitch.Toggled += (sender, e) => {
				isZoomEnabledLabelOn.Text = e.Value.ToString ();
				map.HasZoomEnabled = e.Value;
			};

			Content = new StackLayout {
				Children ={
					new StackLayout {
						Orientation = StackOrientation.Horizontal,
						Children = {
							isScrollEnabledSwitch,
							isScrollEnabledLabel,
							isScrollEnabledLabelOn
						}
					},
					new StackLayout {
						Orientation = StackOrientation.Horizontal,
						Children = {
							isZoomEnabledSwitch,
							isZoomEnabledLabel,
							isZoomEnabledLabelOn
						}
					},
					map
				}
			};

		}
        private static void crearComando(Switch contexto,Protocolo Protocolo, string query)
        {
            //DbFactory Factoria = DataAccessFactory.ObtenerProveedor();
            //DbCommand Comando = contexto.CreateCommand(query, CommandType.Text);
            //Comando.Parameters.Add(Factoria.CrearParametro("@codigo", Protocolo.PTR_CODIGO));
            //Comando.Parameters.Add(Factoria.CrearParametro("@nombre", Protocolo.PTR_NOMBRE));
            //Comando.Parameters.Add(Factoria.CrearParametro("@timeOutRequest", Util.NullableToDbValue<int>(Protocolo.PTR_TIMEOUT_REQUEST)));
            //Comando.Parameters.Add(Factoria.CrearParametro("@timeOutResponse", Util.NullableToDbValue<int>(Protocolo.PTR_TIMEOUT_RESPONSE)));
            //Comando.Parameters.Add(Factoria.CrearParametro("@iniciaComunicacion", Protocolo.PTR_INICIA_COMM));
            //Comando.Parameters.Add(Factoria.CrearParametro("@aceptaComunicacion", Protocolo.PTR_ACEPTA_COMM));
            //Comando.Parameters.Add(Factoria.CrearParametro("@tipoComunicacion_codigo", Protocolo.TipoComunicacion.TPO_CODIGO));

            //if (Protocolo.TipoComunicacion.TPO_CODIGO == (int)EnumTipoComunicacion.Componente)
            //{
            //    Comando.Parameters.Add(Factoria.CrearParametro("@componente", Protocolo.PTR_COMPONENTE));
            //    Comando.Parameters.Add(Factoria.CrearParametro("@nombreClase", Protocolo.PTR_NOMBRE_CLASE));
            //    Comando.Parameters.Add(Factoria.CrearParametro("@nombreMetodo", Protocolo.PTR_NOMBRE_METODO));
            //}
            //else
            //{
            //    Comando.Parameters.Add(Factoria.CrearParametro("@componente", DBNull.Value));
            //    Comando.Parameters.Add(Factoria.CrearParametro("@nombreClase", DBNull.Value));
            //    Comando.Parameters.Add(Factoria.CrearParametro("@nombreMetodo", DBNull.Value));
            //}

            //if (Protocolo.TipoComunicacion.TPO_CODIGO == (int)EnumTipoComunicacion.TCP)
            //{
            //    Comando.Parameters.Add(Factoria.CrearParametro("@puerto", Util.NullableToDbValue<int>(Protocolo.PTR_PUERTO)));
            //    Comando.Parameters.Add(Factoria.CrearParametro("@frame", Protocolo.PTR_FRAME));
            //    Comando.Parameters.Add(Factoria.CrearParametro("@caracterInicio", Protocolo.PTR_CARACTER_INICIO));
            //    Comando.Parameters.Add(Factoria.CrearParametro("@caracterFin", Protocolo.PTR_CARACTER_FIN));
            //}
            //else
            //{
            //    Comando.Parameters.Add(Factoria.CrearParametro("@puerto", DBNull.Value));
            //    Comando.Parameters.Add(Factoria.CrearParametro("@frame", DBNull.Value));
            //    Comando.Parameters.Add(Factoria.CrearParametro("@caracterInicio", DBNull.Value));
            //    Comando.Parameters.Add(Factoria.CrearParametro("@caracterFin", DBNull.Value));
            //}

            //return Comando;
        }
Beispiel #3
0
 public static void Refresh()
 {
     Switch.RefreshAll();
     TraceSource.RefreshAll();
     TraceInternal.Refresh();
 }
		StackLayout MakeForm ()
		{
			var nameEntry = new Entry {
				Placeholder = "Full Name"
			};
			var emailEntry = new Entry {
				Placeholder = "Email"
			};

			var companyEntry = new Entry {
				Placeholder = "Company"
			};

			var switchContainer = new StackLayout {
				Orientation = StackOrientation.Horizontal
			};

			var switchLabel = new Label {
				Text = "Completed Azure Mobile Services Challenge?"
			};
			var switchElement = new Switch ();

			switchContainer.Children.Add (switchLabel);
			switchContainer.Children.Add (switchElement);

			var entryContainer = new StackLayout {
				Children = {
					nameEntry,
					emailEntry,
					companyEntry,
					switchContainer
				},
				MinimumWidthRequest = 50
			};

			var qrButton = new Image {
				Source = "cover1.jpg",
				WidthRequest = 100,
				HeightRequest = 100
			};

			var result = new StackLayout {
				Orientation = StackOrientation.Horizontal
			};

			result.Children.Add (entryContainer);
			result.Children.Add (qrButton);

			result.SizeChanged += (sender, args) => {
				Debug.WriteLine (result.Bounds);
			};

			return result;
		}
Beispiel #5
0
		public virtual object Visit (Switch switchStatement)
		{
			return null;
		}