Ejemplo n.º 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)
                {
                }
            }
Ejemplo n.º 2
0
            /// <summary>
            /// Executes the task
            /// </summary>
            /// <param name="db">The database that is executing the task</param>
            public void Execute(NetworkDatabase db)
            {
                var client = new Client(db._host);

                try
                {
                    var objectList = client.With(DeviceInstance)
                                     .ReadProperty(dev => dev.ObjectList);
                    db._insertObjects(VendorId, DeviceInstance, objectList);
                }
                catch (AggregateException)
                {
                }
            }
Ejemplo n.º 3
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);
                var info   = db._db.GetObject(DeviceInstance, ObjectIdentifier);

                info.Refresh(queue);

                try
                {
                    queue.Send();
                    db._db.UpdateObject(info);
                    db._updateObject(info);
                }
                catch (AggregateException)
                {
                }
            }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructs a new descriptor subscription instance
 /// </summary>
 /// <param name="database">The network database</param>
 /// <param name="observer">The observer</param>
 public DescriptorSubscription(NetworkDatabase database, IDescriptorObserver <ObjectInfo, GlobalObjectId> observer)
 {
     this._database = database;
     this._observer = observer;
 }