Ejemplo n.º 1
0
 protected override void OnRestart()
 {
     base.OnRestart();
     Context.DocStore.LoadList(Context.DocStoreFile);
     Context.Config = LiteIDConfig.Load(Context.ConfigFile);
     doclistAdapter.NotifyDataSetChanged();
 }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            string       ConfigFile = "config.lxm";
            LiteIDConfig Config     = LiteIDConfig.Load(ConfigFile);

            SetContentView(Resource.Layout.Options);
            Button   buttonGenerateAccount = FindViewById <Button>(Resource.Id.buttonGenerateAccount);
            Button   buttonResetID         = FindViewById <Button>(Resource.Id.buttonResetID);
            TextView textCurrentID         = FindViewById <TextView>(Resource.Id.textCurrentID);

            if (Config.Configured)
            {
                textCurrentID.Text = "0x" + LiteIDContext.BytesToHex(Config.BlockchainID);
            }
            else
            {
                textCurrentID.Text = "No ID - You must deploy a new contract.";
            }
            EditText textRPCAddress = FindViewById <EditText>(Resource.Id.textRPCAddress);
            Button   buttonSaveRPC  = FindViewById <Button>(Resource.Id.buttonSaveRPC);

            buttonGenerateAccount.Click += delegate
            {
                Toast.MakeText(this.ApplicationContext, "No connection; demo mode", ToastLength.Long).Show();
            };

            buttonResetID.Click += delegate
            {
                Config.BlockchainID = new byte[32];
                Random random = new Random();
                random.NextBytes(Config.BlockchainID);
                textCurrentID.Text = "0x" + LiteIDContext.BytesToHex(Config.BlockchainID);
                Config.Configured  = true;
                Config.Save(ConfigFile);
            };

            buttonSaveRPC.Click += delegate
            {
                Config.RPCAddress = textRPCAddress.Text;
                Config.Save(ConfigFile);
            };
        }
Ejemplo n.º 3
0
 private void Initialize()
 {
     DocStore = new DocumentList(DocStoreFile);
     Config   = LiteIDConfig.Load(ConfigFile);
 }