Xamarin Public Jenkins (auto-signing) e79aa3c0ed Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
2016-08-03 10:59:49 +00:00

51 lines
1.6 KiB
C#

//-----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace System.Activities.Statements
{
using System;
using System.Activities;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using SA = System.Activities;
public sealed class DeleteBookmarkScope : NativeActivity
{
public DeleteBookmarkScope()
{
}
public InArgument<BookmarkScope> Scope
{
get;
set;
}
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
RuntimeArgument subInstanceArgument = new RuntimeArgument("Scope", typeof(BookmarkScope), ArgumentDirection.In);
metadata.Bind(this.Scope, subInstanceArgument);
metadata.SetArgumentsCollection(new Collection<RuntimeArgument> { subInstanceArgument });
}
protected override void Execute(NativeActivityContext context)
{
BookmarkScope toUnregister = this.Scope.Get(context);
if (toUnregister == null)
{
throw SA.FxTrace.Exception.AsError(new InvalidOperationException(SA.SR.CannotUnregisterNullBookmarkScope));
}
if (toUnregister.Equals(context.DefaultBookmarkScope))
{
throw SA.FxTrace.Exception.AsError(new InvalidOperationException(SA.SR.CannotUnregisterDefaultBookmarkScope));
}
context.UnregisterBookmarkScope(toUnregister);
}
}
}