Exemple #1
0
        void PerformDefaultRegistration()
        {
            if (this.bookmarkScopes == null)
            {
                this.bookmarkScopes = new List <BookmarkScopeHandle>();
            }

            //First register the default subinstance
            this.bookmarkScopes.Add(BookmarkScopeHandle.Default);

            // Note that we are starting the LocationEnvironment traversal from the current environment's Parent. We don't
            // want to include any BookmarkScopeHandles that are at the same scope level as the ExclusiveHandle. The ExclusiveHandle
            // should only be dependent on BookmarkScopeHandles that are higher in the scope tree.
            LocationEnvironment current = this.owningInstance.Environment;

            if (current != null)
            {
                for (current = current.Parent; current != null; current = current.Parent)
                {
                    //don't bother continuing if at this level there are no handles
                    if (!current.HasHandles)
                    {
                        continue;
                    }

                    // Look at the contained handles for the environment.
                    List <Handle> handles = current.Handles;
                    if (handles != null)
                    {
                        int count = handles.Count;
                        for (int i = 0; i < count; i++)
                        {
                            BookmarkScopeHandle scopeHandle = handles[i] as BookmarkScopeHandle;
                            if (scopeHandle != null)
                            {
                                this.bookmarkScopes.Add(scopeHandle);
                            }
                        }
                    }
                }
            }

            // Also need to look in the Executor for handles that may have been created without an environment.
            List <Handle> executorHandles = this.executor.Handles;

            if (executorHandles != null)
            {
                int count = executorHandles.Count;
                for (int i = 0; i < count; i++)
                {
                    BookmarkScopeHandle scopeHandle = executorHandles[i] as BookmarkScopeHandle;
                    if (scopeHandle != null)
                    {
                        this.bookmarkScopes.Add(scopeHandle);
                    }
                }
            }

            this.bookmarkScopesListIsDefault = true;
        }
Exemple #2
0
        public void RegisterBookmarkScope(NativeActivityContext context, BookmarkScopeHandle bookmarkScopeHandle)
        {
            if (context == null)
            {
                throw FxTrace.Exception.ArgumentNull("context");
            }

            context.ThrowIfDisposed();

            if (bookmarkScopeHandle == null)
            {
                throw FxTrace.Exception.ArgumentNull("bookmarkScopeHandle");
            }

            if ((this.ImportantBookmarks != null && this.ImportantBookmarks.Count != 0) || (this.UnimportantBookmarks != null && this.UnimportantBookmarks.Count != 0))
            {
                throw FxTrace.Exception.AsError(new InvalidOperationException(SR.ExclusiveHandleRegisterBookmarkScopeFailed));
            }

            if (this.bookmarkScopesListIsDefault)
            {
                this.bookmarkScopesListIsDefault = false;
                this.bookmarkScopes.Clear();
            }

            this.bookmarkScopes.Add(bookmarkScopeHandle);
            this.readOnlyBookmarkScopeCollection = null;
        }
        private void PerformDefaultRegistration()
        {
            if (this.bookmarkScopes == null)
            {
                this.bookmarkScopes = new List <BookmarkScopeHandle>();
            }
            this.bookmarkScopes.Add(BookmarkScopeHandle.Default);
            LocationEnvironment environment = this.owningInstance.Environment;

            if (environment != null)
            {
                for (environment = environment.Parent; environment != null; environment = environment.Parent)
                {
                    if (environment.HasHandles)
                    {
                        List <Handle> list = environment.Handles;
                        if (list != null)
                        {
                            int count = list.Count;
                            for (int i = 0; i < count; i++)
                            {
                                BookmarkScopeHandle item = list[i] as BookmarkScopeHandle;
                                if (item != null)
                                {
                                    this.bookmarkScopes.Add(item);
                                }
                            }
                        }
                    }
                }
            }
            List <Handle> handles = this.executor.Handles;

            if (handles != null)
            {
                int num3 = handles.Count;
                for (int j = 0; j < num3; j++)
                {
                    BookmarkScopeHandle handle2 = handles[j] as BookmarkScopeHandle;
                    if (handle2 != null)
                    {
                        this.bookmarkScopes.Add(handle2);
                    }
                }
            }
            this.bookmarkScopesListIsDefault = true;
        }
 public void RegisterBookmarkScope(NativeActivityContext context, BookmarkScopeHandle bookmarkScopeHandle)
 {
     if (context == null)
     {
         throw FxTrace.Exception.ArgumentNull("context");
     }
     context.ThrowIfDisposed();
     if (bookmarkScopeHandle == null)
     {
         throw FxTrace.Exception.ArgumentNull("bookmarkScopeHandle");
     }
     if (((this.ImportantBookmarks != null) && (this.ImportantBookmarks.Count != 0)) || ((this.UnimportantBookmarks != null) && (this.UnimportantBookmarks.Count != 0)))
     {
         throw FxTrace.Exception.AsError(new InvalidOperationException(System.Activities.SR.ExclusiveHandleRegisterBookmarkScopeFailed));
     }
     if (this.bookmarkScopesListIsDefault)
     {
         this.bookmarkScopesListIsDefault = false;
         this.bookmarkScopes.Clear();
     }
     this.bookmarkScopes.Add(bookmarkScopeHandle);
     this.readOnlyBookmarkScopeCollection = null;
 }
Exemple #5
0
 public void RegisterBookmarkScope(NativeActivityContext context, BookmarkScopeHandle bookmarkScopeHandle)
 {
     throw new NotImplementedException();
 }
 protected override void OnInitialize(HandleInitializationContext context)
 {
     this.noPersistHandle = context.CreateAndInitializeHandle<NoPersistHandle>();
     this.bookmarkScopeHandle = context.CreateAndInitializeHandle<BookmarkScopeHandle>();
 }
 static BookmarkScopeHandle()
 {
     Default = new BookmarkScopeHandle(BookmarkScope.Default);
 }
 internal BookmarkManager(BookmarkScope scope, BookmarkScopeHandle scopeHandle) : this()
 {
     this.scope = scope;
     this.scopeHandle = scopeHandle;
 }
Exemple #9
0
		static BookmarkScopeHandle ()
		{
			Default = new BookmarkScopeHandle (BookmarkScope.Default);
		}
Exemple #10
0
		public void RegisterBookmarkScope (NativeActivityContext context, BookmarkScopeHandle bookmarkScopeHandle)
		{
			throw new NotImplementedException ();
		}