Exemple #1
0
            /// <summary>
            /// Executes the refresh task
            /// </summary>
            /// <param name="db">The database that is executing the task</param>
            public void Execute(NetworkDatabase db)
            {
                var client = new Client(db._host);
                var queue  = new ReadQueue(client);

                ObjectInfo[] infos = new ObjectInfo[ObjectIdentifiers.Length];

                for (int i = 0; i < infos.Length; i++)
                {
                    infos[i] = db._options.DescriptorRegistrar.CreateDescriptor(
                        VendorId,
                        DeviceInstance,
                        ObjectIdentifiers[i]);

                    infos[i].Refresh(queue);
                }

                try
                {
                    queue.Send();
                    db._db.UpdateObjects(infos);
                    db._updateObjects(infos);
                }
                catch (AggregateException)
                {
                }
            }