Пример #1
0
        void AsyncGetProperties(AndroidDevice device)
        {
            var gpop = new AdbGetPropertiesOperation(device);

            lock (outstandingQueries) {
                outstandingQueries.Add(gpop);
            }
            gpop.Completed += delegate(IAsyncOperation op) {
                lock (outstandingQueries) {
                    if (disposed)
                    {
                        return;
                    }
                    outstandingQueries.Remove(gpop);
                    gpop.Dispose();
                }
                if (!op.Success)
                {
                    LoggingService.LogError(string.Format("Error getting properties from device '{0}'", device.ID), gpop.Error);
                    //fall through, to cache the null result for failed queries
                }
                lock (props) {
                    props [device.ID] = gpop.Properties;
                }
                if (Changed != null)
                {
                    Changed();
                }
            };
        }
Пример #2
0
		void AsyncGetProperties (AndroidDevice device)
		{
			var gpop = new AdbGetPropertiesOperation (device);
			lock (outstandingQueries) {
				outstandingQueries.Add (gpop);
			}
			gpop.Completed += delegate (IAsyncOperation op) {
				lock (outstandingQueries) {
					if (disposed)
						return;
					outstandingQueries.Remove (gpop);
					gpop.Dispose ();
				}
				if (!op.Success) {
					LoggingService.LogError (string.Format ("Error getting properties from device '{0}'", device.ID), gpop.Error);
					//fall through, to cache the null result for failed queries
				}
				lock (props) {
					props [device.ID] = gpop.Properties	;
				}
				if (Changed != null)
					Changed ();
			};
		}