Exemplo n.º 1
0
        public void CreateAsync()
        {
            var worker            = new CreateTaskWorkerDelegate(CreateCollage);
            var completedCallback = new AsyncCallback(CreateTaskCompletedCallback);

            lock (this.sync)
            {
                if (this.isBusy)
                {
                    ThrowExceptions.Custom(Exc.GetStackTrace(), type, Exc.CallingMethod(), "The engine is currently busy.");
                }

                AsyncOperation async   = AsyncOperationManager.CreateOperation(null);
                var            context = new CreateCollageAsyncContext();
                bool           cancelled;
                worker.BeginInvoke(async, context, out cancelled, completedCallback, async);
                this.isBusy            = true;
                this.createTaskContext = context;
            }
        }
Exemplo n.º 2
0
        public void CreateAsync()
        {
            var worker = new CreateTaskWorkerDelegate(CreateCollage);
            var completedCallback = new AsyncCallback(CreateTaskCompletedCallback);

            lock (this.sync)
            {
                if (this.isBusy)
                {
                    throw new InvalidOperationException("The engine is currently busy.");
                }

                AsyncOperation async = AsyncOperationManager.CreateOperation(null);
                var context = new CreateCollageAsyncContext();
                bool cancelled;

                worker.BeginInvoke(async, context, out cancelled, completedCallback, async);

                this.isBusy = true;
                this.createTaskContext = context;
            }
        }
Exemplo n.º 3
0
        public void CreateAsync()
        {
            var worker            = new CreateTaskWorkerDelegate(CreateCollage);
            var completedCallback = new AsyncCallback(CreateTaskCompletedCallback);

            lock (this.sync)
            {
                if (this.isBusy)
                {
                    throw new InvalidOperationException("The engine is currently busy.");
                }

                AsyncOperation async   = AsyncOperationManager.CreateOperation(null);
                var            context = new CreateCollageAsyncContext();
                bool           cancelled;

                worker.BeginInvoke(async, context, out cancelled, completedCallback, async);

                this.isBusy            = true;
                this.createTaskContext = context;
            }
        }