This describes a background operation that occurs for an AlexandriaManager.
Esempio n. 1
0
        void BackgroundOperationThreadStart()
        {
            while (true)
            {
                lock (BackgroundOperations) {
                    if (BackgroundOperations.Count > 0)
                    {
                        CurrentBackgroundOperation = BackgroundOperations[0];
                        BackgroundOperations.RemoveAt(0);

                        try {
                            CurrentBackgroundOperation.Run(BackgroundOperationUpdateProgress);
                        } catch (Exception exception) {
                            Debugger.Log(0, "Exception", exception.ToString());
                            if (DebuggingEnabled)
                            {
                                Debugger.Break();
                            }
                        }

                        BackgroundOperationProgress = 0;
                        CurrentBackgroundOperation  = null;
                    }
                }

                Thread.Sleep(100);
            }
        }
Esempio n. 2
0
        /// <summary>Add a background operation.</summary>
        /// <param name="name"></param>
        /// <param name="description"></param>
        /// <param name="callbacks"></param>
        /// <returns></returns>
        public BackgroundOperation AddBackgroundOperation(string name, string description, params BackgroundOperationCallback[] callbacks)
        {
            BackgroundOperation operation = new BackgroundOperation(this, name, description, callbacks);

            lock (BackgroundOperations)
                BackgroundOperations.Add(operation);
            return(operation);
        }
 /// <summary>Add a background operation.</summary>
 /// <param name="name"></param>
 /// <param name="description"></param>
 /// <param name="callbacks"></param>
 /// <returns></returns>
 public BackgroundOperation AddBackgroundOperation(string name, string description, params BackgroundOperationCallback[] callbacks)
 {
     BackgroundOperation operation = new BackgroundOperation(this, name, description, callbacks);
     lock(BackgroundOperations)
         BackgroundOperations.Add(operation);
     return operation;
 }