Пример #1
0
        // Executes the query outside of a syncEvent wait so it is safe to call from
        // inside an ExecuteOnIdleAndWait
        internal AppResult[] ExecuteQueryNoWait(AppQuery query)
        {
            AppResult[] resultSet = query.Execute();
            Sync(() => {
                DispatchService.RunPendingEvents();
                return(true);
            });

            return(resultSet);
        }
Пример #2
0
        public void WaitForNoElement(AppQuery query, int timeout)
        {
            const int pollTime = 100;

            syncEvent.Reset();
            AppResult[] resultSet = null;

            GLib.Timeout.Add((uint)pollTime, () => {
                resultSet = query.Execute();
                if (resultSet.Length == 0)
                {
                    syncEvent.Set();
                    return(false);
                }

                timeout -= pollTime;
                return(timeout > 0);
            });

            if (!syncEvent.WaitOne(timeout))
            {
                throw new Exception("Timeout while executing synchronized call");
            }
        }
Пример #3
0
		// Executes the query outside of a syncEvent wait so it is safe to call from
		// inside an ExecuteOnIdleAndWait
		AppResult[] ExecuteQueryNoWait (AppQuery query)
		{
			AppResult[] resultSet = query.Execute ();
			Sync (() => {
				DispatchService.RunPendingEvents ();
				return true;
			});

			return resultSet;
		}
Пример #4
0
 public AppResult[] ExecuteQuery(AppQuery query)
 {
     return(query.Execute());
 }