protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); LoadApplication(new App()); var rr = Android.OS.Environment.ExternalStorageDirectory; var ssdsd = new DirectoryInfo(Path.Combine(rr.AbsolutePath, "Solar")); if (!ssdsd.Exists) { ssdsd.Create(); } var sds = ssdsd.GetFiles(); var archivo = sds.First(p => p.Name.Equals("dispositivo.txt")); var dispositivos = System.IO.File.ReadAllLines(archivo.FullName); ccd = ControladorConsumo.GetInstance(ssdsd.FullName); ccd.Inicia(dispositivos); }
////public static ServiceHost host; static void Main(string[] args) { process = ControladorConsumo.GetInstance(); ControladorConsumo._path = "c:/Solar"; var ssdsd = new DirectoryInfo(Path.Combine("c:/Solar")); var sds = ssdsd.GetFiles(); var archivo = sds.First(p => p.Name.Equals("dispositivo.txt")); var dispositivos = System.IO.File.ReadAllLines(archivo.FullName); process.Inicia(dispositivos); IniciaWS(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_main); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab); fab.Click += FabOnClick; this.Window.SetFlags(WindowManagerFlags.KeepScreenOn, WindowManagerFlags.KeepScreenOn); if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.WriteExternalStorage) != (int)Permission.Granted) { ActivityCompat.RequestPermissions(this, new string[] { Manifest.Permission.WriteExternalStorage }, 0); } if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.ReadExternalStorage) != (int)Permission.Granted) { ActivityCompat.RequestPermissions(this, new string[] { Manifest.Permission.ReadExternalStorage }, 0); } Timer.Elapsed += Timer_Elapsed; Timer.Start(); var rr = Android.OS.Environment.ExternalStorageDirectory; var ssdsd = new DirectoryInfo(Path.Combine(rr.AbsolutePath, "Solar")); var sds = ssdsd.GetFiles(); var archivo = sds.First(p => p.Name.Equals("dispositivo.txt")); var dispositivos = System.IO.File.ReadAllLines(archivo.FullName); ccd = ControladorConsumo.GetInstance(ssdsd.FullName); ccd.LogEvent += Ccd_LogEvent; ccd.Inicia(dispositivos); }
public ProcesoCCD() { process = ControladorConsumo.GetInstance(); process.Inicia(); }