Ejemplo n.º 1
0
        /// <summary>
        /// Popola la tabella utilizzando le informazioni memorizzate nel database
        /// </summary>
        void Init()
        {
            Keys = Database.LiteDatabase.singleton.GetTable("keys") as Database.Tables.Keys;
            var fetch = Keys.Get(DeviceId);

            foreach (var group in fetch.Keys)
            {
                dataGrid.Rows.Add(group, fetch[group]);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Inizializza i riferimenti alle tabelle del database
        /// </summary>
        void InitDatabase()
        {
            // Per il l'identificazione dei dispositivi
            Devices = Database.LiteDatabase.singleton.GetTable("devices") as Database.Tables.Devices;

            if (Devices == null)
            {
                MessageBox.Show(
                    "Internal Error! Devices table not found!",
                    "Fatal Error",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error
                    );
                Close();
            }

            // Sono il proprietario di questo dispositivo USB?
            // A seconda della risposta, questo form cambia leggermente comportamento
            OwnerMode = Devices.ImOwner(DeviceId);

            if (OwnerMode == false)
            {
                return;
            }
            // Per la gestione dei gruppi associati ai dispositivi, utile solo in OwnerMode
            Keys = Database.LiteDatabase.singleton.GetTable("keys") as Database.Tables.Keys;

            if (Keys == null)
            {
                MessageBox.Show(
                    "Internal Error! Keys table not found!",
                    "Fatal Error",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error
                    );
                Close();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Inizializza i riferimenti alle tabelle del database
        /// </summary>
        void InitDatabase()
        {
            // Per il l'identificazione dei dispositivi
            Devices = Database.LiteDatabase.singleton.GetTable("devices") as Database.Tables.Devices;

            if (Devices == null)
            {
                MessageBox.Show(
                    "Internal Error! Devices table not found!",
                    "Fatal Error",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error
                    );
                Close();
            }

            // Sono il proprietario di questo dispositivo USB?
            // A seconda della risposta, questo form cambia leggermente comportamento
            OwnerMode = Devices.ImOwner(DeviceId);

            if (OwnerMode == false) return;
            // Per la gestione dei gruppi associati ai dispositivi, utile solo in OwnerMode
            Keys = Database.LiteDatabase.singleton.GetTable("keys") as Database.Tables.Keys;

            if (Keys == null)
            {
                MessageBox.Show(
                    "Internal Error! Keys table not found!",
                    "Fatal Error",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error
                    );
                Close();
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Popola la tabella utilizzando le informazioni memorizzate nel database
 /// </summary>
 void Init()
 {
     Keys = Database.LiteDatabase.singleton.GetTable("keys") as Database.Tables.Keys;
     var fetch = Keys.Get(DeviceId);
     foreach(var group in fetch.Keys)
     {
         dataGrid.Rows.Add(group, fetch[group]);
     }
 }