[bcl] Remove System.Activities.Presentation folder from referencesource
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Tue, 10 Jan 2017 15:29:59 +0000 (16:29 +0100)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Tue, 10 Jan 2017 15:31:29 +0000 (16:31 +0100)
We won't import it into Mono anytime soon and the long paths
cause issues when checking out Mono on Windows.

602 files changed:
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/ExpressionSettingHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/FrameworkNameConstants.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/FrameworkNameExtensions.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/TypeNameHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ActivityBuilderExtensions.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ActivityTemplateFactoryBuilderReader.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ActivityTemplateFactoryBuilderWriter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ActivityTemplateFactoryBuilderXamlMembers.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/AttributeConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/AttributeInfo.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/AttributeXamlType.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/DefaultValueAttributeInfo.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/DesignTimeXamlWriter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/DesignerAttributeInfo.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/EditorAttributeInfo.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/IWorkflowDesignerXamlHelperExecutionContext.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ImportAttributeInfo.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ImportManyAttributeInfo.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/LineColumnPair.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/MultiTargetingTypeResolver.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/NameSpaces.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ObjectReferenceEqualityComparer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ResolverCache.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ResolverResult.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/SourceTextScanner.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ViewStateIdManager.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ViewStateXamlHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/WorkflowDesignerXamlHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/WorkflowDesignerXamlSchemaContext.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlNamespaceHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlObjectReaderWithSequence.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlTypeKind.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlTypeWithExplicitNamespace.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlTypeWithExtraPropertiesRemoved.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlWriterExtensions.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Tools/Common/Win32Interop.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/README.md [new file with mode: 0644]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/AssemblyInfo.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/Microsoft/Activities/Presentation/SharedFx.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/Microsoft/Activities/Presentation/SharedSR.Designer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/SR.Designer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ActivityDelegateInfo.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ActivityDelegateInfoPresenter.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ActivityDelegatePresenter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ActivityDelegateUtilities.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ActivityDesigner.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ActivityDesignerOptionsAttribute.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/AdornerLocation.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/Annotation.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/AnnotationAdorner.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/AnnotationAdornerService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/AnnotationManager.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/AnnotationStatus.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/DockedAnnotationView.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/FloatingAnnotationView.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/IAnnotationIndicator.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/IAnnotationVisualProvider.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/IDockedAnnotation.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/IFloatingAnnotation.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/NotifyArgumentVariableAnnotationTextChanged.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/UIElementToAnnotationIndicatorAdapter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/WorkflowAnnotationAdornerService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ArgumentAccessor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/ContextItem.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/ContextItemManager.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/EditingContext.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/EnumValidator.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/GenericTypeParameterConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/Metadata/AttributeData.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/Metadata/AttributeDataCache.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/Metadata/MutableAttributeTable.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/AutomatedChoiceEditor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/AutomatedComboBox.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/AutomatedListBox.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/AutomatedListBoxItemAutomationPeer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/CategoryContainerAutomationPeer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/CategoryListAutomationPeer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/HiddenUIElementAutomationPeer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/IAutomationFocusChangedEventSource.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/PropertyContainerAutomationPeer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/PropertyInspectorAutomationPeer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/SubPropertyEditorAutomationPeer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/TextFormatConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/CategoryList.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/CategoryNameMap.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/CiderCategoryContainer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/CiderCategoryLayoutContainer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/CiderStandardCategoryLayout.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/ContainerGeneratedEventArgs.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/EditModeSwitchButtonKeyboardFix.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/BoolViewEditor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/EditorUtilities.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/FlagEditor.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/FlagPanel.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/FlagStringConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/ImageSourceToImageConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/NewItemFactoryTypeModelToDisplayNameConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/NonZeroToBoolConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/PropertyValueToDisplayNameConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/PropertyValueToStandardValuesConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/RTLValueConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/SubPropertyEditor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/SubPropertyViewEditor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/ValueToToolTipConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/newitemfactorytypemodeltotypenameconverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/quickitemtemplateselector.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/ExtensibilityAccessor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Diagnostics/AutomationId.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Controls/WorkaroundPopup.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/AppendSuffixConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/BoolToDoubleConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/BoolToVisibilityCollpasedConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/BoolToVisibilityHiddenConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/ComposingConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/DelegateCommand.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/EqualsConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/IntegerToVisibilityConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/IsNullConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/NotConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/NullToBoolConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/ObservableCollection.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/SwitchConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/ValueConverters.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/VisibilityOrConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/ExceptionStringTable.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/IMessageLogger.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/MixedProperty.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/CategoryBase.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/CategoryContainer.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/CategoryContainerCommands.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/CategoryLayoutContainer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/ExtensibilityMetadataHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/IPropertyInspector.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/NewItemFactoryTypeModel.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/PropertyContainerPopupHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/StandardCategoryLayout.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Tolerances.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/UIThreadDispatcher.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/UserInterface/FocusScopeManager.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/ValueEditors/ChoiceEditor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/ValueEditors/RenderUtils.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/ValueEditors/StringEditor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/ValueEditors/ValueEditorUtils.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/ValueEditors/ValueToIconConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/IStateContainer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/KeyboardEnabledRadioButton.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Metadata/PropertyInspectorMetadata.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelCategoryEntry.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyEntry.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyEntryBase.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyEntryCollection.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyIndexer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyMerger.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyValue.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyValueCollection.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelUtilities.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/PropertyEntryNameComparer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/PropertyEntryPropertyOrderComparer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyInspector.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyInspectorFontAndColorDictionary.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyInspectorMergedResources.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyPanel.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertySelectionMode.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyToolBar.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyValueDialogControl.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyValueDialogHost.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyValueEditorCommandHandler.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Resources/PropertyInspectorResources.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Resources/ResourceUtilities.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/SearchDirection.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/CategoryContainerSelectionPathInterpreter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/CategoryEditorSelectionPathInterpreter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/CategoryEditorSelectionStop.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/CategorySelectionStop.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/ISelectionPathInterpreter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/ISelectionStop.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/PropertySelection.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/PropertySelectionPathInterpreter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/PropertySelectionStop.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/SelectionPath.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/SelectionPathResolver.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/SharedPropertyValueColumnWidthContainer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/AggregateStateContainer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/CategoryState.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/CategoryStateContainer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PersistedState.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PersistedStateContainer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PersistedStateUtilities.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PropertyActiveEditModeStateContainer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PropertyState.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PropertyStateContainer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PropertyViewManagerStateContainer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Views/AlphabeticalViewManager.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Views/ByCategoryViewManager.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Views/IPropertyViewManager.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/VisualTreeUtils.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/manifestimages.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/AttributeCallback.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/AttributeCallbackBuilder.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/AttributeTable.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/AttributeTableBuilder.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/AttributeTableValidationException.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/IRegisterMetadata.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/MetadataStore.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/OrderToken.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/OrderTokenConflictResolution.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/OrderTokenPrecedence.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Properties/Resources.Designer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/CategoryEditor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/DependencyPropertyValueSource.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/DialogPropertyValueEditor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/EditModeSwitchButton.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/EditorReuseAttribute.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/EnumValidator.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/ExtendedPropertyValueEditor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/IPropertyFilterTarget.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyContainer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyContainerEditMode.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyFilter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyFilterAppliedEventArgs.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyFilterPredicate.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyMarker.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyOrder.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyOrderAttribute.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValue.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValueCollection.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValueEditor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValueEditorCommands.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValueExceptionEventArgs.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValueExceptionSource.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValueSource.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/categoryentry.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/newitemfactory.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/newitemtypesattribute.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/propertyentry.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/propertyentrycollection.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PublishServiceCallback.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/ServiceManager.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/SubscribeContextCallback.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/SubscribeServiceCallback.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Documents/ViewManager.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Documents/ViewManagerAttribute.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/CreateOptions.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/EnumValidator.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelEditingScope.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelFactory.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelItem.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelItemCollection.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelItemDictionary.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelMemberCollection.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelProperty.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelPropertyCollection.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Services/ModelChangeInfo.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Services/ModelChangeInfoImpl.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Services/ModelChangeType.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Services/ModelChangedEventArgs.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Services/ViewService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Shared/Internal/EqualityArray.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/BookmarkUndoUnit.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/CachedResourceDictionaryExtension.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ClipboardData.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ContextMenuUtilities.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ActivityActionSearchableStringConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ArgumentSearchableStringConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ArgumentToExpressionConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ArgumentToExpressionModelItemConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/EmptySearchableStringConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/EncodingSearchableStringConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ModelItemToAnnotationEnabledConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ModelPropertyEntryToModelItemConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ModelPropertyEntryToOwnerActivityConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ModelToObjectValueConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ObjectToModelValueConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/OutlineViewTextConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/SearchableStringConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/SearchableStringConverterAttribute.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/TypeSearchableStringConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/VBIdentifierTrimConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/VisualBasicValueSearchableStringConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/XNameSearchableStringConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/CutCopyPasteHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Debugger/AllowBreakpointAttribute.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Debugger/BreakpointType.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Debugger/DebuggerService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Debugger/IDesignerDebugView.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DefaultCommandExtensionCallback.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DefaultTypeArgumentAttribute.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DeleteHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignObjectWrapper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignTimeValidationFeature.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignerConfigurationService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignerConfigurationServiceUtilities.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignerMetadata.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignerPerfEventProvider.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignerPerfEvents.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DialogWindow.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DictionaryItemsCollection.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DockedAnnotationDecorator.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DragDropHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DropAnimation.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DynamicActivityPropertyUtilities.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/EditingContextUtilities.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/EditingScopeUndoUnit.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/EditorOptionAttribute.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ErrorActivity.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ErrorItem.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ErrorReporting.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ExpandButtonVisibilityConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ExpandCollapseIsCheckedConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ExpressionHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ExpressionSelection.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Expressions/CreateExpressionFromString.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Expressions/ExpressionActivityEditor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Expressions/ExpressionMorphHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Expressions/ExpressionMorphHelperAttribute.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Expressions/TextualExpressionEditor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Feature.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FeatureAttribute.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FeatureManager.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoConnectAdorner.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoConnectDirections.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoConnectHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoSplitAdorner.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoSplitAlignment.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoSplitHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectionPoint.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectionPointConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectionPointKind.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectionPointsAdorner.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/Connector.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorCreationAdorner.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorEditor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorIdentityConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorLabelMarginConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorLabelVisibilityConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorMovedEventArgs.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorMovedEventHandler.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorPointsToArrowMarginConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorPointsToArrowTransformConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorPointsToSegmentsConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorRouter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorStartDotConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorWithStartDot.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorWithoutStartDot.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/DesignerGeometryHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/DoubleExtensions.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/FreeFormPanel.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/IAutoConnectContainer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/IAutoSplitContainer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/INestedFreeFormPanelContainer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/LocationChangedEventArgs.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/LocationChangedEventHandler.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/PointExtensions.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/RequiredSizeChangedEventArgs.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/RequiredSizeChangedEventHandler.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/GenericTypeParameterConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/HelpKeywords.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/ICommandService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/IDocumentPersistenceService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/IMultiTargetingSupportService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/IWorkflowCommandExtensionCallback.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/MultiTargetingSupportService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/WindowHelperService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/WorkflowCommandExtensionItem.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IActivityDelegateFactory.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IActivityToolboxService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ICompositeView.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ICompositeViewEvents.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IExpandChild.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IIntegratedHelpService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IModalService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IMultipleDragEnabledCompositeView.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IUndoEngineOperations.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IWorkflowDesignerStorageService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IXamlLoadErrorService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Metadata/ActivityArgumentHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Metadata/ActivityDelegateArgumentDirection.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Metadata/ActivityDelegateArgumentMetadata.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Metadata/ActivityDelegateMetadata.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/MiniMap/MiniMapControl.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/AttachablePropertyChange.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/AttachedPropertiesService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/AttachedProperty.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/AttachedPropertyDescriptor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/AttachedPropertyInfo.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/BackPointer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/Change.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/CollectionChange.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/DictionaryChange.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/DictionaryEditChange.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/Edge.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/EditingScope.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/EditingScopeEventArgs.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/FakeModelItemImpl.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/FakeModelPropertyImpl.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/GenericArgumentsUpdater.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/GraphManager.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/IItemsCollection.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/IModelTreeItem.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ImmediateEditingScope.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/LinkBase.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/LinkType.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelChange.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelChangedEventArgsImpl.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemCollectionImpl.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemDictionaryImpl.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemExtensions.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemImpl.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemsAddedEventArgs.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemsRemovedEventArgs.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelPropertyCollectionImpl.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelPropertyDescriptor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelPropertyImpl.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelSearchService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelSearchServiceImpl.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelServiceImpl.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelTreeItemHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelTreeManager.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelTypeConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelTypeDescriptorContextWrapper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelUtilities.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/MorphHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/PropertyChange.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/PropertyReferenceChange.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/PropertyReferenceChangedEventArgs.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/SearchableEntry.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/SearchableEntryOption.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/TextImage.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/WeakKeyDictionary.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/WeakKeyDictionary.cs.back [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/XamlUtilities.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ModelItemKeyValuePair.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NamespaceHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NamespaceHelper.cs.back [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NamespaceListProperty.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NamespaceListProperty.cs.back [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NamespaceSettingsHandler.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NonTextualExpressionMorphHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NotConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NullToBooleanConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ObjectReferenceService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/PropertyEditing/VersionPropertyValueEditor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/PropertyReferenceUtilities.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ReadOnlyState.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/RetriableClipboard.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/SQM/ActivityUsageCounter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/SQM/DataPointIds.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/SQM/FeatureUsageCounter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/SQM/IVSSqmService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ShowExpandedMultiValueConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/SourceLocationUpdatedEventArgs.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/TargetFrameworkPropertyFilter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/TaskDispatcher.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/TextFormattingConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ActivityTemplateFactory.Generic.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ActivityTemplateFactory.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ActivityTemplateFactoryBuilder.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ActivityTemplateFactoryExtension.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/IActivityTemplateFactory.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolCreatedEventArgs.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolCreatedEventHandler.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolboxCategory.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolboxCategoryItems.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolboxControl.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolboxItemImageConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolboxItemLoader.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolboxItemWrapper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/TreeViewContainerStyleSelector.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/TreeViewTemplateSelector.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/TypeNameConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/TypeResolvingOptionsAttribute.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/TypeUtilities.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/UndoEngine.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/UndoUnit.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/UndoUnitEventArgs.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/UpdatableGenericsFeature.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Utility/IconHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/BackgroundValidationSynchronizer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ForegroundValidationSynchronizer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/IValidationErrorService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/IValidationErrorSourceLocator.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationErrorInfo.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationReason.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationRoot.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationState.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationSynchronizer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ValidationErrorSourceLocatorFeature.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/VariableExpressionConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/VerticalConnector.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ActivityTypeDesigner.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ActivityTypeResolver.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/AnnotationDialog.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ArgumentDesigner.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/AssemblyContextControlItem.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/AutoScrollHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/BreadCrumbTextConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/CanExpandCollapseAllConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/DataGridHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/DesignerView.Commands.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/DesignerView.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/DesignerWithHeader.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/EditorResources.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ErrorView.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExpressionTextBox.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExpressionTextBoxAutomationPeer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExpressionValueEditor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExtensionSurface.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExtensionWindow.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExtensionWindowClosingRoutedEventArgs.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExtensionWindowHeader.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExtensionWindowResizeGrip.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/FilterableData.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/GenericActivityTypeDesigner.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/HandleValueEditor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/IExpressionEditorInstance.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/IExpressionEditorService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/IVersionEditor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ImportDesigner.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ImportedNamespaceContextItem.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ModelPropertyPathExpanderConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/NamespaceDisplay.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/NamespaceDisplayAutomationPeer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/NoContextMenuGrid.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/OutlineView/HidePropertyInOutlineViewAttribute.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/OutlineView/ShowInOutlineViewAttribute.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/OutlineView/ShowPropertyInOutlineViewAsSiblingAttribute.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/OutlineView/ShowPropertyInOutlineViewAttribute.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ParserContext.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/PropertyEntryToEditingContextConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/PropertyEntryToEditorOptionConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/QuadTree.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/RubberBandSelector.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ScrollViewerPanner.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/SearchToolTipAdorner.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/Selection.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/SpacerPlaceholder.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/ChangeNotificationTracker.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/DesignerTreeAutoExpandHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/DesignerTreeView.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/DesignerTreeViewItem.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/ITreeViewItemSelectionHandler.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/TreeViewItemKeyValuePairModelItemViewModel.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/TreeViewItemModelItemViewModel.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/TreeViewItemModelPropertyViewModel.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/TreeViewItemViewModel.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/UniqueModelItemHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypeBrowser.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypeKeyValue.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypePresenter.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypePropertyEditor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypeResolvingOptions.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypeToArgumentTypeConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypeToStringValueConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VBIdentifierDesigner.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VBIdentifierName.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VBIdentifierNameEditor.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VariableDesigner.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VersionEditor.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VersionEditorViewModel.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ViewCreatedEventArgs.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ViewStateChangedEventArgs.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ViewStateChangedEventHandler.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ViewStateService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ViewUtilities.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VirtualizedContainerService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VisualBasicEditor.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VisualBasicEditorAutomationPeer.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VisualBasicReferenceValidationFeature.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VisualBasicValueValidationFeature.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/WindowExtensionMethods.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/WorkflowViewManager.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/WorkflowViewService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/WorkflowViewStateService.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ViewModel.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ViewState/ViewStateData.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ViewState/ViewStateManager.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ViewState/WorkflowViewState.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ViewStateAttachedPropertyFeature.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/VisualBasicExpressionMorphHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowDesigner.Debugger.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowDesigner.Helpers.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowDesigner.SerializationHelpers.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowDesigner.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowDesignerColors.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowDesignerIcons.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowElementDialog.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowElementDialogWindow.xaml.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowFileItem.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowItemPresenter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowItemsPresenter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowViewElement.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/XNameConverter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Xaml/ActivityBuilderHelper.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Xaml/ErrorTolerantObjectWriter.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Xaml/MultiTargetingXamlSchemaContext.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Xaml/ObjectToSourceLocationMapping.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Xaml/ShimAsPublicXamlType.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Xaml/SourceLocationExtensions.cs [deleted file]
mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/XamlLoadErrorInfo.cs [deleted file]

diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/ExpressionSettingHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/ExpressionSettingHelper.cs
deleted file mode 100644 (file)
index ff2a8ea..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace Microsoft.Activities.Presentation
-{
-    using System.Activities.Expressions;
-using System.Activities.Presentation.Expressions;
-using System.Activities.Presentation.Model;
-using System.Diagnostics;
-using System.Diagnostics.CodeAnalysis;
-using System.Runtime.Versioning;
-using Microsoft.VisualBasic.Activities;
-
-    internal static class ExpressionSettingHelper
-    {
-        internal static readonly string VBExpressionLanguageName = (new VisualBasicValue<string>() as ITextExpression).Language;
-
-        [SuppressMessage("Reliability", "Reliability101", Justification = "We can't use Fx.Assert here since this is not a framework assembly.")]
-        internal static string GetRootEditorSetting(ModelTreeManager modelTreeManager, FrameworkName targetFramework)
-        {
-            Debug.Assert(modelTreeManager != null, "modelTreeManager is null.");
-            Debug.Assert(targetFramework != null, "targetFramework is null.");
-
-            string globalEditorSetting = null;
-            if (Is45OrHigher(targetFramework))
-            {
-                if (modelTreeManager != null)
-                {
-                    ModelItem rootItem = modelTreeManager.Root;
-                    if (rootItem != null)
-                    {
-                        object root = rootItem.GetCurrentValue();
-                        globalEditorSetting = ExpressionActivityEditor.GetExpressionActivityEditor(root);
-                        if (string.IsNullOrEmpty(globalEditorSetting))
-                        {
-                            globalEditorSetting = VBExpressionLanguageName;
-                        }
-                    }
-                }
-            }
-            else
-            {
-                // When the target framework is less than 4.5, the root setting is ignored and always return VB
-                globalEditorSetting = VBExpressionLanguageName;
-            }
-
-            return globalEditorSetting;
-        }
-
-        private static bool Is45OrHigher(FrameworkName frameworkName)
-        {
-            return frameworkName.Version.Major > 4 || (frameworkName.Version.Major == 4 && frameworkName.Version.Minor >= 5);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/FrameworkNameConstants.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/FrameworkNameConstants.cs
deleted file mode 100644 (file)
index 78218ea..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace Microsoft.Activities.Presentation
-{
-    using System;
-    using System.Runtime.Versioning;
-
-    internal static class FrameworkNameConstants
-    {
-        public static readonly FrameworkName NetFramework40 = new FrameworkName(NetFramework, new Version(4, 0));
-        public static readonly FrameworkName NetFramework45 = new FrameworkName(NetFramework, new Version(4, 5));
-
-        internal const string NetFramework = ".NETFramework";
-        internal const string NetFrameworkWithSpace = ".NET Framework";
-        internal const string ClientProfileName = "Client";
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/FrameworkNameExtensions.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/FrameworkNameExtensions.cs
deleted file mode 100644 (file)
index d3137db..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation
-{
-    using System.Runtime.Versioning;
-
-    internal static class FrameworkNameExtensions
-    {
-        public static bool Is45OrHigher(this FrameworkName frameworkName)
-        {
-            return frameworkName.Version.Major > 4 || (frameworkName.Version.Major == 4 && frameworkName.Version.Minor >= 5);
-        }
-
-        public static bool IsLessThan45(this FrameworkName frameworkName)
-        {
-            return frameworkName.Version.Major < 4 || (frameworkName.Version.Major == 4 && frameworkName.Version.Minor < 5);
-        }
-
-        public static bool IsLessThan40(this FrameworkName frameworkName)
-        {
-            return frameworkName.Version.Major < 4;
-        }
-
-        public static bool IsProfileSupported(this FrameworkName frameworkName)
-        {
-            if (frameworkName.Profile == string.Empty)
-            {
-                return true;
-            }
-
-            if (frameworkName.Profile == FrameworkNameConstants.ClientProfileName)
-            {
-                return true;
-            }
-
-            return false;
-        }
-
-        public static bool IsFullProfile(this FrameworkName frameworkName)
-        {
-            return string.IsNullOrEmpty(frameworkName.Profile);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/TypeNameHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/TypeNameHelper.cs
deleted file mode 100644 (file)
index 231a93f..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace Microsoft.Activities.Presentation
-{
-    using System;
-    using System.Globalization;
-    using System.Text;
-    using System.Text.RegularExpressions;
-
-    internal static class TypeNameHelper
-    {
-        // note: does not work for nested type when fullName is true
-        // eg. Namespace.DeclaringType.NestedType<T> will be displayed
-        // as  Namespace.DeclaringType+NestedType<T>
-        public static string GetDisplayName(Type type, bool fullName)
-        {
-            if (type == null)
-            {
-                return string.Empty;
-            }
-
-            if (type.IsGenericParameter)
-            {
-                return type.Name;
-            }
-
-            if (!type.IsGenericType && !type.IsArray)
-            {
-                if (fullName)
-                {
-                    return type.FullName;
-                }
-                else
-                {
-                    return type.Name;
-                }
-            }
-
-            // replace `2 with <Type1, Type2>
-            Regex regex = new Regex("`[0-9]+");
-            GenericsMatchEvaluator evaluator = new GenericsMatchEvaluator(type.GetGenericArguments(), fullName);
-
-            // Remove [[fullName1, ..., fullNameX]]
-            string name;
-            if (fullName)
-            {
-                name = type.FullName;
-            }
-            else
-            {
-                name = type.Name;
-            }
-
-            int start = name.IndexOf("[[", StringComparison.Ordinal);
-            int end = name.LastIndexOf("]]", StringComparison.Ordinal);
-            if (start > 0 && end > 0)
-            {
-                name = name.Substring(0, start) + name.Substring(end + 2);
-            }
-
-            return regex.Replace(name, evaluator.Evaluate);
-        }
-
-        private class GenericsMatchEvaluator
-        {
-            private Type[] generics = null;
-            private int index;
-            private bool fullName;
-
-            public GenericsMatchEvaluator(Type[] generics, bool fullName)
-            {
-                this.generics = generics;
-                this.index = 0;
-                this.fullName = fullName;
-            }
-
-            public string Evaluate(Match match)
-            {
-                int numberOfParameters = int.Parse(match.Value.Substring(1), CultureInfo.InvariantCulture);
-
-                StringBuilder sb = new StringBuilder();
-
-                // matched "`N" is replaced by "<Type1, ..., TypeN>"
-                sb.Append("<");
-
-                for (int i = 0; i < numberOfParameters; i++)
-                {
-                    if (i > 0)
-                    {
-                        sb.Append(", ");
-                    }
-
-                    sb.Append(TypeNameHelper.GetDisplayName(this.generics[this.index++], this.fullName));
-                }
-
-                sb.Append(">");
-
-                return sb.ToString();
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ActivityBuilderExtensions.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ActivityBuilderExtensions.cs
deleted file mode 100644 (file)
index 4b49258..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Activities;
-    using Microsoft.VisualBasic.Activities;
-
-    internal static class ActivityBuilderExtensions
-    {
-        internal static DynamicActivity ConvertToDynamicActivity(this ActivityBuilder activityBuilder)
-        {
-            DynamicActivity result = new DynamicActivity();
-            ActivityBuilderExtensions.ConvertActivityBuilderToDynamicActivity(activityBuilder, result);
-            return result;
-        }
-
-        internal static void ConvertActivityBuilderToDynamicActivity(ActivityBuilder activityBuilder, DynamicActivity bodyPlaceholder)
-        {
-            bodyPlaceholder.Name = activityBuilder.Name;
-            bodyPlaceholder.Implementation = () => activityBuilder.Implementation;
-
-            if (activityBuilder.Implementation != null)
-            {
-                VisualBasic.SetSettings(bodyPlaceholder, VisualBasic.GetSettings(activityBuilder));
-            }
-
-            bodyPlaceholder.Attributes.Clear();
-            foreach (Attribute attribute in activityBuilder.Attributes)
-            {
-                bodyPlaceholder.Attributes.Add(attribute);
-            }
-
-            bodyPlaceholder.Properties.Clear();
-            foreach (DynamicActivityProperty property in activityBuilder.Properties)
-            {
-                bodyPlaceholder.Properties.Add(property);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ActivityTemplateFactoryBuilderReader.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ActivityTemplateFactoryBuilderReader.cs
deleted file mode 100644 (file)
index dba5836..0000000
+++ /dev/null
@@ -1,284 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Activities.Presentation.Toolbox;
-    using System.Xaml;
-
-    // ActivityTemplateFactoryBuilderReader is a XamlReader that support <ActivityTemplateFactory x:Class ... 
-    //
-    // Think of this class (and any other XamlReader) as a XAML node stream editor
-    // XAML node are *not* objects, they are represented as this. For example, when the reader encounter a StartObject node, its NodeType will become StartObject, and its Type will become the type of the starting object.
-    // The writer will then edit the stream and send the nodes to the underlying stream (by calling the methods on the underlying writer)
-    // 
-    // The editing algorithm goes as follow:
-    // 
-    // Initially, the first node is read from the underlying reader, if the first node is <ActivityTemplateFactory, then we start buffering nodes, otherwise we simply switch to the Bypass state
-    // We transform and buffer the transformed nodes until we reach the StartMember of Implementation Node, then we yield the control and switch to the ReadingFromBuffer state.
-    //
-    // All the external calls are then delegated to the reader provided by the buffer.
-    //
-    // Eventually, the buffer will used up, and we will switch to the Bypass state.
-    internal sealed class ActivityTemplateFactoryBuilderReader : XamlReader, IXamlLineInfo
-    {
-        private XamlSchemaContext schemaContext;
-        private XamlReader underlyingReader;
-        private XamlNodeQueue queuedNodes;
-        private XamlType activityTemplateFactoryBuilderType;
-        private XamlMember activityTemplateFactoryBuilderImplementationMember;
-        private XamlMember activityTemplateFactoryBuilderNameMember;
-        private XamlMember activityTemplateFactoryBuilderTargetTypeMember;
-
-        private bool hasLineInfo;
-        private ActivityTemplateFactoryBuilderReaderStates currentState = ActivityTemplateFactoryBuilderReaderStates.InitialState;
-
-        public ActivityTemplateFactoryBuilderReader(XamlReader underlyingReader, XamlSchemaContext schemaContext)
-        {
-            this.underlyingReader = underlyingReader;
-            this.schemaContext = schemaContext;
-            this.hasLineInfo = this.underlyingReader is IXamlLineInfo;
-        }
-
-        private enum ActivityTemplateFactoryBuilderReaderStates
-        {
-            InitialState,
-            ReadingFromBufferState,
-            BypassState,
-        }
-
-        public override bool IsEof
-        {
-            get
-            {
-                if (this.currentState == ActivityTemplateFactoryBuilderReaderStates.ReadingFromBufferState)
-                {
-                    return false;
-                }
-                else
-                {
-                    return this.underlyingReader.IsEof;
-                }
-            }
-        }
-
-        public override XamlMember Member
-        {
-            get { return this.CurrentReader.Member; }
-        }
-
-        public override NamespaceDeclaration Namespace
-        {
-            get { return this.CurrentReader.Namespace; }
-        }
-
-        public override XamlNodeType NodeType
-        {
-            get { return this.CurrentReader.NodeType; }
-        }
-
-        public override XamlSchemaContext SchemaContext
-        {
-            get { return this.schemaContext; }
-        }
-
-        public override XamlType Type
-        {
-            get { return this.CurrentReader.Type; }
-        }
-
-        public override object Value
-        {
-            get { return this.CurrentReader.Value; }
-        }
-
-        public bool HasLineInfo
-        {
-            get { return this.hasLineInfo; }
-        }
-
-        public int LineNumber
-        {
-            get
-            {
-                if (this.HasLineInfo)
-                {
-                    return this.CurrentLineInfo.LineNumber;
-                }
-                else
-                {
-                    return 0;
-                }
-            }
-        }
-
-        public int LinePosition
-        {
-            get
-            {
-                if (this.HasLineInfo)
-                {
-                    return this.CurrentLineInfo.LinePosition;
-                }
-                else
-                {
-                    return 0;
-                }
-            }
-        }
-
-        private XamlReader CurrentReader
-        {
-            get
-            {
-                switch (this.currentState)
-                {
-                    case ActivityTemplateFactoryBuilderReaderStates.InitialState:
-                    case ActivityTemplateFactoryBuilderReaderStates.BypassState:
-                        return this.underlyingReader;
-
-                    default:
-                        SharedFx.Assert(this.currentState == ActivityTemplateFactoryBuilderReaderStates.ReadingFromBufferState, "This is the only remaining ActivityTemplateFactoryBuilderReaderStates.");
-                        return this.queuedNodes.Reader;
-                }
-            }
-        }
-
-        private IXamlLineInfo CurrentLineInfo
-        {
-            get { return (IXamlLineInfo)this.CurrentReader; }
-        }
-
-        private XamlType ActivityTemplateFactoryBuilderType
-        {
-            get
-            {
-                if (this.activityTemplateFactoryBuilderType == null)
-                {
-                    this.activityTemplateFactoryBuilderType = new XamlType(typeof(ActivityTemplateFactoryBuilder), this.schemaContext);
-                }
-
-                return this.activityTemplateFactoryBuilderType;
-            }
-        }
-
-        private XamlMember ActivityTemplateFactoryBuilderImplementationMember
-        {
-            get
-            {
-                if (this.activityTemplateFactoryBuilderImplementationMember == null)
-                {
-                    this.activityTemplateFactoryBuilderImplementationMember = ActivityTemplateFactoryBuilderXamlMembers.ActivityTemplateFactoryBuilderImplementationMember(this.schemaContext);
-                }
-
-                return this.activityTemplateFactoryBuilderImplementationMember;
-            }
-        }
-
-        private XamlMember ActivityTemplateFactoryBuilderNameMember
-        {
-            get
-            {
-                if (this.activityTemplateFactoryBuilderNameMember == null)
-                {
-                    this.activityTemplateFactoryBuilderNameMember = ActivityTemplateFactoryBuilderXamlMembers.ActivityTemplateFactoryBuilderNameMember(this.schemaContext);
-                }
-
-                return this.activityTemplateFactoryBuilderNameMember;
-            }
-        }
-
-        private XamlMember ActivityTemplateFactoryBuilderTargetTypeMember
-        {
-            get
-            {
-                if (this.activityTemplateFactoryBuilderTargetTypeMember == null)
-                {
-                    this.activityTemplateFactoryBuilderTargetTypeMember = ActivityTemplateFactoryBuilderXamlMembers.ActivityTemplateFactoryBuilderTargetTypeMember(this.schemaContext);
-                }
-
-                return this.activityTemplateFactoryBuilderTargetTypeMember;
-            }
-        }
-
-        public override bool Read()
-        {
-            switch (this.currentState)
-            {
-                case ActivityTemplateFactoryBuilderReaderStates.InitialState:
-                    bool hasMoreNodes = this.underlyingReader.Read();
-                    if (this.underlyingReader.NodeType == XamlNodeType.StartObject && IsActivityTemplateFactoryType(this.underlyingReader.Type))
-                    {
-                        Type underlyingType = this.underlyingReader.Type.UnderlyingType;
-                        Type targetType = underlyingType.IsGenericType ? underlyingType.GetGenericArguments()[0] : null;
-
-                        this.currentState = ActivityTemplateFactoryBuilderReaderStates.ReadingFromBufferState;
-                        this.queuedNodes = new XamlNodeQueue(this.schemaContext);
-                        this.queuedNodes.Writer.WriteStartObject(this.ActivityTemplateFactoryBuilderType, (IXamlLineInfo)this.underlyingReader);
-
-                        string className;
-
-                        while (this.underlyingReader.Read())
-                        {
-                            if (this.underlyingReader.NodeType == XamlNodeType.StartMember && this.underlyingReader.Member == XamlLanguage.Class)
-                            {
-                                this.underlyingReader.Read();
-                                className = (string)this.underlyingReader.Value;
-                                this.underlyingReader.Read();
-                                this.queuedNodes.Writer.WriteStartMember(this.ActivityTemplateFactoryBuilderNameMember, (IXamlLineInfo)this.underlyingReader);
-                                this.queuedNodes.Writer.WriteValue(className, (IXamlLineInfo)this.underlyingReader);
-                                this.queuedNodes.Writer.WriteEndMember((IXamlLineInfo)this.underlyingReader);
-                                if (targetType != null)
-                                {
-                                    this.queuedNodes.Writer.WriteStartMember(this.ActivityTemplateFactoryBuilderTargetTypeMember, (IXamlLineInfo)this.underlyingReader);
-                                    object targetTypeString = targetType;
-                                    this.queuedNodes.Writer.WriteValue(targetTypeString);
-                                    this.queuedNodes.Writer.WriteEndMember();
-                                }
-                            }
-                            else if (this.underlyingReader.NodeType == XamlNodeType.StartMember && this.IsActivityTemplateFactoryImplementationMember(this.underlyingReader.Member))
-                            {
-                                this.queuedNodes.Writer.WriteStartMember(this.ActivityTemplateFactoryBuilderImplementationMember, (IXamlLineInfo)this.underlyingReader);
-                                return true;
-                            }
-                        }
-                    }
-
-                    return hasMoreNodes;
-
-                case ActivityTemplateFactoryBuilderReaderStates.ReadingFromBufferState:
-                    if (this.queuedNodes.Reader.Read())
-                    {
-                        return true;
-                    }
-                    else
-                    {
-                        this.currentState = ActivityTemplateFactoryBuilderReaderStates.BypassState;
-                        this.queuedNodes = null;
-                        return this.underlyingReader.Read();
-                    }
-
-                default:
-                    SharedFx.Assert(this.currentState == ActivityTemplateFactoryBuilderReaderStates.BypassState, "This is the only remaining ActivityTemplateFactoryBuilderReaderStates.");
-                    return this.underlyingReader.Read();
-            }
-        }
-
-        private static bool IsActivityTemplateFactoryType(XamlType xamlType)
-        {
-            if (xamlType.UnderlyingType == null)
-            {
-                return false;
-            }
-
-            return xamlType.UnderlyingType == typeof(ActivityTemplateFactory) || (xamlType.UnderlyingType.IsGenericType && xamlType.UnderlyingType.GetGenericTypeDefinition() == typeof(ActivityTemplateFactory<>));
-        }
-
-        private bool IsActivityTemplateFactoryImplementationMember(XamlMember xamlMember)
-        {
-            return IsActivityTemplateFactoryType(xamlMember.DeclaringType) && xamlMember == ActivityTemplateFactoryBuilderXamlMembers.ActivityTemplateFactoryImplementationMemberForReader(xamlMember.DeclaringType.UnderlyingType, this.schemaContext);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ActivityTemplateFactoryBuilderWriter.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ActivityTemplateFactoryBuilderWriter.cs
deleted file mode 100644 (file)
index 7c10424..0000000
+++ /dev/null
@@ -1,331 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Activities.Presentation.Toolbox;
-    using System.Xaml;
-
-    // ActivityTemplateFactoryBuilderWriter is a XamlWriter that support <ActivityTemplateFactory x:Class ... 
-    //
-    // Think of this class (and any other XamlWriter) as a XAML node stream editor
-    // XAML node are *not* objects, they are represented as method calls. For example, when WriteStartObject is called, a StartObject node is send to this writer.
-    // The writer will then edit the stream and send the nodes to the underlying stream (by calling the methods on the underlying writer)
-    // 
-    // The editing algorithm goes as follow:
-    //
-    // The system starts as the InitialState. There are five states in total: (InitialState, BufferingState, BufferingNameState, BufferingTargetTypeState, BypassState)
-    // If the very first StartObject node is ActivityTemplateFactory, then start buffering by going to the buffering state, otherwise simply go to the ByPassState.
-    // 
-    // In the buffering state, the nodes are buffered in a XamlNodeQueue, until we see the Implementation Node.
-    // When we reach the Implementation node, we will flush all the nodes transformed to the underlyingWriter, we will also switch to the ByPass state.
-    // 
-    // During the buffering, it is possible that we encounter the Name/TargetType node - the name node cannot enter the buffer because editing is required, we will use a separate state to track that.
-    internal sealed class ActivityTemplateFactoryBuilderWriter : XamlWriter
-    {
-        private XamlSchemaContext schemaContext;
-        private XamlWriter underlyingWriter;
-        private XamlType activityTemplateFactoryType;
-        private XamlMember activityTemplateFactoryImplementationMember;
-        private XamlMember activityTemplateFactoryBuilderImplementationMember;
-        private XamlMember activityTemplateFactoryBuilderNameMember;
-        private XamlMember activityTemplateFactoryBuilderTargetTypeMember;
-
-        // Buffering of nodes before starting the Implementation node 
-        private ActivityTemplateFactoryBuilderWriterStates currentState = ActivityTemplateFactoryBuilderWriterStates.InitialState;
-        private XamlNodeQueue queuedNodes;
-        private string className;
-        private string targetType;
-        private bool xamlLanguageNamespaceWritten = false;
-
-        public ActivityTemplateFactoryBuilderWriter(XamlWriter underlyingWriter, XamlSchemaContext schemaContext)
-        {
-            this.schemaContext = schemaContext;
-            this.underlyingWriter = underlyingWriter;
-        }
-
-        private enum ActivityTemplateFactoryBuilderWriterStates
-        {
-            InitialState,
-            BufferingState,
-            BufferingNameState,
-            BufferingTargetTypeState,
-            BypassState,
-        }
-
-        public override XamlSchemaContext SchemaContext
-        {
-            get { return this.schemaContext; }
-        }
-
-        private XamlType ActivityTemplateFactoryType
-        {
-            get
-            {
-                if (this.activityTemplateFactoryType == null)
-                {
-                    this.activityTemplateFactoryType = new XamlType(typeof(ActivityTemplateFactory), this.schemaContext);
-                }
-
-                return this.activityTemplateFactoryType;
-            }
-        }
-
-        private XamlMember ActivityTemplateFactoryImplementationMember
-        {
-            get
-            {
-                if (this.activityTemplateFactoryImplementationMember == null)
-                {
-                    this.activityTemplateFactoryImplementationMember = ActivityTemplateFactoryBuilderXamlMembers.ActivityTemplateFactoryImplementationMemberForWriter(this.schemaContext);
-                }
-
-                return this.activityTemplateFactoryImplementationMember;
-            }
-        }
-
-        private XamlMember ActivityTemplateFactoryBuilderImplementationMember
-        {
-            get
-            {
-                if (this.activityTemplateFactoryBuilderImplementationMember == null)
-                {
-                    this.activityTemplateFactoryBuilderImplementationMember = ActivityTemplateFactoryBuilderXamlMembers.ActivityTemplateFactoryBuilderImplementationMember(this.schemaContext);
-                }
-
-                return this.activityTemplateFactoryBuilderImplementationMember;
-            }
-        }
-
-        private XamlMember ActivityTemplateFactoryBuilderNameMember
-        {
-            get
-            {
-                if (this.activityTemplateFactoryBuilderNameMember == null)
-                {
-                    this.activityTemplateFactoryBuilderNameMember = ActivityTemplateFactoryBuilderXamlMembers.ActivityTemplateFactoryBuilderNameMember(this.schemaContext);
-                }
-
-                return this.activityTemplateFactoryBuilderNameMember;
-            }
-        }
-
-        private XamlMember ActivityTemplateFactoryBuilderTargetTypeMember
-        {
-            get
-            {
-                if (this.activityTemplateFactoryBuilderTargetTypeMember == null)
-                {
-                    this.activityTemplateFactoryBuilderTargetTypeMember = ActivityTemplateFactoryBuilderXamlMembers.ActivityTemplateFactoryBuilderTargetTypeMember(this.schemaContext);
-                }
-
-                return this.activityTemplateFactoryBuilderTargetTypeMember;
-            }
-        }
-
-        public override void WriteNamespace(NamespaceDeclaration namespaceDeclaration)
-        {
-            if (namespaceDeclaration.Prefix == "x")
-            {
-                this.xamlLanguageNamespaceWritten = true;
-            }
-
-            this.underlyingWriter.WriteNamespace(namespaceDeclaration);
-        }
-
-        public override void WriteStartObject(XamlType type)
-        {
-            switch (this.currentState)
-            {
-                case ActivityTemplateFactoryBuilderWriterStates.InitialState:
-                    if (type.Equals(new XamlType(typeof(ActivityTemplateFactoryBuilder), this.schemaContext)))
-                    {
-                        this.queuedNodes = new XamlNodeQueue(this.schemaContext);
-                        this.currentState = ActivityTemplateFactoryBuilderWriterStates.BufferingState;
-                    }
-                    else
-                    {
-                        this.currentState = ActivityTemplateFactoryBuilderWriterStates.BypassState;
-                        this.underlyingWriter.WriteStartObject(type);
-                    }
-
-                    break;
-                case ActivityTemplateFactoryBuilderWriterStates.BypassState:
-                    this.underlyingWriter.WriteStartObject(type);
-                    break;
-                default:
-                    SharedFx.Assert(
-                        this.currentState == ActivityTemplateFactoryBuilderWriterStates.BufferingState
-                        || this.currentState == ActivityTemplateFactoryBuilderWriterStates.BufferingNameState
-                        || this.currentState == ActivityTemplateFactoryBuilderWriterStates.BufferingTargetTypeState,
-                        "These are the only possible ActivityTemplateFactoryBuilderWriterStates.");
-                    SharedFx.Assert("It is impossible to start any object during the buffering state.");
-                    break;
-            }
-        }
-
-        public override void WriteEndObject()
-        {
-            switch (this.currentState)
-            {
-                case ActivityTemplateFactoryBuilderWriterStates.InitialState:
-                    SharedFx.Assert("It is impossible to end an object during InitialState");
-                    break;
-                case ActivityTemplateFactoryBuilderWriterStates.BufferingState:
-                    this.queuedNodes.Writer.WriteEndObject();
-                    break;
-                case ActivityTemplateFactoryBuilderWriterStates.BypassState:
-                    this.underlyingWriter.WriteEndObject();
-                    break;
-                default:
-                    SharedFx.Assert(
-                        this.currentState == ActivityTemplateFactoryBuilderWriterStates.BufferingNameState 
-                        || this.currentState == ActivityTemplateFactoryBuilderWriterStates.BufferingTargetTypeState,
-                        "These are the only possible ActivityTemplateFactoryBuilderWriterStates.");
-                    SharedFx.Assert("It is impossible to end an object when we are buffering the name / targetType.");
-                    break;
-            }
-        }
-
-        public override void WriteGetObject()
-        {
-            switch (this.currentState)
-            {
-                case ActivityTemplateFactoryBuilderWriterStates.InitialState:
-                    SharedFx.Assert("It is impossible to end an object during InitialState");
-                    break;
-                case ActivityTemplateFactoryBuilderWriterStates.BufferingState:
-                    this.queuedNodes.Writer.WriteGetObject();
-                    break;
-                case ActivityTemplateFactoryBuilderWriterStates.BypassState:
-                    this.underlyingWriter.WriteGetObject();
-                    break;
-                default:
-                    SharedFx.Assert(
-                        this.currentState == ActivityTemplateFactoryBuilderWriterStates.BufferingNameState 
-                        || this.currentState == ActivityTemplateFactoryBuilderWriterStates.BufferingTargetTypeState, 
-                        "These are the only possible ActivityTemplateFactoryBuilderWriterStates.");
-                    SharedFx.Assert("It is impossible to get an object when we are buffering the name / targetType.");
-                    break;
-            }
-        }
-
-        public override void WriteStartMember(XamlMember xamlMember)
-        {
-            switch (this.currentState)
-            {
-                case ActivityTemplateFactoryBuilderWriterStates.InitialState:
-                    SharedFx.Assert("It is impossible to start a member during InitialState");
-                    break;
-                case ActivityTemplateFactoryBuilderWriterStates.BufferingState:
-                    if (xamlMember == this.ActivityTemplateFactoryBuilderImplementationMember)
-                    {
-                        xamlMember = this.ActivityTemplateFactoryImplementationMember;
-
-                        if (!this.xamlLanguageNamespaceWritten)
-                        {
-                            // Required namespace for XAML x:Class 
-                            this.underlyingWriter.WriteNamespace(new NamespaceDeclaration("http://schemas.microsoft.com/winfx/2006/xaml", "x"));
-                        }
-
-                        this.underlyingWriter.WriteStartObject(this.ActivityTemplateFactoryType);
-                        this.underlyingWriter.WriteStartMember(XamlLanguage.Class);
-                        this.underlyingWriter.WriteValue(this.className);
-                        this.underlyingWriter.WriteEndMember();
-                        this.underlyingWriter.WriteStartMember(XamlLanguage.TypeArguments);
-                        this.underlyingWriter.WriteValue(this.targetType);
-                        this.underlyingWriter.WriteEndMember();
-                        this.Transform(this.queuedNodes.Reader, this.underlyingWriter);
-                        this.underlyingWriter.WriteStartMember(xamlMember);
-                        this.currentState = ActivityTemplateFactoryBuilderWriterStates.BypassState;
-                    }
-
-                    if (xamlMember == this.ActivityTemplateFactoryBuilderNameMember)
-                    {
-                        this.currentState = ActivityTemplateFactoryBuilderWriterStates.BufferingNameState;
-                    }
-                    else if (xamlMember == this.ActivityTemplateFactoryBuilderTargetTypeMember)
-                    {
-                        this.currentState = ActivityTemplateFactoryBuilderWriterStates.BufferingTargetTypeState;
-                    }
-                    else
-                    {
-                        this.queuedNodes.Writer.WriteStartMember(xamlMember);
-                    }
-
-                    break;
-                case ActivityTemplateFactoryBuilderWriterStates.BypassState:
-                    this.underlyingWriter.WriteStartMember(xamlMember);
-                    break;
-                default:
-                    SharedFx.Assert(
-                        this.currentState == ActivityTemplateFactoryBuilderWriterStates.BufferingNameState 
-                        || this.currentState == ActivityTemplateFactoryBuilderWriterStates.BufferingTargetTypeState, 
-                        "These are the only possible ActivityTemplateFactoryBuilderWriterStates.");
-                    SharedFx.Assert("It is impossible to get an object when we are buffering the name / targetType.");
-                    break;
-            }
-        }
-
-        public override void WriteEndMember()
-        {
-            switch (this.currentState)
-            {
-                case ActivityTemplateFactoryBuilderWriterStates.InitialState:
-                    SharedFx.Assert("It is impossible to end a member during InitialState");
-                    break;
-                case ActivityTemplateFactoryBuilderWriterStates.BufferingState:
-                    this.queuedNodes.Writer.WriteEndMember();
-                    break;
-                case ActivityTemplateFactoryBuilderWriterStates.BypassState:
-                    this.underlyingWriter.WriteEndMember();
-                    break;
-                default:
-                    SharedFx.Assert(
-                        this.currentState == ActivityTemplateFactoryBuilderWriterStates.BufferingNameState 
-                        || this.currentState == ActivityTemplateFactoryBuilderWriterStates.BufferingTargetTypeState, 
-                        "These are the only possible ActivityTemplateFactoryBuilderWriterStates.");
-
-                    // Intentionally skipped the end member of Name / TargetType node
-                    this.currentState = ActivityTemplateFactoryBuilderWriterStates.BufferingState;
-                    break;
-            }
-        }
-
-        public override void WriteValue(object value)
-        {
-            switch (this.currentState)
-            {
-                case ActivityTemplateFactoryBuilderWriterStates.InitialState:
-                    SharedFx.Assert("It is impossible to write a value during InitialState");
-                    break;
-                case ActivityTemplateFactoryBuilderWriterStates.BufferingState:
-                    this.queuedNodes.Writer.WriteValue(value);
-                    break;
-                case ActivityTemplateFactoryBuilderWriterStates.BufferingNameState:
-                    this.className = (string)value;
-                    break;
-                case ActivityTemplateFactoryBuilderWriterStates.BufferingTargetTypeState:
-                    this.targetType = (string)value;
-                    break;
-                default:
-                    SharedFx.Assert(
-                        this.currentState == ActivityTemplateFactoryBuilderWriterStates.BypassState, 
-                        "This is the only possible ActivityTemplateFactoryBuilderWriterStates");
-                    this.underlyingWriter.WriteValue(value);
-                    break;
-            }
-        }
-
-        private void Transform(XamlReader reader, XamlWriter myWriter)
-        {
-            while (!reader.IsEof)
-            {
-                reader.Read();
-                myWriter.WriteNode(reader);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ActivityTemplateFactoryBuilderXamlMembers.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ActivityTemplateFactoryBuilderXamlMembers.cs
deleted file mode 100644 (file)
index 47717a6..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Activities.Presentation.Toolbox;
-    using System.Reflection;
-    using System.Xaml;
-
-    internal static class ActivityTemplateFactoryBuilderXamlMembers
-    {
-        private const string ImplementationPropertyName = "Implementation";
-        private const string NamePropertyName = "Name";
-        private const string TargetTypePropertyName = "TargetType";
-
-        internal static XamlMember ActivityTemplateFactoryImplementationMemberForReader(Type activityTemplateFactoryType, XamlSchemaContext schemaContext)
-        {
-            return new XamlMember(ImplementationPropertyName, new XamlType(activityTemplateFactoryType, schemaContext), false);
-        }
-
-        internal static XamlMember ActivityTemplateFactoryImplementationMemberForWriter(XamlSchemaContext schemaContext)
-        {
-            PropertyInfo implementationPropertyInfo = typeof(ActivityTemplateFactory).GetProperty(ImplementationPropertyName, BindingFlags.Instance | BindingFlags.NonPublic);
-            SharedFx.Assert(implementationPropertyInfo != null, "ActivityTemplateFactory.Implementation should be defined as a protected property of ActivityTemplateFactory.");
-            return new XamlMember(implementationPropertyInfo, schemaContext);
-        }
-
-        internal static XamlMember ActivityTemplateFactoryBuilderNameMember(XamlSchemaContext schemaContext)
-        {
-            PropertyInfo namePropertyInfo = typeof(ActivityTemplateFactoryBuilder).GetProperty(NamePropertyName);
-            SharedFx.Assert(namePropertyInfo != null, "ActivityTemplateFactoryBuilder.Name should be defined as a public property of ActivityTemplateFactoryBuilder.");
-            return new XamlMember(namePropertyInfo, schemaContext);
-        }
-
-        internal static XamlMember ActivityTemplateFactoryBuilderTargetTypeMember(XamlSchemaContext schemaContext)
-        {
-            PropertyInfo namePropertyInfo = typeof(ActivityTemplateFactoryBuilder).GetProperty(TargetTypePropertyName);
-            SharedFx.Assert(namePropertyInfo != null, "ActivityTemplateFactoryBuilder.TargetType should be defined as a public property of ActivityTemplateFactoryBuilder.");
-            return new XamlMember(namePropertyInfo, schemaContext);
-        }
-
-        internal static XamlMember ActivityTemplateFactoryBuilderImplementationMember(XamlSchemaContext schemaContext)
-        {
-            PropertyInfo implementationPropertyInfo = typeof(ActivityTemplateFactoryBuilder).GetProperty(ImplementationPropertyName);
-            SharedFx.Assert(implementationPropertyInfo != null, "ActivityTemplateFactoryBuilder.Implementation should be defined as a public property of ActivityTemplateFactoryBuilder.");
-            return new XamlMember(implementationPropertyInfo, schemaContext);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/AttributeConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/AttributeConverter.cs
deleted file mode 100644 (file)
index 29625d5..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Collections;
-    using System.ComponentModel;
-    using System.ComponentModel.Design.Serialization;
-    using System.Globalization;
-    using System.Reflection;
-
-    // AttributeConverter is to convert some XAML-unfriendly attributes (without default ctor) to InstanceDescriptor for XAML serialization
-    internal class AttributeConverter<TAttribute, TAttributeInfo> : TypeConverter
-        where TAttribute : Attribute
-        where TAttributeInfo : AttributeInfo<TAttribute>, new()
-    {
-        private static ConstructorInfo attributeConstructor = null;
-        private TAttributeInfo attributeInfo = new TAttributeInfo();
-
-        private ConstructorInfo Constructor
-        {
-            get
-            {
-                // no need to lock here because every thread will generate the same constructor info even in race condition
-                // and cost to get the constructor is relative small
-                if (AttributeConverter<TAttribute, TAttributeInfo>.attributeConstructor == null)
-                {
-                    AttributeConverter<TAttribute, TAttributeInfo>.attributeConstructor = this.attributeInfo.GetConstructor();
-                }
-
-                return AttributeConverter<TAttribute, TAttributeInfo>.attributeConstructor;
-            }
-        }
-
-        public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
-        {
-            if (destinationType == typeof(InstanceDescriptor))
-            {
-                return true;
-            }
-
-            return base.CanConvertTo(context, destinationType);
-        }
-
-        public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
-        {
-            return false;
-        }
-
-        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
-        {
-            if (destinationType != typeof(InstanceDescriptor))
-            {
-                return base.ConvertTo(context, culture, value, destinationType);
-            }
-
-            TAttribute attribute = value as TAttribute;
-
-            SharedFx.Assert(value != null, "The usage should be guaranteed by the XAML stack");
-
-            ConstructorInfo constructor = this.Constructor;
-            ICollection arguments = this.attributeInfo.GetConstructorArguments(attribute, ref constructor);
-            return new InstanceDescriptor(constructor, arguments, this.attributeInfo.IsComplete);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/AttributeInfo.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/AttributeInfo.cs
deleted file mode 100644 (file)
index a6b46b4..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Collections;
-    using System.Reflection;
-    using System.Xaml.Schema;
-
-    // AttributeInfo is a helper class to provide type specfic info for each Attribute class
-    internal abstract class AttributeInfo<TAttribute> where TAttribute : Attribute
-    {
-        // false if the attribute has additional (mutable) properties that aren't set in the constructor
-        public virtual bool IsComplete
-        {
-            get { return true; }
-        }
-
-        // whether to use argumented-ctor for serialization even when there's default ctor
-        public virtual bool LookupConstructionRequiresArguments
-        {
-            get { return true; }
-        }
-
-        public virtual XamlTypeInvoker Invoker
-        {
-            get { return null; }
-        }
-
-        public abstract ConstructorInfo GetConstructor();
-
-        public abstract ICollection GetConstructorArguments(TAttribute attribute, ref ConstructorInfo constructor);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/AttributeXamlType.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/AttributeXamlType.cs
deleted file mode 100644 (file)
index f0bb5c9..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.ComponentModel;
-    using System.Xaml;
-    using System.Xaml.Schema;
-
-    internal class AttributeXamlType<TAttribute, TAttributeInfo> : XamlType
-        where TAttribute : Attribute
-        where TAttributeInfo : AttributeInfo<TAttribute>, new()
-    {
-        private TAttributeInfo attributeInfo = new TAttributeInfo();
-
-        public AttributeXamlType(XamlSchemaContext xamlSchemaContext)
-            : base(typeof(TAttribute), xamlSchemaContext)
-        {
-        }
-
-        protected override XamlValueConverter<TypeConverter> LookupTypeConverter()
-        {
-            return new XamlValueConverter<TypeConverter>(typeof(AttributeConverter<TAttribute, TAttributeInfo>), this);
-        }
-
-        protected override bool LookupConstructionRequiresArguments()
-        {
-            return this.attributeInfo.LookupConstructionRequiresArguments;
-        }
-
-        protected override XamlTypeInvoker LookupInvoker()
-        {
-            if (this.attributeInfo.Invoker != null)
-            {
-                return this.attributeInfo.Invoker;
-            }
-            else
-            {
-                return base.LookupInvoker();
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/DefaultValueAttributeInfo.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/DefaultValueAttributeInfo.cs
deleted file mode 100644 (file)
index b1c3d3c..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Reflection;
-    using System.Xaml.Schema;
-
-    internal class DefaultValueAttributeInfo : AttributeInfo<DefaultValueAttribute>
-    {
-        public override XamlTypeInvoker Invoker
-        {
-            get { return new DefaultValueAttributeInvoker(); }
-        }
-
-        public override ICollection GetConstructorArguments(DefaultValueAttribute attribute, ref ConstructorInfo constructor)
-        {
-            return new List<object>() { attribute.Value };
-        }
-
-        public override ConstructorInfo GetConstructor()
-        {
-            Type defaultValueAttributeType = typeof(DefaultValueAttribute);
-            ConstructorInfo constructor = defaultValueAttributeType.GetConstructor(new Type[] { typeof(object) });
-            SharedFx.Assert(constructor != null, "designerAttribute has a constructor that takes an argument of type System.Object.");
-            return constructor;
-        }
-
-        private class DefaultValueAttributeInvoker : XamlTypeInvoker
-        {
-            public override object CreateInstance(object[] arguments)
-            {
-                if (arguments != null && arguments.Length == 1)
-                {
-                    // This helps to disambiguate the different constructors when arguments[0] is null.
-                    return new DefaultValueAttribute(arguments[0]);
-                }
-                else
-                {
-                    return base.CreateInstance(arguments);
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/DesignTimeXamlWriter.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/DesignTimeXamlWriter.cs
deleted file mode 100644 (file)
index 2229b24..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Activities;
-    using System.Activities.Debugger.Symbol;
-    using System.Collections.Generic;
-    using System.Globalization;
-    using System.IO;
-    using System.ServiceModel.Activities;
-    using System.Xaml;
-    using System.Xml;
-
-    class DesignTimeXamlWriter : XamlXmlWriter
-    {
-        //namespaces to ignore (don't load assembilies for) at root node
-        HashSet<string> namespacesToIgnore;
-
-        //namespaces we've seen at root level, we use this to figure out appropriate alias for MC namespace
-        HashSet<string> rootLevelNamespaces;
-
-        // for duplicate namespace filtering (happens if we're using the local assembly to compile itself)
-        HashSet<string> emittedNamespacesInLocalAssembly;
-
-        //For namespace defined in local assembly with assembly info in namespace declaration, we'll strip out the assembly info
-        //and hold the namespace temporarily. Before writing the start object, we'll check whether the short version gets written
-        //as a separate declaration, if not, we write it out.
-        List<NamespaceDeclaration> localNamespacesWithAssemblyInfo;
-
-        WorkflowDesignerXamlSchemaContext schemaContext;
-
-        int currentDepth;
-        int debugSymbolDepth;
-        bool writeDebugSymbol;
-        bool debugSymbolNamespaceAdded;
-        bool isWritingElementStyleString;
-        internal static readonly string EmptyWorkflowSymbol = (new WorkflowSymbol() { FileName = @"C:\Empty.xaml" }).Encode();
-        private bool shouldWriteDebugSymbol;
-
-        public DesignTimeXamlWriter(TextWriter textWriter, WorkflowDesignerXamlSchemaContext context, bool shouldWriteDebugSymbol)
-            : this(new NamespaceIndentingXmlWriter(textWriter), context, shouldWriteDebugSymbol)
-        {
-        }
-
-        DesignTimeXamlWriter(NamespaceIndentingXmlWriter underlyingWriter, WorkflowDesignerXamlSchemaContext context, bool shouldWriteDebugSymbol)
-            : base(underlyingWriter, context,
-                // Setting AssumeValidInput to true allows to save a document even if it has duplicate members
-                new XamlXmlWriterSettings { AssumeValidInput = true })
-        {
-            underlyingWriter.Parent = this;
-            this.namespacesToIgnore = new HashSet<string>();
-            this.rootLevelNamespaces = new HashSet<string>();
-            this.schemaContext = context;
-            this.currentDepth = 0;
-            this.shouldWriteDebugSymbol = shouldWriteDebugSymbol;
-        }
-
-        public override void WriteNamespace(NamespaceDeclaration namespaceDeclaration)
-        {
-            if (this.currentDepth == 0)
-            {
-                //we need to track every namespace alias appeared in root element to figure out right alias for MC namespace
-                this.rootLevelNamespaces.Add(namespaceDeclaration.Prefix);
-
-                //Remember namespaces needed to be ignored at top level so we will add ignore attribute for them when we write start object
-                if (NameSpaces.ShouldIgnore(namespaceDeclaration.Namespace))
-                {
-                    this.namespacesToIgnore.Add(namespaceDeclaration.Prefix);
-                }
-
-                if (namespaceDeclaration.Namespace == NameSpaces.DebugSymbol)
-                {
-                    debugSymbolNamespaceAdded = true;
-                }
-            }
-
-            EmitNamespace(namespaceDeclaration);
-        }
-
-        void EmitNamespace(NamespaceDeclaration namespaceDeclaration)
-        {
-            // Write the namespace, filtering for duplicates in the local assembly because VS might be using it to compile itself.
-
-            if (schemaContext.IsClrNamespaceWithNoAssembly(namespaceDeclaration.Namespace))
-            {
-                // Might still need to trim a semicolon, even though it shouldn't strictly be there.
-                string nonassemblyQualifedNamespace = namespaceDeclaration.Namespace;
-                if (nonassemblyQualifedNamespace[nonassemblyQualifedNamespace.Length - 1] == ';')
-                {
-                    nonassemblyQualifedNamespace = nonassemblyQualifedNamespace.Substring(0, nonassemblyQualifedNamespace.Length - 1);
-                    namespaceDeclaration = new NamespaceDeclaration(nonassemblyQualifedNamespace, namespaceDeclaration.Prefix);
-                }
-                EmitLocalNamespace(namespaceDeclaration);
-            }
-            else if (schemaContext.IsClrNamespaceInLocalAssembly(namespaceDeclaration.Namespace))
-            {
-                string nonassemblyQualifedNamespace = schemaContext.TrimLocalAssembly(namespaceDeclaration.Namespace);
-                namespaceDeclaration = new NamespaceDeclaration(nonassemblyQualifedNamespace, namespaceDeclaration.Prefix);
-                if (this.localNamespacesWithAssemblyInfo == null)
-                {
-                    this.localNamespacesWithAssemblyInfo = new List<NamespaceDeclaration>();
-                }
-                this.localNamespacesWithAssemblyInfo.Add(namespaceDeclaration);
-            }
-            else
-            {
-                base.WriteNamespace(namespaceDeclaration);
-            }
-        }
-
-        void EmitLocalNamespace(NamespaceDeclaration namespaceDeclaration)
-        {
-            if (this.emittedNamespacesInLocalAssembly == null) // lazy initialization
-            {
-                this.emittedNamespacesInLocalAssembly = new HashSet<string>();
-            }
-
-            // Write the namespace only once. Add() returns false if it was already there.
-            if (this.emittedNamespacesInLocalAssembly.Add(namespaceDeclaration.Namespace))
-            {
-                base.WriteNamespace(namespaceDeclaration);
-            }
-        }
-
-        public override void WriteStartObject(XamlType type)
-        {
-            if (type.UnderlyingType == typeof(string))
-            {
-                isWritingElementStyleString = true;
-            }
-            // this is the top-level object
-            if (this.currentDepth == 0)
-            {
-                if (!this.debugSymbolNamespaceAdded)
-                {
-                    string sadsNamespaceAlias = GenerateNamespaceAlias(NameSpaces.DebugSymbolPrefix);
-                    this.WriteNamespace(new NamespaceDeclaration(NameSpaces.DebugSymbol, sadsNamespaceAlias));
-                    this.debugSymbolNamespaceAdded = true;
-                }
-
-                // we need to write MC namespace if any namespaces need to be ignored
-                if (this.namespacesToIgnore.Count > 0)
-                {
-                    string mcNamespaceAlias = GenerateNamespaceAlias(NameSpaces.McPrefix);
-                    this.WriteNamespace(new NamespaceDeclaration(NameSpaces.Mc, mcNamespaceAlias));
-                }
-
-
-                if (this.localNamespacesWithAssemblyInfo != null)
-                {
-                    foreach (NamespaceDeclaration xamlNamespace in this.localNamespacesWithAssemblyInfo)
-                    {
-                        if ((this.emittedNamespacesInLocalAssembly == null) || (!this.emittedNamespacesInLocalAssembly.Contains(xamlNamespace.Namespace)))
-                        {
-                            base.WriteNamespace(xamlNamespace);
-                        }
-                    }
-                }
-
-                if ((type.UnderlyingType == typeof(Activity)) ||
-                    (type.IsGeneric && type.UnderlyingType != null && type.UnderlyingType.GetGenericTypeDefinition() == typeof(Activity<>)) ||
-                    (type.UnderlyingType == typeof(WorkflowService)))
-                {   // Exist ActivityBuilder, DebugSymbolObject will be inserted at the depth == 1.
-                    debugSymbolDepth = 1;
-                }
-                else
-                {
-                    debugSymbolDepth = 0;
-                }
-            }
-
-            if (this.currentDepth == debugSymbolDepth)
-            {
-                if (type.UnderlyingType != null && type.UnderlyingType.IsSubclassOf(typeof(Activity)) && this.shouldWriteDebugSymbol)
-                {
-                    this.writeDebugSymbol = true;
-                }
-            }
-
-            base.WriteStartObject(type);
-
-            if (this.currentDepth == 0)
-            {
-                // we need to add Ignore attribute for all namespaces which we don't want to load assemblies for
-                // this has to be done after WriteStartObject
-                if (this.namespacesToIgnore.Count > 0)
-                {
-                    string nsString = null;
-                    foreach (string ns in this.namespacesToIgnore)
-                    {
-                        if (nsString == null)
-                        {
-                            nsString = ns;
-                        }
-                        else
-                        {
-                            nsString += " " + ns;
-                        }
-                    }
-
-                    XamlDirective ignorable = new XamlDirective(NameSpaces.Mc, "Ignorable");
-                    base.WriteStartMember(ignorable);
-                    base.WriteValue(nsString);
-                    base.WriteEndMember();
-                    this.namespacesToIgnore.Clear();
-                }
-            }
-
-            ++this.currentDepth;
-
-        }
-
-        public override void WriteGetObject()
-        {
-            ++this.currentDepth;
-            base.WriteGetObject();
-        }
-
-        public override void WriteEndObject()
-        {
-            --this.currentDepth;
-            SharedFx.Assert(this.currentDepth >= 0, "Unmatched WriteEndObject");
-            if (this.currentDepth == this.debugSymbolDepth && this.writeDebugSymbol)
-            {
-                base.WriteStartMember(new XamlMember(DebugSymbol.SymbolName.MemberName,
-                   this.SchemaContext.GetXamlType(typeof(DebugSymbol)), true));
-                base.WriteValue(EmptyWorkflowSymbol);
-                base.WriteEndMember();
-                this.writeDebugSymbol = false;
-            }
-            base.WriteEndObject();
-            isWritingElementStyleString = false;
-        }
-
-        string GenerateNamespaceAlias(string prefix)
-        {
-            string aliasPostfix = string.Empty;
-            //try "mc"~"mc1000" first
-            for (int i = 1; i <= 1000; i++)
-            {
-                string mcAlias = prefix + aliasPostfix;
-                if (!this.rootLevelNamespaces.Contains(mcAlias))
-                {
-                    return mcAlias;
-                }
-                aliasPostfix = i.ToString(CultureInfo.InvariantCulture);
-            }
-
-            //roll the dice
-            return prefix + Guid.NewGuid().ToString();
-        }
-
-        class NamespaceIndentingXmlWriter : XmlTextWriter
-        {
-            int currentDepth;
-            TextWriter textWriter;
-
-            public NamespaceIndentingXmlWriter(TextWriter textWriter)
-                : base(textWriter)
-            {
-                this.textWriter = textWriter;
-                this.Formatting = Formatting.Indented;
-            }
-
-            public DesignTimeXamlWriter Parent { get; set; }
-
-            public override void WriteStartElement(string prefix, string localName, string ns)
-            {
-                base.WriteStartElement(prefix, localName, ns);
-                this.currentDepth++;
-            }
-
-            public override void WriteStartAttribute(string prefix, string localName, string ns)
-            {
-                if (prefix == "xmlns" && (this.currentDepth == 1))
-                {
-                    this.textWriter.Write(new char[] { '\r', '\n' });
-                }
-                base.WriteStartAttribute(prefix, localName, ns);
-            }
-
-            public override void WriteEndElement()
-            {
-                if (this.Parent.isWritingElementStyleString)
-                {
-                    base.WriteRaw(string.Empty);
-                }
-                base.WriteEndElement();
-                this.currentDepth--;
-            }
-
-            public override void WriteStartDocument()
-            {
-                // No-op to avoid XmlDeclaration from being written.
-                // Overriding this is equivalent of XmlWriterSettings.OmitXmlDeclaration = true.
-            }
-
-            public override void WriteStartDocument(bool standalone)
-            {
-                // No-op to avoid XmlDeclaration from being written.
-                // Overriding this is equivalent of XmlWriterSettings.OmitXmlDeclaration = true.
-            }
-
-            public override void WriteEndDocument()
-            {
-                // No-op to avoid end of XmlDeclaration from being written.
-                // Overriding this is equivalent of XmlWriterSettings.OmitXmlDeclaration = true.
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/DesignerAttributeInfo.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/DesignerAttributeInfo.cs
deleted file mode 100644 (file)
index 57580e0..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Reflection;
-
-    class DesignerAttributeInfo : AttributeInfo<DesignerAttribute>
-    {
-        public override ICollection GetConstructorArguments(DesignerAttribute attribute, ref ConstructorInfo constructor)
-        {
-            return new List<object>() { Type.GetType(attribute.DesignerTypeName) };
-        }
-
-        public override ConstructorInfo GetConstructor()
-        {
-            Type designerAttributeType = typeof(DesignerAttribute);
-            ConstructorInfo constructor = designerAttributeType.GetConstructor(new Type[] { typeof(Type) });
-            SharedFx.Assert(constructor != null, "designerAttribute has a constructor that takes an argument of type System.Type.");
-            return constructor;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/EditorAttributeInfo.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/EditorAttributeInfo.cs
deleted file mode 100644 (file)
index b5a9922..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Reflection;
-
-    class EditorAttributeInfo : AttributeInfo<EditorAttribute>
-    {
-        public override ICollection GetConstructorArguments(EditorAttribute attribute, ref ConstructorInfo constructor)
-        {
-            return new List<object>() { Type.GetType(attribute.EditorTypeName), Type.GetType(attribute.EditorBaseTypeName) };
-        }
-
-        public override ConstructorInfo GetConstructor()
-        {
-            Type editorAttributeType = typeof(EditorAttribute);
-            ConstructorInfo constructor = editorAttributeType.GetConstructor(new Type[] { typeof(Type), typeof(Type) });
-            SharedFx.Assert(constructor != null, "designerAttribute has a constructor that takes two argument of type System.Type and System.Type.");
-            return constructor;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/IWorkflowDesignerXamlHelperExecutionContext.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/IWorkflowDesignerXamlHelperExecutionContext.cs
deleted file mode 100644 (file)
index 70ade3a..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System.Activities.Debugger;
-    using System.Activities.Debugger.Symbol;
-    using System.Collections.Generic;
-    using System.Runtime.Versioning;
-
-    internal interface IWorkflowDesignerXamlHelperExecutionContext
-    {
-        FrameworkName FrameworkName { get; }
-
-        WorkflowDesignerXamlSchemaContext XamlSchemaContext { get; }
-
-        ViewStateIdManager IdManager { get; }
-
-        WorkflowSymbol LastWorkflowSymbol { get; set; }
-
-        string LocalAssemblyName { get; }
-
-        void OnSerializationCompleted(Dictionary<object, object> sourceLocationObjectToModelItemObjectMapping);
-
-        void OnBeforeDeserialize();
-
-        void OnSourceLocationFound(object target, SourceLocation sourceLocation);
-
-        void OnAfterDeserialize(Dictionary<string, SourceLocation> viewStateDataSourceLocationMapping);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ImportAttributeInfo.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ImportAttributeInfo.cs
deleted file mode 100644 (file)
index 96fd073..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Collections;
-    using System.ComponentModel.Composition;
-    using System.Reflection;
-
-    class ImportAttributeInfo : AttributeInfo<ImportAttribute>
-    {
-        static ConstructorInfo nameConstructor;
-        static ConstructorInfo typeConstructor;
-        static ConstructorInfo nameAndTypeConstructor;
-
-        public override bool IsComplete
-        {
-            get { return false; }
-        }
-
-        public override ICollection GetConstructorArguments(ImportAttribute attribute, ref ConstructorInfo constructor)
-        {
-            if (attribute.ContractName != null)
-            {
-                if (attribute.ContractType != null)
-                {
-                    constructor = NameAndTypeConstructor;
-                    return new object[] { attribute.ContractName, attribute.ContractType };
-                }
-                else
-                {
-                    constructor = NameConstructor;
-                    return new object[] { attribute.ContractName };
-                }
-            }
-            else if (attribute.ContractType != null)
-            {
-                constructor = TypeConstructor;
-                return new object[] { attribute.ContractType };
-            }
-            else
-            {
-                return new object[] { };
-            }
-        }
-
-        public override ConstructorInfo GetConstructor()
-        {
-            return typeof(ImportAttribute).GetConstructor(Type.EmptyTypes);
-        }
-
-        static ConstructorInfo NameConstructor
-        {
-            get
-            {
-                if (nameConstructor == null)
-                {
-                    nameConstructor = typeof(ImportAttribute).GetConstructor(new Type[] { typeof(string) });
-                }
-                return nameConstructor;
-            }
-        }
-
-        static ConstructorInfo NameAndTypeConstructor
-        {
-            get
-            {
-                if (nameAndTypeConstructor == null)
-                {
-                    nameAndTypeConstructor = typeof(ImportAttribute).GetConstructor(new Type[] { typeof(string), typeof(Type) });
-                }
-                return nameAndTypeConstructor;
-            }
-        }
-
-        static ConstructorInfo TypeConstructor
-        {
-            get
-            {
-                if (typeConstructor == null)
-                {
-                    typeConstructor = typeof(ImportAttribute).GetConstructor(new Type[] { typeof(Type) });
-                }
-                return typeConstructor;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ImportManyAttributeInfo.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ImportManyAttributeInfo.cs
deleted file mode 100644 (file)
index aa2b245..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Collections;
-    using System.ComponentModel.Composition;
-    using System.Reflection;
-
-    class ImportManyAttributeInfo : AttributeInfo<ImportManyAttribute>
-    {
-        static ConstructorInfo nameConstructor;
-        static ConstructorInfo typeConstructor;
-        static ConstructorInfo nameAndTypeConstructor;
-
-        public override bool IsComplete
-        {
-            get
-            {
-                return false;
-            }
-        }
-
-        public override ICollection GetConstructorArguments(ImportManyAttribute attribute, ref ConstructorInfo constructor)
-        {
-            if (attribute.ContractName != null)
-            {
-                if (attribute.ContractType != null)
-                {
-                    constructor = NameAndTypeConstructor;
-                    return new object[] { attribute.ContractName, attribute.ContractType };
-                }
-                else
-                {
-                    constructor = NameConstructor;
-                    return new object[] { attribute.ContractName };
-                }
-            }
-            else if (attribute.ContractType != null)
-            {
-                constructor = TypeConstructor;
-                return new object[] { attribute.ContractType };
-            }
-            else
-            {
-                return new object[] { };
-            }
-        }
-
-        public override ConstructorInfo GetConstructor()
-        {
-            return typeof(ImportManyAttribute).GetConstructor(Type.EmptyTypes);
-        }
-
-        static ConstructorInfo NameConstructor
-        {
-            get
-            {
-                if (nameConstructor == null)
-                {
-                    nameConstructor = typeof(ImportManyAttribute).GetConstructor(new Type[] { typeof(string) });
-                }
-                return nameConstructor;
-            }
-        }
-
-        static ConstructorInfo NameAndTypeConstructor
-        {
-            get
-            {
-                if (nameAndTypeConstructor == null)
-                {
-                    nameAndTypeConstructor = typeof(ImportManyAttribute).GetConstructor(new Type[] { typeof(Type) });
-                }
-                return nameAndTypeConstructor;
-            }
-        }
-
-        static ConstructorInfo TypeConstructor
-        {
-            get
-            {
-                if (typeConstructor == null)
-                {
-                    typeConstructor = typeof(ImportManyAttribute).GetConstructor(new Type[] { typeof(string), typeof(Type) });
-                }
-                return typeConstructor;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/LineColumnPair.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/LineColumnPair.cs
deleted file mode 100644 (file)
index 087446a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-
-    internal class LineColumnPair : Tuple<int, int>
-    {
-        internal LineColumnPair(int item1, int item2)
-            : base(item1, item2)
-        {
-            SharedFx.Assert(item1 > 0 && item2 > 0, "item1 > 0&& item2 > 0");
-        }
-
-        internal int LineNumber
-        {
-            get { return this.Item1; }
-        }
-
-        internal int ColumnNumber
-        {
-            get { return this.Item2; }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/MultiTargetingTypeResolver.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/MultiTargetingTypeResolver.cs
deleted file mode 100644 (file)
index be55a92..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Activities.Presentation.Hosting;
-    using System.Collections.Generic;
-    using System.Reflection;
-    using System.Xaml;
-
-    internal static class MultiTargetingTypeResolver
-    {
-        public static ResolverResult Resolve(MultiTargetingSupportService multiTargetingService, Type type)
-        {
-            SharedFx.Assert(multiTargetingService != null, "multiTargetingService should not be null");
-            SharedFx.Assert(type != null, "type should not be null");
-
-            if (!multiTargetingService.IsSupportedType(type))
-            {
-                return ResolverResult.Unknown;
-            }
-
-            ResolverResult result;
-
-            Type reflectionType = multiTargetingService.GetReflectionType(type);
-
-            PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.SetProperty);
-            PropertyInfo[] targetProperties = reflectionType.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.SetProperty);
-
-            List<string> newProperties = new List<string>();
-
-            // Assume we don't remove properties in newer framework
-            // We only compare property name here
-            if (properties.Length > targetProperties.Length)
-            {
-                foreach (PropertyInfo propertyInfo in properties)
-                {
-                    bool found = false;
-                    foreach (PropertyInfo targetProperty in targetProperties)
-                    {
-                        if (targetProperty.Name == propertyInfo.Name)
-                        {
-                            found = true;
-                            break;
-                        }
-                    }
-
-                    if (!found)
-                    {
-                        newProperties.Add(propertyInfo.Name);
-                    }
-                }
-
-                result = new ResolverResult(newProperties);
-            }
-            else
-            {
-                result = ResolverResult.FullySupported;
-            }
-
-            return result;
-        }
-
-        public static XamlType GetXamlType(ResolverResult resolverResult, XamlType oldXamlType)
-        {
-            SharedFx.Assert(oldXamlType != null, "oldXamlType should not be null");
-
-            switch (resolverResult.Kind)
-            {
-                case XamlTypeKind.FullySupported:
-                    return oldXamlType;
-
-                case XamlTypeKind.PartialSupported:
-                    return new XamlTypeWithExtraPropertiesRemoved(oldXamlType.UnderlyingType, oldXamlType.SchemaContext, resolverResult.NewProperties);
-
-                default:
-                    SharedFx.Assert(resolverResult.Kind == XamlTypeKind.Unknown, "resolverResult.Kind should be XamlTypeKind.Unknown.");
-                    return null;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/NameSpaces.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/NameSpaces.cs
deleted file mode 100644 (file)
index 5a5e017..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-internal static class NameSpaces
-{
-    public const string Mc = "http://schemas.openxmlformats.org/markup-compatibility/2006";
-    public const string Design = "http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation";
-    public const string Design2010 = "http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation";
-    public const string Toolbox = "http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation/toolbox";
-    public const string Activities = "http://schemas.microsoft.com/netfx/2009/xaml/activities";
-    public const string DebugSymbol = "http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger";
-    public const string DesignPrefix = "sap";
-    public const string Design2010Prefix = "sap2010";
-    public const string McPrefix = "mc";
-    public const string DebugSymbolPrefix = "sads";
-
-    public static bool ShouldIgnore(string ns)
-    {
-        return ns == Design2010 || ns == DebugSymbol || ns == Design;
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ObjectReferenceEqualityComparer.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ObjectReferenceEqualityComparer.cs
deleted file mode 100644 (file)
index 778ca70..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System.Collections.Generic;
-    using System.Runtime.CompilerServices;
-
-    internal sealed class ObjectReferenceEqualityComparer<T> : IEqualityComparer<T> where T : class
-    {
-        private static ObjectReferenceEqualityComparer<T> defaultComparer;
-
-        private ObjectReferenceEqualityComparer()
-        {
-        }
-
-        public static ObjectReferenceEqualityComparer<T> Default
-        {
-            get
-            {
-                if (defaultComparer == null)
-                {
-                    defaultComparer = new ObjectReferenceEqualityComparer<T>();
-                }
-
-                return defaultComparer;
-            }
-        }
-
-        public bool Equals(T x, T y)
-        {
-            return object.ReferenceEquals(x, y);
-        }
-
-        public int GetHashCode(T obj)
-        {
-            return RuntimeHelpers.GetHashCode(obj);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ResolverCache.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ResolverCache.cs
deleted file mode 100644 (file)
index eab7fee..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Collections.Generic;
-
-    internal class ResolverCache
-    {
-        private Dictionary<Type, WeakReference> cache;
-
-        public ResolverCache()
-        {
-            this.cache = new Dictionary<Type, WeakReference>();
-        }
-
-        public void Update(Type type, ResolverResult result)
-        {
-            SharedFx.Assert(type != null, "type should not be null");
-            SharedFx.Assert(result != null, "result should not be null");
-
-            if (this.cache.ContainsKey(type))
-            {
-                this.cache[type] = new WeakReference(result);
-            }
-            else
-            {
-                this.cache.Add(type, new WeakReference(result));
-            }
-        }
-
-        public ResolverResult Lookup(Type type)
-        {
-            SharedFx.Assert(type != null, "type should not be null");
-
-            WeakReference value;
-            if (this.cache.TryGetValue(type, out value))
-            {
-                return value.Target as ResolverResult;
-            }
-
-            return null;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ResolverResult.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ResolverResult.cs
deleted file mode 100644 (file)
index a7a2bd3..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System.Collections.Generic;
-
-    internal class ResolverResult
-    {
-        private static ResolverResult unknown = new ResolverResult(XamlTypeKind.Unknown);
-        private static ResolverResult fullySupported = new ResolverResult(XamlTypeKind.FullySupported);
-
-        public ResolverResult(XamlTypeKind kind)
-            : this(kind, null)
-        {
-        }
-
-        public ResolverResult(ICollection<string> newProperties)
-            : this(XamlTypeKind.PartialSupported, newProperties)
-        {
-        }
-
-        private ResolverResult(XamlTypeKind kind, ICollection<string> newProperties)
-        {
-            SharedFx.Assert(kind != XamlTypeKind.PartialSupported || newProperties != null, "newProperties should not be null when kind is XamlTypeKind.PartialSupported");
-
-            this.Kind = kind;
-            this.NewProperties = newProperties;
-        }
-
-        public static ResolverResult Unknown
-        {
-            get { return unknown; }
-        }
-
-        public static ResolverResult FullySupported
-        {
-            get { return fullySupported; }
-        }
-
-        public XamlTypeKind Kind { get; private set; }
-
-        public ICollection<string> NewProperties { get; private set; }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/SourceTextScanner.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/SourceTextScanner.cs
deleted file mode 100644 (file)
index 2c3b66d..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Globalization;
-
-    // NOTE: (x, y) denotes line x column y, where x and y are 0 based, 
-    // while the line/column in SourceLocation and LineNumberPair is 1 based.
-    internal class SourceTextScanner
-    {
-        private const char NewLine = '\n';
-
-        private const char Return = '\r';
-
-        private string source;
-
-        // <start index, length>
-        // say a line is "abc\n"
-        // the length is 4, with '\n' included.
-        private List<Tuple<int, int>> indexCache;
-
-        internal SourceTextScanner(string source)
-        {
-            SharedFx.Assert(source != null, "source != null");
-            this.source = source;
-            this.indexCache = new List<Tuple<int, int>>();
-        }
-
-        internal Tuple<LineColumnPair, char> SearchCharAfter(LineColumnPair startPoint, params char[] charsToSearch)
-        {
-            SharedFx.Assert(startPoint != null, "startPoint != null");
-
-            int line = startPoint.LineNumber - 1;
-            int column = startPoint.ColumnNumber - 1;
-
-            HashSet<char> charsToSearchSet = new HashSet<char>(charsToSearch);
-            int index = this.GetIndex(line, column);
-            if (index < 0)
-            {
-                return null;
-            }
-
-            bool firstLoop = true;
-            foreach (Tuple<char, int> currentPair in this.Scan(index))
-            {
-                if (firstLoop)
-                {
-                    firstLoop = false;
-                }
-                else
-                {
-                    if (charsToSearchSet.Contains(currentPair.Item1))
-                    {
-                        LineColumnPair location = this.GetLocation(currentPair.Item2);
-                        SharedFx.Assert(location != null, "invalid location");
-                        return Tuple.Create(location, currentPair.Item1);
-                    }
-                }
-            }
-
-            return null;
-        }
-
-        private LineColumnPair GetLocation(int index)
-        {
-            SharedFx.Assert(index >= 0 && index < this.source.Length, "index out of range");
-
-            while (!this.IsIndexInScannedLine(index))
-            {
-                this.TryScanNextLine();
-            }
-            
-            int line = this.indexCache.Count - 1;
-            for (; line >= 0; --line)
-            {
-                if (index >= this.indexCache[line].Item1)
-                {
-                    break;
-                }
-            }
-            
-            SharedFx.Assert(line >= 0, "line < this.indexCache.Count");
-            int column = index - this.indexCache[line].Item1;
-            SharedFx.Assert(column < this.indexCache[line].Item2, "Should Not Happen");
-
-            return new LineColumnPair(line + 1, column + 1);
-        }
-        
-        private int GetIndex(int line, int column)
-        {
-            while (this.indexCache.Count <= line)
-            {
-                if (!this.TryScanNextLine())
-                {
-                    break;
-                }
-            }
-
-            if (this.indexCache.Count <= line)
-            {
-                SharedFx.Assert(string.Format(CultureInfo.CurrentCulture, "line out of range:({0},{1})", line + 1, column + 1));
-                return -1;
-            }
-
-            if (column >= this.indexCache[line].Item2)
-            {
-                SharedFx.Assert(string.Format(CultureInfo.CurrentCulture, "column out of range:({0},{1})", line + 1, column + 1));
-                return -1;
-            }
-
-            return this.indexCache[line].Item1 + column;
-        }
-
-        private bool IsIndexInScannedLine(int index)
-        {
-            SharedFx.Assert(index >= 0 && index < this.source.Length, "invalid index");
-
-            int last = this.indexCache.Count - 1;
-            return last >= 0 && index < this.indexCache[last].Item1 + this.indexCache[last].Item2;
-        }
-
-        // return created
-        private bool TryScanNextLine()
-        {
-            int startIndex = 0;
-            if (this.indexCache.Count > 0)
-            {
-                int tail = this.indexCache.Count - 1;
-                startIndex = this.indexCache[tail].Item1 + this.indexCache[tail].Item2;
-            }
-
-            if (startIndex >= this.source.Length)
-            {
-                return false;
-            }
-
-            int lastIndex = -1;
-            foreach (Tuple<char, int> currentPair in this.Scan(startIndex))
-            {
-                lastIndex = currentPair.Item2;
-                if (currentPair.Item1 == NewLine)
-                {
-                    break;
-                }
-            }
-
-            if (lastIndex < 0)
-            {
-                SharedFx.Assert("lastIndex < 0");
-                return false;
-            }
-
-            int lineLength = lastIndex - startIndex + 1;
-            this.indexCache.Add(Tuple.Create(startIndex, lineLength));
-            return true;
-        }
-
-        // Tuple<current charactor, charactor index>
-        // this Scan will replace \r\n=>\n \r=>\n
-        // \r\n return: <\n, \n's index>
-        // \r   return: <\n, \r's index>
-        private IEnumerable<Tuple<char, int>> Scan(int index)
-        {
-            if (index < 0 || index >= this.source.Length)
-            {
-                SharedFx.Assert("index < 0 || index >= this.source.Length");
-                yield break;
-            }
-
-            while (index < this.source.Length)
-            {
-                char currentChar = this.source[index];
-
-                if (currentChar == Return)
-                {
-                    if (index + 1 < this.source.Length && this.source[index + 1] == NewLine)
-                    {
-                        ++index;
-                    }
-
-                    currentChar = NewLine;
-                }
-
-                yield return Tuple.Create(currentChar, index);
-                ++index;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ViewStateIdManager.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ViewStateIdManager.cs
deleted file mode 100644 (file)
index 2122c0c..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System.Collections.Generic;
-
-    class ViewStateIdManager
-    {
-        readonly char separatorChar = '_';
-        Dictionary<string, int> prefixToIntMap = new Dictionary<string, int>();
-
-        public void UpdateMap(string id)
-        {
-            int separatorLocation = id.LastIndexOf('_');
-
-            // If the separator is not found or if the separator is the first or last character
-            // in the id then use id value itself as the prefix.
-            if (separatorLocation == -1 || separatorLocation == 0 || separatorLocation == id.Length - 1)
-            {
-                this.prefixToIntMap[id] = 0;
-            }
-            else
-            {
-                string[] idParts = new string[2];
-                idParts[0] = id.Substring(0, separatorLocation);
-                idParts[1] = id.Substring(separatorLocation + 1, id.Length - (separatorLocation + 1));
-
-                int suffix;
-                if (int.TryParse(idParts[1], out suffix))
-                {
-                    int oldValue;
-                    if (this.prefixToIntMap.TryGetValue(idParts[0], out oldValue))
-                    {
-                        if (suffix > oldValue)
-                        {
-                            this.prefixToIntMap[idParts[0]] = suffix;
-                        }
-                    }
-                    else
-                    {
-                        this.prefixToIntMap[idParts[0]] = suffix;
-                    }
-                }
-                else
-                {
-                    this.prefixToIntMap[id] = 0;
-                }
-            }
-        }
-
-        public string GetNewId(string prefix)
-        {
-            int suffix = 0;
-            this.prefixToIntMap.TryGetValue(prefix, out suffix);
-            
-            while (suffix == int.MaxValue)
-            {
-                prefix = prefix + this.separatorChar + suffix;
-                this.prefixToIntMap.TryGetValue(prefix, out suffix);
-            }
-
-            this.prefixToIntMap[prefix] = ++suffix;
-            return prefix + this.separatorChar + suffix;
-        }
-    };
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ViewStateXamlHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/ViewStateXamlHelper.cs
deleted file mode 100644 (file)
index fb5266e..0000000
+++ /dev/null
@@ -1,866 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Activities;
-    using System.Activities.Debugger;
-    using System.Activities.DynamicUpdate;
-    using System.Activities.Presentation.View;
-    using System.Activities.Presentation.ViewState;
-    using System.Collections.Generic;
-    using System.Reflection;
-    using System.Runtime;
-    using System.Xaml;
-
-    internal static class ViewStateXamlHelper
-    {
-        static readonly string ViewStateManager = WorkflowViewState.ViewStateManagerProperty.MemberName;
-        static readonly string IdRef = WorkflowViewState.IdRefProperty.MemberName;
-        static readonly MethodInfo GetViewStateManager = typeof(WorkflowViewState).GetMethod("GetViewStateManager");
-        static readonly MethodInfo SetViewStateManager = typeof(WorkflowViewState).GetMethod("SetViewStateManager");
-        static readonly MethodInfo GetIdRef = typeof(WorkflowViewState).GetMethod("GetIdRef");
-        static readonly MethodInfo SetIdRef = typeof(WorkflowViewState).GetMethod("SetIdRef");
-        static readonly List<string> SourceLocationNames = new List<string> 
-            {
-                XamlDebuggerXmlReader.StartLineName.MemberName,
-                XamlDebuggerXmlReader.StartColumnName.MemberName,
-                XamlDebuggerXmlReader.EndLineName.MemberName,
-                XamlDebuggerXmlReader.EndColumnName.MemberName
-            };
-
-        // These are used to discover that we have found a DynamicUpdateInfo.OriginalDefintion or OriginalActivityBuilder
-        // attached property member. We have "hardcoded" the *MemberName" here because DynamicUpdateInfo has the
-        // AttachableMemberIdentifier properties marked as private. But the DynamicUpdateInfo class itself is public,
-        // as are the Get and Set methods.
-        static readonly string DynamicUpdateOriginalDefinitionMemberName = "OriginalDefinition";
-        static readonly MethodInfo GetOriginalDefinition = typeof(DynamicUpdateInfo).GetMethod("GetOriginalDefinition");
-        static readonly MethodInfo SetOriginalDefinition = typeof(DynamicUpdateInfo).GetMethod("SetOriginalDefinition");
-
-        static readonly string DynamicUpdateOriginalActivityBuilderMemberName = "OriginalActivityBuilder";
-        static readonly MethodInfo GetOriginalActivityBuilder = typeof(DynamicUpdateInfo).GetMethod("GetOriginalActivityBuilder");
-        static readonly MethodInfo SetOriginalActivityBuilder = typeof(DynamicUpdateInfo).GetMethod("SetOriginalActivityBuilder");
-
-        // This method collects view state attached properties and generates a Xaml node stream 
-        // with all view state information appearing within the ViewStateManager node. 
-        // It is called when workflow definition is being serialized to string.
-        // inputReader  - Nodestream with view state information as attached properties on the activity nodes.
-        //                The reader is positioned at the begining of the workflow definition.
-        // idManager    - This component issues running sequence numbers for IdRef.
-        // Result       - Node stream positioned at the begining of the workflow definition with a  
-        //                ViewStateManager node containing all view state information.
-        // Implementation logic:
-        // 1. Scan the input nodestream Objects for attached properties that need to be converted (VirtualizedContainerService.HintSize and WorkflowViewStateService.ViewState).
-        // 2. If the Object had a IdRef value then use it otherwise generate a new value.
-        // 3. Store idRef value and corresponding viewstate related attached property nodes (from step 1) 
-        //    in the viewStateInfo dictionary.
-        // 4. Use the viewStateInfo dictionary to generate ViewStateManager node which is then inserted
-        //    into the end of output nodestream.
-        public static XamlReader ConvertAttachedPropertiesToViewState(XamlObjectReader inputReader, ViewStateIdManager idManager)
-        {
-            // Stack to track StartObject/GetObject and EndObject nodes.
-            Stack<Frame> stack = new Stack<Frame>();
-
-            XamlMember viewStateManager = new XamlMember(ViewStateManager, GetViewStateManager, SetViewStateManager, inputReader.SchemaContext);
-            XamlMember idRefMember = new XamlMember(IdRef, GetIdRef, SetIdRef, inputReader.SchemaContext);
-            
-            // Xaml member corresponding to x:Class property of the workflow definition. Used to find x:Class value in the node stream.
-            XamlMember activityBuilderName = new XamlMember(typeof(ActivityBuilder).GetProperty("Name"), inputReader.SchemaContext);
-            string activityBuilderTypeName = typeof(ActivityBuilder).Name;
-
-            // Dictionary to keep track of IdRefs and corresponding viewstate related
-            // attached property nodes.
-            Dictionary<string, XamlNodeList> viewStateInfo = new Dictionary<string, XamlNodeList>();
-
-            // Output node list
-            XamlNodeList workflowDefinition = new XamlNodeList(inputReader.SchemaContext);
-
-            using (XamlWriter workflowDefinitionWriter = workflowDefinition.Writer)
-            {
-                bool design2010NamespaceFound = false;
-                bool inIdRefMember = false;
-                bool inxClassMember = false;
-                bool skipWritingWorkflowDefinition = false;
-                bool skipReadingWorkflowDefinition = false;
-                string xClassName = null;
-
-                while (skipReadingWorkflowDefinition || inputReader.Read())
-                {
-                    skipWritingWorkflowDefinition = false;
-                    skipReadingWorkflowDefinition = false;
-                    switch (inputReader.NodeType)
-                    {
-                        case XamlNodeType.NamespaceDeclaration:
-                            if (inputReader.Namespace.Namespace.Equals(NameSpaces.Design2010, StringComparison.Ordinal))
-                            {
-                                design2010NamespaceFound = true;
-                            }
-                            break;
-
-                        case XamlNodeType.StartObject:
-                            // Save the Xaml type and clr object on the stack frame. These are used later to generate 
-                            // IdRef values and attaching the same to the clr object.
-                            stack.Push(new Frame() { Type = inputReader.Type, InstanceObject = inputReader.Instance });
-
-                            // If the design2010 namespace was not found add the namespace node
-                            // before the start object is written out.
-                            if (!design2010NamespaceFound)
-                            {
-                                workflowDefinitionWriter.WriteNamespace(new NamespaceDeclaration(NameSpaces.Design2010, NameSpaces.Design2010Prefix));
-                                design2010NamespaceFound = true;
-                            }
-                            break;
-
-                        case XamlNodeType.GetObject:
-                            // Push an empty frame to balance the Pop operation when the EndObject node 
-                            // is encountered.
-                            stack.Push(new Frame() { Type = null });
-                            break;
-
-                        case XamlNodeType.StartMember:
-                            // Track when we enter IdRef member so that we can save its value.
-                            if (inputReader.Member.Equals(idRefMember))
-                            {
-                                inIdRefMember = true;
-                            }
-                            // Track when we enter x:Class member so that we can save its value.
-                            else if (inputReader.Member.Equals(activityBuilderName))
-                            {
-                                inxClassMember = true;
-                            }
-                            // Start of VirtualizedContainerService.HintSize or WorkflowViewStateService.ViewState property.
-                            else if (IsAttachablePropertyForConvert(inputReader)) 
-                            {
-                                // The top of stack here corresponds to the activity on which
-                                // the above properties are attached.
-                                if (stack.Peek().AttachedPropertyNodes == null)
-                                {
-                                    stack.Peek().AttachedPropertyNodes = new XamlNodeList(inputReader.SchemaContext);
-                                }
-
-                                // Write the attached property's xaml nodes into the stack.
-                                XamlReader subTreeReader = inputReader.ReadSubtree();
-                                XamlWriter attachedPropertyWriter = stack.Peek().AttachedPropertyNodes.Writer;
-                                while (subTreeReader.Read())
-                                {
-                                    attachedPropertyWriter.WriteNode(subTreeReader);
-                                }
-
-                                // The subtree reader loop put us at the begining of the next node in the input stream. 
-                                // So skip reading/writing it out just yet.
-                                skipReadingWorkflowDefinition = true;
-                                skipWritingWorkflowDefinition = true;
-                            }
-                            break;
-
-                        case XamlNodeType.Value:
-                            // Read and save IdRef/x:Class member values.
-                            // Also update idManager to keep track of prefixes and ids seen.
-                            if (inIdRefMember)
-                            {
-                                string idRef = inputReader.Value as string;
-                                stack.Peek().IdRef = idRef;
-                                idManager.UpdateMap(idRef); 
-                            }
-                            else if (inxClassMember)
-                            {
-                                xClassName = inputReader.Value as string;
-                                idManager.UpdateMap(xClassName);
-                            }
-                            break;
-
-                        case XamlNodeType.EndMember:
-                            // Exit IdRef/x:Class member state.
-                            if (inIdRefMember)
-                            {
-                                inIdRefMember = false;
-                            }
-                            else if (inxClassMember)
-                            {
-                                inxClassMember = false;
-                            }
-                            break;
-
-                        case XamlNodeType.EndObject:
-                            // Remove an item from the stack because we encountered the end of an object definition.
-                            Frame frameObject = stack.Pop();
-
-                            // If the object had (viewstate related) attached properties we need to save them
-                            // into the viewStateInfo dictionary.
-                            if (frameObject.AttachedPropertyNodes != null)
-                            {
-                                frameObject.AttachedPropertyNodes.Writer.Close();
-
-                                // If the object didn't have IdRef, generate a new one.
-                                if (string.IsNullOrWhiteSpace(frameObject.IdRef))
-                                {
-                                    // Use the object type name (or x:Class value) to generate a new id.
-                                    if (frameObject.Type != null)
-                                    {
-                                        string prefix = frameObject.Type.Name;
-                                        if (frameObject.Type.UnderlyingType != null)
-                                        {
-                                            prefix = frameObject.Type.UnderlyingType.Name;
-                                        }
-
-                                        if (string.CompareOrdinal(prefix, activityBuilderTypeName) == 0 && !string.IsNullOrWhiteSpace(xClassName))
-                                        {
-                                            frameObject.IdRef = idManager.GetNewId(xClassName);
-                                        }
-                                        else
-                                        {
-                                            frameObject.IdRef = idManager.GetNewId(prefix);
-                                        }
-                                    }
-                                    else //Fallback to generating a guid value.
-                                    {
-                                        frameObject.IdRef = Guid.NewGuid().ToString();
-                                    }
-
-                                    // Since we didn't see a IdRef on this object, insert the generated 
-                                    // viewstate id into the output Xaml node-stream.
-                                    workflowDefinitionWriter.WriteStartMember(idRefMember);
-                                    workflowDefinitionWriter.WriteValue(frameObject.IdRef);
-                                    workflowDefinitionWriter.WriteEndMember();
-
-                                    // Save the generated idRef on the corresponding clr object as well.
-                                    if (frameObject.InstanceObject != null)
-                                    {
-                                        WorkflowViewState.SetIdRef(frameObject.InstanceObject, frameObject.IdRef);
-                                    }
-                                }
-
-                                viewStateInfo[frameObject.IdRef] = frameObject.AttachedPropertyNodes;
-                            }
-
-                            // We're at the end of input nodestream and have collected data in viewStateInfo
-                            // so we need to create and insert the ViewStateManager nodes into the output nodestream.
-                            if (stack.Count == 0 && viewStateInfo.Count > 0)
-                            {
-                                XamlNodeList viewStateManagerNodeList = CreateViewStateManagerNodeList(viewStateInfo, inputReader.SchemaContext);
-                                XamlReader viewStateManagerNodeReader = viewStateManagerNodeList.GetReader();
-
-                                // Insert the ViewStateManager nodes into the output node stream.
-                                workflowDefinitionWriter.WriteStartMember(viewStateManager);
-                                while (viewStateManagerNodeReader.Read())
-                                {
-                                    workflowDefinitionWriter.WriteNode(viewStateManagerNodeReader);
-                                }
-                                workflowDefinitionWriter.WriteEndMember(); // viewStateManager
-                            }
-                            break;
-                    }
-
-                    if (!skipWritingWorkflowDefinition)
-                    {
-                        workflowDefinitionWriter.WriteNode(inputReader);
-                    }
-                }
-            }
-
-            return workflowDefinition.GetReader();
-        }
-
-        // This method converts view state information stored within the ViewStateManager node back as
-        // attached properties on corresponding activity nodes.
-        // It is called when workflow definition is being deserialized from a string.
-        // inputReader - Nodestream that may have all view state information in the ViewStateManager node at the end of workflow definition. 
-        //               The reader is positioned at the begining of the workflow definition.
-        // idManager   - This component issues running sequence numbers for IdRef.
-        // viewStateManager - (output) ViewStateManager object instance deserialized from the workflow definition.
-        // Result      - Node stream positioned at the begining of the workflow definition with view state related information
-        //               appearing as attached properties on activities. The ViewStateManager nodes are removed from the stream.
-        // Implementation logic:
-        // 1. Scan the input nodestream for ViewStateManager node.
-        // 2. If ViewStateManager node is found, store Id and corresponding attached property nodes 
-        //    in viewStateInfo dictionary. Otherwise return early.
-        // 3. Walk activity nodes in the workflow definition and apply viewstate related attached properties (from 
-        //    viewStateInfo dictionary) to each node.
-        // 4. If multiple activities have same IdRef values then corresponding viewstate related attached properties 
-        //    (from viewStateInfo dictionary) are applied to the first of those activities. The other activities with duplicate
-        //    IdRef values do not get view state information.
-        public static XamlReader ConvertViewStateToAttachedProperties(XamlReader inputReader, ViewStateIdManager idManager, out Dictionary<string, SourceLocation> viewStateSourceLocationMap)
-        {
-            int idRefLineNumber = 0;
-            int idRefLinePosition = 0;
-            bool shouldWriteIdRefEndMember = false;
-
-            XamlReader retVal = null;
-
-            // Xaml member definition for IdRef. Used to identify existing IdRef properties in the input nodestream.
-            XamlMember idRefMember = new XamlMember(IdRef, GetIdRef, SetIdRef, inputReader.SchemaContext);
-
-            // These are used to ignore the IdRef members that are inside a DynamicUpdateInfo.OriginalDefinition/OriginalActivityBuilder attached property.
-            // We need to ignore these because if we don't, the IdRef values for the objects in the actual workflow defintion will be ignored because of the
-            // duplicate IdRef value. This causes problems with activity designers that depend on the ViewStateManager data to correctly display the workflow
-            // on the WorkflowDesigner canvas.
-            XamlMember originalDefinitionMember = new XamlMember(DynamicUpdateOriginalDefinitionMemberName, GetOriginalDefinition, SetOriginalDefinition, inputReader.SchemaContext);
-            XamlMember originalActivityBuilderMember = new XamlMember(DynamicUpdateOriginalActivityBuilderMemberName, GetOriginalActivityBuilder, SetOriginalActivityBuilder, inputReader.SchemaContext);
-
-            // insideOriginalDefintion gets set to true when we find a "StartMember" node for either of the above two attached properties.
-            // originalDefintionMemberCount gets incremented if we find any "StartMember" and insideOriginalDefinition is true.
-            // originalDefintionMemberCount gets decremented if we find any "EndMember" and insideOriginalDefintion is true.
-            // insideOriginalDefintion gets set to false when we find an "EndMember" and originalDefinitionMemberCount gets decremented to 0.
-            // If insideOriginalDefintion is true when we find an "IdRef" member, we do NOT add that IdRef to the idRefsSeen HashSet to avoid
-            // duplicates being defined by the IdRefs inside of the OriginalDefinition attached properties.
-            bool insideOriginalDefinition = false;
-            int originalDefinitionMemberCount = 0;
-
-            // Dictionary containing Ids and corresponding viewstate related
-            // attached property nodes. Populated by StripViewStateElement method.
-            Dictionary<string, XamlNodeList> viewStateInfo = null;
-            XamlReader workflowDefinition = StripViewStateElement(inputReader, out viewStateInfo, out viewStateSourceLocationMap);
-
-            // This is used to keep track of duplicate IdRefs in the workflow definition.
-            HashSet<string> idRefsSeen = new HashSet<string>();
-            
-            // If the inputReader did not have a ViewStateManager node (4.0 format)
-            // return early.
-            if (viewStateInfo == null)
-            {
-                retVal = workflowDefinition;
-            }
-            else
-            {
-                // Stack to track StartObject/GetObject and EndObject nodes.
-                Stack<Frame> stack = new Stack<Frame>();
-
-                // Output node list.
-                XamlNodeList mergedNodeList = new XamlNodeList(workflowDefinition.SchemaContext);
-                bool inIdRefMember = false;
-
-                using (XamlWriter mergedNodeWriter = mergedNodeList.Writer)
-                {
-                    IXamlLineInfo lineInfo = workflowDefinition as IXamlLineInfo;
-                    IXamlLineInfoConsumer lineInfoComsumer = mergedNodeWriter as IXamlLineInfoConsumer;
-                    bool shouldPassLineInfo = lineInfo != null && lineInfo.HasLineInfo && lineInfoComsumer != null && lineInfoComsumer.ShouldProvideLineInfo;
-
-                    while (workflowDefinition.Read())
-                    {
-                        bool skipWritingWorkflowDefinition = false;
-
-                        switch (workflowDefinition.NodeType)
-                        {
-                            case XamlNodeType.StartObject:
-                                stack.Push(new Frame { Type = workflowDefinition.Type });
-                                break;
-
-                            case XamlNodeType.GetObject:
-                                stack.Push(new Frame { Type = null });
-                                break;
-
-                            case XamlNodeType.StartMember:
-                                // If we find a StartMember for DynamicUpdateInfo.OriginalDefinition or OriginalActivityBuilder, remember that we are
-                                // inside one of those. We don't want to "remember" IdRef values in the idRefsSeen HashSet while inside these attached properties.
-                                if (workflowDefinition.Member.Equals(originalDefinitionMember) || workflowDefinition.Member.Equals(originalActivityBuilderMember))
-                                {
-                                    insideOriginalDefinition = true;
-                                }
-                                
-                                if (insideOriginalDefinition)
-                                {
-                                    originalDefinitionMemberCount++;
-                                }
-
-                                // Track when the reader enters IdRef. Skip writing the start 
-                                // node to the output nodelist until we check for duplicates.
-                                else if (workflowDefinition.Member.Equals(idRefMember))
-                                {
-                                    inIdRefMember = true;
-                                    skipWritingWorkflowDefinition = true;
-
-                                    if (shouldPassLineInfo)
-                                    {
-                                        idRefLineNumber = lineInfo.LineNumber;
-                                        idRefLinePosition = lineInfo.LinePosition;
-                                    }
-                                }
-                                break;
-
-                            case XamlNodeType.Value:
-                                if (inIdRefMember)
-                                {
-                                    // We don't want to deal with the IdRef if we are inside a DynamicUpdateInfo.OriginalDefinition/OriginalActivityBuilder
-                                    // attached property.
-                                    if (!insideOriginalDefinition)
-                                    {
-                                        string idRef = workflowDefinition.Value as string;
-                                        if (!string.IsNullOrWhiteSpace(idRef))
-                                        {
-                                            // If IdRef value is a duplicate then do not associate it with 
-                                            // the stack frame (top of stack == activity node with IdRef member on it).
-                                            if (idRefsSeen.Contains(idRef))
-                                            {
-                                                stack.Peek().IdRef = null;
-                                            }
-                                            // If the IdRef value is unique then associate it with the
-                                            // stack frame and also write its value into the output nodestream.
-                                            else
-                                            {
-                                                stack.Peek().IdRef = idRef;
-                                                idManager.UpdateMap(idRef);
-                                                idRefsSeen.Add(idRef);
-
-                                                if (shouldPassLineInfo)
-                                                {
-                                                    lineInfoComsumer.SetLineInfo(idRefLineNumber, idRefLinePosition);
-                                                }
-
-                                                mergedNodeWriter.WriteStartMember(idRefMember);
-
-                                                if (shouldPassLineInfo)
-                                                {
-                                                    lineInfoComsumer.SetLineInfo(lineInfo.LineNumber, lineInfo.LinePosition);
-                                                }
-
-                                                mergedNodeWriter.WriteValue(idRef);
-
-                                                shouldWriteIdRefEndMember = true;
-                                            }
-                                        }
-                                    }
-                                    // Don't need to write IdRef value into the output
-                                    // nodestream. If the value was valid, it would have been written above.
-                                    skipWritingWorkflowDefinition = true;
-                                }
-                                break;
-
-                            case XamlNodeType.EndMember:
-                                // If we are inside an OriginalDefinition/OriginalActivityBuilder attached property,
-                                // decrement the count and if it goes to zero, set insideOriginalDefintion to false
-                                // because we just encountered the EndMember for it.
-                                if (insideOriginalDefinition)
-                                {
-                                    originalDefinitionMemberCount--;
-                                    if (originalDefinitionMemberCount == 0)
-                                    {
-                                        insideOriginalDefinition = false;
-                                    }
-                                }
-
-                                // Exit IdRef node. Skip writing the EndMember node, we would have done 
-                                // it as part of reading the IdRef value.
-                                if (inIdRefMember && !insideOriginalDefinition)
-                                {
-                                    inIdRefMember = false;
-                                    skipWritingWorkflowDefinition = true;
-
-                                    if (shouldWriteIdRefEndMember)
-                                    {
-                                        shouldWriteIdRefEndMember = false;
-                                        
-                                        if (shouldPassLineInfo)
-                                        {
-                                            lineInfoComsumer.SetLineInfo(lineInfo.LineNumber, lineInfo.LinePosition);
-                                        }
-
-                                        mergedNodeWriter.WriteEndMember();
-                                    }
-                                }
-
-                                break;
-
-                            case XamlNodeType.EndObject:
-                                Frame frameObject = stack.Pop();
-                                // Before we exit the end of an object, check if it had IdRef
-                                // associated with it. If it did, look-up viewStateInfo for viewstate
-                                // related attached property nodes and add them to the output nodelist.
-                                if (!string.IsNullOrWhiteSpace(frameObject.IdRef))
-                                {
-                                    XamlNodeList viewStateNodeList;
-                                    if (viewStateInfo.TryGetValue(frameObject.IdRef, out viewStateNodeList))
-                                    {
-                                        XamlReader viewStateReader = viewStateNodeList.GetReader();
-
-                                        IXamlLineInfo viewStateLineInfo = viewStateReader as IXamlLineInfo;
-                                        bool viewStateShouldPassLineInfo = viewStateLineInfo != null && viewStateLineInfo.HasLineInfo && lineInfoComsumer != null && lineInfoComsumer.ShouldProvideLineInfo;
-
-                                        while (viewStateReader.Read())
-                                        {
-                                            if (viewStateShouldPassLineInfo)
-                                            {
-                                                lineInfoComsumer.SetLineInfo(viewStateLineInfo.LineNumber, viewStateLineInfo.LinePosition);
-                                            }
-
-                                            mergedNodeWriter.WriteNode(viewStateReader);
-                                        }
-                                    }
-                                }
-                                break;
-                        }
-                        if (!skipWritingWorkflowDefinition)
-                        {
-                            if (shouldPassLineInfo)
-                            {
-                                lineInfoComsumer.SetLineInfo(lineInfo.LineNumber, lineInfo.LinePosition);
-                            }
-
-                            mergedNodeWriter.WriteNode(workflowDefinition);
-                        }
-                    }
-                }
-
-                retVal = mergedNodeList.GetReader();
-            }
-
-            return retVal;
-        }
-
-        // This method removes IdRef nodes from the nodestream. This method would be called
-        // when a 4.5 workflow definition is retargeted to 4.0.
-        public static XamlReader RemoveIdRefs(XamlObjectReader inputReader)
-        {
-            XamlMember idRefMember = new XamlMember(IdRef, GetIdRef, SetIdRef, inputReader.SchemaContext);
-
-            XamlNodeList outputNodeList = new XamlNodeList(inputReader.SchemaContext);
-            using (XamlWriter outputWriter = outputNodeList.Writer)
-            {
-                while (inputReader.Read())
-                {
-                    if (inputReader.NodeType == XamlNodeType.StartMember && inputReader.Member.Equals(idRefMember))
-                    {
-                        // Exhaust the idRefMember sub-tree.
-                        XamlReader idRefReader = inputReader.ReadSubtree();
-                        while (idRefReader.Read());
-                    }
-                    outputWriter.WriteNode(inputReader);
-                }
-            }
-            return outputNodeList.GetReader();
-        }
-
-        // This is a helper method to output the nodestream sequence for debugging/diagnostic purposes.
-        public static void NodeLoopTest(XamlReader xamlReader)
-        {
-#if DEBUG
-            string tabs = "";
-            int depth = 1;
-            while (xamlReader.Read())
-            {
-                switch (xamlReader.NodeType)
-                {
-                    case XamlNodeType.NamespaceDeclaration:
-                        System.Diagnostics.Debug.WriteLine(tabs + "Namespace declaration: {0}:{1}", xamlReader.Namespace.Prefix, xamlReader.Namespace.Namespace);
-                        break;
-                    case XamlNodeType.StartObject:
-                        tabs = new String(' ', depth++);
-                        System.Diagnostics.Debug.WriteLine(tabs + "Start object: {0}", xamlReader.Type.Name);
-                        break;
-                    case XamlNodeType.GetObject:
-                        tabs = new String(' ', depth++);
-                        System.Diagnostics.Debug.WriteLine(tabs + "Get object");
-                        break;
-                    case XamlNodeType.StartMember:
-                        tabs = new String(' ', depth++);
-                        System.Diagnostics.Debug.WriteLine(tabs + "Start member: {0}, Attachable: {1}", xamlReader.Member.Name, xamlReader.Member.IsAttachable);
-                        break;
-                    case XamlNodeType.Value:
-                        tabs = new String(' ', depth++);
-                        System.Diagnostics.Debug.WriteLine(tabs + "Value: {0}", xamlReader.Value);
-                        --depth;
-                        break;
-                    case XamlNodeType.EndMember:
-                        tabs = new String(' ', --depth);
-                        System.Diagnostics.Debug.WriteLine(tabs + "End member");
-                        break;
-                    case XamlNodeType.EndObject:
-                        tabs = new String(' ', --depth);
-                        System.Diagnostics.Debug.WriteLine(tabs + "End object");
-                        break;
-                }
-            }
-#endif
-        }
-
-        // Given the viewStateInfo dictionary, this method returns a xaml node list matching a ViewStateManager
-        // object.
-        static XamlNodeList CreateViewStateManagerNodeList(Dictionary<string, XamlNodeList> viewStateInfo, XamlSchemaContext schemaContext)
-        {
-            XamlNodeList viewStateManagerNodeList = new XamlNodeList(schemaContext);
-
-            XamlMember viewStateDataMember = new XamlMember(typeof(ViewStateManager).GetProperty("ViewStateData"), schemaContext);
-            XamlType viewStateManagerType = new XamlType(typeof(ViewStateManager), schemaContext);
-            XamlType viewStateDataType = new XamlType(typeof(ViewStateData), schemaContext);
-            XamlMember idMember = new XamlMember(typeof(ViewStateData).GetProperty("Id"), schemaContext);
-
-            using (XamlWriter viewStateManagerNodeWriter = viewStateManagerNodeList.Writer)
-            {
-                viewStateManagerNodeWriter.WriteStartObject(viewStateManagerType);
-                viewStateManagerNodeWriter.WriteStartMember(viewStateDataMember);
-                viewStateManagerNodeWriter.WriteGetObject();
-                viewStateManagerNodeWriter.WriteStartMember(XamlLanguage.Items);
-
-                foreach (KeyValuePair<string, XamlNodeList> entry in viewStateInfo)
-                {
-                    viewStateManagerNodeWriter.WriteStartObject(viewStateDataType);
-
-                    viewStateManagerNodeWriter.WriteStartMember(idMember);
-                    viewStateManagerNodeWriter.WriteValue(entry.Key);
-                    viewStateManagerNodeWriter.WriteEndMember(); // idMember
-
-                    XamlReader viewStateValueReader = entry.Value.GetReader();
-                    while (viewStateValueReader.Read())
-                    {
-                        viewStateManagerNodeWriter.WriteNode(viewStateValueReader);
-                    }
-
-                    viewStateManagerNodeWriter.WriteEndObject(); // viewStateDataType
-                }
-
-                viewStateManagerNodeWriter.WriteEndMember(); // XamlLanguage.Items
-                viewStateManagerNodeWriter.WriteEndObject(); // GetObject
-                viewStateManagerNodeWriter.WriteEndMember(); // viewStateDataMember
-                viewStateManagerNodeWriter.WriteEndObject(); // viewStateManagerType
-                viewStateManagerNodeWriter.Close();
-            }
-
-            return viewStateManagerNodeList;
-        }
-
-        // Checks if the Xaml reader is on one of WorkflowViewStateService.ViewState or
-        // VirtualizedContainerService.HintSize members in the nodestream. These
-        // members need to be moved into the ViewStateManager node during the conversion.
-        static bool IsAttachablePropertyForConvert(XamlReader reader)
-        {
-            if (reader.NodeType == XamlNodeType.StartMember)
-            {
-                XamlMember member = reader.Member;
-                if (member.IsAttachable)
-                {
-                    if (member.DeclaringType.UnderlyingType == typeof(WorkflowViewStateService) && member.Name.Equals("ViewState", StringComparison.Ordinal))
-                    {
-                        return true;
-                    }
-                    else if (member.DeclaringType.UnderlyingType == typeof(VirtualizedContainerService) && member.Name.Equals("HintSize", StringComparison.Ordinal))
-                    {
-                        return true;
-                    }
-                }
-            }
-            return false;
-        }
-
-        // This method reads ViewStateManager nodes from the xaml nodestream and outputs that in the
-        // viewStateInfo dictionary. The input reader is positioned at the begining of the workflow definition.
-        // The method returns a reader positioned at the begining of the workflow definition with the ViewStateManager 
-        // nodes removed.
-        static XamlReader StripViewStateElement(XamlReader inputReader, out Dictionary<string, XamlNodeList> viewStateInfo, out Dictionary<string, SourceLocation> viewStateSourceLocationMap)
-        {
-            viewStateSourceLocationMap = null;
-            XamlNodeList strippedNodeList = new XamlNodeList(inputReader.SchemaContext);
-            XamlMember viewStateManager = new XamlMember(ViewStateManager, GetViewStateManager, SetViewStateManager, inputReader.SchemaContext);
-
-            using (XamlWriter strippedWriter = strippedNodeList.Writer)
-            {
-                IXamlLineInfo lineInfo = inputReader as IXamlLineInfo;
-                IXamlLineInfoConsumer lineInfoComsumer = strippedWriter as IXamlLineInfoConsumer;
-                bool shouldPassLineInfo = lineInfo != null && lineInfo.HasLineInfo && lineInfoComsumer != null && lineInfoComsumer.ShouldProvideLineInfo;
-
-                viewStateInfo = null;
-                while (inputReader.Read())
-                {
-                    if (inputReader.NodeType == XamlNodeType.StartMember && inputReader.Member.Equals(viewStateManager))
-                    {
-                        ReadViewStateInfo(inputReader.ReadSubtree(), out viewStateInfo, out viewStateSourceLocationMap);
-                        
-                    }
-
-                    if (shouldPassLineInfo)
-                    {
-                        lineInfoComsumer.SetLineInfo(lineInfo.LineNumber, lineInfo.LinePosition);
-                    }
-
-                    strippedWriter.WriteNode(inputReader);
-                }
-            }
-
-            return strippedNodeList.GetReader();
-        }
-
-        // This method reads ViewStateManager nodes from the xaml nodestream and outputs that in the 
-        // viewStateInfo dictionary. The input reader is positioned on the ViewStateManagerNode in the nodestream.
-        static void ReadViewStateInfo(XamlReader inputReader, out Dictionary<string, XamlNodeList> viewStateInfo, out Dictionary<string, SourceLocation> viewStateSourceLocationMap)
-        {
-            XamlType viewStateType = new XamlType(typeof(ViewStateData), inputReader.SchemaContext);
-
-            viewStateInfo = new Dictionary<string, XamlNodeList>();
-            viewStateSourceLocationMap = new Dictionary<string, SourceLocation>();
-            bool skipReading = false;
-            while (skipReading || inputReader.Read())
-            {
-                skipReading = false;
-                if (inputReader.NodeType == XamlNodeType.StartObject && inputReader.Type.Equals(viewStateType))
-                {
-                    string id;
-                    XamlNodeList viewStateNodeList;
-                    SourceLocation viewStateSourceLocation = null;
-                    ReadViewState(viewStateType, inputReader.ReadSubtree(), out id, out viewStateNodeList, out viewStateSourceLocation);
-                    if (id != null)
-                    {
-                        viewStateInfo[id] = viewStateNodeList;
-                        viewStateSourceLocationMap[id] = viewStateSourceLocation;
-                    }
-
-                    //inputReader will be positioned on the next node so no need to advance it.
-                    skipReading = true;
-                }
-            }
-        }
-
-        // This method reads a ViewStateData node from the xaml nodestream. It outputs the Id property into viewStateId
-        // and the attached viewstate related properties in viewStateNodes. The input reader is positioned on a 
-        // ViewStateData node within ViewStateManager.
-        static void ReadViewState(XamlType viewStateType, XamlReader xamlReader, out string viewStateId, out XamlNodeList viewStateNodes, out SourceLocation sourceLocation)
-        {
-            int globalMemberLevel = 0;
-            bool skippingUnexpectedAttachedProperty = false;
-            int skippingUnexpectedAttachedPropertyLevel = 0;
-            viewStateId = null;
-            viewStateNodes = new XamlNodeList(viewStateType.SchemaContext);
-            sourceLocation = null;
-
-            Stack<Frame> objectNodes = new Stack<Frame>();
-            XamlMember idMember = new XamlMember(typeof(ViewStateData).GetProperty("Id"), xamlReader.SchemaContext);
-            int[] viewStateDataSourceLocation = new int[4];
-            int sourceLocationIndex = -1;
-
-            IXamlLineInfo lineInfo = xamlReader as IXamlLineInfo;
-            IXamlLineInfoConsumer lineInfoComsumer = viewStateNodes.Writer as IXamlLineInfoConsumer;
-            bool shouldPassLineInfo = lineInfo != null && lineInfo.HasLineInfo && lineInfoComsumer != null && lineInfoComsumer.ShouldProvideLineInfo;
-
-            while (xamlReader.Read())
-            {
-                bool skipWritingToNodeList = false;
-                switch (xamlReader.NodeType)
-                {
-                    case XamlNodeType.StartObject:
-                        if (xamlReader.Type.Equals(viewStateType))
-                        {
-                            skipWritingToNodeList = true;
-                        }
-                        objectNodes.Push(new Frame { Type = xamlReader.Type });
-                        break;
-
-                    case XamlNodeType.GetObject:
-                        objectNodes.Push(new Frame { Type = null });
-                        break;
-
-                    case XamlNodeType.StartMember:
-                        globalMemberLevel++;
-                        if (xamlReader.Member.Equals(idMember))
-                        {
-                            XamlReader idNode = xamlReader.ReadSubtree();
-                            while (idNode.Read())
-                            {
-                                if (idNode.NodeType == XamlNodeType.Value)
-                                {
-                                    viewStateId = idNode.Value as string;
-                                }
-                            }
-                        } 
-                        // The xamlReader.ReadSubtree and subsequent while loop to get the Id member
-                        // has moved the xamlReader forward to the next member. We need to check to see
-                        // if it is an Attached Property that we care about. If it isn't then we need to
-                        // skip it and not put it in the resulting XamlNodeList.
-                        if (globalMemberLevel == 1 && !IsAttachablePropertyForConvert(xamlReader)) 
-                        {
-                            skippingUnexpectedAttachedProperty = true;
-                        }
-                        if (skippingUnexpectedAttachedProperty)
-                        {
-                            skippingUnexpectedAttachedPropertyLevel++;
-                        }
-
-                        sourceLocationIndex = GetViewStateDataSourceLocationIndexFromCurrentReader(xamlReader);
-                        break;
-
-                    case XamlNodeType.EndMember:
-                        globalMemberLevel--;
-                        if (skippingUnexpectedAttachedProperty)
-                        {
-                            skippingUnexpectedAttachedPropertyLevel--;
-                        }
-                        break;
-                    case XamlNodeType.Value:
-                        if (xamlReader.Value is int
-                            && sourceLocationIndex >= 0 
-                            && sourceLocationIndex < viewStateDataSourceLocation.Length)
-                        {
-                            viewStateDataSourceLocation[sourceLocationIndex] = (int)xamlReader.Value;
-                        }
-
-                        break;
-                    case XamlNodeType.EndObject:
-                        Frame objectNode = objectNodes.Pop();
-                        if (objectNode.Type != null && objectNode.Type.Equals(viewStateType))
-                        {
-                            skipWritingToNodeList = true;
-                            // The ViewStateData's source location should be valid, because
-                            // before each EndObject, its SourceLocation is injected.
-                            // If not, an exception will be thrown from constructor 
-                            // of SourceLocation.
-                            sourceLocation = new SourceLocation(null,
-                                viewStateDataSourceLocation[0],
-                                viewStateDataSourceLocation[1],
-                                viewStateDataSourceLocation[2],
-                                viewStateDataSourceLocation[3]
-                                );
-                        }
-
-                        Array.Clear(viewStateDataSourceLocation, 0, viewStateDataSourceLocation.Length);
-                        break;
-                };
-
-                if (!skipWritingToNodeList && !skippingUnexpectedAttachedProperty)
-                {
-                    if (shouldPassLineInfo)
-                    {
-                        lineInfoComsumer.SetLineInfo(lineInfo.LineNumber, lineInfo.LinePosition);
-                    }
-
-                    viewStateNodes.Writer.WriteNode(xamlReader);
-                }
-
-                if (skippingUnexpectedAttachedPropertyLevel == 0)
-                {
-                    skippingUnexpectedAttachedProperty = false;
-                }
-            }
-            viewStateNodes.Writer.Close();
-        }
-
-        private static int GetViewStateDataSourceLocationIndexFromCurrentReader(XamlReader xamlReader)
-        {
-            if (xamlReader.NodeType != XamlNodeType.StartMember
-                || xamlReader.Member == null
-                || xamlReader.Member.UnderlyingMember == null
-                || xamlReader.Member.UnderlyingMember.DeclaringType != typeof(XamlDebuggerXmlReader))
-            {
-                return -1;
-            }
-
-            // if UnderlineType is XamlDebuggerXmlReader, see if it 
-            // is one of {StartLine, StartColumn, EndLine, EndColumn}
-            return SourceLocationNames.IndexOf(xamlReader.Member.Name);
-        }
-
-        // This class is used for tracking Xaml nodestream data.
-        class Frame
-        {
-            // IdRef value if any associated with the node.
-            public string IdRef { get; set; }
-
-            // XamlType of the node. Helps generating IdRef values.
-            public XamlType Type { get; set; }
-
-            // XamlNodes corresponding to viewstate related attached property nodes.
-            public XamlNodeList AttachedPropertyNodes { get; set; }
-
-            // Underlying CLR object. Used to attach generated IdRef values 
-            // when serializing workflow definition.
-            public object InstanceObject { get; set; }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/WorkflowDesignerXamlHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/WorkflowDesignerXamlHelper.cs
deleted file mode 100644 (file)
index a6c511c..0000000
+++ /dev/null
@@ -1,701 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Activities;
-    using System.Activities.Debugger;
-    using System.Activities.Debugger.Symbol;
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.ViewState;
-    using System.Activities.Presentation.Xaml;
-    using System.Activities.XamlIntegration;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.IO;
-    using System.Runtime.Versioning;
-    using System.Xaml;
-
-    internal class WorkflowDesignerXamlHelper
-    {
-        private IWorkflowDesignerXamlHelperExecutionContext executionContext;
-
-        private XamlMember dynamicActivityPropertyNameMember;
-
-        private XamlMember dynamicActivityPropertyValueMember;
-
-        internal WorkflowDesignerXamlHelper(IWorkflowDesignerXamlHelperExecutionContext executionContext)
-        {
-            this.executionContext = executionContext;
-            SharedFx.Assert(this.executionContext != null, "this.executionContext != null");
-            SharedFx.Assert(this.executionContext.XamlSchemaContext != null, "this.executionContext.XamlSchemaContext != null");
-
-            this.dynamicActivityPropertyNameMember = new XamlMember(typeof(DynamicActivityProperty).GetProperty("Name"), this.XamlSchemaContext);
-            this.dynamicActivityPropertyValueMember = new XamlMember(typeof(DynamicActivityProperty).GetProperty("Value"), this.XamlSchemaContext);
-        }
-
-        private delegate void SourceLocationFoundCallback(object obj, SourceLocation sourceLocation);
-
-        internal enum DeserializationMode
-        {
-            Default,
-            ErrorTolerant,
-        }
-
-        public FrameworkName FrameworkName
-        {
-            get { return this.executionContext.FrameworkName; }
-        }
-
-        public WorkflowDesignerXamlSchemaContext XamlSchemaContext
-        {
-            get { return this.executionContext.XamlSchemaContext; }
-        }
-
-        public ViewStateIdManager IdManager
-        {
-            get { return this.executionContext.IdManager; }
-        }
-
-        public WorkflowSymbol LastWorkflowSymbol
-        {
-            get
-            {
-                return this.executionContext.LastWorkflowSymbol;
-            }
-
-            set
-            {
-                this.executionContext.LastWorkflowSymbol = value;
-            }
-        }
-
-        public string LocalAssemblyName
-        {
-            get { return this.executionContext.LocalAssemblyName; }
-        }
-
-        public void OnSerializationCompleted(Dictionary<object, object> sourceLocationObjectToModelItemObjectMapping)
-        {
-            this.executionContext.OnSerializationCompleted(sourceLocationObjectToModelItemObjectMapping);
-        }
-
-        public void OnBeforeDeserialize()
-        {
-            this.executionContext.OnBeforeDeserialize();
-        }
-
-        public void OnSourceLocationFound(object target, SourceLocation sourceLocation)
-        {
-            this.executionContext.OnSourceLocationFound(target, sourceLocation);
-        }
-
-        public void OnAfterDeserialize(Dictionary<string, SourceLocation> viewStateDataSourceLocationMapping)
-        {
-            this.executionContext.OnAfterDeserialize(viewStateDataSourceLocationMapping);
-        }
-
-        // Get root Activity. Currently only handle when the object is ActivityBuilder or Activity.
-        // May return null if it does not know how to get the root activity.
-        internal static Activity GetRootWorkflowElement(object rootModelObject)
-        {
-            SharedFx.Assert(rootModelObject != null, "Cannot pass null as rootModelObject");
-            Activity rootWorkflowElement;
-            IDebuggableWorkflowTree debuggableWorkflowTree = rootModelObject as IDebuggableWorkflowTree;
-            if (debuggableWorkflowTree != null)
-            {
-                rootWorkflowElement = debuggableWorkflowTree.GetWorkflowRoot();
-            }
-            else
-            {
-                // Loose xaml case.
-                rootWorkflowElement = rootModelObject as Activity;
-            }
-
-            return rootWorkflowElement;
-        }
-
-        internal static Activity GetRootElementForSymbol(object rootInstance, Activity documentRootElement)
-        {
-            ActivityBuilder activityBuilder = rootInstance as ActivityBuilder;
-            if (activityBuilder != null)
-            {
-                documentRootElement = activityBuilder.ConvertToDynamicActivity();
-            }
-
-            return documentRootElement;
-        }
-
-        // Copy the root namespaces from a reader to a writer.
-        // DesignTimeXamlWriter follows proper XAML convention by omitting the assembly name from
-        // clr-namespaces in the local assembly. However, VB Expressions aren't local-assembly-aware,
-        // and require an assembly name. So for every clr-namespace with no assembly name, we add an
-        // additional namespace record with an assembly name, to support VB.
-        // We only do this at the root level, since the designer only writes out namespaces at the root level.
-        internal void CopyNamespacesAndAddLocalAssembly(System.Xaml.XamlReader activityBuilderReader, System.Xaml.XamlWriter objectWriter)
-        {
-            // Designer loads alwas provide line info
-            IXamlLineInfo lineInfo = (IXamlLineInfo)activityBuilderReader;
-            IXamlLineInfoConsumer lineInfoConsumer = (IXamlLineInfoConsumer)objectWriter;
-            HashSet<string> definedPrefixes = new HashSet<string>();
-            List<NamespaceDeclaration> localAsmNamespaces = null;
-
-            while (activityBuilderReader.Read())
-            {
-                lineInfoConsumer.SetLineInfo(lineInfo.LineNumber, lineInfo.LinePosition);
-
-                if (activityBuilderReader.NodeType == XamlNodeType.NamespaceDeclaration)
-                {
-                    definedPrefixes.Add(activityBuilderReader.Namespace.Prefix);
-                    if (this.XamlSchemaContext.IsClrNamespaceWithNoAssembly(activityBuilderReader.Namespace.Namespace))
-                    {
-                        if (localAsmNamespaces == null)
-                        {
-                            localAsmNamespaces = new List<NamespaceDeclaration>();
-                        }
-
-                        localAsmNamespaces.Add(activityBuilderReader.Namespace);
-                    }
-
-                    objectWriter.WriteNode(activityBuilderReader);
-                }
-                else
-                {
-                    if (localAsmNamespaces != null)
-                    {
-                        foreach (NamespaceDeclaration ns in localAsmNamespaces)
-                        {
-                            string prefix = null;
-                            int i = 0;
-                            do
-                            {
-                                i++;
-                                prefix = ns.Prefix + i.ToString(CultureInfo.InvariantCulture);
-                            }
-                            while (definedPrefixes.Contains(prefix));
-                            string fullNs = this.XamlSchemaContext.AddLocalAssembly(ns.Namespace);
-                            objectWriter.WriteNamespace(new NamespaceDeclaration(fullNs, prefix));
-                            definedPrefixes.Add(prefix);
-                        }
-                    }
-
-                    objectWriter.WriteNode(activityBuilderReader);
-                    return;
-                }
-            }
-        }
-
-        internal string SerializeToString(object obj, string fileName)
-        {
-            FrameworkName targetFramework = this.FrameworkName;
-
-            string sourceFile = null;
-            Activity rootWorkflowElement = GetRootWorkflowElement(obj);
-            Dictionary<int, object> modelItemObjectSequence = null;
-
-            // If the current target is 4.5 or Higher, let us not write the filename attribute as DebugSymbol eliminates the need for it.
-            // We will serialize without the Filename by removing it from the element and adding it back after serialization
-            if (targetFramework.Is45OrHigher())
-            {
-                if (AttachablePropertyServices.TryGetProperty<string>(rootWorkflowElement, XamlDebuggerXmlReader.FileNameName, out sourceFile))
-                {
-                    AttachablePropertyServices.RemoveProperty(rootWorkflowElement, XamlDebuggerXmlReader.FileNameName);
-                }
-            }
-
-            TextWriter textWriter = new StringWriter(CultureInfo.InvariantCulture);
-
-            WorkflowDesignerXamlSchemaContext schemaContext = obj is ActivityBuilder ? this.XamlSchemaContext : new WorkflowDesignerXamlSchemaContext(null);
-
-            bool shouldWriteDebugSymbol = true;
-            if (targetFramework.IsLessThan45())
-            {
-                shouldWriteDebugSymbol = false;
-            }
-
-            System.Xaml.XamlReader outerReader;
-            XamlObjectReaderWithSequence innerReader;
-
-            using (textWriter)
-            {
-                UsingXamlWriter(
-                    new DesignTimeXamlWriter(textWriter, schemaContext, shouldWriteDebugSymbol),
-                    delegate(DesignTimeXamlWriter designTimeXamlWriter)
-                    {
-                        UsingXamlWriter(
-                            ActivityXamlServices.CreateBuilderWriter(designTimeXamlWriter),
-                            delegate(System.Xaml.XamlWriter activityBuilderWriter)
-                            {
-                                UsingXamlWriter(
-                                    new ActivityTemplateFactoryBuilderWriter(activityBuilderWriter, schemaContext),
-                                    delegate(System.Xaml.XamlWriter writer)
-                                    {
-                                        // If ViewStateManager property is attached, remove it. It needs to be regenerated if we target 4.5. 
-                                        // It should be removed if we're targeting 4.0.
-                                        AttachablePropertyServices.RemoveProperty(obj, WorkflowViewState.ViewStateManagerProperty);
-
-                                        this.CreateXamlObjectReaders(obj, schemaContext, out outerReader, out innerReader);
-
-                                        using (innerReader)
-                                        {
-                                            using (outerReader)
-                                            {
-#if ERROR_TOLERANT_SUPPORT
-                                                if (ErrorActivity.GetHasErrorActivities(obj))
-                                                {
-                                                    ErrorTolerantObjectWriter.TransformAndStripErrors(outerReader, writer);
-                                                }
-                                                else
-                                                {
-#endif
-                                                    XamlServices.Transform(outerReader, writer);
-#if ERROR_TOLERANT_SUPPORT
-                                                }
-#endif
-                                            }
-                                        }
-
-                                        modelItemObjectSequence = innerReader.SequenceNumberToObjectMap;
-                                    });
-                            });
-                    });
-            }
-
-            string retVal = textWriter.ToString();
-
-            if (targetFramework.IsLessThan45())
-            {
-                if (sourceFile != null)
-                {
-                    XamlDebuggerXmlReader.SetFileName(rootWorkflowElement, sourceFile);
-                }
-            }
-
-            IList<XamlLoadErrorInfo> loadErrors;
-            Dictionary<object, SourceLocation> sourceLocations;
-            object deserializedObject = this.DeserializeString(retVal, out loadErrors, out sourceLocations);
-
-            if (!string.IsNullOrEmpty(fileName) && targetFramework.Is45OrHigher())
-            {
-                this.LastWorkflowSymbol = this.GetWorkflowSymbol(fileName, deserializedObject, sourceLocations);
-                if (this.LastWorkflowSymbol != null)
-                {
-                    retVal = retVal.Replace(DesignTimeXamlWriter.EmptyWorkflowSymbol, this.LastWorkflowSymbol.Encode());
-                }
-            }
-
-            // The symbol is actually removed in GetAttachedWorkflowSymbol() after deserialization completes.
-            System.Xaml.AttachablePropertyServices.RemoveProperty(GetRootWorkflowElement(deserializedObject), DebugSymbol.SymbolName);
-            this.CreateXamlObjectReaders(deserializedObject, schemaContext, out outerReader, out innerReader);
-            Dictionary<object, object> sourceLocationObjectToModelItemObjectMapping = new Dictionary<object, object>(ObjectReferenceEqualityComparer<object>.Default);
-            using (innerReader)
-            {
-                using (outerReader)
-                {
-                    while (outerReader.Read())
-                    {
-                    }
-
-                    Dictionary<int, object> sourceLocationObjectSequence = innerReader.SequenceNumberToObjectMap;
-                    foreach (KeyValuePair<int, object> sourceLocationObjectEntry in sourceLocationObjectSequence)
-                    {
-                        int key = sourceLocationObjectEntry.Key;
-                        object sourceLocationObject = sourceLocationObjectEntry.Value;
-                        object modelItemObject;
-
-                        if (modelItemObjectSequence.TryGetValue(key, out modelItemObject))
-                        {
-                            sourceLocationObjectToModelItemObjectMapping.Add(sourceLocationObject, modelItemObject);
-                        }
-                    }
-                }
-            }
-
-            this.OnSerializationCompleted(sourceLocationObjectToModelItemObjectMapping);
-            return retVal;
-        }
-
-        internal void CreateXamlObjectReaders(object deserializedObject, XamlSchemaContext schemaContext, out XamlReader newWorkflowReader, out XamlObjectReaderWithSequence deserializedObjectSequenceBuilder)
-        {
-            deserializedObjectSequenceBuilder = new XamlObjectReaderWithSequence(deserializedObject, schemaContext);
-            if (this.FrameworkName.Is45OrHigher())
-            {
-                newWorkflowReader = ViewStateXamlHelper.ConvertAttachedPropertiesToViewState(deserializedObjectSequenceBuilder, this.IdManager);
-            }
-            else
-            {
-                newWorkflowReader = ViewStateXamlHelper.RemoveIdRefs(deserializedObjectSequenceBuilder);
-            }
-        }
-
-        internal object DeserializeString(string text)
-        {
-            IList<XamlLoadErrorInfo> loadErrors;
-            Dictionary<object, SourceLocation> sourceLocations;
-            return this.DeserializeString(text, out loadErrors, out sourceLocations);
-        }
-
-        internal object DeserializeString(string text, out IList<XamlLoadErrorInfo> loadErrors, out Dictionary<object, SourceLocation> sourceLocations)
-        {
-            try
-            {
-                return this.DeserializeString(text, DeserializationMode.Default, out loadErrors, out sourceLocations);
-            }
-            catch (XamlObjectWriterException)
-            {
-                // Fall back to error-tolerant path. We don't do this by default for perf reasons.
-                return this.DeserializeString(text, DeserializationMode.ErrorTolerant, out loadErrors, out sourceLocations);
-            }
-        }
-
-        //// XAML writer may throw exception during dispose, therefore the following code will cause exception masking
-        ////
-        //// using (XamlWriter xamlWriter)
-        //// {
-        ////      ...
-        //// }
-        ////
-        //// If there are any exception A thrown within the block, and if xamlWriter.Dispose() throws an exception B
-        //// The exception B will mask exception A and the exception is the ErrorTolerant scenario will be broken.
-        ////
-        //// The fix to this problem is to ---- any XamlException thrown during Dispose(), we are in general not
-        //// interested in those exceptions.
-        private static void UsingXamlWriter<T>(T xamlWriter, Action<T> work) where T : XamlWriter
-        {
-            if (xamlWriter != null)
-            {
-                try
-                {
-                    work(xamlWriter);
-                }
-                finally
-                {
-                    try
-                    {
-                        xamlWriter.Close();
-                    }
-                    catch (XamlException e)
-                    {
-                        // ignore any XAML exception during closing a XamlWriter
-                        Trace.WriteLine(e.Message);
-                    }
-                }
-            }
-        }
-
-        // there are two kind of attribute:
-        // 1) in lined : argument="some value"
-        // 2) <argument>
-        //       <Expression ....../>
-        //    </argument>
-        // here, for (1) return the source location of "some value".
-        // for (2) return null
-        private static SourceLocation GetInlineAttributeValueLocation(LineColumnPair startPoint, SourceTextScanner sourceTextScanner)
-        {
-            const char SingleQuote = '\'';
-            const char DoubleQuote = '"';
-            const char StartAngleBracket = '<';
-            Tuple<LineColumnPair, char> start = sourceTextScanner.SearchCharAfter(startPoint, SingleQuote, DoubleQuote, StartAngleBracket);
-            if (start == null)
-            {
-                return null;
-            }
-
-            if (start.Item2 == StartAngleBracket)
-            {
-                return null;
-            }
-
-            Tuple<LineColumnPair, char> end = sourceTextScanner.SearchCharAfter(start.Item1, start.Item2);
-            if (end == null)
-            {
-                SharedFx.Assert("end of SourceLocation is not found");
-                return null;
-            }
-
-            return new SourceLocation(null, start.Item1.LineNumber, start.Item1.ColumnNumber, end.Item1.LineNumber, end.Item1.ColumnNumber);
-        }
-
-        private WorkflowSymbol GetWorkflowSymbol(string fileName, object deserializedObject, Dictionary<object, SourceLocation> sourceLocations)
-        {
-            if (deserializedObject != null)
-            {
-                Activity deserializedRootElement = GetRootWorkflowElement(deserializedObject);
-                if (deserializedRootElement != null)
-                {
-                    try
-                    {
-                        deserializedRootElement = GetRootElementForSymbol(deserializedObject, deserializedRootElement);
-                        return new WorkflowSymbol
-                        {
-                            FileName = fileName,
-                            Symbols = SourceLocationProvider.GetSymbols(deserializedRootElement, sourceLocations)
-                        };
-                    }
-                    catch (Exception ex)
-                    {
-                        if (SharedFx.IsFatal(ex))
-                        {
-                            throw;
-                        }
-
-                        // This happens when the workflow is invalid so GetSymbols fails.
-                        // ---- exception here.
-                    }
-                }
-            }
-
-            return null;
-        }
-
-        private object DeserializeString(string text, DeserializationMode mode, out IList<XamlLoadErrorInfo> loadErrors, out Dictionary<object, SourceLocation> sourceLocations)
-        {
-            object result = null;
-            loadErrors = null;
-            Dictionary<object, SourceLocation> collectingSourceLocations = new Dictionary<object, SourceLocation>(ObjectReferenceEqualityComparer<object>.Default);
-            SourceLocationFoundCallback sourceLocationFoundCallback = new SourceLocationFoundCallback((obj, sourceLocation) =>
-            {
-                // If an object appear more than once in the XAML stream (e.g. System.Type, which is cached by reflection)
-                // we count the first occurrence.
-                if (!collectingSourceLocations.ContainsKey(obj))
-                {
-                    collectingSourceLocations.Add(obj, sourceLocation);
-                }
-
-                this.OnSourceLocationFound(obj, sourceLocation);
-            });
-
-            this.XamlSchemaContext.ContainsConversionRequiredType = false;
-            Dictionary<string, SourceLocation> viewStateDataSourceLocationMapping = null;
-            using (XamlDebuggerXmlReader debuggerReader = new XamlDebuggerXmlReader(new StringReader(text), this.XamlSchemaContext))
-            {
-                using (System.Xaml.XamlReader activityBuilderReader = ActivityXamlServices.CreateBuilderReader(debuggerReader))
-                {
-                    using (System.Xaml.XamlReader activityTemplateFactoryBuilderReader = new ActivityTemplateFactoryBuilderReader(activityBuilderReader, this.XamlSchemaContext))
-                    {
-                        debuggerReader.SourceLocationFound += delegate(object sender, SourceLocationFoundEventArgs args)
-                        {
-                            sourceLocationFoundCallback(args.Target, args.SourceLocation);
-                        };
-
-                        this.OnBeforeDeserialize();
-                        debuggerReader.CollectNonActivitySourceLocation = this.FrameworkName.Is45OrHigher();
-
-                        using (System.Xaml.XamlReader reader = ViewStateXamlHelper.ConvertViewStateToAttachedProperties(activityTemplateFactoryBuilderReader, this.IdManager, out viewStateDataSourceLocationMapping))
-                        {
-                            switch (mode)
-                            {
-#if ERROR_TOLERANT_SUPPORT
-                                case DeserializationMode.ErrorTolerant:
-                                    {
-                                        ErrorTolerantObjectWriter tolerantWriter = new ErrorTolerantObjectWriter(reader.SchemaContext);
-                                        tolerantWriter.LocalAssemblyName = this.LocalAssemblyName;
-                                        XamlServices.Transform(reader, tolerantWriter);
-                                        loadErrors = this.CheckFileFormatError(tolerantWriter.LoadErrors);
-                                        result = tolerantWriter.Result;
-                                        ErrorActivity.SetHasErrorActivities(result, true);
-                                    }
-
-                                    break;
-#endif
-                                case DeserializationMode.Default:
-                                    {
-                                        result = this.TransformAndGetPropertySourceLocation(reader, new SourceTextScanner(text), sourceLocationFoundCallback);
-
-                                        loadErrors = this.CheckFileFormatError(loadErrors);
-                                    }
-
-                                    break;
-                            }
-                        }
-                    }
-                }
-            }
-
-            sourceLocations = collectingSourceLocations;
-            this.OnAfterDeserialize(viewStateDataSourceLocationMapping);
-            return result;
-        }
-
-        // For dynamic activity property, we needs to collect the source location of 
-        // its default value when the value is inlined.
-        private KeyValuePair<string, SourceLocation> TransformDynamicActivityProperty(
-            XamlReader reader,
-            XamlObjectWriter objectWriter,
-            SourceTextScanner sourceTextScanner)
-        {
-            // (Number of SM -Number of EM) since SM DAP.Name is read.
-            // SO DAP                   ---nameReadingLevel=0
-            //   SM NAME                ---nameReadingLevel=1
-            //     SO String            ---nameReadingLevel=1
-            //       SM Initialize      ---nameReadingLevel=2
-            //         VA StringValue   ---nameReadingLevel=2
-            //       EM                 ---nameReadingLevel=1
-            //     SO                   ---nameReadingLevel=1
-            //   EM                     ---nameReadingLevel=0
-            // EO                       ---nameReadingLevel=0
-            int nameReadingLevel = 0;
-
-            IXamlLineInfo lineInfo = (IXamlLineInfo)reader;
-            SourceLocation defaultValueLocation = null;
-            string propertyName = null;
-
-            while (reader.Read())
-            {
-                switch (reader.NodeType)
-                {
-                    case XamlNodeType.StartMember:
-                        if (nameReadingLevel > 0
-                            || reader.Member == this.dynamicActivityPropertyNameMember)
-                        {
-                            ++nameReadingLevel;
-                        }
-                        else if (reader.Member == this.dynamicActivityPropertyValueMember)
-                        {
-                            LineColumnPair startPoint = new LineColumnPair(lineInfo.LineNumber, lineInfo.LinePosition);
-                            defaultValueLocation = GetInlineAttributeValueLocation(startPoint, sourceTextScanner);
-                        }
-
-                        break;
-
-                    case XamlNodeType.EndMember:
-                        if (nameReadingLevel > 0)
-                        {
-                            --nameReadingLevel;
-                        }
-
-                        break;
-
-                    case XamlNodeType.Value:
-                        if (nameReadingLevel > 0)
-                        {
-                            propertyName = reader.Value as string;
-                        }
-
-                        break;
-                }
-
-                objectWriter.WriteNode(reader);
-            }
-
-            if (propertyName != null && defaultValueLocation != null)
-            {
-                return new KeyValuePair<string, SourceLocation>(propertyName, defaultValueLocation);
-            }
-
-            return new KeyValuePair<string, SourceLocation>();
-        }
-
-        private object TransformAndGetPropertySourceLocation(XamlReader reader, SourceTextScanner sourceTextScanner, SourceLocationFoundCallback sourceLocationFoundCallback)
-        {
-            // <property name, value's start location>
-            Dictionary<string, SourceLocation> propertyValueLocationMapping = new Dictionary<string, SourceLocation>();
-
-            object deserializedObject = null;
-            object earlyResult = null;
-
-            UsingXamlWriter(
-                new XamlObjectWriter(reader.SchemaContext),
-                delegate(XamlObjectWriter objectWriter)
-                {
-                    if (this.XamlSchemaContext.HasLocalAssembly)
-                    {
-                        this.CopyNamespacesAndAddLocalAssembly(reader, objectWriter);
-                    }
-
-                    if (!(reader is IXamlLineInfo))
-                    {
-                        XamlServices.Transform(reader, objectWriter);
-                        earlyResult = objectWriter.Result;
-                        return;
-                    }
-
-                    XamlType dynamicActivityPropertyType = this.XamlSchemaContext.GetXamlType(typeof(DynamicActivityProperty));
-                    while (reader.Read())
-                    {
-                        // read SubTree will moves the reader pointed to
-                        // element after its EO. So, we need to use a while
-                        while (!reader.IsEof && reader.NodeType == XamlNodeType.StartObject
-                            && dynamicActivityPropertyType == reader.Type)
-                        {
-                            KeyValuePair<string, SourceLocation> nameSourceLocation = this.TransformDynamicActivityProperty(reader.ReadSubtree(), objectWriter, sourceTextScanner);
-                            if (nameSourceLocation.Key != null && nameSourceLocation.Value != null && !propertyValueLocationMapping.ContainsKey(nameSourceLocation.Key))
-                            {
-                                propertyValueLocationMapping.Add(nameSourceLocation.Key, nameSourceLocation.Value);
-                            }
-                        }
-
-                        if (!reader.IsEof)
-                        {
-                            objectWriter.WriteNode(reader);
-                        }
-                    }
-
-                    deserializedObject = objectWriter.Result;
-                });
-
-            if (earlyResult != null)
-            {
-                return earlyResult;
-            }
-
-            ActivityBuilder activityBuilder = deserializedObject as ActivityBuilder;
-            if (activityBuilder == null)
-            {
-                return deserializedObject;
-            }
-
-            foreach (KeyValuePair<string, SourceLocation> propertyValueLocation in propertyValueLocationMapping)
-            {
-                string propertyName = propertyValueLocation.Key;
-                SourceLocation propertyLocation = propertyValueLocation.Value;
-                if (!activityBuilder.Properties.Contains(propertyName))
-                {
-                    SharedFx.Assert(string.Format(CultureInfo.CurrentCulture, "no such property:{0}", propertyName));
-                    continue;
-                }
-
-                DynamicActivityProperty property = activityBuilder.Properties[propertyName];
-
-                if (property == null || property.Value == null)
-                {
-                    SharedFx.Assert(string.Format(CultureInfo.CurrentCulture, "no such property value:{0}", propertyName));
-                    continue;
-                }
-
-                object expression = (property.Value is Argument) ? ((Argument)property.Value).Expression : null;
-                if (expression != null)
-                {
-                    sourceLocationFoundCallback(expression, propertyLocation);
-                }
-                else
-                {
-                    sourceLocationFoundCallback(property.Value, propertyLocation);
-                }
-            }
-
-            return deserializedObject;
-        }
-
-        private IList<XamlLoadErrorInfo> CheckFileFormatError(IList<XamlLoadErrorInfo> loadErrors)
-        {
-            IList<XamlLoadErrorInfo> result = loadErrors;
-
-            if (this.XamlSchemaContext.ContainsConversionRequiredType)
-            {
-                if (result == null)
-                {
-                    result = new List<XamlLoadErrorInfo>();
-                }
-
-                result.Add(new XamlLoadErrorInfo(SharedSR.FileFormatError, 0, 0));
-            }
-
-            return result;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/WorkflowDesignerXamlSchemaContext.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/WorkflowDesignerXamlSchemaContext.cs
deleted file mode 100644 (file)
index 6eff79e..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Xaml;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.ComponentModel.Composition;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Linq;
-    using System.Reflection;
-    using System.Runtime.CompilerServices;
-    using System.Runtime.Versioning;
-    using System.Xaml;
-    using Microsoft.Activities.Presentation;
-
-    class WorkflowDesignerXamlSchemaContext : XamlSchemaContext
-    {
-        //post fix for xml namespace defined by CLR namespace in local assembly            
-        readonly string localAssemblyNsPostfix;
-        readonly string localAssemblyNsPostfixNoLeadingSemicolon;
-        // Cache of custom XamlTypes
-        Dictionary<Type, XamlType> customXamlTypes;
-        EditingContext editingContext;
-        bool environmentAssembliesLoaded;
-        private readonly static FrameworkName CurrentFramework = FrameworkNameConstants.NetFramework45;
-        private ResolverCache resolverCache;
-
-        private static List<Type> supportedTypes;
-        private static List<Type> conversionRequiredTypes;
-
-        [SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")]
-        static WorkflowDesignerXamlSchemaContext()
-        {
-            supportedTypes = new List<Type>();
-            supportedTypes.Add(typeof(System.Activities.Presentation.Expressions.ExpressionActivityEditor));
-            supportedTypes.Add(typeof(System.Activities.Presentation.Annotations.Annotation));
-
-            conversionRequiredTypes = new List<Type>();
-            conversionRequiredTypes.Add(typeof(System.Activities.Expressions.TextExpression));
-            conversionRequiredTypes.Add(typeof(System.Activities.Expressions.AssemblyReference));
-            conversionRequiredTypes.Add(typeof(System.Collections.ObjectModel.Collection<System.Activities.Expressions.AssemblyReference>));
-            conversionRequiredTypes.Add(typeof(System.Activities.Debugger.Symbol.DebugSymbol));
-            conversionRequiredTypes.Add(typeof(System.Activities.Presentation.ViewState.WorkflowViewState));
-            conversionRequiredTypes.Add(typeof(System.Activities.Presentation.ViewState.ViewStateManager));
-            conversionRequiredTypes.Add(typeof(System.Activities.Presentation.ViewState.ViewStateData));
-        }
-
-        public WorkflowDesignerXamlSchemaContext(string localAssembly) : this(localAssembly, null)
-        {
-        }
-
-        public WorkflowDesignerXamlSchemaContext(string localAssembly, EditingContext editingContext)
-        {
-            if (!string.IsNullOrEmpty(localAssembly))
-            {
-                this.localAssemblyNsPostfix = XamlNamespaceHelper.ClrNamespaceAssemblyField + localAssembly;
-                this.localAssemblyNsPostfixNoLeadingSemicolon = localAssemblyNsPostfix.Substring(1);
-            }
-            this.editingContext = editingContext;
-        }
-
-        internal bool ContainsConversionRequiredType { get; set; }
-
-        protected override XamlType GetXamlType(string xamlNamespace, string name, params XamlType[] typeArguments)
-        {
-            if (!string.IsNullOrEmpty(this.localAssemblyNsPostfix)
-                && IsClrNamespaceWithNoAssembly(xamlNamespace))
-            {
-                xamlNamespace = AddLocalAssembly(xamlNamespace);
-            }
-
-            var xamlType = base.GetXamlType(xamlNamespace, name, typeArguments);
-
-            if (xamlType == null && environmentAssembliesLoaded == false && editingContext != null)
-            {
-                // Failed to find the type, this might because the namespace is a custom namespace
-                //  and the dependent assembly hasn't been loaded yet. Load all dependent assemblies
-                //  and try to load the same xaml type again.
-                AssemblyContextControlItem assemblyItem = this.editingContext.Items.GetValue<AssemblyContextControlItem>();
-                var environmentAssemblies = assemblyItem.GetEnvironmentAssemblies(null);
-                if (assemblyItem.LocalAssemblyName != null)
-                {
-                    AssemblyContextControlItem.GetAssembly(assemblyItem.LocalAssemblyName, null);
-                }
-
-                environmentAssembliesLoaded = true;
-                xamlType = base.GetXamlType(xamlNamespace, name, typeArguments);
-            }
-
-            if (xamlType == null || xamlType.UnderlyingType == null || this.editingContext == null)
-            {
-                return xamlType;
-            }
-
-            MultiTargetingSupportService multiTargetingService = editingContext.Services.GetService<IMultiTargetingSupportService>() as MultiTargetingSupportService;
-            DesignerConfigurationService config = editingContext.Services.GetService<DesignerConfigurationService>();
-            if (multiTargetingService == null || config == null)
-            {
-                return xamlType;
-            }
-
-            // do not filter out new types and new properties if targeting to current framework and it's a full SKU
-            if (config.TargetFrameworkName.Version == CurrentFramework.Version && config.TargetFrameworkName.IsFullProfile())
-            {
-                return xamlType;
-            }
-
-            // Filter out new types and new properties
-            if (this.resolverCache == null)
-            {
-                this.resolverCache = new ResolverCache();
-            }
-
-            if (supportedTypes.Contains(xamlType.UnderlyingType))
-            {
-                return xamlType;
-            }
-
-            // only check if conversion is needed when target framework is less than 4.5
-            if (config.TargetFrameworkName.Version < CurrentFramework.Version)
-            {
-                if (conversionRequiredTypes.Contains(xamlType.UnderlyingType))
-                {
-                    this.ContainsConversionRequiredType = true;
-                    return xamlType;
-                }
-            }
-
-            ResolverResult resolverResult = this.resolverCache.Lookup(xamlType.UnderlyingType);
-            if (resolverResult == null)
-            {
-                resolverResult = MultiTargetingTypeResolver.Resolve(multiTargetingService, xamlType.UnderlyingType);
-                this.resolverCache.Update(xamlType.UnderlyingType, resolverResult);
-            }
-
-            return MultiTargetingTypeResolver.GetXamlType(resolverResult, xamlType);
-        }
-
-        public override XamlType GetXamlType(Type type)
-        {            
-            XamlType xamlType = null;
-            if (this.customXamlTypes != null && this.customXamlTypes.TryGetValue(type, out xamlType))
-            {
-                return xamlType;
-            }
-            bool isCustom = false;
-            xamlType = GetCustomType(type);
-            if (xamlType != null)
-            {
-                isCustom = true;
-            }
-            else
-            {
-                xamlType = base.GetXamlType(type);
-                if (xamlType.GetXamlNamespaces().Any(ns => IsClrNamespaceInLocalAssembly(ns)))
-                {
-                    isCustom = true;
-                    xamlType = new XamlTypeWithExplicitNamespace(xamlType, xamlType.GetXamlNamespaces().Select(ns => IsClrNamespaceInLocalAssembly(ns) ? TrimLocalAssembly(ns) : ns));
-                }
-            }
-            if (isCustom)
-            {
-                if (this.customXamlTypes == null)
-                {
-                    this.customXamlTypes = new Dictionary<Type, XamlType>();
-                }
-                this.customXamlTypes[type] = xamlType;
-            }
-            return xamlType;
-        }
-
-        public override IEnumerable<string> GetAllXamlNamespaces()
-        {
-            foreach (string ns in base.GetAllXamlNamespaces())
-            {
-                if (IsClrNamespaceInLocalAssembly(ns))
-                {
-                    yield return TrimLocalAssembly(ns);
-                }
-                else
-                {
-                    yield return ns;
-                }
-            }
-        }
-
-        internal bool HasLocalAssembly
-        {
-            get { return !string.IsNullOrEmpty(this.localAssemblyNsPostfix); }
-        }
-
-        internal string AddLocalAssembly(string ns)
-        {
-            string result = ns;
-            // clr-namespace:X.Y.Z ==> clr-namespace:X.Y.Z;assembly=MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
-            if (result[result.Length - 1] != ';')
-            {
-                result += this.localAssemblyNsPostfix;
-            }
-            else
-            {
-                result += this.localAssemblyNsPostfixNoLeadingSemicolon;
-            }
-            return result;
-        }
-
-        internal bool IsClrNamespaceWithNoAssembly(string ns)
-        {
-            //could be more sophisticated with a RegEx, but let's keep it simple for now
-            return ns.StartsWith(XamlNamespaceHelper.ClrNamespacePrefix, StringComparison.OrdinalIgnoreCase) &&
-                ns.IndexOf(XamlNamespaceHelper.ClrNamespaceAssemblyField, StringComparison.OrdinalIgnoreCase) == -1;
-        }
-
-        internal bool IsClrNamespaceInLocalAssembly(string ns)
-        {
-            //could be more sophisticated with a RegEx, but let's keep it simple for now
-
-            return !string.IsNullOrEmpty(this.localAssemblyNsPostfix) && ns.EndsWith(this.localAssemblyNsPostfix, StringComparison.OrdinalIgnoreCase);
-        }
-
-        internal string TrimLocalAssembly(string ns)
-        {
-            return string.IsNullOrEmpty(this.localAssemblyNsPostfix) ? ns : ns.Substring(0, ns.Length - this.localAssemblyNsPostfix.Length);
-        }
-
-        XamlType GetCustomType(Type type)
-        {
-            if (type == typeof(DesignerAttribute))
-            {
-                return new AttributeXamlType<DesignerAttribute, DesignerAttributeInfo>(this);
-            }
-            if (type == typeof(EditorAttribute))
-            {
-                return new AttributeXamlType<EditorAttribute, EditorAttributeInfo>(this);
-            }
-            if (type == typeof(DefaultValueAttribute))
-            {
-                return new AttributeXamlType<DefaultValueAttribute, DefaultValueAttributeInfo>(this);
-            }
-            if (type.Namespace == "System.ComponentModel.Composition")
-            {
-                return GetCustomMefType(type);
-            }
-#if ERROR_TOLERANT_SUPPORT
-            if (ErrorTolerantObjectWriter.IsErrorActivity(type))
-            {
-                return new ShimAsPublicXamlType(type, this);
-            }
-#endif
-            return null;
-        }
-
-        // Avoid loading System.ComponentModel.Composition unless we need it
-        [MethodImpl(MethodImplOptions.NoInlining)]
-        XamlType GetCustomMefType(Type type)
-        {
-            if (type == typeof(ImportAttribute))
-            {
-                return new AttributeXamlType<ImportAttribute, ImportAttributeInfo>(this);
-            }
-            if (type == typeof(ImportManyAttribute))
-            {
-                return new AttributeXamlType<ImportAttribute, ImportAttributeInfo>(this);
-            }
-            return null;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlNamespaceHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlNamespaceHelper.cs
deleted file mode 100644 (file)
index 70d08a3..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-
-    internal class XamlNamespaceHelper 
-    {
-        internal const string ClrNamespacePrefix = "clr-namespace:";
-        internal const string ClrNamespaceAssemblyField = ";assembly=";
-
-        internal static bool TryParseClrNsUri(string xamlNamespace, out string clrNamespace, out string assembly)
-        {
-            clrNamespace = null;
-            assembly = null;
-            if (!xamlNamespace.StartsWith(ClrNamespacePrefix, StringComparison.Ordinal))
-            {
-                return false;
-            }
-            int clrNsIndex = ClrNamespacePrefix.Length;
-            int assemblyIndex = xamlNamespace.IndexOf(ClrNamespaceAssemblyField, StringComparison.Ordinal);
-            if (assemblyIndex < clrNsIndex)
-            {
-                clrNamespace = xamlNamespace.Substring(clrNsIndex);
-                return true;
-            }
-            clrNamespace = xamlNamespace.Substring(clrNsIndex, assemblyIndex - clrNsIndex);
-            assemblyIndex += ClrNamespaceAssemblyField.Length;
-            assembly = xamlNamespace.Substring(assemblyIndex);
-            return true;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlObjectReaderWithSequence.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlObjectReaderWithSequence.cs
deleted file mode 100644 (file)
index 05db903..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System.Activities;
-    using System.Activities.XamlIntegration;
-    using System.Collections.Generic;
-    using System.Reflection;
-    using System.Xaml;
-
-    internal sealed class XamlObjectReaderWithSequence : XamlObjectReader
-    {
-        private int sequenceNumber;
-        private Dictionary<int, object> sequenceNumberToObjectMap;
-        private HashSet<object> visitedObjects;
-
-        private Stack<object> objects = new Stack<object>();
-        private XamlMember xamlMember = null;
-
-        public XamlObjectReaderWithSequence(object instance, XamlSchemaContext schemaContext)
-            : base(instance, schemaContext)
-        {
-        }
-
-        public Dictionary<int, object> SequenceNumberToObjectMap
-        {
-            get
-            {
-                if (this.sequenceNumberToObjectMap == null)
-                {
-                    this.sequenceNumberToObjectMap = new Dictionary<int, object>();
-                }
-
-                return this.sequenceNumberToObjectMap;
-            }
-        }
-
-        private HashSet<object> VisitedObjects
-        {
-            get
-            {
-                if (this.visitedObjects == null)
-                {
-                    this.visitedObjects = new HashSet<object>();
-                }
-
-                return this.visitedObjects;
-            }
-        }
-
-        public override bool Read()
-        {
-            bool readResult = base.Read();
-
-            if (readResult)
-            {
-                switch (this.NodeType)
-                {
-                    case XamlNodeType.StartObject:
-                        this.objects.Push(this.Instance);
-                        this.MapObjectWithSequenceNumber(this.Instance);
-                        break;
-                    case XamlNodeType.GetObject:
-                        this.objects.Push(this.Instance);
-                        break;
-                    case XamlNodeType.EndObject:
-                        this.objects.Pop();
-                        break;
-                    case XamlNodeType.StartMember:
-                        this.xamlMember = this.Member;
-                        break;
-                    case XamlNodeType.EndMember:
-                        this.xamlMember = null;
-                        break;
-                    case XamlNodeType.Value:
-                        this.MapObjectWithSequenceNumber(this.GetRealObject());
-                        break;
-                }
-            }
-
-            return readResult;
-        }
-
-        // Current Node contains the value after original object is serialized to a ValueNode, this method
-        // try to get the original object before it is serialized.
-        private object GetRealObject()
-        {
-            if (this.Value is string)
-            {
-                object parent = this.objects.Peek();
-
-                if (parent == null)
-                {
-                    return null;
-                }
-
-                // handle <InArgument x:TypeArguments="...">[expression]</InArgument>
-                if (this.xamlMember == XamlLanguage.Initialization)
-                {
-                    Argument argument = parent as Argument;
-                    if (argument != null)
-                    {
-                        return argument.Expression;
-                    }
-
-                    return null;
-                }
-
-                if (this.xamlMember == null || !this.xamlMember.IsNameValid || this.xamlMember.IsAttachable || this.xamlMember.IsDirective)
-                {
-                    return null;
-                }
-
-                // handle <x:Array Type="x:Int32"><x:Int32>1</x:Int32>...</x:Array>, type is not limited to x:Int32
-                // Here property.DeclaringType would be ArrayExtension, while parent would be a real array (System.Int32[]), 
-                // calling property.GetValue(parent, null) would cause a TargetException since the type and object doesn't match.
-                // So stop further processing for ArrayExtension.
-                if (this.xamlMember.DeclaringType == XamlLanguage.Array)
-                {
-                    // We can get the element type by parent.GetType().GetElementType(),
-                    // but we really don't care about that, so just return null.
-                    return null;
-                }
-
-                PropertyInfo property = this.xamlMember.UnderlyingMember as PropertyInfo;
-
-                if (property == null || !property.CanRead)
-                {
-                    return null;
-                }
-
-                object realObject = property.GetValue(parent, null);
-
-                // NOTE this is to handle argument containing an IValueSerializable expression
-                // this logic should be kept the same as that in System.Activities.Debugger.XamlDebuggerXmlReader.NotifySourceLocationFound.
-                Argument argumentObject = realObject as Argument;
-                if (argumentObject != null && argumentObject.Expression is IValueSerializableExpression)
-                {
-                    realObject = argumentObject.Expression;
-                }
-
-                return realObject;
-            }
-
-            return this.Value;
-        }
-
-        private void MapObjectWithSequenceNumber(object mappedObject)
-        {
-            if (mappedObject == null)
-            {
-                return;
-            }
-
-            if (!this.VisitedObjects.Contains(mappedObject) && !(mappedObject is string))
-            {
-                this.VisitedObjects.Add(mappedObject);
-                this.SequenceNumberToObjectMap.Add(this.sequenceNumber, mappedObject);
-                this.sequenceNumber++;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlTypeKind.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlTypeKind.cs
deleted file mode 100644 (file)
index bf1bf11..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    internal enum XamlTypeKind
-    {
-        Unknown, // I don't understand this type
-        PartialSupported, // I understand this type if you would like to remove some new properties
-        FullySupported, // I understand this type
-    }
-}
\ No newline at end of file
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlTypeWithExplicitNamespace.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlTypeWithExplicitNamespace.cs
deleted file mode 100644 (file)
index 4515008..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System.Collections.Generic;
-    using System.Xaml;
-
-    class XamlTypeWithExplicitNamespace : XamlType
-    {
-        List<string> explicitNamespaces;
-
-        public XamlTypeWithExplicitNamespace(XamlType wrapped, IEnumerable<string> explicitNamespaces) :
-            base(wrapped.UnderlyingType, wrapped.SchemaContext)
-        {
-            this.explicitNamespaces = new List<string>(explicitNamespaces);
-        }
-
-        public override IList<string> GetXamlNamespaces()
-        {
-            return this.explicitNamespaces;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlTypeWithExtraPropertiesRemoved.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlTypeWithExtraPropertiesRemoved.cs
deleted file mode 100644 (file)
index f021f98..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Xaml;
-
-    internal class XamlTypeWithExtraPropertiesRemoved : XamlType
-    {
-        private ICollection<string> propertiesToBeRemoved;
-
-        public XamlTypeWithExtraPropertiesRemoved(Type underlyingType, XamlSchemaContext schemaContext, ICollection<string> propertiesToBeRemoved)
-            : base(underlyingType, schemaContext)
-        {
-            this.propertiesToBeRemoved = propertiesToBeRemoved;
-        }
-
-        protected override XamlMember LookupMember(string name, bool skipReadOnlyCheck)
-        {
-            if (this.propertiesToBeRemoved.Contains(name))
-            {
-                return null;
-            }
-
-            return base.LookupMember(name, skipReadOnlyCheck);
-        }
-
-        protected override IEnumerable<XamlMember> LookupAllMembers()
-        {
-            List<XamlMember> members = new List<XamlMember>();
-
-            foreach (XamlMember member in base.LookupAllMembers())
-            {
-                if (!this.propertiesToBeRemoved.Contains(member.Name))
-                {
-                    members.Add(member);
-                }
-            }
-
-            return members;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlWriterExtensions.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlWriterExtensions.cs
deleted file mode 100644 (file)
index 8b73e31..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities.Presentation.Xaml
-{
-    using System.Xaml;
-
-    // 
-    internal static class XamlWriterExtensions
-    {
-        public static void PropagateLineInfo(XamlWriter targetWriter, IXamlLineInfo lineInfo)
-        {
-            if (lineInfo != null)
-            {
-                IXamlLineInfoConsumer consumer = targetWriter as IXamlLineInfoConsumer;
-                SharedFx.Assert(consumer != null && consumer.ShouldProvideLineInfo, "Should only call this function to write into a XamlNodeQueue.Writer, which is always IXamlLineInfoConsumer");
-                consumer.SetLineInfo(lineInfo.LineNumber, lineInfo.LinePosition);
-            }
-        }
-
-        public static void PropagateLineInfo(XamlWriter targetWriter, int lineNumber, int linePosition)
-        {
-            IXamlLineInfoConsumer consumer = targetWriter as IXamlLineInfoConsumer;
-            SharedFx.Assert(consumer != null && consumer.ShouldProvideLineInfo, "Should only call this function to write into a XamlNodeQueue.Writer, which is always IXamlLineInfoConsumer");
-            consumer.SetLineInfo(lineNumber, linePosition);
-        }
-
-        // This method is a workaround for TFS bug #788190, since XamlReader.ReadSubtree() should (but doesn't) preserve IXamlLineInfo on the subreader
-        public static void Transform(XamlReader reader, XamlWriter writer, IXamlLineInfo readerLineInfo, bool closeWriter)
-        {
-            IXamlLineInfoConsumer consumer = writer as IXamlLineInfoConsumer;
-            SharedFx.Assert(consumer != null && consumer.ShouldProvideLineInfo, "Should only call this function to write into a XamlNodeQueue.Writer, which is always IXamlLineInfoConsumer");
-            bool shouldPassLineNumberInfo = false;
-            if (readerLineInfo != null)
-            {
-                shouldPassLineNumberInfo = true;
-            }
-
-            while (reader.Read())
-            {
-                if (shouldPassLineNumberInfo)
-                {
-                    consumer.SetLineInfo(readerLineInfo.LineNumber, readerLineInfo.LinePosition);
-                }
-
-                writer.WriteNode(reader);
-            }
-
-            if (closeWriter)
-            {
-                writer.Close();
-            }
-        }
-
-        public static void WriteNode(this XamlWriter writer, XamlReader reader, IXamlLineInfo lineInfo)
-        {
-            PropagateLineInfo(writer, lineInfo);
-            writer.WriteNode(reader);
-        }
-
-        public static void WriteEndMember(this XamlWriter writer, IXamlLineInfo lineInfo)
-        {
-            PropagateLineInfo(writer, lineInfo);
-            writer.WriteEndMember();
-        }
-
-        public static void WriteEndObject(this XamlWriter writer, IXamlLineInfo lineInfo)
-        {
-            PropagateLineInfo(writer, lineInfo);
-            writer.WriteEndObject();
-        }
-
-        public static void WriteGetObject(this XamlWriter writer, IXamlLineInfo lineInfo)
-        {
-            PropagateLineInfo(writer, lineInfo);
-            writer.WriteGetObject();
-        }
-
-        public static void WriteNamespace(this XamlWriter writer, NamespaceDeclaration namespaceDeclaration, IXamlLineInfo lineInfo)
-        {
-            PropagateLineInfo(writer, lineInfo);
-            writer.WriteNamespace(namespaceDeclaration);
-        }
-
-        public static void WriteStartMember(this XamlWriter writer, XamlMember xamlMember, IXamlLineInfo lineInfo)
-        {
-            PropagateLineInfo(writer, lineInfo);
-            writer.WriteStartMember(xamlMember);
-        }
-
-        public static void WriteStartMember(this XamlWriter writer, XamlMember xamlMember, int lineNumber, int linePosition)
-        {
-            PropagateLineInfo(writer, lineNumber, linePosition);
-            writer.WriteStartMember(xamlMember);
-        }
-
-        public static void WriteStartObject(this XamlWriter writer, XamlType type, IXamlLineInfo lineInfo)
-        {
-            PropagateLineInfo(writer, lineInfo);
-            writer.WriteStartObject(type);
-        }
-
-        public static void WriteValue(this XamlWriter writer, object value, IXamlLineInfo lineInfo)
-        {
-            PropagateLineInfo(writer, lineInfo);
-            writer.WriteValue(value);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Tools/Common/Win32Interop.cs b/mcs/class/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Tools/Common/Win32Interop.cs
deleted file mode 100644 (file)
index 7386f83..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace Microsoft.Tools.Common
-{
-    using System;
-    using System.Runtime.InteropServices;
-    using System.Diagnostics.CodeAnalysis;
-
-    
-    internal static class Win32Interop
-    {
-        public const int WM_SETICON = 0x80;
-        public const int WM_NCHITTEST = 0x84;
-        public const int WM_SYSCOMMAND = 0x0112;
-
-        public const int GWL_STYLE = -16;
-        public const int WS_MAXIMIZEBOX = 0x00010000;
-        public const int WS_MINIMIZEBOX = 0x00020000;
-        public const int WS_CLIPCHILDREN = 0x02000000;
-        public const int WS_CLIPSIBLINGS = 0x04000000;
-
-        public const int GWL_EXSTYLE = -20;
-        public const int WS_EX_DLGMODALFRAME = 0x00000001;
-        public const int WS_EX_CONTEXTHELP = 0x00000400;
-
-        public const int SC_CONTEXTHELP = 0xf180;
-
-        public const int ICON_SMALL = 0;
-        public const int ICON_BIG = 1;
-        
-
-        [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "This class is shared by various projects and may not be used by a specific project")]
-        [StructLayout(LayoutKind.Sequential)]
-        public sealed class POINT
-        {
-            public int x;
-            public int y;
-
-            public POINT()
-            {
-                this.x = 0;
-                this.y = 0;
-            }
-
-            public POINT(int x, int y)
-            {
-                this.x = x;
-                this.y = y;
-            }
-        }
-
-        internal static void MakeWindowClipSiblingsAndChildren(HandleRef hwnd)
-        {
-            IntPtr windowStyle = Win32Interop.GetWindowLongPtr(hwnd.Handle, Win32Interop.GWL_STYLE);
-            if (IntPtr.Size == 4)
-            {
-                windowStyle = new IntPtr(windowStyle.ToInt32() | Win32Interop.WS_CLIPSIBLINGS | Win32Interop.WS_CLIPCHILDREN);
-            }
-            else
-            {
-                windowStyle = new IntPtr(windowStyle.ToInt64() | ((long)Win32Interop.WS_CLIPSIBLINGS) | ((long)Win32Interop.WS_CLIPCHILDREN));
-            }
-            Win32Interop.SetWindowLongPtr(hwnd, Win32Interop.GWL_STYLE, (IntPtr)windowStyle);
-        }
-
-        // This static method is required because legacy OSes do not support
-        // SetWindowLongPtr
-        internal static IntPtr SetWindowLongPtr(HandleRef hWnd, int nIndex, IntPtr dwNewLong)
-        {
-            if (IntPtr.Size == 8)
-                return SetWindowLongPtr64(hWnd, nIndex, dwNewLong);
-            else
-                return new IntPtr(SetWindowLong32(hWnd, nIndex, dwNewLong.ToInt32()));
-        }
-
-
-        // This static method is required because Win32 does not support
-        // GetWindowLongPtr directly
-        public static IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex)
-        {
-            if (IntPtr.Size == 8)
-                return GetWindowLongPtr64(hWnd, nIndex);
-            else
-                return GetWindowLongPtr32(hWnd, nIndex);
-        }
-
-        [DllImport("user32.dll", EntryPoint = "SetWindowLong")]
-        private static extern int SetWindowLong32(HandleRef hWnd, int nIndex, int dwNewLong);
-
-        [DllImport("user32.dll", EntryPoint = "SetWindowLongPtr")]
-        private static extern IntPtr SetWindowLongPtr64(HandleRef hWnd, int nIndex, IntPtr dwNewLong);
-
-        [SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", MessageId = "return", Justification = "Calling code is expected to handle the different size of IntPtr")]
-        [DllImport("user32.dll", EntryPoint = "GetWindowLong")]
-        private static extern IntPtr GetWindowLongPtr32(IntPtr hWnd, int nIndex);
-
-        [DllImport("user32.dll", EntryPoint = "GetWindowLongPtr")]
-        private static extern IntPtr GetWindowLongPtr64(IntPtr hWnd, int nIndex);
-
-        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This function is shared by various projects and may not be used by a specific project")]
-        [DllImport("user32.dll")]
-        public static extern IntPtr SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);
-
-        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This function is shared by various projects and may not be used by a specific project")]
-        [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
-        public static extern IntPtr GetActiveWindow();
-
-        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This function is shared by various projects and may not be used by a specific project")]
-        [System.Runtime.InteropServices.DllImport("gdi32.dll")]
-        public static extern bool DeleteObject(IntPtr hObject);
-
-        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This function is shared by various projects and may not be used by a specific project")]
-        [DllImport("User32", EntryPoint = "ScreenToClient", SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)]
-        public static extern int ScreenToClient(IntPtr hWnd, [In, Out] POINT pt);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/README.md b/mcs/class/referencesource/System.Activities.Presentation/README.md
new file mode 100644 (file)
index 0000000..a7d7bf7
--- /dev/null
@@ -0,0 +1,4 @@
+This folder was removed from Mono's copy of referencesource
+since the long file/directory paths caused issues on Windows.
+
+Check the upstream referencesource repo for the original code.
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/AssemblyInfo.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/AssemblyInfo.cs
deleted file mode 100644 (file)
index ca3227c..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Runtime.CompilerServices;
-using System.Windows;
-using System.Windows.Markup;
-using System.Diagnostics.CodeAnalysis;
-
-[assembly: XmlnsDefinition(NameSpaces.Toolbox, "System.Activities.Presentation.Toolbox")]
-[assembly: XmlnsDefinition(NameSpaces.Design, "System.Activities.Presentation")]
-[assembly: XmlnsDefinition(NameSpaces.Design, "System.Activities.Presentation.View")]
-[assembly: XmlnsDefinition(NameSpaces.Design2010, "System.Activities.Presentation.Annotations")]
-[assembly: XmlnsDefinition(NameSpaces.Design2010, "System.Activities.Presentation.Expressions")]
-[assembly: XmlnsDefinition(NameSpaces.Design2010, "System.Activities.Presentation.ViewState")]
-[assembly: XmlnsPrefix(NameSpaces.Design, NameSpaces.DesignPrefix)]
-[assembly: XmlnsPrefix(NameSpaces.Design2010, NameSpaces.Design2010Prefix)]
-[assembly: XmlnsPrefix(NameSpaces.Mc, NameSpaces.McPrefix)]
-
-[assembly: InternalsVisibleTo("CIT.System.Activities.Core.Design, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
-[assembly: InternalsVisibleTo("System.Activities.Core.Presentation, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
-[assembly: InternalsVisibleTo("System.Activities.Presentation.UnitTest, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
-
-[assembly: ThemeInfo(ResourceDictionaryLocation.SourceAssembly, ResourceDictionaryLocation.SourceAssembly)]
-[assembly: SuppressMessage("Microsoft.MSInternal", "CA904:DeclareTypesInMicrosoftOrSystemNamespace", Scope = "namespace", Target = "XamlGeneratedNamespace", Justification = "Xaml Generated")]
-[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "namespace", Target = "System.Activities.Presentation.Sqm", Justification = "False positive for SQM")]
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/Microsoft/Activities/Presentation/SharedFx.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/Microsoft/Activities/Presentation/SharedFx.cs
deleted file mode 100644 (file)
index b070aea..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace Microsoft.Activities
-{
-    using System;
-    using System.Runtime;
-
-    internal static class SharedFx
-    {
-        internal static bool IsFatal(Exception exception)
-        {
-            return Fx.IsFatal(exception);
-        }
-
-        internal static void Assert(bool condition, string messageText)
-        {
-            Fx.Assert(condition, messageText);
-        }
-
-        internal static void Assert(string messageText)
-        {
-            Fx.Assert(messageText);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/Microsoft/Activities/Presentation/SharedSR.Designer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/Microsoft/Activities/Presentation/SharedSR.Designer.cs
deleted file mode 100644 (file)
index f499130..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.1
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace Microsoft.Activities.Presentation {
-    using System;
-    
-    
-    /// <summary>
-    ///   A strongly-typed resource class, for looking up localized strings, etc.
-    /// </summary>
-    // This class was auto-generated by the StronglyTypedResourceBuilder
-    // class via a tool like ResGen or Visual Studio.
-    // To add or remove a member, edit your .ResX file then rerun ResGen
-    // with the /str option, or rebuild your VS project.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class SharedSR {
-        
-        private static global::System.Resources.ResourceManager resourceMan;
-        
-        private static global::System.Globalization.CultureInfo resourceCulture;
-        
-        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal SharedSR() {
-        }
-        
-        /// <summary>
-        ///   Returns the cached ResourceManager instance used by this class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager {
-            get {
-                if (object.ReferenceEquals(resourceMan, null)) {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Activities.Presentation.Microsoft.Activities.Presentation.SharedSR", typeof(SharedSR).Assembly);
-                    resourceMan = temp;
-                }
-                return resourceMan;
-            }
-        }
-        
-        /// <summary>
-        ///   Overrides the current thread's CurrentUICulture property for all
-        ///   resource lookups using this strongly typed resource class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture {
-            get {
-                return resourceCulture;
-            }
-            set {
-                resourceCulture = value;
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The file format is not compatible with current targeting framework. To convert the file format, please explicitly save the file. This error message will go away after you save the file and reopen the designer..
-        /// </summary>
-        internal static string FileFormatError {
-            get {
-                return ResourceManager.GetString("FileFormatError", resourceCulture);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/SR.Designer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/SR.Designer.cs
deleted file mode 100644 (file)
index 44e2b3b..0000000
+++ /dev/null
@@ -1,1174 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.17273
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace System.Activities.Presentation {
-    using System;
-    
-    
-    /// <summary>
-    ///   A strongly-typed resource class, for looking up localized strings, etc.
-    /// </summary>
-    // This class was auto-generated by the StronglyTypedResourceBuilder
-    // class via a tool like ResGen or Visual Studio.
-    // To add or remove a member, edit your .ResX file then rerun ResGen
-    // with the /str option, or rebuild your VS project.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class SR {
-        
-        private static global::System.Resources.ResourceManager resourceMan;
-        
-        private static global::System.Globalization.CultureInfo resourceCulture;
-        
-        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal SR() {
-        }
-        
-        /// <summary>
-        ///   Returns the cached ResourceManager instance used by this class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager {
-            get {
-                if (object.ReferenceEquals(resourceMan, null)) {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Activities.Presentation.SR", typeof(SR).Assembly);
-                    resourceMan = temp;
-                }
-                return resourceMan;
-            }
-        }
-        
-        /// <summary>
-        ///   Overrides the current thread's CurrentUICulture property for all
-        ///   resource lookups using this strongly typed resource class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture {
-            get {
-                return resourceCulture;
-            }
-            set {
-                resourceCulture = value;
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Activity could not be loaded because of errors in the XAML..
-        /// </summary>
-        internal static string ActivityLoadError {
-            get {
-                return ResourceManager.GetString("ActivityLoadError", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Add Annotation.
-        /// </summary>
-        internal static string AddAnnotationDescription {
-            get {
-                return ResourceManager.GetString("AddAnnotationDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Add Annotation.
-        /// </summary>
-        internal static string AddAnnotationTitle {
-            get {
-                return ResourceManager.GetString("AddAnnotationTitle", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The Getter method of an Argument Accessor for Activity &apos;{0}&apos; threw an exception:
-        ///{1}.
-        /// </summary>
-        internal static string ArgumentAccessorGetterThrewException {
-            get {
-                return ResourceManager.GetString("ArgumentAccessorGetterThrewException", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The Setter method of an Argument Accessor for Activity &apos;{0}&apos; threw an exception:
-        ///{1}.
-        /// </summary>
-        internal static string ArgumentAccessorSetterThrewException {
-            get {
-                return ResourceManager.GetString("ArgumentAccessorSetterThrewException", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Attached property&apos;s name should not be empty or null..
-        /// </summary>
-        internal static string AttachedPropertyNameShouldNotBeEmpty {
-            get {
-                return ResourceManager.GetString("AttachedPropertyNameShouldNotBeEmpty", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Bounds must have non zero width and height..
-        /// </summary>
-        internal static string BoundsMustBeNonZero {
-            get {
-                return ResourceManager.GetString("BoundsMustBeNonZero", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Cannot construct line segment between point {0} and point {1}..
-        /// </summary>
-        internal static string CannotConstructConnectionSegment {
-            get {
-                return ResourceManager.GetString("CannotConstructConnectionSegment", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Cannot create an instance of &quot;{0}&quot;..
-        /// </summary>
-        internal static string CannotCreateInstance {
-            get {
-                return ResourceManager.GetString("CannotCreateInstance", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Failed to get Argument Accessors from Activity &apos;{0}&apos;
-        ///{1}..
-        /// </summary>
-        internal static string CannotGetArgumentAccessorsForActivity {
-            get {
-                return ResourceManager.GetString("CannotGetArgumentAccessorsForActivity", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Some data would be lost by changing type argument. Do you want to continue?.
-        /// </summary>
-        internal static string CannotMorphExpression {
-            get {
-                return ResourceManager.GetString("CannotMorphExpression", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The default value will be cleared with this change, do you want to continue?.
-        /// </summary>
-        internal static string CannotPreserveDefaultValue {
-            get {
-                return ResourceManager.GetString("CannotPreserveDefaultValue", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Namespace &apos;{0}&apos; cannot be resolved..
-        /// </summary>
-        internal static string CannotResolveNamespace {
-            get {
-                return ResourceManager.GetString("CannotResolveNamespace", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Cannot enable annotation when target framework is lower than 4.5.
-        /// </summary>
-        internal static string CantEnableAnnotationBefore45 {
-            get {
-                return ResourceManager.GetString("CantEnableAnnotationBefore45", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to One or more children have validation errors or warnings..
-        /// </summary>
-        internal static string ChildValidationError {
-            get {
-                return ResourceManager.GetString("ChildValidationError", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Collection Add.
-        /// </summary>
-        internal static string CollectionAddEditingScopeDescription {
-            get {
-                return ResourceManager.GetString("CollectionAddEditingScopeDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Collection Clear.
-        /// </summary>
-        internal static string CollectionClearEditingScopeDescription {
-            get {
-                return ResourceManager.GetString("CollectionClearEditingScopeDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Collection is read-only..
-        /// </summary>
-        internal static string CollectionIsReadOnly {
-            get {
-                return ResourceManager.GetString("CollectionIsReadOnly", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Collection Remove.
-        /// </summary>
-        internal static string CollectionRemoveEditingScopeDescription {
-            get {
-                return ResourceManager.GetString("CollectionRemoveEditingScopeDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Could not change value after initialization..
-        /// </summary>
-        internal static string CouldNotChangeValueAfterInitialization {
-            get {
-                return ResourceManager.GetString("CouldNotChangeValueAfterInitialization", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Could not generate view for {0}..
-        /// </summary>
-        internal static string CouldNotGenerateView {
-            get {
-                return ResourceManager.GetString("CouldNotGenerateView", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to This property could not be set after workflow designer is loaded. To fix the problem, please set this property before loading the workflow designer..
-        /// </summary>
-        internal static string CouldNotSetPropertyAfterLoad {
-            get {
-                return ResourceManager.GetString("CouldNotSetPropertyAfterLoad", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Activities that cannot be rendered in the designer cannot be cut or copied..
-        /// </summary>
-        internal static string CutCopyErrorActivityMessage {
-            get {
-                return ResourceManager.GetString("CutCopyErrorActivityMessage", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Cut-copy-paste feature requires DesignerView to be present..
-        /// </summary>
-        internal static string CutCopyRequiresDesignerView {
-            get {
-                return ResourceManager.GetString("CutCopyRequiresDesignerView", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Cut.
-        /// </summary>
-        internal static string CutOperationEditingScopeDescription {
-            get {
-                return ResourceManager.GetString("CutOperationEditingScopeDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to http://msdn.microsoft.com/library/dd489402.aspx.
-        /// </summary>
-        internal static string DefaultHelpUrl {
-            get {
-                return ResourceManager.GetString("DefaultHelpUrl", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Are you sure you want to delete all annotations in the workflow?.
-        /// </summary>
-        internal static string DeleteAllAnnotationMessage {
-            get {
-                return ResourceManager.GetString("DeleteAllAnnotationMessage", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Delete All Annotations.
-        /// </summary>
-        internal static string DeleteAllAnnotationsDescription {
-            get {
-                return ResourceManager.GetString("DeleteAllAnnotationsDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Delete Annotation.
-        /// </summary>
-        internal static string DeleteAnnotationDescription {
-            get {
-                return ResourceManager.GetString("DeleteAnnotationDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Delete Annotation.
-        /// </summary>
-        internal static string DeleteAnnotationTitle {
-            get {
-                return ResourceManager.GetString("DeleteAnnotationTitle", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Delete.
-        /// </summary>
-        internal static string DeleteOperationEditingScopeDescription {
-            get {
-                return ResourceManager.GetString("DeleteOperationEditingScopeDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to DesignTimeValidationFeature &apos;{0}&apos; could only apply to type &apos;{1}&apos;, not type &apos;{2}&apos;..
-        /// </summary>
-        internal static string DesignTimeValidationFeatureOnlyAppliesToType {
-            get {
-                return ResourceManager.GetString("DesignTimeValidationFeatureOnlyAppliesToType", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Dictionary Add.
-        /// </summary>
-        internal static string DictionaryAddEditingScopeDescription {
-            get {
-                return ResourceManager.GetString("DictionaryAddEditingScopeDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Dictionary Clear.
-        /// </summary>
-        internal static string DictionaryClearEditingScopeDescription {
-            get {
-                return ResourceManager.GetString("DictionaryClearEditingScopeDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Dictionary Edit.
-        /// </summary>
-        internal static string DictionaryEditEditingScopeDescription {
-            get {
-                return ResourceManager.GetString("DictionaryEditEditingScopeDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Dictionary Remove.
-        /// </summary>
-        internal static string DictionaryRemoveEditingScopeDescription {
-            get {
-                return ResourceManager.GetString("DictionaryRemoveEditingScopeDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Multiple items are dragged and dropped. DragDropHelper.SetDragDropMovedViewElements should have been called to indicate the WorkflowViewElements that are moved..
-        /// </summary>
-        internal static string DraggingMulitpleItemsError {
-            get {
-                return ResourceManager.GetString("DraggingMulitpleItemsError", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to There is already an argument named &apos;{0}&apos; defined. Please choose a different name..
-        /// </summary>
-        internal static string DuplicateArgumentName {
-            get {
-                return ResourceManager.GetString("DuplicateArgumentName", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to &apos;{0}&apos; is already declared in this scope. Identifiers are case-insensitive..
-        /// </summary>
-        internal static string DuplicateIdentifier {
-            get {
-                return ResourceManager.GetString("DuplicateIdentifier", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to An item with the same key has already been added..
-        /// </summary>
-        internal static string DuplicateKey {
-            get {
-                return ResourceManager.GetString("DuplicateKey", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Member &apos;{0}&apos; has already been set on this object..
-        /// </summary>
-        internal static string DuplicateMember {
-            get {
-                return ResourceManager.GetString("DuplicateMember", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Duplicate name: &apos;{0}&apos;..
-        /// </summary>
-        internal static string DuplicateName {
-            get {
-                return ResourceManager.GetString("DuplicateName", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to There is already a variable named &apos;{0}&apos;  in this scope. Please choose a different name..
-        /// </summary>
-        internal static string DuplicateVariableName {
-            get {
-                return ResourceManager.GetString("DuplicateVariableName", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Edit Annotation.
-        /// </summary>
-        internal static string EditAnnotationTitle {
-            get {
-                return ResourceManager.GetString("EditAnnotationTitle", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Element representation expected.
-        /// </summary>
-        internal static string ElementRepresentationExpected {
-            get {
-                return ResourceManager.GetString("ElementRepresentationExpected", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Element representation expected at {0}, {1}.
-        /// </summary>
-        internal static string ElementRepresentationExpectedAt {
-            get {
-                return ResourceManager.GetString("ElementRepresentationExpectedAt", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Argument cannot have empty name..
-        /// </summary>
-        internal static string EmptyArgumentName {
-            get {
-                return ResourceManager.GetString("EmptyArgumentName", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Variable cannot have empty name..
-        /// </summary>
-        internal static string EmptyVariableName {
-            get {
-                return ResourceManager.GetString("EmptyVariableName", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Invalidate return value from SortSelectedItems. The items returned must be the same as the items passed in except the order.
-        /// </summary>
-        internal static string Error_BadOutputFromSortSelectedItems {
-            get {
-                return ResourceManager.GetString("Error_BadOutputFromSortSelectedItems", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Trying to sort some item that is not in the view..
-        /// </summary>
-        internal static string Error_CantFindItemInWIsP {
-            get {
-                return ResourceManager.GetString("Error_CantFindItemInWIsP", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Item &apos;{0}&apos; is not on view..
-        /// </summary>
-        internal static string Error_ItemNotOnView {
-            get {
-                return ResourceManager.GetString("Error_ItemNotOnView", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Moving more than one items from ICompositeView. Implement OnItemsMoved in ICompositeView..
-        /// </summary>
-        internal static string Error_MovingMoreThanOneItemsFromICompositeView {
-            get {
-                return ResourceManager.GetString("Error_MovingMoreThanOneItemsFromICompositeView", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to &apos;{0}&apos; doesn&apos;t have public default constructor which is required for a valid custom ExpressionActivityEditor..
-        /// </summary>
-        internal static string ExpressionActivityEditorRequiresDefaultConstructor {
-            get {
-                return ResourceManager.GetString("ExpressionActivityEditorRequiresDefaultConstructor", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Enter a VB expression.
-        /// </summary>
-        internal static string ExpressionDefaultText {
-            get {
-                return ResourceManager.GetString("ExpressionDefaultText", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Cannot convert the generated expression from type ‘{0}’ to ‘{1}’..
-        /// </summary>
-        internal static string ExpressionTypeDonnotMatch {
-            get {
-                return ResourceManager.GetString("ExpressionTypeDonnotMatch", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Parameterless construction is not supported..
-        /// </summary>
-        internal static string InvalidConstructorCall {
-            get {
-                return ResourceManager.GetString("InvalidConstructorCall", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to {0} is not a valid expression editor name, which cannot be null or white spaces only..
-        /// </summary>
-        internal static string InvalidExpressionEditorName {
-            get {
-                return ResourceManager.GetString("InvalidExpressionEditorName", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to {0} is not a valid expression editor name, which cannot be white spaces only..
-        /// </summary>
-        internal static string InvalidExpressionEditorNameToSet {
-            get {
-                return ResourceManager.GetString("InvalidExpressionEditorNameToSet", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to {0} is not a valid expression editor type, which must be a derived class of {1}..
-        /// </summary>
-        internal static string InvalidExpressionEditorType {
-            get {
-                return ResourceManager.GetString("InvalidExpressionEditorType", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to {0} is not a valid type, which must be a derive class of {1}..
-        /// </summary>
-        internal static string InvalidExpressionMorphHelperType {
-            get {
-                return ResourceManager.GetString("InvalidExpressionMorphHelperType", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to {0} is not a valid value for {1}..
-        /// </summary>
-        internal static string InvalidFlagName {
-            get {
-                return ResourceManager.GetString("InvalidFlagName", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to &apos;{0}&apos; is not a valid identifier. It may contain invalid characters or it is a reserved keyword..
-        /// </summary>
-        internal static string InvalidIdentifier {
-            get {
-                return ResourceManager.GetString("InvalidIdentifier", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Call to BeginEdit() with shouldApplyChangesImmediately=true cannot be nested inside another EditingScope or another call to BeginEdit()..
-        /// </summary>
-        internal static string InvalidNestedModelItemBeginEditExceptionMessage {
-            get {
-                return ResourceManager.GetString("InvalidNestedModelItemBeginEditExceptionMessage", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to &apos;{0}&apos; is not a valid XAML member name..
-        /// </summary>
-        internal static string InvalidXamlMemberName {
-            get {
-                return ResourceManager.GetString("InvalidXamlMemberName", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The given key was not present in the dictionary.
-        /// </summary>
-        internal static string KeyNotFound {
-            get {
-                return ResourceManager.GetString("KeyNotFound", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Member &apos;{0}&apos; already has content..
-        /// </summary>
-        internal static string MemberCanOnlyBeSetOnce {
-            get {
-                return ResourceManager.GetString("MemberCanOnlyBeSetOnce", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Incorrect Xaml Encountered. Attachable member &apos;{0}&apos; can only be set on types assignable from &apos;{1}&apos;.
-        /// </summary>
-        internal static string MemberOnBadTargetType {
-            get {
-                return ResourceManager.GetString("MemberOnBadTargetType", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to &quot;path&quot; should contain at least one element..
-        /// </summary>
-        internal static string ModelItemPathArrayShouldNotBeEmpty {
-            get {
-                return ResourceManager.GetString("ModelItemPathArrayShouldNotBeEmpty", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Item Move.
-        /// </summary>
-        internal static string MoveEditingScopeDescription {
-            get {
-                return ResourceManager.GetString("MoveEditingScopeDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Element of NamespaceList must be NamespaceData..
-        /// </summary>
-        internal static string NamespaceListArgumentMustBeNamespaceData {
-            get {
-                return ResourceManager.GetString("NamespaceListArgumentMustBeNamespaceData", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to NamespaceList could not accept duplicate namespaces..
-        /// </summary>
-        internal static string NamespaceListNoDuplicate {
-            get {
-                return ResourceManager.GetString("NamespaceListNoDuplicate", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Default parameterless constructor not found..
-        /// </summary>
-        internal static string NoDefaultCtorError {
-            get {
-                return ResourceManager.GetString("NoDefaultCtorError", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Cannot find an expression editor named &apos;{0}&apos;. .
-        /// </summary>
-        internal static string NonRegisteredExpressionEditor {
-            get {
-                return ResourceManager.GetString("NonRegisteredExpressionEditor", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Argument key is not of type string..
-        /// </summary>
-        internal static string NonSupportedDynamicArgumentKeyType {
-            get {
-                return ResourceManager.GetString("NonSupportedDynamicArgumentKeyType", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Argument type of parameters is not supported..
-        /// </summary>
-        internal static string NonSupportedDynamicArgumentType {
-            get {
-                return ResourceManager.GetString("NonSupportedDynamicArgumentType", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Data input of the dialog is neither ModelItemCollection nor ModelItemDictionary..
-        /// </summary>
-        internal static string NonSupportedModelItemCollectionOrDictionary {
-            get {
-                return ResourceManager.GetString("NonSupportedModelItemCollectionOrDictionary", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to ModelPropertyPathExpanderConverter doesn&apos;t support converting path string back to ModelProperty..
-        /// </summary>
-        internal static string NonSupportedModelPropertyPathExpanderConverterConvertBack {
-            get {
-                return ResourceManager.GetString("NonSupportedModelPropertyPathExpanderConverterConvertBack", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Collection &apos;{0}&apos; does not support text content..
-        /// </summary>
-        internal static string NoTextInCollection {
-            get {
-                return ResourceManager.GetString("NoTextInCollection", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Type &apos;{0}&apos; is not assignable to type &apos;{1}&apos; of member &apos;{2}&apos; and there is no TypeConverter defined on the member..
-        /// </summary>
-        internal static string NoTextInProperty {
-            get {
-                return ResourceManager.GetString("NoTextInProperty", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Notify Annotation Text Changed.
-        /// </summary>
-        internal static string NotifyAnnotationTextChangedDescription {
-            get {
-                return ResourceManager.GetString("NotifyAnnotationTextChangedDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The framework identifier &apos;{0}&apos; is not supported in the workflow designer. Please use &apos;.NET Framework&apos; or &apos;.NETFramework&apos; as identifier..
-        /// </summary>
-        internal static string NotSupportedFrameworkIdentifier {
-            get {
-                return ResourceManager.GetString("NotSupportedFrameworkIdentifier", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The framework profile &apos;{0}&apos; is not supported in the workflow designer. Please use empty or &apos;Client&apos; as profile value..
-        /// </summary>
-        internal static string NotSupportedFrameworkProfile {
-            get {
-                return ResourceManager.GetString("NotSupportedFrameworkProfile", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The .Net Framework {0} is not supported in the workflow designer..
-        /// </summary>
-        internal static string NotSupportedFrameworkVersion {
-            get {
-                return ResourceManager.GetString("NotSupportedFrameworkVersion", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Type &apos;{0}&apos; is not a valid toolbox type. Reason: {1}.
-        /// </summary>
-        internal static string NotSupportedToolboxTypeFormatString {
-            get {
-                return ResourceManager.GetString("NotSupportedToolboxTypeFormatString", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Type &apos;{0}&apos; cannot be initialized with text content because it does not have a TypeConverter..
-        /// </summary>
-        internal static string NoTypeConverter {
-            get {
-                return ResourceManager.GetString("NoTypeConverter", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Paste.
-        /// </summary>
-        internal static string PasteUndoDescription {
-            get {
-                return ResourceManager.GetString("PasteUndoDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Cannot find ShowInOutlineViewAttribute promoted property &apos;{0}&apos; on type: &apos;{1}&apos;. Specify an existing property of type: &apos;{1}&apos; as promoted property. If this promoted property is not required, remove it from ShowInOutlineViewAttribute() constructor..
-        /// </summary>
-        internal static string PromotedPropertyNotFound {
-            get {
-                return ResourceManager.GetString("PromotedPropertyNotFound", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Property Change.
-        /// </summary>
-        internal static string PropertyChangeEditingScopeDescription {
-            get {
-                return ResourceManager.GetString("PropertyChangeEditingScopeDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Property &apos;{0}&apos; does not exist.
-        /// </summary>
-        internal static string PropertyDoesntExistFormatString {
-            get {
-                return ResourceManager.GetString("PropertyDoesntExistFormatString", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Property is read-only..
-        /// </summary>
-        internal static string PropertyIsReadOnly {
-            get {
-                return ResourceManager.GetString("PropertyIsReadOnly", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Property Reference Change.
-        /// </summary>
-        internal static string PropertyReferenceChangeEditingScopeDescription {
-            get {
-                return ResourceManager.GetString("PropertyReferenceChangeEditingScopeDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Found in property &apos;{0}&apos;.
-        /// </summary>
-        internal static string SearchHintText {
-            get {
-                return ResourceManager.GetString("SearchHintText", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to See the Error List window for more details..
-        /// </summary>
-        internal static string SeeErrorWindow {
-            get {
-                return ResourceManager.GetString("SeeErrorWindow", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The provided SourceReferenceID &apos;{0}&apos; could not be found in the workflow..
-        /// </summary>
-        internal static string SourceReferenceIdNotFoundInWorkflow {
-            get {
-                return ResourceManager.GetString("SourceReferenceIdNotFoundInWorkflow", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Cannot modify ToolName or AssemblyName of already initialized ToolboxItem..
-        /// </summary>
-        internal static string ToolboxItemFrozenDescription {
-            get {
-                return ResourceManager.GetString("ToolboxItemFrozenDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The selected type could not be created..
-        /// </summary>
-        internal static string TypeBrowserError {
-            get {
-                return ResourceManager.GetString("TypeBrowserError", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Type Browser.
-        /// </summary>
-        internal static string TypeBrowserErrorMessageTitle {
-            get {
-                return ResourceManager.GetString("TypeBrowserErrorMessageTitle", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The supplied type &apos;{0}&apos; does not inherit from System.Activities.Activity..
-        /// </summary>
-        internal static string TypeDoesNotInheritFromActivity {
-            get {
-                return ResourceManager.GetString("TypeDoesNotInheritFromActivity", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Not all generic types could be resolved..
-        /// </summary>
-        internal static string TypeResolverError {
-            get {
-                return ResourceManager.GetString("TypeResolverError", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Type Resolver.
-        /// </summary>
-        internal static string TypeResolverErrorMessageTitle {
-            get {
-                return ResourceManager.GetString("TypeResolverErrorMessageTitle", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Select Types.
-        /// </summary>
-        internal static string TypeResolverWindowTitle {
-            get {
-                return ResourceManager.GetString("TypeResolverWindowTitle", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to defaultTypes should not contain null..
-        /// </summary>
-        internal static string TypeResolvingOptionsArgumentExceptionMessage {
-            get {
-                return ResourceManager.GetString("TypeResolvingOptionsArgumentExceptionMessage", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Type &apos;{0}&apos; is not assignable to item type &apos;{1}&apos; nor any other content type of collection &apos;{2}&apos;..
-        /// </summary>
-        internal static string UnassignableCollection {
-            get {
-                return ResourceManager.GetString("UnassignableCollection", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Type &apos;{0}&apos; is not assignable to type &apos;{1}&apos; of member &apos;{2}&apos;..
-        /// </summary>
-        internal static string UnassignableObject {
-            get {
-                return ResourceManager.GetString("UnassignableObject", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Bookmark is garbage collected without being committed or rolled back..
-        /// </summary>
-        internal static string UndoEngine_NotDisposedBookmark {
-            get {
-                return ResourceManager.GetString("UndoEngine_NotDisposedBookmark", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Operation &apos;{0}&apos; not allowed on disposed object..
-        /// </summary>
-        internal static string UndoEngine_OperationNotAllowed {
-            get {
-                return ResourceManager.GetString("UndoEngine_OperationNotAllowed", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Type &apos;{0}&apos; does not have a suitable TypeConverter or content property to handle this content..
-        /// </summary>
-        internal static string UnknownContent {
-            get {
-                return ResourceManager.GetString("UnknownContent", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Could not resolve type &apos;{0}&apos; because could not find one or more of its type arguments..
-        /// </summary>
-        internal static string UnresolvedGenericType {
-            get {
-                return ResourceManager.GetString("UnresolvedGenericType", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Could not find member &apos;{0}&apos; in type &apos;{1}&apos;..
-        /// </summary>
-        internal static string UnresolvedMember {
-            get {
-                return ResourceManager.GetString("UnresolvedMember", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Could not resolve name: &apos;{0}&apos;..
-        /// </summary>
-        internal static string UnresolvedName {
-            get {
-                return ResourceManager.GetString("UnresolvedName", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Could not find type &apos;{0}&apos; in assembly &apos;{1}&apos;..
-        /// </summary>
-        internal static string UnresolvedTypeInAssembly {
-            get {
-                return ResourceManager.GetString("UnresolvedTypeInAssembly", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Could not find type &apos;{0}&apos; in namespace &apos;{1}&apos;..
-        /// </summary>
-        internal static string UnresolvedTypeInNamespace {
-            get {
-                return ResourceManager.GetString("UnresolvedTypeInNamespace", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Value was set in XAML..
-        /// </summary>
-        internal static string UnsupportedExpressionHintText {
-            get {
-                return ResourceManager.GetString("UnsupportedExpressionHintText", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The file &apos;{0}&apos; may have come from a location that isn&apos;t fully trusted. It could present a security risk by opening the file that could cause damage to your computer or compromise your private information.
-        ///To avoid this exception, please do the security check first (you can refer this link http://msdn.microsoft.com/library/system.security.permissionset.aspx to get information about IsUnrestricted check) and turn on LoadingFromUntrustedSourceEnabled by setting DesignerConfigurationService.LoadingFromUntruste [rest of string was truncated]&quot;;.
-        /// </summary>
-        internal static string UntrustedSourceDetected {
-            get {
-                return ResourceManager.GetString("UntrustedSourceDetected", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Update parameters.
-        /// </summary>
-        internal static string UpdateDynamicArgumentsDescription {
-            get {
-                return ResourceManager.GetString("UpdateDynamicArgumentsDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Design time validation is turned off. Validation occurs only at runtime. To validate your workflow, either enable validation by modifying the registry key[HKCU\Software\Microsoft\.NETFramework\v[assembly version]\System.Activities.Presentation\DisableValidateOnModelItemChanged] and reopening the designer or call ActivityValidationServices.Validate() on an instance of your workflow..
-        /// </summary>
-        internal static string ValidationDisabledWarning {
-            get {
-                return ResourceManager.GetString("ValidationDisabledWarning", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to View State Change.
-        /// </summary>
-        internal static string ViewStateUndoUnitDescription {
-            get {
-                return ResourceManager.GetString("ViewStateUndoUnitDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Warning: {0}.
-        /// </summary>
-        internal static string WarningFormat {
-            get {
-                return ResourceManager.GetString("WarningFormat", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Workflow Designer.
-        /// </summary>
-        internal static string WorkflowDesignerErrorPresenterTitle {
-            get {
-                return ResourceManager.GetString("WorkflowDesignerErrorPresenterTitle", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Load should be called before calling this method..
-        /// </summary>
-        internal static string WorkflowDesignerLoadShouldBeCalledFirst {
-            get {
-                return ResourceManager.GetString("WorkflowDesignerLoadShouldBeCalledFirst", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Load should be called only once during the lifetime of a workflow designer object..
-        /// </summary>
-        internal static string WorkflowDesignerLoadShouldBeCalledOnlyOnce {
-            get {
-                return ResourceManager.GetString("WorkflowDesignerLoadShouldBeCalledOnlyOnce", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Value of Text property should not be empty or null..
-        /// </summary>
-        internal static string WorkflowDesignerTextShouldNotBeNull {
-            get {
-                return ResourceManager.GetString("WorkflowDesignerTextShouldNotBeNull", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Wrap in Sequence.
-        /// </summary>
-        internal static string WrapInSequenceDescription {
-            get {
-                return ResourceManager.GetString("WrapInSequenceDescription", resourceCulture);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ActivityDelegateInfo.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ActivityDelegateInfo.cs
deleted file mode 100644 (file)
index 15cf387..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Metadata;
-    using System.Activities.Presentation.Model;
-
-    internal class ActivityDelegateInfo : IActivityDelegateFactory
-    {
-        public ActivityDelegateInfo(ModelItem modelItem, string propertyName)
-        {
-            this.ModelItem = modelItem;
-            this.PropertyName = propertyName;
-            this.DelegateType = this.ModelItem.Properties[this.PropertyName].PropertyType;
-        }
-
-        public ModelItem ModelItem { get; private set; }
-
-        public string PropertyName { get; private set; }
-        
-        public Type DelegateType { get; private set; }
-
-        public EditingContext EditingContext
-        {
-            get
-            {
-                return this.ModelItem.GetEditingContext();
-            }
-        }
-
-        public ActivityDelegate Create()
-        {
-            ActivityDelegate delegateObject = Activator.CreateInstance(this.DelegateType) as ActivityDelegate;
-            ActivityDelegateMetadata metadata = ActivityDelegateUtilities.GetMetadata(this.DelegateType);
-            ActivityDelegateUtilities.FillDelegate(delegateObject, metadata);
-            return delegateObject;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ActivityDelegateInfoPresenter.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ActivityDelegateInfoPresenter.xaml.cs
deleted file mode 100644 (file)
index aecdc3e..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-
-    internal partial class ActivityDelegateInfoPresenter : UserControl
-    {
-        public static readonly DependencyProperty DelegateInfoProperty = DependencyProperty.Register("DelegateInfo", typeof(ActivityDelegateInfo), typeof(ActivityDelegateInfoPresenter), new PropertyMetadata(new PropertyChangedCallback(OnDelegateInfoChanged)));
-
-        public ActivityDelegateInfoPresenter()
-        {
-            this.InitializeComponent();
-        }
-
-        public ActivityDelegateInfo DelegateInfo
-        {
-            get
-            {
-                return (ActivityDelegateInfo)GetValue(DelegateInfoProperty);
-            }
-
-            set
-            {
-                SetValue(DelegateInfoProperty, value);
-            }
-        }
-
-        private static void OnDelegateInfoChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
-        {
-            ActivityDelegateInfoPresenter presenter = sender as ActivityDelegateInfoPresenter;
-
-            presenter.OnDelegateInfoChanged();
-        }
-
-        private void OnDelegateInfoChanged()
-        {
-            if (this.DelegateInfo != null)
-            {
-                Binding binding = new Binding(this.DelegateInfo.PropertyName);
-                binding.Source = this.DelegateInfo.ModelItem;
-                binding.Mode = BindingMode.TwoWay;
-
-                this.activityDelegatePresenter.SetBinding(ActivityDelegatePresenter.ActivityDelegateProperty, binding);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ActivityDelegatePresenter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ActivityDelegatePresenter.cs
deleted file mode 100644 (file)
index 005e3e8..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Metadata;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Statements;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Reflection;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Controls;
-    using Microsoft.Activities.Presentation;
-
-    internal class ActivityDelegatePresenter : Control
-    {
-        public static readonly DependencyProperty EditingContextProperty = DependencyProperty.Register("EditingContext", typeof(EditingContext), typeof(ActivityDelegatePresenter));
-        public static readonly DependencyProperty FactoryProperty = DependencyProperty.Register("Factory", typeof(IActivityDelegateFactory), typeof(ActivityDelegatePresenter));
-
-        public static readonly DependencyProperty ActivityDelegateProperty = DependencyProperty.Register("ActivityDelegate", typeof(ModelItem), typeof(ActivityDelegatePresenter), new PropertyMetadata(new PropertyChangedCallback(ActivityDelegatePresenter.OnActivityDelegateChanged)));
-        public static readonly DependencyProperty HandlerProperty = DependencyProperty.Register("Handler", typeof(ModelItem), typeof(ActivityDelegatePresenter), new PropertyMetadata(new PropertyChangedCallback(ActivityDelegatePresenter.OnHandlerChanged)));
-        public static readonly DependencyProperty ArgumentsProperty = DependencyProperty.Register("Arguments", typeof(ObservableCollection<ModelItem>), typeof(ActivityDelegatePresenter));
-
-        private bool isSetInternally;
-
-        [SuppressMessage(FxCop.Category.Performance, FxCop.Rule.InitializeReferenceTypeStaticFieldsInline,
-            Justification = "Calls to OverrideMetadata for a dependency property should be done in the static constructor.")]
-        static ActivityDelegatePresenter()
-        {
-            DefaultStyleKeyProperty.OverrideMetadata(typeof(ActivityDelegatePresenter), new FrameworkPropertyMetadata(typeof(ActivityDelegatePresenter)));
-        }
-
-        [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors", Justification = "This is internal code with no derived class")]
-        public ActivityDelegatePresenter()
-        {
-            this.Arguments = new ObservableCollection<ModelItem>();
-        }
-
-        public ModelItem Handler
-        {
-            get
-            {
-                return (ModelItem)GetValue(HandlerProperty);
-            }
-
-            set
-            {
-                SetValue(HandlerProperty, value);
-            }
-        }
-
-        public ModelItem ActivityDelegate
-        {
-            get
-            {
-                return (ModelItem)GetValue(ActivityDelegateProperty);
-            }
-
-            set
-            {
-                SetValue(ActivityDelegateProperty, value);
-            }
-        }
-
-        public IActivityDelegateFactory Factory
-        {
-            get
-            {
-                return (IActivityDelegateFactory)GetValue(FactoryProperty);
-            }
-
-            set
-            {
-                SetValue(FactoryProperty, value);
-            }
-        }
-
-        public ObservableCollection<ModelItem> Arguments
-        {
-            get
-            {
-                return (ObservableCollection<ModelItem>)GetValue(ArgumentsProperty);
-            }
-
-            set
-            {
-                SetValue(ArgumentsProperty, value);
-            }
-        }
-
-        public EditingContext EditingContext
-        {
-            get
-            {
-                return (EditingContext)GetValue(EditingContextProperty);
-            }
-
-            set
-            {
-                SetValue(EditingContextProperty, value);
-            }
-        }
-
-        protected virtual void ReportError(string message, string details)
-        {
-            ErrorReporting.ShowErrorMessage(message, details);
-        }
-
-        private static void OnActivityDelegateChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
-        {
-            ((ActivityDelegatePresenter)sender).OnActivityDelegateChanged();
-        }
-
-        private static void OnHandlerChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
-        {
-            ((ActivityDelegatePresenter)sender).OnHandlerChanged();
-        }
-
-        private void OnActivityDelegateChanged()
-        {
-            this.Arguments.Clear();
-
-            if (this.ActivityDelegate != null)
-            {
-                ActivityDelegateMetadata metadata = ActivityDelegateUtilities.GetMetadata(this.ActivityDelegate.ItemType);
-
-                foreach (ActivityDelegateArgumentMetadata argument in metadata)
-                {
-                    this.Arguments.Add(this.ActivityDelegate.Properties[argument.Name].Value);
-                }
-
-                this.isSetInternally = true;
-                this.Handler = this.ActivityDelegate.Properties["Handler"].Value;
-                this.isSetInternally = false;
-            }
-            else
-            {
-                this.isSetInternally = true;
-                this.Handler = null;
-                this.isSetInternally = false;
-            }
-        }
-
-        private void OnHandlerChanged()
-        {
-            if (!this.isSetInternally)
-            {
-                if (this.Handler == null)
-                {
-                    this.ActivityDelegate = null;
-                }
-                else
-                {
-                    if (this.Factory != null && this.EditingContext != null)
-                    {
-                        try
-                        {
-                            ActivityDelegate instance = this.Factory.Create();
-                            Fx.Assert(instance != null, "Factory should not return null");
-                            ModelItem modelItem = this.EditingContext.Services.GetService<ModelTreeManager>().WrapAsModelItem(instance);
-                            modelItem.Properties["Handler"].SetValue(this.Handler);
-                            this.ActivityDelegate = modelItem;
-                        }
-                        catch (Exception ex)
-                        {
-                            if (Fx.IsFatal(ex))
-                            {
-                                throw;
-                            }
-
-                            string details = ex.Message;
-
-                            if (ex is TargetInvocationException && ex.InnerException != null)
-                            {
-                                details = ex.InnerException.Message;
-                            }
-
-                            this.ReportError(string.Format(CultureInfo.CurrentUICulture, SR.CannotCreateInstance, TypeNameHelper.GetDisplayName(this.Factory.DelegateType, false)), details);
-                            
-                            this.isSetInternally = true;
-                            this.Handler = null;
-                            this.isSetInternally = false;
-                        }
-                    }
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ActivityDelegateUtilities.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ActivityDelegateUtilities.cs
deleted file mode 100644 (file)
index 8f11620..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Metadata;
-    using System.Activities.Presentation.Model;
-    using System.Collections.Generic;
-    using System.Reflection;
-    using System.Runtime;
-
-    internal static class ActivityDelegateUtilities
-    {
-        public static ActivityDelegateMetadata GetMetadata(Type type)
-        {
-            ActivityDelegateMetadata metadata = new ActivityDelegateMetadata();
-
-            PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
-
-            foreach (PropertyInfo property in properties)
-            {
-                if (property.PropertyType.IsGenericType)
-                {
-                    ActivityDelegateArgumentMetadata argument = null;
-                    if (property.PropertyType.GetGenericTypeDefinition() == typeof(DelegateInArgument<>))
-                    {
-                        argument = new ActivityDelegateArgumentMetadata();
-                        argument.Direction = ActivityDelegateArgumentDirection.In;
-                    }
-                    else if (property.PropertyType.GetGenericTypeDefinition() == typeof(DelegateOutArgument<>))
-                    {
-                        argument = new ActivityDelegateArgumentMetadata();
-                        argument.Direction = ActivityDelegateArgumentDirection.Out;
-                    }
-
-                    if (argument != null)
-                    {
-                        argument.Name = property.Name;
-                        argument.Type = property.PropertyType.GetGenericArguments()[0];
-                        metadata.Add(argument);
-                    }
-                }
-            }
-
-            return metadata;
-        }
-
-        public static void FillDelegate(ActivityDelegate activityDelegate, ActivityDelegateMetadata metadata)
-        {
-            foreach (ActivityDelegateArgumentMetadata argument in metadata)
-            {
-                activityDelegate.GetType().GetProperty(argument.Name).SetValue(activityDelegate, CreateDelegateArgument(argument), null);
-            }
-        }
-
-        public static bool HasActivityDelegate(Type type)
-        {
-            return GetPropertiesByHeuristics(type).Count > 0;
-        }
-
-        public static List<ActivityDelegateInfo> CreateActivityDelegateInfo(ModelItem activity)
-        {
-            List<ActivityDelegateInfo> list = new List<ActivityDelegateInfo>();
-
-            foreach (PropertyInfo property in GetPropertiesByHeuristics(activity.ItemType))
-            {
-                list.Add(new ActivityDelegateInfo(activity, property.Name));
-            }
-
-            return list;
-        }
-
-        // Heuristics:
-        // A property is considered to be an ActivityDelegate when
-        //   1. it is a public instance property
-        //   2. it has a public getter and a public setter
-        //   3. its type is derived from ActivityDelegate
-        //   4. can create an isntance of its type
-        private static List<PropertyInfo> GetPropertiesByHeuristics(Type activityType)
-        {
-            List<PropertyInfo> result = new List<PropertyInfo>();
-
-            PropertyInfo[] properties = activityType.GetProperties(BindingFlags.Public | BindingFlags.Instance);
-            foreach (PropertyInfo property in properties)
-            {
-                if (property.GetGetMethod() != null &&
-                    property.GetSetMethod() != null &&
-                    property.PropertyType.IsSubclassOf(typeof(ActivityDelegate)) &&
-                    TypeUtilities.CanCreateInstanceUsingDefaultConstructor(property.PropertyType))
-                {
-                    result.Add(property);
-                }
-            }
-
-            result.Sort(new PropertyInfoComparer());
-
-            return result;
-        }
-
-        private static DelegateArgument CreateDelegateArgument(ActivityDelegateArgumentMetadata argument)
-        {
-            DelegateArgument delegateArgument = null;
-            if (argument.Direction == ActivityDelegateArgumentDirection.In)
-            {
-                delegateArgument = Activator.CreateInstance(typeof(DelegateInArgument<>).MakeGenericType(argument.Type)) as DelegateArgument;
-            }
-            else
-            {
-                delegateArgument = Activator.CreateInstance(typeof(DelegateOutArgument<>).MakeGenericType(argument.Type)) as DelegateArgument;
-            }
-
-            delegateArgument.Name = argument.Name;
-
-            return delegateArgument;
-        }
-
-        private class PropertyInfoComparer : IComparer<PropertyInfo>
-        {
-            public int Compare(PropertyInfo x, PropertyInfo y)
-            {
-                Fx.Assert(x != null, "x should not be null");
-                Fx.Assert(y != null, "y should not be null");
-
-                return StringComparer.Ordinal.Compare(x.Name, y.Name);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ActivityDesigner.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ActivityDesigner.cs
deleted file mode 100644 (file)
index 5ff38b5..0000000
+++ /dev/null
@@ -1,357 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Annotations;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.View;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-    using System.Text;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using System.Windows.Threading;
-
-    public class ActivityDesigner : WorkflowViewElement
-    {
-        UserControl defaultDisplayNameReadOnlyControl;
-        TextBox defaultDisplayNameBox;
-        bool defaultDisplayNameReadOnlyControlMouseDown;
-
-        private AnnotationManager annotationManager;
-
-        [Fx.Tag.KnownXamlExternal]
-        public DrawingBrush Icon
-        {
-            get { return (DrawingBrush)GetValue(IconProperty); }
-            set { SetValue(IconProperty, value); }
-        }
-
-        public static readonly DependencyProperty IconProperty =
-            DependencyProperty.Register("Icon", typeof(DrawingBrush), typeof(ActivityDesigner), new UIPropertyMetadata(null));
-
-        internal static readonly DependencyProperty ActivityDelegatesProperty = DependencyProperty.Register("ActivityDelegates", typeof(ObservableCollection<ActivityDelegateInfo>), typeof(ActivityDesigner));
-
-        internal static readonly DependencyProperty HasActivityDelegatesProperty = DependencyProperty.Register("HasActivityDelegates", typeof(bool), typeof(ActivityDesigner));
-
-        [SuppressMessage(FxCop.Category.Performance, FxCop.Rule.InitializeReferenceTypeStaticFieldsInline,
-            Justification = "Calls to OverrideMetadata for a dependency property should be done in the static constructor.")]
-        static ActivityDesigner()
-        {
-            DefaultStyleKeyProperty.OverrideMetadata(typeof(ActivityDesigner), new FrameworkPropertyMetadata(typeof(ActivityDesigner)));
-        }
-
-        public ActivityDesigner()
-        {
-            this.Loaded += (sender, args) =>
-            {
-                this.SetupDefaultIcon();
-                this.annotationManager.Initialize();
-            };
-
-            this.Unloaded += (sender, args) =>
-            {
-                this.annotationManager.Uninitialize();
-            };
-
-            this.annotationManager = new AnnotationManager(this);
-        }
-
-        internal ObservableCollection<ActivityDelegateInfo> ActivityDelegates
-        {
-            get { return (ObservableCollection<ActivityDelegateInfo>)GetValue(ActivityDelegatesProperty); }
-            set { SetValue(ActivityDelegatesProperty, value); }
-        }
-
-        internal bool HasActivityDelegates
-        {
-            get { return (bool)GetValue(HasActivityDelegatesProperty); }
-            set { SetValue(HasActivityDelegatesProperty, value); }
-        }
-
-        protected override void OnModelItemChanged(object newItem)
-        {
-            base.OnModelItemChanged(newItem);
-
-            this.PopulateActivityDelegates((ModelItem)newItem);
-        }
-
-        private void PopulateActivityDelegates(ModelItem modelItem)
-        {
-            if (this.ActivityDelegates == null)
-            {
-                this.ActivityDelegates = new ObservableCollection<ActivityDelegateInfo>();
-            }
-            else
-            {
-                this.ActivityDelegates.Clear();
-            }
-
-            List<ActivityDelegateInfo> list = ActivityDelegateUtilities.CreateActivityDelegateInfo(modelItem);
-
-            if (list.Count > 0)
-            {
-                foreach (ActivityDelegateInfo entry in list)
-                {
-                    this.ActivityDelegates.Add(entry);
-                }
-
-                this.HasActivityDelegates = true;
-            }
-            else
-            {
-                this.HasActivityDelegates = false;
-            }
-        }
-
-        protected override string GetAutomationIdMemberName()
-        {
-            return "DisplayName";
-        }
-
-        protected internal override string GetAutomationItemStatus()
-        {
-            StringBuilder descriptiveText = new StringBuilder();
-
-            EmitPropertyValuePair(descriptiveText, "IsPrimarySelection");
-            EmitPropertyValuePair(descriptiveText, "IsSelection");
-            EmitPropertyValuePair(descriptiveText, "IsCurrentLocation");
-            EmitPropertyValuePair(descriptiveText, "IsCurrentContext");
-            EmitPropertyValuePair(descriptiveText, "IsBreakpointEnabled");
-            EmitPropertyValuePair(descriptiveText, "IsBreakpointBounded");
-            EmitPropertyValuePair(descriptiveText, "ValidationState");
-            descriptiveText.Append(base.GetAutomationItemStatus());
-
-            return descriptiveText.ToString();
-        }
-
-        void EmitPropertyValuePair(StringBuilder description, string propertyName)
-        {
-            PropertyDescriptor property = TypeDescriptor.GetProperties(this.ModelItem)[propertyName];
-            object propertyValue = (property == null) ? null : property.GetValue(this.ModelItem);
-            string propertyValueString = propertyValue == null ? "null" : propertyValue.ToString();
-            description.AppendFormat("{0}={1} ", propertyName, propertyValueString);
-        }
-
-        public override void OnApplyTemplate()
-        {
-            base.OnApplyTemplate();
-
-            if (this.defaultDisplayNameBox != null)
-            {
-                this.defaultDisplayNameBox.LostFocus -= new RoutedEventHandler(OnDefaultDisplayNameBoxLostFocus);
-                this.defaultDisplayNameBox.ContextMenuOpening -= new ContextMenuEventHandler(OnDefaultDisplayNameBoxContextMenuOpening);
-            }
-            if (this.defaultDisplayNameReadOnlyControl != null)
-            {
-                this.defaultDisplayNameReadOnlyControl.MouseLeftButtonDown -= new MouseButtonEventHandler(OnDefaultDisplayNameReadOnlyControlMouseLeftButtonDown);
-                this.defaultDisplayNameReadOnlyControl.GotKeyboardFocus -= new KeyboardFocusChangedEventHandler(OnDefaultDisplayNameReadOnlyControlGotKeyboardFocus);
-            }
-
-            this.defaultDisplayNameReadOnlyControl = this.Template.FindName("DisplayNameReadOnlyControl_6E8E4954_F6B2_4c6c_9E28_33A7A78F1E81", this) as UserControl;
-            this.defaultDisplayNameBox = this.Template.FindName("DisplayNameBox_570C5205_7195_4d4e_953A_8E4B57EF7E7F", this) as TextBox;
-
-            UIElement defaultAnnotationIndicator = this.Template.FindName("AnnotationIndicator_570C5205_7195_4d4e_953A_8E4B57EF7E7F", this) as UIElement;
-            DockedAnnotationDecorator defaultDockedAnnotationDecorator = this.Template.FindName("DockedAnnotationDecorator_570C5205_7195_4d4e_953A_8E4B57EF7E7F", this) as DockedAnnotationDecorator;
-
-            if (defaultAnnotationIndicator != null && defaultDockedAnnotationDecorator != null)
-            {
-                this.annotationManager.AnnotationVisualProvider = new ActivityDesignerAnnotationVisualProvider(new UIElementToAnnotationIndicatorAdapter(defaultAnnotationIndicator), defaultDockedAnnotationDecorator);
-            }
-
-            if (this.defaultDisplayNameBox != null && this.defaultDisplayNameReadOnlyControl != null)
-            {
-                this.defaultDisplayNameBox.LostFocus += new RoutedEventHandler(OnDefaultDisplayNameBoxLostFocus);
-                this.defaultDisplayNameBox.ContextMenuOpening += new ContextMenuEventHandler(OnDefaultDisplayNameBoxContextMenuOpening);
-                this.defaultDisplayNameReadOnlyControl.MouseLeftButtonDown += new MouseButtonEventHandler(OnDefaultDisplayNameReadOnlyControlMouseLeftButtonDown);
-                this.defaultDisplayNameReadOnlyControl.GotKeyboardFocus += new KeyboardFocusChangedEventHandler(OnDefaultDisplayNameReadOnlyControlGotKeyboardFocus);
-            }
-
-            Border titleBar = this.Template.FindName("TitleBar_C36A1CF2_4B36_4F0D_B427_9825C2E110DE", this) as Border;
-            if (titleBar != null)
-            {
-                this.DragHandle = titleBar;
-            }
-        }
-
-        void OnDefaultDisplayNameReadOnlyControlGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
-        {
-            if (this.defaultDisplayNameBox != null && this.defaultDisplayNameReadOnlyControl != null)
-            {
-                DesignerView designerView = this.Context.Services.GetService<DesignerView>();
-                if (!designerView.IsReadOnly && !designerView.IsMultipleSelectionMode)
-                {
-                    this.EnterDisplayNameEditMode();
-                }
-            }
-        }
-
-        void OnDefaultDisplayNameReadOnlyControlMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
-        {
-            this.defaultDisplayNameReadOnlyControlMouseDown = true;
-        }
-
-        void OnDefaultDisplayNameBoxLostFocus(object sender, RoutedEventArgs e)
-        {
-            if (this.defaultDisplayNameBox != null && this.defaultDisplayNameReadOnlyControl != null)
-            {
-                this.ExitDisplayNameEditMode();
-            }
-        }
-
-        void OnDefaultDisplayNameBoxContextMenuOpening(object sender, ContextMenuEventArgs e)
-        {
-            // to disable the context menu
-            e.Handled = true;
-        }
-
-        protected override void OnPreviewMouseDown(MouseButtonEventArgs e)
-        {
-            this.defaultDisplayNameReadOnlyControlMouseDown = false;
-            base.OnPreviewMouseDown(e);
-        }
-
-        protected override void OnMouseUp(MouseButtonEventArgs e)
-        {
-            // We have to check the defaultDisplayNameReadOnlyControlMouseDown flag to determine whether the mouse is clicked on 
-            // the defaultDisplayNameReadOnlyControl. This is because the mouse capture is set on the WorkflowViewElement in 
-            // OnMouseDown, and as a result MouseUp event is not fired on the defaultDisplayNameReadOnlyControl.
-            if (this.defaultDisplayNameBox != null && this.defaultDisplayNameReadOnlyControl != null &&
-                this.defaultDisplayNameReadOnlyControlMouseDown)
-            {
-                this.defaultDisplayNameReadOnlyControlMouseDown = false;
-                DesignerView designerView = this.Context.Services.GetService<DesignerView>();
-                if (!designerView.IsReadOnly)
-                {
-                    this.EnterDisplayNameEditMode();
-                }
-            }
-            base.OnMouseUp(e);
-        }
-
-        void EnterDisplayNameEditMode()
-        {
-            this.defaultDisplayNameBox.Visibility = Visibility.Visible;
-            this.defaultDisplayNameReadOnlyControl.Visibility = Visibility.Collapsed;
-            this.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, (Action)(() =>
-            {
-                Keyboard.Focus(this.defaultDisplayNameBox);
-                this.defaultDisplayNameBox.ScrollToHome();
-            }));
-        }
-
-        void ExitDisplayNameEditMode()
-        {
-            this.defaultDisplayNameReadOnlyControl.Visibility = Visibility.Visible;
-            this.defaultDisplayNameBox.Visibility = Visibility.Collapsed;
-        }
-
-        private void SetupDefaultIcon()
-        {
-            if (this.Icon == null)
-            {
-                this.Icon = GetDefaultIcon();
-            }
-        }
-
-        internal DrawingBrush GetDefaultIcon()
-        {
-            DrawingBrush icon = null;
-
-            // Look for a named icon if this property is not set
-
-            if (this.ModelItem != null)
-            {
-                string iconKey = this.ModelItem.ItemType.IsGenericType ? this.ModelItem.ItemType.GetGenericTypeDefinition().Name : this.ModelItem.ItemType.Name;
-                int genericParamsIndex = iconKey.IndexOf('`');
-                if (genericParamsIndex > 0)
-                {
-                    iconKey = iconKey.Remove(genericParamsIndex);
-                }
-                iconKey = iconKey + "Icon";
-                try
-                {
-                    if (WorkflowDesignerIcons.IconResourceDictionary.Contains(iconKey))
-                    {
-                        object resourceItem = WorkflowDesignerIcons.IconResourceDictionary[iconKey];
-                        if (resourceItem is DrawingBrush)
-                        {
-                            icon = (DrawingBrush)resourceItem;
-                        }
-                    }
-                }
-                catch (ResourceReferenceKeyNotFoundException) { }
-                catch (InvalidCastException) { }
-            }
-            if (icon == null)
-            {
-                // as a last resort fall back to the default generic leaf activity icon.
-                icon = WorkflowDesignerIcons.Activities.DefaultCustomActivity;
-            }
-
-            return icon;
-        }
-
-        protected internal override void OnEditAnnotation()
-        {
-            this.annotationManager.OnEditAnnotation();
-        }
-
-        private class ActivityDesignerAnnotationVisualProvider : IAnnotationVisualProvider
-        {
-            private DockedAnnotationDecorator decorator;
-            private IAnnotationIndicator indicator;
-            private IFloatingAnnotation floatingAnnotation;
-            private IDockedAnnotation dockedAnnotation;
-
-            public ActivityDesignerAnnotationVisualProvider(IAnnotationIndicator indicator, DockedAnnotationDecorator decorator)
-            {
-                this.indicator = indicator;
-                this.decorator = decorator;
-            }
-
-            public IAnnotationIndicator GetAnnotationIndicator()
-            {
-                return this.indicator;
-            }
-
-            public IFloatingAnnotation GetFloatingAnnotation()
-            {
-                if (this.floatingAnnotation == null)
-                {
-                    this.floatingAnnotation = new FloatingAnnotationView();
-                }
-
-                return this.floatingAnnotation;
-            }
-
-            public IDockedAnnotation GetDockedAnnotation()
-            {
-                if (this.dockedAnnotation == null)
-                {
-                    DockedAnnotationView view = new DockedAnnotationView();
-
-                    Binding annotationTextbinding = new Binding("ModelItem.AnnotationText");
-                    view.SetBinding(DockedAnnotationView.AnnotationTextProperty, annotationTextbinding);
-
-                    Binding maxWidthBinding = new Binding("ActualWidth");
-                    maxWidthBinding.ElementName = "annotationWidthSetter";
-                    view.SetBinding(DockedAnnotationView.MaxWidthProperty, maxWidthBinding);
-
-                    this.dockedAnnotation = view;
-                    this.decorator.Child = view;
-                }
-
-                return this.dockedAnnotation;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ActivityDesignerOptionsAttribute.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ActivityDesignerOptionsAttribute.cs
deleted file mode 100644 (file)
index e8c367b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Model;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Media;
-
-    [Fx.Tag.XamlVisible(false)]
-    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Class)]
-    public sealed class ActivityDesignerOptionsAttribute : Attribute
-    {
-        public ActivityDesignerOptionsAttribute()
-        {
-            this.AllowDrillIn = true;
-            this.AlwaysCollapseChildren = false;
-        }
-
-        public bool AllowDrillIn
-        {
-            get;
-            set;
-        }
-
-        public bool AlwaysCollapseChildren
-        {
-            get;
-            set;
-        }
-
-        public Func<ModelItem, DrawingBrush> OutlineViewIconProvider
-        {
-            get;
-            set;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/AdornerLocation.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/AdornerLocation.cs
deleted file mode 100644 (file)
index 34d3d24..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Annotations
-{
-    internal enum AdornerLocation
-    {
-        None,
-        BottomRight,
-        TopRight,
-        TopLeft,
-        BottomLeft
-    }
-}
\ No newline at end of file
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/Annotation.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/Annotation.cs
deleted file mode 100644 (file)
index ca4eef7..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Annotations
-{
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-    using System.Xaml;
-
-    /// <summary>
-    /// Annotation class that contains methods to access annotation attached property
-    /// </summary>
-    public static class Annotation
-    {
-        /// <summary>
-        /// attachable property for annotation text
-        /// </summary>
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes, Justification = "XAML attached property declaration.")]
-        public static readonly AttachableMemberIdentifier AnnotationTextProperty = new AttachableMemberIdentifier(typeof(Annotation), "AnnotationText");
-
-        /// <summary>
-        /// property name to access annotation in a ModelItem
-        /// </summary>
-        public static readonly string AnnotationTextPropertyName = "AnnotationText";
-
-        /// <summary>
-        /// property name to access dock annoation view state
-        /// </summary>
-        internal static readonly string IsAnnotationDockedViewStateName = "IsAnnotationDocked";
-
-        /// <summary>
-        /// Get annotation text of an object
-        /// </summary>
-        /// <param name="instance">instance to get annotation</param>
-        /// <returns>annoation text</returns>
-        public static string GetAnnotationText(object instance)
-        {
-            if (instance == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("instance"));
-            }
-
-            string annotationText;
-            AttachablePropertyServices.TryGetProperty<string>(instance, Annotation.AnnotationTextProperty, out annotationText);
-            return annotationText;
-        }
-
-        /// <summary>
-        /// Set annotation of an object
-        /// </summary>
-        /// <param name="instance">instance to set annotation text</param>
-        /// <param name="annotationText">annoatation text to be set</param>
-        public static void SetAnnotationText(object instance, string annotationText)
-        {
-            if (instance == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("instance"));
-            }
-
-            if (annotationText != null)
-            {
-                AttachablePropertyServices.SetProperty(instance, Annotation.AnnotationTextProperty, annotationText);
-            }
-            else
-            {
-                AttachablePropertyServices.RemoveProperty(instance, Annotation.AnnotationTextProperty);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/AnnotationAdorner.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/AnnotationAdorner.cs
deleted file mode 100644 (file)
index 7632498..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Annotations
-{
-    using System.Activities.Presentation.View;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Documents;
-    using System.Windows.Media;
-
-    internal class AnnotationAdorner : Adorner
-    {
-        public static readonly DependencyProperty AnchorProperty = DependencyProperty.RegisterAttached("Anchor", typeof(AdornerLocation), typeof(AnnotationAdorner), new FrameworkPropertyMetadata(AdornerLocation.None));
-        private UIElement content;
-
-        public AnnotationAdorner(UIElement adornedElement)
-            : base(adornedElement)
-        {
-        }
-
-        internal ScrollViewer ScrollViewer
-        {
-            get;
-            set;
-        }
-
-        internal UIElement Content
-        {
-            get
-            {
-                return this.content;
-            }
-
-            set
-            {
-                if (this.content != value)
-                {
-                    if (this.content != null)
-                    {
-                        this.RemoveVisualChild(this.content);
-                    }
-
-                    this.content = value;
-                    if (this.content != null)
-                    {
-                        this.AddVisualChild(this.content);
-                    }
-                }
-            }
-        }
-
-        protected override int VisualChildrenCount
-        {
-            get
-            {
-                return 1;
-            }
-        }
-
-        public static AdornerLocation GetAnchor(DependencyObject obj)
-        {
-            return (AdornerLocation)obj.GetValue(AnnotationAdorner.AnchorProperty);
-        }
-
-        public static void SetAnchor(DependencyObject obj, AdornerLocation anchor)
-        {
-            obj.SetValue(AnnotationAdorner.AnchorProperty, anchor);
-        }
-
-        // (3)   |   (2)
-        // ______|______
-        // (4)   |   (1)
-        //       |
-        // canvas is divided into four areas by anchorPoint
-        // try to figure out which area could fit desiredSize from area1 to area4, if there's no fit, default to area4.
-        internal static AdornerLocation FindAnchor(Point anchorPoint, Size desiredSize, Rect canvas)
-        {
-            Fx.Assert(anchorPoint.X >= canvas.X && anchorPoint.X <= canvas.X + canvas.Width, "X axis of anchorPoint not within canvas");
-            Fx.Assert(anchorPoint.Y >= canvas.Y && anchorPoint.Y <= canvas.Y + canvas.Height, "Y axis of anchorPoint not within canvas");
-
-            AdornerLocation anchor = AdornerLocation.None;
-
-            // try area 1 and 2
-            if (anchorPoint.X + desiredSize.Width <= canvas.X + canvas.Width)
-            {
-                // area 1
-                if (anchorPoint.Y + desiredSize.Height <= canvas.Y + canvas.Height)
-                {
-                    anchor = AdornerLocation.BottomRight;
-                }
-
-                // area 2
-                if (anchor == AdornerLocation.None && anchorPoint.Y - desiredSize.Height >= canvas.Y)
-                {
-                    anchor = AdornerLocation.TopRight;
-                }
-            }
-
-            // area 3
-            if (anchor == AdornerLocation.None && anchorPoint.X - desiredSize.Width >= canvas.X && anchorPoint.Y - desiredSize.Height >= canvas.Y)
-            {
-                anchor = AdornerLocation.TopLeft;
-            }
-
-            // default to area 4
-            if (anchor == AdornerLocation.None)
-            {
-                anchor = AdornerLocation.BottomLeft;
-            }
-
-            return anchor;
-        }
-
-        protected override Visual GetVisualChild(int index)
-        {
-            return this.Content;
-        }
-
-        protected override Size MeasureOverride(Size constraint)
-        {
-            this.content.Measure(constraint);
-            return this.content.DesiredSize;
-        }
-
-        protected override Size ArrangeOverride(Size finalSize)
-        {
-            Point anchorPoint = this.AdornedElement.TranslatePoint(new Point(this.AdornedElement.RenderSize.Width, 0), this.ScrollViewer);
-
-            AdornerLocation anchor = AnnotationAdorner.GetAnchor(this);
-            if (anchor == AdornerLocation.None)
-            {
-                // Calculate based on the real size of the adorner, depending on current zoom level
-                DesignerView designerView = ((WorkflowViewElement)AdornedElement).Context.Services.GetService<DesignerView>();
-                double zoomLevel = designerView.ZoomFactor;
-                Size adornerSize = new Size(this.content.DesiredSize.Width * zoomLevel, this.content.DesiredSize.Height * zoomLevel);
-                anchor = FindAnchor(anchorPoint, adornerSize, new Rect(0, 0, this.ScrollViewer.ViewportWidth, this.ScrollViewer.ViewportHeight));
-                AnnotationAdorner.SetAnchor(this, anchor);
-            }
-
-            Point location = CalculateLocation(anchor, this.AdornedElement.RenderSize, this.content.DesiredSize);
-
-            this.content.Arrange(new Rect(location, finalSize));
-
-            return finalSize;
-        }
-
-        private static Point CalculateLocation(AdornerLocation anchor, Size adorneeSize, Size adornerSize)
-        {
-            Point location = new Point();
-
-            switch (anchor)
-            {
-                case AdornerLocation.BottomRight:
-                    location = new Point(adorneeSize.Width, 0);
-                    break;
-                case AdornerLocation.TopRight:
-                    location = new Point(adorneeSize.Width, -adornerSize.Height);
-                    break;
-                case AdornerLocation.TopLeft:
-                    location = new Point(adorneeSize.Width - adornerSize.Width, -adornerSize.Height);
-                    break;
-                case AdornerLocation.BottomLeft:
-                    location = new Point(adorneeSize.Width - adornerSize.Width, 20);
-                    break;
-            }
-
-            return location;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/AnnotationAdornerService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/AnnotationAdornerService.cs
deleted file mode 100644 (file)
index 9a8b2b0..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Annotations
-{
-    internal abstract class AnnotationAdornerService
-    {
-        public abstract void Show(AnnotationAdorner adorner);
-
-        public abstract void Hide(AnnotationAdorner adorner);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/AnnotationManager.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/AnnotationManager.cs
deleted file mode 100644 (file)
index 4002583..0000000
+++ /dev/null
@@ -1,574 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Annotations
-{
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.View;
-    using System.ComponentModel;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Threading;
-
-    internal class AnnotationManager
-    {
-        private bool isInitialized;
-
-        private WorkflowViewElement workflowViewElement;
-        private IAnnotationVisualProvider annotationVisualProvider;
-
-        private ModelItem modelItem;
-        private EditingContext editingContext;
-        private IAnnotationIndicator indicator;
-        private IDockedAnnotation dockedAnnotation;
-        private IFloatingAnnotation floatingAnnotation;
-
-        private bool isViewStateChangedInternally;
-        private AnnotationStatus status;
-        private AnnotationAdorner annotationAdorner;
-        private DispatcherTimer tryHideTimer;
-        private bool hasAnnotation;
-
-        private IIntegratedHelpService helpService;
-
-        internal AnnotationManager(WorkflowViewElement workflowViewElement)
-        {
-            this.workflowViewElement = workflowViewElement;
-        }
-
-        public IAnnotationVisualProvider AnnotationVisualProvider
-        {
-            get
-            {
-                return this.annotationVisualProvider;
-            }
-
-            set
-            {
-                if (this.annotationVisualProvider != value)
-                {
-                    if (this.isInitialized)
-                    {
-                        throw FxTrace.Exception.AsError(new InvalidOperationException(SR.CouldNotChangeValueAfterInitialization));
-                    }
-
-                    this.annotationVisualProvider = value;
-                }
-            }
-        }
-
-        protected internal virtual AnnotationAdornerService AnnotationAdornerService
-        {
-            get
-            {
-                return this.EditingContext.Services.GetService<AnnotationAdornerService>();
-            }
-        }
-
-        private ModelItem ModelItem
-        {
-            get
-            {
-                return this.modelItem;
-            }
-
-            set
-            {
-                if (this.modelItem != value)
-                {
-                    Fx.Assert(!this.isInitialized, "could not change value after initialization");
-
-                    this.modelItem = value;
-                }
-            }
-        }
-
-        private EditingContext EditingContext
-        {
-            get
-            {
-                return this.editingContext;
-            }
-
-            set
-            {
-                if (this.editingContext != value)
-                {
-                    Fx.Assert(!this.isInitialized, "could not change value after initialization");
-
-                    this.editingContext = value;
-                }
-            }
-        }
-
-        private IAnnotationIndicator Indicator
-        {
-            get
-            {
-                if (this.indicator == null)
-                {
-                    this.indicator = this.AnnotationVisualProvider.GetAnnotationIndicator();
-                }
-
-                return this.indicator;
-            }
-        }
-
-        private IFloatingAnnotation FloatingAnnotation
-        {
-            get
-            {
-                if (this.floatingAnnotation == null)
-                {
-                    this.floatingAnnotation = this.AnnotationVisualProvider.GetFloatingAnnotation();
-
-                    this.floatingAnnotation.IsReadOnly = this.EditingContext.Items.GetValue<ReadOnlyState>().IsReadOnly;
-                    this.floatingAnnotation.IsMouseOverChanged += new EventHandler(this.OnFloatingAnnotationIsMouseOverChanged);
-                    this.floatingAnnotation.IsKeyboardFocusWithinChanged += new DependencyPropertyChangedEventHandler(this.OnFloatingAnnotationIsKeyboardFocusWithinChanged);
-                    this.floatingAnnotation.DockButtonClicked += new Action(this.OnDockButtonClicked);
-                    this.floatingAnnotation.ModelItem = this.ModelItem;
-                }
-
-                return this.floatingAnnotation;
-            }
-        }
-
-        private IDockedAnnotation DockedAnnotation
-        {
-            get
-            {
-                if (this.dockedAnnotation == null)
-                {
-                    this.dockedAnnotation = this.AnnotationVisualProvider.GetDockedAnnotation();
-
-                    this.dockedAnnotation.IsReadOnly = this.EditingContext.Items.GetValue<ReadOnlyState>().IsReadOnly;
-                    this.dockedAnnotation.UndockButtonClicked += new Action(this.OnUndockButtonClicked);
-                }
-
-                return this.dockedAnnotation;
-            }
-        }
-
-        private ViewStateService ViewStateService
-        {
-            get
-            {
-                return this.EditingContext.Services.GetService<ViewStateService>();
-            }
-        }
-
-        private AnnotationAdorner AnnotationAdorner
-        {
-            get
-            {
-                if (this.annotationAdorner == null)
-                {
-                    this.annotationAdorner = new AnnotationAdorner(this.workflowViewElement);
-                    this.annotationAdorner.Content = this.FloatingAnnotation as UIElement;
-                }
-
-                return this.annotationAdorner;
-            }
-        }
-
-        private bool IsAnnotationDocked
-        {
-            get
-            {
-                bool? value = this.ViewStateService.RetrieveViewState(this.ModelItem, Annotation.IsAnnotationDockedViewStateName) as bool?;
-                if (value.HasValue)
-                {
-                    return value.Value;
-                }
-                else
-                {
-                    return false;
-                }
-            }
-
-            set
-            {
-                this.isViewStateChangedInternally = true;
-                this.ViewStateService.StoreViewState(this.ModelItem, Annotation.IsAnnotationDockedViewStateName, value);
-                this.isViewStateChangedInternally = false;
-            }
-        }
-
-        private DispatcherTimer TryHideTimer
-        {
-            get
-            {
-                if (this.tryHideTimer == null)
-                {
-                    this.tryHideTimer = new DispatcherTimer();
-                    this.tryHideTimer.Interval = TimeSpan.FromMilliseconds(200);
-                    this.tryHideTimer.Tick += this.TryHideAnnotation;
-                }
-
-                return this.tryHideTimer;
-            }
-        }
-
-        public void Initialize()
-        {
-            if (this.isInitialized)
-            {
-                return;
-            }
-
-            this.ModelItem = this.workflowViewElement.ModelItem;
-            this.EditingContext = this.workflowViewElement.Context;
-
-            if (!this.CanInitialize())
-            {
-                return;
-            }
-
-            this.EditingContext.Items.Subscribe<ReadOnlyState>(this.OnReadOnlyStateChanged);
-            this.ViewStateService.ViewStateChanged += new ViewStateChangedEventHandler(this.OnViewStateChanged);
-            this.ModelItem.PropertyChanged += new PropertyChangedEventHandler(this.OnModelItemPropertyChanged);
-            this.Indicator.IsMouseOverChanged += new EventHandler(this.OnIndicatorIsMouseOverChanged);
-            this.helpService = this.EditingContext.Services.GetService<IIntegratedHelpService>();
-
-            this.hasAnnotation = this.ModelItem.Properties[Annotation.AnnotationTextPropertyName].ComputedValue != null;
-
-            if (this.ModelItem.Properties[Annotation.AnnotationTextPropertyName].ComputedValue == null)
-            {
-                this.Indicator.Visibility = Visibility.Collapsed;
-                if (this.dockedAnnotation != null)
-                {
-                    this.DockedAnnotation.Visibility = Visibility.Collapsed;
-                }
-            }
-            else
-            {
-                if (this.IsAnnotationDocked)
-                {
-                    this.Indicator.Visibility = Visibility.Collapsed;
-                    this.DockedAnnotation.Visibility = Visibility.Visible;
-                    this.status = AnnotationStatus.Docked;
-                }
-                else
-                {
-                    this.Indicator.Visibility = Visibility.Visible;
-                    this.DockedAnnotation.Visibility = Visibility.Collapsed;
-                }
-            }
-
-            this.isInitialized = true;
-        }
-
-        public void Uninitialize()
-        {
-            if (!this.isInitialized)
-            {
-                return;
-            }
-
-            this.EditingContext.Items.Unsubscribe<ReadOnlyState>(this.OnReadOnlyStateChanged);
-            this.ViewStateService.ViewStateChanged -= new ViewStateChangedEventHandler(this.OnViewStateChanged);
-            this.ModelItem.PropertyChanged -= new PropertyChangedEventHandler(this.OnModelItemPropertyChanged);
-            this.Indicator.IsMouseOverChanged -= new EventHandler(this.OnIndicatorIsMouseOverChanged);
-
-            if (this.dockedAnnotation != null)
-            {
-                this.dockedAnnotation.UndockButtonClicked -= new Action(this.OnUndockButtonClicked);
-            }
-
-            if (this.floatingAnnotation != null)
-            {
-                this.floatingAnnotation.IsMouseOverChanged -= new EventHandler(this.OnFloatingAnnotationIsMouseOverChanged);
-                this.floatingAnnotation.IsKeyboardFocusWithinChanged -= new DependencyPropertyChangedEventHandler(this.OnFloatingAnnotationIsKeyboardFocusWithinChanged);
-                this.floatingAnnotation.DockButtonClicked -= new Action(this.OnDockButtonClicked);
-            }
-
-            if (this.tryHideTimer != null)
-            {
-                this.tryHideTimer.Tick -= this.TryHideAnnotation;
-                if (this.tryHideTimer.IsEnabled)
-                {
-                    this.tryHideTimer.Stop();
-                }
-            }
-
-            this.tryHideTimer = null;
-
-            this.isInitialized = false;
-        }
-
-        public void OnEditAnnotation()
-        {
-            if (!this.isInitialized)
-            {
-                return;
-            }
-
-            if (this.status == AnnotationStatus.Docked)
-            {
-                this.DockedAnnotation.FocusOnContent();
-                return;
-            }
-
-            if (this.status == AnnotationStatus.Hidden)
-            {
-                this.ShowAnnotation();
-            }
-
-            this.FloatingAnnotation.FocusOnContent();
-        }
-
-        private void OnReadOnlyStateChanged(ReadOnlyState state)
-        {
-            if (this.floatingAnnotation != null)
-            {
-                this.floatingAnnotation.IsReadOnly = state.IsReadOnly;
-            }
-
-            if (this.dockedAnnotation != null)
-            {
-                this.dockedAnnotation.IsReadOnly = state.IsReadOnly;
-            }
-        }
-
-        private void OnViewStateChanged(object sender, ViewStateChangedEventArgs e)
-        {
-            if (e.ParentModelItem == this.ModelItem && e.Key == Annotation.IsAnnotationDockedViewStateName && !this.isViewStateChangedInternally)
-            {
-                bool? isAnnotationDocked = e.NewValue as bool?;
-                if (isAnnotationDocked.HasValue)
-                {
-                    if (this.hasAnnotation)
-                    {
-                        if (isAnnotationDocked.Value)
-                        {
-                            this.DockAnnotation();
-                        }
-                        else
-                        {
-                            this.HideAnnotation();
-                        }
-                    }
-                }
-            }
-        }
-
-        private void OnModelItemPropertyChanged(object sender, PropertyChangedEventArgs e)
-        {
-            if (e.PropertyName == Annotation.AnnotationTextPropertyName)
-            {
-                bool previouslyHadAnnotation = this.hasAnnotation;
-                this.hasAnnotation = this.ModelItem.Properties[Annotation.AnnotationTextPropertyName].ComputedValue != null;
-
-                if (!this.hasAnnotation)
-                {
-                    //// annotation is removed
-
-                    if (this.status == AnnotationStatus.Floating)
-                    {
-                        this.AnnotationAdornerService.Hide(this.AnnotationAdorner);
-                    }
-
-                    this.Indicator.Visibility = Visibility.Collapsed;
-                    if (this.dockedAnnotation != null)
-                    {
-                        this.dockedAnnotation.Visibility = Visibility.Collapsed;
-                    }
-
-                    this.status = AnnotationStatus.Hidden;
-                }
-                else if (!previouslyHadAnnotation)
-                {
-                    //// annotation is added
-
-                    if (this.IsAnnotationDocked)
-                    {
-                        this.Indicator.Visibility = Visibility.Collapsed;
-                        this.DockedAnnotation.Visibility = Visibility.Visible;
-                        this.status = AnnotationStatus.Docked;
-                    }
-                    else
-                    {
-                        this.Indicator.Visibility = Visibility.Visible;
-                    }
-                }
-            }
-        }
-
-        private void OnUndockButtonClicked()
-        {
-            this.ShowAnnotation();
-            this.OnEditAnnotation();
-        }
-
-        private void OnFloatingAnnotationIsMouseOverChanged(object sender, EventArgs e)
-        {
-            if (!this.FloatingAnnotation.IsMouseOver)
-            {
-                if (this.status == AnnotationStatus.Floating)
-                {
-                    this.DelayedTryHide();
-                }
-            }
-        }
-
-        private void OnFloatingAnnotationIsKeyboardFocusWithinChanged(object sender, DependencyPropertyChangedEventArgs e)
-        {
-            if (!this.FloatingAnnotation.IsKeyboardFocusWithin)
-            {
-                this.TryHideAnnotation(null, null);
-                if (this.helpService != null)
-                {
-                    this.helpService.RemoveContextAttribute(string.Empty, typeof(Annotation).FullName);
-                    this.helpService.AddContextAttribute(string.Empty, WorkflowViewManager.GetF1HelpTypeKeyword(this.ModelItem.ItemType), ComponentModel.Design.HelpKeywordType.F1Keyword);
-                }
-            }
-            else
-            {
-                Selection.SelectOnly(this.EditingContext, this.ModelItem);
-                if (this.helpService != null)
-                {
-                    this.helpService.RemoveContextAttribute(string.Empty, WorkflowViewManager.GetF1HelpTypeKeyword(this.ModelItem.ItemType));
-                    this.helpService.AddContextAttribute(string.Empty, typeof(Annotation).FullName, ComponentModel.Design.HelpKeywordType.F1Keyword);
-                }
-            }
-        }
-
-        private void OnIndicatorIsMouseOverChanged(object sender, EventArgs e)
-        {
-            if (this.Indicator.IsMouseOver)
-            {
-                if (this.status == AnnotationStatus.Hidden)
-                {
-                    this.ShowAnnotation();
-                }
-            }
-            else
-            {
-                if (this.status == AnnotationStatus.Floating)
-                {
-                    this.DelayedTryHide();
-                }
-            }
-        }
-
-        private void OnDockButtonClicked()
-        {
-            this.DockAnnotation();
-        }
-
-        private bool CanInitialize()
-        {
-            return this.ModelItem != null &&
-                   this.EditingContext != null &&
-                   this.AnnotationVisualProvider != null &&
-                   this.EditingContext.Services.GetService<DesignerConfigurationService>().AnnotationEnabled;
-        }
-
-        private void TryHideAnnotation(object sender, EventArgs e)
-        {
-            DispatcherTimer timer = sender as DispatcherTimer;
-            if (timer != null)
-            {
-                timer.Stop();
-            }
-
-            if (this.status == AnnotationStatus.Floating)
-            {
-                if (!this.FloatingAnnotation.IsMouseOver &&
-                    !this.Indicator.IsMouseOver &&
-                    !this.FloatingAnnotation.IsKeyboardFocusWithin)
-                {
-                    this.HideAnnotation();
-                }
-            }
-        }
-
-        private void DelayedTryHide()
-        {
-            if (this.TryHideTimer.IsEnabled)
-            {
-                this.TryHideTimer.Stop();
-            }
-
-            this.TryHideTimer.Start();
-        }
-
-        private void ShowAnnotation()
-        {
-            System.Diagnostics.Debug.WriteLine("ShowAnnotation called.");
-
-            switch (this.status)
-            {
-                case AnnotationStatus.Floating:
-                    return;
-                case AnnotationStatus.Hidden:
-                    this.AnnotationAdornerService.Show(this.AnnotationAdorner);
-                    break;
-                case AnnotationStatus.Docked:
-                    if (this.Indicator != null)
-                    {
-                        this.Indicator.Visibility = Visibility.Visible;
-                    }
-
-                    this.DockedAnnotation.Visibility = Visibility.Collapsed;
-
-                    this.AnnotationAdornerService.Show(this.AnnotationAdorner);
-                    break;
-            }
-
-            this.status = AnnotationStatus.Floating;
-            this.IsAnnotationDocked = false;
-        }
-
-        private void HideAnnotation()
-        {
-            System.Diagnostics.Debug.WriteLine("HideAnnotation called.");
-
-            if (this.status == AnnotationStatus.Hidden)
-            {
-                return;
-            }
-
-            if (this.status == AnnotationStatus.Floating)
-            {
-                this.FloatingAnnotation.UpdateModelItem();
-                this.AnnotationAdornerService.Hide(this.AnnotationAdorner);
-            }
-
-            if (this.status == AnnotationStatus.Docked)
-            {
-                this.Indicator.Visibility = Visibility.Visible;
-
-                this.DockedAnnotation.Visibility = Visibility.Collapsed;
-            }
-
-            this.status = AnnotationStatus.Hidden;
-            this.IsAnnotationDocked = false;
-        }
-
-        private void DockAnnotation()
-        {
-            System.Diagnostics.Debug.WriteLine("DockAnnotation called.");
-
-            if (this.status == AnnotationStatus.Docked)
-            {
-                return;
-            }
-
-            if (this.status == AnnotationStatus.Floating)
-            {
-                this.AnnotationAdornerService.Hide(this.AnnotationAdorner);
-            }
-
-            this.Indicator.Visibility = Visibility.Collapsed;
-            this.DockedAnnotation.Visibility = Visibility.Visible;
-
-            this.status = AnnotationStatus.Docked;
-            this.IsAnnotationDocked = true;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/AnnotationStatus.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/AnnotationStatus.cs
deleted file mode 100644 (file)
index eb6a3c3..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Annotations
-{
-    internal enum AnnotationStatus
-    {
-        Hidden = 0,
-        Floating,
-        Docked
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/DockedAnnotationView.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/DockedAnnotationView.xaml.cs
deleted file mode 100644 (file)
index e1018c4..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Annotations
-{
-    using System.Windows;
-    using System.Windows.Controls;
-
-    internal partial class DockedAnnotationView : UserControl, IDockedAnnotation
-    {
-        public static readonly DependencyProperty IsReadOnlyProperty = DependencyProperty.Register("IsReadOnly", typeof(bool), typeof(DockedAnnotationView));
-
-        private static DependencyProperty annotationTextProperty = DependencyProperty.Register("AnnotationText", typeof(string), typeof(DockedAnnotationView), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
-
-        public DockedAnnotationView()
-        {
-            this.InitializeComponent();
-        }
-
-        public event Action UndockButtonClicked;
-
-        public static DependencyProperty AnnotationTextProperty
-        {
-            get { return annotationTextProperty; }
-        }
-
-        public bool IsReadOnly
-        {
-            get { return (bool)GetValue(IsReadOnlyProperty); }
-            set { SetValue(IsReadOnlyProperty, value); }
-        }
-
-        public string AnnotationText
-        {
-            get { return (string)GetValue(AnnotationTextProperty); }
-            set { SetValue(AnnotationTextProperty, value); }
-        }
-
-        public void FocusOnContent()
-        {
-            this.textBox.Focus();
-        }
-
-        protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
-        {
-            base.OnPropertyChanged(e);
-
-            if (e.Property.Name == "IsMouseOver" || e.Property.Name == "IsKeyboardFocusWithin")
-            {
-                if (this.IsMouseOver || this.IsKeyboardFocusWithin)
-                {
-                    this.undockButton.Visibility = Visibility.Visible;
-                    this.border.Visibility = Visibility.Visible;
-                }
-                else
-                {
-                    this.undockButton.Visibility = Visibility.Hidden;
-                    this.border.Visibility = Visibility.Hidden;
-                }
-            }
-        }
-
-        protected override void OnContextMenuOpening(ContextMenuEventArgs e)
-        {
-            e.Handled = true;
-        }
-
-        private void OnUndockButtonClicked(object sender, RoutedEventArgs e)
-        {
-            if (this.UndockButtonClicked != null)
-            {
-                this.UndockButtonClicked();
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/FloatingAnnotationView.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/FloatingAnnotationView.xaml.cs
deleted file mode 100644 (file)
index 83c6c45..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Annotations
-{
-    using System.Activities.Presentation.Model;
-    using System.ComponentModel;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Windows.Input;
-
-    internal sealed partial class FloatingAnnotationView : UserControl, IFloatingAnnotation
-    {
-        public static readonly DependencyProperty ModelItemProperty = DependencyProperty.Register("ModelItem", typeof(ModelItem), typeof(FloatingAnnotationView));
-
-        public static readonly DependencyProperty IsReadOnlyProperty = DependencyProperty.Register("IsReadOnly", typeof(bool), typeof(FloatingAnnotationView));
-
-        private bool focusOnLoad;
-
-        public FloatingAnnotationView()
-        {
-            this.InitializeComponent();
-            this.Loaded += new RoutedEventHandler(this.OnFloatingAnnotationViewLoaded);
-        }
-
-        public event Action DockButtonClicked;
-
-        public event EventHandler IsMouseOverChanged
-        {
-            add
-            {
-                DependencyPropertyDescriptor descriptor = DependencyPropertyDescriptor.FromProperty(UIElement.IsMouseOverProperty, typeof(UIElement));
-                descriptor.AddValueChanged(this, value);
-            }
-
-            remove
-            {
-                DependencyPropertyDescriptor descriptor = DependencyPropertyDescriptor.FromProperty(UIElement.IsMouseOverProperty, typeof(UIElement));
-                descriptor.RemoveValueChanged(this, value);
-            }
-        }
-
-        public bool IsReadOnly
-        {
-            get { return (bool)GetValue(IsReadOnlyProperty); }
-            set { SetValue(IsReadOnlyProperty, value); }
-        }
-
-        public ModelItem ModelItem
-        {
-            get { return (ModelItem)GetValue(ModelItemProperty); }
-            set { SetValue(ModelItemProperty, value); }
-        }
-
-        public void FocusOnContent()
-        {
-            if (this.annotationTextBox.Focus() != true)
-            {
-                this.focusOnLoad = true;
-            }
-        }
-
-        public void UpdateModelItem()
-        {
-            BindingExpression be = this.annotationTextBox.GetBindingExpression(TextBox.TextProperty);
-            be.UpdateSource();
-        }
-
-        protected override void OnContextMenuOpening(ContextMenuEventArgs e)
-        {
-            e.Handled = true;
-        }
-
-        private void OnFloatingAnnotationViewLoaded(object sender, RoutedEventArgs e)
-        {
-            if (this.focusOnLoad)
-            {
-                Keyboard.Focus(this.annotationTextBox);
-                this.focusOnLoad = false;
-            }
-        }
-
-        private void OnDockButtonClicked(object sender, RoutedEventArgs e)
-        {
-            if (this.DockButtonClicked != null)
-            {
-                this.DockButtonClicked();
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/IAnnotationIndicator.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/IAnnotationIndicator.cs
deleted file mode 100644 (file)
index 3af1567..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Annotations
-{
-    using System.Windows;
-
-    internal interface IAnnotationIndicator
-    {
-        event EventHandler IsMouseOverChanged;
-
-        bool IsMouseOver
-        {
-            get;
-        }
-
-        Visibility Visibility
-        {
-            set;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/IAnnotationVisualProvider.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/IAnnotationVisualProvider.cs
deleted file mode 100644 (file)
index 3070ffc..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Annotations
-{
-    internal interface IAnnotationVisualProvider
-    {
-        IAnnotationIndicator GetAnnotationIndicator();
-
-        IFloatingAnnotation GetFloatingAnnotation();
-
-        IDockedAnnotation GetDockedAnnotation();
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/IDockedAnnotation.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/IDockedAnnotation.cs
deleted file mode 100644 (file)
index 658c833..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-//---------------------------------------------------------------------------
-// <copyright file="IDockedAnnotation.cs" company="Microsoft">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//---------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Annotations
-{
-    using System.Windows;
-
-    internal interface IDockedAnnotation
-    {
-        event Action UndockButtonClicked;
-
-        bool IsReadOnly
-        {
-            set;
-        }
-
-        Visibility Visibility
-        {
-            set;
-        }
-
-        void FocusOnContent();
-    }
-}
\ No newline at end of file
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/IFloatingAnnotation.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/IFloatingAnnotation.cs
deleted file mode 100644 (file)
index 2ad648b..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Annotations
-{
-    using System;
-    using System.Activities.Presentation.Model;
-    using System.Windows;
-
-    internal interface IFloatingAnnotation
-    {
-        event DependencyPropertyChangedEventHandler IsKeyboardFocusWithinChanged;
-
-        event EventHandler IsMouseOverChanged;
-
-        event Action DockButtonClicked;
-
-        bool IsReadOnly
-        {
-            set;
-        }
-
-        ModelItem ModelItem
-        {
-            get;
-            set;
-        }
-
-        bool IsKeyboardFocusWithin
-        {
-            get;
-        }
-
-        bool IsMouseOver
-        {
-            get;
-        }
-
-        void FocusOnContent();
-
-        void UpdateModelItem();
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/NotifyArgumentVariableAnnotationTextChanged.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/NotifyArgumentVariableAnnotationTextChanged.cs
deleted file mode 100644 (file)
index d4ff80c..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Annotations
-{
-    using System;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.View;
-
-    // This is to workaround a bug that updating ModelItem from outside of ArgumentDesigner/VariableDesigner will not update it.
-    internal class NotifyArgumentVariableAnnotationTextChanged : Change
-    {
-        public ArgumentDesigner ArgumentDesigner { get; set; }
-
-        public VariableDesigner VariableDesigner { get; set; }
-
-        public override string Description
-        {
-            get { return SR.NotifyAnnotationTextChangedDescription; }
-        }
-
-        public override bool Apply()
-        {
-            this.VariableDesigner.Dispatcher.BeginInvoke(
-                new Action(() =>
-                    {
-                        this.VariableDesigner.NotifyAnnotationTextChanged();
-                        this.ArgumentDesigner.NotifyAnnotationTextChanged();
-                    }),
-                Windows.Threading.DispatcherPriority.ApplicationIdle,
-                null);
-            return true;
-        }
-
-        public override Change GetInverse()
-        {
-            return new NotifyArgumentVariableAnnotationTextChanged()
-            {
-                VariableDesigner = this.VariableDesigner,
-                ArgumentDesigner = this.ArgumentDesigner,
-            };
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/UIElementToAnnotationIndicatorAdapter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/UIElementToAnnotationIndicatorAdapter.cs
deleted file mode 100644 (file)
index 43c9843..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Annotations
-{
-    using System;
-    using System.ComponentModel;
-    using System.Windows;
-
-    internal class UIElementToAnnotationIndicatorAdapter : IAnnotationIndicator
-    {
-        private UIElement element;
-
-        public UIElementToAnnotationIndicatorAdapter(UIElement element)
-        {
-            if (element == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("element"));
-            }
-
-            this.element = element;
-        }
-
-        public event EventHandler IsMouseOverChanged
-        {
-            add
-            {
-                DependencyPropertyDescriptor descriptor = DependencyPropertyDescriptor.FromProperty(UIElement.IsMouseOverProperty, typeof(UIElement));
-                descriptor.AddValueChanged(this.element, value);
-            }
-
-            remove
-            {
-                DependencyPropertyDescriptor descriptor = DependencyPropertyDescriptor.FromProperty(UIElement.IsMouseOverProperty, typeof(UIElement));
-                descriptor.RemoveValueChanged(this.element, value);
-            }
-        }
-
-        public bool IsMouseOver
-        {
-            get
-            {
-                return this.element.IsMouseOver;
-            }
-        }
-
-        public Visibility Visibility
-        {
-            set
-            {
-                this.element.Visibility = value;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/WorkflowAnnotationAdornerService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/WorkflowAnnotationAdornerService.cs
deleted file mode 100644 (file)
index c21dbea..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Annotations
-{
-    using System.Activities.Presentation.Model;
-    using System.Windows.Controls;
-    using System.Windows.Documents;
-    using System.Xaml;
-
-    internal class WorkflowAnnotationAdornerService : AnnotationAdornerService
-    {
-        private ScrollViewer scrollViewer;
-        private bool enabled;
-
-        internal WorkflowAnnotationAdornerService()
-        {
-        }
-
-        public override void Show(AnnotationAdorner adorner)
-        {
-            if (!this.enabled)
-            {
-                return;
-            }
-
-            AnnotationAdorner.SetAnchor(adorner, AdornerLocation.None);
-            adorner.ScrollViewer = this.scrollViewer;
-
-            AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(adorner.AdornedElement);
-            if (adornerLayer != null)
-            {
-                adornerLayer.Add(adorner);
-            }
-
-            return;
-        }
-
-        public override void Hide(AnnotationAdorner adorner)
-        {
-            if (!this.enabled)
-            {
-                return;
-            }
-
-            AnnotationAdorner.SetAnchor(adorner, AdornerLocation.None);
-
-            AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(adorner.AdornedElement);
-            if (adornerLayer != null)
-            {
-                adornerLayer.Remove(adorner);
-            }
-            
-            return;
-        }
-
-        internal void Initialize(EditingContext editingContext, ScrollViewer scrollViewer)
-        {
-            this.scrollViewer = scrollViewer;
-            this.enabled = editingContext.Services.GetService<DesignerConfigurationService>().AnnotationEnabled;
-
-            if (!this.enabled)
-            {
-                return;
-            }
-
-            AttachedPropertiesService attachedPropertiesService = editingContext.Services.GetService<AttachedPropertiesService>();
-            AttachedProperty<string> attachedProperty = new AttachedProperty<string>
-            {
-                IsBrowsable = false,
-                IsVisibleToModelItem = true,
-                Name = Annotation.AnnotationTextPropertyName,
-                OwnerType = typeof(object),
-                Getter = (modelItem) =>
-                {
-                    string annotation = null;
-                    AttachablePropertyServices.TryGetProperty<string>(modelItem.GetCurrentValue(), Annotation.AnnotationTextProperty, out annotation);
-                    return annotation;
-                },
-                Setter = (modelItem, value) =>
-                {
-                    string oldValue = null;
-                    AttachablePropertyServices.TryGetProperty<string>(modelItem.GetCurrentValue(), Annotation.AnnotationTextProperty, out oldValue);
-                    if (oldValue == value)
-                    {
-                        return;
-                    }
-
-                    ModelTreeManager treeManager = modelItem.GetEditingContext().Services.GetService<ModelTreeManager>();
-
-                    AttachablePropertyChange change = new AttachablePropertyChange()
-                    {
-                        Owner = modelItem,
-                        AttachablePropertyIdentifier = Annotation.AnnotationTextProperty,
-                        OldValue = oldValue,
-                        NewValue = value,
-                        PropertyName = Annotation.AnnotationTextPropertyName
-                    };
-
-                    treeManager.AddToCurrentEditingScope(change);
-                }
-            };
-
-            attachedPropertiesService.AddProperty(attachedProperty);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ArgumentAccessor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ArgumentAccessor.cs
deleted file mode 100644 (file)
index e3bfc87..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-
-    /// <summary>
-    /// A class containing a get/set delegate pair to access an argument in an activity instance.
-    /// </summary>
-    public class ArgumentAccessor
-    {
-        /// <summary>
-        /// Gets or sets the method to retrieve an argument from an activity instance.
-        /// </summary>
-        public Func<Activity, Argument> Getter { get; set; }
-
-        /// <summary>
-        /// Gets or sets the method to set an argument into an activity instance.
-        /// </summary>
-        public Action<Activity, Argument> Setter { get; set; }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/ContextItem.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/ContextItem.cs
deleted file mode 100644 (file)
index 977c81a..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation 
-{
-    using System.Diagnostics.CodeAnalysis;
-
-
-    using System;
-    using System.Collections.Generic;
-
-    // <summary>
-    // The ContextItem class is the base class from which all context items must derive.
-    // </summary>
-    public abstract class ContextItem 
-    {
-
-        // <summary>
-        // Creates a new ContextItem.
-        // </summary>
-        protected ContextItem() 
-        {
-        }
-
-        // <summary>
-        // Returns the item type for this editing context item.  Context items are
-        // considered unique based on their item type.  By using ItemType to identify
-        // a type of context item we allow several derived versions of context items to
-        // be cataloged under the same key in the editing context.
-        // </summary>
-        // <value></value>
-        public abstract Type ItemType 
-        { get; }
-
-        // <summary>
-        // This method is called on a context item before it is stored in the context item
-        // manager.  The previous item in the context item manager is passed.
-        // </summary>
-        // <param name="context">The editing context that is making this change.</param>
-        // <param name="previousItem">The previously active item in the context.  Because items must have default constructors a default item will be fabricated if an item is first passed into the context.</param>
-        // <returns></returns>
-        protected virtual void OnItemChanged(EditingContext context, ContextItem previousItem) 
-        {
-        }
-
-        //
-        // Internal API that calls OnItemChanged.  This is invoked from the
-        // abstract ContextItemManager class so deriving classes can still
-        // invoke it.
-        //
-        internal void InvokeOnItemChanged(EditingContext context, ContextItem previousItem) 
-        {
-            OnItemChanged(context, previousItem);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/ContextItemManager.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/ContextItemManager.cs
deleted file mode 100644 (file)
index 5870193..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation 
-{
-
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Activities.Presentation;
-
-    using System.Runtime;
-
-    // <summary>
-    // The ContextItemManager class maintains a set of context items.  A context
-    // item represents a piece of transient state in a designer.
-    //
-    // ContextItems must define an empty constructor.  This empty constructor
-    // version of a context item represents its default value, and will be the
-    // value returned from GetItem if the context item manager does not contain
-    // a context item of the requested type.
-    //
-    // The ContextItemManager supports context layers.  A context layer is a
-    // separation in the set of context items and is useful when providing modal
-    // functions.  For example, when switching modes in the designer to show the
-    // tab order layout it may be desirable to disable adding items from the
-    // toolbox and change the user mouse and keyboard gestures to focus on setting
-    // the tab order.  Rather than grabbing and storing context items before
-    // replacing them with new values, a developer can simply call CreateLayer.
-    // Once the layer is created, all subsequent context changes go to that layer.
-    //
-    // When the developer is done with the layer, as would be the case when a user
-    // switches out of tab order mode, she simply calls Remove on the layer. This
-    // removes all context items that were added to the layer and restores the context
-    // to its previous set of values before the layer was created.
-    // </summary>
-    [SuppressMessage(FxCop.Category.Naming, FxCop.Rule.IdentifiersShouldHaveCorrectSuffix)]
-    public abstract class ContextItemManager : IEnumerable<ContextItem>
-    {
-
-        // <summary>
-        // Creates a new ContextItemManager object.
-        // </summary>
-        protected ContextItemManager() 
-        {
-        }
-
-        // <summary>
-        // Returns true if the item manager contains an item of the given type.
-        // </summary>
-        // <param name="itemType">The type of item to check.</param>
-        // <returns>True if the context contains an instance of this item type.</returns>
-        // <exception cref="ArgumentNullException">if itemType is null.</exception>
-        public abstract bool Contains(Type itemType);
-
-        // <summary>
-        // Returns true if the item manager contains an item of the given type.
-        // </summary>
-        // <typeparam name="TItemType">The type of item to check.</typeparam>
-        // <returns>True if the context contains an instance of this item type.</returns>
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.GenericMethodsShouldProvideTypeParameter)]
-        public bool Contains<TItemType>() where TItemType : ContextItem
-        {
-            return Contains(typeof(TItemType));
-        }
-
-        // <summary>
-        // Enumerates the context items in the editing context.  This enumeration
-        // includes prior layers unless the enumerator hits an isolated layer.
-        // Enumeration is typically not useful in most scenarios but it is provided so
-        // that developers can search in the context and learn what is placed in it.
-        // </summary>
-        // <returns>An enumeration of context items.</returns>
-        public abstract IEnumerator<ContextItem> GetEnumerator();
-
-        // <summary>
-        // Returns an instance of the requested item type.  If there is no context
-        // item with the given type, an empty item will be created.
-        // </summary>
-        // <param name="itemType">The type of item to return.</param>
-        // <returns>A context item of the requested type.  If there is no item in the context of this type a default one will be created.</returns>
-        // <exception cref="ArgumentNullException">if itemType is null.</exception>
-        public abstract ContextItem GetValue(Type itemType);
-
-        // <summary>
-        // Returns an instance of the requested item type.  If there is no context
-        // item with the given type, an empty item will be created.
-        // </summary>
-        // <typeparam name="TItemType">The type of item to return.</typeparam>
-        // <returns>A context item of the requested type.  If there is no item in the context of this type a default one will be created.</returns>
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.GenericMethodsShouldProvideTypeParameter)]
-        public TItemType GetValue<TItemType>() where TItemType : ContextItem
-        {
-            return (TItemType)GetValue(typeof(TItemType));
-        }
-
-        // <summary>
-        // This is a helper method that invokes the protected OnItemChanged
-        // method on ContextItem.
-        // </summary>
-        // <param name="context">The editing context in use.</param>
-        // <param name="item">The new context item.</param>
-        // <param name="previousItem">The previous context item.</param>
-        // <exception cref="ArgumentNullException">if context, item or previousItem is null.</exception>
-        protected static void NotifyItemChanged(EditingContext context, ContextItem item, ContextItem previousItem) 
-        {
-            if (context == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("context");
-            }
-            if (item == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("item");
-            }
-            if (previousItem == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("previousItem");
-            }
-            item.InvokeOnItemChanged(context, previousItem);
-        }
-
-        // <summary>
-        // This sets a context item to the given value.  It is illegal to pass
-        // null here.  If you want to set a context item to its empty value create
-        // an instance of the item using a default constructor.
-        // </summary>
-        // <param name="value">The value to set into the context item manager.</param>
-        public abstract void SetValue(ContextItem value);
-
-        // <summary>
-        // Adds an event callback that will be invoked with a context item of the given item type changes.
-        // </summary>
-        // <param name="contextItemType">The type of item you wish to subscribe to.</param>
-        // <param name="callback">A callback that will be invoked when contextItemType changes.</param>
-        // <exception cref="ArgumentNullException">if contextItemType or callback is null.</exception>
-        public abstract void Subscribe(Type contextItemType, SubscribeContextCallback callback);
-
-        // <summary>
-        // Adds an event callback that will be invoked with a context item of the given item type changes.
-        // </summary>
-        // <typeparam name="TContextItemType">The type of item you wish to subscribe to.</typeparam>
-        // <param name="callback">A callback that will be invoked when contextItemType changes.</param>
-        // <exception cref="ArgumentNullException">if callback is null.</exception>
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.GenericMethodsShouldProvideTypeParameter)]
-        public void Subscribe<TContextItemType>(SubscribeContextCallback<TContextItemType> callback) where TContextItemType : ContextItem
-        {
-            if (callback == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("callback");
-            }
-            SubscribeProxy<TContextItemType> proxy = new SubscribeProxy<TContextItemType>(callback);
-            Subscribe(typeof(TContextItemType), proxy.Callback);
-        }
-
-        // <summary>
-        //     Removes a subscription.
-        // </summary>
-        // <typeparam name="TContextItemType">The type of context item to remove the callback from.</typeparam>
-        // <param name="callback">The callback to remove.</param>
-        // <exception cref="ArgumentNullException">if callback is null.</exception>
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.GenericMethodsShouldProvideTypeParameter)]
-        public void Unsubscribe<TContextItemType>(SubscribeContextCallback<TContextItemType> callback) where TContextItemType : ContextItem
-        {
-            if (callback == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("callback");
-            }
-            SubscribeProxy<TContextItemType> proxy = new SubscribeProxy<TContextItemType>(callback);
-            Unsubscribe(typeof(TContextItemType), proxy.Callback);
-        }
-
-        // <summary>
-        //     Removes a subscription.
-        // </summary>
-        // <param name="contextItemType">The type of context item to remove the callback from.</param>
-        // <param name="callback">The callback to remove.</param>
-        // <exception cref="ArgumentNullException">if contextItemType or callback is null.</exception>
-        public abstract void Unsubscribe(Type contextItemType, SubscribeContextCallback callback);
-
-        // <summary>
-        //     This is a helper method that returns the target object for a delegate.
-        //     If the delegate was created to proxy a generic delegate, this will correctly
-        //     return the original object, not the proxy.
-        // </summary>
-        // <param name="callback">The callback whose target you want.</param>
-        // <exception cref="ArgumentNullException">if callback is null.</exception>
-        // <returns>The target object of the callback.</returns>
-        protected static object GetTarget(Delegate callback) 
-        {
-            if (callback == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("callback");
-            }
-
-            ICallbackProxy proxy = callback.Target as ICallbackProxy;
-            if (proxy != null) 
-            {
-                return proxy.OriginalTarget;
-            }
-
-            return callback.Target;
-        }
-
-        // <summary>
-        //     This is a helper method that performs a Delegate.Remove, but knows
-        //     how to unwrap delegates that are proxies to generic callbacks.  Use
-        //     this in your Unsubscribe implementations.
-        // </summary>
-        // <param name="existing">The existing delegate.</param>
-        // <param name="toRemove">The delegate to be removed from existing.</param>
-        // <returns>The new delegate that should be assigned to existing.</returns>
-        protected static Delegate RemoveCallback(Delegate existing, Delegate toRemove) 
-        {
-            if (existing == null) 
-            {
-                return null;
-            }
-            if (toRemove == null) 
-            {
-                return existing;
-            }
-
-            ICallbackProxy toRemoveProxy = toRemove.Target as ICallbackProxy;
-            if (toRemoveProxy == null) 
-            {
-                // The item to be removed is a normal delegate.  Just call
-                // Delegate.Remove
-                return Delegate.Remove(existing, toRemove);
-            }
-
-            toRemove = toRemoveProxy.OriginalDelegate;
-
-            Delegate[] invocationList = existing.GetInvocationList();
-            bool removedItems = false;
-
-            for (int idx = 0; idx < invocationList.Length; idx++) 
-            {
-                Delegate item = invocationList[idx];
-                ICallbackProxy itemProxy = item.Target as ICallbackProxy;
-                if (itemProxy != null) 
-                {
-                    item = itemProxy.OriginalDelegate;
-                }
-
-                if (item.Equals(toRemove)) 
-                {
-                    invocationList[idx] = null;
-                    removedItems = true;
-                }
-            }
-
-            if (removedItems) 
-            {
-                // We must create a new delegate containing the 
-                // invocation list that is is left
-                existing = null;
-                foreach (Delegate d in invocationList) 
-                {
-                    if (d != null) 
-                    {
-                        if (existing == null) 
-                        {
-                            existing = d;
-                        }
-                        else 
-                        {
-                            existing = Delegate.Combine(existing, d);
-                        }
-                    }
-                }
-            }
-
-            return existing;
-        }
-
-        // <summary>
-        // Implementation of default IEnumerable.
-        // </summary>
-        IEnumerator IEnumerable.GetEnumerator() 
-        {
-            return GetEnumerator();
-        }
-
-        private interface ICallbackProxy 
-        {
-            Delegate OriginalDelegate 
-            { get; }
-            object OriginalTarget 
-            { get; }
-        }
-
-        // <summary>
-        // This is a simple proxy that converts a non-generic subscribe callback to a generic
-        // one.
-        // </summary>
-        // <typeparam name="TContextItemType"></typeparam>
-        private class SubscribeProxy<TContextItemType> : ICallbackProxy where TContextItemType : ContextItem 
-        {
-            private SubscribeContextCallback<TContextItemType> _genericCallback;
-
-            internal SubscribeProxy(SubscribeContextCallback<TContextItemType> callback) 
-            {
-                _genericCallback = callback;
-            }
-
-            internal SubscribeContextCallback Callback 
-            {
-                get {
-                    return new SubscribeContextCallback(SubscribeContext);
-                }
-            }
-
-            Delegate ICallbackProxy.OriginalDelegate 
-            {
-                get { return _genericCallback; }
-            }
-
-            object ICallbackProxy.OriginalTarget 
-            {
-                get {
-                    return _genericCallback.Target;
-                }
-            }
-
-            private void SubscribeContext(ContextItem item) 
-            {
-                if (item == null) 
-                {
-                    throw FxTrace.Exception.ArgumentNull("item");
-                }
-                _genericCallback((TContextItemType)item);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/EditingContext.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/EditingContext.cs
deleted file mode 100644 (file)
index 923712d..0000000
+++ /dev/null
@@ -1,783 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation 
-{
-    using System.Activities.Presentation.Internal.Properties;
-    using System;
-    using System.Runtime;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Text;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // The EditingContext class contains contextual state about a designer.  This includes permanent
-    // state such as list of services running in the designer.
-    // It also includes transient state consisting of context items.  Examples of transient
-    // context item state include the set of currently selected objects as well as the editing tool
-    // being used to manipulate objects on the design surface.
-    //
-    // The editing context is designed to be a concrete class for ease of use.  It does have a protected
-    // API that can be used to replace its implementation.
-    // </summary>
-    public class EditingContext : IDisposable 
-    {
-
-        private ContextItemManager _contextItems;
-        private ServiceManager _services;
-
-        // <summary>
-        // Creates a new editing context.
-        // </summary>
-        public EditingContext() 
-        {
-        }
-
-       
-        // <summary>
-        // The Disposing event gets fired just before the context gets disposed.
-        // </summary>
-        public event EventHandler Disposing;
-
-        // <summary>
-        // Returns the local collection of context items offered by this editing context.
-        // </summary>
-        // <value></value>
-        public ContextItemManager Items 
-        {
-            get {
-                if (_contextItems == null) 
-                {
-                    _contextItems = CreateContextItemManager();
-                    if (_contextItems == null) 
-                    {
-                        throw FxTrace.Exception.AsError(new InvalidOperationException(
-                            string.Format(CultureInfo.CurrentCulture, Resources.Error_NullImplementation, "CreateContextItemManager")));
-                    }
-                }
-
-                return _contextItems;
-            }
-        }
-
-        // <summary>
-        // Returns the service manager for this editing context.
-        // </summary>
-        // <value></value>
-        public ServiceManager Services 
-        {
-            get {
-                if (_services == null) 
-                {
-                    _services = CreateServiceManager();
-                    if (_services == null) 
-                    {
-                        throw FxTrace.Exception.AsError(new InvalidOperationException(
-                            string.Format(CultureInfo.CurrentCulture, Resources.Error_NullImplementation, "CreateServiceManager")));
-                    }
-                }
-
-                return _services;
-            }
-        }
-
-        // <summary>
-        // Creates an instance of the context item manager to be returned from
-        // the ContextItems property.  The default implementation creates a
-        // ContextItemManager that supports delayed activation of design editor
-        // managers through the declaration of a SubscribeContext attribute on
-        // the design editor manager.
-        // </summary>
-        // <returns>Returns an implementation of the ContextItemManager class.</returns>
-        protected virtual ContextItemManager CreateContextItemManager() 
-        {
-            return new DefaultContextItemManager(this);
-        }
-
-        // <summary>
-        // Creates an instance of the service manager to be returned from the
-        // Services property. The default implementation creates a ServiceManager
-        // that supports delayed activation of design editor managers through the
-        // declaration of a SubscribeService attribute on the design editor manager.
-        // </summary>
-        // <returns>Returns an implemetation of the ServiceManager class.</returns>
-        protected virtual ServiceManager CreateServiceManager() 
-        {
-            return new DefaultServiceManager();
-        }
-
-        // <summary>
-        // Disposes this editing context.
-        // </summary>
-        public void Dispose() 
-        {
-            Dispose(true);
-            GC.SuppressFinalize(this);
-        }
-
-        // <summary>
-        // Disposes this editing context.
-        // <param name="disposing">True if this object is being disposed, or false if it is finalizing.</param>
-        // </summary>
-        protected virtual void Dispose(bool disposing) 
-        {
-            if (disposing) 
-            {
-                // Let any interested parties know the context is being disposed
-                if (Disposing != null)
-                {
-                    Disposing(this, EventArgs.Empty);
-                }
-
-                IDisposable d = _services as IDisposable;
-                if (d != null) 
-                {
-                    d.Dispose();
-                }
-
-                d = _contextItems as IDisposable;
-                if (d != null) 
-                {
-                    d.Dispose();
-                }
-            }
-        }
-
-        // <summary>
-        // This is the default context item manager for our editing context.
-        // </summary>
-        private sealed class DefaultContextItemManager : ContextItemManager 
-        {
-            private EditingContext _context;
-            private DefaultContextLayer _currentLayer;
-            private Dictionary<Type, SubscribeContextCallback> _subscriptions;
-
-            internal DefaultContextItemManager(EditingContext context) 
-            {
-                _context = context;
-                _currentLayer = new DefaultContextLayer(null);
-            }
-
-            // <summary>
-            // This changes a context item to the given value.  It is illegal to pass
-            // null here.  If you want to set a context item to its empty value create
-            // an instance of the item using a default constructor.
-            // </summary>
-            // <param name="value"></param>
-            public override void SetValue(ContextItem value) 
-            {
-                if (value == null) 
-                {
-                    throw FxTrace.Exception.ArgumentNull("value");
-                }
-
-                // The rule for change is that we store the new value,
-                // raise a change on the item, and then raise a change
-                // to everyone else.  If changing the item fails, we recover
-                // the previous item.
-                ContextItem existing, existingRawValue;
-                existing = existingRawValue = GetValueNull(value.ItemType);
-
-                if (existing == null) 
-                {
-                    existing = GetValue(value.ItemType);
-                }
-
-                bool success = false;
-
-                try 
-                {
-                    _currentLayer.Items[value.ItemType] = value;
-                    NotifyItemChanged(_context, value, existing);
-                    success = true;
-                }
-                finally 
-                {
-                    if (success) 
-                    {
-                        OnItemChanged(value);
-                    }
-                    else 
-                    {
-                        // The item threw during its transition to 
-                        // becoming active.  Put the old one back.
-                        // We must put the old one back by re-activating
-                        // it.  This could throw a second time, so we
-                        // cover this case by removing the value first.
-                        // Should it throw again, we won't recurse because
-                        // the existing raw value would be null.
-
-                        _currentLayer.Items.Remove(value.ItemType);
-                        if (existingRawValue != null) 
-                        {
-                            SetValue(existingRawValue);
-                        }
-                    }
-                }
-            }
-
-            // <summary>
-            // Returns true if the item manager contains an item of the given type.
-            // This only looks in the current layer.
-            // </summary>
-            // <param name="itemType"></param>
-            // <returns></returns>
-            public override bool Contains(Type itemType) 
-            {
-                if (itemType == null) 
-                {
-                    throw FxTrace.Exception.ArgumentNull("itemType");
-                }
-                if (!typeof(ContextItem).IsAssignableFrom(itemType)) 
-                {
-                    throw FxTrace.Exception.AsError(new ArgumentException(
-                        string.Format(CultureInfo.CurrentCulture,
-                        Resources.Error_ArgIncorrectType,
-                        "itemType", typeof(ContextItem).FullName)));
-                }
-
-                return _currentLayer.Items.ContainsKey(itemType);
-            }
-
-            // <summary>
-            // Returns an instance of the requested item type.  If there is no context
-            // item with the given type, an empty item will be created.
-            // </summary>
-            // <param name="itemType"></param>
-            // <returns></returns>
-            public override ContextItem GetValue(Type itemType) 
-            {
-
-                ContextItem item = GetValueNull(itemType);
-
-                if (item == null) 
-                {
-
-                    // Check the default item table and add a new
-                    // instance there if we need to
-                    if (!_currentLayer.DefaultItems.TryGetValue(itemType, out item)) 
-                    {
-                        item = (ContextItem)Activator.CreateInstance(itemType);
-
-                        // Verify that the resulting item has the correct item type
-                        // If it doesn't, it means that the user provided a derived
-                        // item type
-                        if (item.ItemType != itemType) 
-                        {
-                            throw FxTrace.Exception.AsError(new ArgumentException(string.Format(
-                                CultureInfo.CurrentCulture,
-                                Resources.Error_DerivedContextItem,
-                                itemType.FullName,
-                                item.ItemType.FullName)));
-                        }
-
-                        // Now push the item in the context so we have
-                        // a consistent reference
-                        _currentLayer.DefaultItems.Add(item.ItemType, item);
-                    }
-                }
-
-                return item;
-            }
-
-            // <summary>
-            // Similar to GetValue, but returns NULL if the item isn't found instead of
-            // creating an empty item.
-            // </summary>
-            // <param name="itemType"></param>
-            // <returns></returns>
-            private ContextItem GetValueNull(Type itemType) 
-            {
-
-                if (itemType == null) 
-                {
-                    throw FxTrace.Exception.ArgumentNull("itemType");
-                }
-                if (!typeof(ContextItem).IsAssignableFrom(itemType)) 
-                {
-                    throw FxTrace.Exception.AsError(new ArgumentException(
-                        string.Format(CultureInfo.CurrentCulture,
-                        Resources.Error_ArgIncorrectType,
-                        "itemType", typeof(ContextItem).FullName)));
-                }
-
-                ContextItem item = null;
-                DefaultContextLayer layer = _currentLayer;
-                while (layer != null && !layer.Items.TryGetValue(itemType, out item)) 
-                {
-                    layer = layer.ParentLayer;
-                }
-
-                return item;
-            }
-
-            // <summary>
-            // Enumerates the context items in the editing context.  This enumeration
-            // includes prior layers unless the enumerator hits an isolated layer.
-            // Enumeration is typically not useful in most scenarios but it is provided so
-            // that developers can search in the context and learn what is placed in it.
-            // </summary>
-            // <returns></returns>
-            public override IEnumerator<ContextItem> GetEnumerator() 
-            {
-                return _currentLayer.Items.Values.GetEnumerator();
-            }
-
-            // <summary>
-            // Called when an item changes value.  This happens in one of two ways:
-            // either the user has called Change, or the user has removed a layer.
-            // </summary>
-            // <param name="item"></param>
-            private void OnItemChanged(ContextItem item) 
-            {
-                SubscribeContextCallback callback;
-
-                Fx.Assert(item != null, "You cannot pass a null item here.");
-
-                if (_subscriptions != null && _subscriptions.TryGetValue(item.ItemType, out callback)) 
-                {
-                    callback(item);
-                }
-            }
-
-            // <summary>
-            // Adds an event callback that will be invoked with a context item of the given item type changes.
-            // </summary>
-            // <param name="contextItemType"></param>
-            // <param name="callback"></param>
-            public override void Subscribe(Type contextItemType, SubscribeContextCallback callback) 
-            {
-                if (contextItemType == null) 
-                {
-                    throw FxTrace.Exception.ArgumentNull("contextItemType");
-                }
-                if (callback == null) 
-                {
-                    throw FxTrace.Exception.ArgumentNull("callback");
-                }
-                if (!typeof(ContextItem).IsAssignableFrom(contextItemType)) 
-                {
-                    throw FxTrace.Exception.AsError(new ArgumentException(
-                        string.Format(CultureInfo.CurrentCulture,
-                        Resources.Error_ArgIncorrectType,
-                        "contextItemType", typeof(ContextItem).FullName)));
-                }
-
-                if (_subscriptions == null) 
-                {
-                    _subscriptions = new Dictionary<Type, SubscribeContextCallback>();
-                }
-
-                SubscribeContextCallback existing = null;
-
-                _subscriptions.TryGetValue(contextItemType, out existing);
-
-                existing = (SubscribeContextCallback)Delegate.Combine(existing, callback);
-                _subscriptions[contextItemType] = existing;
-
-                // If the context is already present, invoke the callback.
-                ContextItem item = GetValueNull(contextItemType);
-
-                if (item != null) 
-                {
-                    callback(item);
-                }
-            }
-
-            // <summary>
-            //     Removes a subscription.
-            // </summary>
-            public override void Unsubscribe(Type contextItemType, SubscribeContextCallback callback) 
-            {
-
-                if (contextItemType == null) 
-                {
-                    throw FxTrace.Exception.ArgumentNull("contextItemType");
-                }
-                if (callback == null) 
-                {
-                    throw FxTrace.Exception.ArgumentNull("callback");
-                }
-                if (!typeof(ContextItem).IsAssignableFrom(contextItemType)) 
-                {
-                    throw FxTrace.Exception.AsError(new ArgumentException(
-                        string.Format(CultureInfo.CurrentCulture,
-                        Resources.Error_ArgIncorrectType,
-                        "contextItemType", typeof(ContextItem).FullName)));
-                }
-                if (_subscriptions != null) 
-                {
-                    SubscribeContextCallback existing;
-                    if (_subscriptions.TryGetValue(contextItemType, out existing)) 
-                    {
-                        existing = (SubscribeContextCallback)RemoveCallback(existing, callback);
-                        if (existing == null) 
-                        {
-                            _subscriptions.Remove(contextItemType);
-                        }
-                        else 
-                        {
-                            _subscriptions[contextItemType] = existing;
-                        }
-                    }
-                }
-            }
-
-            // <summary>
-            // This context layer contains our context items.
-            // </summary>
-            private class DefaultContextLayer 
-            {
-                private DefaultContextLayer _parentLayer;
-                private Dictionary<Type, ContextItem> _items;
-                private Dictionary<Type, ContextItem> _defaultItems;
-
-                internal DefaultContextLayer(DefaultContextLayer parentLayer) 
-                {
-                    _parentLayer = parentLayer; // can be null
-                }
-
-                internal Dictionary<Type, ContextItem> DefaultItems 
-                {
-                    get {
-                        if (_defaultItems == null) 
-                        {
-                            _defaultItems = new Dictionary<Type, ContextItem>();
-                        }
-                        return _defaultItems;
-                    }
-                }
-
-                internal Dictionary<Type, ContextItem> Items 
-                {
-                    get {
-                        if (_items == null) 
-                        {
-                            _items = new Dictionary<Type, ContextItem>();
-                        }
-                        return _items;
-                    }
-                }
-
-                internal DefaultContextLayer ParentLayer 
-                {
-                    get { return _parentLayer; }
-                }
-            }
-        }
-
-        // <summary>
-        // This is the default service manager for our editing context.
-        // </summary>
-        private sealed class DefaultServiceManager : ServiceManager, IDisposable 
-        {
-            private static readonly object _recursionSentinel = new object();
-
-            private Dictionary<Type, object> _services;
-            private Dictionary<Type, SubscribeServiceCallback> _subscriptions;
-
-            internal DefaultServiceManager() 
-            {
-            }
-
-            // <summary>
-            // Returns true if the service manager contains a service of the given type.
-            // </summary>
-            // <param name="serviceType"></param>
-            // <returns></returns>
-            public override bool Contains(Type serviceType) 
-            {
-                if (serviceType == null) 
-                {
-                    throw FxTrace.Exception.ArgumentNull("serviceType");
-                }
-                return (_services != null && _services.ContainsKey(serviceType));
-            }
-
-            // <summary>
-            // Retrieves the requested service.  This method returns null if the service could not be located.
-            // </summary>
-            // <param name="serviceType"></param>
-            // <returns></returns>
-            public override object GetService(Type serviceType)
-            {
-                object result = this.GetPublishedService(serviceType);
-                if (result == null)
-                {
-                    if (this.Contains(typeof(IServiceProvider)))
-                    {
-                        result = this.GetRequiredService<IServiceProvider>().GetService(serviceType);
-                        if (result != null)
-                        {
-                            this.Publish(serviceType, result);
-                        }
-                    }
-                }
-                return result;
-            }
-
-            object GetPublishedService(Type serviceType)
-            {
-                object service = null;
-
-                if (serviceType == null) 
-                {
-                    throw FxTrace.Exception.ArgumentNull("serviceType");
-                }
-
-                if (_services != null && _services.TryGetValue(serviceType, out service)) 
-                {
-
-                    // If this service is our recursion sentinel, it means that someone is recursing
-                    // while resolving a service callback.  Throw to break out of the recursion
-                    // cycle.
-                    if (service == _recursionSentinel) 
-                    {
-                        throw FxTrace.Exception.AsError(new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resources.Error_RecursionResolvingService, serviceType.FullName)));
-                    }
-
-                    // See if this service is a callback.  If it is, invoke it and store
-                    // the resulting service back in the dictionary.
-                    PublishServiceCallback callback = service as PublishServiceCallback;
-                    if (callback != null) 
-                    {
-
-                        // Store a recursion sentinel in the dictionary so we can easily
-                        // tell if someone is recursing
-                        _services[serviceType] = _recursionSentinel;
-                        try 
-                        {
-                            service = callback(serviceType);
-                            if (service == null) 
-                            {
-                                throw FxTrace.Exception.AsError(new InvalidOperationException(
-                                    string.Format(CultureInfo.CurrentCulture,
-                                    Resources.Error_NullService,
-                                    callback.Method.DeclaringType.FullName,
-                                    serviceType.FullName)));
-                            }
-
-                            if (!serviceType.IsInstanceOfType(service)) 
-                            {
-                                throw FxTrace.Exception.AsError(new InvalidOperationException(
-                                    string.Format(CultureInfo.CurrentCulture,
-                                    Resources.Error_IncorrectServiceType,
-                                    callback.Method.DeclaringType.FullName,
-                                    serviceType.FullName,
-                                    service.GetType().FullName)));
-                            }
-                        }
-                        finally 
-                        {
-                            // Note, this puts the callback back in place if it threw.
-                            _services[serviceType] = service;
-                        }
-                    }
-                }
-
-                // If the service is not found locally, do not walk up the parent chain.  
-                // This was a major source of unreliability with the component model
-                // design.  For a service to be accessible from the editing context, it
-                // must be added.
-
-                return service;
-            }
-
-            // <summary>
-            // Retrieves an enumerator that can be used to enumerate all of the services that this
-            // service manager publishes.
-            // </summary>
-            // <returns></returns>
-            public override IEnumerator<Type> GetEnumerator() 
-            {
-                if (_services == null) 
-                {
-                    _services = new Dictionary<Type, object>();
-                }
-
-                return _services.Keys.GetEnumerator();
-            }
-
-            // <summary>
-            // Calls back on the provided callback when someone has published the requested service.
-            // If the service was already available, this method invokes the callback immediately.
-            //
-            // A generic version of this method is provided for convience, and calls the non-generic
-            // method with appropriate casts.
-            // </summary>
-            // <param name="serviceType"></param>
-            // <param name="callback"></param>
-            public override void Subscribe(Type serviceType, SubscribeServiceCallback callback) 
-            {
-                if (serviceType == null) 
-                {
-                    throw FxTrace.Exception.ArgumentNull("serviceType");
-                }
-                if (callback == null) 
-                {
-                    throw FxTrace.Exception.ArgumentNull("callback");
-                }
-
-                object service = GetService(serviceType);
-                if (service != null) 
-                {
-
-                    // If the service is already available, callback immediately
-                    callback(serviceType, service);
-                }
-                else 
-                {
-
-                    // Otherwise, store this for later
-                    if (_subscriptions == null) 
-                    {
-                        _subscriptions = new Dictionary<Type, SubscribeServiceCallback>();
-                    }
-                    SubscribeServiceCallback existing = null;
-                    _subscriptions.TryGetValue(serviceType, out existing);
-                    existing = (SubscribeServiceCallback)Delegate.Combine(existing, callback);
-                    _subscriptions[serviceType] = existing;
-                }
-            }
-
-            // <summary>
-            // Calls back on the provided callback when someone has published the requested service.
-            // If the service was already available, this method invokes the callback immediately.
-            //
-            // A generic version of this method is provided for convience, and calls the non-generic
-            // method with appropriate casts.
-            // </summary>
-            // <param name="serviceType"></param>
-            // <param name="callback"></param>
-            public override void Publish(Type serviceType, PublishServiceCallback callback) 
-            {
-                if (serviceType == null) 
-                {
-                    throw FxTrace.Exception.ArgumentNull("serviceType");
-                }
-                if (callback == null) 
-                {
-                    throw FxTrace.Exception.ArgumentNull("callback");
-                }
-
-                Publish(serviceType, (object)callback);
-            }
-
-            // <summary>
-            //     If you already have an instance to a service, you can publish it here.
-            // </summary>
-            // <param name="serviceType"></param>
-            // <param name="serviceInstance"></param>
-            public override void Publish(Type serviceType, object serviceInstance) 
-            {
-                if (serviceType == null) 
-                {
-                    throw FxTrace.Exception.ArgumentNull("serviceType");
-                }
-                if (serviceInstance == null) 
-                {
-                    throw FxTrace.Exception.ArgumentNull("serviceInstance");
-                }
-
-                if (!(serviceInstance is PublishServiceCallback) && !serviceType.IsInstanceOfType(serviceInstance)) 
-                {
-                    throw FxTrace.Exception.AsError(new ArgumentException(
-                        string.Format(CultureInfo.CurrentCulture,
-                        Resources.Error_IncorrectServiceType,
-                        typeof(ServiceManager).Name,
-                        serviceType.FullName,
-                        serviceInstance.GetType().FullName)));
-                }
-
-                if (_services == null) 
-                {
-                    _services = new Dictionary<Type, object>();
-                }
-
-                try 
-                {
-                    _services.Add(serviceType, serviceInstance);
-                }
-                catch (ArgumentException e) 
-                {
-                    throw FxTrace.Exception.AsError(new ArgumentException(string.Format(
-                        CultureInfo.CurrentCulture,
-                        Resources.Error_DuplicateService, serviceType.FullName), e));
-                }
-
-                // Now see if there were any subscriptions that required this service
-                SubscribeServiceCallback subscribeCallback;
-                if (_subscriptions != null && _subscriptions.TryGetValue(serviceType, out subscribeCallback)) 
-                {
-                    subscribeCallback(serviceType, GetService(serviceType));
-                    _subscriptions.Remove(serviceType);
-                }
-            }
-
-            // <summary>
-            //     Removes a subscription.
-            // </summary>
-            public override void Unsubscribe(Type serviceType, SubscribeServiceCallback callback) 
-            {
-
-                if (serviceType == null) 
-                {
-                    throw FxTrace.Exception.ArgumentNull("serviceType");
-                }
-                if (callback == null) 
-                {
-                    throw FxTrace.Exception.ArgumentNull("callback");
-                }
-
-                if (_subscriptions != null) 
-                {
-                    SubscribeServiceCallback existing;
-                    if (_subscriptions.TryGetValue(serviceType, out existing)) 
-                    {
-                        existing = (SubscribeServiceCallback)RemoveCallback(existing, callback);
-                        if (existing == null) 
-                        {
-                            _subscriptions.Remove(serviceType);
-                        }
-                        else 
-                        {
-                            _subscriptions[serviceType] = existing;
-                        }
-                    }
-                }
-            }
-
-            // <summary>
-            // We implement IDisposable so that the editing context can destroy us when it
-            // shuts down.
-            // </summary>
-            void IDisposable.Dispose() 
-            {
-                if (_services != null) 
-                {
-                    Dictionary<Type, object> services = _services;
-
-                    try 
-                    {
-                        foreach (object value in services.Values) 
-                        {
-                            IDisposable d = value as IDisposable;
-                            if (d != null) 
-                            {
-                                d.Dispose();
-                            }
-                        }
-                    }
-                    finally 
-                    {
-                        _services = null;
-                    }
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/EnumValidator.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/EnumValidator.cs
deleted file mode 100644 (file)
index 6319203..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-
-    // <summary>
-    // Class containing a single IsValid() method that ensures
-    // that the given public enum is of expected value.  Use this
-    // method to validate the enum value of all publicly exposed setters.
-    // </summary>
-    internal static partial class EnumValidator
-    {
-        public static bool IsValid(OrderTokenPrecedence value)
-        {
-            return value == OrderTokenPrecedence.Before || value == OrderTokenPrecedence.After;
-        }
-
-        public static bool IsValid(OrderTokenConflictResolution value)
-        {
-            return value == OrderTokenConflictResolution.Win || value == OrderTokenConflictResolution.Lose;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/GenericTypeParameterConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/GenericTypeParameterConverter.cs
deleted file mode 100644 (file)
index 8ea855c..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Core
-{
-    using System;
-    using System.Globalization;
-    using System.Text;
-    using System.Windows.Data;
-    using System.Activities.Presentation.Model;
-
-    using System.Activities.Presentation;
-
-    // This class is used for generating collections of passed type argument, based on the 
-    // fully qualified type name passed as containerParameter. i.e. one may convert
-    // Foo class into List<Foo>
-    internal sealed class GenericTypeParameterConverter : IValueConverter
-    {
-
-        bool displayFullName;
-
-        public GenericTypeParameterConverter() : this(false)
-        {
-        }
-
-        public GenericTypeParameterConverter(bool displayFullName)
-        {
-            this.displayFullName = displayFullName;
-        }
-
-        object IValueConverter.Convert(object value, Type convertToType, object containerParameter, CultureInfo culture)
-        {
-            Type[] argumentTypes = GetGenericTypeArguments(value);
-            Type containerType = GetContainerType(containerParameter);
-
-            if (null != argumentTypes && null != containerType)
-            {
-                Type resultType = BuildTargetType(argumentTypes, containerType);
-                return HandleConversion(resultType, convertToType);
-            }
-
-            containerType = GetContainerType(value);
-            if (null != containerType)
-            {
-                return HandleConversion(containerType, convertToType);
-            }
-            return null;
-        }
-
-        object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotImplementedException());
-        }
-
-        Type GetContainerType(object value)
-        {
-            if (null == value)
-            {
-                return null;
-            }
-            if (value is ModelItem)
-            {
-                value = ((ModelItem)value).GetCurrentValue();
-            }
-            if (value is Type)
-            {
-                return (Type)value;
-            }
-            else if (value is string)
-            {
-                return Type.GetType((string)value, false, true);
-            }
-            return null;
-        }
-
-        Type[] GetGenericTypeArguments(object value)
-        {
-            Type[] result = null;
-            if (value is ModelItem)
-            {
-                value = ((ModelItem)value).GetCurrentValue();
-            }
-            if (null != value && (value is Type))
-            {
-                Type type = (Type)value;
-                if (type.IsGenericType)
-                {
-                    result = type.GetGenericArguments();
-                }
-                else
-                {
-                    result = new Type[] { type };
-                }
-            }
-            return result;
-        }
-
-        Type BuildTargetType(Type[] argumentTypes, Type containerType)
-        {
-            if (containerType.IsGenericType)
-            {
-                return containerType.MakeGenericType(argumentTypes);
-            }
-            return containerType;
-        }
-
-        object HandleConversion(Type resultType, Type convertToType)
-        {
-            if (typeof(string) == convertToType)
-            {
-                if (resultType.IsGenericType)
-                {
-                    StringBuilder strBldr = new StringBuilder();
-                    if (this.displayFullName)
-                    {
-                        strBldr.Append(resultType.FullName.Substring(0, resultType.FullName.IndexOf('`')));
-                    }
-                    else
-                    {
-                        strBldr.Append(resultType.Name.Substring(0, resultType.Name.IndexOf('`')));
-                    }
-                    
-                    strBldr.Append("<");
-                    bool addComma = false;
-                    foreach (Type arg in resultType.GetGenericArguments())
-                    {
-                        strBldr.Append(addComma ? "," : string.Empty);
-                        if (arg.IsGenericType)
-                        {
-                            strBldr.Append(HandleConversion(arg, convertToType));
-                        }
-                        else
-                        {
-                            strBldr.Append(this.displayFullName ? arg.FullName : arg.Name);
-                        }
-                        addComma = true;
-                    }
-                    strBldr.Append(">");
-                    return strBldr.ToString();
-                }
-                return this.displayFullName ? resultType.FullName : resultType.Name;
-            }
-            else if (typeof(Type) == convertToType)
-            {
-                return resultType;
-            }
-            return null;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/Metadata/AttributeData.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/Metadata/AttributeData.cs
deleted file mode 100644 (file)
index 06af11c..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.Metadata 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-    using System.Diagnostics;
-    using System.Runtime;
-
-    // This class groups Attribute with its AttributeUsageAttributes that we care about.
-    // Basically, each Attribute has characteristics that are useful to know about,
-    // such as whether it can be inherited and whether there can be more than
-    // one instance of that attribute extending whatever it is the attribute
-    // is extending (class, method, property, or event).  Those characteristics
-    // are stored as attributes themselves and, as such, are costly to retrieve.
-    // This class retrieves that information exactly once, on demand, and caches it for
-    // further use.
-    internal class AttributeData 
-    {
-
-        private Type _attributeType;
-        private bool? _isInheritable;
-        private bool? _allowsMultiple;
-
-        // <summary>
-        // Creates an AttributeData wrapper around Attribute type to expose its
-        // Inherit and AllowMultiple characteristics
-        // </summary>
-        // <param name="attributeType">Attribute type to wrap around</param>
-        internal AttributeData(Type attributeType) 
-        {
-            Fx.Assert(attributeType != null, "attributeType parameter should not be null");
-            _attributeType = attributeType;
-        }
-
-        // <summary>
-        // Gets the contained attribute type
-        // </summary>
-        internal Type AttributeType 
-        {
-            get {
-                return _attributeType;
-            }
-        }
-
-        // <summary>
-        // Gets the AllowMultiple characteristic of the
-        // contained attribute and caches the result for subsequent
-        // calls to this property.
-        // </summary>
-        internal bool AllowsMultiple 
-        {
-            get {
-                if (_allowsMultiple == null)
-                {
-                    ParseUsageAttributes();
-                }
-
-                return (bool)_allowsMultiple;
-            }
-        }
-
-        // <summary>
-        // Gets the Inherit characteristic of the
-        // contained attribute and caches the result for subsequent
-        // calls to this property.
-        // </summary>
-        internal bool IsInheritable 
-        {
-            get {
-                if (_isInheritable == null)
-                {
-                    ParseUsageAttributes();
-                }
-
-                return (bool)_isInheritable;
-            }
-        }
-
-        private void ParseUsageAttributes() 
-        {
-            _isInheritable = false;
-            _allowsMultiple = false;
-            object[] usageAttributes = _attributeType.GetCustomAttributes(typeof(AttributeUsageAttribute), true);
-
-            if (usageAttributes != null && usageAttributes.Length > 0) 
-            {
-                for (int i = 0; i < usageAttributes.Length; i++) 
-                {
-                    Fx.Assert(usageAttributes[i] is AttributeUsageAttribute, "usageAttributes should be of type AttributeUsageAttribute");
-                    AttributeUsageAttribute usageAttribute = (AttributeUsageAttribute)usageAttributes[i];
-                    _isInheritable = usageAttribute.Inherited;
-                    _allowsMultiple = usageAttribute.AllowMultiple;
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/Metadata/AttributeDataCache.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/Metadata/AttributeDataCache.cs
deleted file mode 100644 (file)
index ef3da8b..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.Metadata 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-    using System.Activities.Presentation.Metadata;
-    using System.Reflection;
-    using System.Diagnostics;
-    using System.Collections;
-    using System.Globalization;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-
-    // <summary>
-    // Helper class that knows how to look up the base implementation of a given MemberInfo,
-    // as well as custom attributes from the MetadataStore or the CLR.  However, it does not
-    // actually cache those attributes.  We can add this functionality in the future if needed.
-    // On the other hand, this class does cache the map between attribute types and our internal
-    // AttributeData data structures that contain AttributeUsageAttributes so we don't have to keep
-    // looking them up via reflection.
-    // </summary>
-    internal static class AttributeDataCache 
-    {
-
-        // BindingFlags used for all GetInfo() types of calls
-        private static readonly BindingFlags _getInfoBindingFlags =
-            BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.NonPublic |
-            BindingFlags.Public | BindingFlags.Static;
-
-        // Note: we use Hashtables instead of Dictionaries because they are thread safe for
-        // read operations without the need for explicit locking.
-
-        // Hashtable of MemberInfos to their base MemberInfos, or null if there is no base MemberInfo
-        private static Hashtable _baseMemberMap = new Hashtable();
-
-        // Hashtable of attribute Types to their corresponding AttributeData classes
-        private static Hashtable _attributeDataCache = new Hashtable();
-
-        // Indicator for no MemberInfo in _baseMemberMap:  Null value means the base MemberInfo wasn't
-        // looked up yet, _noMemberInfo value means it was looked up but it doesn't exist.
-        private static object _noMemberInfo = new object();
-
-        // Used for thread safety
-        private static object _syncObject = new object();
-
-        // This table gets populated once at initialization, so there is no need for a Hashtable here
-        private static Dictionary<MemberTypes, GetBaseMemberCallback> _baseMemberFinders;
-
-        // Static Ctor to populate the lookup table for helper methods that know how
-        // to look up the base MemberInfo of a particular MemberType (ctor, method, event, ...)
-        [SuppressMessage(FxCop.Category.Performance, FxCop.Rule.InitializeReferenceTypeStaticFieldsInline)]
-        static AttributeDataCache() 
-        {
-            _baseMemberFinders = new Dictionary<MemberTypes, GetBaseMemberCallback>();
-            _baseMemberFinders[MemberTypes.Constructor] = new GetBaseMemberCallback(GetBaseConstructorInfo);
-            _baseMemberFinders[MemberTypes.Method] = new GetBaseMemberCallback(GetBaseMethodInfo);
-            _baseMemberFinders[MemberTypes.Property] = new GetBaseMemberCallback(GetBasePropertyInfo);
-            _baseMemberFinders[MemberTypes.Event] = new GetBaseMemberCallback(GetBaseEventInfo);
-        }
-
-        // <summary>
-        // Gets the base MemberInfo for the specified MemberInfo.  For types,
-        // the method returns the base type, if any.  For methods, events, and properties
-        // the method returns the base method, event, or property, if they exists, null
-        // otherwise.
-        // </summary>
-        // <param name="member">MemberInfo to look up in the base class</param>
-        // <returns>Specified MemberInfo in the base class if it exists, null otherwise.</returns>
-        internal static MemberInfo GetBaseMemberInfo(MemberInfo member) 
-        {
-            object baseMember = _baseMemberMap[member];
-            if (baseMember == _noMemberInfo)
-            {
-                return null;
-            }
-
-            if (baseMember == null) 
-            {
-                baseMember = CalculateBaseMemberInfo(member);
-
-                // With Hashtable we only need to lock on writes
-                lock (_syncObject) 
-                {
-                    _baseMemberMap[member] = baseMember ?? _noMemberInfo;
-                }
-            }
-
-            return (MemberInfo)baseMember;
-        }
-
-        // <summary>
-        // Looks up the specified MemberInfo in the custom MetadataStore AttributeTables
-        // and returns any attributes associated with it as an enumeration.  This method
-        // does not return any inherited attributes.
-        // </summary>
-        // <param name="type">Type to look up</param>
-        // <param name="memberName">Member name to look up.  If null, attributes associated
-        // with the type itself will be returned.</param>
-        // <param name="tables">AttributeTables to look in</param>
-        // <returns>Attributes in the AttributeTables associated with the specified
-        // Type and member name.</returns>
-        internal static IEnumerable<object> GetMetadataStoreAttributes(Type type, string memberName, AttributeTable[] tables) {
-            if (tables == null || tables.Length == 0)
-            {
-                yield break;
-            }
-
-            foreach (AttributeTable table in tables) 
-            {
-                if (table.ContainsAttributes(type)) 
-                {
-                    IEnumerable attrEnum;
-                    if (memberName == null)
-                    {
-                        attrEnum = table.GetCustomAttributes(type);
-                    }
-                    else
-                    {
-                        attrEnum = table.GetCustomAttributes(type, memberName);
-                    }
-
-                    foreach (object attr in attrEnum) 
-                    {
-                        yield return attr;
-                    }
-                }
-            }
-        }
-
-        // <summary>
-        // Looks up custom attributes for the specified MemberInfo in CLR via reflection
-        // and returns them as an enumeration.  This method does not return any
-        // inherited attributes.
-        // </summary>
-        // <param name="member">MemberInfo to look up</param>
-        // <returns>Custom Attributes associated with the specified
-        // MemberInfo in the CLR.</returns>
-        internal static IEnumerable<object> GetClrAttributes(MemberInfo member) 
-        {
-            object[] attrs = member.GetCustomAttributes(false);
-            Fx.Assert(attrs != null, "It looks like GetCustomAttributes() CAN return null.  Protect for it.");
-            return attrs;
-        }
-
-        // <summary>
-        // Gets an existing instance of AttributeData associated with the
-        // specified attribute Type, or creates a new one and caches it for
-        // later.  AttributeData is used as a cache for AttributeUsageAttributes
-        // so don't have to keep using reflection to get them.
-        // </summary>
-        // <param name="attributeType">Attribute type to look up</param>
-        // <returns>Instance of AttributeData associated with the specified
-        // attribute type.</returns>
-        internal static AttributeData GetAttributeData(Type attributeType) 
-        {
-            AttributeData attrData = _attributeDataCache[attributeType] as AttributeData;
-
-            if (attrData == null) 
-            {
-                attrData = new AttributeData(attributeType);
-
-                // With Hashtable we only need to lock on writes
-                lock (_syncObject) 
-                {
-                    _attributeDataCache[attributeType] = attrData;
-                }
-            }
-
-            return attrData;
-        }
-
-        //
-        // Tries to get the base MemberInfo associated with the specified
-        // member info, if any.
-        //
-        private static MemberInfo CalculateBaseMemberInfo(MemberInfo member) 
-        {
-            Fx.Assert(member != null, "member parameter should not be null");
-
-            // Type is a special case that covers the majority of cases
-            Type type = member as Type;
-            if (type != null)
-            {
-                return type.BaseType;
-            }
-
-            Type targetType = member.DeclaringType.BaseType;
-
-            Fx.Assert(
-                _baseMemberFinders.ContainsKey(member.MemberType),
-                string.Format(
-                CultureInfo.CurrentCulture,
-                "Didn't know how to look up the base MemberInfo for member type {0}. " +
-                "Please update the list of known GetBaseInfoCallbacks in AttributeDataCache.",
-                member.MemberType));
-
-            MemberInfo baseMemberInfo = null;
-
-            while (targetType != null && baseMemberInfo == null) 
-            {
-                baseMemberInfo = _baseMemberFinders[member.MemberType](member, targetType);
-                targetType = targetType.BaseType;
-            }
-
-            return baseMemberInfo;
-        }
-
-        //
-        // Helper method that knows how to look up the base constructor of a class.  However,
-        // since constructors can't derive from one another, this method always returns
-        // null.
-        // 
-        private static MemberInfo GetBaseConstructorInfo(MemberInfo info, Type targetType) 
-        {
-            return null;
-        }
-
-        //
-        // Helper method that knows how to look up the base implementation of a virtual method.
-        //
-        private static MemberInfo GetBaseMethodInfo(MemberInfo info, Type targetType) 
-        {
-            MethodInfo methodInfo = info as MethodInfo;
-            Fx.Assert(methodInfo != null, "It looks like MemberType did not match the type of MemberInfo: " + info.GetType().Name);
-            return targetType.GetMethod(methodInfo.Name, _getInfoBindingFlags, null, ToTypeArray(methodInfo.GetParameters()), null);
-        }
-
-        //
-        // Helper method that knows how to look up the base implementation of a virtual property.
-        //
-        private static MemberInfo GetBasePropertyInfo(MemberInfo info, Type targetType) 
-        {
-            PropertyInfo propInfo = info as PropertyInfo;
-            Fx.Assert(propInfo != null, "It looks like MemberType did not match the type of MemberInfo: " + info.GetType().Name);
-            return targetType.GetProperty(propInfo.Name, _getInfoBindingFlags, null, propInfo.PropertyType, ToTypeArray(propInfo.GetIndexParameters()), null);
-        }
-
-        //
-        // Helper method that knows how to look up the base implementation of a virtual event.
-        //
-        private static MemberInfo GetBaseEventInfo(MemberInfo info, Type targetType) 
-        {
-            EventInfo eventInfo = info as EventInfo;
-            Fx.Assert(eventInfo != null, "It looks like MemberType did not match the type of MemberInfo: " + info.GetType().Name);
-            return targetType.GetEvent(eventInfo.Name, _getInfoBindingFlags);
-        }
-
-        //
-        // Helper that converts ParamenterInfo[] into Type[]
-        //
-        private static Type[] ToTypeArray(ParameterInfo[] parameterInfo) {
-            if (parameterInfo == null)
-            {
-                return null;
-            }
-
-            Type[] parameterTypes = new Type[parameterInfo.Length];
-            for (int i = 0; i < parameterInfo.Length; i++)
-            {
-                parameterTypes[i] = parameterInfo[i].ParameterType;
-            }
-
-            return parameterTypes;
-        }
-
-        // Delegate used to call specific methods to get a base MemberInfo from the given MemberInfo
-        private delegate MemberInfo GetBaseMemberCallback(MemberInfo member, Type targetType);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/Metadata/MutableAttributeTable.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/Metadata/MutableAttributeTable.cs
deleted file mode 100644 (file)
index f6d0338..0000000
+++ /dev/null
@@ -1,621 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Internal.Metadata 
-{
-
-    using System.Activities.Presentation.Internal.Properties;
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Reflection;
-    using System.Windows;
-    using System.Activities.Presentation.Metadata;
-    using System.Runtime;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Activities.Presentation;
-
-    //
-    // This class is used by the attribute table builder to
-    // add attributes.  It is then handed to AttributeTable
-    // and accessed in a read-only fashion.
-    //
-    internal class MutableAttributeTable 
-    {
-        private static object[] _empty = new object[0];
-
-        private Dictionary<Type, TypeMetadata> _metadata;
-
-        internal MutableAttributeTable() 
-        {
-            _metadata = new Dictionary<Type, TypeMetadata>();
-        }
-
-        //
-        // Returns the types we're handing metadata for
-        //
-        internal IEnumerable<Type> AttributedTypes 
-        {
-            get { return _metadata.Keys; }
-        }
-
-        //
-        // Private helper to add a portion of an existing table.
-        //
-        private static void AddAttributeMetadata(TypeMetadata newMd, TypeMetadata existingMd) 
-        {
-            if (newMd.TypeAttributes != null) 
-            {
-                if (existingMd.TypeAttributes != null) 
-                {
-                    existingMd.TypeAttributes.AddRange(newMd.TypeAttributes);
-                }
-                else 
-                {
-                    existingMd.TypeAttributes = newMd.TypeAttributes;
-                }
-            }
-        }
-
-        //
-        // Helper to add a enum of attributes ot an existing list
-        //
-        private static void AddAttributes(AttributeList list, IEnumerable<object> attributes) 
-        {
-            // Attributes are ordered so those at the end of the
-            // list take prececence over those at the front.
-            list.AddRange(attributes);
-        }
-
-        internal void AddCallback(Type type, AttributeCallback callback) 
-        {
-            Fx.Assert(type != null && callback != null, "type or callback parameter is null");
-            AttributeList list = GetTypeList(type);
-            list.Add(callback);
-        }
-
-        //
-        // Adds custom attrs for a type
-        //
-        internal void AddCustomAttributes(Type type, IEnumerable<object> attributes) 
-        {
-            Fx.Assert(type != null && attributes != null, "type or attributes parameter is null");
-            AddAttributes(GetTypeList(type), attributes);
-        }
-
-        //
-        // Adds custom attrs for a descriptor
-        //
-        internal void AddCustomAttributes(Type ownerType, MemberDescriptor descriptor, IEnumerable<object> attributes) 
-        {
-            Fx.Assert(ownerType != null && descriptor != null && attributes != null, "ownerType/descriptor/attributes is null");
-            AddAttributes(GetMemberList(ownerType, descriptor.Name), attributes);
-        }
-
-        //
-        // Adds custom attrs for a member
-        //
-        internal void AddCustomAttributes(Type ownerType, MemberInfo member, IEnumerable<object> attributes) 
-        {
-            Fx.Assert(ownerType != null && member != null && attributes != null, "ownertype/member/attributes parameter is null");
-            AddAttributes(GetMemberList(ownerType, member.Name), attributes);
-        }
-
-        //
-        // Adds custom attrs for a dp
-        //
-        internal void AddCustomAttributes(Type ownerType, DependencyProperty dp, IEnumerable<object> attributes) 
-        {
-            Fx.Assert(ownerType != null && dp != null && attributes != null, "ownerType/dp/attributes parameter is null");
-            AddAttributes(GetMemberList(ownerType, dp.Name), attributes);
-        }
-
-        //
-        // Adds custom attrs for a member name
-        //
-        internal void AddCustomAttributes(Type ownerType, string memberName, IEnumerable<object> attributes) 
-        {
-            Fx.Assert(ownerType != null && memberName != null && attributes != null, "ownerType/membername/attributes parameter is null");
-            AddAttributes(GetMemberList(ownerType, memberName), attributes);
-        }
-
-        //
-        // Private helper to add a portion of an existing table.
-        //
-        private static void AddMemberMetadata(TypeMetadata newMd, TypeMetadata existingMd) 
-        {
-            if (newMd.MemberAttributes != null) 
-            {
-                if (existingMd.MemberAttributes != null) 
-                {
-                    foreach (KeyValuePair<string, AttributeList> kv in newMd.MemberAttributes) 
-                    {
-                        AttributeList existing;
-                        if (existingMd.MemberAttributes.TryGetValue(kv.Key, out existing)) 
-                        {
-                            existing.AddRange(kv.Value);
-                        }
-                        else 
-                        {
-                            existingMd.MemberAttributes.Add(kv.Key, kv.Value);
-                        }
-                    }
-                }
-                else 
-                {
-                    existingMd.MemberAttributes = newMd.MemberAttributes;
-                }
-            }
-        }
-
-        //
-        // Adds an existing table.
-        //
-        internal void AddTable(MutableAttributeTable table) 
-        {
-            Fx.Assert(table != null, "table parameter is null");
-            foreach (KeyValuePair<Type, TypeMetadata> kv in table._metadata) 
-            {
-                AddTypeMetadata(kv.Key, kv.Value);
-            }
-        }
-
-        //
-        // Private helper to add a portion of an existing table.
-        //
-        private void AddTypeMetadata(Type type, TypeMetadata md) 
-        {
-            TypeMetadata existing;
-            if (_metadata.TryGetValue(type, out existing)) 
-            {
-                AddAttributeMetadata(md, existing);
-                AddMemberMetadata(md, existing);
-            }
-            else 
-            {
-                _metadata.Add(type, md);
-            }
-        }
-
-        //
-        // Returns true if this table contains attributes for the
-        // given type
-        //
-        internal bool ContainsAttributes(Type type) 
-        {
-            Fx.Assert(type != null, "type parameter is null");
-            return (_metadata.ContainsKey(type));
-        }
-
-        //
-        // Helper method that walks through an attribute list and expands all callbacks
-        // within it.
-        //
-        private void ExpandAttributes(Type type, AttributeList attributes) 
-        {
-            Fx.Assert(!attributes.IsExpanded, "Should not call expand attributes with an expanded list.");
-
-            // First, expand all the callbacks.  This may add more attributes
-            // into our list
-            //
-            for (int idx = 0; idx < attributes.Count; idx++) 
-            {
-                AttributeCallback callback = attributes[idx] as AttributeCallback;
-                while (callback != null) 
-                {
-                    attributes.RemoveAt(idx);
-                    AttributeCallbackBuilder builder = new AttributeCallbackBuilder(this, type);
-                    callback(builder);
-
-                    if (idx < attributes.Count) 
-                    {
-                        callback = attributes[idx] as AttributeCallback;
-                    }
-                    else 
-                    {
-                        callback = null;
-                    }
-                }
-            }
-        }
-
-        //
-        // Returns custom attributes for the type.
-        //
-        internal IEnumerable GetCustomAttributes(Type type) 
-        {
-            Fx.Assert(type != null, "type parameter is null");
-
-            AttributeList attributes = GetExpandedAttributes(type, null, delegate(Type typeToGet, object callbackParam) 
-            {
-                TypeMetadata md;
-                if (_metadata.TryGetValue(typeToGet, out md)) 
-                {
-                    return md.TypeAttributes;
-                }
-                return null;
-            });
-
-            if (attributes != null) 
-            {
-                return attributes.AsReadOnly();
-            }
-
-            return _empty;
-        }
-
-        //
-        // Returns custom attributes for the descriptor.
-        //
-        internal IEnumerable GetCustomAttributes(Type ownerType, MemberDescriptor descriptor) 
-        {
-            Fx.Assert(ownerType != null && descriptor != null, "ownerType or descriptor parameter is null");
-            return GetCustomAttributes(ownerType, descriptor.Name);
-        }
-
-        //
-        // Returns custom attributes for the dp.
-        //
-        internal IEnumerable GetCustomAttributes(Type ownerType, DependencyProperty dp) 
-        {
-            Fx.Assert(ownerType != null && dp != null, "ownerType or dp parameter is null");
-            return GetCustomAttributes(ownerType, dp.Name);
-        }
-
-        //
-        // Returns custom attributes for the member.
-        //
-        internal IEnumerable GetCustomAttributes(Type ownerType, MemberInfo member) 
-        {
-            Fx.Assert(ownerType != null && member != null, "ownerType or memeber parameter is null");
-            return GetCustomAttributes(ownerType, member.Name);
-        }
-
-        //
-        // Returns custom attributes for the member.
-        //
-        internal IEnumerable GetCustomAttributes(Type ownerType, string memberName) 
-        {
-            Fx.Assert(ownerType != null && memberName != null, "ownerType or memberName parameter is null");
-
-            AttributeList attributes = GetExpandedAttributes(ownerType, memberName, delegate(Type typeToGet, object callbackParam) 
-            {
-                string name = (string)callbackParam;
-                TypeMetadata md;
-
-                if (_metadata.TryGetValue(typeToGet, out md)) 
-                {
-
-                    // If member attributes are null but type attributes are not,
-                    // it is possible that expanding type attributes could cause
-                    // member attributes to be added.  Check.
-
-                    if (md.MemberAttributes == null && md.TypeAttributes != null && !md.TypeAttributes.IsExpanded) 
-                    {
-                        ExpandAttributes(ownerType, md.TypeAttributes);
-                    }
-
-                    if (md.MemberAttributes != null) 
-                    {
-                        AttributeList list;
-                        if (md.MemberAttributes.TryGetValue(name, out list)) 
-                        {
-                            return list;
-                        }
-                    }
-                }
-
-                return null;
-            });
-
-            if (attributes != null) 
-            {
-                return attributes.AsReadOnly();
-            }
-
-            return _empty;
-        }
-
-        //
-        // Helper to demand create the attribute list ofr a dependency property.
-        //
-        private AttributeList GetMemberList(Type ownerType, string memberName) 
-        {
-            Fx.Assert(ownerType != null && memberName != null, "ownerType or memberName parameter is null");
-            TypeMetadata md = GetTypeMetadata(ownerType);
-
-            if (md.MemberAttributes == null) 
-            {
-                md.MemberAttributes = new Dictionary<string, AttributeList>();
-            }
-
-            AttributeList list;
-            if (!md.MemberAttributes.TryGetValue(memberName, out list)) 
-            {
-                list = new AttributeList();
-                md.MemberAttributes.Add(memberName, list);
-            }
-
-            return list;
-        }
-
-        //
-        // Expands a type attribute table for use.
-        // Attribute tables only contain attributes for
-        // the given type, and may have callbacks embedded
-        // within them.
-        //
-        private AttributeList GetExpandedAttributes(Type type, object callbackParam, GetAttributesCallback callback) 
-        {
-
-            // Do we have attributes to expand?
-
-            AttributeList attributes = callback(type, callbackParam);
-            if (attributes != null) 
-            {
-
-                // If these attributes haven't been expanded yet, do that
-                // now.
-
-                if (!attributes.IsExpanded) 
-                {
-
-                    // We have a lock here because multiple people could be
-                    // surfing type information at the same time from multiple
-                    // threads.  While we are read only once we are expanded,
-                    // we do modify the list here to expand the callbacks and 
-                    // merge.  Therefore, we need to acquire a lock.
-
-                    lock (attributes) 
-                    {
-                        if (!attributes.IsExpanded) 
-                        {
-                            ExpandAttributes(type, attributes);
-                            attributes.IsExpanded = true;
-                        }
-                    }
-                }
-            }
-
-            return attributes;
-        }
-
-        //
-        // Helper to demand create the attribute list for a type.
-        //
-        private AttributeList GetTypeList(Type type) 
-        {
-            Fx.Assert(type != null, "type parameter is null");
-            TypeMetadata md = GetTypeMetadata(type);
-            if (md.TypeAttributes == null) 
-            {
-                md.TypeAttributes = new AttributeList();
-            }
-            return md.TypeAttributes;
-        }
-
-        //
-        // Helper to demand create the type metadata.
-        //
-        private TypeMetadata GetTypeMetadata(Type type) 
-        {
-            Fx.Assert(type != null, "type parameter is null");
-            TypeMetadata md;
-            if (!_metadata.TryGetValue(type, out md)) 
-            {
-                md = new TypeMetadata();
-                _metadata.Add(type, md);
-            }
-            return md;
-        }
-
-
-        //
-        // Called by the MetadataStore to walk through all the metadata and
-        // ensure that it can be found on the appropriate types and members.
-        // Any asserts that come from here are bugs in the type description
-        // provider.
-        //
-        internal void DebugValidateProvider()
- {
-#if DEBUG
-            foreach (KeyValuePair<Type, TypeMetadata> kv in _metadata
-) {
-                if (kv.Value.TypeAttributes != 
-null) {
-                    AttributeCollection attrs = TypeDescriptor.GetAttributes(kv.Key);
-                    foreach (object o in kv.Value
-.TypeAttributes) {
-                        Attribute a = o as Attribute;
-                        if (a 
-!= null) {
-                            bool found = false;
-                            foreach (Attribute a2
- in attrs) {
-                                if (a.TypeId.Equals
-(a2.TypeId)) {
-                                    found = true;
-                                    break;
-                                }
-                            }
-
-                            Fx.Assert(
-                                found,
-                                string.Format(CultureInfo.CurrentCulture, "Attribute {0} on type {1} is missing from provider.",
-                                a.GetType().Name, kv.Key.Name));
-                        }
-                    }
-                }
-
-                if (kv.Value
-.MemberAttributes != null) {
-                    foreach (KeyValuePair<string, AttributeList> kvDesc 
-in kv.Value.MemberAttributes) {
-                        PropertyDescriptor p;
-                        EventDescriptor e;
-                        AttributeCollection attrs = null;
-                        string member = "unknown";
-
-                        if ((p = TypeDescriptor.GetProperties(kv.Key)[kvDesc.Key]) != null) {
-                            attrs = p.Attributes;
-                            member = p.Name;
-                        }
-                        else if ((e = TypeDescriptor.GetEvents(kv.Key)[kvDesc.Key]) != null) {
-                            attrs = e.Attributes;
-                            member = e.Name;
-                        }
-                        else if ((p = DependencyPropertyDescriptor.FromName(kvDesc.Key, kv.Key, typeof(
-DependencyObject))) != null) {
-                            attrs = p.Attributes;
-                            member = p.Name;
-                        }
-                       
- if (attrs != null) {
-                            foreach 
-(object o in kvDesc.Value) {
-                                Attribute a = o as Attribute;
-                             
-   if (a != null) {
-                                    bool found = false;
-                                  
-  foreach (Attribute a2 in attrs) {
-                                        
-if (a.TypeId.Equals(a2.TypeId)) {
-                                            found = true;
-                                            break;
-                                        }
-                                    }
-
-                                    Fx.Assert(
-                                        found,
-                                        string.Format(CultureInfo.CurrentCulture, "Attribute {0} on member {1}.{2} is missing from provider.",
-                                        a.GetType().Name, kv.Key.Name, member));
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-#else
-#endif
-        }
-
-        //
-        // Performs validation of all metadata in the table.
-        // This expands all callbacks so it can be very expensive
-        // for large tables.
-        //
-        public void ValidateTable() 
-        {
-
-            List<string> errors = null;
-
-            foreach (KeyValuePair<Type, TypeMetadata> kv in _metadata) 
-            {
-
-                // Walk type attributes.  We don't need to compare these
-                // to anything because there is no way for them to be
-                // invalid.  We simply get them to ensure they don't throw
-
-                GetCustomAttributes(kv.Key);
-
-                // Walk member attributes.  We need to ensure that all member descriptors
-                // of type LookupMemberDescriptor have matching members (property or event)
-                // on the target type.  Other members are already validated by the fact
-                // that they exist.
-
-                if (kv.Value.MemberAttributes != null) 
-                {
-
-                    foreach (KeyValuePair<string, AttributeList> kvMember in kv.Value.MemberAttributes) 
-                    {
-
-                        // Validate that the attribute expansion doesn't throw
-                        GetCustomAttributes(kv.Key, kvMember.Key);
-
-                        // Validate that the member name matches a real proeprty/event and there
-                        // are no duplicates
-
-                        PropertyDescriptor p = DependencyPropertyDescriptor.FromName(kvMember.Key, kv.Key, typeof(DependencyObject));
-                        EventDescriptor e = TypeDescriptor.GetEvents(kv.Key)[kvMember.Key];
-                        if (p == null && e == null) 
-                        {
-                            p = TypeDescriptor.GetProperties(kv.Key)[kvMember.Key];
-                        }
-
-                        string errorMsg = null;
-                        if (p == null && e == null) 
-                        {
-                            errorMsg = string.Format(
-                                CultureInfo.CurrentCulture,
-                                Resources.Error_ValidationNoMatchingMember,
-                                kvMember.Key, kv.Key.FullName);
-                        }
-                        else if (p != null && e != null) 
-                        {
-                            errorMsg = string.Format(
-                                CultureInfo.CurrentCulture,
-                                Resources.Error_ValidationAmbiguousMember,
-                                kvMember.Key, kv.Key.FullName);
-                        }
-
-                        if (errorMsg != null) 
-                        {
-                            if (errors == null) 
-                            {
-                                errors = new List<string>();
-                            }
-                            errors.Add(errorMsg);
-                        }
-                    }
-                }
-            }
-
-            // Did we get any errors?
-            if (errors != null) 
-            {
-                throw FxTrace.Exception.AsError(new AttributeTableValidationException(
-                    Resources.Error_TableValidationFailed,
-                    errors));
-            }
-        }
-
-        //
-        // We have a generic attribute expansion routine
-        // that relies on someone else providing a mechanism
-        // for returning the base attribute list.  If there
-        // is no base list, this callback can return null.
-        //
-        private delegate AttributeList GetAttributesCallback(Type type, object callbackParam);
-
-        //
-        // All metadata for a type is stored here.
-        //
-        private class TypeMetadata 
-        {
-            internal AttributeList TypeAttributes;
-            internal Dictionary<string, AttributeList> MemberAttributes;
-        }
-
-        //
-        // Individual attributes for a member or type are stored
-        // here.  Attribute lists can be "expanded", so their
-        // callbacks are evaluated and their attributes are
-        // merged with their base attribute list.
-        //
-        private class AttributeList : List<object> 
-        {
-            private bool _isExpanded;
-
-            internal bool IsExpanded 
-            {
-                get { return _isExpanded; }
-                set { _isExpanded = value; }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/AutomatedChoiceEditor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/AutomatedChoiceEditor.cs
deleted file mode 100644 (file)
index 3b2d8bf..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Automation 
-{
-    using System;
-    using System.Windows;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Data;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.ValueEditors;
-
-    // <summary>
-    // Blend's ChoiceEditor that we augment with our an AutomationPeer
-    // </summary>
-    internal class AutomatedChoiceEditor : ChoiceEditor 
-    {
-
-        // <summary>
-        // AutomationValueConverter is used to expose an IValueConverter that the
-        // ChoiceEditorAutomationPeer uses to convert the selected item into a
-        // string exposed through the automation APIs.  If no converver is specified
-        // (default), we call ToString() on the item.
-        // </summary>
-        public static DependencyProperty AutomationValueConverterProperty = DependencyProperty.Register(
-            "AutomationValueConverter",
-            typeof(IValueConverter),
-            typeof(AutomatedChoiceEditor),
-            new PropertyMetadata(null));
-
-        internal event DependencyPropertyChangedEventHandler DependencyPropertyChanged;
-
-        // <summary>
-        // Gets or set AutomationValueConverter
-        // </summary>
-        public IValueConverter AutomationValueConverter 
-        {
-            get { return (IValueConverter)this.GetValue(AutomationValueConverterProperty); }
-            set { this.SetValue(AutomationValueConverterProperty, value); }
-        }
-
-        protected override AutomationPeer OnCreateAutomationPeer() 
-        {
-            return new HiddenUIElementAutomationPeer(this);
-        }
-
-        // Expose DependencyPropertyChanged event to which the AutomationPeer listens, broadcasting
-        // its own set of automation events as needed.
-        protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e) 
-        {
-            if (DependencyPropertyChanged != null)
-            {
-                DependencyPropertyChanged(this, e);
-            }
-
-            base.OnPropertyChanged(e);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/AutomatedComboBox.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/AutomatedComboBox.cs
deleted file mode 100644 (file)
index eeb336a..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Automation 
-{
-    using System;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Controls;
-
-    // <summary>
-    // Standard ComboBox.  However, it uses AutomatedListBoxItemAutomationPeer to represent
-    // all items within it, which is our class and which allows us to return user-friendly
-    // representation of all Cider structures exposed through automation.
-    // </summary>
-    [SuppressMessage("Microsoft.Maintainability", "CA1501:AvoidExcessiveInheritance")]
-    internal class AutomatedComboBox : ComboBox 
-    {
-
-        protected override AutomationPeer OnCreateAutomationPeer() 
-        {
-            return new AutomatedComboBoxAutomationPeer(this);
-        }
-
-        private class AutomatedComboBoxAutomationPeer : ComboBoxAutomationPeer 
-        {
-            public AutomatedComboBoxAutomationPeer(AutomatedComboBox owner)
-                : base(owner) 
-            {
-            }
-
-            protected override ItemAutomationPeer CreateItemAutomationPeer(object item) 
-            {
-                return new AutomatedListBoxItemAutomationPeer(item, this);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/AutomatedListBox.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/AutomatedListBox.cs
deleted file mode 100644 (file)
index 4a597e3..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Automation 
-{
-    using System;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows.Controls;
-    using System.Windows.Automation.Peers;
-
-    // <summary>
-    // Standard ListBox.  However, it uses AutomatedListBoxItemAutomationPeer to represent
-    // all items within it, which is our class and which allows us to return user-friendly
-    // representation of all Cider structures exposed through automation.
-    // </summary>
-    [SuppressMessage("Microsoft.Maintainability", "CA1501:AvoidExcessiveInheritance")]
-    internal class AutomatedListBox : ListBox 
-    {
-
-        protected override AutomationPeer OnCreateAutomationPeer() 
-        {
-            return new AutomatedListBoxAutomationPeer(this);
-        }
-
-        private class AutomatedListBoxAutomationPeer : ListBoxAutomationPeer 
-        {
-            public AutomatedListBoxAutomationPeer(ListBox owner)
-                : base(owner) 
-            {
-            }
-
-            protected override ItemAutomationPeer CreateItemAutomationPeer(object item) 
-            {
-                return new AutomatedListBoxItemAutomationPeer(item, this);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/AutomatedListBoxItemAutomationPeer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/AutomatedListBoxItemAutomationPeer.cs
deleted file mode 100644 (file)
index 3a9a827..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Automation 
-{
-    using System;
-    using System.Globalization;
-    using System.Windows.Automation.Peers;
-
-    using System.Activities.Presentation.PropertyEditing;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.Editors;
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector;
-
-    // <summary>
-    // Cider-specific wrapper for ListBoxItemAutomationPeer that overrides GetNameCore()
-    // and returns a user-friendly name for all Cider structures exposed through automation.
-    // </summary>
-    internal class AutomatedListBoxItemAutomationPeer : ListBoxItemAutomationPeer 
-    {
-
-        public AutomatedListBoxItemAutomationPeer(object item, SelectorAutomationPeer owner)
-            : base(item, owner) 
-        {
-        }
-
-        protected override string GetNameCore() 
-        {
-            return EditorUtilities.GetDisplayName(this.Item);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/CategoryContainerAutomationPeer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/CategoryContainerAutomationPeer.cs
deleted file mode 100644 (file)
index 1af6d56..0000000
+++ /dev/null
@@ -1,660 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Automation 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Text;
-    using System.Windows;
-    using System.Windows.Automation;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Automation.Provider;
-    using System.Windows.Controls;
-    using System.Windows.Media;
-
-    using System.Runtime;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector;
-
-    using System.Activities.Presentation.Internal.Properties;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using System.Activities.Presentation.Internal.PropertyEditing.Selection;
-
-    // <summary>
-    // This class contains the core logic for CategoryContainerAutomationPeer.  It's constructor is
-    // private because it can be instantiated in two different ways, which are exposed through
-    // static methods: CreateStandAloneAutomationPeer() and CreateItemAutomationPeer().
-    //
-    // CreateStandAloneAutomationPeer() returns an AutomationPeer that is agnostic of its parent
-    // CreateItemAutomationPeer() returns an AutomationPeer where the parent is assumed to be an ItemsControl.
-    //
-    // Because in the CategoryList : ItemsControl class we manually override GetContainerForItemOverride()
-    // as a way of reducing control count in PI, we need to provide both versions of the
-    // CategoryContainerAutomationPeer.
-    // </summary>
-    internal class CategoryContainerAutomationPeer : IExpandCollapseProvider, IScrollItemProvider 
-    {
-
-        private CiderCategoryContainer _container;
-        private AutomationPeer _itemAutomationPeer;
-
-        // Private ctor called from two public, static accessors
-        private CategoryContainerAutomationPeer(CiderCategoryContainer container, AutomationPeer itemPeer) 
-        {
-            Fx.Assert(container != null, "CategoryContainer not specified.");
-            Fx.Assert(itemPeer != null, "CategoryContainerItemAutomationPeer not specified.");
-            _container = container;
-            _itemAutomationPeer = itemPeer;
-
-        }
-
-        // <summary>
-        // Gets the expand / collapse state of the contained CategoryContainer
-        // </summary>
-        public ExpandCollapseState ExpandCollapseState 
-        {
-            get {
-                if (_container == null)
-                {
-                    return ExpandCollapseState.Collapsed;
-                }
-
-                return _container.Expanded ? ExpandCollapseState.Expanded : ExpandCollapseState.Collapsed;
-            }
-        }
-        
-        // IScrollItemProvider Members
-
-        // <summary>
-        // Creates a CategoryContainerAutomationPeer that can be returned directly from
-        // the CiderCategoryContainer control itself.
-        // </summary>
-        // <param name="container">Container to automate</param>
-        // <returns>Instance of CategoryContainerAutomationPeer that can be returned directly from
-        // the CiderCategoryContainer control itself</returns>
-        public static UIElementAutomationPeer CreateStandAloneAutomationPeer(CiderCategoryContainer container) 
-        {
-            return new CategoryContainerStandAloneAutomationPeer(container);
-        }
-
-        // <summary>
-        // Creates a CategoryContainerAutomationPeer that can be returned for CategoryContainers
-        // belonging to a CategoryList control
-        // </summary>
-        // <param name="category">CategoryEntry instance used by ItemsControl</param>
-        // <param name="container">Container to automate</param>
-        // <param name="parentAutomationPeer">Parent AutomationPeer</param>
-        // <returns>Instance of CategoryContainerAutomationPeer that can be returned for CategoryContainers
-        // belonging to a CategoryList control</returns>
-        public static ItemAutomationPeer CreateItemAutomationPeer(ModelCategoryEntry category, CiderCategoryContainer container, CategoryListAutomationPeer parentAutomationPeer) 
-        {
-            return new CategoryContainerItemAutomationPeer(category, container, parentAutomationPeer);
-        }
-
-        // Gets the children of the contained CategoryContainer, returning AutomationPeers
-        // for CategoryEditors followed by AutomationPeers for any left-over properties
-        private List<AutomationPeer> GetChildrenCore() 
-        {
-            List<AutomationPeer> children = new List<AutomationPeer>();
-
-            if (_container != null) 
-            {
-                AddCategoryEditors(children, VisualTreeUtils.GetNamedChild<ItemsControl>(_container, "PART_BasicCategoryEditors"), Resources.PropertyEditing_BasicCategoryEditors);
-                AddCategoryProperties(children, VisualTreeUtils.GetNamedChild<ItemsControl>(_container, "PART_BasicPropertyList"));
-
-                if (_container.Expanded) 
-                {
-
-                    Expander advancedExpander = VisualTreeUtils.GetNamedChild<Expander>(_container, "PART_AdvancedExpander");
-
-                    if (advancedExpander != null &&
-                        advancedExpander.Visibility == Visibility.Visible) 
-                    {
-                        children.Add(new AdvancedCategoryContainerAutomationPeer(_container, advancedExpander));
-                    }
-                }
-            }
-
-            return children;
-        }
-
-        // Adds AutomationPeers for all CategoryEditors displayed within the contained CategoryContainer
-        private static void AddCategoryEditors(List<AutomationPeer> peers, ItemsControl editors, string containerDisplayName) 
-        {
-            if (editors == null || editors.Items.Count == 0)
-            {
-                return;
-            }
-
-            peers.Add(new CategoryEditorListAutomationPeer(containerDisplayName, editors));
-        }
-
-        // Adds AutomationPeers for all PropertyEntries not consumed by the CategoryEditors within this
-        // CategoryContainer
-        private static void AddCategoryProperties(List<AutomationPeer> peers, ItemsControl properties) 
-        {
-            if (properties == null)
-            {
-                return;
-            }
-
-            int childCount = properties.Items.Count;
-
-            for (int i = 0; i < childCount; i++) 
-            {
-                PropertyContainer propertyContainer = properties.ItemContainerGenerator.ContainerFromIndex(i) as PropertyContainer;
-
-                if (propertyContainer != null)
-                {
-                    peers.Add(new PropertyContainerAutomationPeer(propertyContainer));
-                }
-            }
-        }
-
-        // Gets the implementation of the specified pattern if one exists.
-        // Currently supported patterns: ExpandCollapse
-        private object GetPattern(PatternInterface patternInterface) 
-        {
-            if (patternInterface == PatternInterface.ExpandCollapse)
-            {
-                return this;
-            }
-            else if (patternInterface == PatternInterface.ScrollItem)
-            {
-                return this;
-            }
-
-            return null;
-        }
-
-        // Returns the name of the represented category
-        private string GetNameCore() 
-        {
-            if (_container != null)
-            {
-                return _container.Category.CategoryName;
-            }
-
-            return string.Empty;
-        }
-
-        // Return "CategoryContainer"
-        private static string GetClassNameCore() 
-        {
-            return typeof(CategoryContainer).Name;
-        }
-
-        // Gets the help text to associated with the contained CategoryContainer
-        private static string GetHelpTextCore() 
-        {
-            return Resources.PropertyEditing_CategoryContainerAutomationPeerHelp;
-        }
-
-        // IExpandCollapseProvider Members
-
-        // <summary>
-        // Collapses the contained CategoryContainer
-        // </summary>
-        public void Collapse() 
-        {
-            if (_container != null)
-            {
-                _container.Expanded = false;
-            }
-        }
-
-        // <summary>
-        // Expands the contained CategoryContainer
-        // </summary>
-        public void Expand() 
-        {
-            if (_container != null)
-            {
-                _container.Expanded = true;
-            }
-        }
-
-        // <summary>
-        // Scrolls the contained CategoryContainer into view
-        // </summary>
-        public void ScrollIntoView() 
-        {
-            if (_container != null)
-            {
-                _container.BringIntoView();
-            }
-        }
-
-
-        // RaiseSelectionEventsForScreenReader
-
-        // <summary>
-        //  This public method is called when parent creates the CategoryContainerItemAutomationPeer
-        //  in the GetChildrenCore, thus listening to the changes in the IsSelectedProperty.
-        // </summary>
-        public void AddFocusEvents() 
-        {
-            if (_container != null) 
-            {
-                HookUpFocusEvents(VisualTreeUtils.GetNamedChild<Expander>(_container, "PART_MainExpander"), OnIsSelectedValueChanged);
-            }
-        }
-
-        // <summary>
-        // Private helper function to listen to the changes in the IsSelectedProperty,
-        // which then fires the OnValueChanged event.
-        // </summary>
-        // <param name="expander">Expander control</param>
-        // <param name="valueChangedEvent">ValueChanged event</param>
-        private static void HookUpFocusEvents(Expander expander, EventHandler valueChangedEvent) 
-        {
-            if (expander != null) 
-            {
-                FrameworkElement expanderGrid = VisualTreeUtils.GetNamedChild<FrameworkElement>(expander, "PART_BasicSection");
-                if (expanderGrid != null) 
-                {
-                    DependencyPropertyDescriptor dpd = DependencyPropertyDescriptor.FromProperty(PropertySelection.IsSelectedProperty, typeof(Grid));
-                    if (dpd != null) 
-                    {
-                        dpd.AddValueChanged(expanderGrid, valueChangedEvent);
-                    }
-                }
-            }
-        }
-
-        // <summary>
-        // The actual event handler, that fires when the IsSelected DP changes.
-        // Here we raise the AutomationFocus event.
-        // </summary>
-        // <param name="sender">Expander</param>
-        // <param name="e">EventArgs</param>
-        private void OnIsSelectedValueChanged(object sender, EventArgs e) 
-        {
-            // Add logic to respond to "Selection"
-            bool curVal = PropertySelection.GetIsSelected(sender as DependencyObject);
-            if (curVal) 
-            {
-                _itemAutomationPeer.RaiseAutomationEvent(AutomationEvents.AutomationFocusChanged);
-            }
-        }
-
-
-
-        // <summary>
-        //  This public method is called when parent creates the CategoryContainerItemAutomationPeer
-        //  in the GetChildrenCore, thus clearing off all the event listeners before we add new ones
-        // </summary>
-        public void RemoveFocusEvents() 
-        {
-            if (_container != null) 
-            {
-                UnHookFocusEvents(VisualTreeUtils.GetNamedChild<Expander>(_container, "PART_MainExpander"), OnIsSelectedValueChanged);
-            }
-        }
-
-        // <summary>
-        // Private method to unhook the ValueChanged event.
-        // </summary>
-        // <param name="expander">Expander</param>
-        // <param name="valueChangedEvent">ValueChanged event</param>
-        private static void UnHookFocusEvents(Expander expander, EventHandler valueChangedEvent) 
-        {
-            if (expander != null) 
-            {
-                FrameworkElement expanderGrid = VisualTreeUtils.GetNamedChild<FrameworkElement>(expander, "PART_BasicSection");
-                if (expanderGrid != null) 
-                {
-                    DependencyPropertyDescriptor dpd = DependencyPropertyDescriptor.FromProperty(PropertySelection.IsSelectedProperty, typeof(Grid));
-                    if (dpd != null) 
-                    {
-                        dpd.RemoveValueChanged(expanderGrid, valueChangedEvent);
-                    }
-                }
-            }
-        }
-
-        // end RaiseSelectionEventsForScreenReader
-
-        // <summary>
-        // Helper AutomationPeer that represents CategoryContainerAutomationPeer when the CategoryContainer
-        // is hosted in a CategoryList control.  All of its methods delegate to CategoryContainerAutomationPeer
-        // </summary>
-        internal class CategoryContainerItemAutomationPeer : ItemAutomationPeer, IAutomationFocusChangedEventSource 
-        {
-
-            private CategoryContainerAutomationPeer _coreLogic;
-            private List<AutomationPeer> _children;
-
-            public CategoryContainerItemAutomationPeer(
-                ModelCategoryEntry item,
-                CiderCategoryContainer container,
-                CategoryListAutomationPeer parentAutomationPeer)
-                : base(item, parentAutomationPeer) 
-            {
-                _coreLogic = new CategoryContainerAutomationPeer(container, this);
-                _coreLogic.AddFocusEvents();
-            }
-
-            // Implementation of this method is specific to CategoryContainerItemAutomationPeer
-            protected override AutomationControlType GetAutomationControlTypeCore() 
-            {
-                return AutomationControlType.List;
-            }
-
-            protected override List<AutomationPeer> GetChildrenCore() 
-            {
-                _children = _coreLogic.GetChildrenCore();
-                return _children;
-            }
-
-            protected override string GetNameCore() 
-            {
-                return _coreLogic.GetNameCore();
-            }
-
-            protected override string GetClassNameCore() 
-            {
-                return CategoryContainerAutomationPeer.GetClassNameCore();
-            }
-
-            protected override string GetHelpTextCore() 
-            {
-                return CategoryContainerAutomationPeer.GetHelpTextCore();
-            }
-
-            public override object GetPattern(PatternInterface patternInterface) 
-            {
-                return _coreLogic.GetPattern(patternInterface);
-            }
-
-            // IAutomationFocusChangedEventSource Members
-            public void UnloadEventHook() 
-            {
-                _coreLogic.RemoveFocusEvents();
-                if (_children != null) 
-                {
-                    foreach (AutomationPeer peer in _children) 
-                    {
-                        IAutomationFocusChangedEventSource unhookEventPeer = peer as IAutomationFocusChangedEventSource;
-                        if (unhookEventPeer != null) 
-                        {
-                            unhookEventPeer.UnloadEventHook();
-                        }
-                    }
-                }
-            }
-        }
-
-        // <summary>
-        // Automation peer we use to display the list of CategoryEditors
-        // </summary>
-        private class CategoryEditorListAutomationPeer : ItemsControlAutomationPeer 
-        {
-
-            private string _displayName;
-
-            // Note: the display name we use here is for completeness only.  This class is hidden
-            // from screen readers.
-            public CategoryEditorListAutomationPeer(string displayName, ItemsControl owner)
-                : base(owner) 
-            {
-                _displayName = displayName ?? string.Empty;
-            }
-
-            protected override ItemAutomationPeer CreateItemAutomationPeer(object item) 
-            {
-                return new CategoryEditorAutomationPeer(item, this);
-            }
-
-            protected override string GetClassNameCore() 
-            { 
-                return typeof(ItemsControl).Name; 
-            }
-            protected override string GetNameCore() 
-            { 
-                return _displayName; 
-            }
-            protected override bool IsControlElementCore() 
-            { 
-                return false; 
-            }
-            protected override bool IsContentElementCore() 
-            { 
-                return false; 
-            }
-
-            private class CategoryEditorAutomationPeer : ItemAutomationPeer 
-            {
-
-                public CategoryEditorAutomationPeer(object item, CategoryEditorListAutomationPeer parent)
-                    : base(item, parent) 
-                {
-                }
-
-                public override object GetPattern(PatternInterface patternInterface) 
-                { 
-                    return null; 
-                }
-                protected override AutomationControlType GetAutomationControlTypeCore() 
-                { 
-                    return AutomationControlType.Custom; 
-                }
-                protected override string GetClassNameCore() 
-                { 
-                    return typeof(CategoryEditor).Name; 
-                }
-                protected override string GetNameCore() 
-                { 
-                    return Item == null ? string.Empty : Item.GetType().Name; 
-                }
-                protected override bool IsContentElementCore() 
-                { 
-                    return true; 
-                }
-                protected override bool IsControlElementCore() 
-                { 
-                    return true; 
-                }
-            }
-        }
-
-        // <summary>
-        // Helper AutomationPeer for the advanced portion of the CategoryContainer
-        // </summary>
-        private class AdvancedCategoryContainerAutomationPeer : ExpanderAutomationPeer, IAutomationFocusChangedEventSource 
-        {
-
-            private CiderCategoryContainer _container;
-            private Expander _expander;
-            private List<AutomationPeer> _children;
-
-            public AdvancedCategoryContainerAutomationPeer(CiderCategoryContainer container, Expander expander)
-                : base(expander) 
-            {
-                Fx.Assert(container != null, "CategoryContainer not specified.");
-                Fx.Assert(expander != null, "Expander not specified.");
-                _expander = expander;
-                _container = container;
-                AddFocusEvents();
-            }
-
-            // <summary>
-            //  This public method is called when parent creates the CategoryContainerItemAutomationPeer
-            //  in the GetChildrenCore, thus listening to the changes in the IsSelectedProperty.
-            // </summary>
-            private void AddFocusEvents() 
-            {
-                if (_container != null) 
-                {
-                    HookUpFocusEvents(VisualTreeUtils.GetNamedChild<Expander>(_container, "PART_AdvancedExpander"), OnIsSelectedValueChanged);
-                }
-            }
-
-            protected override List<AutomationPeer> GetChildrenCore() 
-            {
-                _children = new List<AutomationPeer>();
-                if (_container != null) 
-                {
-                    CategoryContainerAutomationPeer.AddCategoryEditors(_children, VisualTreeUtils.GetNamedChild<ItemsControl>(_container, "PART_AdvancedCategoryEditors"), Resources.PropertyEditing_AdvancedCategoryEditors);
-                    CategoryContainerAutomationPeer.AddCategoryProperties(_children, VisualTreeUtils.GetNamedChild<ItemsControl>(_container, "PART_AdvancedPropertyList"));
-                }
-                //Add focus events for Subproperty editor
-                foreach (AutomationPeer peer in _children) 
-                {
-                    PropertyContainerAutomationPeer pcAutomationPeer = peer as PropertyContainerAutomationPeer;
-                    if (pcAutomationPeer != null) 
-                    {
-                        pcAutomationPeer.AddFocusEvents();
-                    }
-                }
-                return _children;
-            }
-
-            protected override string GetNameCore() 
-            {
-                return _expander.Header.ToString();
-            }
-
-            // <summary>
-            // Private helper function to listen to the changes in the IsSelectedProperty,
-            // which then fires the OnValueChanged event.
-            // </summary>
-            // <param name="expander">Expander control</param>
-            // <param name="valueChangedEvent">ValueChanged event</param>
-            private static void HookUpFocusEvents(Expander expander, EventHandler valueChangedEvent) 
-            {
-                if (expander != null) 
-                {
-                    FrameworkElement expanderGrid = VisualTreeUtils.GetNamedChild<FrameworkElement>(expander, "PART_AdvancedSection");
-                    if (expanderGrid != null) 
-                    {
-                        DependencyPropertyDescriptor dpd = DependencyPropertyDescriptor.FromProperty(PropertySelection.IsSelectedProperty, typeof(Grid));
-                        if (dpd != null) 
-                        {
-                            dpd.AddValueChanged(expanderGrid, valueChangedEvent);
-                        }
-                    }
-                }
-            }
-
-            // <summary>
-            // The actual event handler, that fires when the IsSelected DP changes.
-            // Here we raise the AutomationFocus event for the
-            // Advanced (More Properties) properties expander.
-            // </summary>
-            // <param name="sender">Expander</param>
-            // <param name="e">EventArgs</param>
-            private void OnIsSelectedValueChanged(object sender, EventArgs e) 
-            {
-                // Add logic to respond to "Selection"
-                bool curVal = PropertySelection.GetIsSelected(sender as DependencyObject);
-                if (curVal) 
-                {
-                    this.RaiseAutomationEvent(AutomationEvents.AutomationFocusChanged);
-                }
-            }
-
-            // <summary>
-            //  This public method is called when parent creates the CategoryContainerItemAutomationPeer
-            //  in the GetChildrenCore, thus clearing off all the event listeners before we add new ones
-            // </summary>
-            public void RemoveFocusEvents() 
-            {
-                if (_container != null) 
-                {
-                    UnHookFocusEvents(VisualTreeUtils.GetNamedChild<Expander>(_container, "PART_AdvancedExpander"), OnIsSelectedValueChanged);
-                }
-            }
-
-            // <summary>
-            // Private method to unhook the ValueChanged event.
-            // </summary>
-            // <param name="expander">Expander</param>
-            // <param name="valueChangedEvent">ValueChanged event</param>
-            private static void UnHookFocusEvents(Expander expander, EventHandler valueChangedEvent) 
-            {
-                if (expander != null) 
-                {
-                    FrameworkElement expanderGrid = VisualTreeUtils.GetNamedChild<FrameworkElement>(expander, "PART_AdvancedSection");
-                    if (expanderGrid != null) 
-                    {
-                        DependencyPropertyDescriptor dpd = DependencyPropertyDescriptor.FromProperty(PropertySelection.IsSelectedProperty, typeof(Grid));
-                        if (dpd != null) 
-                        {
-                            dpd.RemoveValueChanged(expanderGrid, valueChangedEvent);
-                        }
-                    }
-                }
-            }
-
-            // IAutomationFocusChangedEventSource Members
-            public void UnloadEventHook() 
-            {
-                RemoveFocusEvents();
-                if (_children != null) 
-                {
-                    foreach (AutomationPeer peer in _children) 
-                    {
-                        IAutomationFocusChangedEventSource unhookEventPeer = peer as IAutomationFocusChangedEventSource;
-                        if (unhookEventPeer != null) 
-                        {
-                            unhookEventPeer.UnloadEventHook();
-                        }
-                    }
-                }
-            }
-        }
-
-        // <summary>
-        // Helper AutomationPeer that represents CategoryContainerAutomationPeer when the CategoryContainer
-        // sits on its own.  All of its methods delegate to CategoryContainerAutomationPeer
-        // </summary>
-        private class CategoryContainerStandAloneAutomationPeer : UIElementAutomationPeer, IAutomationFocusChangedEventSource
-        {
-
-            private CategoryContainerAutomationPeer _coreLogic;
-
-            public CategoryContainerStandAloneAutomationPeer(CiderCategoryContainer container)
-                : base(container) 
-            {
-                _coreLogic = new CategoryContainerAutomationPeer(container, this);
-                _coreLogic.AddFocusEvents();
-            }
-
-            protected override List<AutomationPeer> GetChildrenCore() 
-            {
-                return _coreLogic.GetChildrenCore();
-            }
-
-            protected override string GetNameCore() 
-            {
-                return _coreLogic.GetNameCore();
-            }
-
-            protected override string GetClassNameCore() 
-            {
-                return CategoryContainerAutomationPeer.GetClassNameCore();
-            }
-
-            protected override string GetHelpTextCore() 
-            {
-                return CategoryContainerAutomationPeer.GetHelpTextCore();
-            }
-
-            public override object GetPattern(PatternInterface patternInterface) 
-            {
-                return _coreLogic.GetPattern(patternInterface);
-            }
-
-            // IAutomationFocusChangedEventSource Members
-
-            public void UnloadEventHook() 
-            {
-                _coreLogic.RemoveFocusEvents();
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/CategoryListAutomationPeer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/CategoryListAutomationPeer.cs
deleted file mode 100644 (file)
index c31d46a..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Automation 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Text;
-    using System.Windows;
-    using System.Windows.Automation;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Automation.Provider;
-    using System.Windows.Controls;
-    using System.Windows.Media;
-
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using System.Activities.Presentation.Internal.PropertyEditing.Selection;
-    using System.Activities.Presentation.Internal.Properties;
-
-    // <summary>
-    // AutomationPeer for CategoryList class
-    // </summary>
-    internal class CategoryListAutomationPeer : ItemsControlAutomationPeer, IAutomationFocusChangedEventSource 
-    {
-
-        private CategoryList _control;
-        // Children list.
-        private List<AutomationPeer> _children;
-
-        // <summary>
-        // Basic ctor
-        // </summary>
-        // <param name="owner">Contained CategoryList</param>
-        public CategoryListAutomationPeer(CategoryList owner)
-            : base(owner) 
-        {
-            if (owner == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("owner");
-            }
-
-            _control = owner;
-            _children = new List<AutomationPeer>();
-        }
-
-        protected override ItemAutomationPeer CreateItemAutomationPeer(object item) 
-        {
-
-            ItemAutomationPeer peer = CategoryContainerAutomationPeer.CreateItemAutomationPeer(
-                item as ModelCategoryEntry,
-                _control.ItemContainerGenerator.ContainerFromItem(item) as CiderCategoryContainer,
-                this);
-
-            //Add each item to the children's list
-            _children.Add(peer);
-
-            return peer;
-        }
-
-        protected override string GetClassNameCore() 
-        {
-            return typeof(ItemsControl).Name;
-        }
-
-        protected override string GetNameCore() 
-        {
-            return Resources.PropertyEditing_CategoryList;
-        }
-
-        // We use the ItemStatus to convey read-only property selection status
-        protected override string GetItemStatusCore() 
-        {
-            FrameworkElement selection = _control.Selection;
-            string status;
-
-            if (selection != null) 
-            {
-                ISelectionStop selectionStop = PropertySelection.GetSelectionStop(selection);
-                status = selectionStop == null ? null : selectionStop.Description;
-
-                if (status == null) 
-                {
-                    status = string.Format(
-                        CultureInfo.CurrentCulture,
-                        Resources.PropertyEditing_SelectionStatus_Unknown,
-                        selection.GetType().Name);
-                }
-            }
-            else 
-            {
-                status = Resources.PropertyEditing_SelectionStatus_Empty;
-            }
-
-            return status;
-        }
-
-        // IAutomationFocusChangedEventSource Members
-        public void UnloadEventHook() 
-        {
-            if (_children != null) 
-            {
-                foreach (AutomationPeer peer in _children) 
-                {
-                    IAutomationFocusChangedEventSource unhookEventPeer = peer as IAutomationFocusChangedEventSource;
-                    if (unhookEventPeer != null) 
-                    {
-                        unhookEventPeer.UnloadEventHook();
-                    }
-                }
-            }
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/HiddenUIElementAutomationPeer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/HiddenUIElementAutomationPeer.cs
deleted file mode 100644 (file)
index 54c378b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Automation
-{
-    using System.Windows.Automation.Peers;
-    using System.Windows;
-    // Implementation of UIElementAutomationPeer that in and of itself does not show up on
-    // a screen reader's radar, but that does expose any of its children that should
-    class HiddenUIElementAutomationPeer : UIElementAutomationPeer
-    {
-        public HiddenUIElementAutomationPeer(UIElement owner)
-            : base(owner)
-        {
-        }
-
-        protected override bool IsControlElementCore()
-        {
-            return false;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/IAutomationFocusChangedEventSource.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/IAutomationFocusChangedEventSource.cs
deleted file mode 100644 (file)
index 0aaf5ff..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Internal.PropertyEditing.Automation 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-
-    internal interface IAutomationFocusChangedEventSource 
-    {
-        void UnloadEventHook();
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/PropertyContainerAutomationPeer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/PropertyContainerAutomationPeer.cs
deleted file mode 100644 (file)
index 08ce7b7..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Automation 
-{
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Text;
-    using System.Windows;
-    using System.Windows.Automation;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Automation.Provider;
-    using System.Windows.Controls;
-    using System.Windows.Media;
-
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.PropertyEditing;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector;
-    using System.Activities.Presentation.Internal.PropertyEditing.Selection;
-
-    // <summary>
-    // AutomationPeer for PropertyContainer
-    // </summary>
-    internal class PropertyContainerAutomationPeer : UIElementAutomationPeer, IValueProvider, IScrollItemProvider, IAutomationFocusChangedEventSource
-    {
-
-        private PropertyContainer _container;
-
-        // <summary>
-        // Basic ctor
-        // </summary>
-        // <param name="container"></param>
-        public PropertyContainerAutomationPeer(PropertyContainer container)
-            : base(container) 
-        {
-            if (container == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("container");
-            }
-
-            _container = container;
-        }
-
-        // <summary>
-        // Gets a value indicating whether the contained PropertyContainer is read-only
-        // </summary>
-        public bool IsReadOnly 
-        {
-            get { return _container.PropertyEntry.IsReadOnly || !_container.PropertyEntry.PropertyValue.CanConvertFromString; }
-        }
-
-        // <summary>
-        // Gets the value of the property within the PropertyContainer
-        // </summary>
-        public string Value 
-        {
-            get { return _container.PropertyEntry.PropertyValue.StringValue; }
-        }
-
-
-        // IScrollItemProvider Members
-
-        // <summary>
-        //  This public method is called when parent creates the CategoryContainerItemAutomationPeer
-        //  in the GetChildrenCore, thus listening to the changes in the IsSelectedProperty.
-        // </summary>
-        internal void AddFocusEvents() 
-        {
-            if (_container != null) 
-            {
-                HookUpFocusEvents(_container, OnIsSelectedValueChanged);
-            }
-        }
-
-        // <summary>
-        // "PropertyContainer"
-        // </summary>
-        // <returns>"PropertyContainer"</returns>
-        protected override string GetClassNameCore() 
-        {
-            return typeof(PropertyContainer).Name;
-        }
-
-        // <summary>
-        // Returns the name of the contained property
-        // </summary>
-        // <returns></returns>
-        protected override string GetNameCore() 
-        {
-            return _container.PropertyEntry == null ? string.Empty : _container.PropertyEntry.DisplayName;
-        }
-
-        // <summary>
-        // Currently supported patterns: Value
-        // </summary>
-        // <param name="patternInterface"></param>
-        // <returns></returns>
-        public override object GetPattern(PatternInterface patternInterface) 
-        {
-            if (patternInterface == PatternInterface.Value)
-            {
-                return this;
-            }
-            else if (patternInterface == PatternInterface.ScrollItem)
-            {
-                return this;
-            }
-
-            return base.GetPattern(patternInterface);
-        }
-
-        // <summary>
-        // Private helper function to listen to the changes in the IsSelectedProperty,
-        // which then fires the OnValueChanged event.
-        // </summary>
-        // <param name="expander">Expander control</param>
-        // <param name="valueChangedEvent">ValueChanged event</param>
-        private static void HookUpFocusEvents(PropertyContainer container, EventHandler valueChangedEvent) 
-        {
-            if (container != null) 
-            {
-                DependencyPropertyDescriptor dpd = DependencyPropertyDescriptor.FromProperty(PropertySelection.IsSelectedProperty, typeof(PropertyContainer));
-                if (dpd != null) 
-                {
-                    dpd.AddValueChanged(container, valueChangedEvent);
-                }
-            }
-        }
-
-        // <summary>
-        // The actual event handler, that fires when the IsSelected DP changes.
-        // Here we raise the AutomationFocus event for the
-        // Advanced (More Properties) properties expander.
-        // </summary>
-        // <param name="sender">Expander</param>
-        // <param name="e">EventArgs</param>
-        private void OnIsSelectedValueChanged(object sender, EventArgs e) 
-        {
-            // Add logic to respond to "Selection"
-            bool curVal = PropertySelection.GetIsSelected(sender as DependencyObject);
-            if (curVal) 
-            {
-                this.RaiseAutomationEvent(AutomationEvents.AutomationFocusChanged);
-            }
-        }
-
-        // <summary>
-        //  This public method is called when parent creates the CategoryContainerItemAutomationPeer
-        //  in the GetChildrenCore, thus clearing off all the event listeners before we add new ones
-        // </summary>
-        public void RemoveFocusEvents() 
-        {
-            if (_container != null) 
-            {
-                UnHookFocusEvents(_container, OnIsSelectedValueChanged);
-            }
-        }
-
-        // <summary>
-        // Private method to unhook the ValueChanged event.
-        // </summary>
-        // <param name="expander">Expander</param>
-        // <param name="valueChangedEvent">ValueChanged event</param>
-        private static void UnHookFocusEvents(PropertyContainer container, EventHandler valueChangedEvent) 
-        {
-            if (container != null) 
-            {
-                DependencyPropertyDescriptor dpd = DependencyPropertyDescriptor.FromProperty(PropertySelection.IsSelectedProperty, typeof(PropertyContainer));
-                if (dpd != null) 
-                {
-                    dpd.RemoveValueChanged(container, valueChangedEvent);
-                }
-            }
-        }
-
-        // IValueProvider Members
-
-        // <summary>
-        // Sets the value of the property within the PropertyContainer
-        // </summary>
-        // <param name="value">Value to set</param>
-        public void SetValue(string value) 
-        {
-            _container.PropertyEntry.PropertyValue.StringValue = value;
-        }
-
-        // <summary>
-        // Scrolls the contained PropertyContainer into view, if it's within a scrolling control
-        // </summary>
-        public void ScrollIntoView() 
-        {
-            _container.BringIntoView();
-        }
-
-
-        // IAutomationFocusChangedEventSource Members
-        public void UnloadEventHook() 
-        {
-            RemoveFocusEvents();
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/PropertyInspectorAutomationPeer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/PropertyInspectorAutomationPeer.cs
deleted file mode 100644 (file)
index 1ee3df0..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Automation 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Controls;
-    using System.Windows;
-
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.Internal.Properties;
-    using System.Windows.Input;
-
-    // <summary>
-    // AutomationPeer for PropertyInspector
-    // </summary>
-    internal class PropertyInspectorAutomationPeer : UIElementAutomationPeer 
-    {
-
-        private PropertyInspector _inspector;
-
-        // Current list of children automation peers.
-        private List<AutomationPeer> _children;
-
-        public PropertyInspectorAutomationPeer(PropertyInspector owner)
-            : base(owner) 
-        {
-            if (owner == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("owner");
-            }
-
-            _inspector = owner;
-        }
-
-        // <summary>
-        // Gets a list of AutomationPeers that contains the following:
-        //     Type text box
-        //     Name text box
-        //     List of CategoryContainerAutomationPeers
-        // </summary>
-        // <returns></returns>
-        protected override List<AutomationPeer> GetChildrenCore() 
-        {
-            // If children list is not null and contains AutomationPeer that implements IAutomationFocusChangedEventSource
-            // Then, unhook the automation focus events before clearing the list 
-            // Else, create a new one.
-            if (_children != null) 
-            {
-                foreach (AutomationPeer peer in _children) 
-                {
-                    IAutomationFocusChangedEventSource unhookEventPeer = peer as IAutomationFocusChangedEventSource;
-                    if (unhookEventPeer != null) 
-                    {
-                        unhookEventPeer.UnloadEventHook();
-                    }
-                }
-                _children.Clear();
-            }
-            else 
-            {
-                _children = new List<AutomationPeer>();
-            }
-            _children.Add(new TextBlockAutomationPeer(_inspector.SelectionTypeLabel));
-            _children.Add(new UIElementAutomationPeer(_inspector.PropertyToolBar));
-            _children.Add(new InfoTextBlockAutomationPeer(_inspector.UninitializedLabel));
-            _children.Add(new InfoTextBlockAutomationPeer(_inspector.NoSearchResultsLabel));
-            _children.Add(new CategoryListAutomationPeer(_inspector.CategoryList));
-
-            return _children;
-        }
-
-        protected override Point GetClickablePointCore() 
-        {
-            // return a point that, when clicked, selects the grid without selecting
-            // any of the rows
-            return this.Owner.PointToScreen(new Point(10, 10));
-        }
-
-        protected override string GetHelpTextCore() 
-        {
-            return Resources.PropertyEditing_PropertyInspectorAutomationPeerHelp;
-        }
-
-        protected override string GetNameCore() 
-        {
-            return Resources.PropertyEditing_PropertyInspector;
-        }
-
-        protected override string GetClassNameCore() 
-        {
-            return typeof(PropertyInspector).Name;
-        }
-
-        // The following automation peers provide accessiblity support (Raise automation events on receiving keyboard focus)
-        // This is necessary for ACC-TOOLS especially screen readers like JAWS. 
-        // We cannot use the base AutomationPeers (like UIElementAutomationPeer) and *have* to derive from the respective types
-        // since the actual implementation of the handler when the focus event differs from element to element.
-        // So we cannot use single base class to achieve the desired goal. 
-        // 
-
-
-        private class InfoTextBlockAutomationPeer : TextBlockAutomationPeer, IAutomationFocusChangedEventSource 
-        {
-
-            private TextBlock _informationLabel;
-
-            public InfoTextBlockAutomationPeer(TextBlock informationLabel)
-                : base(informationLabel) 
-            {
-                if (informationLabel == null)
-                {
-                    throw FxTrace.Exception.ArgumentNull("informationLabel");
-                }
-                _informationLabel = informationLabel;
-                _informationLabel.PreviewGotKeyboardFocus += new KeyboardFocusChangedEventHandler(OnPreviewGotKeyboardFocus);
-            }
-
-            // <summary>
-            // PreviewGotKeyboardFocus event to raise the "AutomationFocus" event.
-            // </summary>
-            // <param name="sender">TextBlock</param>
-            // <param name="e">KeyboardFocusChangedEventArgs</param>
-            void OnPreviewGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) 
-            {
-                this.RaiseAutomationEvent(AutomationEvents.AutomationFocusChanged);
-            }
-
-            protected override AutomationPeer GetLabeledByCore() 
-            {
-                return new TextBlockAutomationPeer(_informationLabel);
-            }
-
-        // IAutomationFocusChangedEventSource Members
-
-            public void UnloadEventHook() 
-            {
-                Owner.PreviewGotKeyboardFocus -= new KeyboardFocusChangedEventHandler(OnPreviewGotKeyboardFocus);
-            }
-
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/SubPropertyEditorAutomationPeer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/SubPropertyEditorAutomationPeer.cs
deleted file mode 100644 (file)
index 6d6a089..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Automation 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Windows;
-    using System.Windows.Automation;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Automation.Provider;
-    using System.Windows.Controls;
-    using System.Windows.Media;
-
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.ValueEditors;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.Editors;
-    using System.Activities.Presentation.Internal.Properties;
-
-    // <summary>
-    // AutomationPeer for the SubPropertyEditor
-    // </summary>
-    internal class SubPropertyEditorAutomationPeer : UIElementAutomationPeer, IExpandCollapseProvider 
-    {
-
-        private SubPropertyEditor _editor;
-        List<AutomationPeer> _children;
-
-        public SubPropertyEditorAutomationPeer(SubPropertyEditor editor)
-            : base(editor) 
-        {
-            _editor = editor;
-
-            // Hook into the VisualsChanged event so that this peer can invalidate
-            // itself appropriately
-            if (editor != null)
-            {
-                editor.VisualsChanged += new EventHandler(OnEditorVisualsChanged);
-            }
-
-            _children = new List<AutomationPeer>();
-
-        }
-
-        // <summary>
-        // Gets the ExpandCollapse state of the sub-properties
-        // </summary>
-        public ExpandCollapseState ExpandCollapseState 
-        {
-            get {
-                return _editor.IsExpanded ? ExpandCollapseState.Expanded : ExpandCollapseState.Collapsed;
-            }
-        }
-
-
-        protected override string GetNameCore() 
-        {
-            return Resources.PropertyEditing_SubPropertyEditorAutomationName;
-        }
-
-        protected override string GetClassNameCore() 
-        {
-            return typeof(SubPropertyEditor).Name;
-        }
-
-        // Support the ExpandCollapse pattern
-        public override object GetPattern(PatternInterface patternInterface) 
-        {
-            if (patternInterface == PatternInterface.ExpandCollapse)
-            {
-                return this;
-            }
-
-            return base.GetPattern(patternInterface);
-        }
-
-        protected override List<AutomationPeer> GetChildrenCore() 
-        {
-            if (_children != null) 
-            {
-                foreach (AutomationPeer peer in _children) 
-                {
-                    IAutomationFocusChangedEventSource unhookEventPeer = peer as IAutomationFocusChangedEventSource;
-                    if (unhookEventPeer != null) 
-                    {
-                        unhookEventPeer.UnloadEventHook();
-                    }
-                }
-                _children.Clear();
-            }
-
-            // See if we have access to the QuickTypes combo box (it may or may not be available)
-            AutomatedChoiceEditor choiceEditor = VisualTreeUtils.GetNamedChild<AutomatedChoiceEditor>(_editor, "PART_ValueEditor");
-
-            // If we do, present it as one of our children
-            if (choiceEditor != null) 
-            {
-                _children.Add(new HiddenUIElementAutomationPeer(choiceEditor));
-            }
-
-            // Add any sub-properties
-            ItemsControl properties = VisualTreeUtils.GetNamedChild<ItemsControl>(_editor, "PART_SubPropertyList");
-
-            if (properties != null) 
-            {
-                int childCount = properties.Items.Count;
-
-                for (int i = 0; i < childCount; i++) 
-                {
-                    PropertyContainer propertyContainer = properties.ItemContainerGenerator.ContainerFromIndex(i) as PropertyContainer;
-
-                    if (propertyContainer != null) 
-                    {
-                        PropertyContainerAutomationPeer peer = new PropertyContainerAutomationPeer(propertyContainer);
-                        _children.Add(peer);
-                    }
-
-                }
-            }
-
-            return _children;
-        }
-
-        private void OnEditorVisualsChanged(object sender, EventArgs e) 
-        {
-            this.InvalidatePeer();
-        }
-
-        // IExpandCollapseProvider Members
-
-        // <summary>
-        // Attempts to collapse the sub-properties
-        // </summary>
-        public void Collapse() 
-        {
-            if (_editor != null)
-            {
-                _editor.IsExpanded = false;
-            }
-        }
-
-        // <summary>
-        // Attempts to expand the sub-properties
-        // </summary>
-        public void Expand() 
-        {
-            if (_editor != null &&
-                _editor.PropertyEntry != null &&
-                _editor.PropertyEntry.PropertyValue.HasSubProperties == true)
-            {
-                _editor.IsExpanded = true;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/TextFormatConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Automation/TextFormatConverter.cs
deleted file mode 100644 (file)
index fa413e9..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Automation 
-{
-    using System;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Windows.Data;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // Simple converter that uses a format string to convert a value into a display string
-    // This class is referenced in XAML.
-    // </summary>
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal class TextFormatConverter : IValueConverter 
-    {
-
-        private string _format;
-
-        // <summary>
-        // Gets or sets the format string to apply
-        // </summary>
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        public string Format 
-        {
-            get {
-                return _format;
-            }
-            set {
-                _format = value;
-            }
-        }
-
-        // IValueConverter Members
-
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 
-        {
-            value = value ?? "null";
-            return string.Format(culture ?? CultureInfo.CurrentCulture, _format ?? "{0}", value.ToString());
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 
-        {
-            throw FxTrace.Exception.AsError(new InvalidOperationException());
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/CategoryList.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/CategoryList.cs
deleted file mode 100644 (file)
index cd5a3a4..0000000
+++ /dev/null
@@ -1,1224 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Windows;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Controls;
-    using System.Windows.Input;
-    using System.Windows.Threading;
-
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.PropertyEditing;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.Automation;
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework;
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data;
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using System.Activities.Presentation.Internal.PropertyEditing.Selection;
-    using System.Activities.Presentation.Internal.PropertyEditing.State;
-
-    // <summary>
-    // Wrapper around ItemsControl that knows how to contain and display CategoryEntries,
-    // deals with AutomationPeers, and persists the open and closed state of individual
-    // CategoryContainers.
-    //
-    // This class should ideally be internal, but Avalon can't handle attached properties
-    // (which this class defines) on internal classes.
-    // </summary>
-    internal class CategoryList : ItemsControl, IEnumerable<CategoryBase>, IStateContainer, INotifyPropertyChanged 
-    {
-
-        // This guy is static so that its values persist across designers and CategoryList instances
-        private static CategoryStateContainer _categoryStates = new CategoryStateContainer();
-
-        // This guy is not because it caches FilterString, which is specific to each CategoryList instance
-        private IStateContainer _stateContainer;
-
-        // Used for property selection
-        private FrameworkElement _selection;
-        private PropertySelectionMode _selectionMode;
-
-        // Used for property filtering
-        private string _filterString;
-        private PropertyFilter _currentFilter;
-        private bool _hasAnyFilterMatches = true;
-        private ICommand _clearFilterCommand;
-
-        // Miscelaneous
-        private SharedPropertyValueColumnWidthContainer _sharedWidthContainer;
-
-        [SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")]
-        static CategoryList() 
-        {
-            // Make CategoryList non-focusable by default
-            UIElement.FocusableProperty.OverrideMetadata(typeof(CategoryList), new FrameworkPropertyMetadata(false));
-
-            // Mark the uber-CategoryList as the scope for property selection
-            PropertySelection.IsSelectionScopeProperty.OverrideMetadata(typeof(CategoryList), new PropertyMetadata(true));
-        }
-
-        // <summary>
-        // Basic ctor
-        // </summary>
-        [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
-        public CategoryList() 
-        {
-
-            _stateContainer = new AggregateStateContainer(
-                new CategoryListStateContainer(this),
-                _categoryStates);
-
-            // Setup the shared width container
-            _sharedWidthContainer = new SharedPropertyValueColumnWidthContainer();
-            SharedPropertyValueColumnWidthContainer.SetOwningSharedPropertyValueColumnWidthContainer(this, _sharedWidthContainer);
-
-            // When someone new gets focus, we may need to mess around with selected property, so listen to the event
-            this.AddHandler(FocusManager.GotFocusEvent, new RoutedEventHandler(OnSomeoneGotFocus));
-
-            // When editing is done in the value editor, shift focus back to the selected property
-            this.CommandBindings.Add(new CommandBinding(PropertyValueEditorCommands.FinishEditing, OnFinishEditing));
-
-            // Need to call this method from a UI thread because some of Sparkle's value editors rely on it
-            UIThreadDispatcher.InitializeInstance();
-        }
-
-        // <summary>
-        // Event fired whenever a new CategoryContainer instance is generated
-        // </summary>
-        public event ContainerGeneratedHandler ContainerGenerated;
-
-        // AutomationPeer
-
-        public event PropertyChangedEventHandler PropertyChanged;
-
-        public int Count 
-        {
-            get {
-                return this.Items.Count;
-            }
-        }
-
-        // <summary>
-        // Gets or sets the filter string to apply to the shown properties.
-        // Setting this value will automatically apply the filter to the shown properties.
-        // </summary>
-        public string FilterString 
-        {
-            get {
-                return _filterString;
-            }
-            set {
-                if (string.IsNullOrEmpty(value))
-                {
-                    value = null;
-                }
-
-                if (_filterString != value) 
-                {
-                    _filterString = value;
-                    _currentFilter = new PropertyFilter(_filterString);
-                    RefreshFilter();
-                    this.OnPropertyChanged("FilterString");
-                }
-            }
-        }
-
-        // <summary>
-        // Command-wrapper for the ClearFilter method
-        // </summary>
-        public ICommand ClearFilterCommand 
-        {
-            get {
-                if (_clearFilterCommand == null) 
-                {
-                    _clearFilterCommand = new DelegateCommand(this.ClearFilter);
-                }
-                return _clearFilterCommand;
-            }
-        }
-
-        // <summary>
-        // Gets a value indicating whether there are any categories or properties that
-        // match the current filter string
-        // </summary>
-        public bool HasAnyFilterMatches 
-        {
-            get {
-                return _hasAnyFilterMatches;
-            }
-            private set {
-                if (_hasAnyFilterMatches != value) 
-                {
-                    _hasAnyFilterMatches = value;
-                    this.OnPropertyChanged("HasAnyFilterMatches");
-                }
-            }
-        }
-
-        // <summary>
-        // Gets the currently selected visual.
-        // </summary>
-        public FrameworkElement Selection 
-        {
-            get {
-                return _selection;
-            }
-        }
-
-        // <summary>
-        // Gets or sets the path to the currently selected item in the CategoryList.
-        // Only "sticky" selections will return a valid SelectionPath - otherwise
-        // null is returned.  Setting this property changes the selection if the specified path
-        // can be resolved to a FrameworkElement to select and sets the SelectionMode to
-        // Sticky.
-        // </summary>
-        public SelectionPath SelectionPath 
-        {
-            get {
-                if (_selection == null) 
-                {
-                    return null;
-                }
-                if (this.SelectionMode != PropertySelectionMode.Sticky) 
-                {
-                    return null;
-                }
-
-                ISelectionStop selectionStop = PropertySelection.GetSelectionStop(_selection);
-                if (selectionStop == null) 
-                {
-                    return null;
-                }
-
-                return selectionStop.Path;
-            }
-            set {
-                SetSelectionPath(value);
-            }
-        }
-
-        // <summary>
-        // Gets or sets the current SelectionMode
-        // </summary>
-        private PropertySelectionMode SelectionMode 
-        {
-            get { return _selectionMode; }
-            set { _selectionMode = value; }
-        }
-
-        public CategoryEntry this[int index] {
-            get {
-                return (CategoryEntry)this.Items[index];
-            }
-        }
-
-        protected override AutomationPeer OnCreateAutomationPeer() 
-        {
-            return new CategoryListAutomationPeer(this);
-        }
-
-
-        // Convenience Accessors
-
-        public void Insert(int index, CategoryEntry category) 
-        {
-            if (category == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("category");
-            }
-
-            this.Items.Insert(index, category);
-        }
-
-        public void InsertAlphabetically(CategoryEntry category) 
-        {
-
-            // POSSIBLE OPTIMIZATION: optimize using the fact that the list of categories in this
-            // collection is ordered.
-            int index = 0;
-            for (; index < this.Count; index++) 
-            {
-                if (string.Compare(category.CategoryName, this[index].CategoryName, StringComparison.CurrentCulture) < 0)
-                {
-                    break;
-                }
-            }
-
-            this.Insert(index, category);
-        }
-
-        public void RemoveAt(int index) 
-        {
-            this.Items.RemoveAt(index);
-        }
-
-
-        // Command Handlers
-
-        private void OnFinishEditing(object sender, ExecutedRoutedEventArgs e) 
-        {
-            // Re-focus the selected selection stop
-            this.SynchronizeSelectionFocus(StealFocusMode.Always);
-        }
-
-
-        // IStateContainer
-
-        public void RestoreState(object state) 
-        {
-            _stateContainer.RestoreState(state);
-        }
-
-        public object RetrieveState() 
-        {
-            return _stateContainer.RetrieveState();
-        }
-
-        // This override both gets rid of the inbetween ContentPresenter and
-        // it makes the CategoryContainer available as an instance in PrepareContainerForItemOverride()
-        protected override DependencyObject GetContainerForItemOverride() 
-        {
-            return new CiderCategoryContainer();
-        }
-
-        // Set the expansion state on the CategoryContainer based on an existing container
-        // or a cached value for the contained category
-        protected override void PrepareContainerForItemOverride(DependencyObject element, object item) 
-        {
-            CiderCategoryContainer container = element as CiderCategoryContainer;
-            CategoryEntry category = item as CategoryEntry;
-
-            if (container != null && category != null) 
-            {
-
-                // Ideally, we would want to initalize the expansion state here.  However,
-                // in collection editor, Blend messes around with the expansion state _after_
-                // the call to this method, which breaks our ability to remember which categories
-                // were open and which were closed.  So, we set the state here (because Blend's
-                // search logic relies on it to be set by this point) and _reset_ it in the Loaded
-                // event handler.
-
-                // Look into stored state
-                CategoryState state = _categoryStates.GetCategoryState(category.CategoryName);
-                container.Expanded = state.CategoryExpanded;
-                container.AdvancedSectionPinned = state.AdvancedSectionExpanded;
-
-                // Hook into other event handlers that we care about (including the Loaded event)
-                container.Loaded += new RoutedEventHandler(OnContainerLoaded);
-                container.Unloaded += new RoutedEventHandler(OnContainerUnloaded);
-
-                if (ContainerGenerated != null)
-                {
-                    ContainerGenerated(this, new ContainerGeneratedEventArgs(container));
-                }
-            }
-            else 
-            {
-                Debug.Fail("CategoryList should only be populated with CategoryEntries.");
-            }
-
-            base.PrepareContainerForItemOverride(element, item);
-        }
-
-        // Re-initialize the expansion state here and hook into the ExpandedChanged and
-        // AdvancedSectionPinnedChanged events, because by now Blend may have ----ed those
-        // two values up (see comment in PrepareContainerForItemOverride() )
-        private void OnContainerLoaded(object sender, RoutedEventArgs e) 
-        {
-            CiderCategoryContainer container = sender as CiderCategoryContainer;
-
-            if (container != null) 
-            {
-
-                CategoryEntry category = container.Category;
-                if (category != null) 
-                {
-                    // Look into stored state
-                    CategoryState state = _categoryStates.GetCategoryState(category.CategoryName);
-                    container.Expanded = state.CategoryExpanded;
-                    container.AdvancedSectionPinned = state.AdvancedSectionExpanded;
-
-                    // Hook into these events here, because Blend won't mess the state up at this point
-                    container.ExpandedChanged += new EventHandler(OnContainerExpandedChanged);
-                    container.AdvancedSectionPinnedChanged += new EventHandler(OnAdvancedSectionPinnedChanged);
-                }
-            }
-            else 
-            {
-                Debug.Fail("CategoryList expects the individual items to be CiderCategoryContainers");
-            }
-        }
-
-        private void OnContainerUnloaded(object sender, RoutedEventArgs e) 
-        {
-            CiderCategoryContainer container = sender as CiderCategoryContainer;
-            if (container != null) 
-            {
-                // Unhook from any events that we used to care about
-                container.ExpandedChanged -= new EventHandler(OnContainerExpandedChanged);
-                container.AdvancedSectionPinnedChanged -= new EventHandler(OnAdvancedSectionPinnedChanged);
-                container.Loaded -= new RoutedEventHandler(OnContainerLoaded);
-                container.Unloaded -= new RoutedEventHandler(OnContainerUnloaded);
-            }
-            else 
-            {
-                Debug.Fail("Couldn't clean up event binding and store container state.");
-            }
-        }
-
-        private void OnContainerExpandedChanged(object sender, EventArgs e) 
-        {
-            // If we are in "Filter-applied" mode, don't store the expansion state, since applying
-            // the filter automatically expands everything that matches that filter
-            if (_currentFilter != null && !_currentFilter.IsEmpty)
-            {
-                return;
-            }
-
-            CiderCategoryContainer container = sender as CiderCategoryContainer;
-            if (container != null) 
-            {
-                CategoryEntry category = container.Category;
-                if (category != null) 
-                {
-                    CategoryState state = _categoryStates.GetCategoryState(container.Category.CategoryName);
-                    state.CategoryExpanded = container.Expanded;
-                }
-            }
-        }
-
-        private void OnAdvancedSectionPinnedChanged(object sender, EventArgs e) 
-        {
-            // If we are in "Filter-applied" mode, don't store the expansion state, since applying
-            // the filter automatically expands everything that matches that filter
-            if (_currentFilter != null && !_currentFilter.IsEmpty)
-            {
-                return;
-            }
-
-            CiderCategoryContainer container = sender as CiderCategoryContainer;
-            if (container != null) 
-            {
-                CategoryEntry category = container.Category;
-                if (category != null) 
-                {
-                    CategoryState state = _categoryStates.GetCategoryState(container.Category.CategoryName);
-                    state.AdvancedSectionExpanded = container.AdvancedSectionPinned;
-                }
-            }
-        }
-
-        // Searching
-
-        // <summary>
-        // Applies the current filter to the existing list of categories and properties
-        // and updates the value of HasAnyFilterMatches.  This class does not update itself
-        // automatically when new CategoryEntries are added or removed, so call this method
-        // explicitly when things change.
-        // </summary>
-        public void RefreshFilter() 
-        {
-            bool? matchesFilter = null;
-
-            foreach (CategoryBase category in this.Items) 
-            {
-                matchesFilter = matchesFilter == null ? false : matchesFilter;
-                matchesFilter |= ApplyFilter(_currentFilter, category);
-            }
-
-            this.HasAnyFilterMatches = matchesFilter == null ? true : (bool)matchesFilter;
-        }
-
-        // <summary>
-        // Clears the current property filter, if any
-        // </summary>
-        public void ClearFilter() 
-        {
-            this.FilterString = null;
-        }
-
-        // Applies the specified filter to the specified category, returning a boolean indicating
-        // whether anything in that category matched the filter or not
-        private static bool ApplyFilter(PropertyFilter filter, CategoryBase category) 
-        {
-            category.ApplyFilter(filter);
-            return category.MatchesFilter || category.BasicPropertyMatchesFilter || category.AdvancedPropertyMatchesFilter;
-        }
-
-
-        // Property Selection
-
-        // <summary>
-        // Sets the SelectionMode back to default.  This is a common enough
-        // operation that it makes sense to abstract it to its own method.
-        // </summary>
-        private void ResetSelectionMode() 
-        {
-            SelectionMode = PropertySelectionMode.Default;
-        }
-
-        // <summary>
-        // Updates property selection to the specified SelectionPath (if any)
-        // or the specified default property.  Returns true if some property was selected,
-        // false otherwise (such as in the case when no properties are showing).
-        // </summary>
-        // <param name="stickyPath">SelectionPath to select.  Takes precedence over default property.</param>
-        // <param name="defaultPropertyName">Property to select when no SelectionPath is specified or
-        // if the path cannot be resolved.</param>
-        // <param name="fallbackPath">SelectionPath to use when all else fails.  May be null.</param>
-        // <returns>True if some property was selected, false otherwise (such as in the case
-        // when no properties are showing).</returns>
-        public bool UpdateSelectedProperty(
-            SelectionPath stickyPath,
-            string defaultPropertyName,
-            SelectionPath fallbackPath) 
-        {
-
-            // First, try selecting the given stickyPath, if any
-            //
-            if (stickyPath == null || !SetSelectionPath(stickyPath))
-            {
-                ResetSelectionMode();
-            }
-
-            bool propertySelected;
-
-            if (SelectionMode == PropertySelectionMode.Default) 
-            {
-
-                // Then, try finding and selecting the default property
-                //
-                propertySelected = defaultPropertyName == null ? false : SelectDefaultProperty(defaultPropertyName);
-                if (!propertySelected && fallbackPath != null) 
-                {
-
-                    // And if that fails, go to the specified fallback SelectionPath,
-                    // if any
-                    //
-                    propertySelected = SetSelectionPath(fallbackPath);
-                }
-
-                // Make sure that we are still in Default selection mode
-                // at this point
-                //
-                ResetSelectionMode();
-            }
-            else 
-            {
-                propertySelected = true;
-            }
-
-            return propertySelected;
-        }
-
-        private bool SetSelectionPath(SelectionPath path) 
-        {
-            // Dummy, this variable is only to satisfy SetSelectionPath(SelectionPath path, out bool pendingGeneration)
-            bool isPendingGenerationDummy;
-            return SetSelectionPath(path, out isPendingGenerationDummy);
-        }
-
-        // Attempts to resolve the specified path and set it as the current selection, returning
-        // true or false based on success.  If the path is found, selection is set to Sticky.
-        // If the UI is not ready, return false and pendingGeneration is true.
-        internal bool SetSelectionPath(SelectionPath path, out bool pendingGeneration)
-        {
-            DependencyObject newSelection = SelectionPathResolver.ResolveSelectionPath(this, path, out pendingGeneration);
-            if (newSelection != null)
-            {
-                SelectAndFocus(newSelection, StealFocusMode.OnlyIfCategoryListHasFocusWithin);
-                this.SelectionMode = PropertySelectionMode.Sticky;
-                return true;
-            }
-
-            return false;
-        }
-
-        // When the user clicks somewhere, we try to find the closest parent with IsSelectionStop DP set to true and
-        // select it.
-        //
-        protected override void OnPreviewMouseDown(MouseButtonEventArgs e) 
-        {
-            Select(e.OriginalSource as DependencyObject);
-            base.OnPreviewMouseDown(e);
-        }
-
-        // If we set Focus in OnMouseDown, it would be overwritten by the time the mouse went up.  So, we set the focus
-        // in OnMouseUp() to make sure it sticks
-        //
-        protected override void OnPreviewMouseUp(MouseButtonEventArgs e) 
-        {
-            base.OnPreviewMouseUp(e);
-            SynchronizeSelectionFocus(StealFocusMode.OnlyIfCurrentSelectionDoesNotHaveFocusWithin);
-        }
-
-        // When a UIElement gets focus, we try to find the parent PropertyContainer and make sure
-        // it's selected
-        //
-        private void OnSomeoneGotFocus(object source, RoutedEventArgs e) 
-        {
-            Select(e.OriginalSource as DependencyObject);
-        }
-
-        // We only synchronize the IsSelected object with keyboard focus when the CategoryList itself
-        // has focus.  If it doesn't we don't want to accidentally steal focus from somewhere else
-        // (say the design surface when the user is just tabbing through objects on it).  However, once
-        // the CategoryList itself gains focus, we do want to synchronize the IsSelected object with 
-        // keyboard focus so that Tabs and keyboard navigation works correctly.
-        //
-        protected override void OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs e) 
-        {
-
-            bool hasKeyboardFocus = (bool)e.NewValue;
-
-            if (hasKeyboardFocus) 
-            {
-                // We just gained keyboard focus.  Make sure we [....] up the current property selection
-                // with the keyboard focus, so that navigation works.
-                SynchronizeSelectionFocus(StealFocusMode.OnlyIfCurrentSelectionDoesNotHaveFocusWithin);
-            }
-
-            base.OnIsKeyboardFocusWithinChanged(e);
-        }
-
-        // Helper method that ensures that the element marked as IsSelected also has focus.
-        // If it cannot receive focus, we look for its closest visual child that can
-        //
-        private void SynchronizeSelectionFocus(StealFocusMode focusMode) 
-        {
-            // Is there something to select?
-            if (_selection == null)
-            {
-                return;
-            }
-
-            // Are we even allowed to mess around with focus or does someone else on the
-            // design surface have focus right now and we should just let them have it?
-            if (focusMode == StealFocusMode.OnlyIfCategoryListHasFocusWithin && !this.IsKeyboardFocusWithin)
-            {
-                return;
-            }
-
-            if (focusMode == StealFocusMode.OnlyIfCurrentSelectionDoesNotHaveFocusWithin && _selection.IsKeyboardFocusWithin)
-            {
-                return;
-            }
-
-            FrameworkElement focusableElement = VisualTreeUtils.FindFocusableElement<FrameworkElement>(_selection);
-
-            if (focusableElement != null) 
-            {
-                focusableElement.Focus();
-            }
-        }
-
-        // Attempt to select the right thing for the specified default property name:
-        //
-        //  * If there is a common DefaultProperty among selected objects AND there is a CategoryEditor consuming it,
-        //    select the CategoryEditor
-        //
-        //  * If there is a common DefaultProperty among selected objects AND there is NO CategoryEditor consuming it,
-        //    select the property itself
-        //
-        //  * If there is no common DefaultProperty, select the first common category
-        //
-        //  * Otherwise fail by returning false
-        //
-        private bool SelectDefaultProperty(string defaultPropertyName) 
-        {
-            return SelectDefaultPropertyHelper(defaultPropertyName, true);
-        }
-
-        private bool SelectDefaultPropertyHelper(string defaultPropertyName, bool firstTime) 
-        {
-            if (string.IsNullOrEmpty(defaultPropertyName))
-            {
-                return false;
-            }
-
-            ModelCategoryEntry defaultPropertyCategory;
-            PropertyEntry defaultProperty = FindPropertyEntry(defaultPropertyName, out defaultPropertyCategory);
-            CategoryEditor defaultCategoryEditor = FindCategoryEditor(defaultProperty, defaultPropertyCategory);
-            UIElement element = null;
-            bool elementPendingGeneration = false;
-
-            // Try to look up the correct UIElement to select
-            //
-            if (defaultCategoryEditor != null) 
-            {
-                element = FindCategoryEditorVisual(defaultCategoryEditor, defaultPropertyCategory, out elementPendingGeneration);
-            }
-            else if (defaultProperty != null) 
-            {
-                element = FindPropertyEntryVisual(defaultProperty, defaultPropertyCategory, out elementPendingGeneration);
-            }
-            else if (this.Count > 0) 
-            {
-                // Nothing found, so select the first selectable thing in the list
-                element = PropertySelection.FindNeighborSelectionStop<UIElement>(this, SearchDirection.Next);
-                elementPendingGeneration = false;
-            }
-
-            // If the UIElement was found, select it.  Otherwise, if it should exist but it wasn't generated yet,
-            // wait until it is and try again.
-            //
-            if (element != null) 
-            {
-
-                SelectAndFocus(element, StealFocusMode.OnlyIfCategoryListHasFocusWithin);
-
-                // Ensure that we are in Default SelectionMode because calling SelectAndFocus automatically switches us
-                // to Sticky mode
-                //
-                ResetSelectionMode();
-
-            }
-            else if (elementPendingGeneration && firstTime) 
-            {
-
-                // Set the firstTime flag to false, to prevent any infinite loops should things go wrong
-                this.Dispatcher.BeginInvoke(
-                    DispatcherPriority.Loaded,
-                    new SelectDefaultPropertyHelperDelegate(SelectDefaultPropertyHelper),
-                    defaultPropertyName,
-                    false);
-
-            }
-            else if (elementPendingGeneration && !firstTime) 
-            {
-                elementPendingGeneration = false;
-            }
-
-            return element != null || elementPendingGeneration;
-        }
-
-        // Find the closest IsSelectable parent, select it and set focus on it.
-        //
-        private void SelectAndFocus(DependencyObject element, StealFocusMode focusMode) 
-        {
-            Select(element);
-            SynchronizeSelectionFocus(focusMode);
-        }
-
-        // Find the closest IsSelectable parent and select it.  Don't mess with focus.
-        //
-        private void Select(DependencyObject visualSource) 
-        {
-            if (visualSource != null) 
-            {
-                FrameworkElement selection = PropertySelection.FindParentSelectionStop<FrameworkElement>(visualSource);
-
-                if (selection != _selection) 
-                {
-
-                    // Unselect anything that was selected previously
-                    if (_selection != null) 
-                    {
-                        PropertySelection.SetIsSelected(_selection, false);
-                    }
-
-                    _selection = selection;
-
-                    // Select whatever we need to select now
-                    if (_selection != null) 
-                    {
-                        PropertySelection.SetIsSelected(_selection, true);
-
-                        // Bring the full PropertyContainer into view, if one exists
-                        FrameworkElement focusableElement = VisualTreeUtils.FindFocusableElement<FrameworkElement>(_selection) ?? _selection;
-                        FrameworkElement parentPropertyContainer = VisualTreeUtils.FindVisualAncestor<PropertyContainer>(focusableElement);
-                        FrameworkElement bringIntoViewElement = parentPropertyContainer ?? focusableElement;
-
-                        bringIntoViewElement.BringIntoView();
-
-                        // As soon as the user manually selects a property, automatically switch to Sticky mode
-                        _selectionMode = PropertySelectionMode.Sticky;
-                    }
-                }
-            }
-        }
-
-
-        // Keyboard Navigation
-
-        protected override void OnKeyDown(KeyEventArgs e) 
-        {
-
-            // Intercept Up, Down, Left, Right key strokes and use them to navigate around the
-            // the control
-            //
-            if (e.Key == Key.Left || e.Key == Key.Right || e.Key == Key.Up || e.Key == Key.Down) 
-            {
-                if (_selection != null && !e.Handled) 
-                {
-                    if (object.Equals(
-                        Keyboard.FocusedElement,
-                        VisualTreeUtils.FindFocusableElement<FrameworkElement>(_selection))) 
-                    {
-
-                        ISelectionStop selectionStop = PropertySelection.GetSelectionStop(_selection);
-                        if (selectionStop != null) 
-                        {
-
-                            if (selectionStop.IsExpandable) 
-                            {
-                                if ((e.Key == Key.Right && !selectionStop.IsExpanded) ||
-                                    (e.Key == Key.Left && selectionStop.IsExpanded)) 
-                                {
-
-                                    selectionStop.IsExpanded = !selectionStop.IsExpanded;
-                                    e.Handled = true;
-                                }
-                            }
-
-                        }
-
-                        if (!e.Handled) 
-                        {
-
-                            SearchDirection direction = e.Key == Key.Up || e.Key == Key.Left ? SearchDirection.Previous : SearchDirection.Next;
-                            FrameworkElement nextStop = PropertySelection.FindNeighborSelectionStop<FrameworkElement>(_selection, direction);
-
-                            // If need to select something, select it
-                            if (nextStop != null) 
-                            {
-                                SelectAndFocus(nextStop, StealFocusMode.Always);
-                            }
-
-                            e.Handled = true;
-                        }
-                    }
-                }
-            }
-
-            base.OnKeyDown(e);
-        }
-
-        // SharedPropertyValueColumnWidth State Logic
-
-        protected override Size ArrangeOverride(Size arrangeBounds) 
-        {
-
-            // Set the content width, rather than the entire container width
-            object gridLength = this.FindResource("OpenCloseColumnGridLength");
-            if (gridLength != null && gridLength is GridLength)
-            {
-                _sharedWidthContainer.ContainerWidth = arrangeBounds.Width - ((GridLength)gridLength).Value;
-            }
-            else
-            {
-                _sharedWidthContainer.ContainerWidth = arrangeBounds.Width;
-            }
-
-            return base.ArrangeOverride(arrangeBounds);
-        }
-
-        // Visual Lookup Helpers
-
-        // <summary>
-        // Looks for and returns the PropertyContainer used to represent the specified PropertyEntry.  Returns
-        // null if not found.
-        // </summary>
-        // <param name="property">PropertyEntry to look up</param>
-        // <param name="parentCategory">Category to examine</param>
-        // <param name="pendingGeneration">Set to true if the specified property exists in a collapsed container
-        // (CategoryContainer or an advanced section).  If so, the section is expanded, but the visual does not
-        // exist yet and should be requested later.
-        // </param>
-        // <returns>PropertyContainer for the specified PropertyEntry if found, null otherwise</returns>
-        internal PropertyContainer FindPropertyEntryVisual(PropertyEntry property, CategoryEntry parentCategory, out bool pendingGeneration) 
-        {
-            pendingGeneration = false;
-
-            if (property == null || parentCategory == null)
-            {
-                return null;
-            }
-
-            if (property.MatchesFilter == false)
-            {
-                return null;
-            }
-
-            CiderCategoryContainer categoryContainer = this.ItemContainerGenerator.ContainerFromItem(parentCategory) as CiderCategoryContainer;
-            if (categoryContainer == null)
-            {
-                return null;
-            }
-
-            // Expand the parent category, if it isn't already
-            if (!categoryContainer.Expanded) 
-            {
-                categoryContainer.Expanded = true;
-                pendingGeneration = true;
-            }
-
-            // Expand the parent advanced section, if any and if it isn't already
-            if (property.IsAdvanced && !categoryContainer.AdvancedSectionPinned) 
-            {
-                categoryContainer.AdvancedSectionPinned = true;
-                pendingGeneration = true;
-            }
-
-            bool pendingGenerationTemp;
-            PropertyContainer propertyContainer = categoryContainer.ContainerFromProperty(property, out pendingGenerationTemp);
-            pendingGeneration |= pendingGenerationTemp;
-
-            if (propertyContainer != null)
-            {
-                pendingGeneration = false;
-            }
-
-            return propertyContainer;
-        }
-
-        // <summary>
-        // Looks for and returns CategoryContainer for the specified CategoryEntry.  Returns null if not
-        // found.
-        // </summary>
-        // <param name="category">CategoryEntry to look for.</param>
-        // <returns>Corresponding CategoryContainer if found, null otherwise.</returns>
-        internal CategoryContainer FindCategoryEntryVisual(CategoryEntry category) 
-        {
-            if (category == null)
-            {
-                return null;
-            }
-
-            CiderCategoryContainer categoryContainer = this.ItemContainerGenerator.ContainerFromItem(category) as CiderCategoryContainer;
-            return categoryContainer;
-        }
-
-        // <summary>
-        // Looks for and returns the UIElement used to represent the specified CategoryEditor. Returns
-        // null if not found.
-        // </summary>
-        // <param name="editor">CategoryEditor to look for.</param>
-        // <param name="category">Category to look in.</param>
-        // <param name="pendingGeneration">Set to true if the specified editor exists in a collapsed container
-        // (CategoryContainer or an advanced section).  If so, the section is expanded, but the visual does not
-        // exist yet and should be requested later.</param>
-        // <returns>UIElement for the specified CategoryEditor if found, null otherwise</returns>
-        internal UIElement FindCategoryEditorVisual(CategoryEditor editor, ModelCategoryEntry category, out bool pendingGeneration) 
-        {
-            pendingGeneration = false;
-
-            if (editor == null || category == null)
-            {
-                return null;
-            }
-
-            UIElement editorVisual = null;
-
-            CiderCategoryContainer categoryContainer = this.ItemContainerGenerator.ContainerFromItem(category) as CiderCategoryContainer;
-            if (categoryContainer == null)
-            {
-                return null;
-            }
-
-            // Expand the parent category, if it isn't already
-            if (!categoryContainer.Expanded) 
-            {
-                categoryContainer.Expanded = true;
-                pendingGeneration = true;
-            }
-
-            // Expand the parent advanced section, if any and if it isn't already
-            if (!categoryContainer.AdvancedSectionPinned && ExtensibilityAccessor.GetIsAdvanced(editor)) 
-            {
-                categoryContainer.AdvancedSectionPinned = true;
-                pendingGeneration = true;
-            }
-
-            bool pendingGenerationTemp;
-            editorVisual = categoryContainer.ContainerFromEditor(editor, out pendingGenerationTemp);
-            pendingGeneration |= pendingGenerationTemp;
-
-            if (editorVisual != null)
-            {
-                pendingGeneration = false;
-            }
-
-            return editorVisual;
-        }
-
-        // Logical Lookup Helpers
-
-        // <summary>
-        // Looks for a CategoryEntry contained in this list with the given name
-        // </summary>
-        // <param name="name">Name to look for</param>
-        // <returns>CategoryEntry with the specified name if found, null otherwise</returns>
-        internal CategoryEntry FindCategory(string name) 
-        {
-            if (name == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("name");
-            }
-
-            foreach (CategoryEntry category in this.Items) 
-            {
-                if (category.CategoryName.Equals(name))
-                {
-                    return category;
-                }
-            }
-
-            return null;
-        }
-
-        // <summary>
-        // Looks for the PropertyEntry and its parent CategoryEntry for the specified property
-        // </summary>
-        // <param name="propertyName">Property to look for</param>
-        // <param name="parentCategory">Parent CategoryEntry of the given property</param>
-        // <returns>Corresponding PropertyEntry if found, null otherwise.</returns>
-        internal PropertyEntry FindPropertyEntry(string propertyName, out ModelCategoryEntry parentCategory) 
-        {
-            parentCategory = null;
-            if (propertyName == null)
-            {
-                return null;
-            }
-
-            foreach (ModelCategoryEntry category in this.Items) 
-            {
-                PropertyEntry property = category[propertyName];
-                if (property != null) 
-                {
-                    parentCategory = category;
-                    return property;
-                }
-            }
-
-            return null;
-        }
-
-        // <summary>
-        // Looks for the CategoryEditor of the specified type and returns it if found.
-        // </summary>
-        // <param name="editorTypeName">Type name of the editor to look for.</param>
-        // <param name="category">CategoryEntry that the editor belongs to, if found.</param>
-        // <returns>CategoryEditor instance of the given type name if found, null otherwise.</returns>
-        internal CategoryEditor FindCategoryEditor(string editorTypeName, out ModelCategoryEntry category) 
-        {
-            category = null;
-            if (string.IsNullOrEmpty(editorTypeName) || this.Items == null)
-            {
-                return null;
-            }
-
-            foreach (ModelCategoryEntry currentCategory in this.Items) 
-            {
-                foreach (CategoryEditor editor in currentCategory.CategoryEditors) 
-                {
-                    if (string.Equals(editorTypeName, editor.GetType().Name)) 
-                    {
-                        category = currentCategory;
-                        return editor;
-                    }
-                }
-            }
-
-            return null;
-        }
-
-        // Find the first CategoryEditor that consumes the specified property in the specified category.
-        //
-        private static CategoryEditor FindCategoryEditor(PropertyEntry property, ModelCategoryEntry parentCategory) 
-        {
-            if (property == null || parentCategory == null)
-            {
-                return null;
-            }
-
-            foreach (CategoryEditor editor in parentCategory.CategoryEditors) 
-            {
-                if (editor.ConsumesProperty(property))
-                {
-                    return editor;
-                }
-            }
-
-            return null;
-        }
-
-
-        // IEnumerable<CategoryBase> Members
-
-        public IEnumerator<CategoryBase> GetEnumerator() 
-        {
-            foreach (CategoryBase categoryBase in this.Items)
-            {
-                yield return categoryBase;
-            }
-        }
-
-        // IEnumerable Members
-
-        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() 
-        {
-            return this.GetEnumerator();
-        }
-
-
-        // INotifyPropertyChanged Members
-
-        private void OnPropertyChanged(string propertyName) 
-        {
-            if (PropertyChanged != null)
-            {
-                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-            }
-        }
-
-        private delegate void MethodInvoker();
-
-        // Delegate for SelectDefaultPropertyHelper method so that we can invoke it on Render priority if the
-        // appropriate UIElements have not been generated yet
-        //
-        private delegate bool SelectDefaultPropertyHelperDelegate(string defaultPropertyName, bool firstTime);
-
-        // Enum that defines how and when we steal keyboard focus from the rest of the application
-        // when the property selection changes
-        //
-        private enum StealFocusMode 
-        {
-            Always,
-            OnlyIfCategoryListHasFocusWithin,
-            OnlyIfCurrentSelectionDoesNotHaveFocusWithin
-        }
-
-        // Manages state specific to this CategoryList instance
-        private class CategoryListStateContainer : IStateContainer 
-        {
-
-            private CategoryList _parent;
-            private IStateContainer _containers;
-
-            public CategoryListStateContainer(CategoryList parent) 
-            {
-                if (parent == null) 
-                {
-                    throw FxTrace.Exception.ArgumentNull("parent");
-                }
-                _parent = parent;
-            }
-
-            private IStateContainer Containers 
-            {
-                get {
-                    if (_containers == null)
-                    {
-                        _containers = new AggregateStateContainer(
-                            new FilterStringStateContainer(_parent),
-                            new PropertyValueWidthStateContainer(_parent));
-                    }
-
-                    return _containers;
-                }
-            }
-
-            public object RetrieveState() 
-            {
-                return Containers.RetrieveState();
-            }
-
-            public void RestoreState(object state) 
-            {
-                Containers.RestoreState(state);
-            }
-
-            // FilterStringStateContainer
-
-            // StateContainer responsible for the FilterString
-            //
-            private class FilterStringStateContainer : IStateContainer 
-            {
-                private CategoryList _parent;
-
-                public FilterStringStateContainer(CategoryList parent) 
-                {
-                    if (parent == null) 
-                    {
-                        throw FxTrace.Exception.ArgumentNull("parent");
-                    }
-                    _parent = parent;
-                }
-
-                public object RetrieveState() 
-                {
-                    return _parent.FilterString;
-                }
-
-                public void RestoreState(object state) 
-                {
-                    string filterString = state as string;
-                    if (!string.IsNullOrEmpty(filterString))
-                    {
-                        _parent.FilterString = filterString;
-                    }
-                }
-            }
-
-            // PropertyValueWidthStateContainer
-
-            // StateContainer responsible for the width of the property value column
-            //
-            private class PropertyValueWidthStateContainer : IStateContainer 
-            {
-                private CategoryList _parent;
-
-                public PropertyValueWidthStateContainer(CategoryList parent) 
-                {
-                    if (parent == null) 
-                    {
-                        throw FxTrace.Exception.ArgumentNull("parent");
-                    }
-                    _parent = parent;
-                }
-
-                public object RetrieveState() 
-                {
-                    return _parent._sharedWidthContainer.ValueColumnPercentage.ToString(CultureInfo.InvariantCulture);
-                }
-
-                public void RestoreState(object state) 
-                {
-                    string stateString = state as string;
-                    if (stateString == null)
-                    {
-                        return;
-                    }
-
-                    double percentage;
-                    if (!double.TryParse(stateString, NumberStyles.Float, CultureInfo.InvariantCulture, out percentage)) 
-                    {
-                        Debug.Fail("Invalid PI state: " + stateString);
-                        return;
-                    }
-
-                    if (percentage >= 0 && percentage <= 1) 
-                    {
-                        _parent._sharedWidthContainer.ValueColumnPercentage = percentage;
-                    }
-                    else 
-                    {
-                        Debug.Fail("Invalid percentage width stored in PI state: " + percentage.ToString(CultureInfo.InvariantCulture));
-                    }
-                }
-            }
-
-       }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/CategoryNameMap.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/CategoryNameMap.cs
deleted file mode 100644 (file)
index 94cfa80..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-    using System;
-    using System.Collections.Generic;
-
-    // <summary>
-    // Helper class that looks up (and keeps a map of) category names and their localized versions.
-    // </summary>
-    internal static class CategoryNameMap 
-    {
-
-        private static Dictionary<string, string> _cache = new Dictionary<string, string>();
-
-        // <summary>
-        // Gets the localized value of the specified category name.  If the input string
-        // is already localized, it won't be found in Cider's resources and, hence, it
-        // will be returned as is.
-        //
-        // Note that we pull category names from CategoryAttributes which already look up
-        // the localized version for common categories, such as "Misc", "Layout" and "Appearance",
-        // by default. This method just takes care of the few others that are WPF-specific and that
-        // we want to be localized as well.
-        // </summary>
-        // <param name="categoryName">Category name to look up</param>
-        // <returns>Translated version of the category name or the original name if not found.</returns>
-        public static string GetLocalizedCategoryName(string categoryName) 
-        {
-            if (categoryName == null)
-            {
-                return null;
-            }
-
-            string localizedCategoryName;
-            if (_cache.TryGetValue(categoryName, out localizedCategoryName))
-            {
-                return localizedCategoryName;
-            }
-
-            localizedCategoryName = GetLocalizedWPFCategoryName(categoryName) ?? categoryName;
-            _cache[categoryName] = localizedCategoryName;
-            return localizedCategoryName;
-        }
-
-        private static string GetLocalizedWPFCategoryName(string categoryName) 
-        {
-            return (string)System.Activities.Presentation.Internal.Properties.Resources.ResourceManager.GetString(string.Concat("PropertyCategory", categoryName.Replace(' ', '_')));
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/CiderCategoryContainer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/CiderCategoryContainer.cs
deleted file mode 100644 (file)
index 0152a22..0000000
+++ /dev/null
@@ -1,363 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Collections.Specialized;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Text;
-    using System.Windows;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Controls;
-
-    using System.Activities.Presentation.PropertyEditing;
-    using Blend = System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.Automation;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using System.Activities.Presentation.Internal.PropertyEditing.Selection;
-
-    // <summary>
-    // HACK: wrapper around Sparkle's CategoryContainer that doesn't come with
-    // any initial set of visuals, since we re-brand the control ourselves.
-    // Sparkle doesn't plan to change this code before they ship, so we need
-    // this work-around.
-    // </summary>
-    internal class CiderCategoryContainer : Blend.CategoryContainer 
-    {
-
-        private static readonly DependencyPropertyKey IsEmptyPropertyKey = DependencyProperty.RegisterReadOnly(
-            "IsEmpty",
-            typeof(bool),
-            typeof(CiderCategoryContainer),
-            new PropertyMetadata(true, null, new CoerceValueCallback(CiderCategoryContainer.CoerceIsEmpty)));
-
-        // <summary>
-        // IsEmpty property indicates whether this CategoryContainer contains any editors or unconsumed properties.
-        // If the value is true, UI for this container will hide itself
-        // </summary>
-        public static readonly DependencyProperty IsEmptyProperty = IsEmptyPropertyKey.DependencyProperty;
-
-        // <summary>
-        // Property indicating whether the header for the category should be rendered or not
-        // </summary>
-        public static DependencyProperty ShowCategoryHeaderProperty = DependencyProperty.Register(
-            "ShowCategoryHeader",
-            typeof(bool),
-            typeof(CiderCategoryContainer),
-            new PropertyMetadata(true));
-
-        // Exposed ItemsControls that know how to convert objects into their
-        // visual counterparts
-        private ItemsControl _basicCategoryEditorsContainer;
-        private ItemsControl _advancedCategoryEditorsContainer;
-        private ItemsControl _basicPropertyContainersContainer;
-        private ItemsControl _advancedPropertyContainersContainer;
-        private bool _UIHooksInitialized;
-
-        // Keyboard navigation helpers
-        private CategorySelectionStop _basicCategorySelectionStop;
-        private CategorySelectionStop _advancedCategorySelectionStop;
-
-        public CiderCategoryContainer()
-            :
-            base(false) 
-        {
-
-            // Note: this logic, along with the IsEmpty DP should be pushed into the base class
-            this.BasicCategoryEditors.CollectionChanged += new NotifyCollectionChangedEventHandler(OnContentChanged);
-            this.AdvancedCategoryEditors.CollectionChanged += new NotifyCollectionChangedEventHandler(OnContentChanged);
-            this.UnconsumedBasicProperties.CollectionChanged += new NotifyCollectionChangedEventHandler(OnContentChanged);
-            this.UnconsumedAdvancedProperties.CollectionChanged += new NotifyCollectionChangedEventHandler(OnContentChanged);
-        }
-
-        // IsEmpty ReadOnly DP
-
-        // Events that would have ideally been baked in the base class
-        public event EventHandler ExpandedChanged;
-        public event EventHandler AdvancedSectionPinnedChanged;
-
-        // <summary>
-        // Gets the value for IsEmpty DP
-        // </summary>
-        public bool IsEmpty 
-        {
-            get { return (bool)this.GetValue(IsEmptyProperty); }
-        }
-
-        // <summary>
-        // Gets or set the value of ShowCategoryHeaderProperty
-        // </summary>
-        public bool ShowCategoryHeader 
-        {
-            get { return (bool)this.GetValue(ShowCategoryHeaderProperty); }
-            set { this.SetValue(ShowCategoryHeaderProperty, value); }
-        }
-
-        // <summary>
-        // Wrapper around the ExpandedProperty that keyboard navigation understands.  Called from Xaml.
-        // </summary>
-        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        public ISelectionStop BasicCategorySelectionStop 
-        {
-            get {
-                if (_basicCategorySelectionStop == null)
-                {
-                    _basicCategorySelectionStop = new CategorySelectionStop(this, false);
-                }
-
-                return _basicCategorySelectionStop;
-            }
-        }
-
-        // <summary>
-        // Wrapper around the AdvancedSectionPinnedProperty that keyboard navigation understands
-        // </summary>
-        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        public ISelectionStop AdvancedCategorySelectionStop 
-        {
-            get {
-                if (_advancedCategorySelectionStop == null)
-                {
-                    _advancedCategorySelectionStop = new CategorySelectionStop(this, true);
-                }
-
-                return _advancedCategorySelectionStop;
-            }
-        }
-
-        private ItemsControl BasicCategoryEditorsContainer 
-        {
-            get {
-                //
-                // If called before the UI itself is rendered, this property
-                // will return null, which needs to be handled by the caller
-                //
-                EnsureUIHooksInitialized();
-                return _basicCategoryEditorsContainer;
-            }
-        }
-
-        private ItemsControl AdvancedCategoryEditorsContainer 
-        {
-            get {
-                //
-                // If called before the UI itself is rendered, this property
-                // will return null, which needs to be handled by the caller
-                //
-                EnsureUIHooksInitialized();
-                return _advancedCategoryEditorsContainer;
-            }
-        }
-
-        private ItemsControl BasicPropertyContainersContainer 
-        {
-            get {
-                //
-                // If called before the UI itself is rendered, this property
-                // will return null, which needs to be handled by the caller
-                //
-                EnsureUIHooksInitialized();
-                return _basicPropertyContainersContainer;
-            }
-        }
-
-        private ItemsControl AdvancedPropertyContainersContainer 
-        {
-            get {
-                //
-                // If called before the UI itself is rendered, this property
-                // will return null, which needs to be handled by the caller
-                //
-                EnsureUIHooksInitialized();
-                return _advancedPropertyContainersContainer;
-            }
-        }
-
-        private static object CoerceIsEmpty(DependencyObject obj, object value) 
-        {
-            CiderCategoryContainer theThis = obj as CiderCategoryContainer;
-
-            if (theThis == null)
-            {
-                return value;
-            }
-
-            return theThis.BasicCategoryEditors.Count == 0 &&
-                theThis.UnconsumedBasicProperties.Count == 0 &&
-                theThis.AdvancedCategoryEditors.Count == 0 &&
-                theThis.UnconsumedAdvancedProperties.Count == 0;
-        }
-
-        private void OnContentChanged(object sender, NotifyCollectionChangedEventArgs e) 
-        {
-            this.CoerceValue(IsEmptyProperty);
-        }
-
-        // ShowCategoryHeader DP
-
-        // In Cider and unlike in Blend, we expose all properties (browsable and non-browsable) through the
-        // property editing object model.  Hence, we need to make sure that the UI representing it (CategoryContainer)
-        // does the filtering instead.  This is by design and, for consistency, it should be pushed into Blend as well
-        protected override void AddProperty(PropertyEntry property, ObservableCollection<PropertyEntry> unconsumedProperties, ObservableCollection<PropertyEntry> referenceOrder, ObservableCollection<CategoryEditor> categoryEditors) 
-        {
-
-            // Is this property browsable?
-            ModelPropertyEntry modelPropertyEntry = property as ModelPropertyEntry;
-            if (modelPropertyEntry != null && !modelPropertyEntry.IsBrowsable)
-            {
-                return;
-            }
-
-            // Yes, so we can safely add it to the list
-            base.AddProperty(property, unconsumedProperties, referenceOrder, categoryEditors);
-        }
-
-        // <summary>
-        // Attempts to look up the corresponding PropertyContainer to the specified PropertyEntry
-        // </summary>
-        // <param name="property">Property to look up</param>
-        // <param name="pendingGeneration">Set to true if the specified property may have a container
-        // but the visual does not exist yet and should be requested later.</param>
-        // <returns>Corresponding PropertyContainer, if found, null otherwise</returns>
-        public PropertyContainer ContainerFromProperty(PropertyEntry property, out bool pendingGeneration) 
-        {
-            pendingGeneration = false;
-            if (property == null)
-            {
-                return null;
-            }
-
-            if (this.BasicPropertyContainersContainer != null) 
-            {
-                PropertyContainer propertyContainer = this.BasicPropertyContainersContainer.ItemContainerGenerator.ContainerFromItem(property) as PropertyContainer;
-                if (propertyContainer != null)
-                {
-                    return propertyContainer;
-                }
-            }
-
-            if (this.AdvancedPropertyContainersContainer != null) 
-            {
-                PropertyContainer propertyContainer = this.AdvancedPropertyContainersContainer.ItemContainerGenerator.ContainerFromItem(property) as PropertyContainer;
-                if (propertyContainer != null)
-                {
-                    return propertyContainer;
-                }
-            }
-
-            if (!_UIHooksInitialized)
-            {
-                pendingGeneration = true;
-            }
-
-            return null;
-        }
-
-        // <summary>
-        // Attempts to look up the corresponding UI representation of the specified CategoryEditor
-        // </summary>
-        // <param name="editor">Editor to look up</param>
-        // <param name="pendingGeneration">Set to true if the specified editor may have a container
-        // but the visual does not exist yet and should be requested later.</param>
-        // <returns>UI representation of the specified CategoryEditor, if found, null otherwise.</returns>
-        public UIElement ContainerFromEditor(CategoryEditor editor, out bool pendingGeneration) 
-        {
-            pendingGeneration = false;
-            if (editor == null)
-            {
-                return null;
-            }
-
-            if (this.BasicCategoryEditorsContainer != null) 
-            {
-                UIElement categoryEditor = this.BasicCategoryEditorsContainer.ItemContainerGenerator.ContainerFromItem(editor) as UIElement;
-                if (categoryEditor != null)
-                {
-                    return categoryEditor;
-                }
-            }
-
-            if (this.AdvancedCategoryEditorsContainer != null) 
-            {
-                UIElement categoryEditor = this.AdvancedCategoryEditorsContainer.ItemContainerGenerator.ContainerFromItem(editor) as UIElement;
-                if (categoryEditor != null)
-                {
-                    return categoryEditor;
-                }
-            }
-
-            if (!_UIHooksInitialized)
-            {
-                pendingGeneration = true;
-            }
-
-            return null;
-        }
-
-        protected override AutomationPeer OnCreateAutomationPeer() 
-        {
-            return CategoryContainerAutomationPeer.CreateStandAloneAutomationPeer(this);
-        }
-
-        // This method fires ExpandedChanged and AdvancedSectionPinnedChanged events.  Ideally we would include
-        // these events in Blend.CategoryContainer, but the assembly containing that class has already been locked
-        protected override void OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e) 
-        {
-            base.OnPropertyChanged(e);
-
-            if (e.Property == ExpandedProperty &&
-                ExpandedChanged != null) 
-            {
-                ExpandedChanged(this, EventArgs.Empty);
-            }
-
-            if (e.Property == AdvancedSectionPinnedProperty &&
-                AdvancedSectionPinnedChanged != null) 
-            {
-                AdvancedSectionPinnedChanged(this, EventArgs.Empty);
-            }
-        }
-
-        // Returns true if the hooks should have already been generated
-        // false otherwise.
-        //
-        private bool EnsureUIHooksInitialized() 
-        {
-            if (_UIHooksInitialized)
-            {
-                return true;
-            }
-
-            _basicCategoryEditorsContainer = VisualTreeUtils.GetNamedChild<ItemsControl>(this, "PART_BasicCategoryEditors");
-            _advancedCategoryEditorsContainer = VisualTreeUtils.GetNamedChild<ItemsControl>(this, "PART_AdvancedCategoryEditors");
-            _basicPropertyContainersContainer = VisualTreeUtils.GetNamedChild<ItemsControl>(this, "PART_BasicPropertyList");
-            _advancedPropertyContainersContainer = VisualTreeUtils.GetNamedChild<ItemsControl>(this, "PART_AdvancedPropertyList");
-
-            if (_basicCategoryEditorsContainer == null &&
-                _advancedCategoryEditorsContainer == null &&
-                _basicPropertyContainersContainer == null &&
-                _advancedPropertyContainersContainer == null) 
-            {
-
-                return false;
-            }
-
-            if (_basicCategoryEditorsContainer == null ||
-                _advancedCategoryEditorsContainer == null ||
-                _basicPropertyContainersContainer == null ||
-                _advancedPropertyContainersContainer == null) 
-            {
-
-                Debug.Fail("UI for CategoryContainer changed.  Need to update CiderCategoryContainer logic.");
-            }
-
-            _UIHooksInitialized = true;
-            return true;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/CiderCategoryLayoutContainer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/CiderCategoryLayoutContainer.cs
deleted file mode 100644 (file)
index 35fbce9..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Windows;
-    using Blend = System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector;
-    using System.Activities.Presentation.Internal.PropertyEditing.Selection;
-
-    // <summary>
-    // Container for CategoryEditors - fancy wrapper for ItemsControl that eliminates the need
-    // for extra bindings.
-    //
-    // This class is referenced from XAML
-    // </summary>
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal class CiderCategoryLayoutContainer : Blend.CategoryLayoutContainer 
-    {
-
-        protected override void PrepareContainerForItemOverride(DependencyObject element, object item) 
-        {
-            base.PrepareContainerForItemOverride(element, item);
-
-            if (item != null) 
-            {
-                string editorTypeName = item.GetType().Name;
-
-                // Make each CategoryEditor its own selection stop
-                PropertySelection.SetSelectionStop(element, new CategoryEditorSelectionStop(editorTypeName));
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/CiderStandardCategoryLayout.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/CiderStandardCategoryLayout.cs
deleted file mode 100644 (file)
index 6621bcc..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows;
-
-    using System.Activities.Presentation.PropertyEditing;
-
-    using Blend = System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector;
-    using System.Activities.Presentation.Internal.PropertyEditing.Selection;
-    using System.Activities.Presentation.Internal.PropertyEditing.State;
-
-    // <summary>
-    // Container for PropertyContainers - fancy wrapper for ItemsControl that eliminates the need
-    // for intermediate ContentControls.
-    //
-    // This class is referenced from XAML
-    // </summary>
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal class CiderStandardCategoryLayout : Blend.StandardCategoryLayout 
-    {
-
-        protected override void PrepareContainerForItemOverride(DependencyObject element, object item) 
-        {
-            base.PrepareContainerForItemOverride(element, item);
-
-            if (element != null) 
-            {
-                PropertyEntry property = ((PropertyContainer)element).PropertyEntry;
-
-                if (property != null) 
-                {
-                    // Make each PropertyContainer its own selection stop
-                    PropertySelection.SetSelectionStop(element, new PropertySelectionStop(property));
-                }
-
-                PropertyContainer container = element as PropertyContainer;
-                if (container != null)
-                {
-                    container.Loaded += new RoutedEventHandler(OnPropertyContainerLoaded);
-                }
-            }
-        }
-
-        private void OnPropertyContainerLoaded(object sender, RoutedEventArgs e) 
-        {
-            PropertyContainer container = sender as PropertyContainer;
-            if (container != null) 
-            {
-
-                // When each PropertyContainer gets loaded, restore its ActiveEditMode
-                // based on stored state
-                //
-                container.ActiveEditMode = PropertyActiveEditModeStateContainer.Instance.GetActiveEditMode(container.PropertyEntry);
-
-                // HACK: Here, we would want to hook into the ActiveEditModeChanged
-                // event to store (and restore) the correct expaded state to each
-                // value editor across domain reloads.  However, we already shipped
-                // System.Activities.Presentation.dll which contains the PropertyContainer
-                // class and it's dangerous to add new events to this assembly at this
-                // point.  Once we refactor MWD, we need to add this new event and
-                // simplify this code.  In the meanwhile, we can cheat and accomplish
-                // the same effect by listening to SizeChanged event, which _will_
-                // change when the expanded value editor is pinned down.  It will also
-                // change at other times (user-triggered resize events, etc.), but
-                // it shouldn't cause any noticeable perf degradation.
-                //
-                container.SizeChanged += new SizeChangedEventHandler(OnPropertyContainerSizeChanged);
-                container.Unloaded += new RoutedEventHandler(OnPropertyContainerUnloaded);
-            }
-        }
-
-        // When the size of each PropertyContainer changes, assume that ActiveEditMode
-        // may have been changed and record its current state
-        //
-        private void OnPropertyContainerSizeChanged(object sender, SizeChangedEventArgs e) 
-        {
-            PropertyContainer container = sender as PropertyContainer;
-            if (container != null && container.IsLoaded)
-            {
-                PropertyActiveEditModeStateContainer.Instance.StoreActiveEditMode(container.PropertyEntry, container.ActiveEditMode);
-            }
-        }
-
-        // When each PropertyContainer gets unloaded, stop listening to all events so
-        // that it can be garbage collected
-        //
-        private void OnPropertyContainerUnloaded(object sender, RoutedEventArgs e) 
-        {
-            PropertyContainer container = sender as PropertyContainer;
-
-            if (container != null) 
-            {
-                container.SizeChanged -= new SizeChangedEventHandler(OnPropertyContainerSizeChanged);
-                container.Loaded -= new RoutedEventHandler(OnPropertyContainerLoaded);
-                container.Unloaded -= new RoutedEventHandler(OnPropertyContainerUnloaded);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/ContainerGeneratedEventArgs.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/ContainerGeneratedEventArgs.cs
deleted file mode 100644 (file)
index 2b7efa0..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-    using System;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // EventArgs we use to fire CategoryList.ContainerGenerated event
-    // </summary>
-    internal class ContainerGeneratedEventArgs : EventArgs 
-    {
-
-        private CiderCategoryContainer _container;
-
-        public ContainerGeneratedEventArgs(CiderCategoryContainer container) 
-        {
-            if (container == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("container");
-            }
-            _container = container;
-        }
-
-        public CiderCategoryContainer Container 
-        {
-            get {
-                return _container;
-            }
-        }
-    }
-
-    // <summary>
-    // Used in conjunction with ContainerGeneratedEventArgs
-    // </summary>
-    // <param name="sender"></param>
-    // <param name="e"></param>
-    internal delegate void ContainerGeneratedHandler(object sender, ContainerGeneratedEventArgs e);
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/EditModeSwitchButtonKeyboardFix.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/EditModeSwitchButtonKeyboardFix.cs
deleted file mode 100644 (file)
index c77f41f..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-    using System;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Windows;
-    using System.Windows.Input;
-    using System.Windows.Threading;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Runtime;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // This is a fix for a bug in EditModeSwitchButton which lives in System.Activities.Presentation and
-    // which has already been locked as an assembly.  EditModeSwitchButton only responds to MouseDown
-    // events to make sure that the opening of the popup extended editor works correctly.  However,
-    // that means that it will never respond to keyboard or automation events.  To fix it, this class
-    // offers up an attached DP that, when used, hooks into events offered by EditModeSwitchButton
-    // to correct this issue and still have the button do the right thing even if mouse is not involved
-    // in invoking the button.
-    //
-    // This class is associated with every instance of EditModeSwitchButton using a setter in the
-    // EditModeSwitchButton style:
-    //
-    //   &lt;Style TargetType="{x:Type PropertyEditing:EditModeSwitchButton}" BasedOn="{StaticResource {x:Type Button}}"&gt;
-    //     ...
-    //     &lt;Setter Property="Internal:EditModeSwitchButtonKeyboardFix.ApplyFix" Value="True" /&gt;
-    // </summary>
-
-    class EditModeSwitchButtonKeyboardFix 
-    {
-
-        // <summary>
-        // Property used to correct a problem with EditModeSwitchButton.  This property should only be
-        // applied to EditModeSwitchButton class instances.
-        // </summary>
-        public static readonly DependencyProperty ApplyFixProperty = DependencyProperty.RegisterAttached(
-            "ApplyFix",
-            typeof(bool),
-            typeof(EditModeSwitchButtonKeyboardFix),
-            new PropertyMetadata(false, new PropertyChangedCallback(OnApplyFixPropertyChanged)));
-
-        private bool _clickInitiatedByMouse;
-
-        private EditModeSwitchButtonKeyboardFix(EditModeSwitchButton button) 
-        {
-            button.Click += new RoutedEventHandler(OnEditModeSwitchButtonClick);
-            button.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(OnEditModeSwitchButtonPreviewMouseLeftButtonUp);
-        }
-
-        // <summary>
-        // Gets the value of ApplyFix property from the specified DependencyObject.
-        // </summary>
-        // <param name="obj"></param>
-        // <returns></returns>
-        public static bool GetApplyFix(DependencyObject obj) 
-        {
-            if (obj == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("obj");
-            }
-
-            return (bool)obj.GetValue(ApplyFixProperty);
-        }
-
-        // <summary>
-        // Sets the value of ApplyFix property onto the specified DependencyObject.  Only
-        // instances of EditModeSwitchButton classes should be used as the targets of this property.
-        // </summary>
-        // <param name="obj"></param>
-        // <param name="value"></param>
-        public static void SetApplyFix(DependencyObject obj, bool value) 
-        {
-            if (obj == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("obj");
-            }
-
-            obj.SetValue(ApplyFixProperty, value);
-        }
-
-        [SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults")]
-        private static void OnApplyFixPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) 
-        {
-            EditModeSwitchButton button = obj as EditModeSwitchButton;
-            if (button == null) 
-            {
-                Debug.Fail("EditModeSwitchButtonKeyboardFix.ApplyFix fix can only be applied to EditModeSwitchButton instances.");
-                return;
-            }
-            if (object.Equals(e.NewValue, true)) 
-            {
-                // Instantiating this class will make itself hook into EditModeSwitchButton's events,
-                // hence not be chewed up by garbage collector
-                new EditModeSwitchButtonKeyboardFix(button);
-            }
-        }
-
-        private void OnEditModeSwitchButtonPreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) 
-        {
-            _clickInitiatedByMouse = true;
-
-            ((DispatcherObject)sender).Dispatcher.BeginInvoke(DispatcherPriority.Input, new MethodInvoker(delegate() 
-            {
-                _clickInitiatedByMouse = false;
-            }));
-        }
-
-        private void OnEditModeSwitchButtonClick(object sender, RoutedEventArgs e) 
-        {
-            if (_clickInitiatedByMouse)
-            {
-                return;
-            }
-
-            EditModeSwitchButton button = e.OriginalSource as EditModeSwitchButton;
-            Fx.Assert(button != null, "Expected to see the EditModeSwitchButton at this point.");
-            if (button == null)
-            {
-                return;
-            }
-
-            // At this point the click was initiated using the Invoke AutomationPeer pattern or
-            // by using the keyboard.  So, make sure that the EditModeSwitchButton.OnMouseDown
-            // button still executes.
-            // Invoke the appropriate command
-            switch (button.TargetEditMode) 
-            {
-                case PropertyContainerEditMode.Inline:
-                    PropertyValueEditorCommands.ShowInlineEditor.Execute(null, button);
-                    break;
-                case PropertyContainerEditMode.ExtendedPopup:
-                    PropertyValueEditorCommands.ShowExtendedPopupEditor.Execute(null, button);
-                    break;
-                case PropertyContainerEditMode.ExtendedPinned:
-                    PropertyValueEditorCommands.ShowExtendedPinnedEditor.Execute(null, button);
-                    break;
-                case PropertyContainerEditMode.Dialog:
-                    PropertyValueEditorCommands.ShowDialogEditor.Execute(null, button);
-                    break;
-                default:
-                    Debug.Fail(string.Format(
-                        CultureInfo.CurrentCulture,
-                        "EditModeSwitchButtonKeyboardFix does not yet support PropertyContainerEditMode '{0}'.",
-                        button.TargetEditMode.ToString()));
-                    break;
-            }
-        }
-        private delegate void MethodInvoker();
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/BoolViewEditor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/BoolViewEditor.cs
deleted file mode 100644 (file)
index ee406e0..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Editors 
-{
-    using System.Windows;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation.Internal.PropertyEditing.Resources;
-
-    // <summary>
-    // Simple PropertyValueEditor that uses the BoolViewTemplate (see StylesCore.Editors.xaml)
-    // </summary>
-    internal class BoolViewEditor : PropertyValueEditor 
-    {
-        public BoolViewEditor()
-            :
-            base(PropertyInspectorResources.GetResources()["BoolViewTemplate"] as DataTemplate) { }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/EditorUtilities.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/EditorUtilities.cs
deleted file mode 100644 (file)
index a9e9e78..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Editors 
-{
-    using System;
-    using System.Collections;
-    using System.Globalization;
-    using System.Reflection;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector;
-
-    // <summary>
-    // Collection of utilities used by the various value editors
-    // </summary>
-    internal static class EditorUtilities 
-    {
-
-        // Key = Type, Value = bool
-        private static Hashtable _cachedLookups = new Hashtable();
-
-        // <summary>
-        // Checks to see whether the specified Type is concrete and has a default constructor.
-        // That information if both returned and cached for future reference.
-        //
-        // NOTE: This method does not handle structs correctly because it will return FALSE
-        // for struct types, which is incorrect.  However, this bug has its counter-part in
-        // System.Activities.Presentation.dll where the default NewItemFactory only instantiates
-        // non-struct classes.  Both of these need to be fixed at the same time because
-        // they are used in conjunction.  However, MWD is currently locked.
-        //
-        // </summary>
-        // <param name="type">Type to verify</param>
-        // <returns>True if the specified type is concrete and has a default constructor,
-        // false otherwise.</returns>
-        public static bool IsConcreteWithDefaultCtor(Type type) 
-        {
-
-            object returnValue = _cachedLookups[type];
-            if (returnValue == null) 
-            {
-                if (type == null || type.IsAbstract) 
-                {
-                    returnValue = false;
-                }
-                else 
-                {
-                    ConstructorInfo defaultCtor = type.GetConstructor(Type.EmptyTypes);
-                    returnValue = (defaultCtor != null && defaultCtor.IsPublic);
-                }
-
-                _cachedLookups[type] = returnValue;
-            }
-
-            return (bool)returnValue;
-        }
-
-        // <summary>
-        // Substitutes user-friendly display names for values of properties
-        // </summary>
-        // <param name="item">Item to attempt to identify</param>
-        // <returns>String value for the item (guaranteed to be non-null)</returns>
-        public static string GetDisplayName(object item) 
-        {
-            if (item == null)
-            {
-                return string.Empty;
-            }
-
-            // Display a user-friendly string for PropertyValues
-            PropertyValue propertyValue = item as PropertyValue;
-            if (propertyValue != null)
-            {
-                return PropertyValueToDisplayNameConverter.Instance.Convert(
-                    propertyValue, typeof(string), null, CultureInfo.CurrentCulture).ToString();
-            }
-
-            // Display a user-friendly string for NewItemFactoryTypeModels
-            NewItemFactoryTypeModel model = item as NewItemFactoryTypeModel;
-            if (model != null)
-            {
-                return NewItemFactoryTypeModelToDisplayNameConverter.Instance.Convert(
-                    model, typeof(string), null, CultureInfo.CurrentCulture).ToString();
-            }
-
-            // Otherwise, resort to ToString() implementation
-            return item.ToString();
-        }
-
-        // <summary>
-        // Tests whether a type t is a nullable enum type
-        // </summary>
-        // <param name="t">The type object to be tested</param>
-        // <returns>A bool indicating the test result</returns>
-        public static bool IsNullableEnumType(Type t)
-        {
-            if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>))
-            {
-                Type[] genericArgs = t.GetGenericArguments();
-                if (genericArgs != null && genericArgs.Length == 1)
-                {
-                    return genericArgs[0].IsEnum;
-                }
-            }
-
-            return false;
-        }
-
-        public const string NullString = "(null)";
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/FlagEditor.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/FlagEditor.xaml.cs
deleted file mode 100644 (file)
index 1b1fa52..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Internal.PropertyEditing.Editors
-{
-    using System.Windows.Controls;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Windows.Input;
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.ValueEditors;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Windows.Media;
-    using System.Windows.Threading;
-
-    partial class FlagEditor : ComboBox
-    {
-        bool isCommitting = false;
-
-        public static readonly DependencyProperty FlagTypeProperty =
-            DependencyProperty.Register("FlagType", typeof(Type), typeof(FlagEditor), new PropertyMetadata(null));
-
-        public Type FlagType
-        {
-            get { return (Type)GetValue(FlagTypeProperty); }
-            set { SetValue(FlagTypeProperty, value); }
-        }
-
-        public FlagEditor()
-        {
-            InitializeComponent();
-        }
-
-        void Cancel()
-        {
-            BindingExpression binding = this.GetBindingExpression(ComboBox.TextProperty);
-            binding.UpdateTarget();
-        }
-
-        void Commit()
-        {
-            // In case of error, the popup can make the control lose focus; we don't want to commit twice.
-            if (!this.isCommitting)
-            {
-                BindingExpression binding = this.GetBindingExpression(ComboBox.TextProperty);
-                if (binding != null)
-                {
-                    this.isCommitting = true;
-                    try
-                    {
-                        binding.UpdateSource();
-                    }
-                    catch (ArgumentException exception)
-                    {
-                        ErrorReporting.ShowErrorMessage(exception.Message);
-                        binding.UpdateTarget();
-                    }
-                    this.isCommitting = false;
-                }
-            }
-        }
-
-        void Finish()
-        {
-            ValueEditorUtils.ExecuteCommand(PropertyValueEditorCommands.FinishEditing, this, null);
-        }
-
-        protected override void OnPreviewKeyDown(KeyEventArgs e)
-        {
-            if (e.Key == Key.Down)
-            {
-                this.IsDropDownOpen = true;
-                e.Handled = true;
-            }
-            if (e.Key == Key.Enter || e.Key == Key.Return)
-            {
-                if (this.IsDropDownOpen)
-                {
-                    this.IsDropDownOpen = false;
-                }
-                this.Commit();
-                if ((e.KeyboardDevice.Modifiers & ModifierKeys.Shift) == 0)
-                {
-                    this.Finish();
-                }
-                //Handle this event so that the combo box item is not applied to the text box on "Enter".
-                e.Handled = true;
-            }
-            else if (e.Key == Key.Escape)
-            {
-                this.Cancel();
-            }
-            base.OnPreviewKeyDown(e);
-        }
-
-        protected override void OnDropDownOpened(EventArgs e)
-        {
-            base.OnDropDownOpened(e);
-            this.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, (Action)(() =>
-            {
-                // The item should contains the panel we placed in the combobox,
-                // and we should always have one and only one item.
-                ComboBoxItem comboBoxItem = 
-                    this.ItemContainerGenerator.ContainerFromIndex(0) as ComboBoxItem;
-                if (comboBoxItem != null && VisualTreeHelper.GetChildrenCount(comboBoxItem) > 0)
-                {
-                    comboBoxItem.Focusable = false;
-                    StackPanel panel = VisualTreeHelper.GetChild(comboBoxItem, 0) as StackPanel;
-                    if (panel != null && VisualTreeHelper.GetChildrenCount(panel) > 0)
-                    {
-                        // focus on the first UIElement on the panel.
-                        UIElement item = VisualTreeHelper.GetChild(panel, 0) as UIElement;
-                        if (item != null)
-                        {
-                            item.Focus();
-                        }
-                    }
-                }
-
-            }));
-        }
-
-        protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e)
-        {
-            if (!this.IsKeyboardFocusWithin)
-            {
-                this.Commit();
-            }
-            base.OnLostKeyboardFocus(e);
-        }
-
-        protected override void OnDropDownClosed(EventArgs e)
-        {
-            this.Commit();
-            base.OnDropDownClosed(e);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/FlagPanel.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/FlagPanel.cs
deleted file mode 100644 (file)
index 783742c..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Internal.PropertyEditing.Editors
-{
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Globalization;
-    using System.Windows;
-    using System.Windows.Automation;
-    using System.Runtime;
-    sealed class FlagPanel : StackPanel
-    {
-        public static readonly DependencyProperty FlagStringProperty =
-            DependencyProperty.Register("FlagString", typeof(string), typeof(FlagPanel), new PropertyMetadata(string.Empty));
-
-        public static readonly DependencyProperty FlagTypeProperty = DependencyProperty.Register(
-            "FlagType",
-            typeof(Type),
-            typeof(FlagPanel),
-            new PropertyMetadata(null, new PropertyChangedCallback(OnFlagTypeChanged)));       
-
-        public Type FlagType
-        {
-            get { return (Type)GetValue(FlagTypeProperty); }
-            set { SetValue(FlagTypeProperty, value); }
-        }
-
-        public string FlagString
-        {
-            get { return (string)GetValue(FlagStringProperty); }
-            set { SetValue(FlagStringProperty, value); }
-        }
-
-        static void OnFlagTypeChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
-        {
-            Type flagType = args.NewValue as Type;
-            Fx.Assert(flagType == null || flagType.IsEnum, "FlagType should be null or enum");
-            Fx.Assert(flagType == null || Attribute.IsDefined(flagType, typeof(FlagsAttribute)), "FlagType should be null or have flags attribute");
-
-            if (flagType == null)
-            {
-                return;
-            }
-
-            int index = 0;
-            FlagPanel panel = sender as FlagPanel;
-            string[] flagNames = flagType.GetEnumNames();
-            string zeroValueString = Enum.ToObject(flagType, 0).ToString();
-            foreach (string flagName in flagNames)
-            {
-                if (zeroValueString.Equals("0") || !flagName.Equals(zeroValueString))
-                {
-                    CheckBox checkBox = new CheckBox();
-                    panel.Children.Add(checkBox);
-                    checkBox.Content = flagName;
-                    checkBox.DataContext = panel;
-                    checkBox.SetValue(AutomationProperties.AutomationIdProperty, flagName);
-                    Binding binding = new Binding("FlagString");
-                    binding.Mode = BindingMode.TwoWay;
-                    binding.Converter = new CheckBoxStringConverter(index);
-                    binding.ConverterParameter = panel;
-                    checkBox.SetBinding(CheckBox.IsCheckedProperty, binding);
-                    index++;
-                }
-            }
-        }
-
-        sealed class CheckBoxStringConverter : IValueConverter
-        {
-            int index;
-
-            public CheckBoxStringConverter(int index)
-            {
-                this.index = index;
-            }
-
-            public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-            {
-                string str = (value as string).ToUpperInvariant();
-                FlagPanel panel = parameter as FlagPanel;
-                if (str.Contains((panel.Children[this.index] as CheckBox).Content.ToString().ToUpperInvariant()))
-                {
-                    return true;
-                }
-                else
-                {
-                    return false;
-                }
-            }
-
-            public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-            {
-                FlagPanel panel = parameter as FlagPanel;
-                string str = string.Empty;
-                for (int i = 0; i < panel.Children.Count; i++)
-                {
-                    if ((i != this.index && ((bool)(panel.Children[i] as CheckBox).IsChecked)) ||
-                        (i == this.index && (bool)value))
-                    {
-                        if (!string.IsNullOrEmpty(str))
-                        {
-                            str += ", ";
-                        }
-                        str += (panel.Children[i] as CheckBox).Content.ToString();
-                    }
-                }
-                if (string.IsNullOrEmpty(str))
-                {                    
-                    Type flagType = panel.FlagType;
-                    Fx.Assert(flagType != null && flagType.IsEnum, "FlagType should be enum");
-                    Fx.Assert(Attribute.IsDefined(flagType, typeof(FlagsAttribute)), "FlagType should have flags attribute");
-
-                    return Enum.ToObject(flagType, 0).ToString();                    
-                }
-                return str;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/FlagStringConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/FlagStringConverter.cs
deleted file mode 100644 (file)
index 87bffe9..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Internal.PropertyEditing.Editors
-{
-    using System.Windows.Data;
-    using System.Globalization;
-    using System.Collections.Generic;
-    using System.Runtime;
-    using System.Collections;
-    sealed class FlagStringConverter : IValueConverter
-    {
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            if (value != null)
-            {
-                return value.ToString();
-            }
-            else
-            {
-                return string.Empty;
-            }
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            Type flagType = parameter as Type;
-            Fx.Assert(flagType != null && flagType.IsEnum, "TargetType should be enum");
-            Fx.Assert(Attribute.IsDefined(flagType, typeof(FlagsAttribute)), "FlagType should have flags attribute");
-
-            if (value == null)
-            {
-                return Enum.ToObject(flagType, 0);
-            }
-
-            string str = (value as string).ToUpperInvariant();
-            str = str.Trim();
-            if (str.Equals(string.Empty) || str.Equals("0"))
-            {
-                return Enum.ToObject(flagType, 0);
-            }
-
-            Dictionary<string, object> flagDictionary = GenerateFlagDictionary(flagType);
-            int flagsIntValue = 0;
-            string[] names = str.Split(',');
-            foreach (string name in names)
-            {
-                string flagName = name.Trim();
-                if (flagDictionary.ContainsKey(flagName))
-                {
-                    flagsIntValue |= (int)flagDictionary[flagName];
-                    flagDictionary.Remove(flagName);
-                }                
-                else
-                {
-                    throw FxTrace.Exception.AsError(new ArgumentException(string.Format(CultureInfo.CurrentUICulture, SR.InvalidFlagName, value, flagType.Name)));
-                }
-            }
-            return Enum.ToObject(flagType, flagsIntValue);
-        }
-
-        static Dictionary<string, object> GenerateFlagDictionary(Type flagType)
-        {
-            Dictionary<string, object> flagDictionary = new Dictionary<string, object>();
-            string[] flagNames = flagType.GetEnumNames();
-            Array flagValues = flagType.GetEnumValues();
-            for (int i = 0; i < flagNames.Length; i++)
-            {
-                flagDictionary.Add(flagNames[i].ToUpperInvariant(), flagValues.GetValue(i));
-            }
-            return flagDictionary;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/ImageSourceToImageConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/ImageSourceToImageConverter.cs
deleted file mode 100644 (file)
index 3532726..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Editors 
-{
-    using System;
-    using System.Globalization;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Windows.Media;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // Converter that takes an object and either returns it
-    // or wraps it in an Image control if the object is of type ImageSource.
-    // This class gets instantiated from XAML.
-    // </summary>
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal class ImageSourceToImageConverter : IValueConverter 
-    {
-        // IValueConverter Members
-
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 
-        {
-
-            ImageSource imageSource = value as ImageSource;
-
-            if (imageSource == null)
-            {
-                return value;
-            }
-
-            Image image = new Image();
-            image.Source = imageSource;
-            return image;
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 
-        {
-            throw FxTrace.Exception.AsError(new InvalidOperationException());
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/NewItemFactoryTypeModelToDisplayNameConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/NewItemFactoryTypeModelToDisplayNameConverter.cs
deleted file mode 100644 (file)
index b2264b5..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Editors 
-{
-    using System;
-    using System.Windows.Data;
-    using System.Globalization;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // Converts an instance of NewItemFactoryTypeModel to its appropriate display name.
-    // One way binding to NewItemFactoryTypeModel's DisplayName property also works, but
-    // for the sake of having a single place that converts NewItemFactoryTypeModel to
-    // strings, we expose this internal converter.
-    // </summary>
-    internal class NewItemFactoryTypeModelToDisplayNameConverter : IValueConverter 
-    {
-
-        private static NewItemFactoryTypeModelToDisplayNameConverter _instance;
-
-        // <summary>
-        // Static instance accessor for all non-XAML related conversion needs
-        // </summary>
-        public static NewItemFactoryTypeModelToDisplayNameConverter Instance 
-        {
-            get {
-                if (_instance == null)
-                {
-                    _instance = new NewItemFactoryTypeModelToDisplayNameConverter();
-                }
-
-                return _instance;
-            }
-        }
-
-        // Converts an instance of NewItemFactoryTypeModel to its appropriate display name
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 
-        {
-
-            if (typeof(string).IsAssignableFrom(targetType)) 
-            {
-
-                NewItemFactoryTypeModel model = value as NewItemFactoryTypeModel;
-                if (model != null) 
-                {
-                    return model.DisplayName ?? string.Empty;
-                }
-            }
-
-            return string.Empty;
-        }
-
-        // This class is only a one-way converter
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 
-        {
-            throw FxTrace.Exception.AsError(new InvalidOperationException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/NonZeroToBoolConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/NonZeroToBoolConverter.cs
deleted file mode 100644 (file)
index 2ea67c5..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Editors 
-{
-    using System;
-    using System.Collections;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Windows.Data;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // Converts ints >0 to true, everything else to false.  This class is instantiated from XAML.
-    // </summary>
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal class NonZeroToBoolConverter : IValueConverter 
-    {
-
-        private bool _invert;
-
-        // <summary>
-        // If set to false, NonZeroToBoolConverter.Convert() converts 0 to false and !0 to true.
-        // If set to true, the result is inverted.
-        // </summary>
-        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        public bool Invert 
-        {
-            get { return _invert; }
-            set { _invert = value; }
-        }
-
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 
-        {
-            if (targetType == typeof(bool) && value is int) 
-            {
-                return (((int)value) > 0) ^ _invert;
-            }
-
-            return false;
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 
-        {
-            throw FxTrace.Exception.AsError(new NotImplementedException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/PropertyValueToDisplayNameConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/PropertyValueToDisplayNameConverter.cs
deleted file mode 100644 (file)
index dfde667..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Editors 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Text;
-    using System.Windows.Data;
-
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using System.Activities.Presentation.Internal.Properties;
-
-    // <summary>
-    // ValueConverter that takes an instance of PropertyValue and returns a display name for
-    // it.  The returned name consists of the value Type name as well as its x:Name property
-    // if it is defined.
-    // </summary>
-    internal class PropertyValueToDisplayNameConverter : IValueConverter 
-    {
-
-        private static PropertyValueToDisplayNameConverter _instance;
-
-        // <summary>
-        // Static instance accessor for all non-XAML related conversion needs
-        // </summary>
-        public static PropertyValueToDisplayNameConverter Instance 
-        {
-            get {
-                if (_instance == null)
-                {
-                    _instance = new PropertyValueToDisplayNameConverter();
-                }
-
-                return _instance;
-            }
-        }
-
-        // Converts an instance of PropertyValue to its appropriate display name
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 
-        {
-
-            if (typeof(string).IsAssignableFrom(targetType)) 
-            {
-
-                PropertyValue propertyValue = value as PropertyValue;
-                if (propertyValue != null) 
-                {
-
-                    ModelPropertyEntryBase propertyEntry = propertyValue.ParentProperty as ModelPropertyEntryBase;
-
-                    // Figure out the value type name
-                    string valueTypeName = string.Empty;
-                    if (propertyEntry != null)
-                    {
-                        valueTypeName = propertyEntry.CommonValueType == null ? string.Empty : propertyEntry.CommonValueType.Name;
-                    }
-                    else 
-                    {
-                        Debug.Fail("PropertyValueToDisplayNameConverter is being used for something other than ModelPropertyValues.  Re-evaluate the correctness of its logic.");
-
-                        // Fallback mechanism
-                        object rawPropertyValue = propertyValue.Value;
-                        if (rawPropertyValue != null)
-                        {
-                            valueTypeName = rawPropertyValue.GetType().Name;
-                        }
-                    }
-
-                    // See if there is a regular name
-                    string propertyName = ModelUtilities.GetPropertyName(propertyValue);
-
-                    if (string.IsNullOrEmpty(propertyName)) 
-                    {
-                        // Type only
-                        return string.Format(
-                            culture,
-                            Resources.PropertyEditing_CollectionItemDisplayFormatType,
-                            valueTypeName);
-                    }
-                    else 
-                    {
-                        // Type and name
-                        return string.Format(
-                            culture,
-                            Resources.PropertyEditing_CollectionItemDisplayFormatTypeAndName,
-                            valueTypeName,
-                            propertyName);
-                    }
-                }
-            }
-
-            return string.Empty;
-        }
-
-        // This class is only a one-way converter
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 
-        {
-            throw FxTrace.Exception.AsError(new NotImplementedException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/PropertyValueToStandardValuesConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/PropertyValueToStandardValuesConverter.cs
deleted file mode 100644 (file)
index 58550c6..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Editors 
-{
-    using System;
-    using System.Collections;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Windows.Data;
-
-    using System.Runtime;
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation.Internal.Properties;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-
-    // <summary>
-    // Retrieves StandardValues from a passed in PropertyValue, making sure that if a TypeConverter
-    // exists and if it supports ConvertToString() method, it will be called on each value contained
-    // in the StandardValues collection.
-    // This class is instantiated through XAML
-    // </summary>
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal class PropertyValueToStandardValuesConverter : IValueConverter 
-    {
-        // IValueConverter Members
-
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 
-        {
-
-            Fx.Assert(typeof(IEnumerable).IsAssignableFrom(targetType), "Expecting IEnumerable as the targetType");
-
-            PropertyValue propertyValue = value as PropertyValue;
-            if (propertyValue == null)
-            {
-                return null;
-            }
-
-            ModelPropertyEntryBase parentProperty = (ModelPropertyEntryBase)propertyValue.ParentProperty;
-            return new ConvertedStandardValuesCollection(parentProperty, culture);
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 
-        {
-            throw FxTrace.Exception.AsError(new InvalidOperationException());
-        }
-
-
-        // <summary>
-        // An implementation of ICollection that defers access to the standard
-        // values collection.  Accessing the StandardValues collection may be
-        // expensive, so we defer it until we absolutely need it.
-        // </summary>
-        private class ConvertedStandardValuesCollection : ICollection 
-        {
-
-            private ModelPropertyEntryBase _property;
-            private CultureInfo _culture;
-            private ICollection _contents;
-
-            internal ConvertedStandardValuesCollection(ModelPropertyEntryBase property, CultureInfo culture) 
-            {
-                _property = property;
-                _culture = culture;
-            }
-
-            public int Count 
-            {
-                get { return Contents.Count; }
-            }
-
-            public bool IsSynchronized 
-            {
-                get { return false; }
-            }
-
-            public object SyncRoot 
-            {
-                get { return Contents.SyncRoot; }
-            }
-
-        // IEnumerable Members
-
-            private ICollection Contents 
-            {
-                get {
-                    if (_contents == null) 
-                    {
-                        ICollection standardValues = _property.StandardValues;
-                        TypeConverter converter = _property.Converter;
-
-                        if (standardValues != null && (converter == null || !converter.CanConvertTo(typeof(string)))) 
-                        {
-                            _contents = standardValues;
-                        }
-                        else 
-                        {
-                            ArrayList convertedStandardValues = new ArrayList(standardValues == null ? 0 : standardValues.Count);
-                            if (standardValues != null) 
-                            {
-                                foreach (object standardValue in standardValues) 
-                                {
-                                    convertedStandardValues.Add(converter.ConvertToString(null, _culture, standardValue));
-                                }
-                            }
-                            _contents = convertedStandardValues;
-                        }
-
-                        // PS 107537: Special-case handling for nullable enum types
-                        if (EditorUtilities.IsNullableEnumType(_property.PropertyType))
-                        {
-                            ArrayList filteredStandardValues = new ArrayList();
-                            filteredStandardValues.Add(EditorUtilities.NullString);
-                            foreach (var i in (ArrayList)_contents)
-                            {
-                                if (i != null)
-                                {
-                                    filteredStandardValues.Add(i);
-                                }
-                            }
-                            _contents = filteredStandardValues;
-                        }
-                    }
-
-                    return _contents;
-                }
-            }
-
-        // ICollection Members
-
-            public void CopyTo(Array array, int index) 
-            {
-                Contents.CopyTo(array, index);
-            }
-
-            public IEnumerator GetEnumerator() 
-            {
-                return Contents.GetEnumerator();
-            }
-
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/RTLValueConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/RTLValueConverter.cs
deleted file mode 100644 (file)
index 9c00208..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Editors 
-{
-
-    using System;
-    using System.Collections;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Windows.Data;
-    using System.Windows;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using System.Activities.Presentation.Internal.PropertyEditing.Resources;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation;
-    using System.Runtime;
-
-    // <summary>
-    // Checks the property entry and converts it
-    // to appropriate FlowDirection value which is returned back.
-    // </summary>
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal class RTLValueConveter : IMultiValueConverter 
-    {
-        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) {
-            FlowDirection returnValue = FlowDirection.LeftToRight;
-            Fx.Assert(values.Length == 3, "Incorrect values in the MultiValueConverter!");
-            if (values.Length == 3) 
-            {
-                ModelPropertyEntry propertyEntry = values[1] as ModelPropertyEntry;
-                if (propertyEntry != null) 
-                {
-                    if (!propertyEntry.DisplayName.Equals("Name")) 
-                    {
-                        if (targetType == typeof(FlowDirection)) 
-                        {
-                            object propertyValue = values[0];
-                            if (propertyValue == null || propertyValue.GetType() == typeof(string)) 
-                            {
-                                //customize it to controls FlowDirection Property
-                                returnValue = (FlowDirection)PropertyInspectorResources.GetResources()["SelectedControlFlowDirectionRTL"];
-                            }
-                        }
-                    }
-                }
-            }
-            return returnValue;
-        }
-
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) {
-            throw FxTrace.Exception.AsError(new NotImplementedException());
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/SubPropertyEditor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/SubPropertyEditor.cs
deleted file mode 100644 (file)
index f2cdbcd..0000000
+++ /dev/null
@@ -1,630 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Editors 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.ComponentModel;
-    using System.Globalization;
-    using System.Windows;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-
-    using System.Runtime;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.Automation;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using ModelUtilities = System.Activities.Presentation.Internal.PropertyEditing.Model.ModelUtilities;
-    using System.Activities.Presentation.Internal.PropertyEditing.Resources;
-    using System.Activities.Presentation.Internal.PropertyEditing.Selection;
-    using System.Activities.Presentation.Internal.PropertyEditing.State;
-
-    // <summary>
-    // We use the SubPropertyEditor to replace the entire property row
-    // when the property exposes its subproperties.  This control is _not_
-    // just used within the value-editing portion of a property row.
-    // We cheat because we can.
-    // </summary>
-    internal class SubPropertyEditor : Control, INotifyPropertyChanged, ISelectionStop 
-    {
-
-        // <summary>
-        // PropertyEntry is used to store the currently displayed PropertyEntry
-        // </summary>
-        public static readonly DependencyProperty PropertyEntryProperty = DependencyProperty.Register(
-            "PropertyEntry",
-            typeof(PropertyEntry),
-            typeof(SubPropertyEditor),
-            new PropertyMetadata(null, new PropertyChangedCallback(OnPropertyEntryChanged)));
-
-        // <summary>
-        // Boolean used to indicate whether the sub-properties are being shown or not.  As an optimization,
-        // we don't actually expose the PropertyValue's sub-properties through SelectiveSubProperties until
-        // the sub-property expando-pane has been open at least once.
-        // </summary>
-        public static readonly DependencyProperty IsExpandedProperty = DependencyProperty.Register(
-            "IsExpanded",
-            typeof(bool),
-            typeof(SubPropertyEditor),
-            new PropertyMetadata(false, new PropertyChangedCallback(OnIsExpandedChanged)));
-
-        // <summary>
-        // Exposes the currently selected QuickType in the QuickType drop-down.  Essentially,
-        // the value of this DP is plumbed through to reflect the value of _quickTypeView.CurrentItem
-        // </summary>
-        public static readonly DependencyProperty CurrentQuickTypeProperty = DependencyProperty.Register(
-            "CurrentQuickType",
-            typeof(NewItemFactoryTypeModel),
-            typeof(SubPropertyEditor),
-            new PropertyMetadata(null, new PropertyChangedCallback(OnCurrentQuickTypeChanged)));
-
-        private ICollectionView _quickTypeView;
-        private ObservableCollection<NewItemFactoryTypeModel> _quickTypeCollection;
-        private bool _ignoreInternalChanges;
-        private bool _exposedSubProperties;
-
-        private ItemsControl _subPropertyListControl;
-
-        // <summary>
-        // Basic ctor
-        // </summary>
-        public SubPropertyEditor() 
-        {
-            _quickTypeCollection = new ObservableCollection<NewItemFactoryTypeModel>();
-
-            _quickTypeView = CollectionViewSource.GetDefaultView(_quickTypeCollection);
-            _quickTypeView.CurrentChanged += new EventHandler(OnCurrentQuickTypeChanged);
-        }
-
-        // Automation
-
-        public event PropertyChangedEventHandler PropertyChanged;
-
-        // Internal event we fire for the sake of SubPropertyEditorAutomationPeer that
-        // causes it to refresh its offered set of children
-        internal event EventHandler VisualsChanged;
-
-        public PropertyEntry PropertyEntry 
-        {
-            get { return (PropertyEntry)this.GetValue(PropertyEntryProperty); }
-            set { this.SetValue(PropertyEntryProperty, value); }
-        }
-
-        public bool IsExpanded 
-        {
-            get { return (bool)this.GetValue(IsExpandedProperty); }
-            set { this.SetValue(IsExpandedProperty, value); }
-        }
-
-        public NewItemFactoryTypeModel CurrentQuickType 
-        {
-            get { return (NewItemFactoryTypeModel)this.GetValue(CurrentQuickTypeProperty); }
-            set { this.SetValue(CurrentQuickTypeProperty, value); }
-        }
-
-        // <summary>
-        // Gets a flag indicating whether QuickTypes exist
-        // </summary>
-        public bool HasQuickTypes 
-        {
-            get {
-                return _quickTypeCollection.Count > 0;
-            }
-        }
-
-        // <summary>
-        // Returns a list of available QuickTypes (collection of NewItemFactoryTypeModel instances)
-        // </summary>
-        public ICollectionView QuickTypes 
-        {
-            get {
-                return _quickTypeView;
-            }
-        }
-
-        // <summary>
-        // Exposes PropertyValue.SubProperties when the IsExpanded flag first gets set to true
-        // and forever thereafter (or at least until the current PropertyValue changes and we
-        // collapse the sub-properties)
-        // </summary>
-        public IEnumerable<PropertyEntry> SelectiveSubProperties 
-        {
-            get {
-                if (!_exposedSubProperties) 
-                {
-                    if (!this.IsExpanded)
-                    {
-                        yield break;
-                    }
-
-                    _exposedSubProperties = true;
-                }
-
-                PropertyEntry parent = this.PropertyEntry;
-                if (parent == null)
-                {
-                    yield break;
-                }
-
-                foreach (ModelPropertyEntry subProperty in parent.PropertyValue.SubProperties)
-                {
-                    if (subProperty.IsBrowsable)
-                    {
-                        yield return subProperty;
-                    }
-                }
-            }
-        }
-
-        // <summary>
-        // Gets a flag indicating whether the sub-property editor can be expanded or not.
-        // </summary>
-        public bool IsExpandable 
-        {
-            get { return this.HasQuickTypes && this.CurrentQuickType != null; }
-        }
-
-        // <summary>
-        // Gets a SelectionPath to itself.
-        // </summary>
-        public SelectionPath Path 
-        {
-            get { return PropertySelectionPathInterpreter.Instance.ConstructSelectionPath(this.PropertyEntry); }
-        }
-
-        // <summary>
-        // Gets a description of the contained property
-        // to expose through automation
-        // </summary>
-        public string Description 
-        {
-            get {
-                PropertyEntry property = this.PropertyEntry;
-                if (property != null) 
-                {
-                    return string.Format(
-                        CultureInfo.CurrentCulture,
-                        Properties.Resources.PropertyEditing_SelectionStatus_Property,
-                        this.PropertyEntry.PropertyName);
-                }
-
-                return string.Empty;
-            }
-        }
-
-
-        // <summary>
-        // Exposes the ItemsControl used to display the list of sub-properties.  UI-specific
-        // </summary>
-        private ItemsControl SubPropertyListControl 
-        {
-            get {
-                if (_subPropertyListControl == null) 
-                {
-                    _subPropertyListControl = VisualTreeUtils.GetNamedChild<ItemsControl>(this, "PART_SubPropertyList");
-                    Fx.Assert(_subPropertyListControl != null, "UI for SubPropertyEditor changed.  Need to update SubPropertyEditor class logic.");
-                }
-
-                return _subPropertyListControl;
-            }
-        }
-
-
-        // Keyboard Navigation
-
-        protected override AutomationPeer OnCreateAutomationPeer() 
-        {
-            return new SubPropertyEditorAutomationPeer(this);
-        }
-
-
-        // Properties
-
-        // PropertyEntry DP
-
-        // When the displayed PropertyEntry changes, make sure we update the UI and hook into the
-        // new PropertyEntry's notification mechanism
-        private static void OnPropertyEntryChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) 
-        {
-            SubPropertyEditor theThis = obj as SubPropertyEditor;
-            if (theThis == null)
-            {
-                return;
-            }
-
-            PropertyEntry oldValue = e.OldValue as PropertyEntry;
-            if (oldValue != null) 
-            {
-                oldValue.PropertyValue.RootValueChanged -= new EventHandler(theThis.OnPropertyValueRootValueChanged);
-            }
-
-            PropertyEntry newValue = e.NewValue as PropertyEntry;
-            if (newValue != null) 
-            {
-                newValue.PropertyValue.RootValueChanged += new EventHandler(theThis.OnPropertyValueRootValueChanged);
-            }
-
-            theThis.RefreshVisuals();
-        }
-
-        private void OnPropertyValueRootValueChanged(object sender, EventArgs e) 
-        {
-            if (_ignoreInternalChanges)
-            {
-                return;
-            }
-
-            RefreshVisuals();
-        }
-
-
-        // IsExpanded DP
-
-        private static void OnIsExpandedChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) 
-        {
-            SubPropertyEditor theThis = obj as SubPropertyEditor;
-            if (theThis == null)
-            {
-                return;
-            }
-
-            bool newIsExpanded = (bool)e.NewValue;
-            PropertyEntry containedProperty = theThis.PropertyEntry;
-
-            // Store the new expansion state
-            if (containedProperty != null) 
-            {
-                PropertyState state = PropertyStateContainer.Instance.GetPropertyState(
-                    ModelUtilities.GetCachedSubPropertyHierarchyPath(containedProperty));
-                state.SubPropertiesExpanded = newIsExpanded;
-            }
-
-            // If we are expanded but we never exposed the sub-properties to anyone before,
-            // fire a signal saying that a list of sub-properties may be now available, so that
-            // UI DataBindings refresh themselves
-            if (newIsExpanded == true &&
-                theThis._exposedSubProperties == false) 
-            {
-                theThis.FireSubPropertiesListChangedEvents();
-            }
-        }
-
-        // CurrentQuickType DP
-
-        // This method gets called when the DP changes
-        private static void OnCurrentQuickTypeChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) 
-        {
-            SubPropertyEditor theThis = obj as SubPropertyEditor;
-            if (theThis == null)
-            {
-                return;
-            }
-
-            if (theThis._ignoreInternalChanges)
-            {
-                return;
-            }
-
-            theThis._quickTypeView.MoveCurrentTo(e.NewValue);
-
-            theThis.ExpandSubProperties();
-            theThis.FireSubPropertiesListChangedEvents();
-        }
-
-        // This method gets called when the CurrentItem on _quickTypeView changes
-        private void OnCurrentQuickTypeChanged(object sender, EventArgs e) 
-        {
-            if (_ignoreInternalChanges)
-            {
-                return;
-            }
-
-            NewItemFactoryTypeModel selectedTypeModel = _quickTypeView.CurrentItem as NewItemFactoryTypeModel;
-
-            if (selectedTypeModel == null)
-            {
-                return;
-            }
-
-            Fx.Assert(this.PropertyEntry != null, "PropertyEntry should not be null");
-            if (this.PropertyEntry == null)
-            {
-                return;
-            }
-
-            bool previousValue = IgnoreInternalChanges();
-            try 
-            {
-                this.PropertyEntry.PropertyValue.Value = selectedTypeModel.CreateInstance();
-            }
-            finally 
-            {
-                NoticeInternalChanges(previousValue);
-            }
-        }
-
-
-        protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e) 
-        {
-            if (e.Property == PropertyContainer.OwningPropertyContainerProperty) 
-            {
-
-                // A quick and dirty way to register this instance as the implementation of 
-                // ISelectionBranchPoint that controls the expansion / collapse of this control
-                //
-                OnOwningPropertyContainerChanged((PropertyContainer)e.OldValue, (PropertyContainer)e.NewValue);
-
-            }
-
-            base.OnPropertyChanged(e);
-        }
-
-        private void OnOwningPropertyContainerChanged(PropertyContainer oldValue, PropertyContainer newValue) 
-        {
-            if (oldValue != null) 
-            {
-                PropertySelection.ClearSelectionStop(oldValue);
-                PropertySelection.ClearIsSelectionStopDoubleClickTarget(oldValue);
-            }
-
-            if (newValue != null) 
-            {
-                PropertySelection.SetSelectionStop(newValue, this);
-                PropertySelection.SetIsSelectionStopDoubleClickTarget(newValue, true);
-            }
-        }
-
-
-        // Visual Lookup Helpers
-
-        // <summary>
-        // Looks for and returns the specified sub-property
-        // </summary>
-        // <param name="propertyName">Sub-property to look up</param>
-        // <returns>Corresponding PropertyEntry if found, null otherwise.</returns>
-        internal PropertyEntry FindSubPropertyEntry(string propertyName) 
-        {
-            if (string.IsNullOrEmpty(propertyName)) 
-            {
-                return null;
-            }
-
-            foreach (PropertyEntry property in SelectiveSubProperties)
-            {
-                if (property.PropertyName.Equals(propertyName))
-                {
-                    return property;
-                }
-            }
-
-            return null;
-        }
-
-        // <summary>
-        // Looks for and returns the PropertyContainer used to display
-        // the specified PropertyEntry
-        // </summary>
-        // <param name="property">Property to look for</param>
-        // <returns>Corresponding PropertyContainer if found, null otherwise.</returns>
-        internal PropertyContainer FindSubPropertyEntryVisual(PropertyEntry property) 
-        {
-            if (property == null) 
-            {
-                return null;
-            }
-
-            ItemsControl subPropertyListControl = this.SubPropertyListControl;
-            if (subPropertyListControl == null)
-            {
-                return null;
-            }
-
-            return subPropertyListControl.ItemContainerGenerator.ContainerFromItem(property) as PropertyContainer;
-        }
-
-
-        // Helpers
-
-        private void RefreshVisuals() 
-        {
-            RefreshQuickTypes();
-            RestoreIsExpandedState();
-            FireVisualsChangedEvents();
-        }
-
-        private void RefreshQuickTypes() 
-        {
-            bool previousValue = IgnoreInternalChanges();
-            try 
-            {
-                _quickTypeCollection.Clear();
-
-                PropertyEntry containedProperty = this.PropertyEntry;
-                if (containedProperty == null)
-                {
-                    return;
-                }
-
-                ModelProperty property = ((ModelPropertyEntry)containedProperty).FirstModelProperty;
-                Type containerValueType = ((ModelPropertyEntryBase)containedProperty).CommonValueType;
-                NewItemFactoryTypeModel selectedFactoryModel = null;
-                Type defaultItemType = GetDefaultItemType(property);
-
-                // Find all elligible NewItemFactoryTypes declared through metadata
-                IEnumerable<NewItemFactoryTypeModel> factoryModels =
-                    ExtensibilityAccessor.GetNewItemFactoryTypeModels(
-                    property,
-                    ResourceUtilities.GetDesiredTypeIconSize(this));
-
-                if (factoryModels != null) 
-                {
-                    foreach (NewItemFactoryTypeModel factoryModel in factoryModels) 
-                    {
-                        _quickTypeCollection.Add(factoryModel);
-
-                        if (selectedFactoryModel == null) 
-                        {
-                            if (object.Equals(containerValueType, factoryModel.Type)) 
-                            {
-                                selectedFactoryModel = factoryModel;
-                            }
-                        }
-
-                        if (defaultItemType != null &&
-                            object.Equals(defaultItemType, factoryModel.Type)) 
-                        {
-                            defaultItemType = null;
-                        }
-                    }
-                }
-
-                //add a null value - user should always have an option to clear property value
-                NewItemFactoryTypeModel nullTypeFactoryTypeModel =
-                    new NewItemFactoryTypeModel(null, new NullItemFactory());
-
-                // Add a default item type based on the property type (if it wasn't also added through
-                // metadata)
-                if (defaultItemType != null) 
-                {
-                    NewItemFactoryTypeModel defaultItemFactoryTypeModel = new NewItemFactoryTypeModel(defaultItemType, new NewItemFactory());
-                    _quickTypeCollection.Add(defaultItemFactoryTypeModel);
-
-                    if (selectedFactoryModel == null) 
-                    {
-                        if (object.Equals(containerValueType, defaultItemFactoryTypeModel.Type)) 
-                        {
-                            selectedFactoryModel = defaultItemFactoryTypeModel;
-                        }
-                        else if (containerValueType == null)
-                        {
-                            selectedFactoryModel = nullTypeFactoryTypeModel;
-                        }
-                    }
-                }
-                
-                _quickTypeCollection.Add(nullTypeFactoryTypeModel);
-
-                // Make sure the currently selected value on the CollectionView reflects the
-                // actual value of the property
-                _quickTypeView.MoveCurrentTo(selectedFactoryModel);
-                this.CurrentQuickType = selectedFactoryModel;
-            }
-            finally 
-            {
-                NoticeInternalChanges(previousValue);
-            }
-        }
-
-        private static Type GetDefaultItemType(ModelProperty property) 
-        {
-            if (property == null)
-            {
-                return null;
-            }
-
-            Type propertyType = property.PropertyType;
-            if (EditorUtilities.IsConcreteWithDefaultCtor(propertyType))
-            {
-                return propertyType;
-            }
-
-            return null;
-        }
-
-        private void RestoreIsExpandedState() 
-        {
-            bool newIsExpanded = false;
-            PropertyEntry property = this.PropertyEntry;
-
-            if (property != null) 
-            {
-                PropertyState state = PropertyStateContainer.Instance.GetPropertyState(
-                    ModelUtilities.GetCachedSubPropertyHierarchyPath(property));
-                newIsExpanded = state.SubPropertiesExpanded;
-            }
-
-            this.IsExpanded = newIsExpanded;
-            _exposedSubProperties = false;
-        }
-
-        private void ExpandSubProperties() 
-        {
-            this.IsExpanded = true;
-        }
-
-
-        // Change Notification Helpers
-
-        private bool IgnoreInternalChanges() 
-        {
-            bool previousValue = _ignoreInternalChanges;
-            _ignoreInternalChanges = true;
-            return previousValue;
-        }
-
-        private void NoticeInternalChanges(bool previousValue) 
-        {
-            _ignoreInternalChanges = previousValue;
-        }
-
-        private void FireVisualsChangedEvents() 
-        {
-            // Fire updated events
-            OnPropertyChanged("HasQuickTypes");
-            OnPropertyChanged("QuickTypes");
-            FireSubPropertiesListChangedEvents();
-        }
-
-        private void FireSubPropertiesListChangedEvents() 
-        {
-            OnPropertyChanged("IsExpandable");
-            OnPropertyChanged("SelectiveSubProperties");
-
-            if (VisualsChanged != null)
-            {
-                VisualsChanged(this, EventArgs.Empty);
-            }
-        }
-
-
-        // INotifyPropertyChanged Members
-
-        private void OnPropertyChanged(string propertyName) 
-        {
-            Fx.Assert(!string.IsNullOrEmpty(propertyName), "Can't raise OnPropertyChanged event without a valid property name.");
-
-            if (PropertyChanged != null)
-            {
-                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-            }
-        }
-
-        // ISelectionStop Members
-
-        //NullItemFactory - this class is used to provide a null entry in quick types list - it is required to allow user 
-        //to clear value of an object.
-        sealed class NullItemFactory : NewItemFactory
-        {
-            public override object CreateInstance(Type type)
-            {
-                //no input type is allowed - we never create instance of anything
-                Fx.Assert(type == null, "NullItemFactory supports only null as type parameter");
-                return null;
-            }
-
-            public override string GetDisplayName(Type type)
-            {
-                //no input type is allowed - we always return (null) string
-                Fx.Assert(type == null, "NullItemFactory supports only null as type parameter");
-                return "(null)";
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/SubPropertyViewEditor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/SubPropertyViewEditor.cs
deleted file mode 100644 (file)
index 30b45fa..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Editors 
-{
-    using System;
-    using System.Windows;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation.Internal.PropertyEditing.Resources;
-
-    // <summary>
-    // SubPropertyViewEditor is a "fake" value editor.  We only use it as a marker that exposes
-    // MarkerSubPropertyTemplate as its editor DataTemplates.  The XAML code for PropertyContainer
-    // specifically looks for these markers and it switches its InlineRowTemplate to a
-    // sub-property-specific inline row template when found.
-    // </summary>
-    internal class SubPropertyViewEditor : ExtendedPropertyValueEditor 
-    {
-
-        private static SubPropertyViewEditor _instance;
-
-        // This class can have a private ctor because we instantiate it through code,
-        // not through XAML or attributes
-        private SubPropertyViewEditor()
-            : base(
-            PropertyInspectorResources.GetResources()["MarkerSubPropertyTemplate"] as DataTemplate,
-            PropertyInspectorResources.GetResources()["MarkerSubPropertyTemplate"] as DataTemplate)
-        { 
-        }
-
-        // <summary>
-        // Gets the static instance of this class
-        // </summary>
-        public static SubPropertyViewEditor Instance 
-        {
-            get {
-                if (_instance == null)
-                {
-                    _instance = new SubPropertyViewEditor();
-                }
-
-                return _instance;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/ValueToToolTipConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/ValueToToolTipConverter.cs
deleted file mode 100644 (file)
index 67476dd..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Editors 
-{
-    using System;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Windows.Data;
-    using System.Runtime;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // A converter that takes a value of a property and a boolean indicating whether it
-    // is being edited and returns a string to use for the editor tool tip.
-    // This class gets instantiated from XAML.
-    // </summary>
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal class ValueToToolTipConverter : IMultiValueConverter 
-    {
-        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) {
-            Fx.Assert(values != null && values.Length == 2, "Invalid values passed into ValueToToolTipConverter");
-
-            bool isEditing = (bool)values[1];
-            string value = isEditing ? null : EditorUtilities.GetDisplayName(values[0]);
-
-            return string.IsNullOrEmpty(value) ? null : value;
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) {
-            throw FxTrace.Exception.AsError(new NotImplementedException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/newitemfactorytypemodeltotypenameconverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/newitemfactorytypemodeltotypenameconverter.cs
deleted file mode 100644 (file)
index 91decef..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Editors 
-{
-    using System;
-    using System.Windows.Data;
-    using System.Globalization;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // Converts an instance of NewItemFactoryTypeModel to its contained Type name.
-    // </summary>
-    internal class NewItemFactoryTypeModelToTypeNameConverter : IValueConverter 
-    {
-
-        // Converts an instance of NewItemFactoryTypeModel to its corresponding type name
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 
-        {
-
-            if (typeof(string).IsAssignableFrom(targetType)) 
-            {
-                NewItemFactoryTypeModel model = value as NewItemFactoryTypeModel;
-                if (model != null && model.Type != null) 
-                {
-                    return model.Type.Name;
-                }
-            }
-
-            return string.Empty;
-        }
-
-        // This class is only a one-way converter
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 
-        {
-            throw FxTrace.Exception.AsError(new InvalidOperationException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/quickitemtemplateselector.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Editors/quickitemtemplateselector.cs
deleted file mode 100644 (file)
index fdee3bb..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Editors 
-{
-    using System;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Media;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.ValueEditors;
-
-    // <summary>
-    // DataTemplateSelector we use in some instances of ChoiceEditor (namely sub-property editor)
-    // to detect whether the given item is being displayed in the popup or as an inline item.
-    // Based on that determination, it returns the appropriate DataTemplate.  This is a work-around
-    // for the problem where we can't determine which NewItemTypeFactory instantiated a given instance.
-    // Hence, we show the instance Type inline the ComboBox and the factory DisplayName in the drop-down.
-    // Ideally, we would want to use a different control to handle this scenario.
-    // </summary>
-    internal class QuickItemTemplateSelector : DataTemplateSelector 
-    {
-
-        private DataTemplate _popupTemplate;
-        private DataTemplate _inlineTemplate;
-
-        public DataTemplate PopupTemplate 
-        {
-            [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-            get { return _popupTemplate; }
-            [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-            set { _popupTemplate = value; }
-        }
-
-        public DataTemplate InlineTemplate 
-        {
-            [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-            get { return _inlineTemplate; }
-            [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-            set { _inlineTemplate = value; }
-        }
-
-        public override DataTemplate SelectTemplate(object item, DependencyObject container) 
-        {
-            return HasChoiceEditorParent(container) ? _inlineTemplate : _popupTemplate;
-        }
-
-        private bool HasChoiceEditorParent(DependencyObject element) 
-        {
-            while (element != null) 
-            {
-                element = VisualTreeHelper.GetParent(element);
-                if (element != null && typeof(ChoiceEditor).IsAssignableFrom(element.GetType()))
-                {
-                    return true;
-                }
-            }
-
-            return false;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/ExtensibilityAccessor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/ExtensibilityAccessor.cs
deleted file mode 100644 (file)
index 002837b..0000000
+++ /dev/null
@@ -1,941 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Windows.Markup;
-
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework;
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.Editors;
-    using ModelUtilities = System.Activities.Presentation.Internal.PropertyEditing.Model.ModelUtilities;
-
-    // <summary>
-    // Static helper class that contains all extensibility-related code.  No other code
-    // under PropertyEditing should be looking up attributes and interpretting them.
-    // In most cases, the methods here delegate to Sparkle's binaries to make sure that
-    // both products behave consistently.
-    // </summary>
-    internal static class ExtensibilityAccessor 
-    {
-
-        // Cache of Types to their respective DefaultProperties
-        private static Dictionary<Type, string> _defaultPropertyCache = new Dictionary<Type, string>();
-
-        // <summary>
-        // Gets the name of the category that the specified ModelProperty belongs to
-        // </summary>
-        // <param name="property">ModelProperty to examine</param>
-        // <returns>Name of the category that the specified ModelProperty belongs to</returns>
-        public static string GetCategoryName(ModelProperty property) 
-        {
-            CategoryAttribute attribute = GetAttribute<CategoryAttribute>(property);
-
-            if (attribute == null || string.IsNullOrEmpty(attribute.Category))
-            {
-                return CategoryAttribute.Default.Category;
-            }
-            else
-            {
-                return attribute.Category;
-            }
-        }
-
-        // <summary>
-        // Gets the StandardValues that are exposed by the specified TypeConverter
-        // </summary>
-        // <param name="converter">TypeConverter to examine</param>
-        // <returns>StandardValues that are exposed by the specified TypeConverter</returns>
-        public static ArrayList GetStandardValues(TypeConverter converter) 
-        {
-            if (converter == null)
-            {
-                return null;
-            }
-
-            if (!converter.GetStandardValuesSupported())
-            {
-                return null;
-            }
-
-            ICollection values = converter.GetStandardValues();
-            if (values == null)
-            {
-                return null;
-            }
-
-            // unwrap ModelItems if that's what the converter gives us
-            ArrayList convertedValues = new ArrayList(values.Count);
-            foreach (object value in values) 
-            {
-                ModelItem item = value as ModelItem;
-                if (item != null)
-                {
-                    convertedValues.Add(item.GetCurrentValue());
-                }
-                else
-                {
-                    convertedValues.Add(value);
-                }
-            }
-
-            return convertedValues;
-        }
-
-        // <summary>
-        // Gets a flag indicating if a further call to GetStandardValues will
-        // give back a non-zero collection.
-        // </summary>
-        // <param name="converter">The type converter to check.</param>
-        // <returns>True if the type converter supports standard values.</returns>
-        public static bool GetStandardValuesSupported(TypeConverter converter) 
-        {
-            return (converter != null && converter.GetStandardValuesSupported());
-        }
-
-        // <summary>
-        // Look for and return any custom PropertyValueEditor defined for the specified ModelProperty
-        // </summary>
-        // <param name="property">ModelProperty to examine</param>
-        // <returns>A custom PropertyValueEditor for the specified ModelProperty (may be null)</returns>
-        public static PropertyValueEditor GetCustomPropertyValueEditor(ModelProperty property) 
-        {
-            if (property == null)
-            {
-                return null;
-            }
-
-            PropertyValueEditor editor = ExtensibilityMetadataHelper.GetValueEditor(property.Attributes, MessageLogger.Instance);
-
-            //if property is a generic type, check for designer defined at generic type definition
-            if (editor == null && property.PropertyType.IsGenericType)
-            {
-                Type genericType = property.PropertyType.GetGenericTypeDefinition();
-                editor = ExtensibilityMetadataHelper.GetValueEditor(TypeDescriptor.GetAttributes(genericType), MessageLogger.Instance);
-            }
-
-            return editor;
-        }
-        // <summary>
-        // Returns an instance of SubPropertyEditor if the specified ModelProperty can be edited
-        // using sub-properties, null otherwise.
-        // </summary>
-        // <param name="property">ModelProperty to examine</param>
-        // <returns>An instance of SubPropertyEditor if the specified ModelProperty can be edited
-        // using sub-properties, null otherwise.</returns>
-        public static PropertyValueEditor GetSubPropertyEditor(ModelProperty property) 
-        {
-            if (property == null)
-            {
-                return null;
-            }
-
-            if (property.Converter == null ||
-                property.Converter.GetPropertiesSupported() == false)
-            {
-                // if it's a property of a generic type, check for converter defined at the property of generic type definition
-                if (property.Parent.ItemType.IsGenericType)
-                {
-                    Type genericType = property.Parent.ItemType.GetGenericTypeDefinition();
-                    PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(genericType);
-                    PropertyDescriptor propertyDescriptor = properties.Find(property.Name, false);
-                    if (propertyDescriptor != null)
-                    {
-                        // wrap the converter and check if it supports GetProperties()
-                        TypeConverter converter = new ModelTypeConverter(((IModelTreeItem)property.Parent).ModelTreeManager, propertyDescriptor.Converter);
-                        if (converter.GetPropertiesSupported())
-                        {
-                            return SubPropertyViewEditor.Instance;
-                        }
-                    }
-                }
-
-                return null;
-            }
-
-            //Dont support Arrays
-            if (typeof(Array).IsAssignableFrom(property.PropertyType))
-            {
-                return null;
-            }
-
-            return SubPropertyViewEditor.Instance;
-        }
-
-        // <summary>
-        // ----s open the specified Type and looks for EditorAttributes that represent
-        // CategoryEditors - returns the Types of those editors, if any are found, as a list
-        // </summary>
-        // <param name="ownerType">Type to ---- open</param>
-        // <returns>List of CategoryEditors associated with the specified type, if any.  Null otherwise.</returns>
-        public static IEnumerable<Type> GetCategoryEditorTypes(Type ownerType) 
-        {
-
-            List<Type> editorTypes = null;
-
-            foreach (EditorAttribute editorAttribute in GetAttributes<EditorAttribute>(ownerType)) 
-            {
-
-                // A ---- attempt at using the same extensibility code
-                Type editorType = ExtensibilityMetadataHelper.GetCategoryEditorType(editorAttribute, MessageLogger.Instance);
-                if (editorType == null)
-                {
-                    continue;
-                }
-
-                if (editorTypes == null)
-                {
-                    editorTypes = new List<Type>();
-                }
-
-                editorTypes.Add(editorType);
-            }
-
-            return editorTypes;
-        }
-
-        // <summary>
-        // Decides whether the specified ModelProperty should be advanced
-        // </summary>
-        // <param name="property">ModelProperty to look up</param>
-        // <returns>True if the property should be advanced, false otherwise</returns>
-        public static bool GetIsAdvanced(ModelProperty property) 
-        {
-            EditorBrowsableAttribute browsable = GetAttribute<EditorBrowsableAttribute>(property);
-
-            if (browsable == null)
-            {
-                return false;
-            }
-
-            return browsable.State == EditorBrowsableState.Advanced;
-        }
-
-        // <summary>
-        // Decides whether the specified CategoryEditor should be advanced.
-        // Note: Blend uses custom, baked-in logic to determine whether a given CategoryEditor
-        // is advanced or not.  The logic is the same as the one here, but we can't share it
-        // because they don't expose it.  In v2, this is definitely something we should share.
-        // </summary>
-        // <param name="editor">CategoryEditor to look up</param>
-        // <returns>True if the specified editor should be advanced, false otherwise</returns>
-        public static bool GetIsAdvanced(CategoryEditor editor) 
-        {
-            EditorBrowsableAttribute browsable = GetAttribute<EditorBrowsableAttribute>(editor.GetType());
-
-            if (browsable == null)
-            {
-                return false;
-            }
-
-            return browsable.State == EditorBrowsableState.Advanced;
-        }
-
-        // <summary>
-        // Looks up the DefaultPropertyAttribute on the given type and returns the default property,
-        // if any.
-        // </summary>
-        // <param name="type">Type to look up</param>
-        // <returns>Default property associated with the specified type, if any.</returns>
-        public static string GetDefaultProperty(Type type) 
-        {
-            if (type == null)
-            {
-                return null;
-            }
-
-            string defaultProperty;
-            if (_defaultPropertyCache.TryGetValue(type, out defaultProperty))
-            {
-                return defaultProperty;
-            }
-
-            DefaultPropertyAttribute dpa = GetAttribute<DefaultPropertyAttribute>(type);
-            defaultProperty = dpa == null ? null : dpa.Name;
-            defaultProperty = defaultProperty == null ? null : defaultProperty.Trim();
-            _defaultPropertyCache[type] = defaultProperty;
-            return defaultProperty;
-        }
-
-        // <summary>
-        // Attempts to look up a custom display name from the DisplayNameAttribute.
-        // Returns null if the attribute is not defined.
-        // </summary>
-        // <param name="property">ModelProperty to examine</param>
-        // <returns>Custom DisplayName for the property, if any.</returns>
-        public static string GetDisplayName(ModelProperty property) 
-        {
-            DisplayNameAttribute displayNameAttribute = GetAttribute<DisplayNameAttribute>(property);
-
-            if (displayNameAttribute == null)
-            {
-                return null;
-            }
-
-            string displayName = displayNameAttribute.DisplayName;
-            if (string.IsNullOrEmpty(displayName))
-            {
-                return null;
-            }
-
-            return displayName;
-        }
-
-        // <summary>
-        // Gets the description associated with the specified ModelProperty
-        // </summary>
-        // <param name="property">ModelProperty to examine</param>
-        // <returns>The description associated with the specified ModelProperty</returns>
-        public static string GetDescription(ModelProperty property) 
-        {
-            DescriptionAttribute description = GetAttribute<DescriptionAttribute>(property);
-
-            if (description == null || string.IsNullOrEmpty(description.Description))
-            {
-                return DescriptionAttribute.Default.Description;
-            }
-
-            return description.Description;
-        }
-
-        // <summary>
-        // Instantiates a TypeConverter from a potential TypeConverterAttribute, if one exists.
-        // </summary>
-        // <param name="item">ModelItem to examine</param>
-        // <returns>Instantiated TypeConverter from a potential TypeConverterAttribute, if one exists,
-        // null otherwise.</returns>
-        public static TypeConverter GetTypeConverter(ModelItem item) 
-        {
-            return InstantiateTypeConverter(GetAttribute<TypeConverterAttribute>(item));
-        }
-
-        // <summary>
-        // Gets the TypeConverter associated with the specified ModelProperty, returning
-        // null when no TypeConverter is found.
-        // </summary>
-        // <param name="property">property to examine</param>
-        // <returns>Associated TypeConverter if one exists, null otherwise.</returns>
-        public static TypeConverter GetTypeConverter(ModelProperty property) 
-        {
-            return property == null ? null : property.Converter;
-        }
-
-        // <summary>
-        // Computes the IsReadOnly flag for the specified set of properties, ORing
-        // results together for sets of properties larger than 1.
-        // </summary>
-        // <param name="properties">Properties to examine</param>
-        // <param name="isMixedValueDelegate">Delegate that evaluates the IsMixedValue flag for
-        // the passed in property values (added as an optimization, since we don't always require
-        // the value and it may be computationally expensive)</param>
-        // <returns>Flag indicating whether the set of properties is read only or not</returns>
-        public static bool IsReadOnly(List<ModelProperty> properties, IsMixedValueEvaluator isMixedValueEvaluator) 
-        {
-            if (properties == null || properties.Count == 0) 
-            {
-                Debug.Fail("ExtensibilityAccessor.IsReadOnly: No properties specified.");
-                return true;
-            }
-
-            Type propertyType = properties[0].PropertyType;
-
-            // ILists are readonly only if value is null
-            if (typeof(IList).IsAssignableFrom(propertyType)) 
-            {
-
-                if (OrReadOnlyValues(properties)) 
-                {
-                    IList list = null;
-                    if (isMixedValueEvaluator != null)
-                    {
-                        list = isMixedValueEvaluator() ? null : (ModelUtilities.GetSafeRawValue(properties[0]) as IList);
-                    }
-                    else
-                    {
-                        Debug.Fail("No delegate to evaluate IsMixedValue specified.");
-                    }
-
-                    if (list == null) 
-                    {
-                        return true;
-                    }
-                }
-
-                return false;
-            }
-
-            // Arrays and ICollections are readonly
-            if (typeof(Array).IsAssignableFrom(propertyType) || typeof(ICollection).IsAssignableFrom(propertyType)) 
-            {
-                return true;
-            }
-
-            // Types that implement ONLY ICollection<> or ONLY IList<> (meaning they
-            // don't also implement ICollection or IList, which we handle above)
-            // are also readonly
-            if (ModelUtilities.ImplementsICollection(propertyType) || ModelUtilities.ImplementsIList(propertyType)) 
-            {
-                return true;
-            }
-
-            // Otherwise, go off of the IsReadOnly value in ModelProperty
-            return OrReadOnlyValues(properties);
-        }
-
-
-        // <summary>
-        // Looks up and returns the BrowsableAttribute on the specified property.
-        // </summary>
-        // <param name="property">ModelProperty to examine</param>
-        // <returns>True, if the property is marked as browsable, false if it is
-        // marked as non-browsable, null if it is unmarked.</returns>
-        public static bool? IsBrowsable(ModelProperty property)
-        {
-            if (property == null)
-            {
-                return false;
-            }
-
-            // Check if the Browsable(true) attribute is explicitly defined.
-            BrowsableAttribute browsable = GetAttribute<BrowsableAttribute>(property);
-
-            // If explicit browsable then honor that.
-            if (browsable != null)
-            {
-                return browsable.Browsable;
-            }
-            return null;
-        }
-
-        // <summary>
-        // Gets the PropertyOrder token associated with the given ModelProperty
-        // </summary>
-        // <param name="property">ModelProperty to examine</param>
-        // <returns>Associated PropertyOrder token if one exists, null otherwise.</returns>
-        public static PropertyOrder GetPropertyOrder(ModelProperty property) 
-        {
-            if (property == null)
-            {
-                return null;
-            }
-
-            PropertyOrderAttribute attr = GetAttribute<PropertyOrderAttribute>(property);
-            if (attr == null)
-            {
-                return null;
-            }
-
-            return attr.Order;
-        }
-
-        // <summary>
-        // Returns the list of NewItemTypesAttributes that are associated with the
-        // specified ModelProperty.  Note that we should never be returning attributes
-        // from any of the public methods of ExtensibilityAccessor.  The only reason
-        // why we do so here is to pass them to a Blend API that requires it.  However,
-        // this is a design flaw and we should not follow suite elsewhere.
-        // This method is guaranteed not to return null.
-        // </summary>
-        // <param name="modelProperty">ModelProperty instance to look up</param>
-        // <returns>List of NewItemTypesSttributes associated with the given ModelProperty.</returns>
-        public static List<NewItemTypesAttribute> GetNewItemTypesAttributes(ModelProperty property) 
-        {
-
-            List<NewItemTypesAttribute> newItemTypesList = new List<NewItemTypesAttribute>();
-
-            foreach (NewItemTypesAttribute newItemTypesAttribute in GetAttributes<NewItemTypesAttribute>(property)) 
-            {
-
-                // if there is no custom ItemFactory defined
-                if (newItemTypesAttribute.FactoryType == typeof(NewItemFactory)) 
-                {
-                    foreach (Type type in newItemTypesAttribute.Types) 
-                    {
-                        //Check if the type "IsConcreteWithDefaultCtor"
-                        if (EditorUtilities.IsConcreteWithDefaultCtor(type)) 
-                        {
-                            newItemTypesList.Add(new NewItemTypesAttribute(type));
-                        }
-                    }
-                }
-                else 
-                {
-                    newItemTypesList.Add(newItemTypesAttribute);
-                }
-            }
-            return newItemTypesList;
-        }
-
-        // <summary>
-        // Examines the specified ModelProperty for NewItemTypesAttributes and, if found, returns
-        // an enumerable of all NewItemFactoryTypeModels specified through them.
-        // </summary>
-        // <param name="modelProperty">ModelProperty instance to look up</param>
-        // <returns>Returns an enumerable of all NewItemFactoryTypeModels specified through custom
-        // NewItemFactoryTypeModels, if any.</returns>
-        public static IEnumerable<NewItemFactoryTypeModel> GetNewItemFactoryTypeModels(ModelProperty modelProperty, Size desiredIconSize) 
-        {
-            List<NewItemTypesAttribute> attributes = GetNewItemTypesAttributes(modelProperty);
-            if (attributes == null)
-            {
-                yield break;
-            }
-
-            foreach (NewItemTypesAttribute attribute in attributes) 
-            {
-                NewItemFactory factory = (NewItemFactory)Activator.CreateInstance(attribute.FactoryType);
-
-                foreach (Type type in attribute.Types) 
-                {
-
-                    NewItemFactoryTypeModel model = null;
-
-                    if (attribute.FactoryType == typeof(NewItemFactory)) 
-                    {
-                        if (EditorUtilities.IsConcreteWithDefaultCtor(type)) 
-                        {
-                            model = new NewItemFactoryTypeModel(type, factory, MessageLogger.Instance);
-                        }
-                    }
-                    else 
-                    {
-                        model = new NewItemFactoryTypeModel(type, factory, MessageLogger.Instance);
-                    }
-
-                    if (model != null) 
-                    {
-                        model.DesiredSize = desiredIconSize;
-                        yield return model;
-                    }
-                }
-            }
-        }
-
-        // <summary>
-        // Gets all relevant sub-properties from the given ModelItem
-        // </summary>
-        // <param name="item">Item to examine</param>
-        // <returns>Sub-properties exposed by the given ModelItem</returns>
-        public static List<ModelProperty> GetSubProperties(ModelItem item) 
-        {
-            if (item == null)
-            {
-                return null;
-            }
-
-            // First, see if there is a custom TypeConverter.  If so, get the subProperties
-            // from there.  Otherwise, get all subProperties including those that aren't browsable,
-            // since the Browsability call should be made by the UI, not by the model.
-            return GetTypeConverterSubProperties(item) ?? GetAllSubProperties(item);
-        }
-
-        // <summary>
-        // Gets all relevant sub-properties from the value of the specified
-        // ModelProperty
-        // </summary>
-        // <param name="property">ModelProperty to examine</param>
-        // <returns>Sub-properties exposed by the value of the specified ModelProperty</returns>
-        public static List<ModelProperty> GetSubProperties(ModelProperty property) 
-        {
-            if (property.Value == null || ModelUtilities.GetSafeRawValue(property) == null)
-            {
-                return null;
-            }
-
-            // First, see if there is a custom TypeConverter.  If so, get the subProperties
-            // from there.  Otherwise, get all subProperties including those that aren't browsable,
-            // since the Browsability call should be made by the UI, not by the model.
-            return GetTypeConverterSubProperties(property) ?? GetAllSubProperties(property);
-        }
-
-        // <summary>
-        // try / catch wrapper artound Activator.CreateInstance()
-        // </summary>
-        // <param name="type">Type to instantiate</param>
-        // <returns>Instantiated object or null on error</returns>
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
-        public static object SafeCreateInstance(Type type) 
-        {
-            try 
-            {
-                return Activator.CreateInstance(type);
-            }
-            catch 
-            {
-                // ignore errors...
-            }
-
-            return null;
-        }
-
-        // <summary>
-        // Returns the property source based on the following heuristic (in line with
-        // Blend's behavior):
-        //
-        // Xaml                                    Source
-        // -------------------------------------------------------------------
-        // "123"                                   Local
-        // "{Binding}"                             DataBound
-        // not specified (default value)           Default
-        // not specified (inherited value)         Inherited
-        // not specified (from style)              Inherited
-        // "{DynamicResource ...}"                 LocalDynamicResource
-        // "{StaticResource ...}"                  LocalStaticResource
-        // "{x:Static ...}"                        SystemResource
-        // "{TemplateBinding ...}"                 TemplateBinding
-        // "{CustomMarkup ...}"                    CustomMarkupExtension
-        //
-        // </summary>
-        // <param name="property">Property to examine</param>
-        // <returns>Source of the specified property, if any</returns>
-        public static PropertyValueSource GetPropertySource(ModelProperty property) 
-        {
-            if (property == null)
-            {
-                return null;
-            }
-
-            ModelItem valueItem = property.Value;
-            PropertyValueSource source = null;
-
-            // Binding or any other known markup extension?
-            if (valueItem != null) 
-            {
-                Type valueType = valueItem.ItemType;
-
-                if (IsStaticExtension(valueType))
-                {
-                    source = DependencyPropertyValueSource.SystemResource;
-                }
-                else if (typeof(StaticResourceExtension).IsAssignableFrom(valueType))
-                {
-                    source = DependencyPropertyValueSource.LocalStaticResource;
-                }
-                else if (typeof(DynamicResourceExtension).IsAssignableFrom(valueType))
-                {
-                    source = DependencyPropertyValueSource.LocalDynamicResource;
-                }
-                else if (typeof(TemplateBindingExtension).IsAssignableFrom(valueType))
-                {
-                    source = DependencyPropertyValueSource.TemplateBinding;
-                }
-                else if (typeof(Binding).IsAssignableFrom(valueType))
-                {
-                    source = DependencyPropertyValueSource.DataBound;
-                }
-                else if (typeof(MarkupExtension).IsAssignableFrom(valueType))
-                {
-                    source = DependencyPropertyValueSource.CustomMarkupExtension;
-                }
-            }
-
-            // If not, is this a local, inherited, or default value?
-            if (source == null) 
-            {
-
-                if (property.IsSet)
-                {
-                    source = DependencyPropertyValueSource.Local;
-                }
-                else 
-                {
-
-                    object value = property.ComputedValue;
-
-                    if (object.Equals(value, property.DefaultValue))
-                    {
-                        source = DependencyPropertyValueSource.DefaultValue;
-                    }
-                    else if (valueItem != null && valueItem.Source != property)
-                    {
-                        source = DependencyPropertyValueSource.Inherited;
-                    }
-                }
-            }
-
-            return source;
-        }
-
-        // Helper method that ORs the ModelProperty.IsReadOnly values together and 
-        // returns the result
-        private static bool OrReadOnlyValues(List<ModelProperty> properties) 
-        {
-            if (properties == null) 
-            {
-                return true;
-            }
-
-            for (int i = 0; i < properties.Count; i++) 
-            {
-                if (properties[i].IsReadOnly)
-                {
-                    return true;
-                }
-            }
-
-            return false;
-        }
-       
-        // Helper method to find if the propertyvalueeditor is reusable for the 
-        // given properties collection.
-        public static bool IsEditorReusable(IEnumerable<ModelProperty> properties)
-        {
-            if (properties == null)
-            {
-                return true;
-            }
-
-            foreach (ModelProperty property in properties)
-            {
-                // even if one property says the editor is not reusable, then 
-                // the editor is not reusable for this whole list.
-                if (!ExtensibilityMetadataHelper.IsEditorReusable(property.Attributes))
-                {
-                    return false;
-                }
-            }
-            return true;
-        }
-
-        // Hack to deal with {x:Static ...} extensions.  The Cider Markup code currently
-        // replaces all StaticExtensions with internal versions of the same class.
-        // Once bug 100647 is fixed this code can go away.
-        private static bool IsStaticExtension(Type type) 
-        {
-            return type != null && (
-                typeof(StaticExtension).IsAssignableFrom(type) ||
-                string.Equals("System.Activities.Presentation.Internal.Xaml.Builtins.StaticExtension", type.FullName));
-        }
-
-        // Gets all subProperties from the TypeConverter, if one is explicitely specified
-        private static List<ModelProperty> GetTypeConverterSubProperties(ModelItem item) 
-        {
-            return GetTypeConverterSubPropertiesHelper(item, null);
-        }
-
-        // Gets all subProperties from the TypeConverter, if one is explicitely specified
-        private static List<ModelProperty> GetTypeConverterSubProperties(ModelProperty property) 
-        {
-            TypeConverter propertySpecificConverter = property.Converter;
-            return GetTypeConverterSubPropertiesHelper(property.Value, propertySpecificConverter);
-        }
-
-        private static List<ModelProperty> GetTypeConverterSubPropertiesHelper(ModelItem item, TypeConverter customConverter) 
-        {
-
-            if (item == null)
-            {
-                return null;
-            }
-
-            List<ModelProperty> subProperties = null;
-
-            TypeConverter converter = customConverter;
-
-            if (converter == null) 
-            {
-                // See if there is a converter associated with the item type itself
-                converter = ExtensibilityAccessor.GetTypeConverter(item);
-            }
-
-            if (converter != null) 
-            {
-                PropertyDescriptorCollection subPropertyDescriptors =
-                    converter.GetProperties(item.GetCurrentValue());
-
-                if (subPropertyDescriptors != null && subPropertyDescriptors.Count > 0) 
-                {
-
-                    foreach (PropertyDescriptor subPropertyDescriptor in subPropertyDescriptors) 
-                    {
-
-                        ModelProperty subProperty = item.Properties[subPropertyDescriptor.Name];
-
-                        // We want to expose all properties through the model regardless of whether they
-                        // are browsable or not.  That distinction should be made by the UI utilizing it
-                        if (subProperty != null) 
-                        {
-
-                            if (subProperties == null)
-                            {
-                                subProperties = new List<ModelProperty>();
-                            }
-
-                            subProperties.Add(subProperty);
-                        }
-                    }
-                }
-            }
-            return subProperties;
-        }
-
-        // Gets all subProperties that exist
-        private static List<ModelProperty> GetAllSubProperties(ModelItem item) 
-        {
-
-            if (item == null)
-            {
-                return null;
-            }
-
-            ModelPropertyCollection subModelProperties = item.Properties;
-            if (subModelProperties == null)
-            {
-                return null;
-            }
-
-            List<ModelProperty> subProperties = null;
-
-            // We want to expose all properties through the model regardless of whether they
-            // are browsable or not.  That distinction should be made by the UI utilizing it
-            foreach (ModelProperty subModelProperty in subModelProperties) 
-            {
-
-                if (subProperties == null)
-                {
-                    subProperties = new List<ModelProperty>();
-                }
-
-                subProperties.Add(subModelProperty);
-            }
-
-            return subProperties;
-        }
-
-        // Gets all subProperties that exist
-        private static List<ModelProperty> GetAllSubProperties(ModelProperty property) 
-        {
-            return GetAllSubProperties(property.Value);
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Propagating the error might cause VS to crash")]
-        [SuppressMessage("Reliability", "Reliability108", Justification = "Propagating the error might cause VS to crash")]
-        private static TypeConverter InstantiateTypeConverter(TypeConverterAttribute typeConverterAttribute) 
-        {
-            if (typeConverterAttribute == null)
-            {
-                return null;
-            }
-
-            try 
-            {
-                Type typeConverterType = Type.GetType(typeConverterAttribute.ConverterTypeName);
-                if (typeConverterType != null) 
-                {
-                    return (TypeConverter)Activator.CreateInstance(typeConverterType);
-                }
-            }
-            catch (Exception) 
-            {
-                // Ignore failures.  In the future, log these somewhere for 3rd parties to see and debug.
-            }
-
-            return null;
-        }
-    
-        // GetAttributes() and GetAttribute<T>()
-
-        public static T GetAttribute<T>(ModelProperty property) where T : Attribute 
-        {
-            return GetAttribute<T>(property == null ? null : property.Attributes);
-        }
-
-        public static T GetAttribute<T>(ModelItem item) where T : Attribute 
-        {
-            return GetAttribute<T>(item == null ? null : item.Attributes);
-        }
-
-        public static T GetAttribute<T>(Type type) where T : Attribute 
-        {
-            return GetAttribute<T>(type == null ? null : TypeDescriptor.GetAttributes(type));
-        }
-
-        public static IEnumerable<T> GetAttributes<T>(ModelProperty property) where T : Attribute 
-        {
-            return GetAttributes<T>(property == null ? null : property.Attributes);
-        }
-
-        public static IEnumerable<T> GetAttributes<T>(Type type) where T : Attribute 
-        {
-            return GetAttributes<T>(type == null ? null : TypeDescriptor.GetAttributes(type));
-        }
-
-        // Note: Calling AttributeCollection[typeof(MyAttribute)] creates a default attribute if 
-        // the specified attribute is not found.  That's generally not what we want.
-        public static T GetAttribute<T>(AttributeCollection attributes) where T : Attribute 
-        {
-            T foundAttribute = null;
-            if (attributes != null) 
-            {
-                foreach (Attribute attribute in attributes) 
-                {
-                    if (typeof(T).IsAssignableFrom(attribute.GetType()))
-                    {
-                        foundAttribute = attribute as T;
-                    }
-                }
-            }
-
-            return foundAttribute;
-        }
-
-        // Note: Calling AttributeCollection[typeof(MyAttribute)] creates a default attribute if 
-        // the specified attribute is not found.  That's generally not what we want.
-        private static IEnumerable<T> GetAttributes<T>(AttributeCollection attributes) where T : Attribute 
-        {
-            if (attributes != null) 
-            {
-                foreach (Attribute attribute in attributes) 
-                {
-                    if (typeof(T).IsAssignableFrom(attribute.GetType()))
-                    {
-                        yield return (T)attribute;
-                    }
-                }
-            }
-        }
-
-        // <summary>
-        // Delegate intended to wrap logic that evaluates the IsMixedValue flag of
-        // some property or set of properties.
-        // </summary>
-        // <returns>True if values are mixed, false otherwise</returns>
-        public delegate bool IsMixedValueEvaluator();
-
-        // 
-        private class MessageLogger : IMessageLogger 
-        {
-
-            private static MessageLogger _instance = new MessageLogger();
-
-            public static MessageLogger Instance 
-            { get { return _instance; } }
-
-            public void Clear() 
-            {
-            }
-
-            public void Write(string text) 
-            {
-                Debug.Write(text);
-            }
-
-            public void WriteLine(string text) 
-            {
-                Debug.WriteLine(text);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Diagnostics/AutomationId.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Diagnostics/AutomationId.cs
deleted file mode 100644 (file)
index e19604f..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-
-//Cider comment
-//  This is used by PropertInspector\CategoryContainer.xaml 
-//  For example automation:AutomationElement.Id="CategoryCheckBox"
-//  I'm not sure that this is actually necessary 
-//  But by including this we minimize the changes to CategoryContainer.xaml
-
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Diagnostics
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Diagnostics.Automation
-{
-    using System;
-    using System.Windows;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // This DP is intended to be used in XAML property binding scenarios since FrameworkElement.Name is no longer available.
-    // </summary>
-    internal static class AutomationElement
-    {
-        public static readonly DependencyProperty IdProperty = DependencyProperty.RegisterAttached("Id", typeof(string), typeof(AutomationElement));
-
-        public static string GetId(DependencyObject o)
-        {
-            if (o == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("o");
-            }
-
-            return (string)o.GetValue(AutomationElement.IdProperty);
-        }
-
-        public static void SetId(DependencyObject o, string val)
-        {
-            if (o == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("o");
-            }
-
-            o.SetValue(AutomationElement.IdProperty, val);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Controls/WorkaroundPopup.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Controls/WorkaroundPopup.cs
deleted file mode 100644 (file)
index 0b4cf1b..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Controls
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Controls
-{
-    using System;
-    using System.Windows;
-    using System.Windows.Input;
-    using System.Windows.Controls.Primitives;
-    using System.Windows.Media;
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.UserInterface;
-
-    // <summary>
-    // This class contains specific behavior for the Popup associated with PropertyContainer.
-    // Basically, it is a workaround for Windows OS bug #1745919.  The "StaysOpen = false" setting
-    // on a Popup does not function as we expect when the Popup is created within another
-    // "StaysOpen = false" popup (or if anything has capture).  What happens is the Popup first
-    // checks if anything has capture, and only takes capture if nothing else has taken it.  But the
-    // StaysOpen behavior is implemented using the capture, so we lose that.  Also, related to that
-    // the Closed event will not be called, so to workaround both of those issues we essentially
-    // re-implement the popup capture grabbing code, except we take capture no matter what.
-    // </summary>
-    internal class WorkaroundPopup : Popup
-    {
-        private bool releasingCapture = false;
-
-        protected override void OnOpened(EventArgs e)
-        {
-            this.releasingCapture = false;
-
-            if (this.Child != null)
-            {
-                this.Child.Focusable = true;
-                this.Child.Focus();
-                Mouse.Capture(this.Child, CaptureMode.SubTree);
-            }
-            this.SetValue(FocusScopeManager.FocusScopePriorityProperty, 1);
-            base.OnOpened(e);
-        }
-
-        protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
-        {
-            base.OnGotKeyboardFocus(e);
-        }
-
-        protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e)
-        {
-            base.OnLostKeyboardFocus(e);
-        }
-
-        protected override void OnGotFocus(RoutedEventArgs e)
-        {
-            base.OnGotFocus(e);
-        }
-
-        protected override void OnLostFocus(RoutedEventArgs e)
-        {
-            base.OnLostFocus(e);
-        }
-
-        protected override void OnLostMouseCapture(System.Windows.Input.MouseEventArgs e)
-        {
-            object sender = this;
-            // This code is a stripped down implementation of Popup.OnMouseLostCapture
-            if (!this.releasingCapture && Mouse.Captured != this.Child)
-            {
-                if (e.OriginalSource == this.Child)
-                {
-                    if (Mouse.Captured == null)
-                    {
-                        this.IsOpen = false;
-                    }
-                }
-                else if (this.IsDescendentOfPopup(sender as DependencyObject))
-                {
-                    if (this.IsOpen && Mouse.Captured == null)
-                    {
-                        Mouse.Capture(this.Child, CaptureMode.SubTree);
-                    }
-                }
-                else
-                {
-                    this.IsOpen = false;
-                }
-            }
-            base.OnLostMouseCapture(e);
-        }
-
-        protected override void OnPreviewMouseDown(MouseButtonEventArgs e)
-        {
-            // Check if the mouse down occured within the popup, if it did, leave the popup open.  If it didn't, then close
-            // the popup and release capture.
-            if (e.OriginalSource == this.Child && this.Child.InputHitTest(e.GetPosition(this.Child)) == null)
-            {
-                this.IsOpen = false;
-                this.ReleaseChildMouseCapture();
-            }
-            base.OnMouseDown(e);
-        }
-
-        private bool IsDescendentOfPopup(DependencyObject currentObject)
-        {
-            while (currentObject != null)
-            {
-                if (currentObject == this || currentObject == this.Child)
-                {
-                    return true;
-                }
-                currentObject = VisualTreeHelper.GetParent(currentObject);
-            }
-
-            return false;
-        }
-
-        private void ReleaseChildMouseCapture()
-        {
-            if (Mouse.Captured == this.Child)
-            {
-                this.releasingCapture = true;
-                Mouse.Capture(null);
-                this.releasingCapture = false;
-            }
-        }
-
-        protected override void OnKeyDown(KeyEventArgs e)
-        {
-            if (e.Key == Key.Escape)
-            {
-                this.IsOpen = false;
-                this.ReleaseChildMouseCapture();
-            }
-            base.OnKeyDown(e);
-        }
-
-        protected override void OnClosed(EventArgs e)
-        {
-            this.ReleaseChildMouseCapture();
-            base.OnClosed(e);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/AppendSuffixConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/AppendSuffixConverter.cs
deleted file mode 100644 (file)
index fee4863..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Data
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data
-{
-    using System;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Reflection;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-
-    // <summary>
-    // (object-to-string) Takes an object and returns a new string that is the object's ToString()
-    // with the value of the suffix property appended to it.
-    // </summary>
-
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal class AppendSuffixConverter : IValueConverter
-    {
-        // Private Fields
-        private string suffix;
-
-        // Public Properties
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        public string Suffix
-        {
-            get
-            {
-                return this.suffix;
-            }
-            set
-            {
-                this.suffix = value;
-            }
-        }
-
-        // IValueConverter Implementation
-        public object ConvertBack(object o, Type targetType, object value, CultureInfo culture)
-        {
-            Fx.Assert(false, "AppendSuffixConverter do not support inverse transform.");
-            return null;
-        }
-
-        public object Convert(object o, Type targetType, object parameter, CultureInfo culture)
-        {
-            return o.ToString() + this.Suffix;
-        }
-    }
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/BoolToDoubleConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/BoolToDoubleConverter.cs
deleted file mode 100644 (file)
index e5d0133..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Data
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data
-{
-    using System;
-    using System.ComponentModel;
-    using System.Globalization;
-    using System.Reflection;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-
-    // <summary>
-    // Maps a bool to a FontWeight. True becomes Bold, and False is Normal.
-    // </summary>
-
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal class BoolToDoubleConverter : IValueConverter
-    {
-        // Private Fields
-
-        private double trueValue = 0;
-        private double falseValue = 0;
-
-        // Public Properties
-
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        public double TrueValue
-        {
-            get
-            {
-                return this.trueValue;
-            }
-            set
-            {
-                this.trueValue = value;
-            }
-        }
-
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        public double FalseValue
-        {
-            get
-            {
-                return this.falseValue;
-            }
-            set
-            {
-                this.falseValue = value;
-            }
-        }
-
-
-        // IValueConverter Implementation
-
-        public object ConvertBack(object o, Type targetType, object parameter, CultureInfo culture)
-        {
-            Fx.Assert(false, "Never expecting the inverse transform to be called");
-            return null;
-        }
-
-        public object Convert(object o, Type targetType, object parameter, CultureInfo culture)
-        {
-            Fx.Assert(o is bool, "Ensure that transformed element is a boolean");
-
-            if ((bool)o)
-            {
-                return this.trueValue;
-            }
-            else
-            {
-                return this.falseValue;
-            }
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/BoolToVisibilityCollpasedConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/BoolToVisibilityCollpasedConverter.cs
deleted file mode 100644 (file)
index 220d5cf..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Data
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data
-{
-    using System;
-    using System.ComponentModel;
-    using System.Globalization;
-    using System.Reflection;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Diagnostics.CodeAnalysis;
-
-    // <summary>
-    // (bool-to-Visibility) Maps true to Visible and false to Collapsed.
-    // </summary>
-
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal class BoolToVisibilityCollapsedConverter : IValueConverter
-    {
-        bool invertBoolean = false;
-
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        public bool InvertBoolean
-        {
-            get { return this.invertBoolean; }
-            set { this.invertBoolean = value; }
-        }
-
-        // IValueConverter Implementation
-        public object ConvertBack(object o, Type targetType, object parameter, CultureInfo culture)
-        {
-            Visibility visibility = (Visibility)o;
-            return ((visibility == Visibility.Visible) ^ this.invertBoolean);
-        }
-
-        public object Convert(object o, Type targetType, object parameter, CultureInfo culture)
-        {
-            Visibility result = Visibility.Collapsed;
-
-            if (o is Nullable<bool>)
-            {
-                if ((((Nullable<bool>)o).Value) ^ this.invertBoolean)
-                {
-                    result = Visibility.Visible;
-                }
-            }
-            else if (o is bool)
-            {
-                if (((bool)o) ^ this.invertBoolean)
-                {
-                    result = Visibility.Visible;
-                }
-            }
-            return result;
-        }
-    }
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/BoolToVisibilityHiddenConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/BoolToVisibilityHiddenConverter.cs
deleted file mode 100644 (file)
index 7848c21..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Data
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data
-{
-    using System;
-    using System.ComponentModel;
-    using System.Globalization;
-    using System.Reflection;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Diagnostics.CodeAnalysis;
-
-    // <summary>
-    // (bool-to-Visibility) Maps true to Visible and false to Hidden.
-    // </summary>
-
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal class BoolToVisibilityHiddenConverter : IValueConverter
-    {
-        bool invertBoolean = false;
-
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-
-        public bool InvertBoolean
-        {
-            get { return this.invertBoolean; }
-            set { this.invertBoolean = value; }
-        }
-
-        // IValueConverter Implementation
-        public object ConvertBack(object o, Type targetType, object parameter, CultureInfo culture)
-        {
-            Visibility visibility = (Visibility)o;
-            bool result = visibility == Visibility.Visible;
-            if (this.invertBoolean)
-            {
-                result = !result;
-            }
-            return result;
-        }
-
-        public object Convert(object o, Type targetType, object parameter, CultureInfo culture)
-        {
-            bool show = (bool)o;
-            if (this.invertBoolean)
-            {
-                show = !show;
-            }
-            return show ? Visibility.Visible : Visibility.Hidden;
-        }
-    }
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/ComposingConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/ComposingConverter.cs
deleted file mode 100644 (file)
index 955777e..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Data
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data
-{
-    using System;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Globalization;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Diagnostics.CodeAnalysis;
-
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal sealed class ComposingConverter : IValueConverter
-    {
-        private List<IValueConverter> converters = new List<IValueConverter>();
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-
-        public List<IValueConverter> Converters
-        {
-            get { return this.converters; }
-        }
-
-        // IValueConverter Members
-        public object Convert(object o, Type targetType, object parameter, CultureInfo culture)
-        {
-            for (int i = 0; i < this.converters.Count; i++)
-            {
-                o = converters[i].Convert(o, targetType, parameter, culture);
-            }
-            return o;
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            for (int i = this.converters.Count - 1; i >= 0; i--)
-            {
-                value = converters[i].ConvertBack(value, targetType, parameter, culture);
-            }
-            return value;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/DelegateCommand.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/DelegateCommand.cs
deleted file mode 100644 (file)
index fe53396..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Data
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data
-{
-    using System;
-    using System.Windows.Input;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-
-    internal sealed class DelegateCommand : ICommand
-    {
-        private SimpleEventHandler handler;
-        private bool isEnabled = true;
-
-        public DelegateCommand(SimpleEventHandler handler)
-        {
-            this.handler = handler;
-        }
-
-
-        public event EventHandler CanExecuteChanged;
-
-        public bool IsEnabled
-        {
-            get { return this.isEnabled; }
-        }
-        void ICommand.Execute(object arg)
-        {
-            this.handler();
-        }
-
-        bool ICommand.CanExecute(object arg)
-        {
-            return this.IsEnabled;
-        }
-
-        [SuppressMessage(FxCop.Category.Performance, FxCop.Rule.AvoidUncalledPrivateCode, Justification = "This is required by the ICommand interface.")]
-        private void OnCanExecuteChanged()
-        {
-            if (this.CanExecuteChanged != null)
-            {
-                this.CanExecuteChanged(this, EventArgs.Empty);
-            }
-        }
-        public delegate void SimpleEventHandler();
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/EqualsConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/EqualsConverter.cs
deleted file mode 100644 (file)
index 281544e..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Data
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data
-{
-    using System;
-    using System.Globalization;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Activities.Presentation;
-
-    internal class EqualsConverter : DependencyObject, IValueConverter
-    {
-        private object defaultValue = false, matchValue = true;
-
-        // IValueConverter Members
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            if (Object.Equals(value, parameter))
-            {
-                return this.matchValue;
-            }
-            else
-            {
-                return this.defaultValue;
-            }
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new InvalidOperationException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/IntegerToVisibilityConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/IntegerToVisibilityConverter.cs
deleted file mode 100644 (file)
index 2ad6104..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Data
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data
-{
-    using System;
-    using System.Collections;
-    using System.ComponentModel;
-    using System.Globalization;
-    using System.Reflection;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-
-    // <summary>
-    // Maps an Integer to Visilbity. 0 becomes Hidden, non-zero becomes Visible.
-    // </summary>
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal class IntegerToVisibilityConverter : IValueConverter
-    {
-        private Visibility zeroValue = Visibility.Collapsed;
-
-        private Visibility nonzeroValue = Visibility.Visible;
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        public Visibility ZeroValue
-        {
-            get { return this.zeroValue; }
-            set { this.zeroValue = value; }
-        }
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        public Visibility NonzeroValue
-        {
-            get { return this.nonzeroValue; }
-            set { this.nonzeroValue = value; }
-        }
-
-        // IValueConverter Implementation
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            Fx.Assert(false, "Never expecting the inverse transform to be called");
-            return null;
-        }
-
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            Fx.Assert(value is int, "Ensure that transformed value is an integer");
-
-            if ((value is int) && (int)value == 0)
-            {
-                return this.zeroValue;
-            }
-            else
-            {
-                return this.nonzeroValue;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/IsNullConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/IsNullConverter.cs
deleted file mode 100644 (file)
index d51ed1d..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Data
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data
-{
-    using System;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Windows.Data;
-    using System.Diagnostics.CodeAnalysis;
-
-    // <summary>
-    // (nullable-to-bool) Returns true if the value is null, false otherwise.
-    // </summary>
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal class IsNullConverter : IValueConverter
-    {
-        // IValueConverter Members
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            return value == null;
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            Debug.Fail("IsNullConverter can only be used for BindType=OneWay");
-            return null;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/NotConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/NotConverter.cs
deleted file mode 100644 (file)
index d43bc49..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Data
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data
-{
-    using System;
-    using System.ComponentModel;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Globalization;
-    using System.Reflection;
-    using System.Diagnostics.CodeAnalysis;
-
-    // <summary>
-    // Transform bool value using logical not.
-    // </summary>
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal sealed class NotConverter : IValueConverter
-    {
-        // IValueConverter Members
-
-        public object Convert(object o, Type targetType, object parameter, CultureInfo culture)
-        {
-            return !(bool)o;
-        }
-
-        public object ConvertBack(object o, Type targetType, object parameter, CultureInfo culture)
-        {
-            return !ValueConverterUtilities.AssureBool(o, false);
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/NullToBoolConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/NullToBoolConverter.cs
deleted file mode 100644 (file)
index 0f16988..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Data
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data
-{
-    using System;
-    using System.Collections;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Reflection;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-
-    // <summary>
-    // Converts non-null to true, and null to false.
-    // </summary>
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal class NullToBoolConverter : IValueConverter
-    {
-        // IValueConverter Implementation
-
-        public object ConvertBack(object o, Type targetType, object parameter, CultureInfo culture)
-        {
-            Fx.Assert(false, "NullToBoolConverter can only be used for forward conversion.");
-            return null;
-        }
-
-        public object Convert(object o, Type targetType, object parameter, CultureInfo culture)
-        {
-            return o != null;
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/ObservableCollection.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/ObservableCollection.cs
deleted file mode 100644 (file)
index d7a72f6..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Data
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data
-{
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Collections.Specialized;
-    using System.ComponentModel;
-    using System.Windows;
-
-    // <summary>
-    // Workaround for ObservableCollection not supporting IComparers.  The implementation was copied from ObservableCollection.
-    // </summary>
-    // <typeparam name="T"></typeparam>
-    internal sealed class ObservableCollectionWorkaround<T> : ObservableCollection<T>
-    {
-        public ObservableCollectionWorkaround()
-        {
-        }
-
-        public ObservableCollectionWorkaround(List<T> list)
-            : base(list)
-        {
-        }
-
-        public ObservableCollectionWorkaround(ICollection collection)
-        {
-            foreach (T item in collection)
-            {
-                this.Add(item);
-            }
-        }
-
-        public int BinarySearch(T value, IComparer<T> comparer)
-        {
-            return ((List<T>)base.Items).BinarySearch(value, comparer);
-        }
-
-        public void Sort()
-        {
-            ((List<T>)base.Items).Sort();
-            this.OnPropertyChanged(new PropertyChangedEventArgs("Item[]"));
-            this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset, null, -1));
-        }
-
-        public void Sort(IComparer<T> comparer)
-        {
-            ((List<T>)base.Items).Sort(comparer);
-            this.OnPropertyChanged(new PropertyChangedEventArgs("Item[]"));
-            this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset, null, -1));
-        }
-
-        public void Sort(Comparison<T> comparison)
-        {
-            ((List<T>)base.Items).Sort(comparison);
-            this.OnPropertyChanged(new PropertyChangedEventArgs("Item[]"));
-            this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset, null, -1));
-        }
-
-        public void Reverse()
-        {
-            ((List<T>)base.Items).Reverse();
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/SwitchConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/SwitchConverter.cs
deleted file mode 100644 (file)
index 06366ff..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Data
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data
-{
-    using System;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Reflection;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Windows.Markup;
-    using System.Windows.Media;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // Transformer which maps from input values to output values, based on a list of SwitchCase children.
-    // This isn't strictly a C-style 'switch' statement, since cases aren't guaranteed to be unique.
-    // </summary>
-    //
-    [ContentProperty("Cases")]
-    internal class SwitchConverter : DependencyObject, IValueConverter
-    {
-        static readonly DependencyProperty DefaultValueProperty = DependencyProperty.Register("DefaultValue", typeof(object), typeof(SwitchConverter));
-        private List<SwitchCase> cases;
-
-        public SwitchConverter()
-        {
-            this.cases = new List<SwitchCase>();
-        }
-
-        public List<SwitchCase> Cases
-        {
-            get { return this.cases; }
-        }
-
-        public object DefaultValue
-        {
-            get { return this.GetValue(SwitchConverter.DefaultValueProperty); }
-            set { this.SetValue(SwitchConverter.DefaultValueProperty, value); }
-        }
-
-        // IValueConverter implementation
-        public object Convert(object o, Type targetType, object parameter, CultureInfo culture)
-        {
-            foreach (SwitchCase switchCase in this.Cases)
-            {
-                if (object.Equals(switchCase.In, o))
-                {
-                    return switchCase.Out;
-                }
-            }
-
-            return this.DefaultValue;
-        }
-
-        public object ConvertBack(object o, Type targetType, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new InvalidOperationException(ExceptionStringTable.SwitchConverterIsOneWay));
-        }
-
-    }
-
-    // <summary>
-    // Represents a mapping from an input value to an output value.
-    // </summary>
-    internal class SwitchCase : DependencyObject
-    {
-        static readonly DependencyProperty InProperty = DependencyProperty.Register("In", typeof(object), typeof(SwitchCase));
-        static readonly DependencyProperty OutProperty = DependencyProperty.Register("Out", typeof(object), typeof(SwitchCase));
-
-        public SwitchCase()
-        {
-        }
-
-        // Properties
-        public object In
-        {
-            get { return (object)this.GetValue(InProperty); }
-            set { this.SetValue(InProperty, value); }
-        }
-
-        public object Out
-        {
-            get { return this.GetValue(OutProperty); }
-            set { this.SetValue(OutProperty, value); }
-        }
-    }
-
-    // <summary>
-    // Convenience class for getting at a particular type.  Useful for databinding.
-    // Used in XAML as: <TypeReference Type="*typeof(Foo)" />
-    // </summary>
-    internal sealed class TypeReference : DependencyObject
-    {
-        static readonly DependencyProperty TypeProperty = DependencyProperty.Register("Type", typeof(Type), typeof(TypeReference));
-
-        public Type Type
-        {
-            get { return (Type)this.GetValue(TypeProperty); }
-            set { this.SetValue(TypeProperty, value); }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/ValueConverters.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/ValueConverters.cs
deleted file mode 100644 (file)
index af4aa54..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-
-//Cider comment:
-//  - This file had many more converters but we are not using them at present
-//  - And so I removed them. These are the classes I removed
-//    OrientationToCheckStateConverter
-//    DoubleToStringConverter
-//    IntToStringConverter
-//    IntToBoolConverter
-//    BoolToCheckStateConverter
-//    BoolToStringConverter
-//    UIElementToStringConverter
-//    NullToEmptyStringConverter
-//    InverseVisibilityConverter
-//    GridLengthConverter
-//    CollapseIfOneConverter
-//    StringFormatConverter
-
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Data
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data
-{
-    using System;
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Reflection;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Windows.Media;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-
-    internal static class ValueConverterUtilities
-    {
-        // handles the case of nullable bools
-        public static bool AssureBool(object value, bool defaultIfNull)
-        {
-            if (value is bool?)
-            {
-                bool? nbValue = (bool?)value;
-
-                if (nbValue.HasValue)
-                {
-                    return nbValue.Value;
-                }
-                else
-                {
-                    return defaultIfNull;
-                }
-            }
-
-            return (bool)value;
-        }
-    }
-
-
-    // <summary>
-    // Transforms bool (or MixedProperty.Mixed) to a Visibility.
-    // true -> CheckState.Checked
-    // false -> CheckState.Unchecked
-    // MixedProperty.Mixed -> CheckState.Intermediate
-    // </summary>
-
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal sealed class BoolToVisibilityConverter : IValueConverter
-    {
-        // IValueConverter implementation
-        // <summary>
-        // Transform a CheckState into a bool.
-        // </summary>
-        public object ConvertBack(object o, Type targetType, object parameter, CultureInfo culture)
-        {
-            Fx.Assert(o.GetType() == typeof(Visibility), "Object to inverse-transform isn't a CheckState.");
-            Visibility value = (Visibility)o;
-            return value == Visibility.Visible ? true : false;
-        }
-
-        // <summary>
-        // Transform a boolean value (or mixed state) into a CheckState.
-        // </summary>
-        public object Convert(object o, Type targetType, object parameter, CultureInfo culture)
-        {
-            if (o == MixedProperty.Mixed)
-            {
-                return Visibility.Visible;
-            }
-            else
-            {
-                Fx.Assert(o.GetType() == typeof(bool), "Object to transform isn't a bool or mixed state.");
-                bool value = (bool)o;
-                return (object)(value ? Visibility.Visible : Visibility.Collapsed);
-            }
-        }
-    }
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/VisibilityOrConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Data/VisibilityOrConverter.cs
deleted file mode 100644 (file)
index 9bd6d07..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-
-//Cider comment:
-//  - This file also had a VisibilityOrConverter but we are not using it so I removed it
-
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Data
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data
-{
-    using System;
-    using System.Windows.Data;
-    using System.Windows;
-    using System.Globalization;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Activities.Presentation;
-
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal class VisibilityAndConverter : IMultiValueConverter
-    {
-        // IMultiValueConverter Members
-        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-        {
-            foreach (object value in values)
-            {
-                if (!(value is Visibility) || ((Visibility)value) != Visibility.Visible)
-                {
-                    return Visibility.Collapsed;
-                }
-            }
-
-            return Visibility.Visible;
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotImplementedException(ExceptionStringTable.MethodOrOperationIsNotImplemented));
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/ExceptionStringTable.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/ExceptionStringTable.cs
deleted file mode 100644 (file)
index 1bf6a0b..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-
-//Cider comment:
-// - Integration of Expression error messages. The actual resource strings are in Resources.resx
-// - Rather than alter the classes we ported from Blend I created this file to redirect to Resources.resx
-
-
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\ExceptionStringTable.resx
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework
-{
-    internal class ExceptionStringTable
-    {
-        //FXCop compliance
-        private ExceptionStringTable()
-        {
-        }
-
-        internal static string CanOnlySetFocusScopePriorityOnAnElementThatIsAFocusScope
-        { get { return System.Activities.Presentation.Internal.Properties.Resources.FromExpression_CanOnlySetFocusScopePriorityOnAnElementThatIsAFocusScope; } }
-        internal static string CategoryIconLoadFailed
-        { get { return System.Activities.Presentation.Internal.Properties.Resources.FromExpression_CategoryIconLoadFailed; } }
-        internal static string CategoryEditorTypeLoadFailed
-        { get { return System.Activities.Presentation.Internal.Properties.Resources.FromExpression_CategoryEditorTypeLoadFailed; } }
-        internal static string MethodOrOperationIsNotImplemented
-        { get { return System.Activities.Presentation.Internal.Properties.Resources.FromExpression_MethodOrOperationIsNotImplemented; } }
-        internal static string NewItemFactoryIconLoadFailed
-        { get { return System.Activities.Presentation.Internal.Properties.Resources.FromExpression_NewItemFactoryIconLoadFailed; } }
-        internal static string NoConvertBackForValueToIconConverter
-        { get { return System.Activities.Presentation.Internal.Properties.Resources.FromExpression_NoConvertBackForValueToIconConverter; } }
-        internal static string SwitchConverterIsOneWay
-        { get { return System.Activities.Presentation.Internal.Properties.Resources.FromExpression_SwitchConverterIsOneWay; } }
-        internal static string UnexpectedImageSourceType
-        { get { return System.Activities.Presentation.Internal.Properties.Resources.FromExpression_UnexpectedImageSourceType; } }
-        internal static string UnexpectedDrawingType
-        { get { return System.Activities.Presentation.Internal.Properties.Resources.FromExpression_UnexpectedDrawingType; } }
-        internal static string UnexpectedBrushType
-        { get { return System.Activities.Presentation.Internal.Properties.Resources.FromExpression_UnexpectedBrushType; } }
-        internal static string ValueEditorLoadFailed
-        { get { return System.Activities.Presentation.Internal.Properties.Resources.FromExpression_ValueEditorLoadFailed; } }
-    }
-}
-
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/IMessageLogger.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/IMessageLogger.cs
deleted file mode 100644 (file)
index 1a5b538..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework
-{
-    // <summary>
-    // Central location to handle error, warning and informational messages
-    // </summary>
-    internal interface IMessageLogger
-    {
-        void Clear();
-        void Write(string text);
-        void WriteLine(string text);
-    }
-}
-
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/MixedProperty.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/MixedProperty.cs
deleted file mode 100644 (file)
index 0247ecc..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework
-{
-    // <summary>
-    // A singleton used to indicate that several objects have different values for a property.
-    // </summary>
-    internal sealed class MixedProperty
-    {
-        // Used to indicate that a retrieved property value is mixed (akin to UnsetValue.Instance).
-        public static readonly object Mixed = new MixedProperty();
-
-        private MixedProperty()
-        {
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/CategoryBase.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/CategoryBase.cs
deleted file mode 100644 (file)
index acaff49..0000000
+++ /dev/null
@@ -1,317 +0,0 @@
-
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Properties
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector
-{
-    using System.Runtime;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Collections;
-    using System.Windows.Media;
-    using System.Windows;
-    using System.Globalization;
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data;
-    using System.Diagnostics.CodeAnalysis;
-
-    [SuppressMessage(FxCop.Category.Naming, "CA1724:TypeNamesShouldNotMatchNamespaces", 
-        Justification = "Code imported from Cider; keeping changes to a minimum as it impacts xaml files as well")]
-    internal abstract class CategoryBase : CategoryEntry, IEnumerable<PropertyEntry>
-    {
-
-        private static AlphabeticalCategoryEditorComparer alphabeticalCategoryEditorComparer = new AlphabeticalCategoryEditorComparer();
-
-        private bool basicPropertyMatchesFilter = true;
-        private bool advancedPropertyMatchesFilter = true;
-        private ObservableCollectionWorkaround<CategoryEditor> categoryEditors = new ObservableCollectionWorkaround<CategoryEditor>();
-
-        // Track the category editor that is currently providing the icon:
-        private CategoryEditor iconProvider = null;
-        private ImageSource categoryIcon = null;
-
-        [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
-        protected CategoryBase(string name)
-            : base(name)
-        {
-            this.categoryEditors.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(categoryEditors_CollectionChanged);
-            this.InitializeIcons();
-        }
-
-        public override IEnumerable<PropertyEntry> Properties
-        {
-            get
-            {
-                return this;
-            }
-        }
-
-        public abstract ObservableCollection<PropertyEntry> BasicProperties
-        { get; }
-        public abstract ObservableCollection<PropertyEntry> AdvancedProperties
-        { get; }
-
-        public bool BasicPropertyMatchesFilter
-        {
-            get { return this.basicPropertyMatchesFilter; }
-            set
-            {
-                if (this.basicPropertyMatchesFilter != value)
-                {
-                    this.basicPropertyMatchesFilter = value;
-                    this.OnPropertyChanged("BasicPropertyMatchesFilter");
-                }
-            }
-        }
-
-        public bool AdvancedPropertyMatchesFilter
-        {
-            get { return this.advancedPropertyMatchesFilter; }
-            set
-            {
-                if (this.advancedPropertyMatchesFilter != value)
-                {
-                    this.advancedPropertyMatchesFilter = value;
-                    this.OnPropertyChanged("AdvancedPropertyMatchesFilter");
-                }
-            }
-        }
-
-        public virtual IComparable SortOrdering
-        {
-            get { return this.CategoryName; }
-        }
-
-        public ObservableCollection<CategoryEditor> CategoryEditors
-        {
-            get { return categoryEditors; }
-        }
-
-        public ImageSource CategoryIcon
-        {
-            get { return this.categoryIcon; }
-            protected set { this.categoryIcon = value; this.OnPropertyChanged("CategoryIcon"); }
-        }
-
-        // IPropertyFilterTarget Members
-
-        public override PropertyEntry this[string propertyName]
-        {
-            get
-            {
-                foreach (PropertyEntry property in this.Properties)
-                {
-                    if (property.PropertyName == propertyName)
-                    {
-                        return property;
-                    }
-                }
-                return null;
-            }
-        }
-
-        private void categoryEditors_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
-        {
-            this.InitializeIcons();
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Propagating the error might cause VS to crash")]
-        [SuppressMessage("Reliability", "Reliability108", Justification = "Propagating the error might cause VS to crash")]
-        private void InitializeIcons()
-        {
-            if (this.iconProvider == null || !this.categoryEditors.Contains(this.iconProvider))
-            {
-                foreach (CategoryEditor editor in this.categoryEditors)
-                {
-                    ImageSource icon = null;
-
-                    // CategoryEditor.GetImage is user code and could throw:
-                    try
-                    {
-                        // 24,24 is the desired default size for category icons; it may or may not be respected
-                        // by the implementation of GetImage
-                        icon = editor.GetImage(new Size(24, 24)) as ImageSource;
-                    }
-                    catch (Exception exception)
-                    {
-                        this.ReportCategoryException(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.CategoryIconLoadFailed, this.CategoryName, exception.Message));
-                        continue;
-                    }
-
-                    if (icon != null)
-                    {
-                        if (icon is ISupportInitialize)
-                        {
-                            // Attempt to access some property on the image to ensure it has been initialized properly.  Display the error now, instead of later in the artboard.
-                            try
-                            {
-                                double dummyHeight = icon.Height;
-                            }
-                            catch (InvalidOperationException exception)
-                            {
-                                this.ReportCategoryException(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.CategoryIconLoadFailed, this.CategoryName, exception.Message));
-                                continue;
-                            }
-                        }
-                        this.CategoryIcon = icon;
-                        this.iconProvider = editor;
-                        return;
-                    }
-                }
-                this.CategoryIcon = null;
-                this.iconProvider = null;
-            }
-        }
-
-        public virtual void ReportCategoryException(string message)
-        {
-        }
-
-        IEnumerator<PropertyEntry> IEnumerable<PropertyEntry>.GetEnumerator()
-        {
-            return new PropertyEnumerator(this);
-        }
-
-        IEnumerator IEnumerable.GetEnumerator()
-        {
-            return new PropertyEnumerator(this);
-        }
-
-        public void AddCategoryEditor(CategoryEditor categoryEditor)
-        {
-            int insertionIndex = this.categoryEditors.BinarySearch(categoryEditor, CategoryBase.alphabeticalCategoryEditorComparer);
-            if (insertionIndex < 0)
-            {
-                insertionIndex = ~insertionIndex;
-            }
-            this.categoryEditors.Insert(insertionIndex, categoryEditor);
-        }
-
-        public void RemoveCategoryEditor(Type categoryEditor)
-        {
-            for (int i = 0; i < this.CategoryEditors.Count; i++)
-            {
-                if (this.CategoryEditors[i].GetType() == categoryEditor)
-                {
-                    this.CategoryEditors.RemoveAt(i);
-                    return;
-                }
-            }
-        }
-
-        public override void ApplyFilter(PropertyFilter filter)
-        {
-            this.MatchesFilter = filter.Match(this);
-
-            // Now Match all the properties in this category
-            bool newBasicPropertyMatchesFilter = false;
-            bool newAdvancedPropertyMatchesFilter = false;
-
-            foreach (PropertyEntry property in this.BasicProperties)
-            {
-                if (this.DoesPropertyMatchFilter(filter, property))
-                {
-                    newBasicPropertyMatchesFilter = true;
-                }
-            }
-
-            foreach (PropertyEntry property in this.AdvancedProperties)
-            {
-                if (this.DoesPropertyMatchFilter(filter, property))
-                {
-                    newAdvancedPropertyMatchesFilter = true;
-                }
-            }
-
-            this.BasicPropertyMatchesFilter = newBasicPropertyMatchesFilter;
-            this.AdvancedPropertyMatchesFilter = newAdvancedPropertyMatchesFilter;
-
-            this.OnFilterApplied(filter);
-        }
-
-        public override bool MatchesPredicate(PropertyFilterPredicate predicate)
-        {
-            return predicate.Match(this.CategoryName);
-        }
-
-
-        protected virtual bool DoesPropertyMatchFilter(PropertyFilter filter, PropertyEntry property)
-        {
-            property.ApplyFilter(filter);
-            return property.MatchesFilter;
-        }
-
-        private struct PropertyEnumerator : IEnumerator<PropertyEntry>
-        {
-            private CategoryBase category;
-            private IEnumerator<PropertyEntry> current;
-            private bool enumeratingBasic;
-
-            public PropertyEnumerator(CategoryBase category)
-            {
-                this.category = category;
-                this.current = null;
-                this.enumeratingBasic = false;
-                this.Reset();
-            }
-
-            public PropertyEntry Current
-            {
-                get
-                {
-                    return this.current.Current;
-                }
-            }
-
-            object IEnumerator.Current
-            {
-                get { return this.Current; }
-            }
-
-            public bool MoveNext()
-            {
-                if (this.current.MoveNext())
-                {
-                    return true;
-                }
-                else
-                {
-                    if (this.enumeratingBasic)
-                    {
-                        this.enumeratingBasic = false;
-                        this.current = this.category.AdvancedProperties.GetEnumerator();
-                        return this.MoveNext();
-                    }
-                    else
-                    {
-                        return false;
-                    }
-                }
-            }
-
-            public void Reset()
-            {
-                this.current = category.BasicProperties.GetEnumerator();
-                this.enumeratingBasic = true;
-            }
-
-            void IDisposable.Dispose()
-            {
-            }
-        }
-        private class AlphabeticalCategoryEditorComparer : Comparer<CategoryEditor>
-        {
-            public override int Compare(CategoryEditor x, CategoryEditor y)
-            {
-                //return x.GetType().ToString().CompareTo(y.GetType().ToString());
-                //CompareTo uses currentCulture for string comparison
-                return string.Compare(x.GetType().ToString(), y.GetType().ToString(), StringComparison.CurrentCulture);
-            }
-        }
-    }
-}
-
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/CategoryContainer.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/CategoryContainer.xaml.cs
deleted file mode 100644 (file)
index efdb0b6..0000000
+++ /dev/null
@@ -1,629 +0,0 @@
-
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Properties
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector
-{
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Controls.Primitives;
-    using System.Windows.Data;
-    using System.Windows.Media;
-    using System.Diagnostics;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Collections.ObjectModel;
-    using System.ComponentModel;
-    using System.Runtime;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Activities.Presentation;
-
-    //Cider change [CLSCompliant(false)]
-    internal partial class CategoryContainer : ContentControl
-    {
-
-        // This will be set by the property inspector if the category is hosted in a popup.
-        public static readonly DependencyProperty PopupHostProperty = DependencyProperty.RegisterAttached(
-            "PopupHost", typeof(Popup), typeof(CategoryContainer), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits, OnPopupHostChanged));
-
-        public static readonly DependencyProperty CategoryProperty = DependencyProperty.Register(
-            "Category",
-            typeof(CategoryBase),
-            typeof(CategoryContainer),
-            new PropertyMetadata(
-            (CategoryEntry)null,
-            new PropertyChangedCallback(OnCategoryPropertyChanged)));
-
-        public static readonly DependencyProperty ExpandedProperty = DependencyProperty.Register("Expanded", typeof(bool), typeof(CategoryContainer), new FrameworkPropertyMetadata(false, new PropertyChangedCallback(OnExpandedChanged)));
-
-        public static readonly DependencyProperty AdvancedSectionPinnedProperty = DependencyProperty.Register("AdvancedSectionPinned", typeof(bool), typeof(CategoryContainer), new FrameworkPropertyMetadata(false));
-
-        public static readonly DependencyProperty BasicPropertyMatchesFilterProperty = DependencyProperty.Register("BasicPropertyMatchesFilter", typeof(bool), typeof(CategoryContainer), new FrameworkPropertyMetadata(true));
-
-        public static readonly DependencyProperty AdvancedPropertyMatchesFilterProperty = DependencyProperty.Register("AdvancedPropertyMatchesFilter", typeof(bool), typeof(CategoryContainer), new FrameworkPropertyMetadata(true, new PropertyChangedCallback(CategoryContainer.OnAdvancedPropertyMatchesFilterChanged)));
-
-        public static readonly DependencyProperty ShowAdvancedHeaderProperty = DependencyProperty.Register("ShowAdvancedHeader", typeof(bool), typeof(CategoryContainer), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.None, null, new CoerceValueCallback(CategoryContainer.CoerceShowAdvancedHeader)));
-
-        public static readonly DependencyProperty OwningCategoryContainerProperty = DependencyProperty.RegisterAttached("OwningCategoryContainer", typeof(CategoryContainer), typeof(CategoryContainer), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));
-
-
-
-        // Data for managing expanded state based on a filter.
-        private FilterState filterIsEmpty = FilterState.Unknown;
-
-        // garylins 11/15/2006 - This variable has been added to fix bug 29740.  The real fix is to find
-        // a way to update CategoryContainers expansion state when the Category changes.  The bug comes about
-        // because when UpdateFilter is called from the PI, it fires the FilterUpdated event.  At this time
-        // the CategoryContainer is not yet built out, so it hasn't hooked up to listen to the event and hence
-        // never gets it's filter state related variables updated.
-        private bool haveCachedExpanded = false;
-        private bool wasAdvancedPinnedBeforeFilter = false;
-        private bool wasExpandedBeforeFilter = true;
-
-        // used for managing category editors and overflow properties.
-        private ObservableCollection<CategoryEditor> basicCategoryEditors = new ObservableCollection<CategoryEditor>();
-        private ObservableCollection<CategoryEditor> advancedCategoryEditors = new ObservableCollection<CategoryEditor>();
-        private ObservableCollection<PropertyEntry> unconsumedBasicProperties = new ObservableCollection<PropertyEntry>();
-        private ObservableCollection<PropertyEntry> unconsumedAdvancedProperties = new ObservableCollection<PropertyEntry>();
-
-
-
-        public CategoryContainer() : this(true)
-        {
-        }
-
-        public CategoryContainer(bool initializeComponent)
-        {
-            if (initializeComponent)
-            {
-                this.InitializeComponent();
-            }
-
-            SetOwningCategoryContainer(this, this);
-
-            Binding basicMatchesFilterBinding = new Binding("Category.BasicPropertyMatchesFilter");
-            basicMatchesFilterBinding.Source = this;
-            basicMatchesFilterBinding.Mode = BindingMode.OneWay;
-            this.SetBinding(CategoryContainer.BasicPropertyMatchesFilterProperty, basicMatchesFilterBinding);
-
-            Binding advancedMatchesFilterBinding = new Binding("Category.AdvancedPropertyMatchesFilter");
-            advancedMatchesFilterBinding.Source = this;
-            advancedMatchesFilterBinding.Mode = BindingMode.OneWay;
-            this.SetBinding(CategoryContainer.AdvancedPropertyMatchesFilterProperty, advancedMatchesFilterBinding);
-        }
-
-        public ObservableCollection<CategoryEditor> BasicCategoryEditors
-        {
-            get { return this.basicCategoryEditors; }
-        }
-
-        public ObservableCollection<CategoryEditor> AdvancedCategoryEditors
-        {
-            get { return this.advancedCategoryEditors; }
-        }
-
-        public ObservableCollection<PropertyEntry> UnconsumedBasicProperties
-        {
-            get { return this.unconsumedBasicProperties; }
-        }
-
-        public ObservableCollection<PropertyEntry> UnconsumedAdvancedProperties
-        {
-            get { return this.unconsumedAdvancedProperties; }
-        }
-
-        public CategoryBase Category
-        {
-            get { return (CategoryBase)this.GetValue(CategoryContainer.CategoryProperty); }
-            set { this.SetValue(CategoryContainer.CategoryProperty, value); }
-        }
-
-        public bool Expanded
-        {
-            get { return (bool)this.GetValue(CategoryContainer.ExpandedProperty); }
-            set { this.SetValue(CategoryContainer.ExpandedProperty, value); }
-        }
-
-        public bool AdvancedSectionPinned
-        {
-            get { return (bool)this.GetValue(CategoryContainer.AdvancedSectionPinnedProperty); }
-            set { this.SetValue(CategoryContainer.AdvancedSectionPinnedProperty, value); }
-        }
-
-        public bool BasicPropertyMatchesFilter
-        {
-            get { return (bool)this.GetValue(CategoryContainer.BasicPropertyMatchesFilterProperty); }
-            set { this.SetValue(CategoryContainer.BasicPropertyMatchesFilterProperty, value); }
-        }
-
-        public bool AdvancedPropertyMatchesFilter
-        {
-            get { return (bool)this.GetValue(CategoryContainer.AdvancedPropertyMatchesFilterProperty); }
-            set { this.SetValue(CategoryContainer.AdvancedPropertyMatchesFilterProperty, value); }
-        }
-
-        public bool ShowAdvancedHeader
-        {
-            get { return (bool)this.GetValue(CategoryContainer.ShowAdvancedHeaderProperty); }
-            set { this.SetValue(CategoryContainer.ShowAdvancedHeaderProperty, value); }
-        }
-
-
-        // <summary>
-        // Writes the attached property OwningCategoryContainer to the given element.
-        // </summary>
-        // <param name="d">The element to which to write the attached property.</param>
-        // <param name="value">The property value to set</param>
-        public static void SetOwningCategoryContainer(DependencyObject dependencyObject, CategoryContainer value)
-        {
-            if (dependencyObject == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("dependencyObject");
-            }
-            dependencyObject.SetValue(CategoryContainer.OwningCategoryContainerProperty, value);
-        }
-
-        // <summary>
-        // Reads the attached property OwningCategoryContainer from the given element.
-        // </summary>
-        // <param name="d">The element from which to read the attached property.</param>
-        // <returns>The property's value.</returns>
-        public static CategoryContainer GetOwningCategoryContainer(DependencyObject dependencyObject)
-        {
-            if (dependencyObject == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("dependencyObject");
-            }
-            return (CategoryContainer)dependencyObject.GetValue(CategoryContainer.OwningCategoryContainerProperty);
-        }
-
-        public static Popup GetPopupHost(DependencyObject target)
-        {
-            return (Popup)target.GetValue(CategoryContainer.PopupHostProperty);
-        }
-
-        public static void SetPopupHost(DependencyObject target, Popup value)
-        {
-            target.SetValue(CategoryContainer.PopupHostProperty, value);
-        }
-
-        private static void OnPopupHostChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            CategoryContainer categoryEditor = d as CategoryContainer;
-            if (categoryEditor != null)
-            {
-                // If we are hosted in a popup, do not show the advanced category expander, and pin the advanced section.
-                if (e.NewValue != null)
-                {
-                    categoryEditor.AdvancedSectionPinned = true;
-                }
-                else
-                {
-                    categoryEditor.AdvancedSectionPinned = false;
-                }
-            }
-        }
-
-        private static void OnCategoryPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            CategoryContainer theThis = (CategoryContainer)d;
-
-            if (e.NewValue != null)
-            {
-                CategoryBase category = (CategoryBase)e.NewValue;
-                theThis.SetValue(
-                    System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Diagnostics.Automation.AutomationElement.IdProperty,
-                    category.CategoryName + "Category");
-
-
-                CategoryBase oldCategory = (CategoryBase)e.OldValue;
-                if (oldCategory != null)
-                {
-                    oldCategory.FilterApplied -= new EventHandler<PropertyFilterAppliedEventArgs>(theThis.OnFilterApplied);
-
-                    category.CategoryEditors.CollectionChanged -= theThis.CategoryEditors_CollectionChanged;
-                    theThis.basicCategoryEditors.Clear();
-                    theThis.advancedCategoryEditors.Clear();
-
-                    category.BasicProperties.CollectionChanged -= theThis.BasicProperties_CollectionChanged;
-                    category.AdvancedProperties.CollectionChanged -= theThis.AdvancedProperties_CollectionChanged;
-                    theThis.unconsumedBasicProperties.Clear();
-                    theThis.unconsumedAdvancedProperties.Clear();
-                }
-                if (category != null)
-                {
-                    category.FilterApplied += new EventHandler<PropertyFilterAppliedEventArgs>(theThis.OnFilterApplied);
-
-                    theThis.AddCategoryEditors(category.CategoryEditors);
-                    category.CategoryEditors.CollectionChanged += theThis.CategoryEditors_CollectionChanged;
-
-                    foreach (PropertyEntry property in category.BasicProperties)
-                    {
-                        theThis.AddProperty(property, theThis.unconsumedBasicProperties, theThis.Category.BasicProperties, theThis.basicCategoryEditors);
-                    }
-                    foreach (PropertyEntry property in category.AdvancedProperties)
-                    {
-                        theThis.AddProperty(property, theThis.unconsumedAdvancedProperties, theThis.Category.AdvancedProperties, theThis.advancedCategoryEditors);
-                    }
-                    category.BasicProperties.CollectionChanged += theThis.BasicProperties_CollectionChanged;
-                    category.AdvancedProperties.CollectionChanged += theThis.AdvancedProperties_CollectionChanged;
-                }
-                theThis.CoerceValue(CategoryContainer.ShowAdvancedHeaderProperty);
-            }
-        }
-
-        // ###################################################
-        // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - BEGIN
-        // ###################################################
-
-        // This method used to be non-virtual, private
-        protected virtual void AddProperty(PropertyEntry property, ObservableCollection<PropertyEntry> unconsumedProperties, ObservableCollection<PropertyEntry> referenceOrder, ObservableCollection<CategoryEditor> categoryEditors)
-        {
-
-            // ###################################################
-            // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - END
-            // ###################################################
-
-            bool consumed = false;
-
-            foreach (CategoryEditor categoryEditor in categoryEditors)
-            {
-                if (categoryEditor.ConsumesProperty(property))
-                {
-                    consumed = true;
-                }
-            }
-            if (!consumed)
-            {
-                // We need to insert this property in the correct location.  Reference order is sorted and contains all properties in the unconsumed properties collection.
-                Fx.Assert(referenceOrder.Contains(property), "Reference order should contain the property to be added.");
-#if DEBUG
-                foreach (PropertyEntry unconsumedProperty in unconsumedProperties)
-                {
-                    Fx.Assert(referenceOrder.Contains(unconsumedProperty), "Reference order should contain all unconsumed properties.");
-                }
-#endif
-
-                // We'll walk both collections, and advance the insertion index whenever we see an unconsumed property come ahead of the target in the reference order.
-                int referenceIndex = 0;
-                int insertionIndex = 0;
-                while (referenceOrder[referenceIndex] != property && insertionIndex < unconsumedProperties.Count)
-                {
-                    if (unconsumedProperties[insertionIndex] == referenceOrder[referenceIndex])
-                    {
-                        insertionIndex++;
-                    }
-                    referenceIndex++;
-                }
-                unconsumedProperties.Insert(insertionIndex, property);
-            }
-        }
-
-        private void OnFilterApplied(object source, PropertyFilterAppliedEventArgs args)
-        {
-            // If the filter just switched between empty and non-empty
-            if (args.Filter.IsEmpty && this.filterIsEmpty != FilterState.Empty || !args.Filter.IsEmpty && this.filterIsEmpty != FilterState.NotEmpty)
-            {
-                // If the filter is now empty
-                if (args.Filter.IsEmpty)
-                {
-                    if (this.haveCachedExpanded)
-                    {
-                        // Set Pinned and Expanded to what they were before the filter
-                        this.Expanded = this.wasExpandedBeforeFilter;
-                        this.AdvancedSectionPinned = this.wasAdvancedPinnedBeforeFilter;
-                    }
-                }
-                else
-                {
-                    // Cache the Pinned and Expanded state
-                    this.haveCachedExpanded = true;
-                    this.wasExpandedBeforeFilter = this.Expanded;
-                    this.wasAdvancedPinnedBeforeFilter = this.AdvancedSectionPinned;
-                }
-            }
-
-            if (!args.Filter.IsEmpty)
-            {
-                this.Expanded = this.BasicPropertyMatchesFilter || this.AdvancedPropertyMatchesFilter;
-                this.AdvancedSectionPinned = this.AdvancedPropertyMatchesFilter;
-            }
-
-            this.filterIsEmpty = args.Filter.IsEmpty ? FilterState.Empty : FilterState.NotEmpty;
-        }
-
-
-        private static void OnExpandedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            if (CategoryContainerCommands.UpdateCategoryExpansionState.CanExecute(null, d as IInputElement))
-            {
-                CategoryContainerCommands.UpdateCategoryExpansionState.Execute(null, d as IInputElement);
-            }
-        }
-
-        private void OnMinimizeButtonClick(object sender, RoutedEventArgs e)
-        {
-            // dismiss the popup
-            Popup popupHost = CategoryContainer.GetPopupHost(this);
-            Fx.Assert(popupHost != null, "popupHost should not be null");
-            if (popupHost != null)
-            {
-                popupHost.IsOpen = false;
-            }
-        }
-
-        private static void OnAdvancedPropertyMatchesFilterChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            CategoryContainer editor = d as CategoryContainer;
-            if (editor != null)
-            {
-                editor.CoerceValue(CategoryContainer.ShowAdvancedHeaderProperty);
-            }
-        }
-
-        private static object CoerceShowAdvancedHeader(DependencyObject d, object value)
-        {
-            CategoryContainer editor = d as CategoryContainer;
-            if (editor != null)
-            {
-
-                // ###################################################
-                // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - BEGIN
-                // ###################################################
-
-                // Bugfix: this condition used to reference editor.Category.AdvancedProperties.Count instead of
-                // editor.unconsumedAdvancedProperties, which is a bug.
-                if ((editor.unconsumedAdvancedProperties.Count <= 0 && editor.advancedCategoryEditors.Count == 0) || !editor.AdvancedPropertyMatchesFilter)
-
-                // ###################################################
-                // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - END
-                // ###################################################
-
-                {
-                    return false;
-                }
-            }
-
-            return true;
-        }
-
-        protected override void OnInitialized(EventArgs e)
-        {
-            base.OnInitialized(e);
-            this.Loaded += new RoutedEventHandler(CategoryContainer_Loaded);
-        }
-
-        private void CategoryContainer_Loaded(object sender, RoutedEventArgs e)
-        {
-            IPropertyInspector owningPI = PropertyInspectorHelper.GetOwningPropertyInspectorModel(this);
-            if (owningPI != null)
-            {
-                if (CategoryContainer.GetPopupHost(this) == null)
-                {
-                    this.Expanded = owningPI.IsCategoryExpanded(this.Category.CategoryName);
-                }
-            }
-        }
-
-
-        // Category editor management
-        private void AdvancedProperties_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
-        {
-            switch (e.Action)
-            {
-                case System.Collections.Specialized.NotifyCollectionChangedAction.Add:
-                    foreach (PropertyEntry property in e.NewItems)
-                    {
-                        this.AddProperty(property, this.unconsumedAdvancedProperties, this.Category.AdvancedProperties, this.advancedCategoryEditors);
-                    }
-                    break;
-
-                case System.Collections.Specialized.NotifyCollectionChangedAction.Remove:
-                    foreach (PropertyEntry property in e.OldItems)
-                    {
-                        this.unconsumedAdvancedProperties.Remove(property);
-                    }
-                    break;
-
-                default:
-                    Debug.Fail("BasicProperties should not change in a way other than an add or a remove.");
-                    break;
-            }
-
-            this.CoerceValue(CategoryContainer.ShowAdvancedHeaderProperty);
-        }
-
-        private void BasicProperties_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
-        {
-            switch (e.Action)
-            {
-                case System.Collections.Specialized.NotifyCollectionChangedAction.Add:
-                    foreach (PropertyEntry property in e.NewItems)
-                    {
-                        this.AddProperty(property, this.unconsumedBasicProperties, this.Category.BasicProperties, this.basicCategoryEditors);
-                    }
-                    break;
-
-                case System.Collections.Specialized.NotifyCollectionChangedAction.Remove:
-                    foreach (PropertyEntry property in e.OldItems)
-                    {
-                        this.unconsumedBasicProperties.Remove(property);
-                    }
-                    break;
-
-                default:
-                    Debug.Fail("BasicProperties should not change in a way other than an add or a remove.");
-                    break;
-            }
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Propagating the error might cause VS to crash")]
-        [SuppressMessage("Reliability", "Reliability108", Justification = "Propagating the error might cause VS to crash")]
-        private bool IsAdvanced(CategoryEditor editor)
-        {
-            AttributeCollection attributes = null;
-            try
-            {
-                attributes = TypeDescriptor.GetAttributes(editor);
-            }
-            catch (Exception)
-            {
-            }
-            if (attributes != null)
-            {
-                foreach (Attribute attribute in attributes)
-                {
-                    EditorBrowsableAttribute browsable = attribute as EditorBrowsableAttribute;
-                    if (browsable != null)
-                    {
-                        return browsable.State == EditorBrowsableState.Advanced;
-                    }
-                }
-            }
-            return false;
-        }
-
-        private void AddCategoryEditors(IList editors)
-        {
-            foreach (CategoryEditor editor in editors)
-            {
-                if (this.IsAdvanced(editor))
-                {
-                    this.advancedCategoryEditors.Add(editor);
-                    this.UpdateUnconsumedProperties(editor, this.unconsumedAdvancedProperties);
-                }
-                else
-                {
-                    this.basicCategoryEditors.Add(editor);
-                    this.UpdateUnconsumedProperties(editor, this.unconsumedBasicProperties);
-                }
-            }
-        }
-
-        private void UpdateUnconsumedProperties(CategoryEditor newEditor, ObservableCollection<PropertyEntry> unconsumedProperties)
-        {
-            for (int i = unconsumedProperties.Count - 1; i >= 0; i--)
-            {
-                if (newEditor.ConsumesProperty(unconsumedProperties[i]))
-                {
-                    unconsumedProperties.RemoveAt(i);
-                }
-            }
-        }
-
-        // ###################################################
-        // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - BEGIN
-        // ###################################################
-
-        // This change is a result of bug 88870.  Blend has this issue
-        // as well and will need to address it soon.
-
-        // Original code:
-
-        //private void RemoveCategoryEditors(IList editors) {
-        //    foreach (CategoryEditor editor in editors) {
-        //        if (this.IsAdvanced(editor)) {
-        //            this.advancedCategoryEditors.Remove(editor);
-        //        }
-        //        else {
-        //            this.basicCategoryEditors.Remove(editor);
-        //        }
-        //    }
-        //}
-
-        // Updated code:
-
-        private void RemoveCategoryEditors(IList editors)
-        {
-            bool refreshBasicProperties = false;
-            bool refreshAdvancedProperties = false;
-
-            foreach (CategoryEditor editor in editors)
-            {
-                if (this.IsAdvanced(editor))
-                {
-                    this.advancedCategoryEditors.Remove(editor);
-                    refreshAdvancedProperties = true;
-                }
-                else
-                {
-                    this.basicCategoryEditors.Remove(editor);
-                    refreshBasicProperties = true;
-                }
-            }
-
-            if (this.Category != null)
-            {
-                if (refreshBasicProperties)
-                {
-                    RefreshConsumedProperties(this.unconsumedBasicProperties, this.Category.BasicProperties, this.basicCategoryEditors);
-                }
-
-                if (refreshAdvancedProperties)
-                {
-                    RefreshConsumedProperties(this.unconsumedAdvancedProperties, this.Category.AdvancedProperties, this.advancedCategoryEditors);
-                }
-            }
-        }
-
-        private void RefreshConsumedProperties(ObservableCollection<PropertyEntry> unconsumedProperties, ObservableCollection<PropertyEntry> allProperties, ObservableCollection<CategoryEditor> categoryEditors)
-        {
-            if (allProperties == null || unconsumedProperties == null || unconsumedProperties.Count == allProperties.Count)
-            {
-                return;
-            }
-
-            foreach (PropertyEntry property in allProperties)
-            {
-                if (!unconsumedProperties.Contains(property))
-                {
-                    // The following method will only add the specified property to the unconsumed
-                    // list if it isn't already consumed by some existing category editor.
-                    AddProperty(property, unconsumedProperties, allProperties, categoryEditors);
-                }
-            }
-        }
-
-        // #################################################
-        // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - END
-        // #################################################
-
-        private void CategoryEditors_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
-        {
-            // we need to add/remove category editors
-            switch (e.Action)
-            {
-                case System.Collections.Specialized.NotifyCollectionChangedAction.Reset:
-                    this.basicCategoryEditors.Clear();
-                    this.advancedCategoryEditors.Clear();
-                    break;
-
-                case System.Collections.Specialized.NotifyCollectionChangedAction.Add:
-                    this.AddCategoryEditors(e.NewItems);
-                    break;
-
-                case System.Collections.Specialized.NotifyCollectionChangedAction.Remove:
-                    this.RemoveCategoryEditors(e.OldItems);
-                    break;
-
-                case System.Collections.Specialized.NotifyCollectionChangedAction.Replace:
-                    this.RemoveCategoryEditors(e.OldItems);
-                    this.AddCategoryEditors(e.NewItems);
-                    break;
-            }
-        }
-
-        // Constructors
-        private enum FilterState
-        {
-            Unknown,
-            Empty,
-            NotEmpty
-        }
-        // Fields
-    }
-}
-
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/CategoryContainerCommands.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/CategoryContainerCommands.cs
deleted file mode 100644 (file)
index 3897fd5..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Properties
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector
-{
-    using System;
-    using System.Windows;
-    using System.Windows.Input;
-
-
-    // <summary>
-    // Standard commands and command implementations used by PropertyContainer templates
-    // and implemented by property editing hosts
-    // </summary>
-    internal static class CategoryContainerCommands
-    {
-        private static readonly RoutedCommand togglePinAdvancedProperties = new RoutedCommand("TogglePinAdvancedProperties", typeof(CategoryContainerCommands));
-        private static readonly RoutedCommand updateCategoryExpansionState = new RoutedCommand("UpdateCategoryExpansionState", typeof(CategoryContainerCommands));
-
-        // <summary>
-        // standard command to category edit host to togglePinAdvancedProperties
-        // </summary>
-        public static RoutedCommand TogglePinAdvancedProperties
-        {
-            get { return CategoryContainerCommands.togglePinAdvancedProperties; }
-        }
-
-        // <summary>
-        // standard command to property edit host to updateCategoryExpansionState
-        // </summary>
-        public static RoutedCommand UpdateCategoryExpansionState
-        {
-            get { return CategoryContainerCommands.updateCategoryExpansionState; }
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/CategoryLayoutContainer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/CategoryLayoutContainer.cs
deleted file mode 100644 (file)
index af17a18..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Properties
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector
-{
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Windows.Controls;
-    using System.Activities.Presentation.PropertyEditing;
-
-    internal class CategoryLayoutContainer : ItemsControl
-    {
-        public CategoryLayoutContainer()
-        {
-        }
-
-        protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
-        {
-            ContentPresenter contentPresenter = element as ContentPresenter;
-            CategoryEditor categoryEditor = item as CategoryEditor;
-            if (contentPresenter != null && categoryEditor != null)
-            {
-                Binding contentBinding = new Binding("DataContext.Category");
-                contentBinding.RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(CategoryLayoutContainer), 1);
-                contentPresenter.SetBinding(ContentPresenter.ContentProperty, contentBinding);
-                contentPresenter.ContentTemplate = categoryEditor.EditorTemplate;
-            }
-
-            base.PrepareContainerForItemOverride(element, item);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/ExtensibilityMetadataHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/ExtensibilityMetadataHelper.cs
deleted file mode 100644 (file)
index 5b106a8..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Properties
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector
-{
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Collections;
-    using System.Globalization;
-    using System.Runtime;
-    using System.Diagnostics.CodeAnalysis;
-
-    internal static class ExtensibilityMetadataHelper
-    {
-        // <summary>
-        // Returns an instance of the PropertyValueEditor specified in the provided attribute list.
-        // </summary>
-        // <param name="attributes">A list of attributes. If an EditorAttribute is not specified in this collection, will return null.</param>
-        // <param name="exceptionLogger">Interface for exception logging. If null, exceptions will be silently ignored.</param>
-        // <returns></returns>
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Propagating the error might cause VS to crash")]
-        [SuppressMessage("Reliability", "Reliability108", Justification = "Propagating the error might cause VS to crash")]
-        public static PropertyValueEditor GetValueEditor(IEnumerable attributes, IMessageLogger exceptionLogger)
-        {
-            PropertyValueEditor propertyValueEditor = null;
-            if (attributes != null)
-            {
-                foreach (Attribute attribute in attributes)
-                {
-                    EditorAttribute editorAttribute = attribute as EditorAttribute;
-                    if (editorAttribute != null)
-                    {
-                        try
-                        {
-                            Type editorType = Type.GetType(editorAttribute.EditorTypeName);
-                            if (editorType != null && typeof(PropertyValueEditor).IsAssignableFrom(editorType))
-                            {
-                                propertyValueEditor = (PropertyValueEditor)Activator.CreateInstance(editorType);
-                                break;
-                            }
-                        }
-                        catch (Exception e)
-                        {
-                            if (exceptionLogger != null)
-                            {
-                                exceptionLogger.WriteLine(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.ValueEditorLoadFailed, ExtensibilityMetadataHelper.GetExceptionMessage(e)));
-                            }
-                        }
-                    }
-                }
-            }
-            return propertyValueEditor;
-        }
-
-        // <summary>
-        // Returns the type of the editor specified by the provided EditorAttribute.
-        // </summary>
-        // <param name="attribute">EditorAttribute that specifies a CategoryEditor type. If the type specified is not derived from CategoryEditor, or cannot be loaded, will return null.</param>
-        // <param name="exceptionLogger">Interface for exception logging. If null, exceptions will be silently ignored.</param>
-        // <returns></returns>
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Propagating the error might cause VS to crash")]
-        [SuppressMessage("Reliability", "Reliability108", Justification = "Propagating the error might cause VS to crash")]
-        public static Type GetCategoryEditorType(EditorAttribute attribute, IMessageLogger exceptionLogger)
-        {
-            try
-            {
-                Type editorType = Type.GetType(attribute.EditorTypeName);
-                if (editorType != null && typeof(CategoryEditor).IsAssignableFrom(editorType))
-                {
-                    return editorType;
-                }
-            }
-            catch (Exception e)
-            {
-                if (exceptionLogger != null)
-                {
-                    exceptionLogger.WriteLine(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.CategoryEditorTypeLoadFailed, ExtensibilityMetadataHelper.GetExceptionMessage(e)));
-                }
-            }
-            return null;
-        }
-
-        public static string GetExceptionMessage(Exception e)
-        {
-            return (e.InnerException != null) ? e.InnerException.ToString() : e.Message;
-        }
-
-        public static bool IsEditorReusable(IEnumerable attributes)
-        {
-            bool isEditorReusable = true;
-            if (attributes != null)
-            {
-                foreach (Attribute attribute in attributes)
-                {
-                    EditorReuseAttribute editorReuseAttribute = attribute as EditorReuseAttribute;
-                    if (editorReuseAttribute != null)
-                    {
-                        isEditorReusable = editorReuseAttribute.ReuseEditor;
-                        break;
-                    }
-                }
-            }
-            return isEditorReusable;
-        }
-    }
-}
-
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/IPropertyInspector.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/IPropertyInspector.cs
deleted file mode 100644 (file)
index 4ab420d..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Properties
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Windows;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Diagnostics;
-    using System.Activities.Presentation;
-
-    internal interface IPropertyInspector
-    {
-        bool IsCategoryExpanded(string categoryName);
-
-        // <summary>
-        // Calls Update on the current transaction, if one exists within the context
-        // of this PropertyInspector
-        // </summary>
-        void UpdateTransaction();
-    }
-
-    internal class PropertyInspectorHelper
-    {
-        // OwningPropertyInspector Attached, Inherited DP
-        public static readonly DependencyProperty OwningPropertyInspectorModelProperty = DependencyProperty.RegisterAttached("OwningPropertyInspectorModel", typeof(IPropertyInspector), typeof(PropertyInspectorHelper), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));
-        public static readonly DependencyProperty OwningPropertyInspectorElementProperty = DependencyProperty.RegisterAttached("OwningPropertyInspectorElement", typeof(UIElement), typeof(PropertyInspectorHelper), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));
-
-        // <summary>
-        // Writes the attached property OwningPropertyInspector to the given element.
-        // </summary>
-        // <param name="d">The element to which to write the attached property.</param>
-        // <param name="value">The property value to set</param>
-        public static void SetOwningPropertyInspectorModel(DependencyObject dependencyObject, IPropertyInspector value)
-        {
-            if (dependencyObject == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("dependencyObject");
-            }
-            dependencyObject.SetValue(PropertyInspectorHelper.OwningPropertyInspectorModelProperty, value);
-        }
-
-        // <summary>
-        // Reads the attached property OwningPropertyInspector from the given element.
-        // </summary>
-        // <param name="d">The element from which to read the attached property.</param>
-        // <returns>The property's value.</returns>
-        public static IPropertyInspector GetOwningPropertyInspectorModel(DependencyObject dependencyObject)
-        {
-            if (dependencyObject == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("dependencyObject");
-            }
-            return (IPropertyInspector)dependencyObject.GetValue(PropertyInspectorHelper.OwningPropertyInspectorModelProperty);
-        }
-
-        // OwningPropertyInspector Attached, Inherited DP
-
-        // <summary>
-        // Writes the attached property OwningPropertyInspector to the given element.
-        // </summary>
-        // <param name="d">The element to which to write the attached property.</param>
-        // <param name="value">The property value to set</param>
-        public static void SetOwningPropertyInspectorElement(DependencyObject dependencyObject, UIElement value)
-        {
-            if (dependencyObject == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("dependencyObject");
-            }
-            dependencyObject.SetValue(PropertyInspectorHelper.OwningPropertyInspectorElementProperty, value);
-        }
-
-        // <summary>
-        // Reads the attached property OwningPropertyInspector from the given element.
-        // </summary>
-        // <param name="d">The element from which to read the attached property.</param>
-        // <returns>The property's value.</returns>
-        public static UIElement GetOwningPropertyInspectorElement(DependencyObject dependencyObject)
-        {
-            if (dependencyObject == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("dependencyObject");
-            }
-            return (UIElement)dependencyObject.GetValue(PropertyInspectorHelper.OwningPropertyInspectorElementProperty);
-        }
-    }
-}
-
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/NewItemFactoryTypeModel.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/NewItemFactoryTypeModel.cs
deleted file mode 100644 (file)
index 5f6c5d6..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Properties
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector
-{
-    using System;
-    using System.Windows;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.ComponentModel;
-    using System.Windows.Media;
-    using System.Globalization;
-
-    internal class NewItemFactoryTypeModel
-    {
-        private Type type;
-        private NewItemFactory factory;
-        private Size desiredSize;
-        private IMessageLogger exceptionLogger;
-
-        public NewItemFactoryTypeModel(Type type, NewItemFactory factory)
-        {
-            this.type = type;
-            this.factory = factory;
-            this.desiredSize = new Size(0, 0);
-            this.exceptionLogger = null;
-        }
-
-        public NewItemFactoryTypeModel(Type type, NewItemFactory factory, IMessageLogger exceptionLogger) : this(type, factory)
-        {
-            this.exceptionLogger = exceptionLogger;
-        }
-
-        public string DisplayName
-        {
-            get { return this.factory.GetDisplayName(this.type); }
-        }
-
-        public Type Type
-        {
-            get { return this.type; }
-        }
-
-        public object Image
-        {
-            get
-            {
-                object image = this.factory.GetImage(this.type, this.desiredSize);
-                ImageSource imageSource = image as ImageSource;
-                if (imageSource != null && imageSource is ISupportInitialize)
-                {
-                    try
-                    {
-                        double dummyHeight = imageSource.Height;
-                    }
-                    catch (InvalidOperationException exception)
-                    {
-                        this.ReportException(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.NewItemFactoryIconLoadFailed, this.factory.GetType().Name, exception.Message));
-                    }
-                }
-                return image;
-            }
-        }
-
-        public Size DesiredSize
-        {
-            get { return this.desiredSize; }
-            set { this.desiredSize = value; }
-        }
-
-        public NewItemFactory ItemFactory
-        {
-            get { return this.factory; }
-        }
-
-        public object CreateInstance()
-        {
-            return this.factory.CreateInstance(this.type);
-        }
-
-        private void ReportException(string message)
-        {
-            if (this.exceptionLogger != null)
-            {
-                this.exceptionLogger.WriteLine(message);
-            }
-        }
-
-        // <summary>
-        //  Seems like the ComboBoxAutomation peer, calls the object.ToString() to read out
-        //  the item, if the item doesnt have its content set when queried by AutomationClient.
-        //  As a result, when this NewItemFactoryTypeModel,
-        //  is added to the combo-box in a SubPropertyEditor, we need to return the DisplayName
-        //  property in the ToString() implementation so that that the AutomationClient
-        //  reads out the correct value instead of the type of the object.
-        // </summary>
-        // <returns></returns>
-        public override string ToString()
-        {
-            return DisplayName;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/PropertyContainerPopupHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/PropertyContainerPopupHelper.cs
deleted file mode 100644 (file)
index f4591ef..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Properties
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-    using System.Windows;
-    using System.Windows.Controls.Primitives;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Controls;
-
-    // <summary>
-    // Acrylic needs a way of knowing when we begin and end extended edit mode,
-    // so this class fires commands when those two events take place.
-    // </summary>
-    internal class PropertyContainerPopup : WorkaroundPopup
-    {
-        // these events allow Acrylic to implement its workaround for Avalon/MFC interop
-        // focus issues (WinOS bug # 1713206)
-        public static readonly RoutedCommand OnBeginExtendedEdit = new RoutedCommand("OnBeginExtendedEdit", typeof(PropertyContainerPopup));
-        public static readonly RoutedCommand OnEndExtendedEdit = new RoutedCommand("OnEndExtendedEdit", typeof(PropertyContainerPopup));
-
-        public static CustomPopupPlacementCallback RightAlignedPopupPlacement
-        {
-            get { return new CustomPopupPlacementCallback(PropertyContainerPopup.RightAlignedPopupPlacementCallback); }
-        }
-
-        protected override void OnOpened(EventArgs e)
-        {
-            // Fire OnBeginExtendedEdit command (for Acrylic)
-            PropertyContainer owningPropertyContainer = (PropertyContainer)this.GetValue(PropertyContainer.OwningPropertyContainerProperty);
-            PropertyContainerPopup.OnBeginExtendedEdit.Execute(this, owningPropertyContainer);
-
-            base.OnOpened(e);
-        }
-
-        protected override void OnClosed(EventArgs e)
-        {
-            base.OnClosed(e);
-
-            PropertyContainer owningPropertyContainer = (PropertyContainer)this.GetValue(PropertyContainer.OwningPropertyContainerProperty);
-
-            // Revert back to Inline when the popup is dismissed and we haven't already switched
-            // to the pinned mode
-            if (owningPropertyContainer != null && owningPropertyContainer.ActiveEditMode == PropertyContainerEditMode.ExtendedPopup)
-            {
-                DependencyObject potentialDescendant = Mouse.Captured as DependencyObject;
-                if (potentialDescendant != null && owningPropertyContainer.IsAncestorOf(potentialDescendant))
-                {
-                    // v1 38479: This is a mitigation for Windows OS Bug 1965872.
-                    // Here we force any control which has capture to lose it, though
-                    // this situation can occur in other cases (e.g. via extensibility) but this covers the most
-                    // common cases and is a safe fix.
-                    Mouse.Capture(null);
-                }
-
-                owningPropertyContainer.ActiveEditMode = PropertyContainerEditMode.Inline;
-            }
-
-            // Fire OnEndExtendedEdit command (for Acrylic)
-            OnEndExtendedEdit.Execute(this, owningPropertyContainer);
-        }
-
-        public static CustomPopupPlacement[] RightAlignedPopupPlacementCallback(Size popupSize, Size targetSize, Point offset)
-        {
-            return new CustomPopupPlacement[] { new CustomPopupPlacement(new Point(targetSize.Width - popupSize.Width, targetSize.Height), PopupPrimaryAxis.Horizontal) };
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/StandardCategoryLayout.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/StandardCategoryLayout.cs
deleted file mode 100644 (file)
index 00037dc..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Properties
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector
-{
-    using System;
-    using System.Diagnostics;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Activities.Presentation.PropertyEditing;
-
-    internal class StandardCategoryLayout : ItemsControl
-    {
-        public StandardCategoryLayout()
-        {
-        }
-
-        // This override is present to allow us to skip the automatically inserted ContentPresenter that ItemsControl
-        // generates by default.  PrepareContainerForItemOverride sets up the DataContext and PropertyBinding as though
-        // it were contained within a ContentPresenter and had a Template that was <PropertyContainer Property="{Binding}" />.
-        protected override DependencyObject GetContainerForItemOverride()
-        {
-            return new PropertyContainer();
-        }
-
-        protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
-        {
-            PropertyContainer propertyContainer = element as PropertyContainer;
-            if (propertyContainer != null)
-            {
-                propertyContainer.DataContext = item;
-                propertyContainer.SetBinding(PropertyContainer.PropertyEntryProperty, new Binding());
-            }
-
-            base.PrepareContainerForItemOverride(element, item);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Tolerances.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/Tolerances.cs
deleted file mode 100644 (file)
index d741694..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// -------------------------------------------------------------------
-// Description:
-// Provides helper functions handling move and hit detection 
-// tolerances.
-//
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-
-//Cider comment:
-//  - Class has many members that we don't use. 
-//  - I have removed them to avoid FXCop warning and lowering code coverage 
-
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework
-{
-    using System;
-    using System.Windows;
-    using System.Windows.Media.Media3D;
-    internal static class Tolerances
-    {
-        //Cider private static readonly double ZeroThreshold = 2.2204460492503131e-015; 
-        private const double ZeroThreshold = 2.2204460492503131e-015;
-
-        public static bool NearZero(double d)
-        {
-            return Math.Abs(d) < Tolerances.ZeroThreshold;
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/UIThreadDispatcher.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/UIThreadDispatcher.cs
deleted file mode 100644 (file)
index 5b802d8..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework
-{
-    using System;
-    using System.Diagnostics;
-    using System.Windows.Threading;
-    using System.Runtime;
-
-    // <summary>
-    // A class to execute a method on the UI thread. This must be constructed on the UI thread,
-    // usually by calling UIThreadDispatcher.InitializeDispatcher(). Derive from this and
-    // install your own on UIThreadDispatcher if you want to.
-    // </summary>
-    internal class UIThreadDispatcher
-    {
-
-        static UIThreadDispatcher dispatcher;
-        // fields
-        private Dispatcher uiThreadDispatcher;
-
-        // Singleton Management
-
-        public UIThreadDispatcher()
-        {
-            this.uiThreadDispatcher = Dispatcher.CurrentDispatcher;
-        }
-
-        public static UIThreadDispatcher Instance
-        {
-            get
-            {
-                Fx.Assert(dispatcher != null, "Instance getter called before Instance is initialized");
-
-                return dispatcher;
-            }
-            set
-            {
-                dispatcher = value;
-            }
-        }
-
-
-        public static void InitializeInstance()
-        {
-            Instance = new UIThreadDispatcher();
-        }
-
-        public virtual void BeginInvoke(DispatcherPriority priority, Delegate method)
-        {
-            if (!this.uiThreadDispatcher.HasShutdownStarted)
-            {
-                this.uiThreadDispatcher.BeginInvoke(priority, method);
-            }
-        }
-
-        public virtual void BeginInvoke(DispatcherPriority priority, Delegate method, object arg)
-        {
-            if (!this.uiThreadDispatcher.HasShutdownStarted)
-            {
-                this.uiThreadDispatcher.BeginInvoke(priority, method, arg);
-            }
-        }
-
-        public virtual void BeginInvoke(DispatcherPriority priority, Delegate method, object arg, params object[] args)
-        {
-            if (!this.uiThreadDispatcher.HasShutdownStarted)
-            {
-                this.uiThreadDispatcher.BeginInvoke(priority, method, arg, args);
-            }
-        }
-
-        public virtual void Invoke(DispatcherPriority priority, Delegate method)
-        {
-            if (!this.uiThreadDispatcher.HasShutdownStarted)
-            {
-                this.uiThreadDispatcher.Invoke(priority, method);
-            }
-        }
-
-        public virtual void Invoke(DispatcherPriority priority, Delegate method, object arg)
-        {
-            if (!this.uiThreadDispatcher.HasShutdownStarted)
-            {
-                this.uiThreadDispatcher.Invoke(priority, method, arg);
-            }
-        }
-
-        public virtual void Invoke(DispatcherPriority priority, Delegate method, object arg, params object[] args)
-        {
-            if (!this.uiThreadDispatcher.HasShutdownStarted)
-            {
-                this.uiThreadDispatcher.Invoke(priority, method, arg, args);
-            }
-        }
-    }
-}
-
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/UserInterface/FocusScopeManager.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/UserInterface/FocusScopeManager.cs
deleted file mode 100644 (file)
index fad5c22..0000000
+++ /dev/null
@@ -1,448 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\UserInterface
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.UserInterface
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Input;
-    using System.Windows.Controls.Primitives;
-    using System.Windows.Threading;
-    using System.Windows.Media;
-    using System.Runtime;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Activities.Presentation;
-
-    internal delegate void ReturnFocusCallback();
-
-    internal class FocusScopeManager
-    {
-        public static readonly DependencyProperty FocusScopePriorityProperty;
-        public static readonly DependencyProperty AllowedFocusProperty = DependencyProperty.RegisterAttached("AllowedFocus", typeof(bool), typeof(FocusScopeManager), new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.Inherits, new PropertyChangedCallback(FocusScopeManager.AllowedFocusChanged)));
-
-        private static int DefaultFocusScopePriority;
-
-        private static FocusScopeManager instance;
-
-        private bool listContainsDeadReferences = false;
-        private List<WeakReference> scopes = new List<WeakReference>();
-        // Has a value when a managed focus scope has keyboard focus within it. Null otherwise
-        private WeakReference activeManagedFocusScope = null;
-
-        private bool denyNextFocusChange = false;
-        // Only set to true if we are handling a mouse event while we are denyNextFocusChange is true
-        private bool handlingPointerButtonEvent = false;
-
-        ReturnFocusCallback returnFocusCallback;
-
-        [SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")]
-        static FocusScopeManager()
-        {
-            // Must do this explicitly because the default value of the FocusScopePriorityProperty depends on DefaultFocusScopePriority being properly initialized.
-            FocusScopeManager.DefaultFocusScopePriority = Int32.MaxValue;
-            FocusScopeManager.FocusScopePriorityProperty = DependencyProperty.RegisterAttached("FocusScopePriority", typeof(int), typeof(FocusScopeManager), new FrameworkPropertyMetadata(FocusScopeManager.DefaultFocusScopePriority, new PropertyChangedCallback(FocusScopeManager.FocusScopePriorityChanged)));
-            FocusManager.FocusedElementProperty.OverrideMetadata(typeof(FrameworkElement), new PropertyMetadata(null, null, new CoerceValueCallback(FocusScopeManager.FocusManager_CoerceFocusedElement)));
-        }
-
-        private FocusScopeManager()
-        {
-        }
-
-        public static FocusScopeManager Instance
-        {
-            get
-            {
-                if (FocusScopeManager.instance == null)
-                {
-                    FocusScopeManager.instance = new FocusScopeManager();
-                    EventManager.RegisterClassHandler(typeof(Window), Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(FocusScopeManager.HandleGotKeyboardFocusEvent), true);
-                    EventManager.RegisterClassHandler(typeof(Popup), Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(FocusScopeManager.HandleGotKeyboardFocusEvent), true);
-
-                    EventManager.RegisterClassHandler(typeof(Window), Keyboard.PreviewGotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(FocusScopeManager.HandlePreviewGotKeyboardFocus), true);
-                    EventManager.RegisterClassHandler(typeof(Popup), Keyboard.PreviewGotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(FocusScopeManager.HandlePreviewGotKeyboardFocus), true);
-                }
-                return FocusScopeManager.instance;
-            }
-        }
-
-        public static bool HasInstance
-        {
-            get
-            {
-                return FocusScopeManager.instance != null;
-            }
-        }
-
-        // <summary>
-        // Sets the callback that will be called when the FocusScopeManager
-        // wants to return focus from a control that should not have it.
-        // Clients can use this to override the default behavior here which
-        // is to set keyboard focus to null.
-        // </summary>
-        public ReturnFocusCallback ReturnFocusCallback
-        {
-            get { return this.returnFocusCallback; }
-            set
-            {
-                Fx.Assert(this.returnFocusCallback == null, "Cannot set the ReturnFocusCallback more than once per Process");
-                if (this.returnFocusCallback == null)
-                {
-                    this.returnFocusCallback = value;
-                }
-            }
-        }
-
-        private UIElement ActiveManagedFocusScope
-        {
-            get
-            {
-                if (this.activeManagedFocusScope != null && this.activeManagedFocusScope.IsAlive)
-                {
-                    return this.activeManagedFocusScope.Target as UIElement;
-                }
-                return null;
-            }
-            set
-            {
-                if (this.activeManagedFocusScope == null)
-                {
-                    this.activeManagedFocusScope = new WeakReference(value);
-                }
-                else
-                {
-                    this.activeManagedFocusScope.Target = value;
-                }
-            }
-        }
-
-        private bool ShouldDenyFocusChange
-        {
-            get
-            {
-                return this.denyNextFocusChange && !this.handlingPointerButtonEvent;
-            }
-        }
-
-        private static void HandleGotKeyboardFocusEvent(object sender, KeyboardFocusChangedEventArgs e)
-        {
-            SetFocusToFocusScope(e.NewFocus);
-        }
-
-        private static void HandlePreviewGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
-        {
-            if (FocusScopeManager.Instance.ShouldDenyFocusChange)
-            {
-                e.Handled = true;
-                return;
-            }
-
-            DependencyObject newFocusObject = e.NewFocus as DependencyObject;
-            // if there is a newly focused object and it is not allowed focus
-            if (newFocusObject != null && !FocusScopeManager.GetAllowedFocus(newFocusObject))
-            {
-                // Push focus back to the client's desired focus sink and cancel the change
-                // of focus to new focus.
-                FocusScopeManager.Instance.ReturnFocus();
-                e.Handled = true;
-            }
-        }
-
-        public static void SetFocusToFocusScope(IInputElement newFocus)
-        {
-            UIElement newElementFocus = newFocus as UIElement;
-            if (newElementFocus != null)
-            {
-                UIElement focusScope = FocusManager.GetFocusScope(newElementFocus) as UIElement;
-                int priority = FocusScopeManager.GetFocusScopePriority(focusScope);
-                if (priority != FocusScopeManager.DefaultFocusScopePriority)
-                {
-                    FocusScopeManager.Instance.OnScopeKeyboardFocusChanged(focusScope, priority);
-                }
-            }
-        }
-
-        public static void DenyNextFocusChange()
-        {
-            FocusScopeManager.Instance.denyNextFocusChange = true;
-            InputManager.Current.PreNotifyInput += new NotifyInputEventHandler(FocusScopeManager.Instance.InputManager_PreNotifyInput);
-            InputManager.Current.PostNotifyInput += new NotifyInputEventHandler(FocusScopeManager.Instance.InputManager_PostNotifyInput);
-
-            UIThreadDispatcher.Instance.BeginInvoke(DispatcherPriority.Normal, new DispatcherOperationCallback(delegate
-            {
-                // guard against the focus Scope manager going null.
-                if (FocusScopeManager.HasInstance)
-                {
-                    FocusScopeManager.Instance.EndDenyNextFocusChange();
-                }
-                return null;
-            }
-                ), null);
-        }
-
-        private void EndDenyNextFocusChange()
-        {
-            this.denyNextFocusChange = false;
-            this.handlingPointerButtonEvent = false;
-            InputManager.Current.PreNotifyInput -= new NotifyInputEventHandler(this.InputManager_PreNotifyInput);
-            InputManager.Current.PostNotifyInput -= new NotifyInputEventHandler(this.InputManager_PostNotifyInput);
-        }
-
-        private bool IsPointerButtonEventItem(StagingAreaInputItem stagingItem)
-        {
-            return stagingItem != null && (stagingItem.Input as MouseButtonEventArgs != null || stagingItem.Input as StylusButtonEventArgs != null);
-        }
-
-        private void InputManager_PreNotifyInput(object sender, NotifyInputEventArgs e)
-        {
-            if (this.IsPointerButtonEventItem(e.StagingItem))
-            {
-                this.handlingPointerButtonEvent = true;
-            }
-        }
-
-        private void InputManager_PostNotifyInput(object sender, NotifyInputEventArgs e)
-        {
-            if (this.IsPointerButtonEventItem(e.StagingItem))
-            {
-                this.handlingPointerButtonEvent = false;
-            }
-        }
-
-        public static void SetFocusScopePriority(DependencyObject element, int value)
-        {
-            if (element == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("element");
-            }
-            if (!FocusManager.GetIsFocusScope(element))
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException(ExceptionStringTable.CanOnlySetFocusScopePriorityOnAnElementThatIsAFocusScope));
-            }
-            element.SetValue(FocusScopeManager.FocusScopePriorityProperty, value);
-        }
-
-        public static int GetFocusScopePriority(DependencyObject element)
-        {
-            if (element == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("element");
-            }
-            return (int)element.GetValue(FocusScopeManager.FocusScopePriorityProperty);
-        }
-
-        public static void SetAllowedFocus(DependencyObject element, bool value)
-        {
-            if (element == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("element");
-            }
-            element.SetValue(FocusScopeManager.AllowedFocusProperty, value);
-        }
-
-        public static bool GetAllowedFocus(DependencyObject element)
-        {
-            if (element == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("element");
-            }
-            return (bool)element.GetValue(FocusScopeManager.AllowedFocusProperty);
-        }
-
-        private static void FocusScopePriorityChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            FocusScopeManager.Instance.UpdateFocusScopePriorityForElement(d as UIElement, (int)e.OldValue, (int)e.NewValue);
-        }
-
-        private static object FocusManager_CoerceFocusedElement(DependencyObject d, object value)
-        {
-            UIElement scope = d as UIElement;
-            if (scope != null)
-            {
-                return FocusScopeManager.Instance.CoerceFocusedElement(value);
-            }
-            return value;
-        }
-
-        private static void AllowedFocusChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            FrameworkElement element = d as FrameworkElement;
-            if (element != null)
-            {
-                bool newValue = (bool)e.NewValue;
-                FocusScopeManager.Instance.OnAllowedFocusChanged(element, newValue);
-            }
-        }
-
-        private void UpdateFocusScopePriorityForElement(UIElement element, int oldValue, int newValue)
-        {
-            // If we had an index before
-            if (oldValue != FocusScopeManager.DefaultFocusScopePriority)
-            {
-                this.RemoveScope(element);
-            }
-
-            // If we now have an index
-            if (newValue != FocusScopeManager.DefaultFocusScopePriority)
-            {
-                int startIndex = this.FindStartIndexForPriority(newValue);
-                // No ordering within priorities
-                this.InsertScope(startIndex, element);
-            }
-        }
-
-        private object CoerceFocusedElement(object newFocus)
-        {
-            UIElement newFocusElement = newFocus as UIElement;
-            if (newFocusElement != null)
-            {
-                // If we have been told to deny the next focus change then do so
-                if (this.ShouldDenyFocusChange)
-                {
-                    this.EndDenyNextFocusChange();
-                    return DependencyProperty.UnsetValue;
-                }
-
-                // Don't allow logical focus to go to elements that are not focusable.
-                if (newFocus != null && !FocusScopeManager.GetAllowedFocus(newFocusElement))
-                {
-                    return DependencyProperty.UnsetValue;
-                }
-            }
-            return newFocus;
-        }
-
-        private void OnAllowedFocusChanged(FrameworkElement element, bool newValue)
-        {
-            if (newValue == false && element.IsKeyboardFocused)
-            {
-                this.ReturnFocus();
-            }
-        }
-
-        private void OnScopeKeyboardFocusChanged(UIElement focusScope, int priority)
-        {
-            if (focusScope != this.ActiveManagedFocusScope)
-            {
-                // Make sure that the passed focus scope is managed
-
-                int startIndex = this.FindStartIndexForPriority(priority);
-
-                if (!this.IsFocusScopeManaged(focusScope, priority, startIndex))
-                {
-                    return;
-                }
-                for (int curScopeIndex = startIndex; curScopeIndex < this.scopes.Count; curScopeIndex++)
-                {
-                    WeakReference curRef = this.scopes[curScopeIndex];
-                    if (curRef.IsAlive)
-                    {
-                        UIElement curScope = (UIElement)curRef.Target;
-                        if (curScope != focusScope)
-                        {
-                            FocusManager.SetFocusedElement(curScope, null);
-                        }
-                    }
-                    else
-                    {
-                        this.listContainsDeadReferences = true;
-                    }
-                }
-
-                this.CleanUpDeadReferences();
-
-                this.ActiveManagedFocusScope = focusScope;
-            }
-        }
-
-        private bool IsFocusScopeManaged(UIElement focusScope, int priority, int priorityStartIndex)
-        {
-            for (int curScopeIndex = priorityStartIndex; curScopeIndex < this.scopes.Count; curScopeIndex++)
-            {
-                WeakReference curRef = this.scopes[curScopeIndex];
-                if (curRef.IsAlive)
-                {
-                    UIElement curTarget = (UIElement)curRef.Target;
-                    if (FocusScopeManager.GetFocusScopePriority(curTarget) > priority)
-                    {
-                        return false;
-                    }
-                    if (curTarget == focusScope)
-                    {
-                        return true;
-                    }
-                }
-            }
-            return false;
-        }
-
-        private void CleanUpDeadReferences()
-        {
-            if (this.listContainsDeadReferences)
-            {
-                for (int curRefIndex = this.scopes.Count - 1; curRefIndex >= 0; curRefIndex--)
-                {
-                    if (!this.scopes[curRefIndex].IsAlive)
-                    {
-                        this.scopes.RemoveAt(curRefIndex);
-                    }
-                }
-                this.listContainsDeadReferences = false;
-            }
-        }
-
-        private int FindStartIndexForPriority(int priority)
-        {
-            int startIndex = 0;
-            for (; startIndex < this.scopes.Count; startIndex++)
-            {
-                WeakReference curRef = this.scopes[startIndex];
-                if (curRef.IsAlive)
-                {
-                    if (FocusScopeManager.GetFocusScopePriority((UIElement)curRef.Target) >= priority)
-                    {
-                        break;
-                    }
-                }
-                else
-                {
-                    this.listContainsDeadReferences = true;
-                }
-            }
-
-            return startIndex;
-        }
-
-        private void InsertScope(int index, UIElement scope)
-        {
-            this.scopes.Insert(index, new WeakReference(scope));
-        }
-
-        private void RemoveScope(UIElement scope)
-        {
-            for (int curScopeIndex = this.scopes.Count - 1; curScopeIndex >= 0; curScopeIndex--)
-            {
-                WeakReference curRef = this.scopes[curScopeIndex];
-                if (!curRef.IsAlive || curRef.Target == scope)
-                {
-                    this.scopes.RemoveAt(curScopeIndex);
-                }
-            }
-        }
-
-        private void ReturnFocus()
-        {
-            if (this.ReturnFocusCallback != null)
-            {
-                this.ReturnFocusCallback();
-            }
-            else
-            {
-                Keyboard.Focus(null);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/ValueEditors/ChoiceEditor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/ValueEditors/ChoiceEditor.cs
deleted file mode 100644 (file)
index 9299228..0000000
+++ /dev/null
@@ -1,1236 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\ValueEditors
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.ValueEditors
-{
-    using System;
-    using System.Text;
-    using System.Collections;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using System.Windows.Controls.Primitives;
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data;
-    using System.Runtime;
-
-    // <summary>
-    // Determines the view type of the choice editor.
-    // Combo - a combo box
-    // Buttons - a set of radio buttons with icons
-    // ToggleButtons - a set of radio buttons with icons that use the ToggleIcon style, which allows separate active and inactive icons.
-    // Toggle - a single toggle, good for values that have only two choices, like Boolean
-    // </summary>
-    internal enum ChoiceEditorViewType
-    {
-        Combo,
-        Buttons,
-        ToggleButtons,
-        Toggle
-    }
-    // <summary>
-    // A ChoiceEditor selects a single item from a list of choices. Think combobox or set of radio buttons.
-    // </summary>
-    internal class ChoiceEditor : Control, INotifyPropertyChanged, IIconProvider
-    {
-        public static readonly DependencyProperty ValueProperty = DependencyProperty.Register("Value", typeof(object), typeof(ChoiceEditor), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(ChoiceEditor.ValueChanged), null, false, UpdateSourceTrigger.Explicit));
-        public static readonly DependencyProperty ValueIndexProperty = DependencyProperty.Register("ValueIndex", typeof(int), typeof(ChoiceEditor), new FrameworkPropertyMetadata(-1, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(ChoiceEditor.ValueIndexChanged)));
-        public static readonly DependencyProperty ItemsSourceProperty = DependencyProperty.Register("ItemsSource", typeof(IEnumerable), typeof(ChoiceEditor), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.None, new PropertyChangedCallback(ChoiceEditor.ItemsSourceChanged)));
-        public static readonly DependencyProperty ConverterProperty = DependencyProperty.Register("Converter", typeof(TypeConverter), typeof(ChoiceEditor), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.None));
-
-        public static readonly DependencyProperty ViewTypeProperty = DependencyProperty.Register("ViewType", typeof(ChoiceEditorViewType), typeof(ChoiceEditor), new FrameworkPropertyMetadata(ChoiceEditorViewType.Combo, FrameworkPropertyMetadataOptions.AffectsRender));
-        public static readonly DependencyProperty IsEditableProperty = DependencyProperty.Register("IsEditable", typeof(bool), typeof(ChoiceEditor), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.None, new PropertyChangedCallback(ChoiceEditor.IsEditableChanged)));
-        public static readonly DependencyProperty IconResourcePrefixProperty = DependencyProperty.Register("IconResourcePrefix", typeof(string), typeof(ChoiceEditor), new FrameworkPropertyMetadata(null));
-        public static readonly DependencyProperty IconResourceSuffixProperty = DependencyProperty.Register("IconResourceSuffix", typeof(string), typeof(ChoiceEditor), new FrameworkPropertyMetadata("Icon"));
-        public static readonly DependencyProperty IsNinchedProperty = DependencyProperty.Register("IsNinched", typeof(bool), typeof(ChoiceEditor), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.None, new PropertyChangedCallback(ChoiceEditor.IsNinchedChanged)));
-        public static readonly DependencyProperty ShowFullControlProperty = DependencyProperty.Register("ShowFullControl", typeof(bool), typeof(ChoiceEditor), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender, null, new CoerceValueCallback(ChoiceEditor.CoerceShowFullControl)));
-        public static readonly DependencyProperty ItemTemplateProperty = DependencyProperty.Register("ItemTemplate", typeof(DataTemplate), typeof(ChoiceEditor), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, new PropertyChangedCallback(ChoiceEditor.ItemTemplateChanged)));
-        public static readonly DependencyProperty ItemTemplateSelectorProperty = DependencyProperty.Register("ItemTemplateSelector", typeof(DataTemplateSelector), typeof(ChoiceEditor), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, new PropertyChangedCallback(ChoiceEditor.ItemTemplateSelectorChanged)));
-        public static readonly DependencyProperty UseItemTemplateForSelectionProperty = DependencyProperty.Register("UseItemTemplateForSelection", typeof(Nullable<bool>), typeof(ChoiceEditor), new FrameworkPropertyMetadata(null, null, new CoerceValueCallback(ChoiceEditor.CoerceUseItemTemplateForSelection)));
-
-        public static readonly DependencyProperty BorderCornerRadiusProperty = DependencyProperty.Register("BorderCornerRadius", typeof(double), typeof(ChoiceEditor), new FrameworkPropertyMetadata(0d, FrameworkPropertyMetadataOptions.AffectsRender));
-        public static readonly DependencyProperty DropButtonInsetProperty = DependencyProperty.Register("DropButtonInset", typeof(Thickness), typeof(ChoiceEditor), new FrameworkPropertyMetadata(new Thickness(), FrameworkPropertyMetadataOptions.AffectsRender));
-        public static readonly DependencyProperty TextAreaInsetProperty = DependencyProperty.Register("TextAreaInset", typeof(Thickness), typeof(ChoiceEditor), new FrameworkPropertyMetadata(new Thickness(), FrameworkPropertyMetadataOptions.AffectsRender));
-        public static readonly DependencyProperty DropButtonBrushProperty = DependencyProperty.Register("DropButtonBrush", typeof(Brush), typeof(ChoiceEditor), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
-        public static readonly DependencyProperty InnerCornerRadiusProperty = DependencyProperty.Register("InnerCornerRadius", typeof(double), typeof(ChoiceEditor), new FrameworkPropertyMetadata(0d, FrameworkPropertyMetadataOptions.AffectsRender));
-        public static readonly DependencyProperty ButtonIconProperty = DependencyProperty.Register("ButtonIcon", typeof(ImageSource), typeof(ChoiceEditor), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
-        public static readonly DependencyProperty IconWidthProperty = DependencyProperty.Register("IconWidth", typeof(double), typeof(ChoiceEditor), new FrameworkPropertyMetadata(0d, FrameworkPropertyMetadataOptions.AffectsRender));
-        public static readonly DependencyProperty IconHeightProperty = DependencyProperty.Register("IconHeight", typeof(double), typeof(ChoiceEditor), new FrameworkPropertyMetadata(0d, FrameworkPropertyMetadataOptions.AffectsRender));
-
-        public static readonly DependencyProperty BeginCommandProperty = DependencyProperty.Register("BeginCommand", typeof(ICommand), typeof(ChoiceEditor), new PropertyMetadata(null));
-        public static readonly DependencyProperty UpdateCommandProperty = DependencyProperty.Register("UpdateCommand", typeof(ICommand), typeof(ChoiceEditor), new PropertyMetadata(null));
-        public static readonly DependencyProperty CancelCommandProperty = DependencyProperty.Register("CancelCommand", typeof(ICommand), typeof(ChoiceEditor), new PropertyMetadata(null));
-        public static readonly DependencyProperty CommitCommandProperty = DependencyProperty.Register("CommitCommand", typeof(ICommand), typeof(ChoiceEditor), new PropertyMetadata(null));
-        public static readonly DependencyProperty FinishEditingCommandProperty = DependencyProperty.Register("FinishEditingCommand", typeof(ICommand), typeof(ChoiceEditor), new PropertyMetadata(null));
-
-        public static readonly DependencyProperty ComboBoxLoadingCursorProperty = DependencyProperty.Register("ComboBoxLoadingCursor", typeof(Cursor), typeof(ChoiceEditor), new PropertyMetadata(null));
-
-        // WORKAROUND this property is used in combination with a trigger to kick the combobox when it clears its bindings Avalon bug: 1756023
-        public static readonly DependencyProperty ForceBindingProperty = DependencyProperty.Register("ForceBinding", typeof(bool), typeof(ChoiceEditor), new FrameworkPropertyMetadata(false));
-
-
-        // True if the user is editing the text in an editable combo
-        private bool isTextEditing = false;
-        // True if the user is selecting a value (e.g. in a combo when the dropdown is open)
-        private bool isSelectingValue = false;
-
-        // ###################################################
-        // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - BEGIN
-        // ###################################################
-
-        // True if the full editor is being shown
-        private bool isShowingFullEditor = false;
-
-        // ###################################################
-        // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - END
-        // ###################################################
-
-        // Used to lock out internal changes. Do not change this directly. Use Begin/EndIgnoreInternalChangeBlock
-        private int internalChangeLockCount = 0;
-        // Used to not set commit action = lost focus when cancelling an edit
-        private int internalStringValueChangeLockCount = 0;
-        // True if changes to value should be ignored.
-        private bool ignoreValueChanges = false;
-
-        // Action to take when this control looses focus
-        private LostFocusAction lostFocusAction = LostFocusAction.None;
-        // The selected item of the internal selector. Used to determine Value
-        private object internalValue = null;
-        // The string value of the internal selector if it allows text editing
-        private string internalStringValue = String.Empty;
-
-        // A Collection view over the ItemsSource that we have been passed
-        private CollectionView collectionView = null;
-
-        [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
-        public ChoiceEditor()
-        {
-            this.CoerceValue(ChoiceEditor.UseItemTemplateForSelectionProperty);
-        }
-        public event PropertyChangedEventHandler PropertyChanged;
-        // <summary>
-        // The currently selected choice
-        // </summary>
-        public object Value
-        {
-            get { return this.GetValue(ChoiceEditor.ValueProperty); }
-            set { this.SetValue(ChoiceEditor.ValueProperty, value); }
-        }
-
-        // <summary>
-        // The index of the selected choice. -1 if Value is not in the list.
-        // </summary>
-        public int ValueIndex
-        {
-            get { return (int)this.GetValue(ChoiceEditor.ValueIndexProperty); }
-            set { this.SetValue(ChoiceEditor.ValueIndexProperty, value); }
-        }
-
-        // <summary>
-        // The items source used to populate the choice
-        // </summary>
-        public IEnumerable ItemsSource
-        {
-            get { return (IEnumerable)this.GetValue(ChoiceEditor.ItemsSourceProperty); }
-            set { this.SetValue(ChoiceEditor.ItemsSourceProperty, value); }
-        }
-
-        // <summary>
-        // Converter used to convert text values to object values.
-        // </summary>
-        public TypeConverter Converter
-        {
-            get { return (TypeConverter)this.GetValue(ChoiceEditor.ConverterProperty); }
-            set { this.SetValue(ChoiceEditor.ConverterProperty, value); }
-        }
-
-        // <summary>
-        // Sets the view type of this choice. This will change the behavior of the choice.
-        // </summary>
-        public ChoiceEditorViewType ViewType
-        {
-            get { return (ChoiceEditorViewType)this.GetValue(ChoiceEditor.ViewTypeProperty); }
-            set { this.SetValue(ChoiceEditor.ViewTypeProperty, value); }
-        }
-
-        // <summary>
-        // Set to true if this choice editor should be editable. Currently only works for Combo
-        // </summary>
-        public bool IsEditable
-        {
-            get { return (bool)this.GetValue(ChoiceEditor.IsEditableProperty); }
-            set { this.SetValue(ChoiceEditor.IsEditableProperty, value); }
-        }
-
-        // <summary>
-        // The prefix put on all icon resource references before they are looked up
-        // </summary>
-        public string IconResourcePrefix
-        {
-            get { return (string)this.GetValue(ChoiceEditor.IconResourcePrefixProperty); }
-            set { this.SetValue(ChoiceEditor.IconResourcePrefixProperty, value); }
-        }
-
-        // <summary>
-        // The prefix put on all icon resource references before they are looked up
-        // </summary>
-        public string IconResourceSuffix
-        {
-            get { return (string)this.GetValue(ChoiceEditor.IconResourceSuffixProperty); }
-            set { this.SetValue(ChoiceEditor.IconResourceSuffixProperty, value); }
-        }
-
-        // <summary>
-        // True if this value editor is ninched
-        // </summary>
-        public bool IsNinched
-        {
-            get { return (bool)this.GetValue(ChoiceEditor.IsNinchedProperty); }
-            set { this.SetValue(ChoiceEditor.IsNinchedProperty, value); }
-        }
-
-        // <summary>
-        // True to show the full control instead of the optimized drawing of the control
-        // </summary>
-        public bool ShowFullControl
-        {
-            get { return (bool)this.GetValue(ChoiceEditor.ShowFullControlProperty); }
-            set { this.SetValue(ChoiceEditor.ShowFullControlProperty, value); }
-        }
-
-        public DataTemplate ItemTemplate
-        {
-            get { return (DataTemplate)this.GetValue(ChoiceEditor.ItemTemplateProperty); }
-            set { this.SetValue(ChoiceEditor.ItemTemplateProperty, value); }
-        }
-
-        public DataTemplateSelector ItemTemplateSelector
-        {
-            get { return (DataTemplateSelector)this.GetValue(ChoiceEditor.ItemTemplateSelectorProperty); }
-            set { this.SetValue(ChoiceEditor.ItemTemplateSelectorProperty, value); }
-        }
-
-        public bool UseItemTemplateForSelection
-        {
-            get { return (bool)this.GetValue(ChoiceEditor.UseItemTemplateForSelectionProperty); }
-            set { this.SetValue(ChoiceEditor.UseItemTemplateForSelectionProperty, value); }
-        }
-
-        public double BorderCornerRadius
-        {
-            get { return (double)this.GetValue(ChoiceEditor.BorderCornerRadiusProperty); }
-            set { this.SetValue(ChoiceEditor.BorderCornerRadiusProperty, value); }
-        }
-
-        public Thickness DropButtonInset
-        {
-            get { return (Thickness)this.GetValue(ChoiceEditor.DropButtonInsetProperty); }
-            set { this.SetValue(ChoiceEditor.DropButtonInsetProperty, value); }
-        }
-
-        public Thickness TextAreaInset
-        {
-            get { return (Thickness)this.GetValue(ChoiceEditor.TextAreaInsetProperty); }
-            set { this.SetValue(ChoiceEditor.TextAreaInsetProperty, value); }
-        }
-
-        public Brush DropButtonBrush
-        {
-            get { return (Brush)this.GetValue(ChoiceEditor.DropButtonBrushProperty); }
-            set { this.SetValue(ChoiceEditor.DropButtonBrushProperty, value); }
-        }
-
-        public double InnerCornerRadius
-        {
-            get { return (double)this.GetValue(ChoiceEditor.InnerCornerRadiusProperty); }
-            set { this.SetValue(ChoiceEditor.InnerCornerRadiusProperty, value); }
-        }
-
-        public ImageSource ButtonIcon
-        {
-            get { return (ImageSource)this.GetValue(ChoiceEditor.ButtonIconProperty); }
-            set { this.SetValue(ChoiceEditor.ButtonIconProperty, value); }
-        }
-
-        public double IconWidth
-        {
-            get { return (double)this.GetValue(ChoiceEditor.IconWidthProperty); }
-            set { this.SetValue(ChoiceEditor.IconWidthProperty, value); }
-        }
-
-        public double IconHeight
-        {
-            get { return (double)this.GetValue(ChoiceEditor.IconHeightProperty); }
-            set { this.SetValue(ChoiceEditor.IconHeightProperty, value); }
-        }
-
-        // <summary>
-        // Command fired when editing begins
-        // </summary>
-        public ICommand BeginCommand
-        {
-            get { return (ICommand)this.GetValue(ChoiceEditor.BeginCommandProperty); }
-            set { this.SetValue(ChoiceEditor.BeginCommandProperty, value); }
-        }
-
-        // <summary>
-        // Command fired when an edit value is updated. This command will fire after the
-        // binding has been updated.
-        // </summary>
-        public ICommand UpdateCommand
-        {
-            get { return (ICommand)this.GetValue(ChoiceEditor.UpdateCommandProperty); }
-            set { this.SetValue(ChoiceEditor.UpdateCommandProperty, value); }
-        }
-
-        // <summary>
-        // Command fired when an edit is canceled
-        // </summary>
-        public ICommand CancelCommand
-        {
-            get { return (ICommand)this.GetValue(ChoiceEditor.CancelCommandProperty); }
-            set { this.SetValue(ChoiceEditor.CancelCommandProperty, value); }
-        }
-
-        // <summary>
-        // Command fired when an edit is commited
-        // </summary>
-        public ICommand CommitCommand
-        {
-            get { return (ICommand)this.GetValue(ChoiceEditor.CommitCommandProperty); }
-            set { this.SetValue(ChoiceEditor.CommitCommandProperty, value); }
-        }
-
-        // <summary>
-        // Command fired when the editor is done editing.  At this point the host
-        // may decide to move on to the next property in the list, return focus
-        // to the design surface, or perform any other action it pleases to do.
-        // </summary>
-        public ICommand FinishEditingCommand
-        {
-            get { return (ICommand)this.GetValue(ChoiceEditor.FinishEditingCommandProperty); }
-            set { this.SetValue(ChoiceEditor.FinishEditingCommandProperty, value); }
-        }
-
-        // <summary>
-        // True if cursor should be an hourglass when loading a ComboBox popup
-        // </summary>
-        public Cursor ComboBoxLoadingCursor
-        {
-            get { return (Cursor)this.GetValue(ChoiceEditor.ComboBoxLoadingCursorProperty); }
-            set { this.SetValue(ChoiceEditor.ComboBoxLoadingCursorProperty, value); }
-        }
-
-        // <summary>
-        // Command to rotate the selection of the ChoiceEditor to the next possible item
-        // or cycle to the first if at the end of the current view.
-        // </summary>
-        public ICommand NextValueCommand
-        {
-            get
-            {
-                return new DelegateCommand(new DelegateCommand.SimpleEventHandler(SelectNextValue));
-            }
-        }
-
-        // <summary>
-        // Command to rotate the selection of the ChoiceEditor the previously selected
-        // item in the view, or to the last item in the view if at the first item in the view.
-        // </summary>
-        public ICommand PreviousValueCommand
-        {
-            get
-            {
-                return new DelegateCommand(new DelegateCommand.SimpleEventHandler(SelectPreviousValue));
-            }
-        }
-
-        public bool ForceBinding
-        {
-            get { return (bool)this.GetValue(ChoiceEditor.ForceBindingProperty); }
-            set { this.SetValue(ChoiceEditor.ForceBindingProperty, value); }
-        }
-
-        // <summary>
-        // This is the value internal to this control. Controls in the
-        // template of this control should bind to this.
-        // </summary>
-        public object InternalValue
-        {
-            get
-            {
-                return this.internalValue;
-            }
-            set
-            {
-                if (this.internalValue != value)
-                {
-                    this.internalValue = value;
-                    if (this.ShouldCommitInternalValueChanges)
-                    {
-                        if (!this.isTextEditing)
-                        {
-                            this.CommitChange();
-                        }
-                        else
-                        {
-                            this.lostFocusAction = LostFocusAction.Commit;
-                        }
-                    }
-                    this.SendPropertyChanged("InternalValue");
-                }
-            }
-        }
-
-        public string InternalStringValue
-        {
-            get { return this.internalStringValue; }
-            set
-            {
-                if (!String.Equals(value, this.internalStringValue))
-                {
-                    if (this.ShouldCommitInternalStringValueChanges && this.isTextEditing)
-                    {
-                        this.InternalValue = null;
-                        this.lostFocusAction = LostFocusAction.Commit;
-                    }
-                    this.internalStringValue = value;
-                    this.SendPropertyChanged("InternalStringValue");
-                }
-            }
-        }
-
-        public bool InternalIsSelectingValue
-        {
-            get { return this.isSelectingValue; }
-            set
-            {
-                if (this.isSelectingValue != value)
-                {
-                    this.isSelectingValue = value;
-
-                    if (this.isTextEditing && !this.isSelectingValue)
-                    {
-                        //  
-                        //                          * FinishedEditingCommand in Cider does not 
-                        //                          * move focus off of the control (as we do in Sparkle) The fix is to add code to 
-                        //                          * InternalIsSelectingValue when the value goes to false (when the popup is closing) 
-                        //                          * that checks to see if there is a lostFocusAction of Commit and if so calls CommitChange()//                          
-                        LostFocusAction oldAction = this.lostFocusAction;
-                        this.lostFocusAction = LostFocusAction.None;
-                        if (oldAction == LostFocusAction.Commit)
-                        {
-                            this.CommitChange();
-                        }
-                        this.OnFinishEditing();
-                    }
-                    if (this.isSelectingValue && this.CollectionView != null)
-                    {
-                        this.BeginIgnoreExternalValueChangeBlock();
-                        try
-                        {
-                            this.ValueIndex = this.CollectionView.IndexOf(this.Value);
-                        }
-                        finally
-                        {
-                            this.EndIgnoreExternalValueChangeBlock();
-                        }
-                    }
-                    Cursor loadingCursor = this.ComboBoxLoadingCursor;
-                    if (value && this.ViewType == ChoiceEditorViewType.Combo && loadingCursor != null)
-                    {
-                        bool foundPopup = false;
-                        Mouse.OverrideCursor = loadingCursor;
-                        ComboBox comboBox = this.Template.FindName("PART_Combo", this) as ComboBox;
-                        if (comboBox != null)
-                        {
-                            Popup popup = comboBox.Template.FindName("PART_Popup", comboBox) as Popup;
-                            if (popup != null)
-                            {
-                                foundPopup = true;
-                                popup.Opened += new EventHandler(OnPopupLoaded);
-                            }
-                        }
-                        if (!foundPopup)
-                        {
-                            // if we couldn't set up the event handler, just return
-                            // the cursor now so they aren't stuck with an hourglass
-                            Mouse.OverrideCursor = null;
-                        }
-                    }
-                }
-            }
-        }
-
-        // ###################################################
-        // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - BEGIN
-        // ###################################################
-
-        private CollectionView CollectionView
-        {
-            get {
-                if (collectionView == null)
-                {
-                    IEnumerable newItems = this.ItemsSource;
-                    if (newItems != null)
-                    {
-                        this.collectionView = new CollectionView(this.ItemsSource);
-                    }
-                    else
-                    {
-                        this.collectionView = null;
-                    }
-                }
-                return collectionView;
-            }
-        }
-
-        // ###################################################
-        // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - END
-        // ###################################################
-
-        private bool ShouldCommitInternalValueChanges
-        {
-            get { return this.internalChangeLockCount == 0; }
-        }
-
-        private bool ShouldCommitInternalStringValueChanges
-        {
-            get { return this.internalStringValueChangeLockCount == 0; }
-        }
-
-        private bool ShouldIgnoreExternalValueChanges
-        {
-            get { return this.ignoreValueChanges; }
-        }
-
-
-        public void SelectNextValue()
-        {
-            int currentIndex = this.ValueIndex;
-
-            Fx.Assert(this.CollectionView != null, "ChoiceEditor CollectionView cannot be null.");
-            if (currentIndex < 0 || currentIndex >= this.CollectionView.Count - 1)
-            {
-                currentIndex = 0;
-            }
-            else
-            {
-                currentIndex = currentIndex + 1;
-            }
-            this.ValueIndex = currentIndex;
-        }
-
-        public void SelectPreviousValue()
-        {
-            int currentIndex = this.ValueIndex;
-
-            Fx.Assert(this.CollectionView != null, "ChoiceEditor CollectionView cannot be null.");
-            if (currentIndex <= 0 || currentIndex > this.CollectionView.Count - 1)
-            {
-                currentIndex = this.CollectionView.Count - 1;
-            }
-            else
-            {
-                currentIndex = currentIndex - 1;
-            }
-            this.ValueIndex = currentIndex;
-        }
-
-        public ImageSource GetIconAsImageSource(object key, object parameter)
-        {
-            // This is the place to cache icons if these lookups are costing us too much.
-            try
-            {
-                StringBuilder sb = new StringBuilder();
-                string prefix = this.IconResourcePrefix;
-                string suffix = this.IconResourceSuffix;
-                string parameterString = parameter as string;
-
-                if (prefix != null)
-                {
-                    sb.Append(prefix);
-                }
-                sb.Append(key.ToString());
-                if (suffix != null)
-                {
-                    sb.Append(suffix);
-                }
-                if (parameterString != null)
-                {
-                    sb.Append(parameterString);
-                }
-
-                object resource = this.FindResource(sb.ToString());
-                ImageSource resourceImageSource = resource as ImageSource;
-                return resourceImageSource;
-            }
-            catch (ResourceReferenceKeyNotFoundException)
-            {
-                return null;
-            }
-        }
-
-        private void OnPopupLoaded(object sender, EventArgs e)
-        {
-            Popup popup = sender as Popup;
-
-            Mouse.OverrideCursor = null;
-            if (popup != null)
-            {
-                popup.Opened -= new EventHandler(OnPopupLoaded);
-            }
-        }
-
-        private static void ValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            // Make sure the value actually changed
-            if (!object.Equals(e.OldValue, e.NewValue))
-            {
-                ChoiceEditor choice = d as ChoiceEditor;
-                if (choice != null && !choice.ShouldIgnoreExternalValueChanges)
-                {
-                    choice.UpdateInternalValuesFromValue();
-                }
-            }
-        }
-
-        private static void ValueIndexChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            ChoiceEditor choice = d as ChoiceEditor;
-            if (choice != null && !choice.ShouldIgnoreExternalValueChanges)
-            {
-                choice.UpdateInternalValuesFromValueIndex();
-                choice.UpdateValueFromInternalValues();
-            }
-        }
-
-        private static void ItemsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            ChoiceEditor choice = d as ChoiceEditor;
-            if (choice != null)
-            {
-                choice.ItemsSourceChanged();
-            }
-        }
-
-        private static void IsEditableChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            // Make sure that the internal values are up to date now that we know we are editable or not.
-            ChoiceEditor choice = d as ChoiceEditor;
-            if (choice != null && !choice.ShouldIgnoreExternalValueChanges)
-            {
-                choice.UpdateInternalValuesFromValue();
-            }
-        }
-
-        private static void IsNinchedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            ChoiceEditor choice = d as ChoiceEditor;
-            if (choice != null && !choice.ShouldIgnoreExternalValueChanges)
-            {
-                choice.UpdateInternalValuesFromValue();
-            }
-        }
-
-        private static object CoerceShowFullControl(DependencyObject target, object value)
-        {
-            ChoiceEditor choice = target as ChoiceEditor;
-            if (choice != null && value is bool)
-            {
-                bool boolValue = (bool)value;
-
-                // ###################################################
-                // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - BEGIN
-                // ###################################################
-
-                choice.isShowingFullEditor = boolValue;
-                choice.CheckUpdateValueIndex(false);
-
-                // ###################################################
-                // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - END
-                // ###################################################
-
-                // If we are text editing force the full control to stay showing.
-                if (!boolValue)
-                {
-                    return choice.isTextEditing;
-                }
-            }
-
-            return value;
-        }
-
-        private static void ItemTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            ChoiceEditor choice = d as ChoiceEditor;
-            if (choice != null)
-            {
-                choice.CoerceValue(ChoiceEditor.UseItemTemplateForSelectionProperty);
-            }
-        }
-
-        private static void ItemTemplateSelectorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            ChoiceEditor choice = d as ChoiceEditor;
-            if (choice != null)
-            {
-                choice.CoerceValue(ChoiceEditor.UseItemTemplateForSelectionProperty);
-            }
-        }
-
-        private static object CoerceUseItemTemplateForSelection(DependencyObject target, object value)
-        {
-            ChoiceEditor choice = target as ChoiceEditor;
-            if (choice != null)
-            {
-                if (value == null)
-                {
-                    return choice.ItemTemplate != null || choice.ItemTemplateSelector != null;
-                }
-            }
-            return value;
-        }
-
-        private void SendPropertyChanged(string propertyName)
-        {
-            if (this.PropertyChanged != null)
-            {
-                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-            }
-        }
-
-        protected override void OnPreviewGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
-        {
-            base.OnPreviewGotKeyboardFocus(e);
-            FrameworkElement element = e.NewFocus as FrameworkElement;
-            if (element != null && element.Name.Equals("PART_EditableTextBox", StringComparison.Ordinal))
-            {
-                this.isTextEditing = true;
-            }
-        }
-
-        // ###################################################
-        // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - BEGIN
-        // ###################################################
-        // CIDER needs to override the Keydown behavior : 
-        //   
-        //          * The problem here is just a difference in expectation for control behavior 
-        //          * between the two products (CIDER AND BLEND). The fix is entirely in OnPreviewKeyDown 
-        //          * a.    Remove the condition that we handle navigation keys only when the popup is open
-        //          * b.    Add logic that forces a commit when a navigation happens (you could optionally only do the commit when the popup is closed, but I�m not sure what the desired behavior is here). You may or may not want to limit this behavior to editable ChoiceEditors as well.//          
-
-        protected override void OnPreviewKeyDown(KeyEventArgs e)
-        {
-            bool commitChange = false;
-            bool finishEditing = false;
-
-            bool markHandled = ValueEditorUtils.GetHandlesCommitKeys(this);
-
-            if (e.Key == Key.Return || e.Key == Key.Enter)
-            {
-                e.Handled |= markHandled;
-
-                commitChange = true;
-
-                finishEditing = (e.KeyboardDevice.Modifiers & ModifierKeys.Shift) == 0;
-                //Hide dropdown on excape key
-                HideDropDown();
-            }
-            else if (e.Key == Key.Escape)
-            {
-                e.Handled |= markHandled;
-
-                LostFocusAction savedAction = this.lostFocusAction;
-                this.lostFocusAction = LostFocusAction.None;
-                if (savedAction != LostFocusAction.None)
-                {
-                    this.CancelChange();
-                }
-
-                //Hide dropdown on excape key
-                HideDropDown();
-                this.OnFinishEditing();
-            }
-            // Only pay attention to navigation keys if we are selecting a value from the popup
-            if (this.CollectionView != null && !this.CollectionView.IsEmpty)
-            {
-                bool navigated = false;
-                if (e.Key == Key.Up || (!this.IsEditable && e.Key == Key.Left))
-                {
-                    this.SelectPreviousValue();
-                    navigated = true;
-                }
-                else if (e.Key == Key.Down || (!this.IsEditable && e.Key == Key.Right))
-                {
-                    this.SelectNextValue();
-                    navigated = true;
-                }
-                else if (!this.IsEditable && e.Key == Key.Home)
-                {
-                    this.ValueIndex = 0;
-                    navigated = true;
-                }
-                else if (!this.IsEditable && e.Key == Key.End)
-                {
-                    this.ValueIndex = this.CollectionView.Count - 1;
-                    navigated = true;
-                }
-
-                if (navigated)
-                {
-                    this.lostFocusAction = LostFocusAction.Commit;
-                    e.Handled = true;
-                    ComboBox comboBox = this.Template.FindName("_comboChoiceEditor", this) as ComboBox;
-                    if (!comboBox.IsDropDownOpen)
-                    {
-                        commitChange = true;
-                    }
-                }
-            }
-
-            if (commitChange)
-            {
-                LostFocusAction savedAction = this.lostFocusAction;
-                this.lostFocusAction = LostFocusAction.None;
-                if (savedAction == LostFocusAction.Commit)
-                {
-                    this.CommitChange();
-                }
-            }
-            if (finishEditing)
-            {
-                this.OnFinishEditing();
-            }
-            base.OnPreviewKeyDown(e);
-        }
-
-        // ###################################################
-        // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - END
-        // ###################################################
-
-        // ###################################################
-        // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - BEGIN
-        // ###################################################
-        private void HideDropDown()
-        {
-            ComboBox comboBox = this.Template.FindName("_comboChoiceEditor", this) as ComboBox;
-            if (comboBox != null && comboBox.IsDropDownOpen)
-            {
-                comboBox.IsDropDownOpen = false;
-            }
-        }
-
-        // When the focus is lost by clicking ouside the choice-editor
-        // we dont get a preview message.
-        // The string edtior has OnLostKeyboardFocus and hence we imitate the 
-        // same behavior.
-        protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e)
-        {
-            base.OnLostKeyboardFocus(e);
-
-            FrameworkElement element = e.OldFocus as FrameworkElement;
-            if (element != null && element.Name.Equals("PART_EditableTextBox", StringComparison.Ordinal))
-            {
-                this.HandleLostFocus();
-            }
-        }
-        // #################################################
-        // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - END
-        // #################################################
-
-
-        protected override void OnPreviewLostKeyboardFocus(KeyboardFocusChangedEventArgs e)
-        {
-            base.OnPreviewLostKeyboardFocus(e);
-            FrameworkElement element = e.OldFocus as FrameworkElement;
-            if (element != null && element.Name.Equals("PART_EditableTextBox", StringComparison.Ordinal))
-            {
-                this.HandleLostFocus();
-            }
-        }
-
-        private void HandleLostFocus()
-        {
-            if (this.isTextEditing)
-            {
-                LostFocusAction oldLostFocusAction = this.lostFocusAction;
-                this.lostFocusAction = LostFocusAction.None;
-                this.isTextEditing = false;
-
-
-                if (oldLostFocusAction == LostFocusAction.Commit)
-                {
-                    this.CommitChange();
-                }
-                else if (oldLostFocusAction == LostFocusAction.Cancel)
-                {
-                    this.CancelChange();
-                }
-
-                this.CoerceValue(ChoiceEditor.ShowFullControlProperty);
-            }
-        }
-
-        protected override void OnRender(DrawingContext drawingContext)
-        {
-            base.OnRender(drawingContext);
-            if (this.ViewType == ChoiceEditorViewType.Combo && !this.ShowFullControl)
-            {
-                double borderCornerRadius = this.BorderCornerRadius;
-                Thickness dropButtonInset = this.DropButtonInset;
-                Thickness textAreaInset = this.TextAreaInset;
-                Brush dropButtonBrush = this.DropButtonBrush;
-                double innerCornerRadius = this.InnerCornerRadius;
-                ImageSource buttonIcon = this.ButtonIcon;
-                double iconWidth = this.IconWidth;
-                double iconHeight = this.IconHeight;
-
-                // Draw something that looks like an Expression combo
-                Rect fullRect = new Rect(0d, 0d, this.ActualWidth, this.ActualHeight);
-
-                if (RenderUtils.DrawInscribedRoundedRect(drawingContext, this.BorderBrush, null, fullRect, borderCornerRadius))
-                {
-                    Rect innerRect = RenderUtils.CalculateInnerRect(fullRect, 0);
-                    double dropButtonLeft = (innerRect.Right > textAreaInset.Right ? innerRect.Right - textAreaInset.Right : 0d) + dropButtonInset.Left;
-                    double dropButtonTop = innerRect.Top + dropButtonInset.Top;
-                    double dropButtonRight = innerRect.Right - dropButtonInset.Right;
-                    double dropButtonBottom = innerRect.Bottom - dropButtonInset.Bottom;
-
-                    RenderUtils.DrawInscribedRoundedRect(drawingContext, dropButtonBrush, null, new Rect(new Point(dropButtonLeft, dropButtonTop), new Point(dropButtonRight, dropButtonBottom)), innerCornerRadius);
-                    if (buttonIcon != null)
-                    {
-                        double buttonCenterX = dropButtonLeft + (dropButtonRight - dropButtonLeft) / 2d;
-                        double buttonCenterY = dropButtonTop + (dropButtonBottom - dropButtonTop) / 2d;
-                        drawingContext.DrawImage(buttonIcon, new Rect(new Point(buttonCenterX - iconWidth / 2d, buttonCenterY - iconHeight / 2d), new Point(buttonCenterX + iconWidth / 2d, buttonCenterY + iconHeight / 2d)));
-                    }
-
-                    double textAreaLeft = innerRect.Left + textAreaInset.Left;
-                    double textAreaTop = innerRect.Top + textAreaInset.Top;
-                    double textAreaRight = innerRect.Right > textAreaInset.Right ? innerRect.Right - textAreaInset.Right : textAreaLeft;
-                    double textAreaBottom = innerRect.Bottom - textAreaInset.Bottom;
-
-                    RenderUtils.DrawInscribedRoundedRect(drawingContext, this.Background, null, new Rect(new Point(textAreaLeft, textAreaTop), new Point(textAreaRight, textAreaBottom)), innerCornerRadius);
-                }
-            }
-        }
-
-        protected override void OnTemplateChanged(ControlTemplate oldTemplate, ControlTemplate newTemplate)
-        {
-            this.BeginNoCommitInternalValueChangeBlock();
-            // WORKAROUND Turn off bindings on the internal combo while the template is udpating. This works around Avalon bug: 1756023
-            this.ForceBinding = false;
-            base.OnTemplateChanged(oldTemplate, newTemplate);
-        }
-
-        public override void OnApplyTemplate()
-        {
-            base.OnApplyTemplate();
-            // WORKAROUND Force the bindings on our internal combo (if there is one) to update. This works around Avalon bug: 1756023
-            this.ForceBinding = true;
-
-            this.EndNoCommitInternalValueChangeBlock();
-
-            this.HandleLostFocus();
-        }
-
-        private void CommitChange()
-        {
-            ValueEditorUtils.ExecuteCommand(this.BeginCommand, this, null);
-
-            if (this.UpdateValueFromInternalValues())
-            {
-                // We need to update both the binding on the value property and the valueindex property
-                // so that the value does not bounce around when we commit.
-                ValueEditorUtils.UpdateBinding(this, ChoiceEditor.ValueProperty, UpdateBindingType.Source);
-                ValueEditorUtils.UpdateBinding(this, ChoiceEditor.ValueIndexProperty, UpdateBindingType.Source);
-                ValueEditorUtils.ExecuteCommand(this.CommitCommand, this, null);
-                ValueEditorUtils.UpdateBinding(this, ChoiceEditor.ValueProperty, UpdateBindingType.Target);
-                ValueEditorUtils.UpdateBinding(this, ChoiceEditor.ValueIndexProperty, UpdateBindingType.Target);
-            }
-            else
-            {
-                this.CancelStartedChange();
-            }
-
-            this.lostFocusAction = LostFocusAction.None;
-        }
-
-        private void CancelChange()
-        {
-            ValueEditorUtils.ExecuteCommand(this.BeginCommand, this, null);
-            this.CancelStartedChange();
-        }
-
-        private void CancelStartedChange()
-        {
-            // Revert External values
-            ValueEditorUtils.UpdateBinding(this, ChoiceEditor.ValueProperty, UpdateBindingType.Target);
-            ValueEditorUtils.UpdateBinding(this, ChoiceEditor.ValueIndexProperty, UpdateBindingType.Target);
-            this.UpdateInternalValuesFromValue();
-            ValueEditorUtils.ExecuteCommand(this.CancelCommand, this, null);
-        }
-
-        private void OnFinishEditing()
-        {
-            ICommand finishedEditingCommand = this.FinishEditingCommand;
-            if (finishedEditingCommand != null)
-            {
-                ValueEditorUtils.ExecuteCommand(finishedEditingCommand, this, null);
-            }
-            else
-            {
-                Keyboard.Focus(null);
-            }
-        }
-
-        private void ItemsSourceChanged()
-        {
-            // The collection just changed, so we need to make sure that things are in [....]
-
-            // ###################################################
-            // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - BEGIN
-            // ###################################################
-            this.collectionView = null;
-            // ###################################################
-            // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - end
-            // ###################################################
-
-            this.UpdateInternalValuesFromValue();
-            this.UpdateValueFromInternalValues();
-        }
-
-        private int IndexOf(object item)
-        {
-            if (this.CollectionView != null)
-            {
-                return this.CollectionView.IndexOf(item);
-            }
-            else
-            {
-                return -1;
-            }
-        }
-
-        private object GetItemAt(int index)
-        {
-            if (this.CollectionView != null)
-            {
-                return this.CollectionView.GetItemAt(index);
-            }
-            else
-            {
-                return null;
-            }
-        }
-
-        protected void UpdateInternalValuesFromValue()
-        {
-            this.BeginNoCommitInternalValueChangeBlock();
-            this.BeginNoCommitInternalStringValueChangeBlock();
-            try
-            {
-                if (!this.IsNinched)
-                {
-                    this.InternalValue = this.Value;
-                }
-                else
-                {
-                    this.InternalValue = null;
-                }
-
-                if (this.IsEditable)
-                {
-                    string newStringValue = String.Empty;
-                    if (this.InternalValue != null && !this.IsNinched)
-                    {
-                        TypeConverter converter = this.Converter;
-                        if (converter != null && converter.CanConvertFrom(this.InternalValue.GetType()))
-                        {
-                            newStringValue = converter.ConvertToString(this.InternalValue);
-                        }
-                        else
-                        {
-                            newStringValue = this.InternalValue.ToString();
-                        }
-                    }
-
-                    this.InternalStringValue = newStringValue;
-                }
-            }
-            finally
-            {
-                this.EndNoCommitInternalStringValueChangeBlock();
-                this.EndNoCommitInternalValueChangeBlock();
-            }
-        }
-
-        public void UpdateInternalValuesFromValueIndex()
-        {
-            this.BeginNoCommitInternalValueChangeBlock();
-            this.BeginNoCommitInternalStringValueChangeBlock();
-            try
-            {
-                this.InternalValue = this.GetItemAt(this.ValueIndex);
-            }
-            finally
-            {
-                this.EndNoCommitInternalStringValueChangeBlock();
-                this.EndNoCommitInternalValueChangeBlock();
-            }
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Propagating the error might cause VS to crash")]
-        [SuppressMessage("Reliability", "Reliability108", Justification = "Propagating the error might cause VS to crash")]
-        protected bool UpdateValueFromInternalValues()
-        {
-            this.BeginIgnoreExternalValueChangeBlock();
-            try
-            {
-                if (!this.IsEditable)
-                {
-                    this.Value = this.InternalValue;
-                }
-                else
-                {
-                    if (this.InternalValue != null)
-                    {
-                        this.Value = this.InternalValue;
-                    }
-                    else
-                    {
-                        string stringValue = this.InternalStringValue;
-                        // Try to parse a new value from the string value
-                        if (stringValue != null)
-                        {
-                            TypeConverter converter = this.Converter;
-                            object newValue = null;
-                            if (converter != null)
-                            {
-                                try
-                                {
-                                    newValue = converter.ConvertFromString(stringValue);
-                                }
-                                catch (Exception)
-                                {
-                                    // Have to catch Exception here because Various of these converters (e.g. DoubleConverter) will throw it.
-                                    // Do nothing since newValue should still be null;
-                                    return false;
-                                }
-                            }
-                            else
-                            {
-                                newValue = stringValue;
-                            }
-
-                            this.Value = newValue;
-
-                            // At this point it is possible that the value that we just set is out of [....] with the internal value
-                            if (newValue != this.InternalValue)
-                            {
-                                this.UpdateInternalValuesFromValue();
-                            }
-                        }
-                    }
-
-                }
-            }
-            finally
-            {
-                this.EndIgnoreExternalValueChangeBlock();
-            }
-
-            CheckUpdateValueIndex(true);
-            return true;
-        }
-
-        protected void BeginNoCommitInternalValueChangeBlock()
-        {
-            this.internalChangeLockCount++;
-        }
-
-        // ###################################################
-        // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - BEGIN
-        // ###################################################
-
-        // <summary>
-        // Updates the value index for the current value, but
-        // only if necessary.
-        // </summary>
-        private void CheckUpdateValueIndex(bool sourceChanged)
-        {
-
-            BeginIgnoreExternalValueChangeBlock();
-            try
-            {
-                // Check if we need to update the value index.
-                // We don't need to if we're a combo box and
-                // we're not showing the drop-down.
-
-                if (ViewType != ChoiceEditorViewType.Combo || this.isShowingFullEditor)
-                {
-                    if (sourceChanged || ReadLocalValue(ValueIndexProperty) == DependencyProperty.UnsetValue)
-                    {
-                        ValueIndex = IndexOf(Value);
-                    }
-                }
-                else
-                {
-                    ClearValue(ValueIndexProperty);
-                }
-            }
-            finally
-            {
-                EndIgnoreExternalValueChangeBlock();
-            }
-        }
-
-        // ###################################################
-        // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - END
-        // ###################################################
-
-        protected void EndNoCommitInternalValueChangeBlock()
-        {
-            this.internalChangeLockCount--;
-            Fx.Assert(this.internalChangeLockCount >= 0, "internalChangeLockCount should be positive");
-        }
-
-        protected void BeginNoCommitInternalStringValueChangeBlock()
-        {
-            this.internalStringValueChangeLockCount++;
-        }
-
-        protected void EndNoCommitInternalStringValueChangeBlock()
-        {
-            this.internalStringValueChangeLockCount--;
-            Fx.Assert(this.internalStringValueChangeLockCount >= 0, "internalStringValueChangeLockCount should be positive");
-        }
-
-        protected void BeginIgnoreExternalValueChangeBlock()
-        {
-            Fx.Assert(this.ignoreValueChanges == false, "ignoreValueChanges should be false");
-            this.ignoreValueChanges = true;
-        }
-
-        protected void EndIgnoreExternalValueChangeBlock()
-        {
-            Fx.Assert(this.ignoreValueChanges == true, "ignoreValueChanges should be false");
-            this.ignoreValueChanges = false;
-        }
-
-
-        enum LostFocusAction
-        {
-            None,
-            Commit,
-            Cancel
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/ValueEditors/RenderUtils.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/ValueEditors/RenderUtils.cs
deleted file mode 100644 (file)
index 98ec4b5..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\ValueEditors
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.ValueEditors
-{
-    using System;
-    using System.Windows;
-    using System.Windows.Media;
-
-    internal sealed class RenderUtils
-    {
-        private RenderUtils()
-        {
-        }
-
-        public static bool DrawInscribedRoundedRect(DrawingContext drawingContext, Brush fill, Pen stroke, Rect outerBounds, double cornerRadius)
-        {
-            Point spineLeftTop = new Point(outerBounds.Left, outerBounds.Top);
-            Point spineRightBottom = new Point(outerBounds.Right, outerBounds.Bottom);
-            bool drewSomething = false;
-
-            if (stroke != null && !Tolerances.NearZero(stroke.Thickness))
-            {
-                double halfThickness = stroke.Thickness / 2d;
-                spineLeftTop.X += halfThickness;
-                spineLeftTop.Y += halfThickness;
-                spineRightBottom.X -= halfThickness;
-                spineRightBottom.Y -= halfThickness;
-            }
-
-            Rect spineRect = new Rect(spineLeftTop, spineRightBottom);
-            if (!Tolerances.NearZero(spineRect.Width) && !Tolerances.NearZero(spineRect.Height))
-            {
-                drawingContext.DrawRoundedRectangle(fill, stroke, spineRect, cornerRadius, cornerRadius);
-                drewSomething = true;
-            }
-
-            return drewSomething;
-        }
-
-        public static Rect CalculateInnerRect(Rect outerBounds, double strokeThickness)
-        {
-            if (!Tolerances.NearZero(strokeThickness))
-            {
-                return new Rect(new Point(outerBounds.Left + strokeThickness, outerBounds.Top + strokeThickness), new Point(outerBounds.Right - strokeThickness, outerBounds.Bottom - strokeThickness));
-            }
-            else
-            {
-                return outerBounds;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/ValueEditors/StringEditor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/ValueEditors/StringEditor.cs
deleted file mode 100644 (file)
index 6a17c5d..0000000
+++ /dev/null
@@ -1,376 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\ValueEditors
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.ValueEditors
-{
-    using System;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Windows.Documents;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using System.Windows.Media.Animation;
-    using System.Windows.Threading;
-    using System.Activities.Presentation.View;
-
-    internal class StringEditor : TextBox
-    {
-
-        public static readonly DependencyProperty ValueProperty = DependencyProperty.Register("Value", typeof(string), typeof(StringEditor), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(StringEditor.ValueChanged), null, false, UpdateSourceTrigger.PropertyChanged));
-        public static readonly DependencyProperty IsNinchedProperty = DependencyProperty.Register("IsNinched", typeof(bool), typeof(StringEditor), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.None, new PropertyChangedCallback(StringEditor.IsNinchedChanged)));
-        public static readonly DependencyProperty IsEditingProperty = DependencyProperty.Register("IsEditing", typeof(bool), typeof(StringEditor), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.None, new PropertyChangedCallback(StringEditor.IsEditingChanged)));
-
-        public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.Register("CornerRadius", typeof(double), typeof(StringEditor), new FrameworkPropertyMetadata(0d, FrameworkPropertyMetadataOptions.None));
-        public static readonly DependencyProperty BorderWidthProperty = DependencyProperty.Register("BorderWidth", typeof(double), typeof(StringEditor), new FrameworkPropertyMetadata(1.0, FrameworkPropertyMetadataOptions.None));
-
-        public static readonly DependencyProperty BeginCommandProperty = DependencyProperty.Register("BeginCommand", typeof(ICommand), typeof(StringEditor), new PropertyMetadata(null));
-        public static readonly DependencyProperty CommitCommandProperty = DependencyProperty.Register("CommitCommand", typeof(ICommand), typeof(StringEditor), new PropertyMetadata(null));
-        public static readonly DependencyProperty CancelCommandProperty = DependencyProperty.Register("CancelCommand", typeof(ICommand), typeof(StringEditor), new PropertyMetadata(null));
-        public static readonly DependencyProperty FinishEditingCommandProperty = DependencyProperty.Register("FinishEditingCommand", typeof(ICommand), typeof(StringEditor), new PropertyMetadata(null));
-        public static readonly DependencyProperty LostFocusCommandProperty = DependencyProperty.Register("LostFocusCommand", typeof(ICommand), typeof(StringEditor), new PropertyMetadata(null));
-
-        private LostFocusAction lostFocusAction = LostFocusAction.None;
-        private bool ignoreTextChanges = false;
-
-        public StringEditor()
-        {
-            this.CommandBindings.Add(new CommandBinding( DesignerView.CommitCommand, OnDesignerViewCommitExecute));
-        }
-
-        public string Value
-        {
-            get { return (string)this.GetValue(StringEditor.ValueProperty); }
-            set { this.SetValue(StringEditor.ValueProperty, value); }
-        }
-
-        public bool IsNinched
-        {
-            get { return (bool)this.GetValue(StringEditor.IsNinchedProperty); }
-            set { this.SetValue(StringEditor.IsNinchedProperty, value); }
-        }
-
-        public bool IsEditing
-        {
-            get { return (bool)this.GetValue(StringEditor.IsEditingProperty); }
-            set { this.SetValue(StringEditor.IsEditingProperty, value); }
-        }
-
-        public double CornerRadius
-        {
-            get { return (double)this.GetValue(StringEditor.CornerRadiusProperty); }
-            set { this.SetValue(StringEditor.CornerRadiusProperty, value); }
-        }
-
-        public double BorderWidth
-        {
-            get { return (double)this.GetValue(StringEditor.BorderWidthProperty); }
-            set { this.SetValue(StringEditor.BorderWidthProperty, value); }
-        }
-
-        public ICommand BeginCommand
-        {
-            get { return (ICommand)this.GetValue(StringEditor.BeginCommandProperty); }
-            set { this.SetValue(StringEditor.BeginCommandProperty, value); }
-        }
-
-        public ICommand CommitCommand
-        {
-            get { return (ICommand)this.GetValue(StringEditor.CommitCommandProperty); }
-            set { this.SetValue(StringEditor.CommitCommandProperty, value); }
-        }
-
-        public ICommand CancelCommand
-        {
-            get { return (ICommand)this.GetValue(StringEditor.CancelCommandProperty); }
-            set { this.SetValue(StringEditor.CancelCommandProperty, value); }
-        }
-
-        public ICommand FinishEditingCommand
-        {
-            get { return (ICommand)this.GetValue(StringEditor.FinishEditingCommandProperty); }
-            set { this.SetValue(StringEditor.FinishEditingCommandProperty, value); }
-        }
-
-        public ICommand LostFocusCommand
-        {
-            get { return (ICommand)this.GetValue(StringEditor.LostFocusCommandProperty); }
-            set { this.SetValue(StringEditor.LostFocusCommandProperty, value); }
-        }
-
-        private static void ValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            StringEditor editor = d as StringEditor;
-            if (editor != null)
-            {
-                editor.UpdateTextFromValue();
-            }
-        }
-
-        private static void IsNinchedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            StringEditor editor = d as StringEditor;
-            if (editor != null)
-            {
-                editor.UpdateTextFromValue();
-            }
-        }
-
-        private static void IsEditingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            StringEditor editor = d as StringEditor;
-            if (editor != null)
-            {
-                bool isNowEditing = (bool)e.NewValue;
-                if (isNowEditing)
-                {
-                    if (editor.IsInitialized)
-                    {
-                        editor.Focus();
-                    }
-                    else
-                    {
-                        editor.PostFocusCallback();
-                    }
-                }
-            }
-        }
-
-        // ###################################################
-        // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - BEGIN
-        // ###################################################
-        // StringEditor should select text only when it gets the logical focus and nowhere else.
-        protected override void OnGotFocus(RoutedEventArgs e)
-        {
-            base.OnGotFocus(e);
-            this.SelectAll();
-        }
-        // ###################################################
-        // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - END
-        // ###################################################
-
-
-        protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
-        {
-            if (!this.IsReadOnly)
-            {
-                this.IsEditing = true;
-            }
-            base.OnGotKeyboardFocus(e);
-        }
-
-        protected override void OnPreviewLostKeyboardFocus(KeyboardFocusChangedEventArgs e)
-        {
-            // We have to commit on _preview_ lost focus because the ---- tab control does
-            // work before we loose focus which causes keyframing stuff to happen out of order.
-            base.OnPreviewLostKeyboardFocus(e);
-            InternalLostFocus();
-        }
-
-        protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e)
-        {
-            base.OnLostKeyboardFocus(e);
-            // We have to commit on lost focus as well, since when WPF application
-            // loosing focus to another Win32 window, e.g. the MFC Artboard in Acrylic,
-            // the PreviewLostKeyboardFocus event is not triggered.
-            InternalLostFocus();
-        }
-
-        private void InternalLostFocus()
-        {
-            LostFocusAction savedLostFocusAction = this.lostFocusAction;
-            // Set this to none here so that we will not commit twice when re-entrant (preview lost keyboard focus, then
-            // lost keyboard focus in the same callstack)
-            this.lostFocusAction = LostFocusAction.None;
-            if (savedLostFocusAction == LostFocusAction.Commit)
-            {
-                this.CommitChange();
-            }
-            else if (savedLostFocusAction == LostFocusAction.Cancel)
-            {
-                this.CancelChange();
-            }
-        }
-
-        protected override void OnLostFocus(RoutedEventArgs e)
-        {
-            base.OnLostFocus(e);
-            this.IsEditing = false;
-            ValueEditorUtils.ExecuteCommand(this.LostFocusCommand, this, null);
-            e.Handled = true;
-        }
-
-        protected override void OnTextChanged(TextChangedEventArgs e)
-        {
-            base.OnTextChanged(e);
-
-            if (this.ignoreTextChanges)
-            {
-                return;
-            }
-
-            if (this.IsEditing)
-            {
-                // If we get any text change default to commit if focus goes away
-                this.lostFocusAction = LostFocusAction.Commit;
-            }
-        }
-
-        protected override void OnKeyDown(KeyEventArgs e)
-        {
-            bool markHandled = ValueEditorUtils.GetHandlesCommitKeys(this);
-            if (e.Key == Key.Return || e.Key == Key.Enter)
-            {
-                LostFocusAction savedAction = this.lostFocusAction;
-                this.lostFocusAction = LostFocusAction.None;
-                if (savedAction == LostFocusAction.Commit)
-                {
-                    this.CommitChange();
-                }
-
-                if ((e.KeyboardDevice.Modifiers & ModifierKeys.Shift) == 0)
-                {
-                    this.OnFinishEditing();
-                }
-
-                e.Handled |= markHandled;
-            }
-            else if (e.Key == Key.Escape && this.IsEditing)
-            {
-                LostFocusAction savedAction = this.lostFocusAction;
-                this.lostFocusAction = LostFocusAction.None;
-                if (savedAction != LostFocusAction.None)
-                {
-                    this.CancelChange();
-                }
-
-                this.OnFinishEditing();
-
-                e.Handled |= markHandled;
-            }
-            base.OnKeyDown(e);
-        }
-
-        protected override void OnInitialized(EventArgs e)
-        {
-            base.OnInitialized(e);
-        }
-
-        protected override void OnRender(DrawingContext drawingContext)
-        {
-            Pen strokePen = null;
-            Double borderWidth = this.BorderWidth;
-            Brush borderBrush = this.BorderBrush;
-            if (borderWidth > 0d && borderBrush != null)
-            {
-                strokePen = new Pen(borderBrush, borderWidth);
-            }
-
-            RenderUtils.DrawInscribedRoundedRect(drawingContext, this.Background, strokePen, new Rect(0d, 0d, this.ActualWidth, this.ActualHeight), this.CornerRadius);
-
-            base.OnRender(drawingContext);
-        }
-
-        private void UpdateTextFromValue()
-        {
-            this.ignoreTextChanges = true;
-
-            if (!this.IsNinched)
-            {
-                this.Text = this.Value;
-            }
-            else
-            {
-                this.Text = null;
-            }
-
-            // ###################################################
-            // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - BEGIN
-            // ###################################################
-
-            // Whenever we set the value of a StringEditor programmatically
-            // (either because the contained property value changed somehow
-            // or because the user changed the value, hit enter, and we
-            // are looping back to see what the new value is now), make sure
-            // to clear the TextBox's UndoManager's buffer.  That way, the control
-            // will not be able to perform Undo and the command will be forwarded
-            // to the host.
-
-            // TextBoxBase does not provide any API to reset its Undo stack,
-            // but we can hack around it by resetting the UndoLimit, which
-            // accomplishes the same thing.
-            //
-            int originalUndoLimit = this.UndoLimit;
-            this.UndoLimit = 0;
-            this.UndoLimit = originalUndoLimit;
-
-            // ###################################################
-            // CIDER-SPECIFIC CHANGE IN NEED OF PORTING - END
-            // ###################################################
-
-            this.ignoreTextChanges = false;
-        }
-
-        private void CommitChange()
-        {
-
-            ValueEditorUtils.ExecuteCommand(this.BeginCommand, this, null);
-            this.Value = this.Text;
-            ValueEditorUtils.ExecuteCommand(this.CommitCommand, this, null);
-            ValueEditorUtils.UpdateBinding(this, StringEditor.ValueProperty, UpdateBindingType.Target);
-            // Now update the text value in case the model or a binding has reformated
-            this.UpdateTextFromValue();
-        }
-
-        void OnDesignerViewCommitExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.InternalLostFocus();
-            e.Handled = true;
-        }
-
-        private void CancelChange()
-        {
-            ValueEditorUtils.ExecuteCommand(this.BeginCommand, this, null);
-            ValueEditorUtils.UpdateBinding(this, StringEditor.ValueProperty, false);
-            ValueEditorUtils.ExecuteCommand(this.CancelCommand, this, null);
-            ValueEditorUtils.UpdateBinding(this, StringEditor.ValueProperty, UpdateBindingType.Target);
-            this.UpdateTextFromValue();
-        }
-
-        private void OnFinishEditing()
-        {
-            ICommand finishedEditingCommand = this.FinishEditingCommand;
-            if (finishedEditingCommand != null)
-            {
-                ValueEditorUtils.ExecuteCommand(finishedEditingCommand, this, null);
-            }
-            else
-            {
-                Keyboard.Focus(null);
-            }
-        }
-
-        private void PostFocusCallback()
-        {
-            UIThreadDispatcher.Instance.BeginInvoke(DispatcherPriority.Input, new DispatcherOperationCallback(this.SetFocus), null);
-        }
-
-        private object SetFocus(object o)
-        {
-            if (this.Visibility == Visibility.Visible)
-            {
-                this.Focus();
-            }
-
-            return null;
-        }
-        private enum LostFocusAction
-        {
-            None,
-            Commit,
-            Cancel
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/ValueEditors/ValueEditorUtils.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/ValueEditors/ValueEditorUtils.cs
deleted file mode 100644 (file)
index 1cd35bf..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-// -------------------------------------------------------------------
-
-//Cider comment:
-//  - Removed class MouseCursor
-
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\ValueEditors
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.ValueEditors
-{
-    using System;
-    using System.ComponentModel;
-    using System.Runtime.InteropServices;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Windows.Input;
-    using System.Windows.Interop;
-    using System.Windows.Media;
-
-    internal enum UpdateBindingType
-    {
-        Source,
-        Target,
-        Both
-    }
-    internal static class ValueEditorUtils
-    {
-        // This property determines whether the commit keys (enter and escape) are marked handled by value editors or not.  It inherits
-        // so can be set at any point in the tree, and all ValueEditors below that point in the UI will use this behavior.
-        public static readonly DependencyProperty HandlesCommitKeysProperty = DependencyProperty.RegisterAttached("HandlesCommitKeys", typeof(bool), typeof(ValueEditorUtils), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Inherits));
-
-        public static bool GetHandlesCommitKeys(DependencyObject dependencyObject)
-        {
-            return (bool)dependencyObject.GetValue(ValueEditorUtils.HandlesCommitKeysProperty);
-        }
-
-        public static void SetHandlesCommitKeys(DependencyObject dependencyObject, bool value)
-        {
-            dependencyObject.SetValue(ValueEditorUtils.HandlesCommitKeysProperty, value);
-        }
-
-        public static void UpdateBinding(FrameworkElement element, DependencyProperty property, bool updateSource)
-        {
-            ValueEditorUtils.UpdateBinding(element, property, (updateSource ? UpdateBindingType.Both : UpdateBindingType.Target));
-        }
-
-        public static void UpdateBinding(FrameworkElement element, DependencyProperty property, UpdateBindingType updateType)
-        {
-            BindingExpression bindingExpression = element.GetBindingExpression(property);
-            if (bindingExpression != null)
-            {
-                // If desired, push the current text value to the source of the binding.
-                if (updateType == UpdateBindingType.Source || updateType == UpdateBindingType.Both)
-                {
-                    bindingExpression.UpdateSource();
-                }
-
-                // Update the text from the source of the binding.
-                if (updateType == UpdateBindingType.Target || updateType == UpdateBindingType.Both)
-                {
-                    bindingExpression.UpdateTarget();
-                }
-            }
-        }
-
-        public static void ExecuteCommand(ICommand command, IInputElement element, object parameter)
-        {
-            RoutedCommand routedCommand = command as RoutedCommand;
-            if (routedCommand != null)
-            {
-                if (routedCommand.CanExecute(parameter, element))
-                {
-                    routedCommand.Execute(parameter, element);
-                }
-            }
-            else
-            {
-                if (command != null && command.CanExecute(parameter))
-                {
-                    command.Execute(parameter);
-                }
-            }
-        }
-    }
-
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/ValueEditors/ValueToIconConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/ValueEditors/ValueToIconConverter.cs
deleted file mode 100644 (file)
index ccdbf4d..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-// -------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-// -------------------------------------------------------------------
-//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\ValueEditors
-namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.ValueEditors
-{
-    using System;
-    using System.Globalization;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Windows.Media;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // Implement this interface to provide icons to the ValueToIconProvider
-    // </summary>
-    internal interface IIconProvider
-    {
-        ImageSource GetIconAsImageSource(object key, object parameter);
-    }
-
-    // <summary>
-    // Gets an Icon as a Brush from the IIconProvider passed in as the first object of a multibinding
-    // using the second object as the key.
-    // </summary>
-
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal class ValueToIconConverter : IMultiValueConverter
-    {
-        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-        {
-            if (values.Length == 2)
-            {
-                IIconProvider iconProvider = values[0] as IIconProvider;
-                object objectToLookUp = values[1];
-                if (iconProvider != null && objectToLookUp != null)
-                {
-                    return iconProvider.GetIconAsImageSource(objectToLookUp, parameter);
-                }
-            }
-
-            return null;
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotImplementedException(ExceptionStringTable.NoConvertBackForValueToIconConverter));
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/IStateContainer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/IStateContainer.cs
deleted file mode 100644 (file)
index 928b50d..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.State 
-{
-
-    // <summary>
-    // Internal interface we use to mark classes that manage state that we want to
-    // marshal across control instances as well as AppDomains.
-    // </summary>
-    internal interface IStateContainer 
-    {
-
-        // <summary>
-        // Retrieves the state stored in the object implementing this interface
-        // </summary>
-        // <returns>AppDomain-friendly state object</returns>
-        object RetrieveState();
-
-        // <summary>
-        // Restores its state based on the specified state object
-        // </summary>
-        // <param name="state">State to apply</param>
-        void RestoreState(object state);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/KeyboardEnabledRadioButton.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/KeyboardEnabledRadioButton.cs
deleted file mode 100644 (file)
index 4b4d2fb..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-    using System.Windows.Controls;
-    using System.Windows.Input;
-
-    // <summary>
-    // WPF's RadioButton responds to Space key to trigger selection, but
-    // not the Enter or Return keys.  This class responds to both.
-    // </summary>
-    internal class KeyboardEnabledRadioButton : RadioButton 
-    {
-        protected override void OnKeyDown(KeyEventArgs e) 
-        {
-            if (e.Key == Key.Enter ||
-                e.Key == Key.Return) 
-            {
-
-                this.IsChecked = true;
-                e.Handled = true;
-            }
-
-            base.OnKeyDown(e);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Metadata/PropertyInspectorMetadata.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Metadata/PropertyInspectorMetadata.cs
deleted file mode 100644 (file)
index 01fe37f..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Metadata 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Input;
-    using System.Windows.Media.Effects;
-
-    using System.Activities.Presentation.Metadata;
-    using System.Activities.Presentation.PropertyEditing;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.Editors;
-
-    // <summary>
-    // Metadata specific to PropertyEditing -- associates specific PropertyValueEditors with
-    // specific property Types or properties themselves.
-    // </summary>
-    [SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes", Justification = "Suppress to avoid churning the code base.")]
-    static class PropertyInspectorMetadata 
-    {
-
-        private static bool _initialized;
-
-        // <summary>
-        // Initializes the metadata provided by this class.  Multiple class
-        // are ignored.
-        // </summary>
-        public static void Initialize() 
-        {
-            if (_initialized)
-            {
-                return;
-            }
-
-            // Introduce any Cider-specific customizations
-            AttributeTableBuilder builder = new AttributeTableBuilder();
-
-            // Make Name and FlowDirection properties browsable.  The reason why
-            // these attributes are here instead of in the BaseOverridesAttributeTable
-            // is because the BaseAttributeTable explicitly hides these properties
-            // and adding conflicting attributes to the same table (via BaseOverridesAttributeTable
-            // which derives from BaseAttributeTable) currently results in unspeciefied
-            // behavior.  Hence we use this table to deal with these attributes.
-            //
-            MakeBasic(builder, typeof(FrameworkElement), FrameworkElement.FlowDirectionProperty);
-            MakeBasic(builder, typeof(Control), Control.NameProperty);
-
-            // Note: Add any new attributes here or into System.Activities.Presentation.Developer / 
-            // System.Activities.Presentation.Internal.Metadata.BaseOverridesAttributeTable
-
-            MetadataStore.AddAttributeTable(builder.CreateTable());
-
-            _initialized = true;
-        }
-
-        private static void MakeBasic(AttributeTableBuilder builder, Type owningType, DependencyProperty property) 
-        {
-            builder.AddCustomAttributes(owningType, property, BrowsableAttribute.Yes);
-            builder.AddCustomAttributes(owningType, property, new EditorBrowsableAttribute(EditorBrowsableState.Always));
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelCategoryEntry.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelCategoryEntry.cs
deleted file mode 100644 (file)
index b8535a2..0000000
+++ /dev/null
@@ -1,331 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Model 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Collections.Specialized;
-    using System.Diagnostics;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data;
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // Cider's concrete implementation of CategoryEntry (CategoryBase comes from Sparkle
-    // and it has a few extra goodies that we want to reuse).  This class implements
-    // INotifyCollectionChanged.  We need to push this implementation to the base class
-    // in v2.
-    // </summary>
-    internal class ModelCategoryEntry : CategoryBase, INotifyCollectionChanged 
-    {
-
-        private ObservableCollectionWorkaround<PropertyEntry> _basicProperties;
-        private ObservableCollectionWorkaround<PropertyEntry> _advancedProperties;
-
-        // <summary>
-        // Basic ctor
-        // </summary>
-        // <param name="categoryName">Localized name for this category</param>
-        public ModelCategoryEntry(string categoryName) : base(categoryName) 
-        {
-            _basicProperties = new ObservableCollectionWorkaround<PropertyEntry>();
-            _advancedProperties = new ObservableCollectionWorkaround<PropertyEntry>();
-        }
-
-        public event NotifyCollectionChangedEventHandler CollectionChanged;
-
-        // <summary>
-        // Gets the advanced properties contained in this category
-        // </summary>
-        public override ObservableCollection<PropertyEntry> AdvancedProperties 
-        {
-            get {
-                return _advancedProperties;
-            }
-        }
-
-        // <summary>
-        // Gets the basic properties contained in this category
-        // </summary>
-        public override ObservableCollection<PropertyEntry> BasicProperties 
-        {
-            get {
-                return _basicProperties;
-            }
-        }
-
-        // <summary>
-        // Gets a flag indicating whether this category contains any properties
-        // </summary>
-        internal bool IsEmpty 
-        {
-            get {
-                return _advancedProperties.Count + _basicProperties.Count == 0;
-            }
-        }
-
-        // <summary>
-        // Returns either the basic or the advanced bucket based on the IsAdvanced flag
-        // set in the PropertyEntry itself
-        // </summary>
-        // <param name="property">Property to examine</param>
-        // <returns>The corresponding basic or advanced bucket</returns>
-        internal ObservableCollectionWorkaround<PropertyEntry> GetBucket(PropertyEntry property) 
-        {
-            if (property == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("property");
-            }
-            return property.IsAdvanced ? _advancedProperties : _basicProperties;
-        }
-
-        // <summary>
-        // Adds the given property to the specified property bucket (use
-        // ModelCategoryEntry.BasicProperties, ModelCategoryEntry.AdvancedProperties, or
-        // ModelCategoryEntry.GetBucket()) sorted using the specified comparer.
-        // </summary>
-        // <param name="property">Property to add</param>
-        // <param name="bucket">Property bucket to populate</param>
-        // <param name="comparer">Sort algorithm to use</param>
-        // <param name="fireCollectionChangedEvent">If set to true, NotifyCollectionChanged event is fired</param>
-        internal void Add(
-            PropertyEntry property,
-            ObservableCollection<PropertyEntry> bucket,
-            IComparer<PropertyEntry> comparer) 
-        {
-            Add(property, bucket, comparer, true);
-        }
-
-        //
-        // Adds the given property to the specified property bucket (use
-        // ModelCategoryEntry.BasicProperties, ModelCategoryEntry.AdvancedProperties, or
-        // ModelCategoryEntry.GetBucket()) sorted using the specified comparer.
-        //
-        private void Add(
-            PropertyEntry property,
-            ObservableCollection<PropertyEntry> bucket,
-            IComparer<PropertyEntry> comparer,
-            bool fireCollectionChangedEvent) 
-        {
-
-            if (property == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("property");
-            }
-            if (bucket == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("bucket");
-            }
-            if (comparer == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("comparer");
-            }
-
-            ObservableCollectionWorkaround<PropertyEntry> castBucket = bucket as ObservableCollectionWorkaround<PropertyEntry>;
-            int insertionIndex = 0;
-
-            if (castBucket == null) 
-            {
-                Debug.Fail("Invalid property bucket.  The property sort order will be broken.");
-            }
-            else 
-            {
-                insertionIndex = castBucket.BinarySearch(property, comparer);
-                if (insertionIndex < 0) 
-                {
-                    insertionIndex = ~insertionIndex;
-                }
-            }
-
-            bucket.Insert(insertionIndex, property);
-
-            if (fireCollectionChangedEvent)
-            {
-                FirePropertiesChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, property));
-            }
-        }
-
-        // <summary>
-        // Removes and re-adds the specified property from this category, if it existed
-        // there to begin with.  Noop otherwise.
-        //
-        // Use this method to refresh the cate----zation of a property if it suddenly
-        // becomes Advanced if it was Basic before, or if its IsBrowsable status changes.
-        // </summary>
-        // <param name="property">Property to refresh</param>
-        // <param name="bucket">Property bucket to repopulate</param>
-        // <param name="sortComparer">Comparer to use to reinsert the given property in its new place</param>
-        internal void Refresh(ModelPropertyEntry property, ObservableCollection<PropertyEntry> bucket, IComparer<PropertyEntry> sortComparer) 
-        {
-            if (property == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("property");
-            }
-            if (bucket != _basicProperties && bucket != _advancedProperties) 
-            {
-                Debug.Fail("Invalid bucket specified.  Property was not refreshed.");
-                return;
-            }
-
-            // Let's see if we know about this property
-            ObservableCollectionWorkaround<PropertyEntry> collection;
-            collection = _advancedProperties;
-
-            int index = collection.BinarySearch(property, null);
-            if (index < 0) 
-            {
-                collection = _basicProperties;
-                index = collection.BinarySearch(property, null);
-            }
-
-            // If not, noop
-            if (index < 0)
-            {
-                return;
-            }
-
-            // We know about this property, so refresh it.  It may have changed
-            // somehow (eg. switched from basic to advanced, become hidden, etc.)
-            // so make sure it's thrown into the right bucket.
-            collection.RemoveAt(index);
-            Add(property, bucket, sortComparer, false);
-        }
-
-        // <summary>
-        // This is a work-around fix because Blend's CategoryBase does not handle null filters (valid value)
-        // correctly.  We need to ask Blend to eventually fix this issue.
-        // </summary>
-        // <param name="filter">Filter to apply, can be null</param>
-        public override void ApplyFilter(PropertyFilter filter) 
-        {
-            if (filter == null) 
-            {
-                this.MatchesFilter = true;
-                this.BasicPropertyMatchesFilter = true;
-                this.AdvancedPropertyMatchesFilter = true;
-
-                foreach (PropertyEntry property in this.BasicProperties)
-                {
-                    property.ApplyFilter(filter);
-                }
-
-                foreach (PropertyEntry property in this.AdvancedProperties)
-                {
-                    property.ApplyFilter(filter);
-                }
-            }
-            else 
-            {
-                base.ApplyFilter(filter);
-            }
-        }
-
-        // Another Blend work-around - we expose all properties through the OM, not just the
-        // Browsable ones.  However, as a result, we need to cull the non-browsable ones from
-        // consideration.  Otherwise, empty categories may appear.
-        protected override bool DoesPropertyMatchFilter(PropertyFilter filter, PropertyEntry property) 
-        {
-            property.ApplyFilter(filter);
-
-            bool isBrowsable = true;
-            ModelPropertyEntry modelPropertyEntry = property as ModelPropertyEntry;
-            if (modelPropertyEntry != null)
-            {
-                //display given property if it is browsable or
-                isBrowsable = modelPropertyEntry.IsBrowsable || 
-                    // it may not be browsable, but if there is a category editor associated - display it anyway
-                    (this.CategoryEditors != null && this.CategoryEditors.Count != 0);
-            }
-
-            return isBrowsable && property.MatchesFilter;
-        }
-
-        // <summary>
-        // Sets the Disassociated flag on all contained properties to True
-        // </summary>
-        internal void MarkAllPropertiesDisassociated() 
-        {
-            MarkAllPropertiesDisassociated(_basicProperties);
-            MarkAllPropertiesDisassociated(_advancedProperties);
-        }
-
-        // <summary>
-        // Sets the Disassociated flag on all contained attached properties to True
-        // </summary>
-        internal void MarkAttachedPropertiesDisassociated() 
-        {
-            MarkAttachedPropertiesDisassociated(_basicProperties);
-            MarkAttachedPropertiesDisassociated(_advancedProperties);
-        }
-
-        // <summary>
-        // Removes all properties from this category whose Disassociated flag is set to True
-        // </summary>
-        internal void CullDisassociatedProperties() 
-        {
-            bool propertiesCulled = false;
-            propertiesCulled |= CullDisassociatedProperties(_basicProperties);
-            propertiesCulled |= CullDisassociatedProperties(_advancedProperties);
-
-            if (propertiesCulled)
-            {
-                FirePropertiesChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
-            }
-        }
-
-        private static void MarkAllPropertiesDisassociated(ObservableCollectionWorkaround<PropertyEntry> propertyList) 
-        {
-            foreach (ModelPropertyEntry property in propertyList)
-            {
-                property.Disassociated = true;
-            }
-        }
-
-        private static void MarkAttachedPropertiesDisassociated(ObservableCollectionWorkaround<PropertyEntry> propertyList) 
-        {
-            foreach (ModelPropertyEntry property in propertyList)
-            {
-                if (property.IsAttached)
-                {
-                    property.Disassociated = true;
-                }
-            }
-        }
-
-        private static bool CullDisassociatedProperties(ObservableCollectionWorkaround<PropertyEntry> propertyList) 
-        {
-            bool propertiesCulled = false;
-            for (int i = propertyList.Count - 1; i >= 0; i--) 
-            {
-                ModelPropertyEntry property = (ModelPropertyEntry)propertyList[i];
-                if (property.Disassociated) 
-                {
-                    property.Disconnect();
-                    propertyList.RemoveAt(i);
-                    propertiesCulled = true;
-                }
-            }
-
-            return propertiesCulled;
-        }
-
-        // INotifyCollectionChanged Members
-
-        private void FirePropertiesChanged(NotifyCollectionChangedEventArgs collectionChangedEventArgs) 
-        {
-            // Fire both "Properties" changed events
-            OnPropertyChanged("Properties");
-            OnPropertyChanged("Item[]");
-
-            // as well as the appropriate collection-changed event
-            if (CollectionChanged != null)
-            {
-                CollectionChanged(this, collectionChangedEventArgs);
-            }
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyEntry.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyEntry.cs
deleted file mode 100644 (file)
index 64d8a0f..0000000
+++ /dev/null
@@ -1,1387 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Model 
-{
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Text;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Windows.Markup;
-    using System.Windows.Media;
-
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation.Services;
-
-    using System.Activities.Presentation.Internal.Properties;
-    using System.Runtime;
-    using System.Activities.Presentation.Internal.PropertyEditing.Editors;
-
-    // <summary>
-    // ModelPropertyEntry is a wrapper around Cider's ModelProperty and that
-    // exposes its functionality through the PropertyEntry object model.  It handles
-    // all get / set / clear functionality.
-    // </summary>
-    internal class ModelPropertyEntry : ModelPropertyEntryBase, IComparable 
-    {
-        private const string _textBlockInlinesPropertyName = "Inlines";
-
-        // Property names for TextBlock properties that require special handling
-        private static string _textBlockTextPropertyName = System.Windows.Controls.TextBlock.TextProperty.Name;
-
-        // Cached values that need to be nixed when the underlying ModelProperty changes
-        // (ie. someone calls SetProperty())
-        private CachedValues _valueCache;
-
-        // List of ModelProperties that this instance wraps around.  It
-        // is guaranteed to contain at least one ModelProperty instance (single
-        // selection scenario), but it may contain multiple ModelProperty instances
-        // (multi-select scenario)
-        private List<ModelProperty> _properties = new List<ModelProperty>();
-
-        // Flag indicating whether this instance points to something valid.
-        // Used both as a perf optimization from PropertyInspector.UpdateCategories()
-        // as well as to disable the making of changes to ModelPropertyEntries
-        // when the underlying ModelProperties are no longer available.
-        private bool _disassociated;
-
-        // Bool indicating whether this property is a wrapper around the Name property
-        // (which we special case for display purposes)
-        private bool _wrapsAroundNameProperty;
-
-        // <summary>
-        // Basic ctor that wraps around a single ModelProperty
-        // </summary>
-        // <param name="property">ModelProperty to wrap around</param>
-        // <param name="parentValue">Parent PropertyValue, if any</param>
-        [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
-        public ModelPropertyEntry(ModelProperty property, ModelPropertyValue parentValue)
-            : base(parentValue) 
-        {
-
-            _valueCache = new CachedValues(this);
-            SetUnderlyingModelPropertyHelper(property, false);
-        }
-
-        // <summary>
-        // Basic ctor that wraps around multiple ModelProperties in the
-        // multi-select scenario.  The code assumes that the ModelProperties in
-        // the set all represent the same property (eg. Background) across different
-        // ModelItems (eg. Button, Grid, and ComboBox).
-        // </summary>
-        // <param name="propertySet">Set of ModelProperties to wrap around</param>
-        // <param name="parentValue">Parent PropertyValue, if any</param>
-        [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
-        public ModelPropertyEntry(IEnumerable<ModelProperty> propertySet, ModelPropertyValue parentValue)
-            : base(parentValue) 
-        {
-
-            _valueCache = new CachedValues(this);
-            SetUnderlyingModelPropertyHelper(propertySet, false);
-        }
-
-
-        // <summary>
-        // Gets the name of the contained property
-        // </summary>
-        public override string PropertyName 
-        {
-            get {
-                return _properties[0].Name;
-            }
-        }
-
-        // <summary>
-        // Gets the display name of the contained property, if any.
-        // Defaults to property name if none is found.
-        // </summary>
-        public override string DisplayName 
-        {
-            get {
-                return _valueCache.DisplayName;
-            }
-        }
-
-        // <summary>
-        // Gets the type of the contained property
-        // </summary>
-        public override Type PropertyType 
-        {
-            get {
-                return _properties[0].PropertyType;
-            }
-        }
-
-        // <summary>
-        // Gets the category name of the contained property
-        // </summary>
-        public override string CategoryName 
-        {
-            get {
-                return _valueCache.CategoryName;
-            }
-        }
-
-        // <summary>
-        // Gets the description of the contained property
-        // </summary>
-        public override string Description 
-        {
-            get {
-                return _valueCache.Description;
-            }
-        }
-
-        // <summary>
-        // Gets a flad indicating whether the property is read-only
-        // </summary>
-        public override bool IsReadOnly 
-        {
-            get {
-                return _valueCache.IsReadOnly;
-            }
-        }
-
-        // <summary>
-        // Gets a flag indicating whether the property is advanced
-        // </summary>
-        public override bool IsAdvanced 
-        {
-            get {
-                return _valueCache.IsAdvanced;
-            }
-        }
-
-        // <summary>
-        // Gets a flag indicating whether this property is browsable or not
-        // (All properties are exposed through the object model.  It's up to the
-        // UI to make the display / don't-display decision)
-        // </summary>
-        public bool IsBrowsable 
-        {
-            get {
-                return _valueCache.IsBrowsable;
-            }
-        }
-
-        // <summary>
-        // Gets a collection of standard values that can be assigned to
-        // the property
-        // </summary>
-        public override ICollection StandardValues 
-        {
-            get {
-                return _valueCache.StandardValues;
-            }
-        }
-
-        // <summary>
-        // Gets a flag indicating whether the list of StandardValues is complete
-        // or whether the user can type a value that's different from the ones in the list
-        // Note: this property is referenced from XAML
-        // </summary>
-        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        public bool StandardValuesExclusive 
-        {
-            get {
-                return _valueCache.StandardValuesExclusive;
-            }
-        }
-
-        // <summary>
-        // Gets the PropertyValueEditor for this property
-        // </summary>
-        public override PropertyValueEditor PropertyValueEditor 
-        {
-            get {
-                return _valueCache.PropertyValueEditor;
-            }
-        }
-
-        // <summary>
-        // Gets the TypeConverted for the contained property
-        // </summary>
-        public override TypeConverter Converter 
-        {
-            get {
-                return _valueCache.Converter;
-            }
-        }
-
-        // <summary>
-        // Gets the value Type for all contained properties if it matches,
-        // null otherwise
-        // </summary>
-        public override Type CommonValueType 
-        {
-            get {
-                return _valueCache.CommonValueType;
-            }
-        }
-
-        // <summary>
-        // Returns true if the contained ModelProperties don't
-        // share the same value
-        // </summary>
-        public override bool IsMixedValue 
-        {
-            get {
-                return _valueCache.IsMixedValue;
-            }
-        }
-
-        // <summary>
-        // Gets the source of the value contained by this property
-        // </summary>
-        public override PropertyValueSource Source 
-        {
-            get {
-                return _valueCache.Source;
-            }
-        }
-
-        // <summary>
-        // Gets the sub-properties of the contained property
-        // </summary>
-        public override PropertyEntryCollection SubProperties 
-        {
-            get {
-                return _valueCache.SubProperties;
-            }
-        }
-
-        // <summary>
-        // Gets the collection of PropertyValues if this ModelProperty represents
-        // a collection
-        // </summary>
-        public override PropertyValueCollection Collection 
-        {
-            get {
-                return _valueCache.Collection;
-            }
-        }
-
-        // <summary>
-        // Gets a flag indicating whether the collection instance has already
-        // been instantiated (perf optimization)
-        // </summary>
-        internal override bool CollectionInstanceExists 
-        {
-            get {
-                return _valueCache.CollectionInstanceExists;
-            }
-        }
-
-        // <summary>
-        // Gets the underlying collection of ModelProperties
-        // </summary>
-        internal ICollection<ModelProperty> ModelPropertySet 
-        {
-            get {
-                return _properties;
-            }
-        }
-
-        // <summary>
-        // Gets the first underlying ModelProperty for cases when
-        // this class wraps around multiple
-        // </summary>
-        internal ModelProperty FirstModelProperty 
-        {
-            get {
-                return _properties[0];
-            }
-        }
-
-        // <summary>
-        // Gets an order token for property ordering
-        // </summary>
-        internal PropertyOrder PropertyOrder 
-        {
-            get {
-                return _valueCache.PropertyOrder;
-            }
-        }
-
-        // <summary>
-        // Gets or sets the disassociated flag
-        // </summary>
-        internal bool Disassociated 
-        {
-            get { return _disassociated; }
-            set { _disassociated = value; }
-        }
-
-        // <summary>
-        // Gets a flag indicating whether this instance represents an attached DP
-        // </summary>
-        internal bool IsAttached 
-        {
-            get {
-                return _valueCache.IsAttached;
-            }
-        }
-
-        // <summary>
-        // Gets a list of CategoryEditor types associated with this PropertyEntry
-        // </summary>
-        internal IEnumerable<Type> CategoryEditorTypes 
-        {
-            get {
-                return _valueCache.CategoryEditorTypes;
-            }
-        }
-
-
-        // <summary>
-        // Returns true if there are standard values for this property.
-        // </summary>
-        protected override bool HasStandardValues 
-        {
-            get { return _valueCache.StandardValuesSupported; }
-        }
-
-        // <summary>
-        // Replaces the underlying ModelProperty/ies with the specified ModelProperties.
-        // Fires the appropriate PropertyChanged events
-        // </summary>
-        // <param name="propertySet">Property set to wrap around</param>
-        public void SetUnderlyingModelProperty(IEnumerable<ModelProperty> propertySet) 
-        {
-            SetUnderlyingModelPropertyHelper(propertySet, true);
-        }
-
-        private void SetUnderlyingModelPropertyHelper(ModelProperty property, bool firePropertyValueChangedEvents) 
-        {
-            if (property == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("property");
-            }
-
-            // Store the value
-            ClearUnderlyingModelProperties();
-            AddUnderlyingModelProperty(property);
-
-            // Clear any cached values
-            RefreshCache();
-
-            if (firePropertyValueChangedEvents) 
-            {
-                // Update the PropertyValue (always, except when it doesn't exist yet (ctor time))
-                this.ModelPropertyValue.OnUnderlyingModelChanged();
-            }
-        }
-
-        private void SetUnderlyingModelPropertyHelper(IEnumerable<ModelProperty> propertySet, bool firePropertyValueChangedEvents) 
-        {
-            if (propertySet == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("propertySet");
-            }
-
-            // Attempt to store the values
-            int count = 0;
-            foreach (ModelProperty property in propertySet) 
-            {
-                if (property == null)
-                {
-                    continue;
-                }
-
-                if (count == 0)
-                {
-                    ClearUnderlyingModelProperties();
-                }
-
-                AddUnderlyingModelProperty(property);
-                count++;
-            }
-
-            // Throw if the underlying property set was invalid
-            if (count == 0)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException("Cannot set the underlying ModelProperty to an empty set."));
-            }
-
-            // Clear any cached values
-            RefreshCache();
-
-            if (firePropertyValueChangedEvents) 
-            {
-                // Update the PropertyValue (always, except when it doesn't exist yet (ctor time))
-                this.ModelPropertyValue.OnUnderlyingModelChanged();
-            }
-        }
-
-        // Adds the property to the internal collection list and hooks into its PropertyChanged event
-        private void AddUnderlyingModelProperty(ModelProperty property) 
-        {
-            if (property == null)
-            {
-                return;
-            }
-
-            property.Parent.PropertyChanged += new PropertyChangedEventHandler(OnUnderlyingPropertyChanged);
-            _properties.Add(property);
-            _wrapsAroundNameProperty = "Name".Equals(property.Name);
-        }
-
-        internal void Disconnect()
-        {
-            foreach (ModelProperty property in _properties)
-            {
-                property.Parent.PropertyChanged -= new PropertyChangedEventHandler(OnUnderlyingPropertyChanged);
-            }
-        }
-
-        // Removes all properties from the internal collection and unhooks from their PropertyChanged events
-        private void ClearUnderlyingModelProperties() 
-        {
-            foreach (ModelProperty property in _properties) 
-            {
-                property.Parent.PropertyChanged -= new PropertyChangedEventHandler(OnUnderlyingPropertyChanged);
-            }
-
-            _properties.Clear();
-            _wrapsAroundNameProperty = false;
-        }
-
-        // Event handler for PropertyChanged event.  Called whenever any of the underlying properties that
-        // this ModelPropertyEntry wraps around changes.
-        private void OnUnderlyingPropertyChanged(object sender, PropertyChangedEventArgs e) 
-        {
-            if (!this.PropertyName.Equals(e.PropertyName))
-            {
-                return;
-            }
-
-            this.OnUnderlyingModelChanged();
-
-            // If this property is a sub-property of some other property we know and care
-            // about, notify the parents as well
-            PropertyValue parentValue = this.ParentValue;
-            while (parentValue != null) 
-            {
-                ModelPropertyEntryBase parentProperty = (ModelPropertyEntryBase)parentValue.ParentProperty;
-                parentProperty.OnUnderlyingSubModelChanged();
-                parentValue = parentProperty.ParentValue;
-            }
-        }
-
-        // <summary>
-        // Clear any cached values
-        // </summary>
-        protected override void RefreshCache() 
-        {
-            base.RefreshCache();
-            _valueCache.ClearAll();
-        }
-
-        // <summary>
-        // Gets the underlying value as an object instance.  Mixed values will
-        // return null.
-        // </summary>
-        // <returns>Underlying value contained by this property.</returns>
-        public override object GetValueCore() 
-        {
-            if (this.IsMixedValue)
-            {
-                return null;
-            }
-
-            object retValue = ModelUtilities.GetSafeComputedValue(_properties[0]);
-
-            return retValue;
-        }
-
-        // <summary>
-        // Sets the value of the underlying property / ies.
-        // </summary>
-        // <param name="value">Value to set</param>
-        public override void SetValueCore(object value) 
-        {
-            // If this ModelPropertyEntry instance is no longer hooked up into
-            // the underlying model, ignore calls to SetValueCore()
-            if (_disassociated)
-            {
-                return;
-            }
-
-            bool textBlockTextHackNeeded = false;
-            List<ModelProperty> textBlockTextProperties = null;
-            if (typeof(System.Windows.Controls.TextBlock).IsAssignableFrom(_properties[0].Parent.ItemType)) {
-                textBlockTextHackNeeded = true;
-            }
-
-            // POSSIBLE OPTIMIZATION: remember which properties were altered.  When on Idle we
-            // receive global property changed events, ignore the ones we know about
-            using (ModelEditingScope group = _properties[0].Parent.BeginEdit(
-                string.Format(
-                CultureInfo.CurrentCulture,
-                Resources.PropertyEditing_UndoText,
-                this.DisplayName))) 
-            {
-
-                for (int i = 0; i < _properties.Count; i++) 
-                {
-                    if (textBlockTextHackNeeded && _properties[i].Name.Equals(_textBlockTextPropertyName)) {
-                        // We need to set Text after we clear inlines!
-                        if (textBlockTextProperties == null)
-                        {
-                            textBlockTextProperties = new List<ModelProperty>();
-                        }
-                        textBlockTextProperties.Add(_properties[i]);
-                        continue;
-                    }
-                    _properties[i].SetValue(value);
-                }
-
-                // TextBlock has very bad IAddChild behavior with two properties contributing and having different
-                // views into the content (Text and Inlines).  To simplify editing, we clear Inlines when Text is set
-                // which is what most users want anyways
-                if (textBlockTextProperties != null) 
-                {
-                    foreach (ModelProperty textBlockTextProperty in textBlockTextProperties) 
-                    {
-                        ModelProperty inlinesProperty = textBlockTextProperty.Parent.Properties[_textBlockInlinesPropertyName];
-                        if (inlinesProperty != null && inlinesProperty.Collection != null)
-                        {
-                            inlinesProperty.Collection.Clear();
-                        }
-                        textBlockTextProperty.SetValue(value);
-                    }
-                }
-
-                if (group != null)
-                {
-                    group.Complete();
-                }
-            }
-
-            _valueCache.ClearValueRelatedCacheItems();
-            NotifyParentOfNameChanged();
-        }
-
-        // <summary>
-        // Clears the underlying property / ies.
-        // </summary>
-        public override void ClearValue() 
-        {
-
-            // If this ModelPropertyEntry instance is no longer hooked up into
-            // the underlying model, ignore calls to ClearValue()
-            if (_disassociated)
-            {
-                return;
-            }
-
-            // POSSIBLE OPTIMIZATION: remember which properties were altered.  When on Idle we
-            // receive global property changed events, ignore the ones we know about
-
-            using (ModelEditingScope group = _properties[0].Parent.BeginEdit(
-                string.Format(
-                CultureInfo.CurrentCulture,
-                Resources.PropertyEditing_UndoText,
-                this.DisplayName))) 
-            {
-
-                for (int i = 0; i < _properties.Count; i++) 
-                {
-                    _properties[i].ClearValue();
-                }
-
-                group.Complete();
-            }
-
-            _valueCache.ClearValueRelatedCacheItems();
-            NotifyParentOfNameChanged();
-        }
-
-        // If this property happens to wrap around the "Name" property, give our parent
-        // (if one exists) a heads-up that the value has changed.  We use this mechanism
-        // to update display names of items in a collection editor.
-        private void NotifyParentOfNameChanged() 
-        {
-            if (!_wrapsAroundNameProperty)
-            {
-                return;
-            }
-
-            ModelPropertyValue parentValue = this.ParentValue as ModelPropertyValue;
-            if (parentValue == null)
-            {
-                return;
-            }
-
-            // This PropertyEntry is the Name sub-property of another PropertyValue,
-            // so let our parent know that its name has changed.
-            parentValue.OnNameSubPropertyChanged();
-        }
-
-        // <summary>
-        // Called when the underlying ModelProperty changes.  Clears any cached
-        // values and fires the appropriate changed events.
-        // </summary>
-        internal void OnUnderlyingModelChanged() 
-        {
-            _valueCache.ClearValueRelatedCacheItems();
-            this.ModelPropertyValue.OnUnderlyingModelChanged();
-        }
-
-        // <summary>
-        // Called when the sub-property of the underlying ModelProperty changes.
-        // </summary>
-        protected override void OnUnderlyingSubModelChangedCore() 
-        {
-            _valueCache.ClearSubValueRelatedCacheItems();
-        }
-
-        // <summary>
-        // Creates new instance of ModelPropertyValue
-        // </summary>
-        // <returns>New instance of ModelPropertyValue</returns>
-        protected override PropertyValue CreatePropertyValueInstance() 
-        {
-            return new ModelPropertyValue(this);
-        }
-
-        // <summary>
-        // Opens a new ModelEditingScope
-        // </summary>
-        // <param name="description">Change description (may be null)</param>
-        // <returns>A new, opened ModelEditingScope</returns>
-        internal override ModelEditingScope BeginEdit(string description) 
-        {
-            return description == null ? FirstModelProperty.Parent.BeginEdit() : FirstModelProperty.Parent.BeginEdit(description);
-        }
-
-        // IPropertyFilterTarget Members
-
-        // <summary>
-        // IPropertyFilterTarget method.  We override the default behavior which matches
-        // both property DisplayName as well as the property Type name.
-        // </summary>
-        // <param name="predicate">the predicate to match against</param>
-        // <returns>true if there is a match</returns>
-        public override bool MatchesPredicate(PropertyFilterPredicate predicate) 
-        {
-            return predicate == null ? false : predicate.Match(this.DisplayName);
-        }
-
-
-        // IComparable Members
-
-        // <summary>
-        // Compares 'this' with the object passed into it using the ModelPropertyEntryComparer,
-        // which looks at both PropertyOrder as well as DisplayName to do the comparison
-        // </summary>
-        // <param name="obj">Object to compare this instance to</param>
-        // <returns>Comparison result</returns>
-        public int CompareTo(object obj) 
-        {
-            return PropertyEntryPropertyOrderComparer.Instance.Compare(this, obj);
-        }
-
-
-        // <summary>
-        // Debuging-friendly ToString()
-        // </summary>
-        // <returns></returns>
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
-        public override string ToString() 
-        {
-            try 
-            {
-                if (string.Equals(this.PropertyName, this.DisplayName)) 
-                {
-                    return string.Format(CultureInfo.CurrentCulture, "{0} (PropertyEntry)", this.PropertyName);
-                }
-                else 
-                {
-                    return string.Format(CultureInfo.CurrentCulture, "{0} (\"{1}\" - PropertyEntry)", this.PropertyName, this.DisplayName);
-                }
-            }
-            catch 
-            {
-                return base.ToString();
-            }
-        }
-
-        // Cached values that need to be nixed when the underlying ModelProperty changes
-        // (ie. someone calls SetProperty()).  Pretty much everything in here is an "expensive"
-        // calculation which requires us to evaluate some attributes associated with the given
-        // property or a set of properties, so we cache the return values and keep that cache
-        // in a single place so that it's easy to know what needs to be ----d when the underlying
-        // ModelProperties change.
-        private class CachedValues 
-        {
-
-            private static readonly PropertyValueEditor NoPropertyValueEditor = new PropertyValueEditor();
-            private static readonly PropertyOrder NoPropertyOrder = PropertyOrder.CreateAfter(PropertyOrder.Default);
-            private static readonly TypeConverter NoTypeConverter = new TypeConverter();
-            private static readonly ValueSerializer NoSerializer = new NoValueSerializer();
-            private static readonly Type NoCommonValueType = typeof(CachedValues); // some private type that we can use as a marker
-            private static readonly List<Type> NoCategoryEditorTypes = new List<Type>();
-            private static readonly PropertyValueSource NoSource = new NoPropertyValueSource();
-
-            private ModelPropertyEntry _parent;
-
-            // Cached values
-            private string _displayName;
-            private string _categoryName;
-            private string _description;
-            private bool? _isAdvanced;
-            private bool? _isBrowsable;
-            private bool? _isReadOnly;
-            private bool? _isAttached;
-            private ArrayList _standardValues;
-            private bool? _standardValuesExclusive;
-            private bool? _standardValuesSupported;
-            private PropertyValueEditor _propertyValueEditor;
-            private bool? _isMixedValue;
-            private PropertyValueSource _source;
-            private ModelPropertyEntryCollection _subProperties;
-            private ModelPropertyValueCollection _collection;
-            private TypeConverter _converter;
-            private ValueSerializer _valueSerializer;
-            private Type _commonValueType;
-            private PropertyOrder _propertyOrder;
-            private IEnumerable<Type> _categoryEditorTypes;
-
-            public CachedValues(ModelPropertyEntry parent) 
-            {
-                _parent = parent;
-            }
-
-            // <summary>
-            // Gets the display name of the contained property, if any.
-            // Defaults to property name if none is found.
-            // </summary>
-            public string DisplayName 
-            {
-                get {
-                    if (_displayName == null) 
-                    {
-                        _displayName =
-                            ExtensibilityAccessor.GetDisplayName(_parent.FirstModelProperty) ??
-                            _parent.PropertyName;
-                    }
-
-                    Fx.Assert(_displayName != null, "_displayName should not be null");
-                    return _displayName;
-                }
-            }
-
-            // <summary>
-            // Pick the first category name
-            // </summary>
-            public string CategoryName 
-            {
-                get {
-                    if (_categoryName == null)
-                    {
-                        _categoryName = ExtensibilityAccessor.GetCategoryName(_parent.FirstModelProperty);
-                    }
-
-                    Fx.Assert(_categoryName != null, "_categoryName should not be null");
-                    return _categoryName;
-                }
-            }
-
-            // <summary>
-            // Pick the first description
-            // </summary>
-            public string Description 
-            {
-                get {
-                    if (_description == null)
-                    {
-                        _description = ExtensibilityAccessor.GetDescription(_parent.FirstModelProperty);
-                    }
-
-                    Fx.Assert(_description != null, "_description should not be null");
-                    return _description;
-                }
-            }
-
-            // <summary>
-            // OR mutliple values of IsAdvanced together
-            // </summary>
-            public bool IsAdvanced 
-            {
-                get {
-                    if (_isAdvanced == null) 
-                    {
-                        _isAdvanced = false;
-                        for (int i = 0; i < _parent._properties.Count; i++) 
-                        {
-                            _isAdvanced |= ExtensibilityAccessor.GetIsAdvanced(_parent._properties[i]);
-                            if (_isAdvanced == true)
-                            {
-                                break;
-                            }
-                        }
-                    }
-
-                    Fx.Assert(_isAdvanced != null, "_isAdvanced should not be null");
-                    return (bool)_isAdvanced;
-                }
-            }
-
-            // <summary>
-            // AND multiple values of IsBrowsable together
-            // </summary>
-            public bool IsBrowsable 
-            {
-                get {
-                    if (_isBrowsable == null) 
-                    {
-                        _isBrowsable = true;
-                        for (int i = 0; i < _parent._properties.Count; i++) 
-                        {
-
-                            // Look for the BrowsableAttribute
-                            bool? temp = ExtensibilityAccessor.IsBrowsable(_parent._properties[i]);
-
-                            // Go by the IsReadOnly flag, if not found
-                            if (temp == null)
-                            {
-                                temp = !this.IsReadOnly;
-                            }
-                            
-                            // AND multiple values together
-                            _isBrowsable &= (bool)temp;
-
-                            if (_isBrowsable == false)
-                            {
-                                break;
-                            }
-                        }
-                    }
-
-                    Fx.Assert(_isBrowsable != null, "_isBrowsable should not be null");
-                    return (bool)_isBrowsable;
-                }
-            }
-
-            // <summary>
-            // Gets a flags indicating whether this property is read only.
-            // </summary>
-            public bool IsReadOnly 
-            {
-                get {
-                    if (_isReadOnly == null) 
-                    {
-
-                        _isReadOnly = ExtensibilityAccessor.IsReadOnly(
-                            _parent._properties,
-                            new ExtensibilityAccessor.IsMixedValueEvaluator(delegate() 
-                        {
-                            return this.IsMixedValue;
-                        }));
-
-                        Fx.Assert(_isReadOnly != null, "_isReadOnly should not be null");
-                    }
-
-                    return (bool)_isReadOnly;
-                }
-            }
-
-            // <summary>
-            // Merge collection of standard values and only present the subset that exists in all.
-            // We do fancy magic here because presenting the user with invalid set of StandardValues
-            // could actually cause bad things to happen (read: exceptions when the value is actually changed)
-            // </summary>
-            public ICollection StandardValues 
-            {
-                get {
-                    if (_standardValues == null) 
-                    {
-
-                        // Note: this.Converter will return the converter associated with _parent._properties[0]
-                        if (ExtensibilityAccessor.GetStandardValuesSupported(this.Converter)) 
-                        {
-                            _standardValues = ExtensibilityAccessor.GetStandardValues(this.Converter);
-                        }
-
-                        if (_standardValues == null)
-                        {
-                            _standardValues = new ArrayList();
-                        }
-
-                        for (int i = 1; i < _parent._properties.Count && _standardValues.Count > 0; i++) 
-                        {
-                            ArrayList nextSetOfValues = null;
-
-                            if (ExtensibilityAccessor.GetStandardValuesSupported(_parent._properties[i].Converter))
-                            {
-                                nextSetOfValues = ExtensibilityAccessor.GetStandardValues(_parent._properties[i].Converter);
-                            }
-
-                            if (nextSetOfValues == null || nextSetOfValues.Count == 0) 
-                            {
-                                // The AND of something and nothing = nothing, so clear any remaining list and exit
-                                _standardValues.Clear();
-                                break;
-                            }
-
-                            for (int j = 0; j < _standardValues.Count; j++) 
-                            {
-
-                                object expectedValue = _standardValues[j];
-
-                                if (!nextSetOfValues.Contains(expectedValue)) 
-                                {
-                                    _standardValues.RemoveAt(j);
-                                    j--;
-                                    continue;
-                                }
-                            }
-                        }
-                    }
-
-                    Fx.Assert(_standardValues != null, "_standardValues should not be null");
-                    return _standardValues;
-                }
-            }
-
-            // <summary>
-            // Gets a flag indicating whether the list of StandardValues is complete
-            // or whether the user can type a value that's different from the ones in the list
-            // </summary>
-            public bool StandardValuesExclusive 
-            {
-                get {
-                    if (_standardValuesExclusive == null) 
-                    {
-                        _standardValuesExclusive = (this.Converter == null || this.Converter.GetStandardValuesExclusive());
-                    }
-
-                    Fx.Assert(_standardValuesExclusive != null, "_standardValuesExclusive should not be null");
-                    return (bool)_standardValuesExclusive;
-                }
-            }
-
-            // <summary>
-            // Gets a flag indicating whether the StandardValues list has any contents.
-            // </summary>
-            public bool StandardValuesSupported 
-            {
-                get {
-                    if (_standardValuesSupported == null) 
-                    {
-                        _standardValuesSupported = (this.Converter != null && this.Converter.GetStandardValuesSupported());
-                    }
-
-                    Fx.Assert(_standardValuesSupported != null, "_standardValuesSupported should not be null");
-                    return (bool)_standardValuesSupported;
-                }
-            }
-
-            // <summary>
-            // Pick the editor of the first ModelProperty
-            // </summary>
-            public PropertyValueEditor PropertyValueEditor 
-            {
-                get {
-                    if (_propertyValueEditor == null) 
-                    {
-
-                        _propertyValueEditor =
-                            ExtensibilityAccessor.GetCustomPropertyValueEditor(_parent.FirstModelProperty) ??
-                            ExtensibilityAccessor.GetSubPropertyEditor(_parent.FirstModelProperty);
-
-                        if (_propertyValueEditor == null && _parent.PropertyType == typeof(bool))
-                        {
-                            _propertyValueEditor = new BoolViewEditor();
-                        }
-
-                        _propertyValueEditor = _propertyValueEditor == null ? NoPropertyValueEditor : _propertyValueEditor;
-                    }
-
-                    return _propertyValueEditor == NoPropertyValueEditor ? null : _propertyValueEditor;
-                }
-            }
-
-            public bool IsMixedValue 
-            {
-                get {
-                    if (_isMixedValue == null) 
-                    {
-
-                        _isMixedValue = false;
-
-                        if (_parent._properties.Count > 1) 
-                        {
-
-                            object mergedValue = null;
-                            string mergedValueString = null;
-                            ValueSerializer valueSerializer = null;
-
-                            for (int i = 0; i < _parent._properties.Count; i++) 
-                            {
-                                ModelProperty property = _parent._properties[i];
-                                if (i == 0) 
-                                {
-
-                                    // Note: Calling GetValue on ModelProperty has the potential to
-                                    // to reset internal stores and, even though the value doesn't change,
-                                    // we get a value changed notification.  That notification clears 
-                                    // our _isMixedValue, which, in fact, we want to retain.
-                                    //
-                                    bool oldIsMixedValue = (bool)_isMixedValue;
-                                    mergedValue = ModelUtilities.GetSafeRawValue(property);
-                                    _isMixedValue = oldIsMixedValue;
-                                }
-                                else 
-                                {
-
-                                    // See comment above
-                                    bool oldIsMixedValue = (bool)_isMixedValue;
-                                    object nextValue = ModelUtilities.GetSafeRawValue(property);
-                                    _isMixedValue = oldIsMixedValue;
-
-                                    // Are the objects equal?
-                                    if (object.Equals(mergedValue, nextValue))
-                                    {
-                                        continue;
-                                    }
-
-                                    // No, so if any of them is null, we might as well bail
-                                    if (mergedValue == null || nextValue == null) 
-                                    {
-                                        _isMixedValue = true;
-                                        break;
-                                    }
-
-                                    valueSerializer = valueSerializer ?? this.ValueSerializer;
-
-                                    // If there is no ValueSerializer found, we can't
-                                    // be clever and need to bail
-                                    if (valueSerializer == null) 
-                                    {
-                                        _isMixedValue = true;
-                                        break;
-                                    }
-
-                                    // If we can't even convert the original value to string,
-                                    // there is nothing to compare, so we bail
-                                    // the CanConvertToString call may throw an ArgumentException, for
-                                    // example if mergedValue isn't a supported type
-                                    try 
-                                    {
-                                        if (mergedValueString == null &&
-                                            !valueSerializer.CanConvertToString(mergedValue, null)) 
-                                        {
-                                            _isMixedValue = true;
-                                            break;
-                                        }
-                                    }
-                                    catch (ArgumentException) 
-                                    {
-                                        _isMixedValue = true;
-                                        break;
-                                    }
-
-                                    if (mergedValueString == null)
-                                    {
-                                        mergedValueString = valueSerializer.ConvertToString(mergedValue, null);
-                                    }
-
-                                    // Finally, check to see if the nextValue can be converted to string
-                                    // and, if so, compare it to the mergedValue.
-                                    if (!valueSerializer.CanConvertToString(nextValue, null) ||
-                                        string.CompareOrdinal(mergedValueString, valueSerializer.ConvertToString(nextValue, null)) != 0) 
-                                    {
-                                        _isMixedValue = true;
-                                        break;
-                                    }
-                                }
-                            }
-                        }
-
-                    }
-
-                    return (bool)_isMixedValue;
-                }
-            }
-
-            // <summary>
-            // Gets the source of the given property
-            // </summary>
-            public PropertyValueSource Source 
-            {
-                get {
-                    if (_source == null && this.IsMixedValue)
-                    {
-                        _source = NoSource;
-                    }
-
-                    if (_source == null) 
-                    {
-
-                        foreach (ModelProperty property in _parent._properties) 
-                        {
-
-                            if (_source == null) 
-                            {
-                                _source = ExtensibilityAccessor.GetPropertySource(property);
-
-                                // Default value if we can't figure out anything else (this should never happen)
-                                Fx.Assert(_source != null, "Could not figure out the source for property " + _parent.PropertyName);
-                                _source = _source ?? DependencyPropertyValueSource.Local;
-                            }
-                            else if (_source != ExtensibilityAccessor.GetPropertySource(property)) 
-                            {
-                                _source = NoSource;
-                                break;
-                            }
-                        }
-                    }
-
-                    return _source == NoSource ? null : _source;
-                }
-            }
-
-            public ModelPropertyEntryCollection SubProperties 
-            {
-                get {
-                    if (_subProperties == null)
-                    {
-                        _subProperties = new ModelPropertyEntryCollection(_parent);
-                    }
-
-                    return _subProperties;
-                }
-            }
-
-            public bool CollectionInstanceExists 
-            {
-                get {
-                    return _collection != null;
-                }
-            }
-
-            public ModelPropertyValueCollection Collection 
-            {
-                get {
-                    if (_collection == null)
-                    {
-                        _collection = new ModelPropertyValueCollection(_parent.ModelPropertyValue);
-                    }
-
-                    return _collection;
-                }
-            }
-
-            // <summary>
-            // Pick the first converter
-            // </summary>
-            public TypeConverter Converter 
-            {
-                get {
-                    if (_converter == null)
-                    {
-                        _converter = ExtensibilityAccessor.GetTypeConverter(_parent.FirstModelProperty) ?? NoTypeConverter;
-                    }
-
-                    return _converter == NoTypeConverter ? null : _converter;
-                }
-            }
-
-            // <summary>
-            // Gets the Type of value instance for this property.  For multi-properties,
-            // CommonValueType returns the Type of all properties if it matches, null otherwise.
-            // </summary>
-            public Type CommonValueType 
-            {
-                get {
-                    if (_commonValueType == null) 
-                    {
-
-                        foreach (ModelProperty modelProperty in _parent.ModelPropertySet) 
-                        {
-                            object value = modelProperty.ComputedValue;
-                            if (value != null) 
-                            {
-                                Type valueType = value.GetType();
-
-                                if (_commonValueType == null) 
-                                {
-                                    _commonValueType = valueType;
-                                }
-                                else if (_commonValueType != valueType) 
-                                {
-                                    _commonValueType = NoCommonValueType;
-                                    break;
-                                }
-                            }
-                            else 
-                            {
-                                _commonValueType = NoCommonValueType;
-                                break;
-                            }
-                        }
-
-                        _commonValueType = _commonValueType ?? NoCommonValueType;
-                    }
-
-                    return _commonValueType == NoCommonValueType ? null : _commonValueType;
-                }
-            }
-
-            // <summary>
-            // Pick the first PropertyOrder
-            // </summary>
-            public PropertyOrder PropertyOrder 
-            {
-                get {
-                    if (_propertyOrder == null) 
-                    {
-                        _propertyOrder = ExtensibilityAccessor.GetPropertyOrder(_parent.FirstModelProperty);
-                        _propertyOrder = _propertyOrder ?? NoPropertyOrder;
-                    }
-
-                    return _propertyOrder == NoPropertyOrder ? null : _propertyOrder;
-                }
-            }
-
-            // <summary>
-            // Gets a list of CategoryEditor types associated with this PropertyEntry
-            // </summary>
-            public IEnumerable<Type> CategoryEditorTypes 
-            {
-                get {
-                    if (_categoryEditorTypes == null) 
-                    {
-                        if (_parent.FirstModelProperty.IsAttached) 
-                        {
-                            _categoryEditorTypes = ExtensibilityAccessor.GetCategoryEditorTypes(_parent.FirstModelProperty.AttachedOwnerType);
-                        }
-                        _categoryEditorTypes = _categoryEditorTypes ?? NoCategoryEditorTypes;
-                    }
-
-                    return _categoryEditorTypes == NoCategoryEditorTypes ? null : _categoryEditorTypes;
-                }
-            }
-
-            public bool IsAttached 
-            {
-                get {
-                    if (_isAttached == null)
-                    {
-                        _isAttached = _parent.PropertyName.IndexOf('.') > -1;
-                    }
-
-                    return (bool)_isAttached;
-                }
-            }
-
-            // <summary>
-            // Gets the ValueSerializer corresponding to the property type
-            // </summary>
-            private ValueSerializer ValueSerializer 
-            {
-                get {
-                    if (_valueSerializer == null)
-                    {
-                        _valueSerializer = ValueSerializer.GetSerializerFor(_parent.PropertyType) ?? NoSerializer;
-                    }
-
-                    return _valueSerializer == NoSerializer ? null : _valueSerializer;
-                }
-            }
-
-            // Clear everything this class caches
-            public void ClearAll() 
-            {
-                _categoryName = null;
-                _description = null;
-                _isAdvanced = null;
-                _isBrowsable = null;
-                _propertyValueEditor = null;
-                _propertyOrder = null;
-                _categoryEditorTypes = null;
-                _displayName = null;
-
-                // Internal properties we don't bind to and, hence,
-                // don't need to fire PropertyChanged event:
-                _isAttached = null;
-
-                ClearValueRelatedCacheItems();
-
-                _parent.OnPropertyChanged("CategoryName");
-                _parent.OnPropertyChanged("Description");
-                _parent.OnPropertyChanged("IsAdvanced");
-                _parent.OnPropertyChanged("IsBrowsable");
-                _parent.OnPropertyChanged("PropertyValueEditor");
-                _parent.OnPropertyChanged("PropertyOrder");
-                _parent.OnPropertyChanged("CategoryEditorTypes");
-                _parent.OnPropertyChanged("DisplayName");
-            }
-
-            // Clear value-related things that this class caches
-            public void ClearValueRelatedCacheItems() 
-            {
-                _subProperties = null;
-                _collection = null;
-                _standardValues = null;
-                _standardValuesExclusive = null;
-                _converter = null;
-                _commonValueType = null;
-                _source = null;
-                _isReadOnly = null;
-                _valueSerializer = null;
-
-                ClearSubValueRelatedCacheItems();
-
-                _parent.OnPropertyChanged("StandardValues");
-                _parent.OnPropertyChanged("StandardValuesExclusive");
-                _parent.OnPropertyChanged("Converter");
-                _parent.OnPropertyChanged("CommonValueType");
-                _parent.OnPropertyChanged("IsReadOnly");
-
-                // The following properties are only exposed by ModelPropertyEntry, not PropertyEntry.
-                // People should bind to these properties through the PropertyValue.
-                // However, if they ---- up in Xaml, the binding will still work and if that happens
-                // we should try to update them when things change.
-                _parent.OnPropertyChanged("SubProperties");
-                _parent.OnPropertyChanged("Collection");
-                _parent.OnPropertyChanged("Source");
-            }
-
-            public void ClearSubValueRelatedCacheItems() 
-            {
-                _isMixedValue = null;
-
-                // The following property is only exposed by ModelPropertyEntry, not PropertyEntry.
-                // People should bind to this property through the PropertyValue.
-                // However, if they ---- up in Xaml, the binding will still work and if that happens
-                // we should try to update them when things change.
-                _parent.OnPropertyChanged("IsMixedValue");
-            }
-
-            private class NoPropertyValueSource : PropertyValueSource 
-            {
-                public NoPropertyValueSource() 
-                {
-                }
-            }
-
-            private class NoValueSerializer : ValueSerializer 
-            {
-                public NoValueSerializer() 
-                {
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyEntryBase.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyEntryBase.cs
deleted file mode 100644 (file)
index fefa12f..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Model 
-{
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Text;
-
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation.Services;
-
-    // <summary>
-    // Cider-specific base class for PropertyEntry.  It is shared by both
-    // ModelPropertyEntry and ModelPropertyIndexer.  ModelPropertyEntry is used
-    // to model regular properties that are backed by Cider's ModelProperty.
-    // ModelPropertyIndexers are used to model items in collections that are
-    // backed by Cider's ModelItems.
-    // </summary>
-    internal abstract class ModelPropertyEntryBase : PropertyEntry 
-    {
-
-        // Cache the depth of this property because once a property entry is create
-        // it doesn't jump levels.  Depth is only used to track sub-property tree's
-        // not collection trees.
-        private int _depth;
-        private string _propertyPath;
-
-        protected ModelPropertyEntryBase() : this(null) 
-        {
-        }
-        protected ModelPropertyEntryBase(PropertyValue parentValue) : base(parentValue) 
-        {
-            UpdateDepth();
-        }
-
-        public abstract PropertyValueSource Source 
-        { get; }
-        public abstract bool IsMixedValue 
-        { get; }
-        public abstract Type CommonValueType 
-        { get; }
-        public abstract TypeConverter Converter 
-        { get; }
-
-        // <summary>
-        // Gets a flag indicating whether this property exposes any sub-properties.
-        // We rely on TypeConverter.GetPropertiesSupported() for this value.
-        // </summary>
-        public bool HasSubProperties 
-        {
-            get {
-                return this.PropertyValue.Value != null && this.Converter != null &&
-                    this.Converter.GetPropertiesSupported() && !this.IsMarkupExtension;
-            }
-        }
-
-        public abstract PropertyEntryCollection SubProperties 
-        { get; }
-
-        // <summary>
-        // Gets a flag indicating whether the type of the contained property
-        // can be assigned to an IList
-        // </summary>
-        public bool IsCollection 
-        {
-            get {
-                return typeof(IList).IsAssignableFrom(this.PropertyType);
-            }
-        }
-        public abstract PropertyValueCollection Collection 
-        { get; }
-
-        // <summary>
-        // Gets the depth of this property in the PI sub-property tree
-        // </summary>
-        public virtual int Depth 
-        {
-            get {
-                return _depth;
-            }
-        }
-
-        // <summary>
-        // Gets a ',' separated path of this property through its
-        // sub-property hierarchy.
-        // </summary>
-        public string SubPropertyHierarchyPath 
-        {
-            get {
-                if (_propertyPath == null)
-                {
-                    _propertyPath = ModelUtilities.GetSubPropertyHierarchyPath(this);
-                }
-
-                return _propertyPath;
-            }
-        }
-
-        // <summary>
-        // Checks to see if the value of this property comes from a MarkupExtension
-        // </summary>
-        internal bool IsMarkupExtension 
-        {
-            get {
-                DependencyPropertyValueSource source = this.Source as DependencyPropertyValueSource;
-                return source != null && source.IsExpression;
-            }
-        }
-
-        internal abstract bool CollectionInstanceExists 
-        { get; }
-
-        // <summary>
-        // Convenience accessor
-        // </summary>
-        protected ModelPropertyValue ModelPropertyValue 
-        {
-            get {
-                return (ModelPropertyValue)this.PropertyValue;
-            }
-        }
-        public abstract object GetValueCore();
-        public abstract void SetValueCore(object value);
-        public abstract void ClearValue();
-
-        // Calculate the depth of this property in the sub-property
-        // hierarchy
-        //
-        private void UpdateDepth() 
-        {
-            if (ParentValue != null)
-            {
-                _depth = ((ModelPropertyEntryBase)ParentValue.ParentProperty).Depth + 1;
-            }
-        }
-
-        // <summary>
-        // Called when one of the sub-properties exposed by this class changes.
-        // There is a call to the concrete implementation of this class so that it
-        // can do any internal cache clean up as needed, followed by the firing
-        // of the appropriate changed events.
-        // </summary>
-        public void OnUnderlyingSubModelChanged() 
-        {
-            OnUnderlyingSubModelChangedCore();
-            this.ModelPropertyValue.OnUnderlyingSubModelChanged();
-        }
-
-        // <summary>
-        // Called when one of the sub-properties exposed by this class changes
-        // that allows the concrete implementation of this class to clean up
-        // any internal state.
-        // </summary>
-        protected abstract void OnUnderlyingSubModelChangedCore();
-
-        // <summary>
-        // Clears or updates any cached values - call this method
-        // when the underlying ModelProperty changes and cached values
-        // may have become invalid
-        // </summary>
-        protected virtual void RefreshCache() 
-        {
-            UpdateDepth();
-            _propertyPath = null;
-        }
-
-        internal abstract ModelEditingScope BeginEdit(string description);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyEntryCollection.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyEntryCollection.cs
deleted file mode 100644 (file)
index 7a6c65b..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Model 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Text;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Runtime;
-
-    // <summary>
-    // Collection of ModelPropertyEntries used to model sub-properties of PropertyValues
-    // </summary>
-    internal class ModelPropertyEntryCollection : PropertyEntryCollection 
-    {
-
-        List<ModelPropertyEntry> _properties;
-
-        // <summary>
-        // Basic ctor
-        // </summary>
-        // <param name="parentProperty">Parent property</param>
-        public ModelPropertyEntryCollection(ModelPropertyEntry parentProperty)
-            : base(parentProperty.PropertyValue) 
-        {
-
-            CreateCollection(parentProperty);
-        }
-
-        // <summary>
-        // Basic ctor
-        // </summary>
-        // <param name="parentProperty">Parent indexer</param>
-        public ModelPropertyEntryCollection(ModelPropertyIndexer parentProperty)
-            : base(parentProperty.PropertyValue) 
-        {
-
-            CreateCollection(parentProperty);
-        }
-
-        // <summary>
-        // Gets the number of PropertyEntries in this collection
-        // </summary>
-        public override int Count 
-        {
-            get {
-                return _properties == null ? 0 : _properties.Count;
-            }
-        }
-
-        // <summary>
-        // Gets the property from this collection of the given name (case sensitive)
-        // </summary>
-        // <param name="propertyName">Name to look up</param>
-        // <returns>Corresponding PropertyEntry if one exists.</returns>
-        public override PropertyEntry this[string propertyName] {
-            get {
-                if (_properties == null)
-                {
-                    return null;
-                }
-
-                foreach (ModelPropertyEntry entry in _properties)
-                {
-                    if (string.Equals(entry.PropertyName, propertyName))
-                    {
-                        return entry;
-                    }
-                }
-
-                return null;
-            }
-        }
-
-        // <summary>
-        // Gets the enumerator for this collection
-        // </summary>
-        // <returns></returns>
-        public override IEnumerator<PropertyEntry> GetEnumerator() 
-        {
-            if (_properties == null)
-            {
-                yield break;
-            }
-
-            for (int i = 0; i < _properties.Count; i++) 
-            {
-                yield return _properties[i];
-            }
-        }
-
-        // Parses the sub-properties of the given parent collection item and populates a corresponding
-        // private list of ModelPropertyEntries that represents it.
-        private void CreateCollection(ModelPropertyIndexer parentCollectionItem) 
-        {
-
-            // Assert some assumptions that should be true at this point
-            Fx.Assert(parentCollectionItem.ModelItem != null, "parentCollectionItem.ModelItem should not be null");
-
-            List<ModelProperty> subProperties = ExtensibilityAccessor.GetSubProperties(parentCollectionItem.ModelItem);
-
-            if (subProperties == null || subProperties.Count < 1)
-            {
-                return;
-            }
-
-            // At this point we have at least one ModelProperty that acts as a subProperty of the 
-            // given ModelItem.  Wrap the list in ModelPropertyEntries and exit.
-
-            _properties = new List<ModelPropertyEntry>(subProperties.Count);
-
-            for (int i = 0; i < subProperties.Count; i++) 
-            {
-                _properties.Add(new ModelPropertyEntry(subProperties[i], (ModelPropertyValue)parentCollectionItem.PropertyValue));
-            }
-
-            // Sort the sub-properties by their OrderToken as well as their name
-            if (_properties != null)
-            {
-                _properties.Sort();
-            }
-        }
-
-        private void CreateCollection(ModelPropertyEntry parentProperty) 
-        {
-
-            // Assert some assumptions that should be true at this point
-            Fx.Assert(parentProperty != null, "parentProperty should not be null");
-            Fx.Assert(parentProperty.ModelPropertySet != null, "parentProperty.ModelPropertySet should not be null");
-            Fx.Assert(parentProperty.ModelPropertySet.Count > 0, "parentProperty.ModelPropertySet.Count should be > 0");
-
-            // Ignore sub-properties of MarkupExtensions for v1
-            if (parentProperty.IsMarkupExtension)
-            {
-                return;
-            }
-
-            IEnumerable<IList<ModelProperty>> mergedSubProperties = ModelPropertyMerger.GetMergedSubProperties(parentProperty.ModelPropertySet);
-
-            int index = 0;
-            bool multiSelect = parentProperty.ModelPropertySet.Count > 1;
-            foreach (IList<ModelProperty> subPropertySet in mergedSubProperties) 
-            {
-
-                if (index == 0)
-                {
-                    _properties = new List<ModelPropertyEntry>();
-                }
-
-                ModelPropertyEntry entry;
-
-                if (multiSelect)
-                {
-                    entry = new ModelPropertyEntry(subPropertySet, (ModelPropertyValue)parentProperty.PropertyValue);
-                }
-                else
-                {
-                    entry = new ModelPropertyEntry(subPropertySet[0], (ModelPropertyValue)parentProperty.PropertyValue);
-                }
-
-                _properties.Add(entry);
-                index++;
-            }
-
-            // Sort the sub-properties by their OrderToken as well as their name
-            if (_properties != null)
-            {
-                _properties.Sort();
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyIndexer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyIndexer.cs
deleted file mode 100644 (file)
index b5504e0..0000000
+++ /dev/null
@@ -1,375 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Model 
-{
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Text;
-
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-
-    using System.Activities.Presentation.Internal.Properties;
-
-    // <summary>
-    // ModelPropertyIndexer is used to represent ModelItems in a collection.  As such
-    // and unlike ModelProperty, the class wraps around a single ModelItem instead of
-    // one or more ModelProperties.
-    // </summary>
-    internal class ModelPropertyIndexer : ModelPropertyEntryBase 
-    {
-
-        private static readonly ICollection EmptyCollection = new object[0];
-
-        private ModelItem _modelItem;
-        private int _index;
-        private ModelPropertyValueCollection _parentCollection;
-
-        private CachedValues _valueCache;
-
-        // <summary>
-        // Basic ctor.  Note, however, that this class should only be created by ModelPropertyValueCollection
-        // as that class ensures that the new instance is correctly added and removed from the
-        // ModelItemMap.
-        // </summary>
-        // <param name="modelItem">ModelItem to wrap around</param>
-        // <param name="index">Index of the ModelItem in the collection</param>
-        // <param name="parentCollection">Parent collection</param>
-        public ModelPropertyIndexer(
-            ModelItem modelItem,
-            int index,
-            ModelPropertyValueCollection parentCollection)
-            : base(parentCollection.ParentValue) 
-        {
-
-            if (modelItem == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("modelItem");
-            }
-            if (parentCollection == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("parentCollection");
-            }
-
-            _modelItem = modelItem;
-            _index = index;
-            _parentCollection = parentCollection;
-            _valueCache = new CachedValues(this);
-        }
-
-
-        // <summary>
-        // Gets the index of the underlying ModelItem.  If index &lt; 0, this
-        // ModelPropertyIndexer no longer belongs to a collection and setting its value
-        // will fail.
-        // </summary>
-        public int Index 
-        {
-            get {
-                return _index;
-            }
-            internal set {
-                _index = value;
-            }
-        }
-
-        // <summary>
-        // Gets the name category name of the parent collection
-        // </summary>
-        public override string CategoryName 
-        {
-            get {
-                return _parentCollection.ParentValue.ParentProperty.CategoryName;
-            }
-        }
-
-        // <summary>
-        // Gets the description of the parent collection
-        // </summary>
-        public override string Description 
-        {
-            get {
-                return _parentCollection.ParentValue.ParentProperty.Description;
-            }
-        }
-
-        // <summary>
-        // Gets the IsAdvanced flag of the parent collection
-        // </summary>
-        public override bool IsAdvanced 
-        {
-            get {
-                return _parentCollection.ParentValue.ParentProperty.IsAdvanced;
-            }
-        }
-
-        // <summary>
-        // Returns true
-        // </summary>
-        public override bool IsReadOnly 
-        {
-            get { return true; }
-        }
-
-        // <summary>
-        // Gets the index of this item as string
-        // </summary>
-        public override string PropertyName 
-        {
-            get {
-                return _index.ToString(CultureInfo.InvariantCulture);
-            }
-        }
-
-        // <summary>
-        // Gets the type of items in the parent collection
-        // </summary>
-        public override Type PropertyType 
-        {
-            get {
-                return _modelItem.ItemType;
-            }
-        }
-
-        // <summary>
-        // Returns null because there are no ValueEditors for values that belong to a collection
-        // </summary>
-        public override PropertyValueEditor PropertyValueEditor 
-        {
-            get {
-                // There are no ValueEditors for items in a collection
-                return null;
-            }
-        }
-
-        // <summary>
-        // Returns an empty collection - there are no StandardValues for items in a collection
-        // </summary>
-        public override ICollection StandardValues 
-        {
-            get {
-                // There are no StandardValues for items in a collection
-                return EmptyCollection;
-            }
-        }
-
-        // <summary>
-        // Returns false - ModelPropertyIndexers always wrap around a single ModelItem
-        // </summary>
-        public override bool IsMixedValue 
-        {
-            get { return false; }
-        }
-
-        // <summary>
-        // Returns Local - this PropertyEntry always contains a collection item value which is local
-        // </summary>
-        public override PropertyValueSource Source 
-        {
-            get { return DependencyPropertyValueSource.Local; }
-        }
-
-        // <summary>
-        // Gets the TypeConverter
-        // </summary>
-        public override TypeConverter Converter 
-        {
-            get {
-                return _valueCache.Converter;
-            }
-        }
-
-        // <summary>
-        // Gets the Type of the contained ModelItem
-        // </summary>
-        public override Type CommonValueType 
-        {
-            get {
-                return _modelItem.ItemType;
-            }
-        }
-
-        // <summary>
-        // Gets the sub-properties of the underlying item
-        // </summary>
-        public override PropertyEntryCollection SubProperties 
-        {
-            get {
-                return _valueCache.SubProperties;
-            }
-        }
-
-        // <summary>
-        // Gets the collection of the underlying ModelItem
-        // </summary>
-        public override PropertyValueCollection Collection 
-        {
-            get {
-                return _valueCache.Collection;
-            }
-        }
-
-        // <summary>
-        // Gets the depth of this property in the PI sub-property tree.
-        // Since this class represents an item in the collection, it's depth
-        // resets to -1 so that it's children start at depth 0 ( -1 + 1 = 0) again.
-        // </summary>
-        public override int Depth 
-        {
-            get {
-                return -1;
-            }
-        }
-
-
-        // <summary>
-        // Gets the underlying ModelItem
-        // </summary>
-        internal ModelItem ModelItem 
-        {
-            get {
-                return _modelItem;
-            }
-        }
-
-        // <summary>
-        // Gets a flag indicating whether the underlying collection instance has already been
-        // initialized.  Optimization.
-        // </summary>
-        internal override bool CollectionInstanceExists 
-        {
-            get {
-                return _valueCache.CollectionInstanceExists;
-            }
-        }
-
-        // <summary>
-        // Creates a new ModelPropertyValue instance
-        // </summary>
-        // <returns>New ModelPropertyValue instance</returns>
-        protected override PropertyValue CreatePropertyValueInstance() 
-        {
-            return new ModelPropertyValue(this);
-        }
-
-        // <summary>
-        // Gets the actual object instance respresented by this class
-        // </summary>
-        // <returns>Actual object instance respresented by this class</returns>
-        public override object GetValueCore() 
-        {
-            return _modelItem.GetCurrentValue();
-        }
-
-        // <summary>
-        // Sets the value of the collection item at the same position as the
-        // ModelItem represented by this class.  Identical to removing the old
-        // item and adding a new one
-        // </summary>
-        // <param name="value">Value to set</param>
-        public override void SetValueCore(object value) 
-        {
-            throw FxTrace.Exception.AsError(new InvalidOperationException(Resources.PropertyEditing_ErrorSetValueOnIndexer));
-        }
-
-        // <summary>
-        // Throws an exception -- invalid operation
-        // </summary>
-        public override void ClearValue() 
-        {
-            throw FxTrace.Exception.AsError(new InvalidOperationException(Resources.PropertyEditing_ClearIndexer));
-        }
-
-        // <summary>
-        // Opens a new ModelEditingScope with the specified description.
-        // </summary>
-        // <param name="description">Change description (may be null).</param>
-        // <returns>New, opened ModelEditingScope with the specified description</returns>
-        internal override ModelEditingScope BeginEdit(string description) 
-        {
-            return description == null ? _modelItem.BeginEdit() : _modelItem.BeginEdit(description);
-        }
-
-        // <summary>
-        // Called when one of the sub-properties exposed by this class changes
-        // </summary>
-        protected override void OnUnderlyingSubModelChangedCore() 
-        {
-            // Do nothing.  There is nothing in CachedValues right now that would need to
-            // be refreshed as a result of one of our sub-properties changing value
-        }
-
-        // Cached values that need to be nixed when the underlying ModelItem changes
-        // (ie. someone calls SetValueCore()).  Pretty much everything in here is an "expensive"
-        // calculation which requires us to evaluate some attributes associated with the given
-        // property of set of properties, so we cache the return values and keep that cache
-        // in a single place so that it's easy to know what needs to be ----d when the underlying
-        // ModelItem changes.
-        private class CachedValues 
-        {
-
-            private static readonly TypeConverter NoTypeConverter = new TypeConverter();
-
-            private ModelPropertyIndexer _parent;
-
-            private TypeConverter _converter;
-            private ModelPropertyEntryCollection _subProperties;
-            private ModelPropertyValueCollection _collection;
-
-            public CachedValues(ModelPropertyIndexer indexer) 
-            {
-                _parent = indexer;
-            }
-
-            public TypeConverter Converter 
-            {
-                get {
-                    if (_converter == null) 
-                    {
-                        _converter = ExtensibilityAccessor.GetTypeConverter(_parent._modelItem);
-                        _converter = _converter ?? NoTypeConverter;
-                    }
-
-                    return _converter == NoTypeConverter ? null : _converter;
-                }
-            }
-
-            public ModelPropertyEntryCollection SubProperties 
-            {
-                get {
-                    if (_subProperties == null)
-                    {
-                        _subProperties = new ModelPropertyEntryCollection(_parent);
-                    }
-
-                    return _subProperties;
-                }
-            }
-
-            public bool CollectionInstanceExists 
-            {
-                get {
-                    return _collection != null;
-                }
-            }
-
-            public ModelPropertyValueCollection Collection 
-            {
-                get {
-                    if (_collection == null)
-                    {
-                        _collection = new ModelPropertyValueCollection(_parent.ModelPropertyValue);
-                    }
-
-                    return _collection;
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyMerger.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyMerger.cs
deleted file mode 100644 (file)
index f9e06d4..0000000
+++ /dev/null
@@ -1,303 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Model
-{
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Text;
-    using System.Activities.Presentation.Model;
-
-    // <summary>
-    // Helper class that knows how to merge ModelProperties across multiple ModelItems
-    // </summary>
-    internal static class ModelPropertyMerger
-    {
-
-        private static IEnumerable<IList<ModelProperty>> _emptyCollection;
-
-        private static IEnumerable<IList<ModelProperty>> EmptyCollection
-        {
-            get
-            {
-                if (_emptyCollection == null)
-                {
-                    _emptyCollection = new List<IList<ModelProperty>>();
-                }
-
-                return _emptyCollection;
-            }
-        }
-
-        // <summary>
-        // Uber method that returns a list of list of ModelProperties that represent the
-        // merged set of properties across the specified ModelItems
-        // </summary>
-        // <param name="items">ModelItems to examine</param>
-        // <param name="itemCount">Count on ModelItems to examine</param>
-        // <returns>List of list of merged properties</returns>
-        public static IEnumerable<IList<ModelProperty>> GetMergedProperties(IEnumerable<ModelItem> items, int itemCount)
-        {
-            return GetMergedPropertiesHelper(new ModelItemExpander(items, itemCount));
-        }
-
-        // <summary>
-        // Uber method that returns a list of list of ModelProperties that represent the
-        // merged set of sub-properties across the values of the specified parent properties
-        // </summary>
-        // <param name="parentProperties">ModelProperties to examine</param>
-        // <returns>List of list of merged properties</returns>
-        public static IEnumerable<IList<ModelProperty>> GetMergedSubProperties(ICollection<ModelProperty> parentProperties)
-        {
-            return GetMergedPropertiesHelper(new SubPropertyExpander(parentProperties));
-        }
-
-        // <summary>
-        // Finds the consolidated default property name and returns it.  If there is no shared
-        // default property betweem the specified items, null is returned.
-        // </summary>
-        // <param name="items">Items to examine</param>
-        // <returns>Shared default property, if any.</returns>
-        public static string GetMergedDefaultProperty(IEnumerable<ModelItem> items)
-        {
-            if (items == null)
-            {
-                return null;
-            }
-
-            bool firstIteration = true;
-            string mergedDefaultProperty = null;
-
-            foreach (ModelItem item in items)
-            {
-                string currentDefaultProperty = ExtensibilityAccessor.GetDefaultProperty(item.ItemType);
-
-                if (firstIteration)
-                {
-                    mergedDefaultProperty = currentDefaultProperty;
-                }
-                else if (!string.Equals(currentDefaultProperty, mergedDefaultProperty))
-                {
-                    mergedDefaultProperty = null;
-                }
-
-                if (string.IsNullOrEmpty(mergedDefaultProperty))
-                {
-                    return null;
-                }
-
-                firstIteration = false;
-            }
-
-            return mergedDefaultProperty;
-        }
-
-        // Optimization that speeds up the common case (single selection)
-        private static IEnumerable<IList<ModelProperty>> GetMergedPropertiesHelper(PropertyExpander expander)
-        {
-            // Check empty list
-            if (expander == null || expander.ContainerCount == 0)
-            {
-                return EmptyCollection;
-            }
-
-            if (expander.ContainerCount == 1)
-            {
-                // Corner case - one object selected, don't bother with merging
-                return GetFirstProperties(expander);
-            }
-            else
-            {
-                // Calculate the list anew
-                return GetMergedPropertiesCore(expander);
-            }
-        }
-
-        // Optimization that speeds up the common case (single selection)
-        private static IEnumerable<IList<ModelProperty>> GetFirstProperties(PropertyExpander expander)
-        {
-            IEnumerator<IEnumerable<ModelProperty>> propertyContainers = expander.GetEnumerator();
-            propertyContainers.MoveNext();
-
-            if (propertyContainers.Current != null)
-            {
-                foreach (ModelProperty property in propertyContainers.Current)
-                {
-                    yield return new ModelProperty[] { property };
-                }
-            }
-        }
-
-        private static IEnumerable<IList<ModelProperty>> GetMergedPropertiesCore(PropertyExpander expander)
-        {
-
-            Dictionary<string, IList<ModelProperty>> counter = new Dictionary<string, IList<ModelProperty>>();
-
-            int containerCounter = 0;
-            foreach (IEnumerable<ModelProperty> properties in expander)
-            {
-
-                if (properties == null)
-                {
-                    yield break;
-                }
-
-                foreach (ModelProperty property in properties)
-                {
-
-                    IList<ModelProperty> existingModelPropertiesForProperty;
-                    if (!counter.TryGetValue(property.Name, out existingModelPropertiesForProperty))
-                    {
-
-                        if (containerCounter == 0)
-                        {
-                            existingModelPropertiesForProperty = new List<ModelProperty>(expander.ContainerCount);
-                            counter[property.Name] = existingModelPropertiesForProperty;
-                        }
-                        else
-                        {
-                            // This property has not been encountered yet in the previous objects,
-                            // so skip it altogether.
-                            continue;
-                        }
-
-                    }
-
-                    if (existingModelPropertiesForProperty.Count < containerCounter)
-                    {
-                        // There has been a ModelItem in the list that didn't have this property,
-                        // so delete any record of it and skip it in the future.
-                        counter.Remove(property.Name);
-                        continue;
-                    }
-
-                    // Verify that the properties are equivalent
-                    if (containerCounter > 0 &&
-                        !ModelUtilities.AreEquivalent(
-                        existingModelPropertiesForProperty[containerCounter - 1], property))
-                    {
-                        // They are not, so scrap this property altogether
-                        counter.Remove(property.Name);
-                        continue;
-                    }
-
-                    existingModelPropertiesForProperty.Add(property);
-                }
-
-                containerCounter++;
-            }
-
-            foreach (KeyValuePair<string, IList<ModelProperty>> pair in counter)
-            {
-                // Once again, if there is a property that is not shared by all
-                // selected items, ignore it
-                if (pair.Value.Count < containerCounter)
-                {
-                    continue;
-                }
-
-                // We should not set the same instance to multiple properties, 
-                // so ignore types that are not value type or string in case of multi-selection
-                if (pair.Value.Count > 1 && !(pair.Value[0].PropertyType.IsValueType || pair.Value[0].PropertyType.Equals(typeof(string))))
-                {
-                    continue;
-                }
-
-                yield return (IList<ModelProperty>)pair.Value;
-            }
-        }
-
-        // <summary>
-        // We use the same code to merge properties across a set of ModelItems as well
-        // as to merge sub-properties across a set of ModelProperties.  PropertyExpander
-        // class is a helper that abstracts the difference between these two inputs, so
-        // that the merge methods don't have to worry about it.
-        // </summary>
-        private abstract class PropertyExpander : IEnumerable<IEnumerable<ModelProperty>>
-        {
-            public abstract int ContainerCount
-            { get; }
-            public abstract IEnumerator<IEnumerable<ModelProperty>> GetEnumerator();
-
-            IEnumerator IEnumerable.GetEnumerator()
-            {
-                return GetEnumerator();
-            }
-        }
-
-        // <summary>
-        // Version of PropertyExpander that returns the properties of a set of ModelItems
-        // </summary>
-        private class ModelItemExpander : PropertyExpander
-        {
-
-            private IEnumerable<ModelItem> _items;
-            private int _itemCount;
-
-            public ModelItemExpander(IEnumerable<ModelItem> items, int itemCount)
-            {
-                _items = items;
-                _itemCount = itemCount;
-            }
-
-            public override int ContainerCount
-            {
-                get { return _itemCount; }
-            }
-
-            public override IEnumerator<IEnumerable<ModelProperty>> GetEnumerator()
-            {
-                if (_items == null)
-                {
-                    yield break;
-                }
-
-                foreach (ModelItem item in _items)
-                {
-                    if (item.Properties == null)
-                    {
-                        continue;
-                    }
-
-                    yield return item.Properties;
-                }
-            }
-        }
-
-        // <summary>
-        // Version of PropertyExpander that returns the sub-properties of a set of
-        // ModelProperty values.
-        // </summary>
-        private class SubPropertyExpander : PropertyExpander
-        {
-
-            private ICollection<ModelProperty> _parentProperties;
-
-            public SubPropertyExpander(ICollection<ModelProperty> parentProperties)
-            {
-                _parentProperties = parentProperties;
-            }
-
-            public override int ContainerCount
-            {
-                get { return _parentProperties == null ? 0 : _parentProperties.Count; }
-            }
-
-            public override IEnumerator<IEnumerable<ModelProperty>> GetEnumerator()
-            {
-                if (_parentProperties == null)
-                {
-                    yield break;
-                }
-
-                foreach (ModelProperty property in _parentProperties)
-                {
-                    yield return ExtensibilityAccessor.GetSubProperties(property);
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyValue.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyValue.cs
deleted file mode 100644 (file)
index 2e1e041..0000000
+++ /dev/null
@@ -1,429 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Model 
-{
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Data;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Windows;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using System.Windows.Media.Imaging;
-    using System.Text;
-
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.Resources;
-    using System.Activities.Presentation.Internal.Properties;
-    using System.Activities.Presentation.Internal.PropertyEditing.Editors;
-
-    // <summary>
-    // Concrete implementation of PropertyValue that delegates to ModelPropertyEntryBase for
-    // all actions.
-    // </summary>
-    internal class ModelPropertyValue : PropertyValue 
-    {
-
-        // Object used to mark a property value that should be cleared instead of set
-        private static readonly object ClearValueMarker = new object();
-
-        // CultureInfo instance we use for formatting values so that they reflect what is in Xaml
-        private static CultureInfo _xamlCultureInfo;
-
-        // <summary>
-        // Basic ctor
-        // </summary>
-        // <param name="parentProperty">Parent ModelPropertyEntryBase</param>
-        public ModelPropertyValue(ModelPropertyEntryBase parentProperty) : base(parentProperty) 
-        {
-        }
-
-        // <summary>
-        // Returns the source of this property value
-        // </summary>
-        public override PropertyValueSource Source 
-        {
-            get {
-                return ParentModelPropertyEntry.Source;
-            }
-        }
-
-        // <summary>
-        // Returns true if this value represents the default value of the property
-        // </summary>
-        public override bool IsDefaultValue 
-        {
-            get {
-                return Source == DependencyPropertyValueSource.DefaultValue;
-            }
-        }
-
-        // <summary>
-        // Returns true if the value contained by this property is mixed
-        // </summary>
-        public override bool IsMixedValue 
-        {
-            get {
-                return ParentModelPropertyEntry.IsMixedValue;
-            }
-        }
-
-        // <summary>
-        // Returns true if custom TypeConverter exists and if it can convert
-        // the value from string.
-        // </summary>
-        public override bool CanConvertFromString 
-        {
-            get {
-                return ParentModelPropertyEntry.Converter != null &&
-                    ParentModelPropertyEntry.Converter.CanConvertFrom(typeof(string));
-            }
-        }
-
-        // <summary>
-        // Gets a flag indicating whether this PropertyValue has sub properties
-        // </summary>
-        public override bool HasSubProperties 
-        {
-            get {
-                return ParentModelPropertyEntry.HasSubProperties;
-            }
-        }
-
-        // <summary>
-        // Gets the sub-properties of the PropertyValue
-        // </summary>
-        public override PropertyEntryCollection SubProperties 
-        {
-            get {
-                return ParentModelPropertyEntry.SubProperties;
-            }
-        }
-
-        // <summary>
-        // Gets a flag indicating whether this PropertyValue represents a collection
-        // </summary>
-        public override bool IsCollection 
-        {
-            get {
-                return ParentModelPropertyEntry.IsCollection;
-            }
-        }
-
-        // <summary>
-        // Gets the collection represented by this PropertyValue
-        // </summary>
-        public override PropertyValueCollection Collection 
-        {
-            get {
-                return ParentModelPropertyEntry.Collection;
-            }
-        }
-
-        // <summary>
-        // This is an internal helper to which we can bind and on which we fire PropertyChanged
-        // event when the Name sub-property (if one exists) changes.  More-specifically,
-        // we bind to this property in CollectionEditor to display the Type as well as the
-        // Name of the items in the collection.  This property is accessed from XAML.
-        // </summary>
-        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        public PropertyValue NameSensitiveInstance 
-        {
-            get {
-                return this;
-            }
-        }
-
-        // <summary>
-        // Always catch exceptions
-        // </summary>
-        protected override bool CatchExceptions 
-        {
-            get {
-                return true;
-            }
-        }
-
-        // <summary>
-        // Gets an en-us CultureInfo that ignores user-specified settings
-        // </summary>
-        private static CultureInfo XamlCultureInfo 
-        {
-            get {
-                if (_xamlCultureInfo == null)
-                {
-                    _xamlCultureInfo = new CultureInfo("en-us", false);
-                }
-
-                return _xamlCultureInfo;
-            }
-        }
-
-        // Convenience accessor
-        private ModelPropertyEntryBase ParentModelPropertyEntry 
-        {
-            get {
-                return (ModelPropertyEntryBase)this.ParentProperty;
-            }
-        }
-
-        // <summary>
-        // Validates the value using the TypeConverter, if one exists
-        // </summary>
-        // <param name="valueToValidate">Value to validate</param>
-        protected override void ValidateValue(object valueToValidate) 
-        {
-            // Noop.  We used to rely on TypeConverter.IsValid() here, but it turns out
-            // that a bunch of standard TypeConverters don't really work (eg. Int32TypeConverter
-            // returns true for IsValid("abc") and EnumConverter returns false for
-            // IsValid(MyEnum.One | MyEnum.Two) even if MyEnum if adorned with FlagsAttribute)
-        }
-
-        // Called when there exists a Name sub-property for this value and it changes
-        internal void OnNameSubPropertyChanged() 
-        {
-            // Updates XAML bindings (collection editor item-display-name-template for one)
-            this.OnPropertyChanged("NameSensitiveInstance");
-        }
-
-        // <summary>
-        // Convert the specified string to a value
-        // </summary>
-        // <param name="stringToConvert"></param>
-        // <returns></returns>
-        protected override object ConvertStringToValue(string stringToConvert) 
-        {
-            if (this.ParentProperty.PropertyType == typeof(string)) 
-            {
-                return stringToConvert;
-            }
-            else if (string.IsNullOrEmpty(stringToConvert)) 
-            {
-
-                // If the type of this property is string:
-                //
-                //      StringValue of ''   -> set Value to ''
-                //      StringValue of null -> ClearValue()
-                //
-                // Otherwise
-                //
-                //      StringValue of ''   -> ClearValue()
-                //      StringValue of null -> ClearValue()
-                //
-                if (stringToConvert != null && typeof(string).Equals(this.ParentProperty.PropertyType))
-                {
-                    return null;
-                }
-                else
-                {
-                    return ClearValueMarker;
-                }
-
-            }
-            else if (EditorUtilities.IsNullableEnumType(this.ParentProperty.PropertyType) && stringToConvert.Equals(EditorUtilities.NullString, StringComparison.Ordinal))
-            {
-                // PS 107537: Special case handling when converting a string to a nullable enum type.
-                return null;
-            }
-            else if (this.ParentModelPropertyEntry.Converter != null &&
-                this.ParentModelPropertyEntry.Converter.CanConvertFrom(typeof(string)))
-            {
-
-                return this.ParentModelPropertyEntry.Converter.ConvertFromString(null, XamlCultureInfo, stringToConvert);
-            }
-
-            throw FxTrace.Exception.AsError(new InvalidOperationException(string.Format(
-                CultureInfo.CurrentCulture,
-                Resources.PropertyEditing_NoStringToValueConversion,
-                this.ParentProperty.DisplayName)));
-        }
-
-        // <summary>
-        // Convert the specified value to a string
-        // </summary>
-        // <param name="valueToConvert"></param>
-        // <returns></returns>
-        protected override string ConvertValueToString(object valueToConvert) 
-        {
-            string stringValue = string.Empty;
-
-            if (valueToConvert == null) 
-            {
-                if (typeof(IList).IsAssignableFrom(this.ParentProperty.PropertyType)) 
-                {
-                    stringValue = Resources.PropertyEditing_DefaultCollectionStringValue;
-                }
-                else if (EditorUtilities.IsNullableEnumType(this.ParentProperty.PropertyType))
-                {
-                    // PS 107537: Special case handling when converting a nullable enum type to a string.
-                    return EditorUtilities.NullString;
-                }
-                return stringValue;
-            }
-            else if ((stringValue = valueToConvert as string) != null) 
-            {
-                return stringValue;
-            }
-
-            TypeConverter typeConverter = this.ParentModelPropertyEntry.Converter;
-            if (valueToConvert is Array) 
-            {
-                stringValue = Resources.PropertyEditing_DefaultArrayStringValue;
-            }
-            else if (valueToConvert is IList
-                || valueToConvert is ICollection
-                || ModelUtilities.ImplementsICollection(valueToConvert.GetType())
-                || ModelUtilities.ImplementsIList(valueToConvert.GetType())) 
-            {
-                stringValue = Resources.PropertyEditing_DefaultCollectionStringValue;
-            }
-            else if (valueToConvert is IEnumerable) 
-            {
-                stringValue = Resources.PropertyEditing_DefaultEnumerableStringValue;
-            }
-            else if (typeConverter != null && typeConverter.CanConvertTo(typeof(string))) 
-            {
-                stringValue = typeConverter.ConvertToString(null, XamlCultureInfo, valueToConvert);
-            }
-            else 
-            {
-                stringValue = valueToConvert.ToString();
-            }
-
-            return stringValue ?? string.Empty;
-        }
-
-
-        // <summary>
-        // Redirect the call to parent PropertyEntry
-        // </summary>
-        // <returns></returns>
-        protected override object GetValueCore() 
-        {
-            return ParentModelPropertyEntry.GetValueCore();
-        }
-
-        // <summary>
-        // Redirect the call to parent PropertyEntry
-        // </summary>
-        // <param name="value"></param>
-        protected override void SetValueCore(object value) 
-        {
-            if (value == ClearValueMarker)
-            {
-                ParentModelPropertyEntry.ClearValue();
-            }
-            else
-            {
-                ParentModelPropertyEntry.SetValueCore(value);
-            }
-        }
-
-        // <summary>
-        // Apply the FlowDirection to the resource.
-        // </summary>
-        private void CheckAndSetFlowDirectionResource() 
-        {
-            // Check if the value being edited is FlowDirection
-            // and if so, reset the resource to the current value that the user is setting.
-            // This will refresh the property inspector and all the string editors, showing "string" properties,
-            // would have their FlowDirection set to the current value.
-            if (ParentModelPropertyEntry.PropertyName.Equals(FrameworkElement.FlowDirectionProperty.Name)) 
-            {
-                object value = Value;
-                if (value != null) 
-                {
-                    PropertyInspectorResources.GetResources()["SelectedControlFlowDirectionRTL"] = value;
-                }
-            }
-        }
-
-        // <summary>
-        // Redirect the call to parent PropertyEntry
-        // </summary>
-        public override void ClearValue() 
-        {
-            ParentModelPropertyEntry.ClearValue();
-        }
-
-        // <summary>
-        // Fires the appropriate PropertyChanged events
-        // </summary>
-        public void OnUnderlyingModelChanged() 
-        {
-            CheckAndSetFlowDirectionResource();
-            this.NotifyRootValueChanged();
-        }
-
-        // <summary>
-        // Fires the appropriate PropertyChanged events
-        // </summary>
-        public void OnUnderlyingSubModelChanged() 
-        {
-            this.NotifySubPropertyChanged();
-        }
-
-        // <summary>
-        // Called when there is an error setting or getting a PropertyValue.
-        // Displays an error dialog.
-        // </summary>
-        // <param name="e"></param>
-        protected override void OnPropertyValueException(PropertyValueExceptionEventArgs e) 
-        {
-            if (e.Source == PropertyValueExceptionSource.Set) 
-            {
-                if (e.Exception != null) 
-                {
-                    Debug.WriteLine(e.Exception.ToString());
-                }
-
-                ErrorReporting.ShowErrorMessage(e.Exception.Message);
-
-                base.OnPropertyValueException(e);
-            }
-            else 
-            {
-                base.OnPropertyValueException(e);
-            }
-        }
-
-        // <summary>
-        // Debuging-friendly ToString()
-        // </summary>
-        // <returns></returns>
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
-        public override string ToString() 
-        {
-            try 
-            {
-                string value;
-                if (this.Value == null)
-                {
-                    value = "{null}";
-                }
-                else 
-                {
-                    value = this.StringValue;
-                    if (string.IsNullOrEmpty(value))
-                    {
-                        value = "{empty}";
-                    }
-                }
-
-                return string.Format(CultureInfo.CurrentCulture, "{0} (PropertyValue)", value ?? "{null}");
-            }
-            catch 
-            {
-                return base.ToString();
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyValueCollection.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelPropertyValueCollection.cs
deleted file mode 100644 (file)
index 2a98410..0000000
+++ /dev/null
@@ -1,530 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Model 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Collections.Specialized;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Text;
-
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-
-    using System.Activities.Presentation.Internal.Properties;
-    using System.Runtime;
-
-    // <summary>
-    // Collection of ModelPropertyValues used to model collections of ModelItems
-    // </summary>
-    internal class ModelPropertyValueCollection : PropertyValueCollection 
-    {
-
-        private List<ModelPropertyIndexer> _values;
-        private bool _listenToCollectionChanges = true;
-
-        // <summary>
-        // Basic ctor
-        // </summary>
-        // <param name="parentValue">Parent PropertyValue</param>
-        public ModelPropertyValueCollection(ModelPropertyValue parentValue) : base(parentValue) 
-        {
-            if (parentValue == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("parentValue");
-            }
-
-            // Wrap each existing item in the collection in ModelPropertyEntryIndexer
-            ModelItemCollection collection = this.GetRawCollection();
-            if (collection != null && collection.Count > 0) 
-            {
-                _values = new List<ModelPropertyIndexer>();
-                int i = 0;
-                foreach (ModelItem item in collection) 
-                {
-                    _values.Add(CreateModelPropertyIndexer(item, i++));
-                }
-            }
-
-            // Hook into the collection changed events
-            if (collection != null)
-            {
-                collection.CollectionChanged += new NotifyCollectionChangedEventHandler(OnUnderlyingCollectionChanged);
-            }
-        }
-
-        // <summary>
-        // Gets the number of items in this collection
-        // </summary>
-        public override int Count 
-        {
-            get {
-                return _values == null ? 0 : _values.Count;
-            }
-        }
-
-        // <summary>
-        // Gets the PropertyValue at the specified index
-        // </summary>
-        // <param name="index">Index to look up</param>
-        // <returns>PropertyValue at the specified index</returns>
-        public override PropertyValue this[int index] {
-            get {
-                VerifyExistingIndex(index);
-                return _values[index].PropertyValue;
-            }
-        }
-
-        // <summary>
-        // Adds the specified object to this collection, returning its wrapped version
-        // </summary>
-        // <param name="value">Value to add and wrap in PropertyValue</param>
-        // <returns>Wrapped value</returns>
-        public override PropertyValue Add(object value) 
-        {
-            return Insert(value, this.Count);
-        }
-
-        // <summary>
-        // Inserts the specified object into this collection, returning its wrapped version
-        // </summary>
-        // <param name="value">Value to insert and wrap</param>
-        // <param name="index">Index to insert at</param>
-        // <returns>Wrapped version of the inserted value</returns>
-        public override PropertyValue Insert(object value, int index) 
-        {
-            VerifyNewIndex(index);
-
-            if (_values == null)
-            {
-                _values = new List<ModelPropertyIndexer>();
-            }
-
-            ModelItem item;
-            bool previouslyActive = SnoozeListeningToCollectionChanges();
-            try 
-            {
-                item = GetRawCollection().Insert(index, value);
-            }
-            finally 
-            {
-                StartListeningToCollectionChanges(previouslyActive);
-            }
-
-            return InsertExternal(item, index);
-        }
-
-        // Same as Insert(), except it doesn't modify the raw collection, because it assumes
-        // that the raw collection was already modified externally.
-        private PropertyValue InsertExternal(ModelItem item, int index) 
-        {
-            if (_values == null)
-            {
-                _values = new List<ModelPropertyIndexer>();
-            }
-
-            PropertyValue insertedValue = InsertHelper(item, index);
-
-            // Fire OnChanged event
-            this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, insertedValue, index));
-
-            return insertedValue;
-        }
-
-        // Updates internal structures, but does not fire any notification
-        private PropertyValue InsertHelper(ModelItem item, int index) 
-        {
-            // Only insert the value into the collection, if it's not already there.
-            // Say that an ItemAdded event comes in even though this collection has not yet been used.
-            // By requesting the instance of this collection for the first time, the collection
-            // gets populated correctly and fully.  Now when InsertExternal is called as a result
-            // of the ItemAdded event, we would be adding the new item into the collection twice.
-            // We need to prevent that from happening.
-            if (_values.Count > index &&
-                object.Equals(_values[index].ModelItem, item))
-            {
-                return _values[index].PropertyValue;
-            }
-
-            ModelPropertyIndexer indexer = CreateModelPropertyIndexer(item, index);
-            _values.Insert(index, indexer);
-
-            // Adjust all indexes of the remaining indexers in the list
-            for (int i = index + 1; i < _values.Count; i++)
-            {
-                _values[i].Index++;
-            }
-
-            return indexer.PropertyValue;
-        }
-
-        // <summary>
-        // Removes the specified PropertyValue from the collection.
-        // </summary>
-        // <param name="property">Property to remove</param>
-        // <returns>True, if the PropertyValue was found and removed, false
-        // otherwise.</returns>
-        public override bool Remove(PropertyValue propertyValue) 
-        {
-            if (propertyValue == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("property");
-            }
-
-            if (_values == null)
-            {
-                return false;
-            }
-
-            for (int i = 0; i < _values.Count; i++) 
-            {
-                if (_values[i].PropertyValue == propertyValue) {
-                    this.RemoveAt(i);
-                    return true;
-                }
-            }
-
-            // Call to RemoveAt() already fires the right CollectionChanged events
-            return false;
-        }
-
-        // Same as Remove, except it doesn't modify the raw collection, because it's
-        // assumed that the raw collection was already modified externally.
-        private bool RemoveExternal(ModelItem item) 
-        {
-            Fx.Assert(item != null, "item parameter should not be null");
-            Fx.Assert(_values != null, "_values parameter should not be null");
-
-            for (int i = 0; i < _values.Count; i++) 
-            {
-                if (_values[i].ModelItem == item) {
-                    this.RemoveAtExternal(i);
-                    return true;
-                }
-            }
-
-            return false;
-        }
-
-        // <summary>
-        // Removes the PropertyValue at the specified index.
-        // </summary>
-        // <param name="index">Index at which to remove the value.</param>
-        public override void RemoveAt(int index) 
-        {
-            VerifyExistingIndex(index);
-
-            bool previouslyActive = SnoozeListeningToCollectionChanges();
-            try 
-            {
-                this.GetRawCollection().RemoveAt(index);
-            }
-            finally 
-            {
-                StartListeningToCollectionChanges(previouslyActive);
-            }
-
-            RemoveAtExternal(index);
-        }
-
-        // Same as RemoveAt, except it doesn't modify the raw collection, because it's
-        // assumed that the raw collection was already modified externally.
-        private void RemoveAtExternal(int index) 
-        {
-            VerifyExistingIndex(index);
-            PropertyValue removedValue = RemoveAtHelper(index);
-
-            // Fire OnChanged event
-            this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, removedValue, index));
-        }
-
-        // Updates internal structures, but does not fire any notification
-        private PropertyValue RemoveAtHelper(int index) 
-        {
-            // invalidate the ModelPropertyEntryIndexer at the index and adjust all other indexes
-            ModelPropertyIndexer indexer = _values[index];
-            DestroyModelPropertyIndexer(indexer);
-
-            _values.RemoveAt(index);
-            for (int i = index; i < _values.Count; i++)
-            {
-                _values[i].Index--;
-            }
-
-            return indexer.PropertyValue;
-        }
-
-        // Replaces the old ModelItem with the new one, assuming that the raw collection
-        // has already been verified
-        private void ReplaceExternal(ModelItem oldItem, ModelItem newItem) 
-        {
-            Fx.Assert(_values != null, "_values parameter should not be null");
-            Fx.Assert(oldItem != null, "oldItem parameter should not be null");
-            Fx.Assert(newItem != null, "newItem parameter should not be null");
-
-            for (int i = 0; i < _values.Count; i++) 
-            {
-                if (_values[i].ModelItem == oldItem) {
-                    this.RemoveAtHelper(i);
-                    this.InsertHelper(newItem, i);
-
-                    // Fire OnChanged event
-                    this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, _values[i].PropertyValue));
-                    return;
-                }
-            }
-
-            Debug.Fail("Didn't find the expected item to remove");
-        }
-
-        // Clears the collection, assuming that the raw collection was already cleared externally
-        private void ClearExternal() 
-        {
-            _values.Clear();
-            this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
-        }
-
-        // <summary>
-        // Swaps the items at the specified indexes
-        // </summary>
-        // <param name="currentIndex">Index of item 1</param>
-        // <param name="newIndex">Index of item 2</param>
-        public override void SetIndex(int currentIndex, int newIndex) 
-        {
-
-            VerifyExistingIndex(currentIndex);
-            VerifyExistingIndex(newIndex);
-
-            if (currentIndex == newIndex)
-            {
-                return;
-            }
-
-            ModelItemCollection collection = this.GetRawCollection();
-            ModelPropertyIndexer currentIndexer = _values[currentIndex];
-            ModelPropertyIndexer newIndexer = _values[newIndex];
-
-            bool previouslyActive = SnoozeListeningToCollectionChanges();
-            try 
-            {
-                // Remove the higher index first (doesn't affect the value of the lower index)
-                if (currentIndex < newIndex) 
-                {
-                    collection.RemoveAt(newIndex);
-                    collection.RemoveAt(currentIndex);
-                }
-                else 
-                {
-                    collection.RemoveAt(currentIndex);
-                    collection.RemoveAt(newIndex);
-                }
-
-                // Insert the lower index first (fixes the value of the higher index)
-                if (currentIndex < newIndex) 
-                {
-                    collection.Insert(currentIndex, newIndexer.ModelItem);
-                    collection.Insert(newIndex, currentIndexer.ModelItem);
-                }
-                else 
-                {
-                    collection.Insert(newIndex, currentIndexer.ModelItem);
-                    collection.Insert(currentIndex, newIndexer.ModelItem);
-                }
-            }
-            finally 
-            {
-                StartListeningToCollectionChanges(previouslyActive);
-            }
-
-            SetIndexExternal(currentIndex, newIndex);
-        }
-
-        // Same as SetIndex, except it doesn't modify the raw collection, because it's
-        // assumed that the raw collection was already modified externally.
-        private void SetIndexExternal(int currentIndex, int newIndex) 
-        {
-
-            if (currentIndex == newIndex)
-            {
-                return;
-            }
-
-            ModelPropertyIndexer currentIndexer = _values[currentIndex];
-            ModelPropertyIndexer newIndexer = _values[newIndex];
-
-            // Remove the higher index first (doesn't affect the value of the lower index)
-            if (currentIndex < newIndex) 
-            {
-                _values.RemoveAt(newIndex);
-                _values.RemoveAt(currentIndex);
-            }
-            else 
-            {
-                _values.RemoveAt(currentIndex);
-                _values.RemoveAt(newIndex);
-            }
-
-            // Insert the lower index first (fixes the value of the higher index)
-            if (currentIndex < newIndex) 
-            {
-                _values.Insert(currentIndex, newIndexer);
-                _values.Insert(newIndex, currentIndexer);
-            }
-            else 
-            {
-                _values.Insert(newIndex, currentIndexer);
-                _values.Insert(currentIndex, newIndexer);
-            }
-
-            newIndexer.Index = currentIndex;
-            currentIndexer.Index = newIndex;
-
-            // Fire OnChanged event
-            this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(
-                NotifyCollectionChangedAction.Move, currentIndexer.PropertyValue, newIndex, currentIndex));
-        }
-
-        // <summary>
-        // Gets the underlying ModelItemCollection
-        // </summary>
-        // <returns>The underlying ModelItemCollection</returns>
-        internal ModelItemCollection GetRawCollection() 
-        {
-            ModelPropertyEntry parentAsEntry = ParentValue.ParentProperty as ModelPropertyEntry;
-            if (parentAsEntry != null)
-            {
-                return parentAsEntry.FirstModelProperty.Collection;
-            }
-
-            ModelPropertyIndexer parentAsIndexer = ParentValue.ParentProperty as ModelPropertyIndexer;
-            if (parentAsIndexer != null) 
-            {
-                ModelItemCollection modelItemCollection = parentAsIndexer.ModelItem as ModelItemCollection;
-
-                // If the parent is an indexer, that means we are a collection within another collection
-                // and the ModelItem of the indexer is really a ModelItemCollection.
-                Fx.Assert(modelItemCollection != null, "modelItemCollection should not be null");
-
-                return modelItemCollection;
-            }
-
-            Debug.Fail("A new class was introduced that derives from PropertyEntry.  Need to update ModelPropertyValueCollection code as well.");
-            return null;
-        }
-
-        // <summary>
-        // Gets the enumerator over this collection
-        // </summary>
-        // <returns>Enumerator over this collection</returns>
-        public override IEnumerator<PropertyValue> GetEnumerator() 
-        {
-            if (_values == null)
-            {
-                yield break;
-            }
-
-            foreach (ModelPropertyIndexer value in _values) 
-            {
-                yield return value.PropertyValue;
-            }
-        }
-
-        // Handler for all collection changed events that happen through the model
-        private void OnUnderlyingCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) 
-        {
-            if (!_listenToCollectionChanges)
-            {
-                return;
-            }
-
-            switch (e.Action) 
-            {
-                case NotifyCollectionChangedAction.Add:
-                    int startingIndex = e.NewStartingIndex < 0 ? this.Count : e.NewStartingIndex;
-                    foreach (ModelItem item in e.NewItems) 
-                    {
-                        this.InsertExternal(item, startingIndex++);
-                    }
-                    break;
-
-                case NotifyCollectionChangedAction.Remove:
-                    foreach (ModelItem item in e.OldItems) 
-                    {
-                        this.RemoveExternal(item);
-                    }
-                    break;
-
-                case NotifyCollectionChangedAction.Move:
-                    int oldIndex = e.OldStartingIndex, newIndex = e.NewStartingIndex;
-                    for (int i = 0; i < e.OldItems.Count; i++) 
-                    {
-                        this.SetIndexExternal(oldIndex++, newIndex++);
-                    }
-
-                    break;
-
-                case NotifyCollectionChangedAction.Replace:
-                    for (int i = 0; i < e.OldItems.Count; i++) 
-                    {
-                        ModelItem oldItem = e.OldItems[i] as ModelItem;
-                        ModelItem newItem = e.NewItems[i] as ModelItem;
-                        this.ReplaceExternal(oldItem, newItem);
-                    }
-                    break;
-
-                case NotifyCollectionChangedAction.Reset:
-                    this.ClearExternal();
-                    break;
-            }
-        }
-
-        // Activates the CollectionChanged event handler
-        private void StartListeningToCollectionChanges(bool previousValue) 
-        {
-            _listenToCollectionChanges = previousValue;
-        }
-
-        // Suspends the CollectionChanged event handler
-        private bool SnoozeListeningToCollectionChanges() 
-        {
-            bool previousValue = _listenToCollectionChanges;
-            _listenToCollectionChanges = false;
-            return previousValue;
-        }
-
-        [SuppressMessage("Microsoft.Usage", "CA2201:DoNotRaiseReservedExceptionTypes")]
-        private void VerifyExistingIndex(int index) 
-        {
-            if (_values == null || _values.Count <= index || index < 0)
-            {
-                throw FxTrace.Exception.AsError(new IndexOutOfRangeException(index.ToString(CultureInfo.InvariantCulture)));
-            }
-        }
-
-        [SuppressMessage("Microsoft.Usage", "CA2201:DoNotRaiseReservedExceptionTypes")]
-        private void VerifyNewIndex(int index) 
-        {
-            if ((_values == null && index != 0) ||
-                (_values != null && _values.Count < index) ||
-                index < 0)
-            {
-                throw FxTrace.Exception.AsError(new IndexOutOfRangeException(index.ToString(CultureInfo.InvariantCulture)));
-            }
-        }
-
-        private ModelPropertyIndexer CreateModelPropertyIndexer(ModelItem item, int index) 
-        {
-            ModelPropertyIndexer indexer = new ModelPropertyIndexer(item, index, this);
-            return indexer;
-        }
-
-        private static void DestroyModelPropertyIndexer(ModelPropertyIndexer indexer) 
-        {
-            indexer.Index = -1;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelUtilities.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/ModelUtilities.cs
deleted file mode 100644 (file)
index 9c27ef2..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Model
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Text;
-    using System.Windows.Markup;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-
-    // <summary>
-    // Static class full of useful helpers
-    // </summary>
-    internal static class ModelUtilities
-    {
-        public static Type GetPropertyType(IEnumerable<ModelProperty> propertySet)
-        {
-            // all the ModelProperty should be of the same type, so returning the first type.
-            foreach (ModelProperty property in propertySet)
-            {
-                return property.PropertyType;
-            }
-            return null;
-        }
-
-        // <summary>
-        // Compares the name and Type of the specified ModelProperties,
-        // returning true if they are equal.
-        // </summary>
-        // <param name="a">ModelProperty A</param>
-        // <param name="b">ModelProperty B</param>
-        // <returns>True if the names and Types of the specified ModelProperties
-        // match, false otherwise.</returns>
-        public static bool AreEquivalent(ModelProperty a, ModelProperty b)
-        {
-            return object.Equals(a.Name, b.Name) &&
-                object.Equals(a.PropertyType, b.PropertyType);
-        }
-
-        // <summary>
-        // Gets the underlying value object of the specified ModelProperty.  MarkupExtensions
-        // (resources and such) will be returned as they are, with the exception of NullExtension,
-        // which will be returned as null.
-        // </summary>
-        // <param name="property">ModelProperty to ---- open (can be null)</param>
-        // <returns>Underlying value object, if any</returns>
-        public static object GetSafeRawValue(ModelProperty property)
-        {
-            return GetSafeValue(property, false);
-        }
-
-        // <summary>
-        // Gets the underlying computed value object of the specified ModelProperty.  MarkupExtensions
-        // (resources and such) will be resolved into their final value.
-        // </summary>
-        // <param name="property">ModelProperty to ---- open (can be null)</param>
-        // <returns>Underlying value object, if any</returns>
-        public static object GetSafeComputedValue(ModelProperty property)
-        {
-            return GetSafeValue(property, true);
-        }
-
-        private static object GetSafeValue(ModelProperty property, bool resolveReferences)
-        {
-            if (property == null)
-            {
-                return null;
-            }
-
-            object value;
-
-            // We have to special case TextBlock due to IAddChild behavior with Text and Inlines
-            if (resolveReferences && !(typeof(System.Windows.Controls.TextBlock).IsAssignableFrom(property.Parent.ItemType) &&
-                property.Name.Equals(System.Windows.Controls.TextBlock.TextProperty.Name)))
-            {
-                value = property.ComputedValue;
-            }
-            else
-            {
-                value = property.Value == null ? null : property.Value.GetCurrentValue();
-            }
-
-            if (value == null || value.GetType().Equals(typeof(NullExtension)))
-            {
-                return null;
-            }
-
-            return value;
-        }
-
-        // <summary>
-        // Looks for the x:Name or Name property of the given PropertyValue and returns it if found.
-        // Note: this method is expensive because it evaluates all the sub-properties of the given
-        // PropertyValue.
-        // </summary>
-        // <param name="propertyValue">PropertyValue instance to look at</param>
-        // <returns>Name if the PropertyValue defines one, null otherwise</returns>
-        public static string GetPropertyName(PropertyValue propertyValue)
-        {
-            if (propertyValue == null)
-            {
-                return null;
-            }
-
-            if (propertyValue.HasSubProperties)
-            {
-                PropertyEntry nameProperty = propertyValue.SubProperties["Name"];
-                if (nameProperty != null)
-                {
-                    return nameProperty.PropertyValue.StringValue;
-                }
-            }
-
-            return null;
-        }
-
-        // <summary>
-        // Returns ',' separated property name for sub-properties, going all the way
-        // to the root ancestor in the property editing OM.  (ie. you get strings
-        // such as 'ContextMenu,IsEnabled' instead of just 'IsEnabled'.
-        // </summary>
-        // <param name="property">Property to get the name of</param>
-        // <returns>',' separated property name for sub-properties</returns>
-        public static string GetSubPropertyHierarchyPath(PropertyEntry property)
-        {
-            if (property == null)
-            {
-                return null;
-            }
-
-            if (property.ParentValue == null)
-            {
-                return property.PropertyName;
-            }
-
-            StringBuilder sb = new StringBuilder();
-            do
-            {
-                if (sb.Length > 0)
-                {
-                    sb.Insert(0, ',');
-                }
-
-                sb.Insert(0, property.PropertyName);
-                property = property.ParentValue == null ? null : property.ParentValue.ParentProperty;
-
-            } while (property != null && !(property is ModelPropertyIndexer));
-
-            return sb.ToString();
-        }
-
-        // <summary>
-        // Same as GetSubPropertyHierarchyPath(), but it looks up a cached version
-        // of this path, if one exists, or calculates one from scratch and caches it
-        // if it doesn't.
-        // </summary>
-        // <param name="property">Property to get the name of</param>
-        // <returns>',' separated property name for sub-properties</returns>
-        public static string GetCachedSubPropertyHierarchyPath(PropertyEntry property)
-        {
-            ModelPropertyEntry mpe = property as ModelPropertyEntry;
-            return mpe == null ? GetSubPropertyHierarchyPath(property) : mpe.SubPropertyHierarchyPath;
-        }
-
-        // <summary>
-        // Determines whether the specified type is implement generic Ilist interface.
-        // </summary>
-        // <param name="type">The type.</param>
-        // <returns>
-        // <c>true</c> if the specified type is implement generic Ilist interface;otherwise, <c>false</c>.
-        // </returns>
-        public static bool ImplementsIList(Type type)
-        {
-            bool ret = false;
-            if (!type.IsGenericType)
-            {
-                ret = false;
-            }
-            Type[] interfaceTypes = type.GetInterfaces();
-            foreach (Type interfaceType in interfaceTypes)
-            {
-                if (interfaceType.IsGenericType &&
-                    interfaceType.GetGenericTypeDefinition() == typeof(IList<>))
-                {
-                    ret = true;
-                    break;
-                }
-            }
-            return ret;
-        }
-
-        // <summary>
-        // Determines whether the specified type is implement generic ICollection interface.
-        // </summary>
-        // <param name="type">The type.</param>
-        // <returns>
-        // <c>true</c> if the specified type is implement generic ICollection interface;otherwise, <c>false</c>.
-        // </returns>
-        public static bool ImplementsICollection(Type type)
-        {
-            bool ret = false;
-            if (!type.IsGenericType)
-            {
-                ret = false;
-            }
-            Type[] interfaceTypes = type.GetInterfaces();
-            foreach (Type interfaceType in interfaceTypes)
-            {
-                if (interfaceType.IsGenericType &&
-                    interfaceType.GetGenericTypeDefinition() == typeof(ICollection<>))
-                {
-                    ret = true;
-                    break;
-                }
-            }
-            return ret;
-        }
-
-        // <summary>
-        // Tries to determine the common type ancestor of the specified types
-        // </summary>
-        // <param name="t1">Type 1</param>
-        // <param name="t2">Type 2</param>
-        // <returns>Common ancestor Type, if any</returns>
-        public static Type GetCommonAncestor(Type t1, Type t2)
-        {
-            if (t1 == null || t2 == null)
-            {
-                return null;
-            }
-
-            if (t1 == typeof(object) || t2 == typeof(object))
-            {
-                return typeof(object);
-            }
-
-            if (t1.IsAssignableFrom(t2))
-            {
-                return t1;
-            }
-
-            while (t2 != typeof(object))
-            {
-                if (t2.IsAssignableFrom(t1))
-                {
-                    return t2;
-                }
-
-                t2 = t2.BaseType;
-            }
-
-            return typeof(object);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/PropertyEntryNameComparer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/PropertyEntryNameComparer.cs
deleted file mode 100644 (file)
index 4d29abf..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Model 
-{
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-
-    using System.Activities.Presentation.PropertyEditing;
-
-    // <summary>
-    // Compares PropertyEntry instances solely on their DisplayName
-    // </summary>
-    internal class PropertyEntryNameComparer : IComparer, IComparer<PropertyEntry> 
-    {
-
-        public static readonly PropertyEntryNameComparer Instance = new PropertyEntryNameComparer();
-
-        private static int CompareCore(object x, object y) 
-        {
-            ModelPropertyEntry j = x as ModelPropertyEntry;
-            ModelPropertyEntry k = y as ModelPropertyEntry;
-
-            if (j == null && k == null) 
-            {
-                return 0;
-            }
-            if (j == null) 
-            {
-                return -1;
-            }
-            if (k == null) 
-            {
-                return 1;
-            }
-
-            return string.Compare(j.DisplayName, k.DisplayName, StringComparison.CurrentCulture);
-        }
-
-        // IComparer<PropertyEntry> Members
-
-        public int Compare(PropertyEntry x, PropertyEntry y) 
-        {
-            return CompareCore(x, y);
-        }
-
-
-        // IComparer Members
-
-        public int Compare(object x, object y) 
-        {
-            return CompareCore(x, y);
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/PropertyEntryPropertyOrderComparer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Model/PropertyEntryPropertyOrderComparer.cs
deleted file mode 100644 (file)
index e80e1d6..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Model 
-{
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Activities.Presentation.PropertyEditing;
-
-    // <summary>
-    // Compares PropertyEntry instances based on their PropertyOrder tokens
-    // as well as their DisplayNames
-    // </summary>
-    internal class PropertyEntryPropertyOrderComparer : IComparer, IComparer<PropertyEntry> 
-    {
-
-        private static readonly PropertyOrder DefaultOrder = PropertyOrder.Default;
-        private static PropertyEntryPropertyOrderComparer _instance;
-
-        // <summary>
-        // Gets a singleton instance of this class
-        // </summary>
-        public static PropertyEntryPropertyOrderComparer Instance 
-        {
-            get {
-                if (_instance == null)
-                {
-                    _instance = new PropertyEntryPropertyOrderComparer();
-                }
-
-                return _instance;
-            }
-        }
-
-        // <summary>
-        // Compares two instances of PropertyEntry class, using both
-        // PropertyOrder and DisplayName to cast its vote.
-        // </summary>
-        // <param name="x">Left side</param>
-        // <param name="y">Right side</param>
-        // <returns>Comparison result</returns>
-        public int Compare(object x, object y) 
-        {
-            return CompareCore(x, y);
-        }
-
-        // <summary>
-        // Compares two instances of PropertyEntry class, using both
-        // PropertyOrder and DisplayName to cast its vote.
-        // Same method, different signature.
-        // </summary>
-        // <param name="x">Left</param>
-        // <param name="y">Right</param>
-        // <param name="x">Left side</param>
-        // <param name="y">Right side</param>
-        // <returns>Comparison result</returns>
-        public int Compare(PropertyEntry x, PropertyEntry y) 
-        {
-            return CompareCore(x, y);
-        }
-
-        private static int CompareCore(object x, object y) 
-        {
-            ModelPropertyEntry j = x as ModelPropertyEntry;
-            ModelPropertyEntry k = y as ModelPropertyEntry;
-
-            if (j == null && k == null) 
-            {
-                return 0;
-            }
-            if (j == null) 
-            {
-                return -1;
-            }
-            if (k == null) 
-            {
-                return 1;
-            }
-
-            PropertyOrder a = j.PropertyOrder ?? DefaultOrder;
-            PropertyOrder b = k.PropertyOrder ?? DefaultOrder;
-
-            int result = a.CompareTo(b);
-
-            return result != 0 ? result : string.Compare(j.DisplayName, k.DisplayName, StringComparison.CurrentCulture);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyInspector.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyInspector.xaml.cs
deleted file mode 100644 (file)
index a97aca1..0000000
+++ /dev/null
@@ -1,1052 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing
-{
-    using System;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Controls;
-    using System.Windows.Media;
-    using System.Windows.Media.Imaging;
-    using System.Windows.Shapes;
-    using System.Windows.Threading;
-
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.Model;
-    using View = System.Activities.Presentation.View;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Runtime;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.Automation;
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.ValueEditors;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using ModelUtilities = System.Activities.Presentation.Internal.PropertyEditing.Model.ModelUtilities;
-    using System.Activities.Presentation.Internal.PropertyEditing.Resources;
-    using System.Activities.Presentation.Internal.PropertyEditing.Selection;
-    using System.Activities.Presentation.Internal.PropertyEditing.State;
-    using System.Text;
-    using Microsoft.Activities.Presentation;
-
-    // <summary>
-    // The main control that acts as the PropertyInspector
-    // </summary>
-    [SuppressMessage(FxCop.Category.Naming, "CA1724:TypeNamesShouldNotMatchNamespaces",
-        Justification = "Code imported from Cider; keeping changes to a minimum as it impacts xaml files as well")]
-    partial class PropertyInspector :
-        INotifyPropertyChanged
-    {
-
-        private static readonly Size DesiredIconSize = new Size(40, 40);
-
-        private View.Selection _displayedSelection;
-        private View.Selection _lastNotifiedSelection;
-        private ModelItem _lastParent;
-
-        private bool _ignoreSelectionNameChanges;
-
-        private List<ModelEditingScope> _pendingTransactions = new List<ModelEditingScope>();
-        private PropertyValueEditorCommandHandler _defaultCommandHandler;
-        private IStateContainer _sessionStateContainer;
-
-        private SelectionPath _lastSelectionPath;
-        private bool _objectSelectionInitialized;
-
-        private bool _disposed;
-        private bool _isReadOnly;
-
-        private string propertyPathToSelect;
-
-        private ContextItemManager designerContextItemManager;
-        private DesignerPerfEventProvider designerPerfEventProvider;
-
-        // Map between currently displayed category editors and the names of the categories they belong to
-        private Dictionary<Type, string> _activeCategoryEditors = new Dictionary<Type, string>();
-
-        // <summary>
-        // Basic ctor
-        // </summary>
-        // FxCop complains this.DataContext, which is somewhat bogus
-        [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
-        public PropertyInspector()
-        {
-            this.DataContext = this;
-
-            HookIntoCommands();
-
-            this.InitializeComponent();
-
-            //Handle the commit and cancel keys within the property inspector
-            ValueEditorUtils.SetHandlesCommitKeys(this, true);
-
-            _propertyToolBar.CurrentViewManagerChanged += new EventHandler(OnCurrentViewManagerChanged);
-        }
-
-        // <summary>
-        // Event fired when the IsInAlphaView changes as a result of some
-        // user or internal interaction.  When IsInAlphaView is set by the
-        // external host, this event will not and should not be fired.
-        // </summary>
-        public event EventHandler RootViewModified;
-
-        public event PropertyChangedEventHandler PropertyChanged;
-
-        [SuppressMessage("Microsoft.Design", "CA1044:PropertiesShouldNotBeWriteOnly", Justification = "No need for a Setter")]
-        public ContextItemManager DesignerContextItemManager
-        {
-            set
-            {
-                this.designerContextItemManager = value;
-                this.designerContextItemManager.Subscribe<View.Selection>(this.OnSelectionChanged);
-            }
-        }
-
-        // <summary>
-        // Gets a value indicating whether the selected object Name should be read-only
-        // </summary>
-        public bool IsInfoBarNameReadOnly
-        {
-            get
-            {
-                return _displayedSelection == null || _displayedSelection.SelectionCount != 1;
-            }
-        }
-
-        // <summary>
-        // Gets the selection name to display
-        // </summary>
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Propagating the error might cause VS to crash")]
-        [SuppressMessage("Reliability", "Reliability108", Justification = "Propagating the error might cause VS to crash")]
-        public string SelectionName
-        {
-            get
-            {
-                if (_displayedSelection == null || _displayedSelection.SelectionCount == 0)
-                {
-                    return null;
-                }
-
-                if (_displayedSelection.SelectionCount == 1)
-                {
-                    return _displayedSelection.PrimarySelection.Name;
-                }
-
-                return System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_MultipleObjectsSelected;
-            }
-            set
-            {
-                if (_disposed)
-                {
-                    return;
-                }
-
-                if (CanSetSelectionName(_displayedSelection))
-                {
-                    ModelItem selection = _displayedSelection.PrimarySelection;
-                    Fx.Assert(selection != null, "PrimarySelection should not be null");
-
-                    try
-                    {
-                        _ignoreSelectionNameChanges = true;
-
-                        using (ModelEditingScope change = selection.BeginEdit(System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_NameChangeUndoText))
-                        {
-                            if (string.IsNullOrEmpty(value))
-                            {
-                                // Null with cause ClearValue to be called in the base implementation on the NameProperty
-                                selection.Name = null;
-                            }
-                            else
-                            {
-                                selection.Name = value;
-                            }
-
-                            if (change != null)
-                                change.Complete();
-                        }
-                    }
-                    catch (Exception e)
-                    {
-                        Debug.WriteLine(e.ToString());
-
-                        ErrorReporting.ShowErrorMessage(e.Message);
-                    }
-                    finally
-                    {
-                        _ignoreSelectionNameChanges = false;
-                    }
-
-                    OnPropertyChanged("SelectionName");
-                }
-                else
-                {
-                    Debug.Fail("Shouldn't be able to set a selection name if no or more than one object is selected.");
-                }
-            }
-        }
-
-        // <summary>
-        // Gets the icon for the selection
-        // </summary>
-        public object SelectionIcon
-        {
-            get
-            {
-                if (_displayedSelection == null || _displayedSelection.SelectionCount == 0)
-                {
-                    return null;
-                }
-
-                if (_displayedSelection.SelectionCount == 1 || AreHomogenous(_displayedSelection.SelectedObjects))
-                {
-
-                    if (_displayedSelection.SelectionCount == 1)
-                    {
-
-                        Visual selectedVisual = _displayedSelection.PrimarySelection.View as Visual;
-                        // We dont want to show tooltips for elements that derive from "Window" class.  
-                        // But we do want to show it for DesignTimeWindow, hence we check the View, so that modelItem returns the correct value 
-                        // for designtimewindow.
-                        if (selectedVisual != null && !typeof(Window).IsAssignableFrom(_displayedSelection.PrimarySelection.View.GetType()))
-                        {
-                            // Show a small preview of the selected single object
-                            VisualBrush controlBrush = new VisualBrush(selectedVisual);
-                            controlBrush.Stretch = Stretch.Uniform;
-                            Rectangle rect = new Rectangle();
-                            rect.Width = DesiredIconSize.Width;
-                            rect.Height = DesiredIconSize.Height;
-                            rect.DataContext = string.Empty;
-
-                            // If the control's parent is RTLed, then the VisualBrush "mirrors" the text.
-                            // so apply "mirror" transform to "negate" the mirroring.
-                            FrameworkElement curElement = selectedVisual as FrameworkElement;
-                            FrameworkElement parentElement = curElement.Parent as FrameworkElement;
-                            if (parentElement != null && parentElement.FlowDirection == FlowDirection.RightToLeft)
-                            {
-                                ScaleTransform mirrorTransform = new ScaleTransform(-1, 1);
-                                mirrorTransform.CenterX = rect.Width / 2;
-                                mirrorTransform.CenterY = rect.Height / 2;
-                                controlBrush.Transform = mirrorTransform;
-                            }
-                            rect.Fill = controlBrush;
-                            return rect;
-                        }
-                        else
-                        {
-                            // The selected object is not a visual, so show a non-designable object icon
-                            return GetEmbeddedImage("NonDesignableSelection.png");
-                        }
-                    }
-
-                    // Show mutliple-selection of the same type icon
-                    return GetEmbeddedImage("MultiSelectionSameType.png");
-                }
-
-                // Show multiple-selection of different types icon
-                return GetEmbeddedImage("MultiSelectionDifferentType.png");
-            }
-        }
-
-        // <summary>
-        // Gets the Type name for the current selection
-        // </summary>
-        public string SelectionTypeName
-        {
-            get
-            {
-                if (_displayedSelection == null || _displayedSelection.SelectionCount == 0)
-                {
-                    return null;
-                }
-
-                if (_displayedSelection.SelectionCount == 1 || AreHomogenous(_displayedSelection.SelectedObjects))
-                {
-                    return GetStringRepresentation(_displayedSelection.PrimarySelection.ItemType);
-                }
-
-                return System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_MultipleTypesSelected;
-            }
-        }
-
-        static string GetStringRepresentation(Type type)
-        {
-            return TypeNameHelper.GetDisplayName(type, true);
-        }
-
-        // Property View
-
-        // <summary>
-        // Gets the state that should be persisted while the host is
-        // running, but discarded when the host shuts down.
-        // </summary>
-        public object SessionState
-        {
-            get
-            {
-                // Don't instantiate the SessionStateContainer until
-                // CategoryList has been instantiated.  Otherwise, we would
-                // get an invalid container.
-                if (_categoryList == null)
-                {
-                    return null;
-                }
-
-                return SessionStateContainer.RetrieveState();
-            }
-            set
-            {
-                // Don't instantiate the SessionStateContainer until
-                // CategoryList has been instantiated.  Otherwise, we would
-                // get an invalid container.
-                if (_categoryList == null || value == null)
-                {
-                    return;
-                }
-
-                SessionStateContainer.RestoreState(value);
-
-                _objectSelectionInitialized = false;
-            }
-        }
-
-        public bool IsReadOnly
-        {
-            get { return this._isReadOnly; }
-            internal set
-            {
-                this._isReadOnly = value;
-                this._categoryList.Opacity = this._isReadOnly ? 0.8 : 1.0;
-                this._categoryList.ToolTip = this._isReadOnly ? this.FindResource("editingDisabledHint") : null;
-                this.OnPropertyChanged("IsReadOnly");
-            }
-        }
-
-        // <summary>
-        // Gets or sets a flag indicating whether the root PropertyInspector
-        // control is in alpha-view.  We isolate this state from any other
-        // to make VS integration easier.
-        // </summary>
-        public bool IsInAlphaView
-        {
-            get { return _propertyToolBar.IsAlphaViewSelected; }
-            set { _propertyToolBar.IsAlphaViewSelected = value; }
-        }
-
-        private void SelectPropertyByPathOnIdle()
-        {
-            SelectionPath selectionPath =
-                new SelectionPath(PropertySelectionPathInterpreter.PropertyPathTypeId, propertyPathToSelect);
-            bool pendingGeneration;
-            bool result = this._categoryList.SetSelectionPath(selectionPath, out pendingGeneration);
-            if (!result && pendingGeneration)
-            {
-                Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, new MethodInvoker(SelectPropertyByPathOnIdle));
-            }
-        }
-
-        internal void SelectPropertyByPath(string path)
-        {
-            this.propertyPathToSelect = path;
-            // must do it in application idle time, otherwise the propertygrid is not popugrated yet.
-            Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, new MethodInvoker(SelectPropertyByPathOnIdle));
-        }
-
-        internal TextBlock SelectionTypeLabel
-        { get { return _typeLabel; } }
-        //internal TextBlock SelectionNameLabel 
-        //{ get { return _nameLabel; } }
-        //internal StringEditor SelectionNameEditor 
-        //{ get { return _nameEditor; } }
-        internal PropertyToolBar PropertyToolBar
-        { get { return _propertyToolBar; } }
-        internal TextBlock NoSearchResultsLabel
-        { get { return _noSearchResultsLabel; } }
-        internal TextBlock UninitializedLabel
-        { get { return _uninitializedLabel; } }
-        internal CategoryList CategoryList
-        { get { return _categoryList; } }
-
-        internal EditingContext EditingContext { get; set; }
-
-        private DesignerPerfEventProvider DesignerPerfEventProvider
-        {
-            get
-            {
-                if (this.designerPerfEventProvider == null && this.EditingContext != null)
-                {
-                    this.designerPerfEventProvider = this.EditingContext.Services.GetService<DesignerPerfEventProvider>();
-                }
-                return this.designerPerfEventProvider;
-            }
-        }
-
-        private SelectionPath LastSelectionPath
-        {
-            get { return _lastSelectionPath; }
-            set { _lastSelectionPath = value; }
-        }
-
-        private IStateContainer SessionStateContainer
-        {
-            get
-            {
-                if (_categoryList == null)
-                {
-                    return null;
-                }
-
-                if (_sessionStateContainer == null)
-                {
-                    _sessionStateContainer = new AggregateStateContainer(
-                        PropertyStateContainer.Instance,
-                        _categoryList,
-                        new SelectionPathStateContainer(this),
-                        PropertyActiveEditModeStateContainer.Instance,
-                        PropertyViewManagerStateContainer.Instance);
-                }
-
-                return _sessionStateContainer;
-            }
-        }
-
-        // IPropertyInspectorState
-
-        internal void Dispose()
-        {
-            _disposed = true;
-            DisassociateAllProperties();
-            UpdateSelectionPropertyChangedEventHooks(_displayedSelection, null);
-            _displayedSelection = null;
-            _defaultCommandHandler.Dispose();
-            _defaultCommandHandler = null;
-        }
-
-        private void HookIntoCommands()
-        {
-            // Use a helper classes to handle all the standard PI commands
-            _defaultCommandHandler = new PropertyValueEditorCommandHandler(this);
-        }
-
-        // <summary>
-        // Marks all shown properties as disassociated which disables all modifications
-        // done to them through the PI model objects.
-        // </summary>
-        private void DisassociateAllProperties()
-        {
-            if (_categoryList != null && _categoryList.IsLoaded)
-            {
-                foreach (ModelCategoryEntry category in _categoryList)
-                {
-                    category.MarkAllPropertiesDisassociated();
-                }
-            }
-        }
-
-        // Properties
-
-        private void OnCurrentViewManagerChanged(object sender, EventArgs e)
-        {
-            this.RefreshPropertyList(false);
-
-            // Isolate the current view of the root PropertyInspector into
-            // its own separate flag and event to appease the VS ----s
-            //
-            if (this.RootViewModified != null)
-            {
-                RootViewModified(null, EventArgs.Empty);
-            }
-        }
-
-        private void RefreshPropertyList(bool attachedOnly)
-        {
-            UpdateCategories(_lastNotifiedSelection, attachedOnly);
-            UpdateCategoryEditors(_lastNotifiedSelection);
-
-            //
-            // The first time SelectionChanges, there is nothing selected, so don't store the
-            // current property selected.  It would just overwrite the selection path that we
-            // received from SelectionPathStateContainer, which is not what we want.
-            //
-            if (_objectSelectionInitialized)
-            {
-                LastSelectionPath = _categoryList.SelectionPath;
-            }
-
-            _objectSelectionInitialized = true;
-
-            //
-            // Call UpdateSelectedProperty() _after_ the UI renders.  We need to set PropertySelection.IsSelected
-            // property on a templated visual objects (CategoryContainer, PropertyContainer) and those may not exist yet. 
-            //
-            Dispatcher.BeginInvoke(DispatcherPriority.Render, new UpdateSelectedPropertyInvoker(UpdateSelectedProperty), _lastNotifiedSelection);
-        }
-
-
-        // Selection Logic
-
-        // SelectionPathStateContainer
-
-        // <summary>
-        // Called externally whenever selection changes
-        // </summary>
-        // <param name="selection">New selection</param>
-        public void OnSelectionChanged(View.Selection selection)
-        {
-            _lastNotifiedSelection = selection;
-            RefreshSelection();
-        }
-
-        // <summary>
-        // Called when visibility of the PropertyBrowserPane changes and the
-        // PropertyInspector may be showing a stale selection.  This method is identical
-        // to OnSelectionChanged() but with no new selection instance introduced.
-        // </summary>
-        public void RefreshSelection()
-        {
-            Dispatcher.BeginInvoke(DispatcherPriority.Background, new MethodInvoker(OnSelectionChangedIdle));
-        }
-
-        // Updates PI when the application becomes Idle (perf optimization)
-        private void OnSelectionChangedIdle()
-        {
-            if (DesignerPerfEventProvider != null)
-            {
-                DesignerPerfEventProvider.PropertyInspectorUpdatePropertyListStart();
-            }
-
-            if (AreSelectionsEquivalent(_lastNotifiedSelection, _displayedSelection))
-            {
-                return;
-            }
-
-            if (!VisualTreeUtils.IsVisible(this))
-            {
-                return;
-            }
-
-            // Change the SelectedControlFlowDirectionRTL resource property
-            // This will allow the 3rd party editors to look at this property
-            // and change to RTL for controls that support RTL. 
-            // We set the resource to the primary selections RTL property. 
-            FlowDirection commmonFD = this.FlowDirection;
-            if (_lastNotifiedSelection != null && _lastNotifiedSelection.PrimarySelection != null)
-            {
-
-                FrameworkElement selectedElement = _lastNotifiedSelection.PrimarySelection.View as FrameworkElement;
-                if (selectedElement != null)
-                {
-                    commmonFD = selectedElement.FlowDirection;
-                }
-
-                // In case of mulitislection, 
-                // if the FlowDirection is different then always set it to LTR.
-                // else set it to common FD.
-                if (_lastNotifiedSelection.SelectionCount > 1)
-                {
-                    foreach (ModelItem item in _lastNotifiedSelection.SelectedObjects)
-                    {
-                        FrameworkElement curElm = item.View as FrameworkElement;
-                        if (curElm != null && curElm.FlowDirection != commmonFD)
-                        {
-                            //reset to LTR (since the FD's are different within multiselect)
-                            commmonFD = FlowDirection.LeftToRight;
-                            break;
-                        }
-                    }
-                }
-            }
-
-            PropertyInspectorResources.GetResources()["SelectedControlFlowDirectionRTL"] = commmonFD;
-
-            RefreshPropertyList(false);
-
-            UpdateSelectionPropertyChangedEventHooks(_displayedSelection, _lastNotifiedSelection);
-            _displayedSelection = _lastNotifiedSelection;
-            _lastParent = GetCommonParent(_lastNotifiedSelection);
-
-            // Handle dangling transactions
-            _defaultCommandHandler.CommitOpenTransactions();
-
-            OnPropertyChanged("IsInfoBarNameReadOnly");
-            OnPropertyChanged("SelectionName");
-            OnPropertyChanged("SelectionIcon");
-            OnPropertyChanged("SelectionTypeName");
-        }
-
-        // Removes / adds a PropertyChanged listener from / to the previous / current selection
-        private void UpdateSelectionPropertyChangedEventHooks(View.Selection previousSelection, View.Selection currentSelection)
-        {
-            if (previousSelection != null && previousSelection.PrimarySelection != null)
-            {
-                previousSelection.PrimarySelection.PropertyChanged -= OnSelectedItemPropertyChanged;
-            }
-
-            if (currentSelection != null && currentSelection.PrimarySelection != null)
-            {
-                currentSelection.PrimarySelection.PropertyChanged += OnSelectedItemPropertyChanged;
-            }
-        }
-
-        private void OnSelectedItemPropertyChanged(object sender, PropertyChangedEventArgs e)
-        {
-            if (_ignoreSelectionNameChanges)
-            {
-                return;
-            }
-
-            // PS 40699 - Name is not a special property for WF
-            //if ("Name".Equals(e.PropertyName))
-            //{
-            //  OnSelectedItemNameChanged();
-            //}
-
-            if ("Parent".Equals(e.PropertyName))
-            {
-                OnParentChanged();
-            }
-        }
-
-        // Called when the name changes
-        private void OnSelectedItemNameChanged()
-        {
-            OnPropertyChanged("SelectionName");
-        }
-
-        // Called when the parent of the current selection changes
-        private void OnParentChanged()
-        {
-            Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, new MethodInvoker(OnParentChangedIdle));
-        }
-
-        private void OnParentChangedIdle()
-        {
-            if (_displayedSelection == null || _displayedSelection.SelectionCount < 1)
-            {
-                return;
-            }
-
-            ModelItem newParent = GetCommonParent(_displayedSelection);
-
-            if (_lastParent != newParent)
-            {
-                RefreshPropertyList(true);
-                _lastParent = newParent;
-            }
-        }
-
-        // Looks for common parent ModelItem among all the items in the selection
-        private static ModelItem GetCommonParent(View.Selection selection)
-        {
-            if (selection == null || selection.SelectionCount < 1)
-            {
-                return null;
-            }
-
-            ModelItem parent = null;
-            foreach (ModelItem item in selection.SelectedObjects)
-            {
-                if (parent == null)
-                {
-                    parent = item.Parent;
-                }
-                else if (parent != item.Parent)
-                {
-                    return null;
-                }
-            }
-
-            return parent;
-        }
-
-        // The user can only specify the name for the selected objects iff exactly one
-        // object is selected.
-        private static bool CanSetSelectionName(View.Selection selection)
-        {
-            return selection != null && selection.SelectionCount == 1;
-        }
-
-        private static bool AreSelectionsEquivalent(View.Selection a, View.Selection b)
-        {
-            if (a == null && b == null)
-            {
-                return true;
-            }
-            if (a == null || b == null)
-            {
-                return false;
-            }
-            if (a.SelectionCount != b.SelectionCount)
-            {
-                return false;
-            }
-
-            // POSSIBLE OPTIMIZATION: be smarter about same selection in a different order
-            IEnumerator<ModelItem> ea = a.SelectedObjects.GetEnumerator();
-            IEnumerator<ModelItem> eb = b.SelectedObjects.GetEnumerator();
-
-            while (ea.MoveNext() && eb.MoveNext())
-            {
-                if (!object.Equals(ea.Current, eb.Current))
-                {
-                    return false;
-                }
-            }
-
-            return true;
-        }
-
-        // This is the work-horse that refreshes the list of properties and categories within a PropertyInspector
-        // window, including refreshing of CategoryEditors, based on the specified selection
-        private void UpdateCategories(View.Selection selection, bool attachedOnly)
-        {
-
-            // Optimization stolen from Sparkle:
-            // re-rendering the categories is the number one perf issue. Clearing
-            // the databound collection results in massive Avalon code execution, and
-            // then re-adding everything causes another huge shuffle. What is more, 
-            // even when changing the selection between different objects, most properties
-            // do not change. Therefore we are going to take the new list of properties 
-            // and we are going to merge them into the existing stuff, using an 
-            // approach I call Mark, Match, and Cull.
-            //
-            // First we mark all the properties in the current collection. Those which 
-            // are still marked at the end will be culled out
-            foreach (ModelCategoryEntry category in _categoryList)
-            {
-                if (attachedOnly)
-                {
-                    category.MarkAttachedPropertiesDisassociated();
-                }
-                else
-                {
-                    category.MarkAllPropertiesDisassociated();
-                }
-            }
-
-            // Second we try to match each property in the list of properties for the newly selected objects 
-            // against something that we already have. If we have a match, then we reset the existing
-            // ModelPropertyEntry and clear the mark
-            //
-            foreach (IEnumerable<ModelProperty> propertySet in
-                ModelPropertyMerger.GetMergedProperties(
-                selection == null ? null : selection.SelectedObjects,
-                selection == null ? 0 : selection.SelectionCount))
-            {
-
-                string propertyName = GetPropertyName(propertySet);
-
-                // Specifically filter out the Name property
-                // PS 40699 - Name is not a special property for WF
-                //if ("Name".Equals(propertyName))
-                //{
-                //    continue;
-                //}
-
-                if (attachedOnly && propertyName.IndexOf('.') < 0)
-                {
-                    continue;
-                }
-
-                ModelPropertyEntry wrappedProperty = _propertyToolBar.CurrentViewManager.AddProperty(propertySet, propertyName, _categoryList);
-
-                // Make sure no valid properties get culled out
-                wrappedProperty.Disassociated = false;
-            }
-
-            // Third, we walk the properties and categories, and we cull out all of the
-            // marked properties. Empty categories are removed.
-            //
-            for (int i = _categoryList.Count - 1; i >= 0; i--)
-            {
-                ModelCategoryEntry category = (ModelCategoryEntry)_categoryList[i];
-                category.CullDisassociatedProperties();
-                if (category.IsEmpty)
-                {
-                    _categoryList.RemoveAt(i);
-                }
-            }
-
-            _categoryList.RefreshFilter();
-        }
-
-        // Helper method that adjusts the visible set of CategoryEditors based on the specified selection
-        private void UpdateCategoryEditors(View.Selection selection)
-        {
-
-            // Figure out which category editors to show
-            Dictionary<Type, object> newCategoryEditorTypes = _propertyToolBar.CurrentViewManager.GetCategoryEditors(
-                FindCommonType(selection == null ? null : selection.SelectedObjects),
-                _categoryList);
-
-            // Figure out which CategoryEditors are no longer needed and remove them
-            List<Type> editorTypesToRemove = null;
-            foreach (KeyValuePair<Type, string> item in _activeCategoryEditors)
-            {
-                if (!newCategoryEditorTypes.ContainsKey(item.Key) || !IsCategoryShown(item.Key))
-                {
-
-                    // New selection does not include this existing category editor 
-                    // or the category that contains this editor
-                    // so remove the editor.
-                    if (editorTypesToRemove == null)
-                    {
-                        editorTypesToRemove = new List<Type>();
-                    }
-
-                    editorTypesToRemove.Add(item.Key);
-                }
-                else
-                {
-                    // This category editor already exists, so don't re-add it
-                    newCategoryEditorTypes.Remove(item.Key);
-                }
-            }
-
-            if (editorTypesToRemove != null)
-            {
-                foreach (Type editorTypeToRemove in editorTypesToRemove)
-                {
-                    ModelCategoryEntry affectedCategory = _categoryList.FindCategory(_activeCategoryEditors[editorTypeToRemove]) as ModelCategoryEntry;
-                    if (affectedCategory != null)
-                    {
-                        affectedCategory.RemoveCategoryEditor(editorTypeToRemove);
-                    }
-
-                    _activeCategoryEditors.Remove(editorTypeToRemove);
-                }
-            }
-
-            // Figure out which CategoryEditors are now required and add them
-            foreach (Type editorTypeToAdd in newCategoryEditorTypes.Keys)
-            {
-                CategoryEditor editor = (CategoryEditor)ExtensibilityAccessor.SafeCreateInstance(editorTypeToAdd);
-                if (editor == null)
-                {
-                    continue;
-                }
-
-                ModelCategoryEntry affectedCategory = _categoryList.FindCategory(editor.TargetCategory) as ModelCategoryEntry;
-                if (affectedCategory == null)
-                {
-                    continue;
-                }
-
-                affectedCategory.AddCategoryEditor(editor);
-                _activeCategoryEditors[editorTypeToAdd] = editor.TargetCategory;
-            }
-        }
-
-        // Check if the category is shown for the current category editor type
-        private bool IsCategoryShown(Type categoryEditorType)
-        {
-            bool ret = true;
-            CategoryEditor editorToRemove = (CategoryEditor)ExtensibilityAccessor.SafeCreateInstance(categoryEditorType);
-            if (editorToRemove != null)
-            {
-                ModelCategoryEntry affectedCategory = _categoryList.FindCategory(editorToRemove.TargetCategory) as ModelCategoryEntry;
-                if (affectedCategory == null)
-                {
-                    ret = false;
-                }
-            }
-            else
-            {
-                ret = false;
-            }
-            return ret;
-        }
-
-        // Tries to figure out what property to select and selects is
-        private void UpdateSelectedProperty(View.Selection selection)
-        {
-
-            // If we are not loaded, skip any and all selection magic
-            if (!this.IsLoaded)
-            {
-                return;
-            }
-
-            if (selection != null)
-            {
-
-                // See what the view would like us to select if we run out of things
-                // we can think of selecting
-                //
-                SelectionPath fallbackSelection = null;
-                if (_propertyToolBar.CurrentViewManager != null)
-                {
-                    fallbackSelection = _propertyToolBar.CurrentViewManager.GetDefaultSelectionPath(_categoryList);
-                }
-
-                // Select the first thing we request that exists, using the following
-                // precedence order:
-                //
-                //  * LastSelectionPath
-                //  * DefaultProperty
-                //  * Whatever the view wants to show (first category, first property, ...)
-                //
-                _categoryList.UpdateSelectedProperty(
-                    this.LastSelectionPath,
-                    ModelPropertyMerger.GetMergedDefaultProperty(selection.SelectedObjects),
-                    fallbackSelection);
-            }
-
-            if (DesignerPerfEventProvider != null)
-            {
-                DesignerPerfEventProvider.PropertyInspectorUpdatePropertyListEnd();
-            }
-        }
-
-        private static Type FindCommonType(IEnumerable<ModelItem> modelItems)
-        {
-            Type commonType = null;
-
-            if (modelItems != null)
-            {
-                foreach (ModelItem selectedItem in modelItems)
-                {
-                    if (commonType == null)
-                    {
-                        commonType = selectedItem.ItemType;
-                    }
-                    else
-                    {
-                        commonType = ModelUtilities.GetCommonAncestor(commonType, selectedItem.ItemType);
-                    }
-                }
-            }
-
-            return commonType;
-        }
-
-        private static bool AreHomogenous(IEnumerable<ModelItem> items)
-        {
-            Fx.Assert(items != null, "items parameter is null");
-
-            Type type = null;
-            foreach (ModelItem item in items)
-            {
-                if (type == null)
-                {
-                    type = item.ItemType;
-                }
-                else if (type != item.ItemType)
-                {
-                    return false;
-                }
-            }
-
-            return true;
-        }
-
-        // Static Helpers
-
-        private static string GetPropertyName(IEnumerable<ModelProperty> propertySet)
-        {
-            if (propertySet == null)
-            {
-                return null;
-            }
-            foreach (ModelProperty property in propertySet)
-            {
-                return property.Name;
-            }
-            return null;
-        }
-
-        private static Image GetEmbeddedImage(string imageName)
-        {
-            Image image = new Image();
-            image.Source = new BitmapImage(new Uri(
-                string.Concat(
-                "/System.Activities.Presentation;component/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Resources/",
-                imageName),
-                UriKind.RelativeOrAbsolute));
-            return image;
-        }
-
-
-        // AutomationPeer Stuff
-
-        protected override AutomationPeer OnCreateAutomationPeer()
-        {
-            return new PropertyInspectorAutomationPeer(this);
-        }
-
-
-        // Cross-domain State Storage
-
-        // <summary>
-        // Clears the FilterString
-        // </summary>
-        public void ClearFilterString()
-        {
-            _categoryList.FilterString = null;
-        }
-
-        // INotifyPropertyChanged Members
-
-        private void OnPropertyChanged(string propertyName)
-        {
-            if (PropertyChanged != null)
-            {
-                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-            }
-        }
-
-        private delegate void MethodInvoker();
-        private delegate void UpdateSelectedPropertyInvoker(View.Selection selection);
-
-        // Container for property-selection state represented by SelectionPath.
-        // Since we receive a stored SelectionPath on the reload of this control,
-        // at which point the visuals themselves have not been rendered yet, we
-        // store the supplied SelectionPath instance and use it to select the 
-        // correct property only after the UI has been rendered.
-        //
-        private class SelectionPathStateContainer : IStateContainer
-        {
-            private PropertyInspector _parent;
-
-            public SelectionPathStateContainer(PropertyInspector parent)
-            {
-                if (parent == null)
-                {
-                    throw FxTrace.Exception.ArgumentNull("parent");
-                }
-                _parent = parent;
-            }
-
-            //
-            // Pulls the SelectionPath from the CategoryList, but only if it was Sticky,
-            // meaning we should preserve it
-            //
-            public object RetrieveState()
-            {
-                if (_parent.CategoryList != null)
-                {
-                    SelectionPath path = _parent._objectSelectionInitialized ? _parent.CategoryList.SelectionPath : _parent.LastSelectionPath;
-                    return path == null ? null : path.State;
-                }
-
-                return null;
-            }
-
-            //
-            // Pulls the SelectionPath from the CategoryList, but only if it was Sticky,
-            // meaning we should preserve it
-            //
-            public void RestoreState(object state)
-            {
-                if (state != null)
-                {
-                    SelectionPath restoredPath = SelectionPath.FromState(state);
-                    _parent.LastSelectionPath = restoredPath;
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyInspectorFontAndColorDictionary.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyInspectorFontAndColorDictionary.cs
deleted file mode 100644 (file)
index b21bf66..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-    using System.Collections.Generic;
-    using System.Windows;
-    using System.Windows.Media;
-    using System.Diagnostics.CodeAnalysis;
-
-    internal class PropertyInspectorFontAndColorDictionary : ResourceDictionary 
-    {
-        [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
-        internal PropertyInspectorFontAndColorDictionary(Dictionary<string, object> fontAndColorData) 
-        {
-            try 
-            {
-                BeginInit();
-
-                foreach (KeyValuePair<string, object> keyValuePair in fontAndColorData)
-                {
-                    if (keyValuePair.Value is System.Drawing.SolidBrush)
-                    {
-                        System.Drawing.SolidBrush drawingBrush = (System.Drawing.SolidBrush)(keyValuePair.Value);
-                        Color color = new Color();
-                        color.A = drawingBrush.Color.A;
-                        color.R = drawingBrush.Color.R;
-                        color.G = drawingBrush.Color.G;
-                        color.B = drawingBrush.Color.B;
-
-                        Add(keyValuePair.Key, new SolidColorBrush(color));
-                    }
-                    else if (keyValuePair.Value is System.Drawing.Drawing2D.LinearGradientBrush)
-                    {
-                        System.Drawing.Drawing2D.LinearGradientBrush drawingBrush = (System.Drawing.Drawing2D.LinearGradientBrush)keyValuePair.Value;
-                        Color startingColor = new Color();
-                        startingColor.A = drawingBrush.LinearColors[0].A;
-                        startingColor.R = drawingBrush.LinearColors[0].R;
-                        startingColor.G = drawingBrush.LinearColors[0].G;
-                        startingColor.B = drawingBrush.LinearColors[0].B;
-                        Color endingColor = new Color();
-                        endingColor.A = drawingBrush.LinearColors[1].A;
-                        endingColor.R = drawingBrush.LinearColors[1].R;
-                        endingColor.G = drawingBrush.LinearColors[1].G;
-                        endingColor.B = drawingBrush.LinearColors[1].B;
-                        Add(keyValuePair.Key, new System.Windows.Media.LinearGradientBrush(startingColor, endingColor, 90));
-                    }
-                    else if (keyValuePair.Value is System.Drawing.FontFamily)
-                    {
-                        System.Drawing.FontFamily drawingFontFamily = (System.Drawing.FontFamily)keyValuePair.Value;
-                        Add(keyValuePair.Key, new FontFamily(drawingFontFamily.Name));
-                    }
-                    else if (keyValuePair.Key == "FontWeightKey")
-                    {
-                        Add(keyValuePair.Key, System.Windows.FontWeights.Normal);
-                    }
-                    else
-                    {
-                        Add(keyValuePair.Key, keyValuePair.Value);
-                    }
-                }
-            }
-            finally 
-            {
-                EndInit();
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyInspectorMergedResources.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyInspectorMergedResources.cs
deleted file mode 100644 (file)
index 0874120..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-
-    using System.Diagnostics.CodeAnalysis;
-    using System.Collections.Generic;
-    using System.Windows;
-    using System.Windows.Media;
-    using System.Activities.Presentation.Internal.PropertyEditing.Resources;
-
-    // <summary>
-    // This class merges the font and brush resources for PropertyInspector.
-    // PropertyInspectorMergedResources uses AdornerResources to hook on to the theme-changes to
-    // re-apply the color values.
-    // </summary>
-    [SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes", Justification = "Suppress to avoid churning the code base.")]
-    internal static class PropertyInspectorMergedResources 
-    {
-        private static readonly string _fontSizeKey = CreateKey("FontSizeKey");
-        private static readonly string _fontFamilyKey = CreateKey("FontFamilyKey");
-        private static readonly string _fontWeightKey = CreateKey("FontWeightKey");
-        private static readonly string _textBrushKey = CreateKey("TextBrushKey");
-        private static readonly string _selectedForegroundBrushKey = CreateKey("SelectedForegroundBrushKey");
-        private static readonly string _selectedBackgroundBrushKey = CreateKey("SelectedBackgroundBrushKey");
-        private static readonly string _backgroundBrushKey = CreateKey("BackgroundBrushKey");
-        private static readonly string _borderBrushKey = CreateKey("BorderBrushKey");
-        private static readonly string _categoryCaptionTextBrushKey = CreateKey("CategoryCaptionTextBrushKey");
-        private static readonly string _paneBrushKey = CreateKey("PaneBrushKey");
-        private static readonly string _popupBrushKey = CreateKey("PopupBrushKey");
-        private static readonly string _toolBarItemHoverBackgroundBrushKKey = CreateKey("ToolBarItemHoverBackgroundBrushKey");
-        private static readonly string _toolBarItemHoverBorderBrushKey = CreateKey("ToolBarItemHoverBorderBrushKey");
-        private static readonly string _toolBarItemSelectedBackgroundBrushKey = CreateKey("ToolBarItemSelectedBackgroundBrushKey");
-        private static readonly string _toolBarItemSelectedBorderBrushKey = CreateKey("ToolBarItemSelectedBorderBrushKey");
-        private static readonly string _toolBarBackgroundBrushKey = CreateKey("ToolBarBackgroundBrushKey");
-        private static readonly string _toolBarSeparatorBrushKey = CreateKey("ToolBarSeparatorBrushKey");
-        private static readonly string _toolBarTextBoxBorderBrushKey = CreateKey("ToolBarTextBoxBorderBrushKey");        
-
-        // <summary>
-        // Specifies a FontSizeKey.
-        // </summary>
-        public static string FontSizeKey 
-        {
-            get { return _fontSizeKey; }
-        }
-
-        // <summary>
-        // Specifies FontFamilyKey
-        // </summary>
-        public static string FontFamilyKey 
-        {
-            get { return _fontFamilyKey; }
-        }
-
-        // <summary>
-        // Specifies FontWeightKey
-        // </summary>
-        public static string FontWeightKey 
-        {
-            get { return _fontWeightKey; }
-        }
-
-
-        public static string TextBrushKey 
-        {
-            get { return _textBrushKey; }
-        }
-
-        public static string SelectedForegroundBrushKey 
-        {
-            get { return _selectedForegroundBrushKey; }
-        }
-
-
-
-        public static string SelectedBackgroundBrushKey 
-        {
-            get { return _selectedBackgroundBrushKey; }
-        }
-
-
-
-        public static string BackgroundBrushKey 
-        {
-            get { return _backgroundBrushKey; }
-        }
-
-
-
-        public static string BorderBrushKey 
-        {
-            get { return _borderBrushKey; }
-        }
-
-
-
-
-        public static string CategoryCaptionTextBrushKey 
-        {
-            get { return _categoryCaptionTextBrushKey; }
-        }
-
-
-
-
-        public static string PaneBrushKey 
-        {
-            get { return _paneBrushKey; }
-        }
-
-
-
-
-        public static string PopupBrushKey 
-        {
-            get { return _popupBrushKey; }
-        }
-
-
-      
-
-
-        public static string ToolBarItemHoverBackgroundBrushKey 
-        {
-            get { return _toolBarItemHoverBackgroundBrushKKey; }
-        }
-
-
-   
-
-        public static string ToolBarItemHoverBorderBrushKey 
-        {
-            get { return _toolBarItemHoverBorderBrushKey; }
-        }
-
-
-
-
-        public static string ToolBarItemSelectedBackgroundBrushKey 
-        {
-            get { return _toolBarItemSelectedBackgroundBrushKey; }
-        }
-
-
-
-
-        public static string ToolBarItemSelectedBorderBrushKey 
-        {
-            get { return _toolBarItemSelectedBorderBrushKey; }
-        }
-
-
-
-        public static string ToolBarBackgroundBrushKey 
-        {
-            get { return _toolBarBackgroundBrushKey; }
-        }
-
-
-
-
-        public static string ToolBarSeparatorBrushKey 
-        {
-            get { return _toolBarSeparatorBrushKey; }
-        }
-
-
-
-
-        public static string ToolBarTextBoxBorderBrushKey 
-        {
-            get { return _toolBarTextBoxBorderBrushKey; }
-        }
-
-
-        //HelperFunctions
-
-        // <summary>
-        // Creates a new key.  Used at static construction time.
-        // </summary>
-        private static string CreateKey(string name) 
-        {
-            //return AdornerResources.CreateResourceKey(typeof(PropertyInspectorMergedResources), name);
-            return name;
-        }
-
-      
-
-        //<summary>
-        //return (Collection) for custom collection editor defined in other assemblies to use, e.g. DynamicArgumentDictionary
-        //<summary>
-        public static string DefaultCollectionStringValue
-        {
-            get
-            {                
-                return System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_DefaultCollectionStringValue;
-            }
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyPanel.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyPanel.cs
deleted file mode 100644 (file)
index 4750569..0000000
+++ /dev/null
@@ -1,308 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-    using System;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Media;
-
-    // <summary>
-    // PropertyPanel is a simplified version of a horizontal StackPanel that we use for PropertyContainer
-    // visuals in lieu of Grid, which was too heavy-weight and bogging down perf.  It exposes a property,
-    // LastChildWidth, that specifies the forced width of the last child in the panel.  All other
-    // children are stacked on the left and eat up the remainder of the space left on the panel.
-    //
-    // The panel also deals with drawing compartments for itself and the last child and it deals with
-    // visually nesting sub-properties based on their depth (Level).
-    // </summary>
-    internal class PropertyPanel : Panel 
-    {
-
-        // LastChildWidth DP
-
-        public static readonly DependencyProperty OutlineBrushProperty =
-            DependencyProperty.Register("OutlineBrush",
-            typeof(Brush),
-            typeof(PropertyPanel),
-            new FrameworkPropertyMetadata((Brush)null,
-            FrameworkPropertyMetadataOptions.AffectsRender |
-            FrameworkPropertyMetadataOptions.SubPropertiesDoNotAffectRender));
-
-        public static readonly DependencyProperty SelectionBrushProperty =
-            DependencyProperty.Register("SelectionBrush",
-            typeof(Brush),
-            typeof(PropertyPanel),
-            new FrameworkPropertyMetadata((Brush)null,
-            FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.SubPropertiesDoNotAffectRender));
-
-        public static readonly DependencyProperty OutlineThicknessProperty =
-            DependencyProperty.Register("OutlineThickness",
-            typeof(double),
-            typeof(PropertyPanel),
-            new FrameworkPropertyMetadata((double)1,
-            FrameworkPropertyMetadataOptions.AffectsRender));
-
-        public static readonly DependencyProperty IgnoreFirstChildBackgroundProperty =
-            DependencyProperty.Register("IgnoreFirstChildBackground",
-            typeof(bool),
-            typeof(PropertyPanel),
-            new FrameworkPropertyMetadata(
-            false,
-            FrameworkPropertyMetadataOptions.AffectsRender));
-
-        public static DependencyProperty LastChildWidthProperty = DependencyProperty.Register(
-            "LastChildWidth",
-            typeof(double),
-            typeof(PropertyPanel),
-            new FrameworkPropertyMetadata(
-            (double)0,
-            FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender));
-
-        public static DependencyProperty LevelProperty = DependencyProperty.Register(
-            "Level",
-            typeof(int),
-            typeof(PropertyPanel),
-            new FrameworkPropertyMetadata(
-            (int)0,
-            FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure));
-
-        public static DependencyProperty LevelIndentProperty = DependencyProperty.Register(
-            "LevelIndent",
-            typeof(double),
-            typeof(PropertyPanel),
-            new FrameworkPropertyMetadata(
-            (double)13,
-            FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure));
-
-        // <summary>
-        // Gets or sets the pixel width of the last child added into this panel.
-        // </summary>
-        public double LastChildWidth 
-        {
-            get { return (double)this.GetValue(LastChildWidthProperty); }
-            set { this.SetValue(LastChildWidthProperty, value); }
-        }
-
-
-
-        // Level DP
-
-        // <summary>
-        // Gets or sets the indentation level for the first child in this panel.  Levels are
-        // measured in ints, with 0 = no indentation, 1 = 1st sub-property, ...
-        // The actual amount of space taken up by each level is controled by LevelIndent property
-        // </summary>
-        public int Level 
-        {
-            get { return (int)this.GetValue(LevelProperty); }
-            set { this.SetValue(LevelProperty, value); }
-        }
-
-
-
-        // LevelIndent DP
-
-        // <summary>
-        // Gets or sets the pixel width that the first child is indented for each level that
-        // it belongs to
-        // </summary>
-        public double LevelIndent 
-        {
-            get { return (double)this.GetValue(LevelIndentProperty); }
-            set { this.SetValue(LevelIndentProperty, value); }
-        }
-
-
-
-        // OutlineBrush DP
-
-        // <summary>
-        // Gets or sets the line brush to use for the panel compartments
-        // </summary>
-        public Brush OutlineBrush 
-        {
-            get { return (Brush)GetValue(OutlineBrushProperty); }
-            set { SetValue(OutlineBrushProperty, value); }
-        }
-
-
-
-        // SelectionBrush DP
-
-        // <summary>
-        // Gets or sets the brush to be used as the background for everything but the last
-        // element in the panel
-        // </summary>
-        public Brush SelectionBrush 
-        {
-            get { return (Brush)GetValue(SelectionBrushProperty); }
-            set { SetValue(SelectionBrushProperty, value); }
-        }
-
-
-
-        // OutlineThickness DP
-
-        // <summary>
-        // Gets or sets the line thickness for the panel compartments (not as Thickness, but
-        // instead as a simple double)
-        // </summary>
-        public double OutlineThickness 
-        {
-            get { return (double)GetValue(OutlineThicknessProperty); }
-            set { SetValue(OutlineThicknessProperty, value); }
-        }
-
-
-
-        // IgnoreFirstChildBackground DP
-
-        // <summary>
-        // Gets or sets a flag indicating whether the SelectionBrush background should
-        // or should not be applied to the first child of the panel
-        // </summary>
-        public bool IgnoreFirstChildBackground 
-        {
-            get { return (bool)GetValue(IgnoreFirstChildBackgroundProperty); }
-            set { SetValue(IgnoreFirstChildBackgroundProperty, value); }
-        }
-
-
-
-        // Stacks the children to the left, leaving LastChildWidth amount of space for the last child
-        protected override Size MeasureOverride(Size availableSize) 
-        {
-
-            double lastChildWidth = Math.Max(0, this.LastChildWidth);
-            double indent = this.LevelIndent * this.Level;
-            double availableWidth = Math.Max(0, availableSize.Width - lastChildWidth - indent);
-            int childrenCount = InternalChildren.Count;
-            int lastIndex = childrenCount - 1;
-            Size actualSize = new Size();
-
-            for (int i = 0; i < childrenCount; i++) 
-            {
-                UIElement child = InternalChildren[i];
-
-                if (i == lastIndex) 
-                {
-                    InternalChildren[i].Measure(new Size(lastChildWidth, availableSize.Height));
-                }
-                else 
-                {
-                    InternalChildren[i].Measure(new Size(availableWidth, availableSize.Height));
-                }
-
-                availableWidth -= child.DesiredSize.Width;
-                //Compute the actual size for the propertypanel
-                actualSize.Height = Math.Max(actualSize.Height, child.DesiredSize.Height);
-                actualSize.Width += child.DesiredSize.Width;
-            }
-
-            return actualSize;
-        }
-
-        // Stacks the children to the left, leaving LastChildWidth amount of space for the last child
-        protected override Size ArrangeOverride(Size finalSize) 
-        {
-
-            double lastChildWidth = Math.Max(0, this.LastChildWidth);
-            double indent = this.LevelIndent * this.Level;
-            double availableWidth = Math.Max(0, finalSize.Width - lastChildWidth - indent);
-            double left = indent;
-            int childrenCount = InternalChildren.Count;
-            int lastIndex = childrenCount - 1;
-
-            for (int i = 0; i < childrenCount; i++) 
-            {
-
-                UIElement child = InternalChildren[i];
-                double desiredWidth = child.DesiredSize.Width;
-                if (i == lastIndex) 
-                {
-                    child.Arrange(new Rect(Math.Max(0, finalSize.Width - lastChildWidth), 0, lastChildWidth, finalSize.Height));
-                }
-                else 
-                {
-                    child.Arrange(new Rect(left, 0, Math.Min(desiredWidth, availableWidth), finalSize.Height));
-                }
-
-                left += desiredWidth;
-                availableWidth -= desiredWidth;
-                availableWidth = Math.Max(0, availableWidth);
-            }
-
-            return finalSize;
-        }
-
-        // Custom renders compartments and dividers
-        protected override void OnRender(DrawingContext dc) 
-        {
-
-            Size renderSize = this.RenderSize;
-            Brush outlineBrush = this.OutlineBrush;
-            double outlineThickness = this.OutlineThickness;
-            double halfThickness = outlineThickness / 2.0;
-            double dividerRight = Math.Max(0, this.LastChildWidth);
-            double dividerLeft = renderSize.Width - dividerRight - outlineThickness;
-
-            Brush selectionBrush = this.SelectionBrush;
-
-            if (selectionBrush != null) 
-            {
-                bool ignoreFirstChildBackground = this.IgnoreFirstChildBackground;
-                double firstChildWidth = 0;
-
-                if (ignoreFirstChildBackground && this.Children.Count > 0) 
-                {
-                    firstChildWidth = this.Children[0].RenderSize.Width;
-                }
-
-                dc.DrawRectangle(selectionBrush, null, new Rect(
-                    firstChildWidth,
-                    0,
-                    Math.Max(dividerLeft - firstChildWidth, 0),
-                    renderSize.Height));
-            }
-
-            base.OnRender(dc);
-
-            // Use Guidelines to avoid anti-aliasing (fuzzy border lines)
-            dc.PushGuidelineSet(new GuidelineSet(
-                // X coordinates for guidelines (vertical lines)
-                new double[] { 0, dividerLeft, dividerLeft + outlineThickness, renderSize.Width - outlineThickness, renderSize.Width },
-                // Y coordinates for guidelines (horizontal lines)
-                new double[] { 0, renderSize.Height - outlineThickness, renderSize.Height }));
-
-            Pen outlinePen = new Pen(outlineBrush, outlineThickness);
-
-            // Bottom edge
-            dc.DrawLine(
-                outlinePen,
-                new Point(0, renderSize.Height - halfThickness),
-                new Point(renderSize.Width, renderSize.Height - halfThickness));
-
-            // Top edge
-            dc.DrawLine(
-                outlinePen,
-                new Point(0, 0 - halfThickness),
-                new Point(renderSize.Width, 0 - halfThickness));
-
-            // Right edge
-            dc.DrawLine(
-                outlinePen,
-                new Point(renderSize.Width - halfThickness, 0),
-                new Point(renderSize.Width - halfThickness, renderSize.Height));
-
-            // Divider
-            dc.DrawLine(
-                outlinePen,
-                new Point(dividerLeft + halfThickness, 0),
-                new Point(dividerLeft + halfThickness, renderSize.Height));
-
-            dc.Pop();
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertySelectionMode.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertySelectionMode.cs
deleted file mode 100644 (file)
index 36b96a1..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-    using System;
-
-    // <summary>
-    // SelectionMode used for property selection.  'Default' means that with each object selection change,
-    // we try to figure out the default property to select and we select it.  'Sticky' means that the user
-    // has made some conscious decision as to what property should be selected and we try to preserve it
-    // across object selection changes.
-    // </summary>
-    internal enum PropertySelectionMode 
-    {
-        Default,
-        Sticky
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyToolBar.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyToolBar.cs
deleted file mode 100644 (file)
index 0cc9b27..0000000
+++ /dev/null
@@ -1,335 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-    using System;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Controls;
-    using System.Runtime;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.Automation;
-    using System.Activities.Presentation.Internal.PropertyEditing.State;
-    using System.Activities.Presentation.Internal.PropertyEditing.Views;
-
-    // <summary>
-    // Container control that hosts both the property-search UI as well as the view-switching UI
-    // </summary>
-    internal sealed class PropertyToolBar : Control, INotifyPropertyChanged 
-    {
-
-        // <summary>
-        // Property representing the currently-selected IPropertyViewManager
-        // </summary>
-        public static DependencyProperty CurrentViewManagerProperty = DependencyProperty.Register(
-            "CurrentViewManager",
-            typeof(IPropertyViewManager),
-            typeof(PropertyToolBar),
-            new PropertyMetadata(null, OnCurrentViewManagerChanged));
-
-        // <summary>
-        // Property containing a link to the CategoryList control instance that this
-        // PropertyToolBar controls.  We need this link to be able to change the appearance
-        // of each new generated CategoryContainer (whether it should show a header or not).
-        // That way CategoryList doesn't need to know anything about this class.
-        // </summary>
-        public static DependencyProperty CategoryListProperty = DependencyProperty.Register(
-            "CategoryList",
-            typeof(CategoryList),
-            typeof(PropertyToolBar),
-            new PropertyMetadata(null, OnCategoryListChanged));
-
-        private string _persistenceId;
-        private bool _persistViewManagerChanges = true;
-
-        public PropertyToolBar() 
-        {
-            this.Loaded += new RoutedEventHandler(OnLoaded);
-            this.Unloaded += new RoutedEventHandler(OnUnloaded);
-        }
-
-        // <summary>
-        // Event we fire when the CurrentViewManager changes
-        // </summary>
-        public event EventHandler CurrentViewManagerChanged;
-
-        public event PropertyChangedEventHandler PropertyChanged;
-
-        // <summary>
-        // Gets or set the currently selected IPropertyViewManager
-        // </summary>
-        public IPropertyViewManager CurrentViewManager 
-        {
-            get { return (IPropertyViewManager)this.GetValue(CurrentViewManagerProperty); }
-            set { this.SetValue(CurrentViewManagerProperty, value); }
-        }
-
-        // <summary>
-        // Gets or set the value of the CategoryListProperty
-        // </summary>
-        public CategoryList CategoryList 
-        {
-            get { return (CategoryList)this.GetValue(CategoryListProperty); }
-            set { this.SetValue(CategoryListProperty, value); }
-        }
-
-        // <summary>
-        // Gets or sets a string ID that we use to differentiate between the states of different
-        // PropertyToolBar instances.  Currently, we only care about two different PropertyToolBar
-        // buckets - (1) the PTBs we use in the main PI and (2) the PTBs we use in collection editors.
-        // </summary>
-        public string PersistenceId 
-        {
-            get {
-                return _persistenceId;
-            }
-            set {
-                if (_persistenceId != value) 
-                {
-                    _persistenceId = value;
-
-                    if (this.CurrentViewManager == null) 
-                    {
-                        bool oldPersistViewManagerChanges = _persistViewManagerChanges;
-                        try 
-                        {
-                            _persistViewManagerChanges = false;
-                            this.CurrentViewManager = PropertyViewManagerStateContainer.Instance.GetPropertyViewManager(_persistenceId);
-                        }
-                        finally 
-                        {
-                            _persistViewManagerChanges = oldPersistViewManagerChanges;
-                        }
-                    }
-
-                    OnPropertyChanged("PersistenceId");
-                }
-            }
-        }
-
-        // <summary>
-        // Convenience accessor for the UI data binding
-        // </summary>
-        public bool IsCategoryViewSelected 
-        {
-            get {
-                if (this.CurrentViewManager != null)
-                {
-                    return this.CurrentViewManager == ByCategoryViewManager.Instance;
-                }
-
-                return false;
-            }
-            set {
-                // No need to fire PropertyChanged events here - changing CurrentViewManager
-                // will fire those events as a side-effect
-                //
-                if (this.CurrentViewManager == ByCategoryViewManager.Instance ^ value) 
-                {
-                    if (value)
-                    {
-                        this.CurrentViewManager = ByCategoryViewManager.Instance;
-                    }
-                    else
-                    {
-                        this.CurrentViewManager = AlphabeticalViewManager.Instance;
-                    }
-                }
-            }
-        }
-
-        // <summary>
-        // Convenience accessor for the UI data binding
-        // </summary>
-        public bool IsAlphaViewSelected 
-        {
-            get {
-                if (this.CurrentViewManager != null)
-                {
-                    return this.CurrentViewManager == AlphabeticalViewManager.Instance;
-                }
-
-                return false;
-            }
-            set {
-                // No need to fire PropertyChanged events here - changing CurrentViewManager
-                // will fire those events as a side-effect
-                //
-                if (this.CurrentViewManager == AlphabeticalViewManager.Instance ^ value) 
-                {
-                    if (value)
-                    {
-                        this.CurrentViewManager = AlphabeticalViewManager.Instance;
-                    }
-                    else
-                    {
-                        this.CurrentViewManager = ByCategoryViewManager.Instance;
-                    }
-                }
-            }
-        }
-
-        // AutomationPeer Stuff
-
-        internal RadioButton ByCategoryViewButton 
-        { get { return VisualTreeUtils.GetNamedChild<RadioButton>(this, "PART_ByCategoryViewButton"); } }
-        internal RadioButton AlphaViewButton 
-        { get { return VisualTreeUtils.GetNamedChild<RadioButton>(this, "PART_AlphaViewButton"); } }
-        internal TextBlock SearchLabel 
-        { get { return VisualTreeUtils.GetNamedChild<TextBlock>(this, "PART_SearchLabel"); } }
-        internal TextBox SearchTextBox 
-        { get { return VisualTreeUtils.GetNamedChild<TextBox>(this, "PART_SearchTextBox"); } }
-        internal Button SearchClearButton 
-        { get { return VisualTreeUtils.GetNamedChild<Button>(this, "PART_SearchClearButton"); } }
-
-        private void OnLoaded(object sender, RoutedEventArgs e) 
-        {
-            PropertyViewManagerStateContainer.Instance.ContentRestored += new EventHandler(OnGlobalPropertyViewManagerRestored);
-        }
-
-        private void OnUnloaded(object sender, RoutedEventArgs e) 
-        {
-            PropertyViewManagerStateContainer.Instance.ContentRestored -= new EventHandler(OnGlobalPropertyViewManagerRestored);
-        }
-
-        private void OnGlobalPropertyViewManagerRestored(object sender, EventArgs e) 
-        {
-
-            // If the state of PropertyViewManagerStateContainer has been restored
-            // update the current view of the PropertyToolBar based on the restored state
-
-            if (this.PersistenceId != null) 
-            {
-                bool oldPersistViewManagerChanges = _persistViewManagerChanges;
-                try 
-                {
-                    _persistViewManagerChanges = false;
-                    this.CurrentViewManager = PropertyViewManagerStateContainer.Instance.GetPropertyViewManager(this.PersistenceId);
-                }
-                finally 
-                {
-                    _persistViewManagerChanges = oldPersistViewManagerChanges;
-                }
-            }
-        }
-
-        // CurrentViewManager DP
-
-        private static void OnCurrentViewManagerChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) 
-        {
-            PropertyToolBar theThis = obj as PropertyToolBar;
-            if (theThis == null) 
-            {
-                return;
-            }
-
-            theThis.OnPropertyChanged("IsCategoryViewSelected");
-            theThis.OnPropertyChanged("IsAlphaViewSelected");
-
-            // Store and persist the CurrentViewManager value only if:
-            // 
-            // * this change did not come from PropertyViewManagerStateContainer itself
-            // * we have a persistence ID to differentiate this control instance by
-            // * this is not the first time the value was set - in other words, only
-            //   store values that were triggered by the user making a conscious change
-            //
-            if (theThis.PersistenceId != null && theThis._persistViewManagerChanges && e.OldValue != null)
-            {
-                PropertyViewManagerStateContainer.Instance.StorePropertyViewManager(theThis.PersistenceId, e.NewValue as IPropertyViewManager);
-            }
-
-            // fire this event after we have stored the propertyviewmanager, so that the StateChanged event will get
-            // the updated view-manager
-            if (theThis.CurrentViewManagerChanged != null)
-            {
-                theThis.CurrentViewManagerChanged(theThis, EventArgs.Empty);
-            }
-
-            //refresh filter 
-            if (null != theThis.CategoryList)
-            {
-                theThis.CategoryList.RefreshFilter();
-            }
-
-        }
-
-
-
-        // CategoryList DP
-
-        private static void OnCategoryListChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) 
-        {
-            PropertyToolBar theThis = obj as PropertyToolBar;
-            if (theThis == null) 
-            {
-                return;
-            }
-
-            if (e.OldValue != null)
-            {
-                theThis.UnhookEvents(e.OldValue as CategoryList);
-            }
-
-            if (e.NewValue != null)
-            {
-                theThis.HookEvents(e.NewValue as CategoryList);
-            }
-        }
-
-        private void HookEvents(CategoryList categoryList) 
-        {
-            if (categoryList == null) 
-            {
-                Debug.Fail("This method shouldn't be called when there is no CategoryList instance to process.");
-                return;
-            }
-
-            categoryList.ContainerGenerated += new ContainerGeneratedHandler(OnCategoryContainerGenerated);
-        }
-
-        private void UnhookEvents(CategoryList categoryList) 
-        {
-            if (categoryList == null) 
-            {
-                Debug.Fail("This method shouldn't be called when there is no CategoryList instance to process.");
-                return;
-            }
-
-            categoryList.ContainerGenerated -= new ContainerGeneratedHandler(OnCategoryContainerGenerated);
-        }
-
-        private void OnCategoryContainerGenerated(object sender, ContainerGeneratedEventArgs e) 
-        {
-            if (e.Container == null) 
-            {
-                return;
-            }
-            e.Container.ShowCategoryHeader = this.CurrentViewManager == null ? true : this.CurrentViewManager.ShowCategoryHeaders;
-        }
-
-
-
-        protected override AutomationPeer OnCreateAutomationPeer() 
-        {
-            return new UIElementAutomationPeer(this);
-        }
-
-
-
-        // INotifyPropertyChanged Members
-
-        private void OnPropertyChanged(string propertyName) 
-        {
-            if (PropertyChanged != null)
-            {
-                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-            }
-        }
-
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyValueDialogControl.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyValueDialogControl.xaml.cs
deleted file mode 100644 (file)
index 168ad50..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-    using System;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Input;
-
-    using System.Runtime;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.Editors;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using System.Activities.Presentation.Internal.PropertyEditing.Resources;
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.ValueEditors;
-
-    // <summary>
-    // Root WPF control used for DialogPropertyValueEditors.  It contains a place for the
-    // editor and adds standard OK / Cancel buttons.  It's also responsible for handling
-    // PropertyValueEditorCommands and opening and closing the root transaction that
-    // responds to the OK / Cancel buttons.
-    // </summary>
-    internal partial class PropertyValueDialogControl 
-    {
-
-        private ModelEditingScope _rootTransaction;
-        private PropertyValueEditorCommandHandler _defaultCommandHandler;
-
-        // <summary>
-        // Basic ctor
-        // </summary>
-        // <param name="property">Property to display</param>
-        // <param name="valueDialogTemplate">Template to use</param>
-        public PropertyValueDialogControl(PropertyEntry property, DataTemplate valueDialogTemplate) 
-        {
-            Fx.Assert(property != null, "property parameter is null");
-            Fx.Assert(valueDialogTemplate != null, "valueDialogTemplate parameter is null");
-
-            ModelPropertyEntry modelPropertyValue = property as ModelPropertyEntry;
-            if (modelPropertyValue != null) 
-            {
-                _rootTransaction = modelPropertyValue.FirstModelProperty.Value.BeginEdit();
-            }
-
-            InitializeComponent();
-
-            // Make sure we use PI-specific resources within this control
-            this.Resources.MergedDictionaries.Add(PropertyInspectorResources.GetResources());
-
-            // Hook into an opening of nested dialogs.  PropertyInspector class takes care of this for us.
-            // However, we are using Blend's collection editor which doesn't do the same thing, so
-            // we need to reproduce that behavior manually.
-            PropertyValueDialogHost.AttachOpenDialogHandlers(this);
-
-            // Hook into the standard set of Commands
-            _defaultCommandHandler = new PropertyValueEditorCommandHandler(this);
-
-
-            _OKButton.Click += new RoutedEventHandler(OnOkButtonClicked);
-            _cancelButton.Click += new RoutedEventHandler(OnCancelButtonClicked);
-            _contentControl.Content = property.PropertyValue;
-            _contentControl.ContentTemplate = valueDialogTemplate;
-
-            //Handle the commit and cancel keys within the property inspector, that is hosted in the collection editor
-            ValueEditorUtils.SetHandlesCommitKeys(this, true);
-
-        }
-
-        // Internal event we use for this control to signal that the uber-dialog (which is actually
-        // a Form) should be closed.  This event is raised whenever the OK / Cancel buttons are
-        // pressed
-        internal event EventHandler CloseParentDialog;
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Propagating the error might cause VS to crash")]
-        [SuppressMessage("Reliability", "Reliability108", Justification = "Propagating the error might cause VS to crash")]
-        private void OnOkButtonClicked(object sender, RoutedEventArgs e) 
-        {
-            try 
-            {
-                CommitDanglingTransactions();
-                CommitRootTransaction();
-                SignalCloseParentDialog();
-            }
-            catch (Exception ex) 
-            {
-                ErrorReporting.ShowErrorMessage(ex.Message);
-            }
-        }
-
-        private void OnCancelButtonClicked(object sender, RoutedEventArgs e) 
-        {
-            AbortDanglingTransactions();
-            AbortRootTransaction();
-            SignalCloseParentDialog();
-        }
-
-
-        private void CommitDanglingTransactions() 
-        {
-            _defaultCommandHandler.CommitOpenTransactions();
-        }
-
-        private void AbortDanglingTransactions() 
-        {
-            _defaultCommandHandler.AbortOpenTransactions();
-        }
-
-        private void SignalCloseParentDialog() 
-        {
-            if (CloseParentDialog != null)
-            {
-                CloseParentDialog(this, EventArgs.Empty);
-            }
-        }
-
-        // Called when the parent dialog gets closed.  If this happened without us clicking on
-        // the OK or Cancel button, the root transaction will still exist and we need to manually
-        // abort it.
-        public void OnParentDialogClosing() 
-        {
-            AbortRootTransaction();
-        }
-
-        private void CommitRootTransaction() 
-        {
-            if (_rootTransaction == null)
-            {
-                return;
-            }
-
-            _rootTransaction.Complete();
-            _rootTransaction = null;
-        }
-
-        private void AbortRootTransaction() 
-        {
-            if (_rootTransaction == null)
-            {
-                return;
-            }
-
-            _rootTransaction.Revert();
-            _rootTransaction = null;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyValueDialogHost.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyValueDialogHost.cs
deleted file mode 100644 (file)
index d0d06dd..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing
-{
-    using System;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Windows;
-    using System.Windows.Input;
-    using System.Windows.Forms;
-    using System.Windows.Forms.Integration;
-
-    using System.Runtime;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using System.Activities.Presentation.Internal.PropertyEditing.Editors;
-    using Microsoft.Win32;
-
-    // <summary>
-    // Helper class that is responsible for opening a [....] Form that hosts the WPF
-    // PropertyValueDialogControl that ultimately hosts a DialogPropertyValueEditor.
-    // Both PropertyInspector control as well as PropertyValueDialogControl use this class.
-    // </summary>
-    internal class PropertyValueDialogHost
-    {
-
-        private System.Windows.Forms.Form _dialogWindow;
-
-        // Ctor is private because it is created automatically when the OpenDialogWindow fires. 
-        private PropertyValueDialogHost()
-        {
-        }
-
-        // <summary>
-        // Helper that attaches the OpenDialogWindow command to a handler within this host
-        // class.  The handler will automatically open and populate the dialog window when
-        // the OpenDialogWindow command is fired.
-        // </summary>
-        // <param name="dialogRoot">UIElement that should handle the OpenDialogWindow command</param>
-        public static void AttachOpenDialogHandlers(UIElement dialogRoot)
-        {
-            Fx.Assert(dialogRoot != null, "dialogRoot parameter is null");
-
-            PropertyValueDialogHost dialogHost = new PropertyValueDialogHost();
-            dialogRoot.CommandBindings.Add(new CommandBinding(PropertyContainer.OpenDialogWindow, dialogHost.OnOpenDialogWindow, dialogHost.OnCanOpenDialogWindow));
-        }
-
-        // <summary>
-        // Called in response to OpenDialogWindow command firing. A dialog can be opened if
-        // a dialog editor DataTemplate exists on the corresponding property being edited.
-        // </summary>
-        // <param name="sender"></param>
-        // <param name="e"></param>
-        public void OnCanOpenDialogWindow(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = false;
-            DataTemplate dialogEditorTemplate = GetDialogEditorTemplate(GetParentProperty(e.OriginalSource));
-            if (dialogEditorTemplate == null)
-            {
-                return;
-            }
-
-            // We can show a dialog
-            e.CanExecute = true;
-        }
-
-        // <summary>
-        // Called in response to OpenDialogWindow command firing. The method opens a
-        // [....] Form that contains an ElementHost that, in turn, contains
-        // PropertyValueDialogControl.
-        // </summary>
-        // <param name="sender"></param>
-        // <param name="e"></param>
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
-        public void OnOpenDialogWindow(object sender, ExecutedRoutedEventArgs e)
-        {
-            // Hook on to the system user-preference changed event.
-            SystemEvents.UserPreferenceChanged += new UserPreferenceChangedEventHandler(OnUserPreferenceChanged);
-
-            // Is there a DataTemplate and PropertyValue to display?
-            PropertyEntry parentProperty = GetParentProperty(e.OriginalSource);
-            DataTemplate dialogEditorTemplate = GetDialogEditorTemplate(parentProperty);
-            if (dialogEditorTemplate == null)
-            {
-                return;
-            }
-
-            // Create and populate a new Form
-            _dialogWindow = new Form();
-            _dialogWindow.ShowInTaskbar = false;
-            _dialogWindow.ShowIcon = false;
-            _dialogWindow.MaximizeBox = false;
-            _dialogWindow.MinimizeBox = false;
-            _dialogWindow.HelpButton = false;
-            _dialogWindow.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Auto;
-            _dialogWindow.Width = 600;
-            _dialogWindow.Height = 400;
-
-            // We need to change the title based on the type of the property being edited.
-            // e.g: For CollectionEditors we should say "CollectionEditor : <DisplayName>"
-            // For everything else we should say "Property Editor : <DisplayName>"
-            string title = System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_DialogValueEditorTitle;
-            _dialogWindow.MinimumSize = new System.Drawing.Size(575, 400); // Magic min-size numbers from Dan
-            _dialogWindow.Text = string.Format(
-                CultureInfo.CurrentCulture,
-                title,
-                parentProperty.DisplayName);
-
-            PropertyValueDialogControl dialogControl = new PropertyValueDialogControl(parentProperty, dialogEditorTemplate);
-            dialogControl.CloseParentDialog += new EventHandler(OnCloseParentDialog);
-
-            using (ElementHost elementHost = new ElementHost())
-            {
-                elementHost.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right;
-                elementHost.Size = _dialogWindow.ClientSize;
-                elementHost.Child = dialogControl;
-
-                _dialogWindow.Controls.Add(elementHost);
-                _dialogWindow.ShowDialog();
-                dialogControl.OnParentDialogClosing();
-            }
-        }
-
-        // <summary>
-        // Event handler for system color changes. This will change the BackColor of the dialog
-        // matching the current tool window background color for Visual Studio.
-        // </summary>
-        // <param name="sender"></param>
-        // <param name="e"></param>
-
-        private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
-        {
-            // 
-            //             if (PropertyInspectorFontAndColorDictionary.ColorService != null) {
-            //                 System.Drawing.Color backColor = PropertyInspectorFontAndColorDictionary.ColorService.GetColor(Microsoft.VisualStudio.Shell.Interop.__VSSYSCOLOREX.VSCOLOR_TOOLWINDOW_BACKGROUND, 255);
-            //                 _dialogWindow.BackColor = backColor;
-            //                 _dialogWindow.Refresh();
-            //                 _dialogWindow.Invalidate(true);
-            //             }//
-        }
-
-        // Event handler invoked when the PropertyValueDialogControl indicates that the dialog should close
-        private void OnCloseParentDialog(object sender, EventArgs e)
-        {
-            // Unhook on to the system user-preference changed event.
-            SystemEvents.UserPreferenceChanged -= new UserPreferenceChangedEventHandler(OnUserPreferenceChanged);
-
-            if (_dialogWindow != null)
-            {
-                _dialogWindow.Close();
-            }
-        }
-
-        private static DataTemplate GetDialogEditorTemplate(PropertyEntry property)
-        {
-            if (property == null)
-            {
-                return null;
-            }
-
-            // Does the current PropertyEntry have a dialog editor?
-            DialogPropertyValueEditor dialogEditor = property.PropertyValueEditor as DialogPropertyValueEditor;
-            if (dialogEditor == null)
-            {
-                return null;
-            }
-
-            return dialogEditor.DialogEditorTemplate;
-        }
-
-        private static PropertyEntry GetParentProperty(object showDialogCommandSource)
-        {
-            // Was the command invoked from a control that we expect?
-            DependencyObject source = showDialogCommandSource as DependencyObject;
-            if (source == null)
-            {
-                return null;
-            }
-
-            PropertyContainer container = PropertyContainer.GetOwningPropertyContainer(source);
-            if (container == null)
-            {
-                return null;
-            }
-
-            // Does the current PropertyEntry have a dialog editor?
-            return container.PropertyEntry;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyValueEditorCommandHandler.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/PropertyValueEditorCommandHandler.cs
deleted file mode 100644 (file)
index af503be..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Windows;
-    using System.Windows.Input;
-
-    using System.Activities.Presentation;
-    using System.Runtime;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-
-    // <summary>
-    // Container for standard PropertyValueEditorCommand handlers.  These handlers need to do their
-    // work both for the PropertyInspector control as well as for any standard WPF dialog editor
-    // launched from the PropertyInspector itself.  As such, the functionality is extracted here
-    // to be shared in both cases.
-    // </summary>
-    internal class PropertyValueEditorCommandHandler : IDisposable 
-    {
-
-        private UIElement _commandHost;
-        private List<CommandBinding> _activeCommandBindings = new List<CommandBinding>();
-        private List<ModelEditingScope> _pendingTransactions = new List<ModelEditingScope>();
-
-        public PropertyValueEditorCommandHandler(UIElement commandHost) 
-        {
-            Fx.Assert(commandHost != null, "commandHost parameter is null");
-            _commandHost = commandHost;
-
-            AddEditModeCommandBindings();
-            AddTransactionCommandBindings();
-
-            foreach (CommandBinding binding in _activeCommandBindings)
-            {
-                _commandHost.CommandBindings.Add(binding);
-            }
-        }
-
-        // <summary>
-        // Cleans up by removing all CommandBindings added by this class from the commandHost
-        // </summary>
-        public void Dispose() 
-        {
-            if (_commandHost != null && _activeCommandBindings.Count > 0) 
-            {
-                foreach (CommandBinding binding in _activeCommandBindings) 
-                {
-                    _commandHost.CommandBindings.Remove(binding);
-                }
-                _activeCommandBindings.Clear();
-            }
-        }
-
-        // <summary>
-        // Commits any pending and open transactions in the correct order
-        // </summary>
-        public void CommitOpenTransactions() 
-        {
-            for (int i = _pendingTransactions.Count - 1; i >= 0; i--) 
-            {
-                _pendingTransactions[i].Complete();
-                _pendingTransactions.RemoveAt(i);
-            }
-        }
-
-        // <summary>
-        // Aborts any pending and open transactions in the correct order
-        // </summary>
-        public void AbortOpenTransactions() 
-        {
-            for (int i = _pendingTransactions.Count - 1; i >= 0; i--) 
-            {
-                _pendingTransactions[i].Revert();
-                _pendingTransactions.RemoveAt(i);
-            }
-        }
-
-        // ActiveEditMode Switch Handlers
-
-        // Adds handlers for ShowInlineEditor, ShowExtendedPopupEditor, ShowExtendedPinnedEditor,
-        // and ShowDialogEditor commands.  These handlers the ActiveEditMode of the closest PropertyContainer
-        // that contains the UIElement that invoked it
-        private void AddEditModeCommandBindings() 
-        {
-            _activeCommandBindings.Add(new CommandBinding(PropertyValueEditorCommands.ShowInlineEditor, OnShowInlineEditor));
-            _activeCommandBindings.Add(new CommandBinding(PropertyValueEditorCommands.ShowExtendedPopupEditor, OnShowExtendedPopupEditor));
-            _activeCommandBindings.Add(new CommandBinding(PropertyValueEditorCommands.ShowExtendedPinnedEditor, OnShowExtendedPinnedEditor));
-            _activeCommandBindings.Add(new CommandBinding(PropertyValueEditorCommands.ShowDialogEditor, OnShowDialogEditor));
-        }
-
-        private void OnShowInlineEditor(object sender, ExecutedRoutedEventArgs e) 
-        {
-            SwitchActiveEditMode(e, PropertyContainerEditMode.Inline);
-        }
-
-        private void OnShowExtendedPopupEditor(object sender, ExecutedRoutedEventArgs e) 
-        {
-            SwitchActiveEditMode(e, PropertyContainerEditMode.ExtendedPopup);
-        }
-
-        private void OnShowExtendedPinnedEditor(object sender, ExecutedRoutedEventArgs e) 
-        {
-            SwitchActiveEditMode(e, PropertyContainerEditMode.ExtendedPinned);
-        }
-
-        private void OnShowDialogEditor(object sender, ExecutedRoutedEventArgs e) 
-        {
-            SwitchActiveEditMode(e, PropertyContainerEditMode.Dialog);
-        }
-
-        private static void SwitchActiveEditMode(ExecutedRoutedEventArgs e, PropertyContainerEditMode newMode) 
-        {
-            PropertyContainer container = GetContainerFromEventArgs(e);
-            if (container == null)
-            {
-                return;
-            }
-
-            container.ActiveEditMode = newMode;
-        }
-
-
-
-        // Transaction Handlers
-
-        // Adds command handlers for BeginTransaction, CommitTransaction, and AbortTransaction
-        // commands.  These handlers open, commit, or abort a transaction
-        private void AddTransactionCommandBindings() 
-        {
-            _activeCommandBindings.Add(new CommandBinding(PropertyValueEditorCommands.BeginTransaction, OnBeginTransaction));
-            _activeCommandBindings.Add(new CommandBinding(PropertyValueEditorCommands.CommitTransaction, OnCommitTransaction));
-            _activeCommandBindings.Add(new CommandBinding(PropertyValueEditorCommands.AbortTransaction, OnAbortTransaction));
-        }
-
-        private void OnBeginTransaction(object sender, ExecutedRoutedEventArgs e) 
-        {
-            ModelPropertyEntryBase property = GetContainedPropertyFromEventArgs(e);
-            if (property == null)
-            {
-                return;
-            }
-
-            _pendingTransactions.Add(property.BeginEdit(e.Parameter as string));
-        }
-
-        private void OnCommitTransaction(object sender, ExecutedRoutedEventArgs e) 
-        {
-            if (_pendingTransactions.Count == 0)
-            {
-                throw FxTrace.Exception.AsError(new InvalidOperationException(System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_ErrorCommit_NoTransactionsOpened));
-            }
-
-            try 
-            {
-                _pendingTransactions[_pendingTransactions.Count - 1].Complete();
-            }
-            finally 
-            {
-                _pendingTransactions.RemoveAt(_pendingTransactions.Count - 1);
-            }
-        }
-
-        private void OnAbortTransaction(object sender, ExecutedRoutedEventArgs e) 
-        {
-            if (_pendingTransactions.Count == 0)
-            {
-                throw FxTrace.Exception.AsError(new InvalidOperationException(System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_ErrorAbort_NoTransactionsOpened));
-            }
-
-            try 
-            {
-                _pendingTransactions[_pendingTransactions.Count - 1].Revert();
-            }
-            finally 
-            {
-                _pendingTransactions.RemoveAt(_pendingTransactions.Count - 1);
-            }
-        }
-
-
-
-        // Static Helpers
-
-        private static ModelPropertyEntryBase GetContainedPropertyFromEventArgs(ExecutedRoutedEventArgs e) 
-        {
-            PropertyContainer container = GetContainerFromEventArgs(e);
-            if (container == null)
-            {
-                return null;
-            }
-
-            return container.PropertyEntry as ModelPropertyEntryBase;
-        }
-
-        private static PropertyContainer GetContainerFromEventArgs(ExecutedRoutedEventArgs e) 
-        {
-            DependencyObject source = e.OriginalSource as DependencyObject;
-            if (source == null)
-            {
-                return null;
-            }
-
-            return PropertyContainer.GetOwningPropertyContainer(source);
-        }
-
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Resources/PropertyInspectorResources.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Resources/PropertyInspectorResources.cs
deleted file mode 100644 (file)
index 218fa48..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Resources 
-{
-    using System;
-    using System.Windows;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Runtime;
-
-    // <summary>
-    // Helper class that knows how to look up, load, and return PropertyInspector-specific
-    // ResourceDictionary
-    // </summary>
-
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
-    internal class PropertyInspectorResources 
-    {
-        private static ResourceDictionary sharedResources;
-
-        // <summary>
-        // Wrapper around System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_DefaultCollectionStringValue,
-        // which is internal and, hence, cannot be referenced from Xaml.  We use this property to
-        // display "(Collection)" string in Xaml, rather than hard-coding it within Xaml, to make sure
-        // all of the translations of "(Collection)" string is the same, regardless whether the string
-        // comes from code or whether it comes from Xaml.
-        // </summary>
-        public static string DefaultCollectionStringValue 
-        {
-            get {
-                return System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_DefaultCollectionStringValue;
-            }
-        }
-
-        // <summary>
-        // Getter for the header representing the NameProperty.  We don't want to hard-code that value in Xaml,
-        // because then it would get localized and, since it's technically a property name, we don't
-        // want it to get localized.
-        // </summary>
-        public static string NamePropertyHeader 
-        {
-            get {
-                return string.Format(
-                    CultureInfo.CurrentCulture,
-                    System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_NamePropertyDisplayFormat,
-                    FrameworkElement.NameProperty.Name);
-            }
-        }
-
-        // <summary>
-        // Wrapper around PropertyEditing_AlphabeticalCaption resource accessible from Xaml
-        // </summary>
-        public static string PropertyEditing_AlphabeticalCaption 
-        {
-            get {
-                return System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_AlphabeticalCaption;
-            }
-        }
-
-        // <summary>
-        // Wrapper around PropertyEditing_AlphabeticalCaption resource accessible from Xaml
-        // </summary>
-        public static string PropertyEditing_CategorizedCaption 
-        {
-            get {
-                return System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_CategorizedCaption;
-            }
-        }
-
-        // <summary>
-        // Wrapper around PropertyEditing_AlphabeticalCaption resource accessible from Xaml
-        // </summary>
-        public static string PropertyEditing_ClearButtonCaption 
-        {
-            get {
-                return System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_ClearButtonCaption;
-            }
-        }
-
-        // <summary>
-        // Gets the PropertyInspector-specific ResourceDictionary
-        // </summary>
-        // <returns></returns>
-        public static ResourceDictionary GetResources()
-        {
-            if (sharedResources == null)
-            {
-                Uri resourceLocator = new Uri(
-                string.Concat(
-                typeof(PropertyInspectorResources).Assembly.GetName().Name,
-                @";component/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Resources/StylesCore.xaml"),
-                UriKind.RelativeOrAbsolute);
-
-                sharedResources = (ResourceDictionary)Application.LoadComponent(resourceLocator);
-            }
-
-            Fx.Assert(sharedResources != null, "Could not load PropertyInspector shared resources.");
-            
-            return sharedResources;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Resources/ResourceUtilities.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Resources/ResourceUtilities.cs
deleted file mode 100644 (file)
index 41b3495..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Resources 
-{
-    using System;
-    using System.Windows;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // Helper utilities for accessing values in ResourceDictionaries of controls
-    // </summary>
-    internal static class ResourceUtilities 
-    {
-
-        private const string TypeIconWidthKey = "TypeIconWidth";
-        private const string TypeIconHeightKey = "TypeIconHeight";
-
-        // <summary>
-        // Looks up a double based on the specified key, returning specified fallback value if not found
-        // </summary>
-        // <param name="element">Element to use as the starting point</param>
-        // <param name="key">Key to look up</param>
-        // <param name="fallbackValue">Fallback value to return if key is not found</param>
-        // <returns>Double from the resource or fallback value if not found</returns>
-        public static double GetDouble(FrameworkElement element, string key, double fallbackValue) 
-        {
-            if (element == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("element");
-            }
-            if (string.IsNullOrEmpty(key)) 
-            {
-                throw FxTrace.Exception.ArgumentNull("key");
-            }
-            return (double)(element.FindResource(key) ?? fallbackValue);
-        }
-
-        public static Size GetDesiredTypeIconSize(FrameworkElement queryRoot) 
-        {
-            return new Size(ResourceUtilities.GetDouble(queryRoot, TypeIconWidthKey, 16),
-                ResourceUtilities.GetDouble(queryRoot, TypeIconHeightKey, 16));
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/SearchDirection.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/SearchDirection.cs
deleted file mode 100644 (file)
index 2f9fbce..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-
-    // <summary>
-    // Direction used to denote search-direction for neighboring selection stops.
-    // </summary>
-    internal enum SearchDirection 
-    {
-        Next,
-        Previous
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/CategoryContainerSelectionPathInterpreter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/CategoryContainerSelectionPathInterpreter.cs
deleted file mode 100644 (file)
index 4d9029e..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Selection 
-{
-    using System.Diagnostics;
-    using System.Text;
-    using System.Windows;
-
-    using System.Activities.Presentation.PropertyEditing;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.State;
-
-    // <summary>
-    // Helper class that knows how to construct and interpret SelectionPaths leading
-    // to CategoryContainers.
-    // </summary>
-    internal class CategoryContainerSelectionPathInterpreter : ISelectionPathInterpreter 
-    {
-
-        private static CategoryContainerSelectionPathInterpreter _instance = new CategoryContainerSelectionPathInterpreter();
-        private CategoryContainerSelectionPathInterpreter() 
-        {
-        }
-        public static CategoryContainerSelectionPathInterpreter Instance 
-        { get { return _instance; } }
-
-        public string PathTypeId 
-        { get { return "Cider_CategoryPath"; } }
-
-        // <summary>
-        // Creates an instance of SelectionPath to the specified category container's
-        // basic or advanced sections that this class knows how to interpret.
-        // </summary>
-        // <param name="categoryName">Name of the category</param>
-        // <param name="isAdvanced">True if the path should lead to the advanced section,
-        // false otherwise.</param>
-        // <returns>A new instance of SelectionPath to the specified section of the specified
-        // category container.</returns>
-        public SelectionPath ConstructSelectionPath(string categoryName, bool isAdvanced) 
-        {
-            StringBuilder path = new StringBuilder(PersistedStateUtilities.Escape(categoryName));
-            if (isAdvanced)
-            {
-                path.Append(",Advanced");
-            }
-
-            return new SelectionPath(PathTypeId, path.ToString());
-        }
-
-        // ISelectionPathInterpreter Members
-
-        public DependencyObject ResolveSelectionPath(CategoryList root, SelectionPath path, out bool pendingGeneration) 
-        {
-            pendingGeneration = false;
-            if (path == null || !string.Equals(PathTypeId, path.PathTypeId)) 
-            {
-                Debug.Fail("Invalid SelectionPath specified.");
-                return null;
-            }
-
-            if (root == null) 
-            {
-                Debug.Fail("No CategoryList specified.");
-                return null;
-            }
-
-            string[] pathValues = path.Path.Split(',');
-            string categoryName = PersistedStateUtilities.Unescape(pathValues[0]);
-            bool isAdvanced = pathValues.Length == 2;
-
-            CategoryEntry category = root.FindCategory(categoryName);
-            if (category == null)
-            {
-                return null;
-            }
-
-            DependencyObject categoryVisual = root.FindCategoryEntryVisual(category);
-            if (categoryVisual == null)
-            {
-                return null;
-            }
-
-            DependencyObject searchStart;
-
-            // For basic section, start at the root.
-            // For advanced section, start at the advanced expander.
-            // The next SelectionStop in both cases will be the section header SelectionStop.
-            if (!isAdvanced)
-            {
-                searchStart = categoryVisual;
-            }
-            else
-            {
-                searchStart = VisualTreeUtils.GetNamedChild<FrameworkElement>(categoryVisual, "PART_AdvancedExpander");
-            }
-
-            return PropertySelection.FindNeighborSelectionStop<DependencyObject>(searchStart, SearchDirection.Next);
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/CategoryEditorSelectionPathInterpreter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/CategoryEditorSelectionPathInterpreter.cs
deleted file mode 100644 (file)
index e5cc46f..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Selection 
-{
-    using System;
-    using System.Diagnostics;
-    using System.Windows;
-
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.PropertyEditing;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-
-    // <summary>
-    // Helper class that knows how to construct and interpret SelectionPaths leading
-    // to category editors.
-    // </summary>
-    internal class CategoryEditorSelectionPathInterpreter : ISelectionPathInterpreter 
-    {
-        private static CategoryEditorSelectionPathInterpreter _instance = new CategoryEditorSelectionPathInterpreter();
-        private CategoryEditorSelectionPathInterpreter() 
-        {
-        }
-        public static CategoryEditorSelectionPathInterpreter Instance 
-        { get { return _instance; } }
-
-        public string PathTypeId 
-        { get { return "Cider_CategoryEditorPath"; } }
-
-        // <summary>
-        // Creates an instance of SelectionPath to the specified category editor that
-        // this class knows how to interpret.
-        // </summary>
-        // <param name="editorTypeName">Editor type name to create the path to</param>
-        // <returns>A new instance of SelectionPath to the specified category editor</returns>
-        public SelectionPath ConstructSelectionPath(string editorTypeName) 
-        {
-            if (string.IsNullOrEmpty(editorTypeName)) 
-            {
-                throw FxTrace.Exception.ArgumentNull("editorTypeName");
-            }
-            return new SelectionPath(PathTypeId, editorTypeName);
-        }
-
-        // ISelectionPathInterpreter Members
-
-        public DependencyObject ResolveSelectionPath(CategoryList root, SelectionPath path, out bool pendingGeneration) 
-        {
-            pendingGeneration = false;
-            if (path == null || !string.Equals(PathTypeId, path.PathTypeId)) 
-            {
-                Debug.Fail("Invalid SelectionPath specified.");
-                return null;
-            }
-
-            if (root == null) 
-            {
-                Debug.Fail("No CategoryList specified.");
-                return null;
-            }
-
-            string editorTypeName = path.Path;
-
-            if (string.IsNullOrEmpty(editorTypeName)) 
-            {
-                Debug.Fail("Invalid SelectionPath specified.");
-                return null;
-            }
-
-            ModelCategoryEntry category;
-            CategoryEditor editor = root.FindCategoryEditor(editorTypeName, out category);
-            if (editor == null || category == null) 
-            {
-                return null;
-            }
-
-            return root.FindCategoryEditorVisual(editor, category, out pendingGeneration);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/CategoryEditorSelectionStop.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/CategoryEditorSelectionStop.cs
deleted file mode 100644 (file)
index 0d5e49c..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Selection 
-{
-    using System;
-    using System.Globalization;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // Helper class used to manage the selection stop behavior of a given CategoryContainer's basic
-    // and advanced sections.  It deals with both expanding and collapsing of the specified section
-    // as well as knowing how to get a SelectionPath leading to its heading.
-    // </summary>
-    internal class CategoryEditorSelectionStop : ISelectionStop 
-    {
-
-        private string _editorTypeName;
-        private SelectionPath _selectionPath;
-
-        // <summary>
-        // Creates a new CategoryEditorSelectionStop that wraps around the
-        // specified category editor.
-        // </summary>
-        // <param name="editorTypeName">Contained category editor type name</param>
-        public CategoryEditorSelectionStop(string editorTypeName) 
-        {
-            if (string.IsNullOrEmpty(editorTypeName)) 
-            {
-                throw FxTrace.Exception.ArgumentNull("editorTypeName");
-            }
-
-            _editorTypeName = editorTypeName;
-        }
-
-        // <summary>
-        // Gets true, throws on set
-        // </summary>
-        public bool IsExpanded 
-        {
-            get { return true; }
-            set { throw FxTrace.Exception.AsError(new InvalidOperationException()); }
-        }
-
-        // <summary>
-        // Gets false
-        // </summary>
-        public bool IsExpandable 
-        {
-            get { return false; }
-        }
-
-        // <summary>
-        // Gets a SelectionPath that leads to the contained category editor
-        // </summary>
-        public SelectionPath Path 
-        {
-            get {
-                if (_selectionPath == null)
-                {
-                    _selectionPath = CategoryEditorSelectionPathInterpreter.Instance.ConstructSelectionPath(_editorTypeName);
-                }
-
-                return _selectionPath;
-            }
-        }
-
-        // <summary>
-        // Gets a description of the contained category editor
-        // to expose through automation
-        // </summary>
-        public string Description 
-        {
-            get {
-                return string.Format(
-                    CultureInfo.CurrentCulture,
-                    Properties.Resources.PropertyEditing_SelectionStatus_CategoryEditor,
-                    _editorTypeName);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/CategorySelectionStop.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/CategorySelectionStop.cs
deleted file mode 100644 (file)
index e063e2c..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Selection 
-{
-    using System;
-    using System.Globalization;
-    using System.Windows;
-    using System.Activities.Presentation;
-
-    using Blend = System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector;
-
-    // <summary>
-    // Helper class used to manage the selection stop behavior of a given CategoryContainer's basic
-    // and advanced sections.  It deals with both expanding and collapsing of the specified section
-    // as well as knowing how to get a SelectionPath leading to its heading.
-    // </summary>
-    internal class CategorySelectionStop : ISelectionStop 
-    {
-
-        private CiderCategoryContainer _parent;
-        private DependencyProperty _expansionProperty;
-        private SelectionPath _selectionPath;
-        private string _description;
-
-        // <summary>
-        // Creates a new selection stop logic for the specified CiderCategoryContainer.
-        // </summary>
-        // <param name="parent">CategoryContainer to wrap around</param>
-        // <param name="isAdvanced">True if this selection stop wraps around the
-        // advanced set of properties, false otherwise.</param>
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2208:InstantiateArgumentExceptionsCorrectly")]
-        public CategorySelectionStop(CiderCategoryContainer parent, bool isAdvanced) 
-        {
-
-            if (parent == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("parent");
-            }
-            if (parent.Category == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("parent.Category");
-            }
-
-            _parent = parent;
-            _expansionProperty = isAdvanced ? Blend.CategoryContainer.AdvancedSectionPinnedProperty : Blend.CategoryContainer.ExpandedProperty;
-            _selectionPath = CategoryContainerSelectionPathInterpreter.Instance.ConstructSelectionPath(parent.Category.CategoryName, isAdvanced);
-            _description = isAdvanced ?
-                string.Format(
-                CultureInfo.CurrentCulture,
-                System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_SelectionStatus_AdvancedCategory,
-                parent.Category.CategoryName) :
-                string.Format(
-                CultureInfo.CurrentCulture,
-                System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_SelectionStatus_Category,
-                parent.Category.CategoryName);
-        }
-
-        // <summary>
-        // Gets or sets a flag indicating whether the basic/advanced section is expanded
-        // </summary>
-        public bool IsExpanded 
-        {
-            get { return (bool)_parent.GetValue(_expansionProperty); }
-            set { _parent.SetValue(_expansionProperty, value); }
-        }
-
-        // <summary>
-        // Returns true
-        // </summary>
-        public bool IsExpandable 
-        {
-            get { return true; }
-        }
-
-        // <summary>
-        // Gets the SelectionPath to the contained CategoryContainer section
-        // </summary>
-        public SelectionPath Path 
-        {
-            get { return _selectionPath; }
-        }
-
-        // <summary>
-        // Gets a description of the contained category container
-        // to expose through automation
-        // </summary>
-        public string Description 
-        {
-            get { return _description; }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/ISelectionPathInterpreter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/ISelectionPathInterpreter.cs
deleted file mode 100644 (file)
index e8c1e33..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Selection 
-{
-    using System.Windows;
-
-    // <summary>
-    // Interface we use to separate logic that knows how to look up and resolve a given SelectionPath
-    // into an actual visual object somewhere within a given CategoryList control instance.
-    // </summary>
-    internal interface ISelectionPathInterpreter 
-    {
-
-        // <summary>
-        // Gets the token that uniquely identifies the type of SelectionPath instances
-        // that a given ISelectionPathInterpreter knows how to interpret
-        // </summary>
-        string PathTypeId 
-        { get; }
-
-        // <summary>
-        // Resolves the specified SelectionPath into an actual visual object somewhere within
-        // the given CategoryList control instance.  The implementation can assume that the
-        // SelectionPath instance passed into this method matches the PathTypeId specified
-        // by this interface.
-        // </summary>
-        // <param name="root">CategoryList control to look into</param>
-        // <param name="path">SelectionPath to resolve</param>
-        // <param name="pendingGeneration">Set to true if the specified UI is under generating</param>
-        // <returns>Resolved visual corresponding to the given path if found, null otherise.</returns>
-        DependencyObject ResolveSelectionPath(CategoryList root, SelectionPath path, out bool pendingGeneration);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/ISelectionStop.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/ISelectionStop.cs
deleted file mode 100644 (file)
index 5073cf8..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Selection 
-{
-    using System.ComponentModel;
-
-    // <summary>
-    // Interface we use to mark objects in the visual tree as ones
-    // that can be selected and, potentially, expanded and collapsed.
-    // </summary>
-    internal interface ISelectionStop 
-    {
-
-        // <summary>
-        // Gets or sets the IsExpanded flag on the selected object.
-        // Setting this flag on an object that doesn't return true
-        // from IsExpandable is undefined.
-        // </summary>
-        bool IsExpanded 
-        { get; set; }
-
-        // <summary>
-        // Gets a flag indicating whether this object can be expanded
-        // and collapsed using the IsExpanded flag.
-        // </summary>
-        bool IsExpandable 
-        { get; }
-
-        // <summary>
-        // Gets the SelectionPath to this object that can be used to
-        // restore selection to it when the PropertyInspector reloads
-        // (such as when we recycle the app domains).
-        // </summary>
-        SelectionPath Path 
-        { get; }
-
-        // <summary>
-        // Gets the description to show through the Automation API
-        // defining what item is selected.
-        // </summary>
-        string Description 
-        { get; }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/PropertySelection.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/PropertySelection.cs
deleted file mode 100644 (file)
index 0183750..0000000
+++ /dev/null
@@ -1,703 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Selection
-{
-    using System;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows;
-    using System.Windows.Input;
-    using System.Windows.Media;
-
-    using System.Runtime;
-    using System.Activities.Presentation.Internal.PropertyEditing.Selection;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // This is a container for attached properties used by PropertyInspector to track and manage
-    // property selection.  It is public because WPF requires that attached properties used in XAML
-    // be declared by public classes.
-    // </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    static class PropertySelection
-    {
-
-        private static readonly DependencyPropertyKey IsSelectedPropertyKey = DependencyProperty.RegisterAttachedReadOnly(
-            "IsSelected",
-            typeof(bool),
-            typeof(PropertySelection),
-            new PropertyMetadata(false));
-
-        // <summary>
-        // Attached, ReadOnly DP that we use to mark objects as selected.  If they care, they can then render
-        // themselves differently.
-        // </summary>
-        internal static readonly DependencyProperty IsSelectedProperty = IsSelectedPropertyKey.DependencyProperty;
-
-        // <summary>
-        // Attached DP that we use in XAML to mark elements that can be selected.
-        // </summary>
-        internal static readonly DependencyProperty SelectionStopProperty = DependencyProperty.RegisterAttached(
-            "SelectionStop",
-            typeof(ISelectionStop),
-            typeof(PropertySelection),
-            new PropertyMetadata(null));
-
-        // <summary>
-        // Attached DP used in conjunction with SelectionStop DP.  It specifies the FrameworkElement to hook into
-        // in order to handle double-click events to control the expanded / collapsed state of its parent SelectionStop.
-        // </summary>
-        internal static readonly DependencyProperty IsSelectionStopDoubleClickTargetProperty = DependencyProperty.RegisterAttached(
-            "IsSelectionStopDoubleClickTarget",
-            typeof(bool),
-            typeof(PropertySelection),
-            new PropertyMetadata(false, new PropertyChangedCallback(OnIsSelectionStopDoubleClickTargetChanged)));
-
-        // <summary>
-        // Attached DP that we use in XAML to mark elements as selection scopes - meaning selection
-        // won't spill beyond the scope of the marked element.
-        // </summary>
-        internal static readonly DependencyProperty IsSelectionScopeProperty = DependencyProperty.RegisterAttached(
-            "IsSelectionScope",
-            typeof(bool),
-            typeof(PropertySelection),
-            new PropertyMetadata(false));
-
-        // <summary>
-        // Attached property we use to route non-navigational key strokes from one FrameworkElement to
-        // another.  When this property is set on a FrameworkElement, we hook into its KeyDown event
-        // and send any unhandled, non-navigational key strokes to the FrameworkElement specified
-        // by this property.  The target FrameworkElement must be focusable or have a focusable child.
-        // When the first eligible key stroke is detected, the focus will be shifted to the focusable
-        // element and the key stroke will be sent to it.
-        // </summary>
-        internal static readonly DependencyProperty KeyDownTargetProperty = DependencyProperty.RegisterAttached(
-            "KeyDownTarget",
-            typeof(FrameworkElement),
-            typeof(PropertySelection),
-            new PropertyMetadata(null, new PropertyChangedCallback(OnKeyDownTargetChanged)));
-
-        // Constant that determines how deep in the visual tree we search for SelectionStops that
-        // are children or neighbors of a given element (usually one that the user clicked on) before
-        // giving up.  This constant is UI-dependent.
-        private const int MaxSearchDepth = 11;
-
-        // <summary>
-        // Gets PropertySelection.IsSelected property from the specified DependencyObject
-        // </summary>
-        // <param name="obj">DependencyObject to examine</param>
-        // <returns>Value of the IsSelected property</returns>
-        internal static bool GetIsSelected(DependencyObject obj)
-        {
-            if (obj == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("obj");
-            }
-
-            return (bool)obj.GetValue(IsSelectedProperty);
-        }
-
-        // Private (internal) setter that we use to mark objects as selected from within CategoryList class
-        //
-        internal static void SetIsSelected(DependencyObject obj, bool value)
-        {
-            if (obj == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("obj");
-            }
-
-            obj.SetValue(IsSelectedPropertyKey, value);
-        }
-
-
-        // SelectionStop Attached DP
-
-        // <summary>
-        // Gets PropertySelection.SelectionStop property from the specified DependencyObject
-        // </summary>
-        // <param name="obj">DependencyObject to examine</param>
-        // <returns>Value of the SelectionStop property.</returns>
-        internal static ISelectionStop GetSelectionStop(DependencyObject obj)
-        {
-            if (obj == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("obj");
-            }
-
-            return (ISelectionStop)obj.GetValue(SelectionStopProperty);
-        }
-
-        // <summary>
-        // Sets PropertySelection.SelectionStop property on the specified DependencyObject
-        // </summary>
-        // <param name="obj">DependencyObject to modify</param>
-        // <param name="value">New value of SelectionStop</param>
-        internal static void SetSelectionStop(DependencyObject obj, ISelectionStop value)
-        {
-            if (obj == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("obj");
-            }
-
-            obj.SetValue(SelectionStopProperty, value);
-        }
-
-        // <summary>
-        // Clears PropertySelection.SelectionStop property from the specified DependencyObject
-        // </summary>
-        // <param name="obj">DependencyObject to clear</param>
-        internal static void ClearSelectionStop(DependencyObject obj)
-        {
-            if (obj == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("obj");
-            }
-
-            obj.ClearValue(SelectionStopProperty);
-        }
-
-
-        // IsSelectionStopDoubleClickTarget Attached DP
-
-        // <summary>
-        // Gets PropertySelection.IsSelectionStopDoubleClickTarget property from the specified DependencyObject
-        // </summary>
-        // <param name="obj">DependencyObject to examine</param>
-        // <returns>Value of the IsSelectionStopDoubleClickTarget property.</returns>
-        internal static bool GetIsSelectionStopDoubleClickTarget(DependencyObject obj)
-        {
-            if (obj == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("obj");
-            }
-
-            return (bool)obj.GetValue(IsSelectionStopDoubleClickTargetProperty);
-        }
-
-        // <summary>
-        // Sets PropertySelection.IsSelectionStopDoubleClickTarget property on the specified DependencyObject
-        // </summary>
-        // <param name="obj">DependencyObject to modify</param>
-        // <param name="value">New value of IsSelectionStopDoubleClickTarget</param>
-        internal static void SetIsSelectionStopDoubleClickTarget(DependencyObject obj, bool value)
-        {
-            if (obj == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("obj");
-            }
-
-            obj.SetValue(IsSelectionStopDoubleClickTargetProperty, value);
-        }
-
-        // <summary>
-        // Clears PropertySelection.IsSelectionStopDoubleClickTarget property from the specified DependencyObject
-        // </summary>
-        // <param name="obj">DependencyObject to modify</param>
-        internal static void ClearIsSelectionStopDoubleClickTarget(DependencyObject obj)
-        {
-            if (obj == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("obj");
-            }
-
-            obj.ClearValue(IsSelectionStopDoubleClickTargetProperty);
-        }
-
-        // Called when some object gets specified as the SelectionStop double-click target:
-        //
-        //      * Hook into the MouseDown event so that we can detect double-clicks and automatically
-        //        expand or collapse the corresponding SelectionStop, if possible
-        //
-        private static void OnIsSelectionStopDoubleClickTargetChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
-        {
-            FrameworkElement target = sender as FrameworkElement;
-            if (target == null)
-            {
-                return;
-            }
-
-            if (bool.Equals(e.OldValue, false) && bool.Equals(e.NewValue, true))
-            {
-                AddDoubleClickHandler(target);
-            }
-            else if (bool.Equals(e.OldValue, true) && bool.Equals(e.NewValue, false))
-            {
-                RemoveDoubleClickHandler(target);
-            }
-        }
-
-        // Called when some SelectionStop double-click target gets unloaded:
-        //
-        //      * Unhook from events so that we don't prevent garbage collection
-        //
-        private static void OnSelectionStopDoubleClickTargetUnloaded(object sender, RoutedEventArgs e)
-        {
-            FrameworkElement target = sender as FrameworkElement;
-            Fx.Assert(target != null, "sender parameter should not be null");
-
-            if (target == null)
-            {
-                return;
-            }
-
-            RemoveDoubleClickHandler(target);
-        }
-
-        // Called when the UI object representing a SelectionStop gets clicked:
-        //
-        //      * If this is a double-click and the SelectionStop can be expanded / collapsed,
-        //        expand / collapse the SelectionStop
-        //
-        private static void OnSelectionStopDoubleClickTargetMouseDown(object sender, MouseButtonEventArgs e)
-        {
-            DependencyObject target = e.OriginalSource as DependencyObject;
-            if (target == null)
-            {
-                return;
-            }
-
-            if (e.ClickCount > 1)
-            {
-
-                FrameworkElement parentSelectionStopVisual = PropertySelection.FindParentSelectionStop<FrameworkElement>(target);
-                if (parentSelectionStopVisual != null)
-                {
-
-                    ISelectionStop parentSelectionStop = PropertySelection.GetSelectionStop(parentSelectionStopVisual);
-                    if (parentSelectionStop != null && parentSelectionStop.IsExpandable)
-                    {
-                        parentSelectionStop.IsExpanded = !parentSelectionStop.IsExpanded;
-                    }
-                }
-            }
-        }
-
-        private static void AddDoubleClickHandler(FrameworkElement target)
-        {
-            target.AddHandler(UIElement.MouseDownEvent, new MouseButtonEventHandler(OnSelectionStopDoubleClickTargetMouseDown), false);
-            target.Unloaded += new RoutedEventHandler(OnSelectionStopDoubleClickTargetUnloaded);
-        }
-
-        private static void RemoveDoubleClickHandler(FrameworkElement target)
-        {
-            target.Unloaded -= new RoutedEventHandler(OnSelectionStopDoubleClickTargetUnloaded);
-            target.RemoveHandler(UIElement.MouseDownEvent, new MouseButtonEventHandler(OnSelectionStopDoubleClickTargetMouseDown));
-        }
-
-
-        // IsSelectionScope Attached DP
-
-        // <summary>
-        // Gets PropertySelection.IsSelectionScope property from the specified DependencyObject
-        // </summary>
-        // <param name="obj">DependencyObject to examine</param>
-        // <returns>Value of the IsSelectionScope property.</returns>
-        internal static bool GetIsSelectionScope(DependencyObject obj)
-        {
-            if (obj == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("obj");
-            }
-
-            return (bool)obj.GetValue(IsSelectionScopeProperty);
-        }
-
-        // <summary>
-        // Sets PropertySelection.IsSelectionScope property on the specified DependencyObject
-        // </summary>
-        // <param name="obj">DependencyObject to modify</param>
-        // <param name="value">New value of IsSelectionScope</param>
-        internal static void SetIsSelectionScope(DependencyObject obj, bool value)
-        {
-            if (obj == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("obj");
-            }
-
-            obj.SetValue(IsSelectionScopeProperty, value);
-        }
-
-        // KeyDownTarget Attached DP
-
-        // <summary>
-        // Gets PropertySelection.KeyDownTarget property from the specified DependencyObject
-        // </summary>
-        // <param name="obj">DependencyObject to examine</param>
-        // <returns>Value of the KeyDownTarget property.</returns>
-        internal static FrameworkElement GetKeyDownTarget(DependencyObject obj)
-        {
-            if (obj == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("obj");
-            }
-
-            return (FrameworkElement)obj.GetValue(KeyDownTargetProperty);
-        }
-
-        // <summary>
-        // Sets PropertySelection.KeyDownTarget property on the specified DependencyObject
-        // </summary>
-        // <param name="obj">DependencyObject to modify</param>
-        // <param name="value">New value of KeyDownTarget</param>
-        internal static void SetKeyDownTarget(DependencyObject obj, FrameworkElement value)
-        {
-            if (obj == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("obj");
-            }
-
-            obj.SetValue(KeyDownTargetProperty, value);
-        }
-
-        // Called when some FrameworkElement gets specified as the target for KeyDown RoutedEvents -
-        // hook into / unhook from the KeyDown event of the source
-        private static void OnKeyDownTargetChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
-        {
-            FrameworkElement target = sender as FrameworkElement;
-            if (target == null)
-            {
-                return;
-            }
-
-            if (e.OldValue != null && e.NewValue == null)
-            {
-                RemoveKeyStrokeHandlers(target);
-            }
-            else if (e.NewValue != null && e.OldValue == null)
-            {
-                AddKeyStrokeHandlers(target);
-            }
-        }
-
-        // Called when a KeyDownTarget gets unloaded -
-        // unhook from events so that we don't prevent garbage collection
-        private static void OnKeyDownTargetUnloaded(object sender, RoutedEventArgs e)
-        {
-            FrameworkElement target = sender as FrameworkElement;
-            Fx.Assert(target != null, "sender parameter should not be null");
-
-            if (target == null)
-            {
-                return;
-            }
-
-            RemoveKeyStrokeHandlers(target);
-        }
-
-        // Called when a KeyDownTarget is specified and a KeyDown event is detected on the source
-        private static void OnKeyDownTargetKeyDown(object sender, KeyEventArgs e)
-        {
-
-            // Ignore handled events
-            if (e.Handled)
-            {
-                return;
-            }
-
-            // Ignore navigation keys
-            if (e.Key == Key.Left || e.Key == Key.Right || e.Key == Key.Up || e.Key == Key.Down ||
-                e.Key == Key.Tab || e.Key == Key.Escape || e.Key == Key.Return || e.Key == Key.Enter ||
-                e.Key == Key.PageUp || e.Key == Key.PageDown || e.Key == Key.Home || e.Key == Key.End || e.Key == Key.LeftCtrl || e.Key == Key.RightCtrl)
-            {
-                return;
-            }
-
-            if (Keyboard.Modifiers == ModifierKeys.Control)
-            {
-                return;
-            }
-
-
-
-            DependencyObject keySender = sender as DependencyObject;
-            Fx.Assert(keySender != null, "keySender should not be null");
-            if (keySender == null)
-            {
-                return;
-            }
-
-            FrameworkElement keyTarget = GetKeyDownTarget(keySender);
-            Fx.Assert(keyTarget != null, "keyTarget should not be null");
-            if (keyTarget == null)
-            {
-                return;
-            }
-
-            // Find a focusable element on the target, set focus to it, and send the keys over
-            FrameworkElement focusable = VisualTreeUtils.FindFocusableElement<FrameworkElement>(keyTarget);
-            if (focusable != null && focusable == Keyboard.Focus(focusable))
-            {
-                focusable.RaiseEvent(e);
-            }
-        }
-
-        private static void AddKeyStrokeHandlers(FrameworkElement target)
-        {
-            target.AddHandler(UIElement.KeyDownEvent, new KeyEventHandler(OnKeyDownTargetKeyDown), false);
-            target.Unloaded += new RoutedEventHandler(OnKeyDownTargetUnloaded);
-        }
-
-        private static void RemoveKeyStrokeHandlers(FrameworkElement target)
-        {
-            target.Unloaded -= new RoutedEventHandler(OnKeyDownTargetUnloaded);
-            target.RemoveHandler(UIElement.KeyDownEvent, new KeyEventHandler(OnKeyDownTargetKeyDown));
-        }
-
-
-        // <summary>
-        // Returns the closest parent (or the element itself) marked as a SelectionStop.
-        // </summary>
-        // <typeparam name="T">Type of element to look for</typeparam>
-        // <param name="element">Element to examine</param>
-        // <returns>The closest parent (or the element itself) marked as a SelectionStop;
-        // null if not found.</returns>
-        internal static T FindParentSelectionStop<T>(DependencyObject element) where T : DependencyObject
-        {
-            if (element == null)
-            {
-                return null;
-            }
-
-            do
-            {
-                // IsEligibleSelectionStop already checks for visibility, so we don't need to
-                // to do a specific check somewhere else in this loop
-                if (IsEligibleSelectionStop<T>(element))
-                {
-                    return (T)element;
-                }
-
-                element = VisualTreeHelper.GetParent(element);
-            } while (element != null);
-
-            return null;
-        }
-
-        // <summary>
-        // Returns the closest neighbor in the given direction marked as a SelectionStop.
-        // </summary>
-        // <typeparam name="T">Type of element to look for</typeparam>
-        // <param name="element">Element to examine</param>
-        // <param name="direction">Direction to search in</param>
-        // <returns>The closest neighboring element in the given direction marked as a IsSelectionStop,
-        // if found, null otherwise.</returns>
-        internal static T FindNeighborSelectionStop<T>(DependencyObject element, SearchDirection direction) where T : DependencyObject
-        {
-
-            if (element == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("element");
-            }
-
-            T neighbor;
-            int maxSearchDepth = MaxSearchDepth;
-
-            // If we are looking for the NEXT element and we can dig deeper, start by digging deeper
-            // before trying to look for any siblings.
-            //
-            if (direction == SearchDirection.Next && IsExpanded(element))
-            {
-                neighbor = FindChildSelectionStop<T>(element, 0, VisualTreeHelper.GetChildrenCount(element) - 1, direction, maxSearchDepth, MatchDirection.Down);
-
-                if (neighbor != null)
-                {
-                    return neighbor;
-                }
-            }
-
-            int childIndex, childrenCount, childDepth;
-            bool isParentSelectionStop, isParentSelectionScope = false;
-            DependencyObject parent = element;
-
-            while (true)
-            {
-                while (true)
-                {
-                    // If we reached the selection scope, don't try to go beyond it
-                    if (isParentSelectionScope)
-                    {
-                        return null;
-                    }
-
-                    parent = GetEligibleParent(parent, out childIndex, out childrenCount, out childDepth, out isParentSelectionStop, out isParentSelectionScope);
-                    maxSearchDepth += childDepth;
-
-                    if (parent == null)
-                    {
-                        return null;
-                    }
-
-                    if (direction == SearchDirection.Next && (childIndex + 1) >= childrenCount)
-                    {
-                        continue;
-                    }
-
-                    if (direction == SearchDirection.Previous && isParentSelectionStop == false && (childIndex < 1))
-                    {
-                        continue;
-                    }
-
-                    break;
-                }
-
-                // If we get here, that means we found a SelectionStop on which we need to look for children that are
-                // SelectionStops themselves.  The first such child found should be returned.  Otherwise, if no such child
-                // is found, we potentially look at the node itself and return it OR we repeat the process and keep looking
-                // for a better parent.
-
-                int leftIndex, rightIndex;
-                MatchDirection matchDirection;
-
-                if (direction == SearchDirection.Previous)
-                {
-                    leftIndex = 0;
-                    rightIndex = childIndex - 1;
-                    matchDirection = MatchDirection.Up;
-                }
-                else
-                {
-                    leftIndex = childIndex + 1;
-                    rightIndex = childrenCount - 1;
-                    matchDirection = MatchDirection.Down;
-                }
-
-                neighbor = FindChildSelectionStop<T>(parent, leftIndex, rightIndex, direction, maxSearchDepth, matchDirection);
-                if (neighbor != null)
-                {
-                    return neighbor;
-                }
-
-                if (direction == SearchDirection.Previous &&
-                    IsEligibleSelectionStop<T>(parent))
-                {
-                    return (T)parent;
-                }
-            }
-        }
-
-        // Helper method used from GetNeighborSelectionStop()
-        // Returns a parent DependencyObject of the specified element that is
-        // 
-        //  * Visible AND
-        //  * ( Marked with a SelectionStop OR
-        //  *   Marked with IsSelectionScope = true OR
-        //  *   Has more than one child )
-        //
-        private static DependencyObject GetEligibleParent(DependencyObject element, out int childIndex, out int childrenCount, out int childDepth, out bool isSelectionStop, out bool isSelectionScope)
-        {
-            childDepth = 0;
-            isSelectionStop = false;
-            isSelectionScope = false;
-            bool isVisible;
-
-            do
-            {
-                element = VisualTreeUtils.GetIndexedVisualParent(element, out childrenCount, out childIndex);
-                isSelectionStop = element == null ? false : (GetSelectionStop(element) != null);
-                isSelectionScope = element == null ? false : GetIsSelectionScope(element);
-                isVisible = VisualTreeUtils.IsVisible(element as UIElement);
-
-                childDepth++;
-            }
-            while (
-                element != null &&
-                (isVisible == false ||
-                (isSelectionStop == false &&
-                isSelectionScope == false &&
-                childrenCount < 2)));
-
-            return element;
-        }
-
-        // Helper method that performs a recursive, depth-first search of children starting at the specified parent,
-        // looking for any children that conform to the specified Type and are marked with a SelectionStop
-        //
-        private static T FindChildSelectionStop<T>(DependencyObject parent, int leftIndex, int rightIndex, SearchDirection iterationDirection, int maxDepth, MatchDirection matchDirection)
-            where T : DependencyObject
-        {
-
-            if (parent == null || maxDepth <= 0)
-            {
-                return null;
-            }
-
-            int step = iterationDirection == SearchDirection.Next ? 1 : -1;
-            int index = iterationDirection == SearchDirection.Next ? leftIndex : rightIndex;
-
-            for (; index >= leftIndex && index <= rightIndex; index = index + step)
-            {
-
-                DependencyObject child = VisualTreeHelper.GetChild(parent, index);
-
-                // If MatchDirection is set to Down, do an eligibility match BEFORE we dive down into
-                // more children.
-                //
-                if (matchDirection == MatchDirection.Down && IsEligibleSelectionStop<T>(child))
-                {
-                    return (T)child;
-                }
-
-                // If this child is not an eligible SelectionStop because it is not visible,
-                // there is no point digging down to get to more children.
-                //
-                if (!VisualTreeUtils.IsVisible(child as UIElement))
-                {
-                    continue;
-                }
-
-                int grandChildrenCount = VisualTreeHelper.GetChildrenCount(child);
-                if (grandChildrenCount > 0 && IsExpanded(child))
-                {
-                    T element = FindChildSelectionStop<T>(child, 0, grandChildrenCount - 1, iterationDirection, maxDepth - 1, matchDirection);
-
-                    if (element != null)
-                    {
-                        return element;
-                    }
-                }
-
-                // If MatchDirection is set to Up, do an eligibility match AFTER we tried diving into
-                // more children and failed to find something we could return.
-                //
-                if (matchDirection == MatchDirection.Up && IsEligibleSelectionStop<T>(child))
-                {
-                    return (T)child;
-                }
-            }
-
-            return null;
-        }
-
-        // Helper method that returns false if the given element is a collapsed SelectionStop,
-        // true otherwise.
-        //
-        private static bool IsExpanded(DependencyObject element)
-        {
-            ISelectionStop selectionStop = PropertySelection.GetSelectionStop(element);
-            return selectionStop == null || selectionStop.IsExpanded;
-        }
-
-        // Helper method that return true if the given element is marked with a SelectionStop,
-        // if it derives from the specified Type, and if it is Visible (assuming it derives from UIElement)
-        //
-        private static bool IsEligibleSelectionStop<T>(DependencyObject element) where T : DependencyObject
-        {
-            return (GetSelectionStop(element) != null) && typeof(T).IsAssignableFrom(element.GetType()) && VisualTreeUtils.IsVisible(element as UIElement);
-        }
-
-        // <summary>
-        // Private enum we use to specify whether FindSelectionStopChild() should return any matches
-        // as it drills down into the visual tree (Down) or whether it should wait on looking at
-        // matches until it's bubbling back up again (Up).
-        // </summary>
-        private enum MatchDirection
-        {
-            Down,
-            Up
-        }
-
-        // IsSelected ReadOnly, Attached DP
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/PropertySelectionPathInterpreter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/PropertySelectionPathInterpreter.cs
deleted file mode 100644 (file)
index e4e6118..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Selection 
-{
-    using System.Diagnostics;
-    using System.Text;
-    using System.Windows;
-
-    using System.Activities.Presentation.PropertyEditing;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.Editors;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using System.Activities.Presentation.Internal.PropertyEditing.State;
-
-    // <summary>
-    // Helper class that knows how to construct and interpret SelectionPaths leading
-    // to properties.
-    // </summary>
-    internal class PropertySelectionPathInterpreter : ISelectionPathInterpreter 
-    {
-        internal const string PropertyPathTypeId = "Cider_PropertyPath";
-        private static PropertySelectionPathInterpreter _instance = new PropertySelectionPathInterpreter();
-        private PropertySelectionPathInterpreter() 
-        {
-        }
-        public static PropertySelectionPathInterpreter Instance 
-        { get { return _instance; } }
-
-        public string PathTypeId
-        { get { return PropertyPathTypeId; } }
-
-        // <summary>
-        // Creates an instance of SelectionPath to the specified property that
-        // this class knows how to interpret.
-        // </summary>
-        // <param name="property">Property to create a path to</param>
-        // <returns>A new instance of SelectionPath to the specified property</returns>
-        public SelectionPath ConstructSelectionPath(PropertyEntry property) 
-        {
-            StringBuilder path = new StringBuilder();
-            path.Append(ModelUtilities.GetCachedSubPropertyHierarchyPath(property));
-            return new SelectionPath(PathTypeId, path.ToString());
-        }
-
-        // ISelectionPathInterpreter Members
-
-        public DependencyObject ResolveSelectionPath(CategoryList root, SelectionPath path, out bool pendingGeneration) 
-        {
-            pendingGeneration = false;
-            if (path == null || !string.Equals(PathTypeId, path.PathTypeId)) 
-            {
-                Debug.Fail("Invalid SelectionPath specified.");
-                return null;
-            }
-
-            if (root == null) 
-            {
-                Debug.Fail("No CategoryList specified.");
-                return null;
-            }
-
-            string[] pathValues = path.Path.Split(',');
-            if (pathValues.Length < 1) 
-            {
-                Debug.Fail("Invalid SelectionPath specified.");
-                return null;
-            }
-
-            //
-            // Note: By the time this method gets called, all the visuals should have been expanded
-            // and rendered.  Hence, if we can't find a visual in the visual tree, it doesn't exist
-            // and we shouldn't worry about trying to expand some parent visual and waiting for it
-            // to render.
-            //
-
-            ModelCategoryEntry parentCategory;
-
-            PropertyEntry currentProperty = root.FindPropertyEntry(PersistedStateUtilities.Unescape(pathValues[0]), out parentCategory);
-            PropertyContainer currentContainer = root.FindPropertyEntryVisual(currentProperty, parentCategory, out pendingGeneration);
-            DependencyObject lastFoundContainer = currentContainer;
-            int pathIndex = 1;
-
-            while (currentContainer != null && pathIndex < pathValues.Length) 
-            {
-
-                SubPropertyEditor subPropertyEditor = VisualTreeUtils.GetTemplateChild<SubPropertyEditor>(currentContainer);
-                if (subPropertyEditor == null)
-                {
-                    break;
-                }
-
-                // If the subpropertyEditor is not expanded and is expandable, we won't be able to get the target property's visual
-                // element, Expand it, set pendingGeneration to True, and return null. Expect the caller to call again.
-                if (subPropertyEditor.IsExpandable && !subPropertyEditor.IsExpanded)
-                {
-                    subPropertyEditor.IsExpanded = true;
-                    pendingGeneration = true;
-                    return null;
-                }
-
-                PropertyEntry property = subPropertyEditor.FindSubPropertyEntry(PersistedStateUtilities.Unescape(pathValues[pathIndex]));
-                if (property == null)
-                {
-                    break;
-                }
-
-                currentContainer = subPropertyEditor.FindSubPropertyEntryVisual(property);
-                lastFoundContainer = currentContainer ?? lastFoundContainer;
-                pathIndex++;
-            }
-
-            if (lastFoundContainer == null)
-            {
-                return null;
-            }
-
-            return lastFoundContainer;
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/PropertySelectionStop.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/PropertySelectionStop.cs
deleted file mode 100644 (file)
index 4bd0daf..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Selection 
-{
-    using System;
-    using System.Globalization;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // Helper class used to manage the selection stop behavior of a given PropertyContainer.
-    // All it really does is expose the SelectionPath leading to its contained PropertyContainer.
-    // </summary>
-    internal class PropertySelectionStop : ISelectionStop 
-    {
-
-        private PropertyEntry _property;
-        private SelectionPath _selectionPath;
-
-        // <summary>
-        // Creates a new PropertySelectionStop wrapping around the specified PropertyEntry
-        // </summary>
-        // <param name="property">PropertyEntry to wrap around</param>
-        public PropertySelectionStop(PropertyEntry property) 
-        {
-            if (property == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("property");
-            }
-            _property = property;
-        }
-
-        // <summary>
-        // Gets true, throws on set
-        // </summary>
-        public bool IsExpanded 
-        {
-            get { return true; }
-            set { throw FxTrace.Exception.AsError(new InvalidOperationException()); }
-        }
-
-        // <summary>
-        // Gets false
-        // </summary>
-        public bool IsExpandable 
-        {
-            get { return false; }
-        }
-
-        // <summary>
-        // Gets a SelectionPath that leads to the contained PropertyEntry
-        // </summary>
-        public SelectionPath Path 
-        {
-            get {
-                if (_selectionPath == null)
-                {
-                    _selectionPath = PropertySelectionPathInterpreter.Instance.ConstructSelectionPath(_property);
-                }
-
-                return _selectionPath;
-            }
-        }
-
-        // <summary>
-        // Gets a description of the contained property
-        // to expose through automation
-        // </summary>
-        public string Description 
-        {
-            get {
-                return string.Format(
-                    CultureInfo.CurrentCulture,
-                    Properties.Resources.PropertyEditing_SelectionStatus_Property,
-                    _property.PropertyName);
-
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/SelectionPath.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/SelectionPath.cs
deleted file mode 100644 (file)
index 87c844d..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Selection 
-{
-    using System.ComponentModel;
-    using System.Diagnostics;
-
-    // <summary>
-    // A class we use to describe what visual element is currently selected within
-    // the CategoryList class (property, category, category editor, ...)
-    // </summary>
-    internal class SelectionPath 
-    {
-        private string _pathTypeId;
-        private string _path;
-
-        // <summary>
-        // Creates a new instance of SelectionPath with the specified
-        // path ID and path.
-        // </summary>
-        // <param name="pathTypeId">Token that identifies the ISelectionPathInterpreter
-        // that knows how to resolve the specified path</param>
-        // <param name="path">Path to the selected object</param>
-        public SelectionPath(string pathTypeId, string path) 
-        {
-            _pathTypeId = pathTypeId;
-            _path = path;
-        }
-
-        // <summary>
-        // Gets the token that identifies the ISelectionPathInterpreter that knows how
-        // to resolve the contained path.
-        // </summary>
-        public string PathTypeId 
-        { get { return _pathTypeId; } }
-
-        // <summary>
-        // Gets the path itself.
-        // </summary>
-        public string Path 
-        { get { return _path; } }
-
-        // <summary>
-        // Packages this instance into a serializable object
-        // </summary>
-        public object State 
-        {
-            get {
-                return new string[] { _pathTypeId, _path };
-            }
-        }
-
-        // <summary>
-        // Converts the serializable object returned by the State property
-        // back into an instance of SelectionPath
-        // </summary>
-        // <param name="state">State to convert</param>
-        // <returns>Instance of SelectionPath represented by the given state object</returns>
-        public static SelectionPath FromState(object state) 
-        {
-            string[] values = state as string[];
-            if (values == null || values.Length != 2) 
-            {
-                Debug.Fail("Invalid SelectionPath State object");
-                return null;
-            }
-
-            return new SelectionPath(values[0], values[1]);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/SelectionPathResolver.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Selection/SelectionPathResolver.cs
deleted file mode 100644 (file)
index 564d6b4..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Selection 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Windows;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // Helper static class that attempts to resolve a given SelectionPath into the corresponding
-    // visual in the CategoryList control.
-    // </summary>
-    internal static class SelectionPathResolver 
-    {
-        private static Dictionary<string, ISelectionPathInterpreter> _interpreters;
-
-        [SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")]
-        static SelectionPathResolver() 
-        {
-
-            // Register known SelectionPath interpreters
-            //
-            SelectionPathResolver.RegisterInterpreter(CategoryContainerSelectionPathInterpreter.Instance);
-            SelectionPathResolver.RegisterInterpreter(CategoryEditorSelectionPathInterpreter.Instance);
-            SelectionPathResolver.RegisterInterpreter(PropertySelectionPathInterpreter.Instance);
-        }
-
-        private static void RegisterInterpreter(ISelectionPathInterpreter interpreter) 
-        {
-            if (interpreter == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("interpreter");
-            }
-
-            if (_interpreters == null)
-            {
-                _interpreters = new Dictionary<string, ISelectionPathInterpreter>();
-            }
-
-            if (_interpreters.ContainsKey(interpreter.PathTypeId))
-            {
-                Debug.Fail(string.Format(System.Globalization.CultureInfo.CurrentCulture, "ISelectionPathInterpreter for path type of ID '{0}' already registered.  Ignoring.", interpreter.PathTypeId));
-            }
-            else 
-            {
-                _interpreters[interpreter.PathTypeId] = interpreter;
-            }
-        }
-
-        // <summary>
-        // Attempt to resolve the given SelectionPath into the corresponding visual in the
-        // specified CategoryList control.
-        // </summary>
-        // <param name="root">CategoryList control instance to look in</param>
-        // <param name="path">SelectionPath to resolve</param>
-        // <returns>Corresponding visual, if found, null otherwise</returns>
-        public static DependencyObject ResolveSelectionPath(CategoryList root, SelectionPath path, out bool pendingGeneration) 
-        {
-            pendingGeneration = false;
-            if (root == null || path == null) 
-            {
-                return null;
-            }
-
-            ISelectionPathInterpreter interpreter;
-            if (!_interpreters.TryGetValue(path.PathTypeId, out interpreter)) 
-            {
-                return null;
-            }
-            return interpreter.ResolveSelectionPath(root, path, out pendingGeneration);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/SharedPropertyValueColumnWidthContainer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/SharedPropertyValueColumnWidthContainer.cs
deleted file mode 100644 (file)
index 44ad11d..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-    using System;
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows;
-    using System.Activities.Presentation;
-    using System.Runtime;
-
-    // <summary>
-    // Container for a shared DependencyProperty that determines the width of the property value
-    // column within a CategoryList.
-    // This class needs to be public because it's referenced from MarkupExtensions and, apparently,
-    // they require the classes to be public.
-    // </summary>
-    class SharedPropertyValueColumnWidthContainer : DependencyObject, INotifyPropertyChanged 
-    {
-
-        // <summary>
-        // Accessor to static, inherited, attached DP that contains a pointer to this class
-        // </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public static readonly DependencyProperty OwningSharedPropertyValueColumnWidthContainerProperty = DependencyProperty.RegisterAttached(
-            "OwningSharedPropertyValueColumnWidthContainer",
-            typeof(SharedPropertyValueColumnWidthContainer),
-            typeof(SharedPropertyValueColumnWidthContainer),
-            new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));
-
-        private const double DefaultPercentage = 0.4f;
-
-        private bool _changeTriggeredInternally;
-        private GridLength _valueColumnWidth = new GridLength(0);
-        private double _containerWidth;
-        private double _valueColumnPercentage = DefaultPercentage;
-
-        // OwningSharedPropertyValueColumnWidthContainer attached, inherited DP
-
-        // <summary>
-        // Fires an event when one of the exposed properties change
-        // </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public event PropertyChangedEventHandler PropertyChanged;
-
-        // <summary>
-        // Gets or sets the pixel width of the shared property value column.
-        // Setting this value will recalculate the ValueColumnPercentage property.
-        // We bind to this property from Xaml, hence it has to be public.
-        // Sigh...
-        // </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        [Fx.Tag.KnownXamlExternalAttribute]
-        public GridLength ValueColumnWidth 
-        {
-            get {
-                return _valueColumnWidth;
-            }
-            set {
-                if (value.GridUnitType != GridUnitType.Pixel) 
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException());
-                }
-
-                _valueColumnWidth = value;
-                OnPropertyChanged("ValueColumnWidth");
-
-                if (this.ContainerWidth > 0) 
-                {
-                    if (!_changeTriggeredInternally) 
-                    {
-                        try 
-                        {
-                            // Don't modify ValueColumnWidth again
-                            _changeTriggeredInternally = true;
-
-                            this.ValueColumnPercentage = value.Value / this.ContainerWidth;
-                        }
-                        finally 
-                        {
-                            _changeTriggeredInternally = false;
-                        }
-                    }
-                }
-            }
-        }
-
-        // <summary>
-        // Gets or sets the width of the container.  Setting this value
-        // will recalculate the ValueColumnWidth property.
-        // We bind to this property from Xaml, hence it has to be public.
-        // Sigh...
-        // </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public double ContainerWidth 
-        {
-            get {
-                return _containerWidth;
-            }
-            internal set {
-                _containerWidth = value;
-                OnPropertyChanged("ContainerWidth");
-
-                if (!_changeTriggeredInternally) 
-                {
-                    try 
-                    {
-                        // Don't modify ValueColumnPercentage, just ValueColumnWidth
-                        _changeTriggeredInternally = true;
-
-                        this.ValueColumnWidth = new GridLength(value * this.ValueColumnPercentage);
-                    }
-                    finally 
-                    {
-                        _changeTriggeredInternally = false;
-                    }
-                }
-            }
-        }
-
-        // <summary>
-        // Gets or sets the percentage width of the property value column
-        // as compared to the rest of the container.  Setting this value will
-        // recalculate the ValueColumnWidth property.
-        // </summary>
-        internal double ValueColumnPercentage 
-        {
-            get {
-                return _valueColumnPercentage;
-            }
-            set {
-                _valueColumnPercentage = Normalize(value, 0, 1);
-                OnPropertyChanged("ValueColumnPercentage");
-
-                if (!_changeTriggeredInternally) 
-                {
-                    try 
-                    {
-                        // Don't modify ValueColumnPercentage again
-                        _changeTriggeredInternally = true;
-
-                        this.ValueColumnWidth = new GridLength(value * this.ContainerWidth);
-                    }
-                    finally 
-                    {
-                        _changeTriggeredInternally = false;
-                    }
-                }
-            }
-        }
-
-        // <summary>
-        // Setter for OwningSharedPropertyValueColumnWidthContainerProperty
-        // </summary>
-        // <param name="obj"></param>
-        // <param name="value"></param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public static void SetOwningSharedPropertyValueColumnWidthContainer(DependencyObject obj, SharedPropertyValueColumnWidthContainer value) 
-        {
-            if (obj == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("obj");
-            }
-
-            obj.SetValue(OwningSharedPropertyValueColumnWidthContainerProperty, value);
-        }
-
-        // <summary>
-        // Getter for OwningSharedPropertyValueColumnWidthContainerProperty
-        // </summary>
-        // <param name="obj"></param>
-        // <returns></returns>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public static SharedPropertyValueColumnWidthContainer GetOwningSharedPropertyValueColumnWidthContainer(DependencyObject obj) 
-        {
-            if (obj == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("obj");
-            }
-
-            return (SharedPropertyValueColumnWidthContainer)obj.GetValue(OwningSharedPropertyValueColumnWidthContainerProperty);
-        }
-
-
-
-        // Normalizes the given value into the specified range
-        private static double Normalize(double value, double min, double max) 
-        {
-            return Math.Max(min, Math.Min(max, value));
-        }
-
-        // INotifyPropertyChanged Members
-
-        private void OnPropertyChanged(string propertyName) 
-        {
-            if (propertyName == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("propertyName");
-            }
-
-            if (PropertyChanged != null)
-            {
-                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-            }
-        }
-
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/AggregateStateContainer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/AggregateStateContainer.cs
deleted file mode 100644 (file)
index efe93df..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.State 
-{
-    using System;
-    using System.Diagnostics;
-
-    // <summary>
-    // Aggregate of IStateContainer objects
-    // </summary>
-    internal class AggregateStateContainer : IStateContainer 
-    {
-
-        private IStateContainer[] _containers;
-
-        public AggregateStateContainer(params IStateContainer[] containers) {
-            _containers = containers;
-        }
-
-        public object RetrieveState() 
-        {
-            object[] states = null;
-
-            if (_containers != null) 
-            {
-                states = new object[_containers.Length];
-                for (int i = 0; i < _containers.Length; i++)
-                {
-                    states[i] = _containers[i] == null ? null : _containers[i].RetrieveState();
-                }
-            }
-
-            return states;
-        }
-
-        public void RestoreState(object state) 
-        {
-            if (_containers != null) 
-            {
-
-                object[] states = state as object[];
-                if (states == null || states.Length != _containers.Length) 
-                {
-                    Debug.Fail("Invalid state to restore: " + (state == null ? "null" : state.ToString()));
-                    return;
-                }
-
-                for (int i = 0; i < _containers.Length; i++)
-                {
-                    if (_containers[i] != null)
-                    {
-                        _containers[i].RestoreState(states[i]);
-                    }
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/CategoryState.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/CategoryState.cs
deleted file mode 100644 (file)
index a1ab311..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.State 
-{
-    using System;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-
-    // <summary>
-    // Simple category state object that knows how to remember
-    // two boolean flags: the expansion state of the category itself and the
-    // expansion state of its advanced section.
-    // </summary>
-    internal class CategoryState : PersistedState 
-    {
-
-        private const bool DefaultCategoryExpanded = true;
-        private const bool DefaultAdvancedSectionExpanded = true;
-
-        private string _categoryName;
-
-        private bool _categoryExpanded = DefaultCategoryExpanded;
-        private bool _advancedSectionExpanded = DefaultAdvancedSectionExpanded;
-
-        // <summary>
-        // Basic ctor
-        // </summary>
-        // <param name="categoryName">Name of the contained category</param>
-        [SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily")]
-        public CategoryState(string categoryName) 
-        {
-            Fx.Assert(!string.IsNullOrEmpty(categoryName), "Expected a full category name");
-            _categoryName = categoryName;
-        }
-
-        // <summary>
-        // We key these state objects by the category names
-        // </summary>
-        public override object Key 
-        {
-            get { return _categoryName; }
-        }
-
-        // <summary>
-        // Returns true if any of the contained values differ from the default
-        // </summary>
-        public override bool IsSignificant 
-        {
-            get { return _categoryExpanded != DefaultCategoryExpanded || _advancedSectionExpanded != DefaultAdvancedSectionExpanded; }
-        }
-
-        // <summary>
-        // Gets or sets a flag indicating whether this category should be expanded or collapsed
-        // </summary>
-        public bool CategoryExpanded 
-        {
-            get { return _categoryExpanded; }
-            set { _categoryExpanded = value; }
-        }
-
-        // <summary>
-        // Gets or sets a flag indicating whether this category should have its advanced section
-        // expanded or collapsed
-        // </summary>
-        public bool AdvancedSectionExpanded 
-        {
-            get { return _advancedSectionExpanded; }
-            set { _advancedSectionExpanded = value; }
-        }
-
-        // <summary>
-        // Serializes this object into a simple string (AppDomains like strings).
-        //
-        // Format: CategoryName,CategoryExpanded,AdvancedExpanded;NextCategoryName,CategoryExpanded,AdvancedExpanded;...
-        // Where bools are recorded as 0 = false and 1 = true and ';' and ',' are escaped
-        // </summary>
-        // <returns>Serialized version of this state object (may be null)</returns>
-        protected override string SerializeCore() 
-        {
-            return string.Concat(
-                PersistedStateUtilities.Escape(_categoryName),
-                ',',
-                PersistedStateUtilities.BoolToDigit(_categoryExpanded),
-                ',',
-                PersistedStateUtilities.BoolToDigit(_advancedSectionExpanded));
-        }
-
-        // <summary>
-        // Attempts to deserialize a string into a CategoryState object
-        // </summary>
-        // <param name="categoryStateString">String to deserialize</param>
-        // <returns>Instance of CategoryState if the serialized string was valid, null otherwise.</returns>
-        public static CategoryState Deserialize(string categoryStateString) 
-        {
-            string[] args = categoryStateString.Split(',');
-            if (args == null || args.Length != 3)
-            {
-                return null;
-            }
-
-            bool? categoryExpanded = PersistedStateUtilities.DigitToBool(args[1]);
-            bool? advancedSectionExpanded = PersistedStateUtilities.DigitToBool(args[2]);
-            if (categoryExpanded == null || advancedSectionExpanded == null)
-            {
-                return null;
-            }
-
-            string categoryName = PersistedStateUtilities.Unescape(args[0]);
-            if (string.IsNullOrEmpty(categoryName))
-            {
-                return null;
-            }
-
-            CategoryState categoryState = new CategoryState(categoryName);
-            categoryState.CategoryExpanded = (bool)categoryExpanded;
-            categoryState.AdvancedSectionExpanded = (bool)advancedSectionExpanded;
-            return categoryState;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/CategoryStateContainer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/CategoryStateContainer.cs
deleted file mode 100644 (file)
index 86f38ec..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.State 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Diagnostics;
-
-    // <summary>
-    // Simple wrapper around a dictionary of CategoryStates keyed by the category names.
-    // </summary>
-    internal class CategoryStateContainer : PersistedStateContainer 
-    {
-
-        // <summary>
-        // Gets the CategoryState for the specified category.  If one does not exist
-        // yet, it will be created automatically, guaranteeing a non-null return value.
-        // </summary>
-        // <param name="categoryName">Name of the requested category</param>
-        // <returns>A non-null instance of CategoryState</returns>
-        public CategoryState GetCategoryState(string categoryName) 
-        {
-            return (CategoryState)this.GetState(categoryName);
-        }
-
-        // <summary>
-        // Creates a default state object based on the specified key
-        // </summary>
-        // <param name="key">Key of the state object</param>
-        // <returns>Default state object</returns>
-        protected override PersistedState CreateDefaultState(object key) 
-        {
-            return new CategoryState(key as string);
-        }
-
-        // <summary>
-        // Deserializes the specified string value into a state object
-        // </summary>
-        // <param name="serializedValue">Serialized value of the state object</param>
-        // <returns>Deserialized instance of the state object</returns>
-        protected override PersistedState DeserializeState(string serializedValue) 
-        {
-            return CategoryState.Deserialize(serializedValue);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PersistedState.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PersistedState.cs
deleted file mode 100644 (file)
index bca19b0..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.State 
-{
-    using System;
-
-    // <summary>
-    // Simple base class for persisted state objects so that we can reuse a chunk of the logic
-    // from one persistent state storage to another.
-    // </summary>
-    internal abstract class PersistedState 
-    {
-
-        // <summary>
-        // Gets a value indicating whether the content of the state object is significant
-        // enough that it warrants serialization
-        // </summary>
-        public abstract bool IsSignificant 
-        { get; }
-
-        // <summary>
-        // Gets an object that we use as a key to key off this state instance
-        // </summary>
-        public abstract object Key 
-        { get; }
-
-        // <summary>
-        // Serializes this state into a string that can be persisted across app domains.
-        // If the content of this state is not significant enough to persist, null is returned.
-        // </summary>
-        // <returns>Serialization of this state object, or null if not significant enough.</returns>
-        public string Serialize() 
-        {
-            return IsSignificant ? SerializeCore() : null;
-        }
-
-        // <summary>
-        // Serializes this object into a string.
-        // </summary>
-        // <returns>String representation of this object.</returns>
-        protected abstract string SerializeCore();
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PersistedStateContainer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PersistedStateContainer.cs
deleted file mode 100644 (file)
index 1982dd8..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.State 
-{
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Text;
-    using System.Runtime;
-
-    // <summary>
-    // Helper class we use to contain a bunch of PersistedState objects.  Basically, the common functionality
-    // of CategoryStateContainer and PropertyStateContainer lives here.
-    // </summary>
-    internal abstract class PersistedStateContainer : IStateContainer 
-    {
-
-        private readonly Dictionary<object, PersistedState> _persistedStates = new Dictionary<object, PersistedState>();
-
-        // <summary>
-        // Gets the state for the specified key.  If not found, a default state object is
-        // created and returned.
-        // </summary>
-        // <param name="key">Key to look up</param>
-        // <returns>Guaranteed non-null result</returns>
-        protected PersistedState GetState(object key) 
-        {
-            PersistedState state = null;
-            if (!_persistedStates.TryGetValue(key, out state)) 
-            {
-                state = CreateDefaultState(key);
-                Fx.Assert(state != null, "CreateDefaultState() should always return a value");
-
-                _persistedStates[key] = state;
-            }
-
-            return state;
-        }
-
-        // <summary>
-        // Creates a default state object based on the specified key
-        // </summary>
-        // <param name="key">Key of the state object</param>
-        // <returns>Default state object</returns>
-        protected abstract PersistedState CreateDefaultState(object key);
-
-        // <summary>
-        // Deserializes the specified string value into a state object
-        // </summary>
-        // <param name="serializedValue">Serialized value of the state object</param>
-        // <returns>Deserialized instance of the state object</returns>
-        protected abstract PersistedState DeserializeState(string serializedValue);
-
-        // IStateContainer Members
-
-        // <summary>
-        // Merges the content of the state object with the content of this class
-        // </summary>
-        // <param name="state">State object to apply</param>
-        public void RestoreState(object state) 
-        {
-            string serializedStates = state as string;
-            if (string.IsNullOrEmpty(serializedStates))
-            {
-                return;
-            }
-
-            string[] stateArray = serializedStates.Split(';');
-            if (stateArray == null || stateArray.Length == 0)
-            {
-                return;
-            }
-
-            foreach (string stateString in stateArray) 
-            {
-                PersistedState deserializedState = DeserializeState(stateString);
-                if (deserializedState == null) 
-                {
-                    Debug.Fail("Invalid state.  Deserialization failed: " + stateString);
-                    continue;
-                }
-
-                _persistedStates[deserializedState.Key] = deserializedState;
-            }
-        }
-
-        // <summary>
-        // Serializes the content of this class into a state object.
-        // </summary>
-        // <returns>Serialized version of this class</returns>
-        public object RetrieveState() 
-        {
-            if (_persistedStates.Count == 0)
-            {
-                return null;
-            }
-
-            StringBuilder serializedState = new StringBuilder();
-            bool addSeparator = false;
-            foreach (PersistedState state in _persistedStates.Values) 
-            {
-
-                string stateString = state.Serialize();
-                if (stateString == null)
-                {
-                    continue;
-                }
-
-                if (addSeparator)
-                {
-                    serializedState.Append(';');
-                }
-
-                serializedState.Append(stateString);
-                addSeparator = true;
-            }
-
-            return serializedState.ToString();
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PersistedStateUtilities.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PersistedStateUtilities.cs
deleted file mode 100644 (file)
index 9f3635d..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.State 
-{
-
-    // <summary>
-    // A set of utility methods we use to persist state
-    // </summary>
-    internal static class PersistedStateUtilities 
-    {
-
-        // <summary>
-        // Escapes '&,;.' characters
-        // </summary>
-        // <param name="s">String to escape</param>
-        // <returns>Escaped string</returns>
-        public static string Escape(string s) 
-        {
-            if (string.IsNullOrEmpty(s))
-            {
-                return null;
-            }
-
-            s = s.Replace("&", "&&");
-            s = s.Replace(",", "&comma&");
-            s = s.Replace(";", "&semicolon&");
-            s = s.Replace(".", "&dot&");
-            return s;
-        }
-
-        // <summary>
-        // Unescapes '&;,.' characters
-        // </summary>
-        // <param name="s">Escaped string</param>
-        // <returns>Unescaped string</returns>
-        public static string Unescape(string s) 
-        {
-            if (string.IsNullOrEmpty(s))
-            {
-                return null;
-            }
-
-            s = s.Replace("&comma&", ",");
-            s = s.Replace("&semicolon&", ";");
-            s = s.Replace("&dot&", ".");
-            s = s.Replace("&&", "&");
-            return s;
-        }
-
-        // <summary>
-        // Converts 0 -> false, 1 -> true, anything else -> null
-        // </summary>
-        // <param name="digit">digit to convert</param>
-        // <returns>True/False/Null</returns>
-        public static bool? DigitToBool(string digit) 
-        {
-            return "0".Equals(digit) ? false : ("1".Equals(digit) ? true : (bool?)null);
-        }
-
-        // <summary>
-        // Converts true -> 1, false -> 0
-        // </summary>
-        // <param name="value">Value to convert</param>
-        // <returns>Bool as a digit string</returns>
-        public static string BoolToDigit(bool value) 
-        {
-            return value ? "1" : "0";
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PropertyActiveEditModeStateContainer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PropertyActiveEditModeStateContainer.cs
deleted file mode 100644 (file)
index fa0d09c..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.State 
-{
-    using System.Collections;
-    using System.Text;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-
-    // <summary>
-    // Container storing the names of properties the value editors of which
-    // are in ExtendedPinned ActiveEditMode.  We persist this information
-    // across domain reloads and view changes.
-    // </summary>
-    internal class PropertyActiveEditModeStateContainer : IStateContainer 
-    {
-
-        public static readonly PropertyActiveEditModeStateContainer Instance = new PropertyActiveEditModeStateContainer();
-
-        private Hashtable _expandedPropertyEditors = new Hashtable();
-        private PropertyActiveEditModeStateContainer() 
-        {
-        }
-
-        // <summary>
-        // Gets the last stored ActiveEditMode for the specified property
-        // </summary>
-        // <param name="property">PropertyEntry to look up</param>
-        // <returns>Last stored ActiveEditMode for the specified property</returns>
-        public PropertyContainerEditMode GetActiveEditMode(PropertyEntry property) 
-        {
-            return _expandedPropertyEditors.ContainsKey(ModelUtilities.GetCachedSubPropertyHierarchyPath(property)) ?
-                PropertyContainerEditMode.ExtendedPinned :
-                PropertyContainerEditMode.Inline;
-        }
-
-        // <summary>
-        // Stores the current ActiveEditMode for the specified property
-        // </summary>
-        // <param name="property">Property to key off of</param>
-        // <param name="editMode">ActiveEditMode value to store</param>
-        public void StoreActiveEditMode(PropertyEntry property, PropertyContainerEditMode editMode) 
-        {
-            string path = ModelUtilities.GetCachedSubPropertyHierarchyPath(property);
-
-            // We only care about storing the ExtendedPinned state.  Everything
-            // else is transitory and shouldn't be persisted.
-            //
-            if (editMode == PropertyContainerEditMode.ExtendedPinned)
-            {
-                _expandedPropertyEditors[path] = null;
-            }
-            else
-            {
-                _expandedPropertyEditors.Remove(path);
-            }
-        }
-
-        // IStateContainer
-
-        public object RetrieveState() 
-        {
-            if (_expandedPropertyEditors.Count == 0)
-            {
-                return null;
-            }
-
-            bool firstTime = true;
-            StringBuilder sb = new StringBuilder();
-            foreach (string propertyPath in _expandedPropertyEditors) 
-            {
-                sb.Append(propertyPath);
-                if (!firstTime) 
-                {
-                    sb.Append(';');
-                }
-                firstTime = false;
-            }
-
-            return sb.ToString();
-        }
-
-        public void RestoreState(object state) 
-        {
-            string stateString = state as string;
-            if (stateString == null) 
-            {
-                return;
-            }
-
-            string[] paths = stateString.Split(';');
-            foreach (string path in paths) 
-            {
-                if (string.IsNullOrEmpty(path)) 
-                {
-                    continue;
-                }
-                _expandedPropertyEditors[path] = null;
-            }
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PropertyState.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PropertyState.cs
deleted file mode 100644 (file)
index 4079c55..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.State 
-{
-    using System;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-
-    // <summary>
-    // Simple state object that knows how to remember state for a single property.
-    // The only thing it currently remembers is whether the property's sub-properties
-    // are expanded or collapsed.
-    // </summary>
-    internal class PropertyState : PersistedState 
-    {
-
-        private const bool DefaultSubPropertiesExpanded = false;
-
-        private string _propertyName;
-        private bool _subPropertiesExpanded = DefaultSubPropertiesExpanded;
-
-        // <summary>
-        // Basic ctor
-        // </summary>
-        // <param name="propertyName">Property to wrap around</param>
-        [SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily")]
-        public PropertyState(string propertyName) 
-        {
-            Fx.Assert(!string.IsNullOrEmpty(propertyName), "Expected a full property name");
-            _propertyName = propertyName;
-        }
-
-        // <summary>
-        // We key these state objects by their property names
-        // </summary>
-        public override object Key 
-        {
-            get { return _propertyName; }
-        }
-
-        // <summary>
-        // Returns true if any of the contained values differ from the default
-        // </summary>
-        public override bool IsSignificant 
-        {
-            get { return _subPropertiesExpanded != DefaultSubPropertiesExpanded; }
-        }
-
-        // <summary>
-        // Gets or sets a flag indicating whether the sub-properties of the contained
-        // property have been expanded or collapsed.
-        // </summary>
-        public bool SubPropertiesExpanded 
-        {
-            get { return _subPropertiesExpanded; }
-            set { _subPropertiesExpanded = value; }
-        }
-
-        // <summary>
-        // Serializes this object into a simple string (AppDomains like strings).
-        //
-        // Format: PropertyName,SubPropertiesExpanded;NextPropertyName,SubPropertiesExpanded;...
-        // Where bools are recorded as 0 = false and 1 = true
-        // </summary>
-        // <returns>Serialized version of this state object (may be null)</returns>
-        protected override string SerializeCore() 
-        {
-            return string.Concat(
-                PersistedStateUtilities.Escape(_propertyName),
-                ',',
-                PersistedStateUtilities.BoolToDigit(_subPropertiesExpanded));
-        }
-
-        // <summary>
-        // Attempts to deserialize a string into a PropertyState object
-        // </summary>
-        // <param name="propertyStateString">String to deserialize</param>
-        // <returns>Instance of PropertyState if the serialized string was valid, null otherwise.</returns>
-        public static PropertyState Deserialize(string propertyStateString) 
-        {
-            string[] args = propertyStateString.Split(',');
-            if (args == null || args.Length != 2)
-            {
-                return null;
-            }
-
-            bool? subPropertiesExpanded = PersistedStateUtilities.DigitToBool(args[1]);
-            if (subPropertiesExpanded == null)
-            {
-                return null;
-            }
-
-            string propertyName = PersistedStateUtilities.Unescape(args[0]);
-            if (string.IsNullOrEmpty(propertyName))
-            {
-                return null;
-            }
-
-            PropertyState propertyState = new PropertyState(propertyName);
-            propertyState.SubPropertiesExpanded = (bool)subPropertiesExpanded;
-            return propertyState;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PropertyStateContainer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PropertyStateContainer.cs
deleted file mode 100644 (file)
index 82d5321..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Text;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.State;
-
-    // <summary>
-    // Simple wrapper around a dictionary of PropertyStates keyed by the property names.
-    // </summary>
-    internal class PropertyStateContainer : PersistedStateContainer 
-    {
-
-        private static PropertyStateContainer _instance;
-
-        // The ctor is private because we use this class as a singleton
-        private PropertyStateContainer() 
-        {
-        }
-
-        // <summary>
-        // Gets a static instance of this class
-        // </summary>
-        public static PropertyStateContainer Instance 
-        {
-            get {
-                if (_instance == null)
-                {
-                    _instance = new PropertyStateContainer();
-                }
-
-                return _instance;
-            }
-        }
-
-        // <summary>
-        // Gets the PropertyState for the specified category.  If one does not exist
-        // yet, it will be created automatically, guaranteeing a non-null return value.
-        // </summary>
-        // <param name="propertyName">Name of the property itself</param>
-        // <returns>A non-null instance of PropertyState</returns>
-        public PropertyState GetPropertyState(string propertyName) 
-        {
-            return (PropertyState)this.GetState(propertyName);
-        }
-
-        // <summary>
-        // Creates a default state object based on the specified key
-        // </summary>
-        // <param name="key">Key of the state object</param>
-        // <returns>Default state object</returns>
-        protected override PersistedState CreateDefaultState(object key) 
-        {
-            return new PropertyState(key as string);
-        }
-
-        // <summary>
-        // Deserializes the specified string value into a state object
-        // </summary>
-        // <param name="serializedValue">Serialized value of the state object</param>
-        // <returns>Deserialized instance of the state object</returns>
-        protected override PersistedState DeserializeState(string serializedValue) 
-        {
-            return PropertyState.Deserialize(serializedValue);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PropertyViewManagerStateContainer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/State/PropertyViewManagerStateContainer.cs
deleted file mode 100644 (file)
index f645f6a..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.State 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Text;
-    using System.Activities.Presentation.Internal.PropertyEditing.Views;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // StateContainer for current selection of IPropertyViewManager
-    // </summary>
-    internal class PropertyViewManagerStateContainer : IStateContainer 
-    {
-
-        public static readonly PropertyViewManagerStateContainer Instance = new PropertyViewManagerStateContainer();
-
-        public const string RootPropertyInspectorPersistenceId = "RootPropertyInspector";
-
-        private Dictionary<string, string> _persistenceIdToManagerTypeNameMap;
-        private PropertyViewManagerStateContainer() 
-        {
-        }
-
-        // <summary>
-        // Event fired when the internal state is scrapped and restored from
-        // some saved value
-        // </summary>
-        public event EventHandler ContentRestored;
-
-        // <summary>
-        // Gets the instance of IPropertyViewManager stored under the specified
-        // persistence ID.
-        // </summary>
-        // <param name="persistenceId">ID to look up</param>
-        // <returns>Instance of IPropertyViewManager stored under the specified
-        // persistence ID.  If not found, an instance of the default IPropertyViewManager
-        // is returned.</returns>
-        public IPropertyViewManager GetPropertyViewManager(string persistenceId) 
-        {
-            string propertyViewManagerTypeName;
-            if (_persistenceIdToManagerTypeNameMap == null ||
-                !_persistenceIdToManagerTypeNameMap.TryGetValue(persistenceId, out propertyViewManagerTypeName)) 
-            {
-
-                // If we don't have any state stored, default to the value of the 
-                // root PropertyInspector, unless that state is not stored either
-                // in which case default to category view.
-                //
-                if (persistenceId != RootPropertyInspectorPersistenceId)
-                {
-                    return GetPropertyViewManager(RootPropertyInspectorPersistenceId);
-                }
-                else
-                {
-                    return ByCategoryViewManager.Instance;
-                }
-            }
-
-            if (string.Equals(propertyViewManagerTypeName, typeof(ByCategoryViewManager).Name))
-            {
-                return ByCategoryViewManager.Instance;
-            }
-            else if (string.Equals(propertyViewManagerTypeName, typeof(AlphabeticalViewManager).Name))
-            {
-                return AlphabeticalViewManager.Instance;
-            }
-
-            Debug.Fail("Unknown IPropertyViewManager type: " + (propertyViewManagerTypeName ?? "null"));
-            return ByCategoryViewManager.Instance;
-        }
-
-        // <summary>
-        // Stores the specified IPropertyViewManager under the specified persistenceId.
-        // </summary>
-        // <param name="persistenceId">ID to store under</param>
-        // <param name="manager">IPropertyViewManager to store</param>
-        public void StorePropertyViewManager(string persistenceId, IPropertyViewManager manager) 
-        {
-            if (persistenceId == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("persistenceId");
-            }
-
-            if (manager == null && _persistenceIdToManagerTypeNameMap == null)
-            {
-                return;
-            }
-
-            if (manager == null) 
-            {
-                _persistenceIdToManagerTypeNameMap.Remove(persistenceId);
-            }
-            else 
-            {
-                if (_persistenceIdToManagerTypeNameMap == null)
-                {
-                    _persistenceIdToManagerTypeNameMap = new Dictionary<string, string>();
-                }
-
-                _persistenceIdToManagerTypeNameMap[persistenceId] = manager.GetType().Name;
-            }
-        }
-
-        // IStateContainer Members
-
-        // <summary>
-        // Retrieves all stored IPropertyViewManager types under all persistence IDs
-        // </summary>
-        // <returns>All stored IPropertyViewManager types under all persistence IDs</returns>
-        public object RetrieveState() 
-        {
-            if (_persistenceIdToManagerTypeNameMap == null || _persistenceIdToManagerTypeNameMap.Count == 0) 
-            {
-                return null;
-            }
-
-            StringBuilder sb = new StringBuilder();
-            foreach (KeyValuePair<string, string> pair in _persistenceIdToManagerTypeNameMap) 
-            {
-                if (sb.Length > 0)
-                {
-                    sb.Append(';');
-                }
-
-                sb.Append(PersistedStateUtilities.Escape(pair.Key));
-                sb.Append(';');
-                sb.Append(pair.Value);
-            }
-
-            return sb.ToString();
-        }
-
-        // <summary>
-        // Attempts to restore the persisted state
-        // </summary>
-        // <param name="state"></param>
-        public void RestoreState(object state) 
-        {
-            if (state == null) 
-            {
-                return;
-            }
-
-            string serializedState = state as string;
-            if (serializedState == null) 
-            {
-                Debug.Fail("Invalid PropertyViewManager state: " + state.ToString());
-                return;
-            }
-
-            string[] items = serializedState.Split(';');
-            if ((items.Length % 2) != 0) 
-            {
-                Debug.Fail("Invalid PropertyViewManager state: " + state.ToString());
-                return;
-            }
-
-            if (_persistenceIdToManagerTypeNameMap == null)
-            {
-                _persistenceIdToManagerTypeNameMap = new Dictionary<string, string>();
-            }
-
-            for (int i = 0; i < items.Length;)
-            {
-                _persistenceIdToManagerTypeNameMap[items[i++]] = items[i++];
-            }
-
-            if (ContentRestored != null)
-            {
-                ContentRestored(this, EventArgs.Empty);
-            }
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Views/AlphabeticalViewManager.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Views/AlphabeticalViewManager.cs
deleted file mode 100644 (file)
index 69a353a..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Views 
-{
-    using System;
-    using System.Collections.Generic;
-
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using System.Activities.Presentation.Internal.PropertyEditing.Selection;
-
-    // <summary>
-    // IPropertyViewManager we use to display an alphabetical list of properties
-    // </summary>
-    internal class AlphabeticalViewManager : IPropertyViewManager 
-    {
-
-        public static readonly AlphabeticalViewManager Instance = new AlphabeticalViewManager();
-        private AlphabeticalViewManager() 
-        {
-        }
-
-        // <summary>
-        // AlphabeticalViewManager doesn't show category headers
-        // </summary>
-        public bool ShowCategoryHeaders 
-        { get { return false; } }
-
-        // <summary>
-        // AlphabeticalViewManager always uses PropertyEntryNameComparer instance
-        // </summary>
-        private IComparer<PropertyEntry> PropertyComparer 
-        {
-            get {
-                return PropertyEntryNameComparer.Instance;
-            }
-        }
-
-        // IPropertyViewManager Members
-
-        // <summary>
-        // Add a property into the correct category within the specified CategoryList.
-        // </summary>
-        // <param name="propertySet">Specified property (passed in as a set for multi-select scenarios)</param>
-        // <param name="propertyName">Name of the current property (perf optimization)</param>
-        // <param name="categoryList">CategoryList instance to populate</param>
-        // <returns>Wrapped ModelPropertyEntry for the specified propertySet</returns>
-        public ModelPropertyEntry AddProperty(IEnumerable<ModelProperty> propertySet, string propertyName, CategoryList categoryList) 
-        {
-            string categoryName = System.Activities.Presentation.Internal.Properties.Resources.PropertyCategoryAllProperties;
-            ModelCategoryEntry category = categoryList.FindCategory(categoryName) as ModelCategoryEntry;
-
-            bool reuseEntries = ExtensibilityAccessor.IsEditorReusable(propertySet);
-            if (reuseEntries && category != null) 
-            {
-                ModelPropertyEntry foundProperty;
-                if ((foundProperty = (ModelPropertyEntry)category[propertyName]) != null) {
-                    if (foundProperty.PropertyType != null && foundProperty.PropertyType.Equals(System.Activities.Presentation.Internal.PropertyEditing.Model.ModelUtilities.GetPropertyType(propertySet)))
-                    {
-                        // Found a match for the property, so reuse it
-
-                        bool oldIsBrowsable = foundProperty.IsBrowsable;
-
-                        foundProperty.SetUnderlyingModelProperty(propertySet);
-
-                        // If the IsBrowsable or IsAdvanced value of the property changed,
-                        // refresh the property within the category, because how and whether
-                        // this property should be rendered may have changed.
-                        // Note that refreshing a selected property also nullifies its stickiness
-                        // (ie. it resets CategoryList.PropertySelectionMode)
-                        if (oldIsBrowsable != foundProperty.IsBrowsable) 
-                        {
-                            category.Refresh(foundProperty, category.BasicProperties, this.PropertyComparer);
-                        }
-
-                        return foundProperty;
-                    }
-                }
-            }
-
-            if (category == null) 
-            {
-                category = new ModelCategoryEntry(categoryName);
-                categoryList.InsertAlphabetically(category);
-            }
-
-            ModelPropertyEntry property = new ModelPropertyEntry(propertySet, null);
-            category.Add(property, category.BasicProperties, this.PropertyComparer);
-            return property;
-        }
-
-        // <summary>
-        // Scans the list of categories in the specified CategoryList and returns a set of
-        // CategoryEditor types that should be present in the list based on the properties
-        // in it.
-        // </summary>
-        // <param name="ownerType">Type of the currently displayed item</param>
-        // <param name="categoryList">CategoryList to examine</param>
-        // <returns>Set of expected CategoryEditor types</returns>
-        public Dictionary<Type, object> GetCategoryEditors(Type ownerType, CategoryList categoryList) 
-        {
-            // No category editors in alpha-view
-            return new Dictionary<Type, object>();
-        }
-
-        // <summary>
-        // Returns a SelectionPath pointing to the first visible property
-        // in the list or null if no such property exists.
-        // </summary>
-        // <param name="categoryList">CategoryList for reference</param>
-        // <returns>SelectionPath pointing to the first visible property
-        // in the list or null if no such property exists.</returns>
-        public SelectionPath GetDefaultSelectionPath(CategoryList categoryList) 
-        {
-            if (categoryList.Count > 0) 
-            {
-                CategoryEntry firstCategory = categoryList[0];
-
-                if (firstCategory != null) 
-                {
-                    foreach (ModelPropertyEntry firstProperty in firstCategory.Properties) 
-                    {
-                        if (firstProperty != null && firstProperty.IsBrowsable && firstProperty.MatchesFilter)
-                        {
-                            return PropertySelectionPathInterpreter.Instance.ConstructSelectionPath(firstProperty);
-                        }
-                    }
-                }
-            }
-
-            return null;
-        }
-
-        // Blend's CollectionEditor compatibility APIs
-
-        //
-        // Since Blend's API uses PropertyEntries instead of ModelProperties, we need
-        // to provide methods that consume those instead.  Ideally, with the two code
-        // bases merged, we wouldn't need these at all.
-        //
-
-        // <summary>
-        // Gets the category name of the specified property
-        // </summary>
-        // <param name="property">Property to examine</param>
-        // <returns>Category name the property belongs to.</returns>
-        public string GetCategoryName(PropertyEntry property) 
-        {
-            return System.Activities.Presentation.Internal.Properties.Resources.PropertyCategoryAllProperties;
-        }
-
-        // <summary>
-        // Adds the specified property into the specified category.
-        // </summary>
-        // <param name="property">Property to add</param>
-        // <param name="category">Category to populate</param>
-        public void AddProperty(PropertyEntry property, ModelCategoryEntry category) 
-        {
-            category.Add(property, category.BasicProperties, this.PropertyComparer);
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Views/ByCategoryViewManager.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Views/ByCategoryViewManager.cs
deleted file mode 100644 (file)
index 2d72532..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Views 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Windows;
-
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using System.Activities.Presentation.Internal.PropertyEditing.Selection;
-
-    // <summary>
-    // IPropertyViewManager we use to display properties grouped into categories
-    // </summary>
-    internal class ByCategoryViewManager : IPropertyViewManager 
-    {
-
-        public static readonly ByCategoryViewManager Instance = new ByCategoryViewManager();
-        private ByCategoryViewManager() 
-        {
-        }
-
-        // <summary>
-        // ByCategoryViewManager shows category headers
-        // </summary>
-        public bool ShowCategoryHeaders 
-        { get { return true; } }
-
-        // <summary>
-        // ByCategoryViewManager always uses PropertyEntryPropertyOrderComparer instance
-        // </summary>
-        private IComparer<PropertyEntry> PropertyComparer 
-        {
-            get {
-                return PropertyEntryPropertyOrderComparer.Instance;
-            }
-        }
-
-        // IPropertyViewManager Members
-
-        // <summary>
-        // Add a property into the correct category within the specified CategoryList.
-        // </summary>
-        // <param name="propertySet">Specified property (passed in as a set for multi-select scenarios)</param>
-        // <param name="propertyName">Name of the current property (perf optimization)</param>
-        // <param name="categoryList">CategoryList instance to populate</param>
-        // <returns>Wrapped ModelPropertyEntry for the specified propertySet</returns>
-        public ModelPropertyEntry AddProperty(IEnumerable<ModelProperty> propertySet, string propertyName, CategoryList categoryList) 
-        {
-
-            string categoryName = GetCategoryName(propertySet);
-            ModelCategoryEntry category = categoryList.FindCategory(categoryName) as ModelCategoryEntry;
-
-            bool reuseEntries = ExtensibilityAccessor.IsEditorReusable(propertySet);
-            if (reuseEntries && category != null) 
-            {
-                ModelPropertyEntry foundProperty;
-                if ((foundProperty = (ModelPropertyEntry)category[propertyName]) != null) {
-                    if (foundProperty.PropertyType != null && foundProperty.PropertyType.Equals(System.Activities.Presentation.Internal.PropertyEditing.Model.ModelUtilities.GetPropertyType(propertySet)))
-                    {
-                        // Found a match for the property, so reuse it
-
-                        bool oldIsBrowsable = foundProperty.IsBrowsable;
-                        bool oldIsAdvanced = foundProperty.IsAdvanced;
-
-                        foundProperty.SetUnderlyingModelProperty(propertySet);
-
-                        // If the IsBrowsable or IsAdvanced value of the property changed,
-                        // refresh the property within the category, because how and whether
-                        // this property should be rendered may have changed.
-                        // Note that refreshing a selected property also nullifies its stickiness
-                        // (ie. it resets CategoryList.PropertySelectionMode)
-                        if (oldIsAdvanced != foundProperty.IsAdvanced ||
-                            oldIsBrowsable != foundProperty.IsBrowsable) 
-                        {
-                            category.Refresh(foundProperty, category.GetBucket(foundProperty), this.PropertyComparer);
-                        }
-
-                        return foundProperty;
-                    }
-                }
-            }
-
-            if (category == null) 
-            {
-                category = new ModelCategoryEntry(categoryName);
-                categoryList.InsertAlphabetically(category);
-            }
-
-            ModelPropertyEntry property = new ModelPropertyEntry(propertySet, null);
-            category.Add(property, category.GetBucket(property), this.PropertyComparer);
-            return property;
-        }
-
-        private static string GetCategoryName(IEnumerable<ModelProperty> propertySet) 
-        {
-            if (propertySet == null)
-            {
-                return null;
-            }
-
-            // Note: ExtensibilityAccessor uses CategoryAttribute to look up the category name.
-            // CategoryAttribute logic tries to look up the localized names for standard category names
-            // by default already.  CategoryNameMap.GetLocalizedCategoryName() takes care of the few,
-            // special WPF categories that are not found by the existing mechanism.
-            foreach (ModelProperty property in propertySet)
-            {
-                return CategoryNameMap.GetLocalizedCategoryName(ExtensibilityAccessor.GetCategoryName(property));
-            }
-            return null;
-        }
-
-        // <summary>
-        // Scans the list of categories in the specified CategoryList and returns a set of
-        // CategoryEditor types that should be present in the list based on the properties
-        // in it.
-        // </summary>
-        // <param name="ownerType">Type of the currently displayed item</param>
-        // <param name="categoryList">CategoryList to examine</param>
-        // <returns>Set of expected CategoryEditor types</returns>
-        public Dictionary<Type, object> GetCategoryEditors(Type ownerType, CategoryList categoryList) 
-        {
-            Dictionary<Type, object> editorSet = new Dictionary<Type, object>();
-            AddAttachedPropertiesCategoryEditors(editorSet, categoryList);
-            AddTypeCategoryEditors(editorSet, ownerType);
-            return editorSet;
-        }
-
-        // Scans through the properties of the specified categories, looking for CategoryEditors
-        // associated with any attached properties.  If found, they will be added to the categoryEditorSet
-        private static void AddAttachedPropertiesCategoryEditors(Dictionary<Type, object> categoryEditorSet, IEnumerable<CategoryBase> categories) 
-        {
-            if (categories != null) 
-            {
-                foreach (ModelCategoryEntry category in categories) 
-                {
-                    foreach (ModelPropertyEntry property in category.Properties) 
-                    {
-
-                        // Only attached-properties return any CategoryEditorTypes
-                        IEnumerable<Type> editorTypes = property.CategoryEditorTypes;
-                        if (editorTypes == null)
-                        {
-                            continue;
-                        }
-
-                        foreach (Type editorType in editorTypes)
-                        {
-                            categoryEditorSet[editorType] = null;
-                        }
-                    }
-                }
-            }
-        }
-
-        // Adds any CategoryEditors associated with the specified type
-        private static void AddTypeCategoryEditors(Dictionary<Type, object> categoryEditorSet, Type type) 
-        {
-            if (type != null) 
-            {
-                IEnumerable<Type> editorTypes = ExtensibilityAccessor.GetCategoryEditorTypes(type);
-                if (editorTypes != null) 
-                {
-                    foreach (Type editorType in editorTypes)
-                    {
-                        categoryEditorSet[editorType] = null;
-                    }
-                }
-            }
-        }
-
-        // <summary>
-        // Returns a SelectionPath pointing to the first visible category in the list
-        // or null if no such category exists.
-        // </summary>
-        // <param name="categoryList">CategoryList for reference</param>
-        // <returns>SelectionPath pointing to the first visible category in the list
-        // or null if no such category exists.</returns>
-        public SelectionPath GetDefaultSelectionPath(CategoryList categoryList) 
-        {
-            foreach (CategoryEntry categoryEntry in categoryList) 
-            {
-                CategoryContainer container = categoryList.FindCategoryEntryVisual(categoryEntry);
-                if (container != null && container.Visibility == Visibility.Visible) 
-                {
-                    return CategoryContainerSelectionPathInterpreter.Instance.ConstructSelectionPath(categoryEntry.CategoryName, false);
-                }
-            }
-
-            return null;
-        }
-
-        // Blend's CollectionEditor compatibility APIs
-
-        //
-        // Since Blend's API uses PropertyEntries instead of ModelProperties, we need
-        // to provide methods that consume those instead.  Ideally, with the two code
-        // bases merged, we wouldn't need these at all.
-        //
-
-        // <summary>
-        // Gets the category name of the specified property
-        // </summary>
-        // <param name="property">Property to examine</param>
-        // <returns>Category name the property belongs to.</returns>
-        public string GetCategoryName(PropertyEntry property) 
-        {
-            return property.CategoryName;
-        }
-
-        // <summary>
-        // Adds the specified property into the specified category.
-        // </summary>
-        // <param name="property">Property to add</param>
-        // <param name="category">Category to populate</param>
-        public void AddProperty(PropertyEntry property, ModelCategoryEntry category) 
-        {
-            category.Add(property as ModelPropertyEntry, category.GetBucket(property), this.PropertyComparer);
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Views/IPropertyViewManager.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Views/IPropertyViewManager.cs
deleted file mode 100644 (file)
index 5c22585..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing.Views 
-{
-    using System;
-    using System.Collections.Generic;
-
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using System.Activities.Presentation.Internal.PropertyEditing.Selection;
-
-    // <summary>
-    // Interface we use to wrap logic that determines how a set of properties
-    // will be categorized into categories.
-    // </summary>
-    internal interface IPropertyViewManager 
-    {
-
-        // <summary>
-        // Gets a flag indicating whether the PropertyViewManager implementation
-        // supports category headers.
-        // </summary>
-        bool ShowCategoryHeaders 
-        { get; }
-
-        // <summary>
-        // Add a property into the correct category within the specified CategoryList.
-        // </summary>
-        // <param name="propertySet">Specified property (passed in as a set for multi-select scenarios)</param>
-        // <param name="propertyName">Name of the current property (perf optimization)</param>
-        // <param name="categoryList">CategoryList instance to populate</param>
-        // <returns>Wrapped ModelPropertyEntry for the specified propertySet</returns>
-        ModelPropertyEntry AddProperty(IEnumerable<ModelProperty> propertySet, string propertyName, CategoryList categoryList);
-
-        // <summary>
-        // Scans the list of categories in the specified CategoryList and returns a set of
-        // CategoryEditor types that should be present in the list based on the properties
-        // in it.
-        // </summary>
-        // <param name="ownerType">Type of the currently displayed item</param>
-        // <param name="categoryList">CategoryList to examine</param>
-        // <returns>Set of expected CategoryEditor types</returns>
-        Dictionary<Type, object> GetCategoryEditors(Type ownerType, CategoryList categoryList);
-
-        // <summary>
-        // Figures out what property / category editor / category / ... we should select
-        // if the currently selected item does not define a default property.
-        // </summary>
-        // <param name="categoryList">CategoryList for reference</param>
-        // <returns>Thing to select (can be null) if no default property has been
-        // specified and we are trying to select something by default.</returns>
-        SelectionPath GetDefaultSelectionPath(CategoryList categoryList);
-
-        // Blend's CollectionEditor compatibility APIs
-
-        //
-        // Since Blend's API uses PropertyEntries instead of ModelProperties, we need
-        // to provide methods that consume those instead.  Ideally, with the two code
-        // bases merged, we wouldn't need these at all.
-        //
-
-        // <summary>
-        // Gets the category name of the specified property
-        // </summary>
-        // <param name="property">Property to examine</param>
-        // <returns>Category name the property belongs to.</returns>
-        string GetCategoryName(PropertyEntry property);
-
-        // <summary>
-        // Adds the specified property into the specified category.
-        // </summary>
-        // <param name="property">Property to add</param>
-        // <param name="category">Category to populate</param>
-        void AddProperty(PropertyEntry property, ModelCategoryEntry category);
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/VisualTreeUtils.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/VisualTreeUtils.cs
deleted file mode 100644 (file)
index a9d683b..0000000
+++ /dev/null
@@ -1,359 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal.PropertyEditing 
-{
-    using System;
-    using System.Collections;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows;
-    using System.Windows.Media;
-    using System.Windows.Media.Media3D;
-    using System.Collections.Generic;
-
-    // <summary>
-    // Collection of simple utilities that deal with the VisualTree
-    // </summary>
-    internal static class VisualTreeUtils 
-    {
-
-        // The depth of the visual tree we explore in looking for templated children
-        // (see GetTemplateChild<>())
-        private const int MaxSearchDepth = 5;
-
-        // The maxium wpf visual tree depth
-        // this value should be kept in [....] with WPF's limit
-        private const int MaxAllowedTreeDepth = 250;
-
-        // <summary>
-        // Examines the visual children of the given element and returns the one
-        // with the specified name and type, if one exists
-        // </summary>
-        // <typeparam name="T">Type of child to look for</typeparam>
-        // <param name="container">Container to look in</param>
-        // <param name="name">Name to look for</param>
-        // <returns>The specified named child if found, null otherwise</returns>
-        public static T GetNamedChild<T>(DependencyObject container, string name)
-            where T : FrameworkElement 
-        {
-            return GetNamedChild<T>(container, name, 0);
-        }
-
-        // <summary>
-        // Examines the visual children of the given element and returns the one
-        // with the specified name and type, if one exists
-        // </summary>
-        // <typeparam name="T">Type of child to look for</typeparam>
-        // <param name="container">Container to look in</param>
-        // <param name="name">Name to look for</param>
-        // <param name="searchDepth">Visual depth to search in.  Default is 0.</param>
-        // <returns>The specified named child if found, null otherwise</returns>
-        public static T GetNamedChild<T>(DependencyObject container, string name, int searchDepth)
-            where T : FrameworkElement 
-        {
-            if (container == null || string.IsNullOrEmpty(name) || searchDepth < 0)
-            {
-                return null;
-            }
-
-            if (container is T && string.Equals( name, ((T)container).Name))
-            {
-                return (T)container;
-            }
-
-            int childCount = VisualTreeHelper.GetChildrenCount(container);
-            if (childCount == 0)
-            {
-                return null;
-            }
-
-            // Look for the first child that matches
-            for (int index = 0; index < childCount; index++) 
-            {
-                FrameworkElement child = VisualTreeHelper.GetChild(container, index) as FrameworkElement;
-                if (child == null)
-                {
-                    continue;
-                }
-
-                // Search recursively until we reach the requested search depth
-                T namedChild =
-                    (child.FindName(name) as T) ??
-                    (searchDepth > 0 ? GetNamedChild<T>(child, name, searchDepth - 1) : null);
-
-                if (namedChild != null)
-                {
-                    return namedChild;
-                }
-            }
-
-            return null;
-        }
-
-        // <summary>
-        // Helper method that goes down the first-child visual tree and looks for the visual element of the
-        // specified type.  Useful for when you have one control that is templated to look like another
-        // and you need to get to the template instance itself.
-        // </summary>
-        // <typeparam name="T">Type of the visual template to look for</typeparam>
-        // <param name="element">Element to start from</param>
-        // <returns>The first matching instance in the visual tree of first children, null otherwise</returns>
-        public static T GetTemplateChild<T>(DependencyObject element) where T : DependencyObject 
-        {
-            int availableSearchDepth = MaxSearchDepth;
-            while (availableSearchDepth > 0 && element != null) 
-            {
-                int childrenCount = VisualTreeHelper.GetChildrenCount(element);
-                if (childrenCount < 1)
-                {
-                    return null;
-                }
-
-                // Just worry about the first child, since we are looking for a template control,
-                // not a complicated visual tree
-                //
-                element = VisualTreeHelper.GetChild(element, 0);
-                T childAsT = element as T;
-                if (childAsT != null)
-                {
-                    return childAsT;
-                }
-
-                availableSearchDepth--;
-            }
-
-            return null;
-        }
-
-        // <summary>
-        // Goes up the visual tree, looking for an ancestor of the specified Type
-        // </summary>
-        // <typeparam name="T">Type to look for</typeparam>
-        // <param name="child">Starting point</param>
-        // <returns>Visual ancestor, if any, of the specified starting point and Type</returns>
-        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        public static T FindVisualAncestor<T>(DependencyObject child) where T : DependencyObject 
-        {
-            if (child == null)
-            {
-                return null;
-            }
-
-            do 
-            {
-                child = VisualTreeHelper.GetParent(child);
-            }
-            while (child != null && !typeof(T).IsAssignableFrom(child.GetType()));
-
-            return child as T;
-        }
-
-        // <summary>
-        // Recursively looks through all the children and looks for and returns the first
-        // element with IsFocusable set to true.
-        // </summary>
-        // <param name="reference">Starting point for the search</param>
-        // <typeparam name="T">Type of child to look for</typeparam>
-        // <returns>The first focusable child of the specified Type, null otherwise.</returns>
-        public static T FindFocusableElement<T>(T reference) where T : UIElement 
-        {
-            if (reference == null || (reference.Focusable && reference.Visibility == Visibility.Visible))
-            {
-                return reference;
-            }
-
-            int childCount = VisualTreeHelper.GetChildrenCount(reference);
-            for (int i = 0; i < childCount; i++) 
-            {
-                T child = VisualTreeHelper.GetChild(reference, i) as T;
-                if (child == null)
-                {
-                    continue;
-                }
-
-                if (child.Visibility != Visibility.Visible)
-                {
-                    continue;
-                }
-
-                if (child.Focusable)
-                {
-                    return child;
-                }
-
-                child = FindFocusableElement<T>(child);
-                if (child != null)
-                {
-                    return child;
-                }
-            }
-
-            return null;
-        }
-
-        // <summary>
-        // Walks up the parent tree and returns the first
-        // element with IsFocusable set to true.
-        // </summary>
-        // <param name="reference">Starting point for the search</param>
-        // <typeparam name="T">Type of parent to look for</typeparam>
-        // <returns>The first focusable parent of the specified Type, null otherwise.</returns>
-        public static T FindFocusableParent<T>(UIElement reference) where T : UIElement
-        {
-            if (null != reference)
-            {
-                UIElement parent = VisualTreeHelper.GetParent(reference) as UIElement;
-                while (null != parent)
-                {
-                    if (parent.Visibility == Visibility.Visible && parent is T && parent.Focusable)
-                    {
-                        return parent as T;
-                    }
-
-                    parent = VisualTreeHelper.GetParent(parent) as UIElement;
-                }
-            }
-            return null;
-        }
-
-        // <summary>
-        // Helper method identical to VisualTreeHelper.GetParent() but that also returns the index of the given child
-        // with respect to any of its visual siblings
-        // </summary>
-        // <param name="child">Child to examine</param>
-        // <param name="childrenCount">Total number of children that the specified child's parent has</param>
-        // <param name="childIndex">Index of the specified child in the parent's visual children array</param>
-        // <returns>Visual parent of the specified child, if any</returns>
-        public static DependencyObject GetIndexedVisualParent(DependencyObject child, out int childrenCount, out int childIndex) 
-        {
-            childrenCount = 0;
-            DependencyObject parent = VisualTreeHelper.GetParent(child);
-
-            if (parent != null) 
-            {
-                childrenCount = VisualTreeHelper.GetChildrenCount(parent);
-                for (childIndex = 0; childIndex < childrenCount; childIndex++) 
-                {
-                    if (child.Equals(VisualTreeHelper.GetChild(parent, childIndex)))
-                    {
-                        return parent;
-                    }
-                }
-            }
-
-            childIndex = -1;
-            return null;
-        }
-
-        // <summary>
-        // Helper method that goes up the visual tree checking the visibility flag of the specified element
-        // and all its parents.  If an invisible parent is found, the method return false.  Otherwise it returns
-        // true.
-        // </summary>
-        // <param name="element">Element to check</param>
-        // <returns>True if the specified element and all of its visual parents are visible,
-        // false otherwise.</returns>
-        public static bool IsVisible(UIElement element) 
-        {
-            UIElement parent = element;
-            while (parent != null) 
-            {
-                if (parent.Visibility != Visibility.Visible)
-                {
-                    return false;
-                }
-
-                parent = VisualTreeHelper.GetParent(parent) as UIElement;
-            }
-
-            return true;
-        }
-
-        /// <summary>
-        /// Helper method that trasverse the visual tree checking for immediate parent of specified type that has children
-        /// that is too deep for WPF visual tree
-        /// </summary>
-        /// <typeparam name="T">The type of parent to look for</typeparam>
-        /// <param name="root">The root element to start checking</param>
-        /// <returns></returns>
-        public static ICollection<T> PrunVisualTree<T>(Visual root) where T : DependencyObject
-        {
-            HashSet<T> deepElements = new HashSet<T>();
-            Stack<VisualState> stack = new Stack<VisualState>();
-            VisualState currentObject = new VisualState(root, GetTreeDepth(root));
-            stack.Push(currentObject);
-            int totalChildCount = 0;
-            Visual child;
-            T violatingParent;
-            //doing a depth first walk of the visual tree.
-            while (stack.Count > 0)
-            {
-                currentObject = stack.Pop();
-
-                // currentObject.Depth + 1 is the children's depth
-                // if it's too deep, we would try to find the parent and stop traversing 
-                // this node further
-                if (currentObject.Depth + 1 >= MaxAllowedTreeDepth)
-                {
-                    violatingParent = currentObject.Visual as T;
-                    if (violatingParent != null)
-                    {
-                        deepElements.Add(violatingParent);
-                    }
-                    else
-                    {
-                        violatingParent = FindVisualAncestor<T>(currentObject.Visual);
-                        if (violatingParent != null)
-                        {
-                            deepElements.Add(violatingParent);
-                        }
-                    }
-                }
-                else // continue the depth first traversal
-                {
-                    totalChildCount = VisualTreeHelper.GetChildrenCount(currentObject.Visual);
-                    for (int i = 0; i < totalChildCount; i++)
-                    {
-                        child = VisualTreeHelper.GetChild(currentObject.Visual, i) as Visual;
-                        if (child != null)
-                        {
-                            stack.Push(new VisualState(child, currentObject.Depth + 1));
-                        }
-                    }
-                }
-            }
-           return deepElements;
-        }
-
-        //find the depth of an DependencyObject
-        public static uint GetTreeDepth(DependencyObject element)
-        {
-            uint depth = 0;
-            while (element != null)
-            {
-                depth++;
-                if (element is Visual || element is Visual3D)
-                {
-                    element = VisualTreeHelper.GetParent(element);
-                }
-                else
-                {
-                    element = LogicalTreeHelper.GetParent(element);
-                }
-            }
-            return depth;
-        }
-
-        private class VisualState
-        {
-            internal Visual Visual { get; set; }
-            internal uint Depth { get; set; }
-
-            internal VisualState(Visual visual, uint depth)
-            {
-                this.Visual = visual;
-                this.Depth = depth;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/manifestimages.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/manifestimages.cs
deleted file mode 100644 (file)
index e4ea169..0000000
+++ /dev/null
@@ -1,321 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Internal 
-{
-    using System;
-    using System.IO;
-    using System.Reflection;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Markup;
-    using System.Windows.Media.Imaging;
-    using System.Diagnostics;
-    using System.Runtime;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // Helper class that knows how to load up icons that live in assemblies and follow
-    // our extensibility icon naming convention.
-    // </summary>
-    internal static class ManifestImages 
-    {
-
-        private static readonly string[] SupportedExtensions = new string[] {
-                ".png", ".xaml", ".bmp", ".gif", ".jpg", ".jpeg"
-            };
-
-        // <summary>
-        // ----s open the assembly to which the specified Type belongs and tries
-        // to find and return an image that follows the naming conventions of:
-        //
-        //     My.Namespace.MyControl.Icon.png
-        //
-        // and matches the desired size most closely, if multiple such images are found.
-        // </summary>
-        // <param name="type">Type to look up</param>
-        // <param name="desiredSize">Desired size (may not be met)</param>
-        // <returns>Null (if no image was found), Image instance (for non-Xaml images),
-        // or object instance (for Xaml-instantiated structures)</returns>
-        // <exception cref="ArgumentNullException">if type is null</exception>
-        public static object GetImage(Type type, Size desiredSize) 
-        {
-            if (type == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("type");
-            }
-
-            Assembly assembly = type.Assembly;
-            string[] resourceNames = assembly.GetManifestResourceNames();
-
-            if (resourceNames == null || resourceNames.Length == 0)
-            {
-                return null;
-            }
-
-            string fullTypeName = type.FullName;
-            string typeName = type.Name;
-
-            // Do a full namespace match first
-            ImageInfo bestMatch = FindBestMatch(type, assembly, resourceNames, desiredSize, delegate(string extensionlessResourceName) 
-            {
-                return fullTypeName.Equals(extensionlessResourceName);
-            });
-
-            // Do a partial name match second, if full name didn't give us anything
-            bestMatch = bestMatch ?? FindBestMatch(type, assembly, resourceNames, desiredSize, delegate(string extensionlessResourceName) 
-            {
-                return extensionlessResourceName != null && extensionlessResourceName.EndsWith(typeName, StringComparison.Ordinal);
-            });
-
-            if (bestMatch != null)
-            {
-                return bestMatch.Image;
-            }
-
-            return null;
-        }
-
-        private static ImageInfo FindBestMatch(
-            Type type,
-            Assembly assembly,
-            string[] resourceNames,
-            Size desiredSize,
-            MatchNameDelegate matchName) 
-        {
-
-            Fx.Assert(type != null, "FindBestMatch - type parameter should not be null");
-            Fx.Assert(resourceNames != null && resourceNames.Length > 0, "resourceNames parameter should not be null");
-            Fx.Assert(matchName != null, "matchName parameter should not be null");
-
-            ImageInfo bestMatch = null;
-
-            for (int i = 0; i < resourceNames.Length; i++) 
-            {
-
-                string extension = Path.GetExtension(resourceNames[i]);
-
-                if (!IsExtensionSupported(extension))
-                {
-                    continue;
-                }
-
-                if (!matchName(StripIconExtension(resourceNames[i])))
-                {
-                    continue;
-                }
-
-                ImageInfo info = ProcessResource(assembly, resourceNames[i]);
-                if (info == null)
-                {
-                    continue;
-                }
-
-                // Try to match the found resource to the requested size
-                float sizeMatch = info.Match(desiredSize);
-
-                // Check for exact size match
-                if (sizeMatch < float.Epsilon)
-                {
-                    return info;
-                }
-
-                // Keep the best image found so far
-                if (bestMatch == null ||
-                    bestMatch.LastMatch > sizeMatch)
-                {
-                    bestMatch = info;
-                }
-            }
-
-            return bestMatch;
-        }
-
-        // Tries to load up an image
-        private static ImageInfo ProcessResource(Assembly assembly, string resourceName) 
-        {
-            Stream stream = assembly.GetManifestResourceStream(resourceName);
-            if (stream == null)
-            {
-                return null;
-            }
-
-            if (IsXamlContent(resourceName))
-            {
-                return new XamlImageInfo(stream);
-            }
-            else
-            {
-                return new BitmapImageInfo(stream);
-            }
-        }
-
-        // Checks to see whether the given extension is supported
-        private static bool IsExtensionSupported(string extension) 
-        {
-            for (int i = 0; i < SupportedExtensions.Length; i++)
-            {
-                if (SupportedExtensions[i].Equals(extension, StringComparison.OrdinalIgnoreCase))
-                {
-                    return true;
-                }
-            }
-
-            return false;
-        }
-
-        // Returns true if the passed in resource name ends in ".xaml"
-        private static bool IsXamlContent(string resourceName) 
-        {
-            return ".xaml".Equals(Path.GetExtension(resourceName), StringComparison.OrdinalIgnoreCase);
-        }
-
-        // Strips ".Icon.ext" from a resource name
-        private static string StripIconExtension(string resourceName) 
-        {
-            if (resourceName == null)
-            {
-                return null;
-            }
-
-            resourceName = Path.GetFileNameWithoutExtension(resourceName);
-            int dotIconIndex = resourceName.LastIndexOf(".Icon", StringComparison.OrdinalIgnoreCase);
-            if (dotIconIndex > 0)
-            {
-                return resourceName.Substring(0, dotIconIndex);
-            }
-
-            return null;
-        }
-
-        private delegate bool MatchNameDelegate(string extensionlessResourceName);
-
-        // Helper class that has information about an image
-        private abstract class ImageInfo 
-        {
-
-            private float _lastMatch = 1;
-
-            protected ImageInfo() 
-            {
-            }
-
-            public float LastMatch 
-            { get { return _lastMatch; } }
-            public abstract object Image 
-            { get; }
-            protected abstract Size Size 
-            { get; }
-            protected abstract bool HasFixedSize 
-            { get; }
-
-            // gets value range from 0 to 1: 0 == perfect match, 1 == complete opposite
-            public float Match(Size desiredSize) 
-            {
-
-                if (!this.HasFixedSize) 
-                {
-                    _lastMatch = 0;
-                }
-                else 
-                {
-                    Size actualSize = this.Size;
-
-                    float desiredAspectRatio = Math.Max(float.Epsilon, GetAspectRatio(desiredSize));
-                    float actualAspectRatio = Math.Max(float.Epsilon, GetAspectRatio(actualSize));
-
-                    float desiredArea = Math.Max(float.Epsilon, GetArea(desiredSize));
-                    float actualArea = Math.Max(float.Epsilon, GetArea(actualSize));
-
-                    // these values range from 0 to 1, 1 being perfect match, 0 being not so perfect match
-                    float ratioDiff = desiredAspectRatio < actualAspectRatio ? desiredAspectRatio / actualAspectRatio : actualAspectRatio / desiredAspectRatio;
-                    float areaDiff = desiredArea < actualArea ? desiredArea / actualArea : actualArea / desiredArea;
-
-                    float diff = ratioDiff * areaDiff;
-
-                    _lastMatch = Math.Min(1f, Math.Max(0f, 1f - diff));
-                }
-
-                return _lastMatch;
-            }
-
-            private static float GetAspectRatio(Size size) 
-            {
-                if (size.Height < float.Epsilon)
-                {
-                    return 0;
-                }
-
-                return (float)(size.Width / size.Height);
-            }
-
-            private static float GetArea(Size size) 
-            {
-                return (float)(size.Width * size.Height);
-            }
-        }
-
-        // Helper class that knows how to deal with Xaml
-        private class XamlImageInfo : ImageInfo 
-        {
-
-            private object _image;
-
-            public XamlImageInfo(Stream stream) 
-            {
-                _image = XamlReader.Load(stream);
-            }
-
-            public override object Image 
-            {
-                get { return _image; }
-            }
-
-            protected override Size Size 
-            {
-                get { return Size.Empty; }
-            }
-
-            protected override bool HasFixedSize 
-            {
-                get { return false; }
-            }
-        }
-
-        // Helper class that knows how to deal with bitmaps
-        private class BitmapImageInfo : ImageInfo 
-        {
-
-            private Image _image;
-            private Size _size;
-
-            public BitmapImageInfo(Stream stream) 
-            {
-                BitmapImage bmp = new BitmapImage();
-                bmp.BeginInit();
-                bmp.StreamSource = stream;
-                bmp.EndInit();
-
-                _image = new Image();
-                _image.Source = bmp;
-
-                _size = new Size(bmp.Width, bmp.Height);
-            }
-
-            public override object Image 
-            {
-                get { return _image; }
-            }
-
-            protected override Size Size 
-            {
-                get { return _size; }
-            }
-
-            protected override bool HasFixedSize 
-            {
-                get { return true; }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/AttributeCallback.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/AttributeCallback.cs
deleted file mode 100644 (file)
index 23ee634..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Metadata 
-{
-
-    using System;
-    using System.Collections;
-
-    // <summary>
-    // Called when attributes are needed for a type.
-    // </summary>
-    // <param name="builder">A builder that can be used to
-    // add attributes.  AttributeCallbackBuilders can only build attributes
-    // for the type that is requesting metadata.</param>
-    public delegate void AttributeCallback(AttributeCallbackBuilder builder);
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/AttributeCallbackBuilder.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/AttributeCallbackBuilder.cs
deleted file mode 100644 (file)
index ffe7d0a..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Metadata 
-{
-    using System.Runtime;
-
-    using System.Activities.Presentation.Internal.Metadata;
-    using System.Activities.Presentation.Internal.Properties;
-
-    using System;
-    using System.ComponentModel;
-    using System.Globalization;
-    using System.Reflection;
-    using System.Windows;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // An instance of this class is passed to callback delegates to lazily
-    // populate the attributes for a type.
-    // </summary>
-    [Fx.Tag.XamlVisible(false)]
-    public sealed class AttributeCallbackBuilder 
-    {
-        private MutableAttributeTable _table;
-        private Type _callbackType;
-
-        internal AttributeCallbackBuilder(MutableAttributeTable table, Type callbackType) 
-        {
-            _table = table;
-            _callbackType = callbackType;
-        }
-
-        // <summary>
-        // The type this callback is being invoked for.
-        // </summary>
-        public Type CallbackType 
-        {
-            get { return _callbackType; }
-        }
-
-        // <summary>
-        // Adds the contents of the provided attributes to this builder.
-        // Conflicts are resolved with a last-in-wins strategy.
-        // </summary>
-        // <param name="attributes">
-        // The new attributes to add.
-        // </param>
-        // <exception cref="ArgumentNullException">if type or attributes is null</exception>
-        public void AddCustomAttributes(params Attribute[] attributes) {
-            if (attributes == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("attributes");
-            }
-            _table.AddCustomAttributes(_callbackType, attributes);
-        }
-
-        // <summary>
-        // Adds the contents of the provided attributes to this builder.
-        // Conflicts are resolved with a last-in-wins strategy.
-        // </summary>
-        // <param name="descriptor">An event or property descriptor to add attributes to.</param>
-        // <param name="attributes">
-        // The new attributes to add.
-        // </param>
-        // <exception cref="ArgumentNullException">if descriptor or attributes is null</exception>
-        public void AddCustomAttributes(MemberDescriptor descriptor, params Attribute[] attributes) {
-            if (descriptor == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("descriptor");
-            }
-            if (attributes == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("attributes");
-            }
-            _table.AddCustomAttributes(_callbackType, descriptor, attributes);
-        }
-
-        // <summary>
-        // Adds the contents of the provided attributes to this builder.
-        // Conflicts are resolved with a last-in-wins strategy.
-        // </summary>
-        // <param name="member">An event or property info to add attributes to.</param>
-        // <param name="attributes">
-        // The new attributes to add.
-        // </param>
-        // <exception cref="ArgumentNullException">if member or attributes is null</exception>
-        public void AddCustomAttributes(MemberInfo member, params Attribute[] attributes) {
-            if (member == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("member");
-            }
-            if (attributes == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("attributes");
-            }
-            _table.AddCustomAttributes(_callbackType, member, attributes);
-        }
-
-        // <summary>
-        // Adds attributes to the member with the given name.  The member can be a property
-        // or an event.  The member is evaluated on demand when the user queries
-        // attributes on a given property or event.
-        // </summary>
-        // <param name="memberName">
-        // The member to add attributes for.  Only property and event members are supported;
-        // all others will be ignored.
-        // </param>
-        // <param name="attributes">
-        // The new attributes to add.
-        // </param>
-        public void AddCustomAttributes(string memberName, params Attribute[] attributes) {
-            if (memberName == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("memberName");
-            }
-            if (attributes == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("attributes");
-            }
-            _table.AddCustomAttributes(_callbackType, memberName, attributes);
-        }
-
-        // <summary>
-        // Adds the contents of the provided attributes to this builder.
-        // Conflicts are resolved with a last-in-wins strategy.
-        // </summary>
-        // <param name="dp">A dependency property to add attributes to.</param>
-        // <param name="attributes">
-        // The new attributes to add.
-        // </param>
-        // <exception cref="ArgumentNullException">if dp or attributes is null</exception>
-        public void AddCustomAttributes(DependencyProperty dp, params Attribute[] attributes) {
-            if (dp == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("dp");
-            }
-            if (attributes == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("attributes");
-            }
-            _table.AddCustomAttributes(_callbackType, dp, attributes);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/AttributeTable.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/AttributeTable.cs
deleted file mode 100644 (file)
index a63de41..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Metadata 
-{
-
-    using System.Activities.Presentation.Internal.Metadata;
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Reflection;
-    using System.Windows;
-    using System.Runtime;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // Attribute tables are essentially read-only dictionaries, but the keys
-    // and values are computed separately.  It is very efficient to ask an
-    // attribute table if it contains attributes for a particular type.
-    // The actual set of attributes is demand created.
-    // </summary>
-    [Fx.Tag.XamlVisible(false)]
-    public sealed class AttributeTable 
-    {
-
-        private MutableAttributeTable _attributes;
-
-        //
-        // Creates a new attribute table given dictionary information
-        // from the attribute table builder.
-        //
-        internal AttributeTable(MutableAttributeTable attributes) 
-        {
-            Fx.Assert(attributes != null, "attributes parameter should not be null");
-            _attributes = attributes;
-        }
-
-        // <summary>
-        // Returns an enumeration of all types that have attribute overrides
-        // of some kind (on a property, on the type itself, etc).  This can be
-        // used to determine what types will be refreshed when this attribute
-        // table is added to the metadata store.
-        // </summary>
-        // <returns></returns>
-        public IEnumerable<Type> AttributedTypes 
-        {
-            get { return _attributes.AttributedTypes; }
-        }
-
-        //
-        // Returns our internal mutable table.  This is used
-        // by AttributeTableBuilder's AddTable method.
-        //
-        internal MutableAttributeTable MutableTable 
-        {
-            get { return _attributes; }
-        }
-
-        // <summary>
-        // Returns true if this table contains any metadata for the given type.
-        // The metadata may be class-level metadata or metadata associated with
-        // a DepenendencyProperty or MemberDescriptor.  The AttributeStore uses
-        // this method to identify loaded types that need a Refresh event raised
-        // when a new attribute table is added, and to quickly decide which
-        // tables should be further queried during attribute queries.
-        // </summary>
-        // <param name="type">The type to check.</param>
-        // <returns>true if the table contains attributes for the given type.</returns>
-        // <exception cref="ArgumentNullException">if type is null</exception>
-        public bool ContainsAttributes(Type type) 
-        {
-            if (type == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("type");
-            }
-            return _attributes.ContainsAttributes(type);
-        }
-
-        // <summary>
-        // Returns an enumeration of all attributes provided for the
-        // given argument.  This will never return a null enumeration.
-        // </summary>
-        // <param name="type">The type to get class-level attributes for.</param>
-        // <returns>An enumeration of attributes.</returns>
-        // <exception cref="ArgumentNullException">if type is null</exception>
-        public IEnumerable GetCustomAttributes(Type type) 
-        {
-            if (type == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("type");
-            }
-            return _attributes.GetCustomAttributes(type);
-        }
-
-        // <summary>
-        // Returns an enumeration of all attributes provided for the
-        // given argument.  This will never return a null enumeration.
-        // </summary>
-        // <param name="ownerType">The type that declares this descriptor.</param>
-        // <param name="descriptor">A member descriptor to get custom attributes for.</param>
-        // <returns>An enumeration of attributes.</returns>
-        // <exception cref="ArgumentNullException">if descriptor is null</exception>
-        public IEnumerable GetCustomAttributes(Type ownerType, MemberDescriptor descriptor) 
-        {
-            if (ownerType == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("ownerType");
-            }
-            if (descriptor == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("descriptor");
-            }
-            return _attributes.GetCustomAttributes(ownerType, descriptor);
-        }
-
-        // <summary>
-        // Returns an enumeration of all attributes provided for the
-        // given argument.  This will never return a null enumeration.
-        // </summary>
-        // <param name="ownerType">The owner type of the dependency property.</param>
-        // <param name="dp">A dependency property to get custom attributes for.</param>
-        // <returns>An enumeration of attributes.</returns>
-        // <exception cref="ArgumentNullException">if ownerType or dp is null</exception>
-        public IEnumerable GetCustomAttributes(Type ownerType, DependencyProperty dp) 
-        {
-            if (ownerType == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("ownerType");
-            }
-            if (dp == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("dp");
-            }
-            return _attributes.GetCustomAttributes(ownerType, dp);
-        }
-
-        // <summary>
-        // Returns an enumeration of all attributes provided for the
-        // given argument.  This will never return a null enumeration.
-        // </summary>
-        // <param name="ownerType">The owner type of the dependency property.</param>
-        // <param name="member">The member to provide attributes for.</param>
-        // <returns>An enumeration of attributes.</returns>
-        // <exception cref="ArgumentNullException">if ownerType or member is null</exception>
-        public IEnumerable GetCustomAttributes(Type ownerType, MemberInfo member) 
-        {
-            if (ownerType == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("ownerType");
-            }
-            if (member == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("member");
-            }
-            return _attributes.GetCustomAttributes(ownerType, member);
-        }
-
-        // <summary>
-        // Returns an enumeration of all attributes provided for the
-        // given argument.  This will never return a null enumeration.
-        // </summary>
-        // <param name="ownerType">The owner type of the dependency property.</param>
-        // <param name="memberName">The name of the member to provide attributes for.</param>
-        // <returns>An enumeration of attributes.</returns>
-        // <exception cref="ArgumentNullException">if ownerType or member is null</exception>
-        public IEnumerable GetCustomAttributes(Type ownerType, string memberName) 
-        {
-            if (ownerType == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("ownerType");
-            }
-            if (memberName == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("memberName");
-            }
-            return _attributes.GetCustomAttributes(ownerType, memberName);
-        }
-
-        //
-        // Called by the MetadataStore to walk through all the metadata and
-        // ensure that it can be found on the appropriate types and members.
-        // Any asserts that come from here are bugs in the type description
-        // provider.
-        //
-        internal void DebugValidateProvider()
-        {
-#if DEBUG
-            _attributes.DebugValidateProvider();
-#else
-#endif
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/AttributeTableBuilder.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/AttributeTableBuilder.cs
deleted file mode 100644 (file)
index 7955e3e..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Metadata 
-{
-
-    using System.Activities.Presentation.Internal.Metadata;
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Reflection;
-    using System.Windows;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // An attribute table is a read only blob of data.  How
-    // do you create one?  We will have a class called an
-    // Attribute Builder that can be used to create an attribute
-    // table.  Attribute builders have methods you can call to
-    // add metadata.  When you�re finished, you can produce an
-    // attribute table from the builder.  Builder methods also
-    // support callback delegates so the entire process can be
-    // deferred until needed.
-    // </summary>
-    public class AttributeTableBuilder 
-    {
-
-        private MutableAttributeTable _table = new MutableAttributeTable();
-        private bool _cloneOnUse;
-
-        //
-        // Returns an attribute table we can make changes to
-        //
-        private MutableAttributeTable MutableTable 
-        {
-            get {
-                if (_cloneOnUse) 
-                {
-                    MutableAttributeTable clone = new MutableAttributeTable();
-                    clone.AddTable(_table);
-                    _table = clone;
-                    _cloneOnUse = false;
-                }
-
-                return _table;
-            }
-        }
-
-        // <summary>
-        // Adds a callback that will be invoked when metadata for the
-        // given type is needed.  The callback can add metadata to
-        // to the attribute table on demand, which is much more efficient
-        // than adding metadata up front.
-        // </summary>
-        // <param name="type"></param>
-        // <param name="callback"></param>
-        public void AddCallback(Type type, AttributeCallback callback) 
-        {
-            if (type == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("type");
-            }
-            if (callback == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("callback");
-            }
-            MutableTable.AddCallback(type, callback);
-        }
-
-        // <summary>
-        // Adds the contents of the provided attributes to this builder.
-        // Conflicts are resolved with a last-in-wins strategy.  When
-        // building a large attribute table it is best to use AddCallback
-        // to defer the work of creating attributes until they are needed.
-        // </summary>
-        // <param name="type">The type to add class-level attributes to.</param>
-        // <param name="attributes">
-        // The new attributes to add.
-        // </param>
-        // <exception cref="ArgumentNullException">if type or attributes is null</exception>
-        public void AddCustomAttributes(Type type, params Attribute[] attributes) {
-            if (type == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("type");
-            }
-            if (attributes == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("attributes");
-            }
-            MutableTable.AddCustomAttributes(type, attributes);
-        }
-
-        // <summary>
-        // Adds the contents of the provided attributes to this builder.
-        // Conflicts are resolved with a last-in-wins strategy.  When
-        // building a large attribute table it is best to use AddCallback
-        // to defer the work of creating attributes until they are needed.
-        // </summary>
-        // <param name="ownerType">
-        // The type the member lives on.
-        // </param>
-        // <param name="descriptor">An event or property descriptor to add attributes to.</param>
-        // <param name="attributes">
-        // The new attributes to add.
-        // </param>
-        // <exception cref="ArgumentNullException">if descriptor or attributes is null</exception>
-        public void AddCustomAttributes(Type ownerType, MemberDescriptor descriptor, params Attribute[] attributes) {
-            if (ownerType == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("ownerType");
-            }
-            if (descriptor == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("descriptor");
-            }
-            if (attributes == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("attributes");
-            }
-            MutableTable.AddCustomAttributes(ownerType, descriptor, attributes);
-        }
-
-        // <summary>
-        // Adds the contents of the provided attributes to this builder.
-        // Conflicts are resolved with a last-in-wins strategy.  When
-        // building a large attribute table it is best to use AddCallback
-        // to defer the work of creating attributes until they are needed.
-        // </summary>
-        // <param name="ownerType">
-        // The type the member lives on.
-        // </param>
-        // <param name="member">An event or property info to add attributes to.</param>
-        // <param name="attributes">
-        // The new attributes to add.
-        // </param>
-        // <exception cref="ArgumentNullException">if member or attributes is null</exception>
-        public void AddCustomAttributes(Type ownerType, MemberInfo member, params Attribute[] attributes) {
-            if (ownerType == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("ownerType");
-            }
-            if (member == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("member");
-            }
-            if (attributes == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("attributes");
-            }
-            MutableTable.AddCustomAttributes(ownerType, member, attributes);
-        }
-
-        // <summary>
-        // Adds attributes to the member with the given name.  The member can be a property
-        // or an event.  The member is evaluated on demand when the user queries
-        // attributes on a given property or event.
-        // </summary>
-        // <param name="ownerType">
-        // The type the member lives on.
-        // </param>
-        // <param name="memberName">
-        // The member to add attributes for.  Only property and event members are supported;
-        // all others will be ignored.
-        // </param>
-        // <param name="attributes">
-        // The new attributes to add.
-        // </param>
-        public void AddCustomAttributes(Type ownerType, string memberName, params Attribute[] attributes) {
-            if (ownerType == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("ownerType");
-            }
-            if (memberName == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("memberName");
-            }
-            MutableTable.AddCustomAttributes(ownerType, memberName, attributes);
-        }
-
-        // <summary>
-        // Adds the contents of the provided attributes to this builder.
-        // Conflicts are resolved with a last-in-wins strategy.  When
-        // building a large attribute table it is best to use AddCallback
-        // to defer the work of creating attributes until they are needed.
-        // </summary>
-        // <param name="ownerType">
-        // The type that owns the dependency property.
-        // </param>
-        // <param name="dp">A dependency property to add attributes to.</param>
-        // <param name="attributes">
-        // The new attributes to add.
-        // </param>
-        // <exception cref="ArgumentNullException">if dp, ownerType or attributes is null</exception>
-        public void AddCustomAttributes(Type ownerType, DependencyProperty dp, params Attribute[] attributes) {
-            if (ownerType == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("ownerType");
-            }
-            if (dp == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("dp");
-            }
-            if (attributes == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("attributes");
-            }
-            MutableTable.AddCustomAttributes(ownerType, dp, attributes);
-        }
-
-        // <summary>
-        // Adds the contents of the provided attribute table to
-        // this builder.  Conflicts are resolved with a last-in-wins
-        // strategy.
-        // </summary>
-        // <param name="table">An existing attribute table.</param>
-        // <exception cref="ArgumentNullException">if table is null</exception>
-        public void AddTable(AttributeTable table) 
-        {
-            if (table == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("table");
-            }
-            MutableTable.AddTable(table.MutableTable);
-        }
-
-        // <summary>
-        // Creates an attribute table that contains all of the attribute
-        // definitions provided through AddAttribute calls.  The table is
-        // a snapshot of the current state of the attribute builder; any
-        // subsequent AddAttribute calls are not included in the table.
-        //
-        // If callback methods were used to declare attributes, those methods
-        // will not be evaluated during CreateTable.  Instead, the table will
-        // contain those callbacks and will evaluate them as needed.
-        // </summary>
-        // <returns>
-        // An attribute table that can be passed to the metadata store.
-        // </returns>
-        public AttributeTable CreateTable() 
-        {
-            _cloneOnUse = true;
-            return new AttributeTable(_table);
-        }
-
-        // <summary>
-        // This method can be used to verify that the attribute table
-        // that is being built contains valid attribute information.
-        // Some overrides of AddCustomAttributes cannot validate that
-        // values passed to their prameters represent valid members on
-        // classes.  Therefore, incorrect information passed to
-        // AddCustomAttributes may go undetected.  ValidateTable will
-        // run through the contents of the AttributeTableBuilder and
-        // verify that all custom attribute information matches up with
-        // physical members.  Note:  calling this method can be very
-        // costly so you should only do it when validation is absolutely
-        // needed.
-        // </summary>
-        // <exception cref="AttributeTableValidationException">if the state of the table is invalid.</exception>
-        public void ValidateTable() 
-        {
-            MutableTable.ValidateTable();
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/AttributeTableValidationException.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/AttributeTableValidationException.cs
deleted file mode 100644 (file)
index 173c916..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Metadata 
-{
-
-    using System;
-    using System.Collections.Generic;
-    using System.Runtime.Serialization;
-    using System.Security.Permissions;
-    using System.Activities.Presentation;
-
-    // <summary>
-    // This exception may be thrown from the ValidateTable method on
-    // AttributeTable.  It will be thrown if the metadata provided in
-    // the table does not match properties, methods and events on real
-    // types.
-    // </summary>
-    [Serializable]
-    public class AttributeTableValidationException : Exception 
-    {
-        private string[] _validationErrors;
-
-        // <summary>
-        // Creates a new AttributeTableValidationException.
-        // </summary>
-        public AttributeTableValidationException() : base() 
-        {
-        }
-
-        // <summary>
-        // Creates a new AttributeTableValidationException.
-        // </summary>
-        // <param name="message"></param>
-        public AttributeTableValidationException(string message)
-            : base(message) 
-        {
-        }
-
-        // <summary>
-        // Creates a new AttributeTableValidationException.
-        // </summary>
-        // <param name="message">The message provided to the user.</param>
-        // <param name="inner">An optional inner exception.</param>
-        public AttributeTableValidationException(string message, Exception inner)
-            : base(message, inner) 
-        {
-        }
-
-        // <summary>
-        // Creates a new AttributeTableValidationException.
-        // </summary>
-        // <param name="message">The message provided to the user.</param>
-        // <param name="validationErrors">Zero or more errors that occurred during validation.</param>
-        public AttributeTableValidationException(string message, IEnumerable<string> validationErrors)
-            : base(message) 
-        {
-            _validationErrors = CreateArray(validationErrors);
-        }
-
-        // <summary>
-        // Creates a new AttributeTableValidationException.
-        // </summary>
-        // <param name="message">The message provided to the user.</param>
-        // <param name="inner">An optional inner exception.</param>
-        // <param name="validationErrors">Zero or more errors that occurred during validation.</param>
-        public AttributeTableValidationException(string message, Exception inner, IEnumerable<string> validationErrors)
-            : base(message, inner) 
-        {
-            _validationErrors = CreateArray(validationErrors);
-        }
-
-        // <summary>
-        // Used during serialization to deserialize an exception.
-        // </summary>
-        // <param name="info">The serialization store.</param>
-        // <param name="context">The serialization context.</param>
-        protected AttributeTableValidationException(SerializationInfo info, StreamingContext context)
-            : base(info, context) 
-        {
-            if (info == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("info");
-            }
-            _validationErrors = (string[])info.GetValue("ValidationErrors", typeof(string[]));
-        }
-
-        // <summary>
-        // Returns an enumeration of validation errors.
-        // </summary>
-        public IEnumerable<string> ValidationErrors 
-        {
-            get { return _validationErrors; }
-        }
-
-        //
-        // Helper method to create an array from an enumeration.
-        //
-        private static string[] CreateArray(IEnumerable<string> validationErrors) {
-
-            string[] array;
-
-            if (validationErrors != null) 
-            {
-                int cnt = 0;
-                IEnumerator<string> e = validationErrors.GetEnumerator();
-                while (e.MoveNext()) 
-                {
-                    cnt++;
-                }
-
-                e.Reset();
-
-                array = new string[cnt];
-
-                cnt = 0;
-
-                while (e.MoveNext()) 
-                {
-                    array[cnt++] = e.Current;
-                }
-            }
-            else 
-            {
-                array = new string[0];
-            }
-
-            return array;
-        }
-
-        // <summary>
-        // Override of Exception's GetObjectData that is used to perform serialization.
-        // </summary>
-        // <param name="info">The serialization store.</param>
-        // <param name="context">The serialization context.</param>
-        public override void GetObjectData(SerializationInfo info, StreamingContext context) 
-        {
-            if (info == null) 
-            {
-                throw FxTrace.Exception.ArgumentNull("info");
-            }
-            base.GetObjectData(info, context);
-            info.AddValue("ValidationErrors", _validationErrors);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/IRegisterMetadata.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/IRegisterMetadata.cs
deleted file mode 100644 (file)
index 10c961f..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Metadata 
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-
-    // <summary>
-    // Specifies a class that wishes to add extra attributes
-    // to the metadata store.
-    // </summary>
-    public interface IRegisterMetadata 
-    {
-        // <summary>
-        // Classes implementing register should use the
-        // MetadataStore.AddAttributeTable to add additional
-        // metadata to the store.
-        //
-        // Register will be called upon the
-        // initialization of the designer.
-        // </summary>
-        void Register();
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/MetadataStore.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Metadata/MetadataStore.cs
deleted file mode 100644 (file)
index 036e3cf..0000000
+++ /dev/null
@@ -1,2006 +0,0 @@
-using System.Diagnostics.CodeAnalysis;
-
-namespace System.Activities.Presentation.Metadata
-{
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Reflection;
-    using System.Activities.Presentation.Internal.Metadata;
-    using System.Runtime;
-    using System.Activities.Presentation;
-
-    /// <summary>
-    /// The MetadataStore is a container of custom attribute metadata.
-    /// Custom attributes may be defined in an attribute table and added
-    /// to the metadata store.  Once added, these attributes will appear
-    /// in calls made to TypeDescriptor.
-    /// </summary>
-    public static class MetadataStore
-    {
-
-        private static object _syncLock = new object();
-        private static MetadataStoreProvider _objectProvider;
-        private static Dictionary<Type, Type> _interfaces;
-        private static Hashtable _typeAttributeCache;
-
-        [SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")]
-        static MetadataStore()
-        {
-            TypeDescriptor.Refreshed += TypeDescriptor_Refreshed;
-        }
-
-        static void TypeDescriptor_Refreshed(RefreshEventArgs e)
-        {
-            _typeAttributeCache = null;
-        }
-
-        /// <summary>
-        /// Adds the given table to the current AppDomain\92s attribute store.  
-        /// Once added, calls to TypeDescriptor will use attributes defined 
-        /// in the newly added table.  Multiple tables may be added to the 
-        /// attribute store.  In the case of conflicts, attributes in the 
-        /// most recently added table win.
-        /// </summary>
-        /// <param name="table">The table to add</param>
-        /// <exception cref="ArgumentNullException">if table is null</exception>
-        public static void AddAttributeTable(AttributeTable table)
-        {
-            AddAttributeTableCore(table, false);
-        }
-
-        internal static void AddSystemAttributeTable(AttributeTable table)
-        {
-            AddAttributeTableCore(table, true);
-        }
-
-        private static void AddAttributeTableCore(AttributeTable table, bool isSystemAttributeTable = false)
-        {
-            if (table == null) throw FxTrace.Exception.ArgumentNull("table");
-
-            lock (_syncLock)
-            {
-                if (_objectProvider == null)
-                {
-                    _objectProvider = new MetadataStoreProvider(table);
-                    TypeDescriptor.AddProvider(_objectProvider, typeof(object));
-                }
-                else
-                {
-                    _objectProvider.AddTable(table, isSystemAttributeTable);
-                }
-
-                foreach (Type t in table.AttributedTypes)
-                {
-
-                    // If there are any interface types in the given
-                    // table, we must add providers specifically for those
-                    // types because interfaces do not derive from object and
-                    // are therefore missed by our global hook.
-
-                    if (t.IsInterface)
-                    {
-                        if (_interfaces == null)
-                        {
-                            _interfaces = new Dictionary<Type, Type>();
-                        }
-                        if (!_interfaces.ContainsKey(t))
-                        {
-                            TypeDescriptor.AddProvider(_objectProvider, t);
-                            _interfaces.Add(t, t);
-                        }
-                    }
-                }
-            }
-
-            // Now invalidate the types.
-            foreach (Type t in table.AttributedTypes)
-            {
-                TypeDescriptor.Refresh(t);
-            }
-
-#if DEBUG
-            table.DebugValidateProvider();
-#endif
-        }
-
-        //
-        // This type description provider is used for all objects and
-        // interfaces.
-        //
-        private class MetadataStoreProvider : TypeDescriptionProvider
-        {
-
-            private Dictionary<Type, Type> _metadataTypeCache;
-            private Dictionary<Type, AttributeCollection> _attributeCache;
-            private Dictionary<DescriptorKey, MemberDescriptor> _descriptorCache;
-            private AttributeTable[] _tables;
-            private object _syncLock = new object();
-
-            internal MetadataStoreProvider(AttributeTable table)
-                : base(TypeDescriptor.GetProvider(typeof(object)))
-            {
-                _tables = new AttributeTable[] { table };
-            }
-
-            //
-            // Called by the metadata store to add a new table to our
-            // provider.  Guarded by a lock on the metadata store.
-            //
-            internal void AddTable(AttributeTable table, bool isSystemAttributeTable = false)
-            {
-
-                // We don't expect a huge number of tables,
-                // so creating a new array here is fine.  Also,
-                // this has the added benefit of allowing code
-                // that eumerates tables to be thread-safe 
-                // without taking any locks.  Caller is responsible
-                // for ensuring AddTable is synchronized.
-
-                AttributeTable[] newTables;
-                newTables = new AttributeTable[_tables.Length + 1];
-
-                if (isSystemAttributeTable)
-                {
-                    _tables.CopyTo(newTables, 0);
-                    newTables[newTables.Length - 1] = table;
-                }
-                else
-                {
-                    _tables.CopyTo(newTables, 1);
-                    newTables[0] = table;
-                }
-
-                _tables = newTables;
-
-                if (_attributeCache != null) _attributeCache.Clear();
-
-                // Clear all metadata types that will change as
-                // a result of adding this new table
-
-                if (_metadataTypeCache != null)
-                {
-                    List<Type> toRemove = null;
-                    foreach (Type t in table.AttributedTypes)
-                    {
-                        foreach (Type cached in _metadataTypeCache.Keys)
-                        {
-                            Type realCachedType = cached.UnderlyingSystemType;
-                            if (t.IsAssignableFrom(realCachedType))
-                            {
-                                if (toRemove == null) toRemove = new List<Type>();
-                                toRemove.Add(realCachedType);
-                            }
-
-                            // if a type definition is changed, clear all types defined by this type definition.
-                            // eg. if Cat<> is changed, clear Cat<int>, Cat<object> etc.
-                            if (t.IsGenericTypeDefinition
-                                && realCachedType.IsGenericType
-                                && t == realCachedType.GetGenericTypeDefinition())
-                            {
-                                if (toRemove == null) toRemove = new List<Type>();
-                                toRemove.Add(realCachedType);
-                            }
-                        }
-                    }
-
-                    if (toRemove != null)
-                    {
-                        foreach (Type t in toRemove)
-                        {
-                            _metadataTypeCache.Remove(t);
-                        }
-                    }
-                }
-            }
-
-            //
-            // Private helper that creates an attribute collection given an array of attributes.
-            // This does the appropriate pairing down of attributes with matching TypeIds so
-            // the collection contains no redundant attributes.  Attributes should be ordered
-            // from most derived to least derived, so the first attribute reported wins.
-            //
-            private static AttributeCollection CreateAttributeCollection(Attribute[] attrArray)
-            {
-                Dictionary<object, Attribute> dict = new Dictionary<object, Attribute>(attrArray.Length);
-
-                // Attrs array is ordered by priority, first one in 
-                // wins.
-
-                int finalCount = attrArray.Length;
-
-                for (int idx = 0; idx < attrArray.Length; idx++)
-                {
-                    Attribute a = attrArray[idx];
-                    if (dict.ContainsKey(a.TypeId))
-                    {
-                        attrArray[idx] = null;
-                        finalCount--;
-                    }
-                    else
-                    {
-                        dict.Add(a.TypeId, a);
-                    }
-                }
-
-                Attribute[] finalArray;
-
-                if (finalCount != attrArray.Length)
-                {
-                    finalArray = new Attribute[finalCount];
-                    int finalIdx = 0;
-                    for (int idx = 0; idx < attrArray.Length; idx++)
-                    {
-                        if (attrArray[idx] != null)
-                        {
-                            finalArray[finalIdx++] = attrArray[idx];
-                        }
-                    }
-                }
-                else
-                {
-                    finalArray = attrArray;
-                }
-
-                return new AttributeCollection(finalArray);
-            }
-
-            //
-            // Returns a cached attribute collection for the given
-            // object type and member.  Member can be null to get
-            // attributes for the class.
-            //
-            private AttributeCollection GetAttributes(Type objectType)
-            {
-                Fx.Assert(objectType != null, "objectType parameter should not be null");
-                AttributeCollection attributes;
-
-                // Dictionary does not support thread-safe reads.  We need to lock on 
-                // all access.
-
-                lock (_syncLock)
-                {
-                    if (_attributeCache == null) _attributeCache = new Dictionary<Type, AttributeCollection>();
-                    if (!_attributeCache.TryGetValue(objectType, out attributes))
-                    {
-                        attributes = CreateAttributeCollection(GetRawAttributes(objectType, null, null, false));
-                        _attributeCache[objectType] = attributes;
-                    }
-                }
-
-                return attributes;
-            }
-
-            //
-            // Raw API to return attributes.  This is used by GetAttributes to 
-            // populate the AttributeCollection (which is cached), and by
-            // the Attributes property on property and event descriptors (where
-            // caching is handled by the Member Descriptor). Attributes
-            // are returned from this ordered so the highest priority attributes
-            // are first (first in wins).
-            //
-
-            private static Attribute[] GetRawAttributes(Type objectType, string member, MemberDescriptor parentDescriptor, bool isEvent)
-            {
-                Fx.Assert(objectType != null, "objectType parameter should not be null");
-                Type reflectType = TypeDescriptor.GetReflectionType(objectType);
-
-                // There is a bug in CLR reflection that does not respect the "inherit"
-                // flag for event or property infos.  Our custom metadata type does respect
-                // this flag and correctly does the right thing.  If the object type we
-                // are passed is not a metadata type, just use the default behavior of the
-                // parent member descriptor.  It will be right, and since we're not a metadata
-                // type that means we have no overrides anyway.
-                //
-                // The reason we have to call our type with inherit, instead of just using
-                // one code path is we need to support the interleaving of CLR and 
-                // metadata table attributes up the inheritance hierarchy.  MetadataType 
-                // does that for us.
-
-                if (parentDescriptor != null && !(reflectType is MetadataType))
-                {
-                    AttributeCollection attrs = parentDescriptor.Attributes;
-                    Attribute[] attrArray = new Attribute[attrs.Count];
-
-                    // CLR property descriptor reverses attribute order.  Fix it.
-                    for (int idx = 0; idx < attrArray.Length; idx++)
-                    {
-                        attrArray[idx] = attrs[attrArray.Length - idx - 1];
-                    }
-
-                    return attrArray;
-                }
-
-                MemberInfo reflectMember;
-                Type reflectMemberType = null;
-
-                Attribute[] attributes;
-
-                if (member == null)
-                {
-                    reflectMember = reflectType;
-                }
-                else if (isEvent)
-                {
-                    EventInfo info = null;
-
-                    MemberInfo[] infos = reflectType.GetMember(member, MemberTypes.Event, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public);
-                    if (infos.Length > 0)
-                    {
-                        info = infos[0] as EventInfo;
-                    }
-
-                    reflectMember = info;
-                    if (info != null) reflectMemberType = TypeDescriptor.GetReflectionType(info.EventHandlerType);
-                }
-                else
-                {
-                    PropertyInfo info = null;
-
-                    MemberInfo[] infos = reflectType.GetMember(member, MemberTypes.Property, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public);
-                    if (infos.Length > 0)
-                    {
-                        info = infos[0] as PropertyInfo;
-                    }
-
-                    reflectMember = info;
-                    if (info != null) reflectMemberType = TypeDescriptor.GetReflectionType(info.PropertyType);
-                }
-
-                if (reflectMember == null)
-                {
-                    Debug.Fail("Member " + member + " is not a member of type " + objectType.Name);
-                    attributes = new Attribute[0];
-                }
-                else
-                {
-                    // Cannot simply cast to Attribute[]
-                    Object[] attrs = reflectMember.GetCustomAttributes(typeof(Attribute), true);
-                    List<Object> attrList = new List<Object>(attrs);
-
-                    Hashtable cache = _typeAttributeCache;
-                    if (cache == null)
-                    {
-                        cache = new Hashtable();
-                        _typeAttributeCache = cache;
-                    }
-
-                    // Get the base type attributes if we have them
-                    if (reflectMemberType != null)
-                    {
-                        reflectType = reflectMemberType;
-
-                        attrs = (object[])cache[reflectType];
-                        if (attrs == null)
-                        {
-                            attrs = reflectType.GetCustomAttributes(typeof(Attribute), true);
-                            lock (cache.SyncRoot)
-                            {
-                                cache[reflectType] = attrs;
-                            }
-                        }
-
-                        attrList.AddRange(attrs);
-                    }
-
-                    // Get interface attributes too.
-
-                    foreach (Type iface in reflectType.GetInterfaces())
-                    {
-                        attrs = (object[])cache[iface];
-                        if (attrs == null)
-                        {
-                            attrs = iface.GetCustomAttributes(typeof(Attribute), false);
-                            lock (cache.SyncRoot)
-                            {
-                                cache[iface] = attrs;
-                            }
-                        }
-
-                        attrList.AddRange(attrs);
-                    }
-
-                    // Now go through the attributes and expand those that are 
-                    // AttributeProviderAttributes
-                    for (int idx = 0; idx < attrList.Count; idx++)
-                    {
-                        AttributeProviderAttribute a = attrList[idx] as AttributeProviderAttribute;
-                        if (a != null)
-                        {
-                            reflectType = Type.GetType(a.TypeName);
-                            if (reflectType != null)
-                            {
-                                reflectType = TypeDescriptor.GetReflectionType(reflectType);
-                                reflectMember = reflectType;
-
-                                if (a.PropertyName != null && a.PropertyName.Length > 0)
-                                {
-                                    MemberInfo[] infos = reflectType.GetMember(a.PropertyName);
-                                    if (infos != null && infos.Length > 0)
-                                    {
-                                        reflectMember = infos[0];
-                                    }
-                                }
-
-                                attrList.AddRange(reflectMember.GetCustomAttributes(typeof(Attribute), true));
-                            }
-                        }
-                    }
-
-                    attributes = new Attribute[attrList.Count];
-
-                    for (int idx = 0; idx < attrList.Count; idx++)
-                    {
-                        attributes[idx] = (Attribute)attrList[idx];
-                    }
-                }
-
-                return attributes;
-            }
-
-            //
-            // Access to our descriptor cache
-            //
-            private MemberDescriptor GetCachedDescriptor(Type objectType, MemberDescriptor descriptor)
-            {
-                MemberDescriptor cached;
-                DescriptorKey key = new DescriptorKey(objectType, descriptor);
-
-                lock (_syncLock)
-                {
-                    if (_descriptorCache == null || !_descriptorCache.TryGetValue(key, out cached))
-                    {
-                        cached = null;
-                    }
-                }
-
-                return cached;
-            }
-
-            //
-            // Access to our descriptor cache
-            //
-            private void CacheDescriptor(Type objectType, MemberDescriptor descriptor, MemberDescriptor cache)
-            {
-
-                lock (_syncLock)
-                {
-                    if (_descriptorCache == null)
-                    {
-                        _descriptorCache = new Dictionary<DescriptorKey, MemberDescriptor>();
-                    }
-                    DescriptorKey key = new DescriptorKey(objectType, descriptor);
-
-                    // Caller may ---- and this cache slot may already be allocated.
-                    // That's OK; we'll just replace it.
-                    _descriptorCache[key] = cache;
-                }
-            }
-
-            //
-            // Takes a collection of events and merges them with our own descriptors.
-            //
-            private EventDescriptorCollection MergeEvents(Type objectType, EventDescriptorCollection incoming)
-            {
-                EventDescriptor[] array = new EventDescriptor[incoming.Count];
-                for (int idx = 0; idx < array.Length; idx++)
-                {
-                    EventDescriptor theirs = incoming[idx];
-                    EventDescriptor ours = (EventDescriptor)GetCachedDescriptor(objectType, theirs);
-                    if (ours == null)
-                    {
-                        ours = new MetadataStoreEventDescriptor(objectType, theirs);
-                        CacheDescriptor(objectType, theirs, ours);
-                    }
-                    array[idx] = ours;
-                }
-                return new EventDescriptorCollection(array, true);
-            }
-
-            //
-            // Takes a collection of properties and merges them with our own descriptors.
-            //
-            private PropertyDescriptorCollection MergeProperties(Type objectType, PropertyDescriptorCollection incoming)
-            {
-                PropertyDescriptor[] array = new PropertyDescriptor[incoming.Count];
-                for (int idx = 0; idx < array.Length; idx++)
-                {
-                    PropertyDescriptor theirs = incoming[idx];
-                    PropertyDescriptor ours = (PropertyDescriptor)GetCachedDescriptor(objectType, theirs);
-                    if (ours == null)
-                    {
-                        ours = new MetadataStorePropertyDescriptor(objectType, theirs);
-                        CacheDescriptor(objectType, theirs, ours);
-                    }
-                    array[idx] = ours;
-                }
-                return new PropertyDescriptorCollection(array, true);
-            }
-
-            //
-            // Looks at objectType and returns a wrapped type if needed.  The
-            // parameter may be null, in which case this API returns null.
-            //
-            internal Type MergeType(Type objectType)
-            {
-                if (objectType == null) return null;
-                return MergeTypeInternal(objectType, null);
-            }
-
-            //
-            // Helper method for both MergeType and GetReflectionType
-            //
-            private Type MergeTypeInternal(Type objectType, object instance)
-            {
-
-                // If the incoming object type is already one of our wrapped types,
-                // there is nothing more for us to do
-                if (objectType is MetadataType) return objectType;
-
-                Type baseReflectionType = base.GetReflectionType(objectType, instance);
-                Type reflectionType;
-
-                lock (_syncLock)
-                {
-                    if (_metadataTypeCache == null || !_metadataTypeCache.TryGetValue(baseReflectionType, out reflectionType))
-                    {
-                        Type objectTypeDefinition = null;
-                        if (objectType.IsGenericType && !objectType.IsGenericTypeDefinition)
-                        {
-                            objectTypeDefinition = objectType.GetGenericTypeDefinition();
-                        }
-
-                        // See if we need to build a custom type for this objectType
-
-                        bool containsAttributes = false;
-                        foreach (AttributeTable table in _tables)
-                        {
-                            if (table.ContainsAttributes(objectType))
-                            {
-                                containsAttributes = true;
-                                break;
-                            }
-
-                            if (objectTypeDefinition != null && table.ContainsAttributes(objectTypeDefinition))
-                            {
-                                containsAttributes = true;
-                                break;
-                            }
-                        }
-
-                        // If we failed to find attributes quickly, we need
-                        // to check base classes and interfaces.
-
-                        if (!containsAttributes)
-                        {
-                            foreach (AttributeTable table in _tables)
-                            {
-                                foreach (Type t in table.AttributedTypes)
-                                {
-                                    if (t.IsAssignableFrom(objectType))
-                                    {
-                                        containsAttributes = true;
-                                        break;
-                                    }
-                                }
-                            }
-                        }
-
-                        // If we have a table that contains attributes for this type, we need
-                        // to wrap the type in our own reflection type.  If not, we will
-                        // store baseReflectionType in the cache slot.
-
-                        if (containsAttributes)
-                        {
-                            reflectionType = new MetadataType(baseReflectionType, _tables, this);
-                        }
-                        else
-                        {
-                            reflectionType = baseReflectionType;
-                        }
-
-                        if (_metadataTypeCache == null)
-                        {
-                            _metadataTypeCache = new Dictionary<Type, Type>();
-                        }
-                        _metadataTypeCache[baseReflectionType] = reflectionType;
-                    }
-                }
-
-                return reflectionType;
-            }
-
-            //
-            // This method is the metadata store's "master hook".  It will return a custom
-            // "MetadataType" for all types that have custom metadata declared in the
-            // attribute table.  By infusing our custom metadata at this low level,
-            // everything that builds on top of reflection can be accomodated.
-            //
-            public override Type GetReflectionType(Type objectType, object instance)
-            {
-                if (objectType == null) throw FxTrace.Exception.ArgumentNull("objectType");
-                return MergeTypeInternal(objectType, instance);
-            }
-
-            //
-            // Returns a custom type descriptor for the given object
-            //
-            public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
-            {
-                ICustomTypeDescriptor descriptor = base.GetTypeDescriptor(objectType, instance);
-                descriptor = new MetadataStoreTypeDescriptor(this, objectType, descriptor);
-                return descriptor;
-            }
-
-            //
-            // A descriptor key is a dictionary key used by
-            // our member descriptor cache.  The key consists of a type
-            // and a member descriptor.
-            // 
-            private struct DescriptorKey : IEquatable<DescriptorKey>
-            {
-                internal readonly Type Type;
-                internal readonly MemberDescriptor Member;
-
-                internal DescriptorKey(Type type, MemberDescriptor member)
-                {
-                    Type = type;
-                    Member = member;
-                }
-
-                public override int GetHashCode()
-                {
-                    int hash = Type.GetHashCode();
-                    if (Member != null)
-                    {
-                        hash ^= Member.GetHashCode();
-                    }
-                    return hash;
-                }
-
-                public override bool Equals(object obj)
-                {
-                    return Equals((DescriptorKey)obj);
-                }
-
-                public static bool operator ==(DescriptorKey a, DescriptorKey b)
-                {
-                    return a.Equals(b);
-                }
-
-                public static bool operator !=(DescriptorKey a, DescriptorKey b)
-                {
-                    return !a.Equals(b);
-                }
-
-#if DEBUG
-                public override string ToString() {
-                    string v = Type.FullName;
-                    if (Member != null) v = string.Concat(v, ".", Member);
-                    return v;
-                }
-#endif
-
-                // IEquatable<DescriptorKey> Members
-
-                public bool Equals(DescriptorKey other)
-                {
-                    if (Type != other.Type) return false;
-                    return object.ReferenceEquals(Member, other.Member);
-                }
-
-            }
-
-            //
-            // This type descriptor is what provides additional metadata.
-            // We implement ICustomTypeDescriptor ourselves, rather than
-            // derive from the helper CustomTypeDescriptor class because
-            // we want this implementation to be built on a struct for
-            // performance reasons.
-            //
-            private struct MetadataStoreTypeDescriptor : ICustomTypeDescriptor
-            {
-
-                private MetadataStoreProvider _provider;
-                private Type _objectType;
-                private ICustomTypeDescriptor _parent;
-
-                internal MetadataStoreTypeDescriptor(MetadataStoreProvider provider, Type objectType, ICustomTypeDescriptor parent)
-                {
-                    _provider = provider;
-                    _objectType = objectType;
-                    _parent = parent;
-                }
-
-                // ICustomTypeDescriptor Members
-
-                // Calls that just forward the the parent API
-                string ICustomTypeDescriptor.GetClassName() { return _parent.GetClassName(); }
-                string ICustomTypeDescriptor.GetComponentName() { return _parent.GetComponentName(); }
-                TypeConverter ICustomTypeDescriptor.GetConverter() { return _parent.GetConverter(); }
-                EventDescriptor ICustomTypeDescriptor.GetDefaultEvent() { return _parent.GetDefaultEvent(); }
-                PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty() { return _parent.GetDefaultProperty(); }
-                object ICustomTypeDescriptor.GetEditor(Type editorBaseType) { return _parent.GetEditor(editorBaseType); }
-                object ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor pd) { return _parent.GetPropertyOwner(pd); }
-
-                //
-                // Override to provide merged metadata
-                //
-                AttributeCollection ICustomTypeDescriptor.GetAttributes()
-                {
-                    return _provider.GetAttributes(_objectType);
-                }
-
-                //
-                // Override to provide merged metadata
-                //
-                EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes)
-                {
-                    return _provider.MergeEvents(_objectType, _parent.GetEvents(attributes));
-                }
-
-                //
-                // Override to provide merged metadata
-                //
-                EventDescriptorCollection ICustomTypeDescriptor.GetEvents()
-                {
-                    return _provider.MergeEvents(_objectType, _parent.GetEvents());
-                }
-
-                //
-                // Override to provide merged metadata
-                //
-                PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
-                {
-                    return _provider.MergeProperties(_objectType, _parent.GetProperties(attributes));
-                }
-
-                //
-                // Override to provide merged metadata
-                //
-                PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties()
-                {
-                    return _provider.MergeProperties(_objectType, _parent.GetProperties());
-                }
-
-            }
-
-            //
-            // A property descriptor that adds additional metadata to an existing
-            // property descriptor.
-            //
-            private class MetadataStorePropertyDescriptor : PropertyDescriptor
-            {
-
-                private static readonly object _noValue = new object();
-                private static readonly object _invalidValue = new object();
-
-                private Type _objectType;
-                private PropertyDescriptor _parent;
-                private AttributeCollection _attributes;
-                private Attribute[] _rawAttributes;
-                private object _defaultValue = _invalidValue;
-                private object _ambientValue = _invalidValue;
-
-                // There are simpler base ctors we can invoke that do attribute merging for us.  However,
-                // they do it all up front instead of deferring.  We want to defer until someone actually
-                // asks for attributes.
-                internal MetadataStorePropertyDescriptor(Type objectType, PropertyDescriptor parent)
-                    : base(parent.Name, null)
-                {
-                    _objectType = objectType;
-                    _parent = parent;
-                }
-
-                //
-                // Return our attribute collection.  We cache it
-                // for speed.
-                //
-                public override AttributeCollection Attributes
-                {
-                    get
-                    {
-                        CheckAttributesValid();
-                        if (_attributes == null)
-                        {
-                            _attributes = MetadataStoreProvider.CreateAttributeCollection(_rawAttributes);
-                        }
-
-                        return _attributes;
-                    }
-                }
-
-                //
-                // DefaultValue and AmbientValue are two values that are used by
-                // ReflectTypeDescriptionProvider in ResetValue(), CanResetValue(),
-                // and ShouldSerializeValue() in such a way that by-passes any additional
-                // values provided by the MetadataStore.  As such, we manually look up
-                // these two attributes ourselves to keep the MetadataStore functionality
-                // intact.
-                //
-                private object DefaultValue
-                {
-                    get
-                    {
-                        if (_defaultValue == _invalidValue)
-                        {
-                            DefaultValueAttribute dva = (DefaultValueAttribute)Attributes[typeof(DefaultValueAttribute)];
-                            if (dva != null)
-                            {
-                                _defaultValue = dva.Value;
-                            }
-                            else
-                            {
-                                _defaultValue = _noValue;
-                            }
-                        }
-                        return _defaultValue;
-                    }
-                }
-
-                //
-                // See comment for DefaultValue
-                //
-                private object AmbientValue
-                {
-                    get
-                    {
-                        if (_ambientValue == _invalidValue)
-                        {
-                            AmbientValueAttribute ava = (AmbientValueAttribute)Attributes[typeof(AmbientValueAttribute)];
-                            if (ava != null)
-                            {
-                                _ambientValue = ava.Value;
-                            }
-                            else
-                            {
-                                _ambientValue = _noValue;
-                            }
-                        }
-                        return _ambientValue;
-                    }
-                }
-
-                //
-                // This is a little strange and merits some explanation.
-                // We want to cache our attribute collection, but we need
-                // to know when to invalidate the cache. MemberDescriptor
-                // has an internal version stamp that it compares with
-                // TypeDescriptor's metadata version and automatically invalidates
-                // its own cached values for attributes.  The trick is 
-                // we need to know when MemberDescriptor invalidated its
-                // cached values.  We do this by keying off the fact that
-                // MemberDescriptor will call FillAttributes when its cache
-                // needs to be repopulated.  But, in oder to get MemberDescriptor
-                // to look at its cache we must access an API that requires
-                // cached data.  AttributeArray does this in the lightest
-                // possible way.  The actual set of attributes in the array
-                // is always an empty set, but we don't care; we only need
-                // to access the property.  The return value of the API
-                // and the check for length are only here so the compiler
-                // and FXCop do not complain about us calling a property
-                // and not using the return value.  The attribute array
-                // always contains zero elements.
-                //
-                private bool CheckAttributesValid()
-                {
-                    Fx.Assert(AttributeArray.Length == 0, "Attribute array should always contain zero elements");
-                    return AttributeArray.Length == 0 && _attributes != null;
-                }
-
-                //
-                // This method is called when we need to populate the raw set of
-                // attributes for this property.  
-                //
-                protected override void FillAttributes(IList attributeList)
-                {
-                    _attributes = null;
-                    _defaultValue = _invalidValue;
-                    _ambientValue = _invalidValue;
-
-                    _rawAttributes = MetadataStoreProvider.GetRawAttributes(_objectType, Name, _parent, false);
-                    base.FillAttributes(attributeList);
-                }
-
-                // PropertyDescriptor API.  
-                public override bool CanResetValue(object component)
-                {
-                    if (DefaultValue != _noValue)
-                    {
-                        object currentValue = GetValue(component);
-                        return !object.Equals(currentValue, DefaultValue);
-                    }
-                    else if (AmbientValue != _noValue)
-                    {
-                        object currentValue = GetValue(component);
-                        return !object.Equals(currentValue, AmbientValue);
-                    }
-                    else
-                    {
-                        return _parent.CanResetValue(component);
-                    }
-                }
-
-                public override void ResetValue(object component)
-                {
-                    if (DefaultValue != _noValue)
-                    {
-                        SetValue(component, DefaultValue);
-                    }
-                    else if (AmbientValue != _noValue)
-                    {
-                        SetValue(component, AmbientValue);
-                    }
-                    else
-                    {
-                        _parent.ResetValue(component);
-                    }
-                }
-
-                public override bool ShouldSerializeValue(object component)
-                {
-                    if (DefaultValue != _noValue)
-                    {
-                        object currentValue = GetValue(component);
-                        return !object.Equals(currentValue, DefaultValue);
-                    }
-                    else if (AmbientValue != _noValue)
-                    {
-                        object currentValue = GetValue(component);
-                        return !object.Equals(currentValue, AmbientValue);
-                    }
-                    else
-                    {
-                        return _parent.ShouldSerializeValue(component);
-                    }
-                }
-
-                public override void AddValueChanged(object component, EventHandler handler) { _parent.AddValueChanged(component, handler); }
-                public override Type ComponentType { get { return _parent.ComponentType; } }
-                [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Propagating the error might cause VS to crash")]
-                [SuppressMessage("Reliability", "Reliability108", Justification = "Propagating the error might cause VS to crash")]
-                public override object GetValue(object component)
-                {
-                    object retValue = null;
-
-                    try
-                    {
-                        retValue = _parent.GetValue(component);
-                    }
-                    catch (System.Exception)
-                    {
-                        // GetValue throws an exception if Value is not available
-                    }
-
-                    return retValue;
-                }
-                public override bool IsReadOnly { get { return _parent.IsReadOnly || Attributes.Contains(ReadOnlyAttribute.Yes); } }
-                public override Type PropertyType { get { return _parent.PropertyType; } }
-                public override void SetValue(object component, object value) { _parent.SetValue(component, value); }
-                public override void RemoveValueChanged(object component, EventHandler handler) { _parent.RemoveValueChanged(component, handler); }
-                public override bool SupportsChangeEvents { get { return _parent.SupportsChangeEvents; } }
-            }
-
-            //
-            // An event descriptor that adds additional metadata to an existing 
-            // event descriptor.
-            //
-            private class MetadataStoreEventDescriptor : EventDescriptor
-            {
-                private Type _objectType;
-                private EventDescriptor _parent;
-
-                // There are simpler base ctors we can invoke that do attribute merging for us.  However,
-                // they do it all up front instead of deferring.  We want to defer until someone actually
-                // asks for attributes.
-                internal MetadataStoreEventDescriptor(Type objectType, EventDescriptor parent)
-                    : base(parent.Name, null)
-                {
-                    _objectType = objectType;
-                    _parent = parent;
-                }
-
-                //
-                // We override this so we can merge in our additional attributes.
-                // By overriding here, we wait until someone actually asks for
-                // attributes before merging.
-                //
-                protected override AttributeCollection CreateAttributeCollection()
-                {
-                    Attribute[] attrs = MetadataStoreProvider.GetRawAttributes(_objectType, Name, _parent, true);
-
-                    // We must let MemberDescriptor build its attributes, even if we're going
-                    // to replace them.  The reason for this is that MemberDescriptor keeps an
-                    // internal version stamp.  This version stamp changes when someone adds
-                    // a new TypeDescriptionProvider.  If we don't let MemberDescriptor maintain
-                    // this version stamp it won't invalidate metadata when someone adds or removes
-                    // a TypeDescriptionProvider, which can cause us to return stale data.
-
-                    AttributeArray = attrs;
-                    AttributeCollection attributes = base.CreateAttributeCollection(); // do not delete this
-                    attributes = MetadataStoreProvider.CreateAttributeCollection(attrs);
-                    return attributes;
-                }
-
-                // EventDescriptor API
-                public override void AddEventHandler(object component, Delegate value) { _parent.AddEventHandler(component, value); }
-                public override Type ComponentType { get { return _parent.ComponentType; } }
-                public override Type EventType { get { return _parent.EventType; } }
-                public override bool IsMulticast { get { return _parent.IsMulticast; } }
-                public override void RemoveEventHandler(object component, Delegate value) { _parent.RemoveEventHandler(component, value); }
-            }
-        }
-
-        //
-        // This type is the core of our metadata store.  We offer this through our type 
-        // description provider as the "reflection type" that should be used during
-        // reflection operations.  All things within TypeDescriptor will use this
-        // type to get metadata, which gives us a big hook into their mechanism.
-        // By hooking at this low level we can be sure to cover all of our bases.
-        //
-        private class MetadataType : Type
-        {
-
-            private Type _baseReflectionType;
-            private AttributeTable[] _tables;
-            private MetadataStoreProvider _provider;
-            private Dictionary<MemberInfo, MemberInfo> _memberCache;
-            private Hashtable _seenAttributes;
-            private AttributeMergeCache _cache;
-            private object _syncLock = new object();
-
-            internal MetadataType(Type baseReflectionType, AttributeTable[] tables, MetadataStoreProvider provider)
-            {
-                _baseReflectionType = baseReflectionType;
-                _tables = tables;
-                _provider = provider;
-            }
-
-            // Type Forward APIs
-            //
-            // The majority of Type's API is just forwarded to our base reflection 
-            // type.
-            //
-            public override Guid GUID { get { return _baseReflectionType.GUID; } }
-            public override Assembly Assembly { get { return _baseReflectionType.Assembly; } }
-            public override string AssemblyQualifiedName { get { return _baseReflectionType.AssemblyQualifiedName; } }
-            public override bool ContainsGenericParameters { get { return _baseReflectionType.ContainsGenericParameters; } }
-            public override MethodBase DeclaringMethod { get { return _baseReflectionType.DeclaringMethod; } }
-            public override RuntimeTypeHandle TypeHandle { get { return _baseReflectionType.TypeHandle; } }
-            public override int GetHashCode() { return _baseReflectionType.GetHashCode(); }
-            public override string FullName { get { return _baseReflectionType.FullName; } }
-            public override GenericParameterAttributes GenericParameterAttributes { get { return _baseReflectionType.GenericParameterAttributes; } }
-            public override int GenericParameterPosition { get { return _baseReflectionType.GenericParameterPosition; } }
-            public override int GetArrayRank() { return _baseReflectionType.GetArrayRank(); }
-            protected override TypeAttributes GetAttributeFlagsImpl() { return _baseReflectionType.Attributes; }
-            protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) { return _baseReflectionType.GetConstructor(bindingAttr, binder, callConvention, types, modifiers); }
-            public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) { return _baseReflectionType.GetConstructors(bindingAttr); }
-            public override FieldInfo GetField(string name, BindingFlags bindingAttr) { return _baseReflectionType.GetField(name, bindingAttr); }
-            public override FieldInfo[] GetFields(BindingFlags bindingAttr) { return _baseReflectionType.GetFields(bindingAttr); }
-            protected override bool HasElementTypeImpl() { return _baseReflectionType.HasElementType; }
-            public override object InvokeMember(string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, System.Globalization.CultureInfo culture, string[] namedParameters) { return _baseReflectionType.InvokeMember(name, invokeAttr, binder, target, args, modifiers, culture, namedParameters); }
-            protected override bool IsArrayImpl() { return _baseReflectionType.IsArray; }
-            protected override bool IsByRefImpl() { return _baseReflectionType.IsByRef; }
-            protected override bool IsCOMObjectImpl() { return _baseReflectionType.IsCOMObject; }
-            protected override bool IsPointerImpl() { return _baseReflectionType.IsPointer; }
-            protected override bool IsPrimitiveImpl() { return _baseReflectionType.IsPrimitive; }
-            public override Module Module { get { return _baseReflectionType.Module; } }
-            public override string Namespace { get { return _baseReflectionType.Namespace; } }
-            public override Type UnderlyingSystemType { get { return _baseReflectionType.UnderlyingSystemType; } }
-            public override string Name { get { return _baseReflectionType.Name; } }
-            public override InterfaceMapping GetInterfaceMap(Type interfaceType) { return _baseReflectionType.GetInterfaceMap(interfaceType); }
-            public override bool IsAssignableFrom(Type c) { return _baseReflectionType.IsAssignableFrom(c); }
-            protected override bool IsContextfulImpl() { return _baseReflectionType.IsContextful; }
-            public override bool IsGenericParameter { get { return _baseReflectionType.IsGenericParameter; } }
-            public override bool IsGenericType { get { return _baseReflectionType.IsGenericType; } }
-            public override bool IsGenericTypeDefinition { get { return _baseReflectionType.IsGenericTypeDefinition; } }
-            public override bool IsInstanceOfType(object o) { return _baseReflectionType.IsInstanceOfType(o); }
-            protected override bool IsMarshalByRefImpl() { return _baseReflectionType.IsMarshalByRef; }
-            public override bool IsSubclassOf(Type c) { return _baseReflectionType.IsSubclassOf(c); }
-            protected override bool IsValueTypeImpl() { return _baseReflectionType.IsValueType; }
-            public override Type MakeArrayType() { return _baseReflectionType.MakeArrayType(); }
-            public override Type MakeArrayType(int rank) { return _baseReflectionType.MakeArrayType(rank); }
-            public override Type MakeByRefType() { return _baseReflectionType.MakeByRefType(); }
-            public override Type MakeGenericType(params Type[] typeArguments) { return _baseReflectionType.MakeGenericType(typeArguments); }
-            public override Type MakePointerType() { return _baseReflectionType.MakePointerType(); }
-            public override MemberTypes MemberType { get { return _baseReflectionType.MemberType; } }
-            public override int MetadataToken { get { return _baseReflectionType.MetadataToken; } }
-            public override Type ReflectedType { get { return _baseReflectionType.ReflectedType; } }
-            public override System.Runtime.InteropServices.StructLayoutAttribute StructLayoutAttribute { get { return _baseReflectionType.StructLayoutAttribute; } }
-            public override string ToString() { return _baseReflectionType.ToString(); }
-
-
-            // Type APIs
-
-            //
-            // Wrap returned types
-            //
-            public override Type GetElementType()
-            {
-                return _provider.MergeType(_baseReflectionType.GetElementType());
-            }
-
-            //
-            // Wrap returned types
-            //
-            public override Type DeclaringType
-            {
-                get { return _provider.MergeType(_baseReflectionType.DeclaringType); }
-            }
-
-            //
-            // Wrap returned types
-            //
-            public override Type[] FindInterfaces(TypeFilter filter, object filterCriteria)
-            {
-                Type[] ifaces = _baseReflectionType.FindInterfaces(filter, filterCriteria);
-                for (int idx = 0; idx < ifaces.Length; idx++)
-                {
-                    ifaces[idx] = _provider.MergeType(ifaces[idx]);
-                }
-                return ifaces;
-            }
-
-            //
-            // Wrap returned types
-            //
-            public override Type BaseType
-            {
-                get { return _provider.MergeType(_baseReflectionType.BaseType); }
-            }
-
-            //
-            // Wrap returned types
-            //
-            public override Type GetInterface(string name, bool ignoreCase)
-            {
-                return _provider.MergeType(_baseReflectionType.GetInterface(name, ignoreCase));
-            }
-
-            //
-            // Wrap returned types
-            //
-            public override Type[] GetInterfaces()
-            {
-                Type[] ifaces = _baseReflectionType.GetInterfaces();
-                for (int idx = 0; idx < ifaces.Length; idx++)
-                {
-                    ifaces[idx] = _provider.MergeType(ifaces[idx]);
-                }
-                return ifaces;
-            }
-
-            //
-            // Wrap returned types
-            //
-            public override Type GetNestedType(string name, BindingFlags bindingAttr)
-            {
-                return _provider.MergeType(_baseReflectionType.GetNestedType(name, bindingAttr));
-            }
-
-            //
-            // Wrap returned types
-            //
-            public override Type[] GetNestedTypes(BindingFlags bindingAttr)
-            {
-                Type[] ifaces = _baseReflectionType.GetNestedTypes(bindingAttr);
-                for (int idx = 0; idx < ifaces.Length; idx++)
-                {
-                    ifaces[idx] = _provider.MergeType(ifaces[idx]);
-                }
-                return ifaces;
-            }
-
-            //
-            // Wrap returned types
-            //
-            public override Type[] GetGenericArguments()
-            {
-                Type[] ifaces = _baseReflectionType.GetGenericArguments();
-                for (int idx = 0; idx < ifaces.Length; idx++)
-                {
-                    ifaces[idx] = _provider.MergeType(ifaces[idx]);
-                }
-                return ifaces;
-            }
-
-            //
-            // Wrap returned types
-            //
-            public override Type[] GetGenericParameterConstraints()
-            {
-                Type[] ifaces = _baseReflectionType.GetGenericParameterConstraints();
-                for (int idx = 0; idx < ifaces.Length; idx++)
-                {
-                    ifaces[idx] = _provider.MergeType(ifaces[idx]);
-                }
-                return ifaces;
-            }
-
-            //
-            // Wrap returned types
-            //
-            public override Type GetGenericTypeDefinition()
-            {
-                return _provider.MergeType(_baseReflectionType.GetGenericTypeDefinition());
-            }
-
-            //
-            // Custom attribute access
-            //
-            public override object[] GetCustomAttributes(bool inherit)
-            {
-                return MergeAttributes(null, _baseReflectionType, inherit, ref _cache);
-            }
-
-            //
-            // Custom attribute access
-            //
-            public override object[] GetCustomAttributes(Type attributeType, bool inherit)
-            {
-                return MergeAttributes(attributeType, _baseReflectionType, inherit, ref _cache);
-            }
-
-            //
-            // Custom attribute access
-            //
-            public override bool IsDefined(Type attributeType, bool inherit)
-            {
-                bool isDefined = _baseReflectionType.IsDefined(attributeType, inherit);
-                if (!isDefined) isDefined = IsDefinedInTable(attributeType, null, inherit);
-                return isDefined;
-            }
-
-            //
-            // Member access
-            //
-            public override MemberInfo[] FindMembers(MemberTypes memberType, BindingFlags bindingAttr, MemberFilter filter, object filterCriteria)
-            {
-                MemberInfo[] infos = _baseReflectionType.FindMembers(memberType, bindingAttr, filter, filterCriteria);
-                return MergeMembers(infos);
-            }
-
-            //
-            // Member access
-            //
-            public override MemberInfo[] GetDefaultMembers()
-            {
-                MemberInfo[] infos = _baseReflectionType.GetDefaultMembers();
-                return MergeMembers(infos);
-            }
-
-            //
-            // Member access
-            //
-            public override MemberInfo[] GetMember(string name, MemberTypes type, BindingFlags bindingAttr)
-            {
-                MemberInfo[] infos = _baseReflectionType.GetMember(name, type, bindingAttr);
-                return MergeMembers(infos);
-            }
-
-            //
-            // Member access
-            //
-            public override MemberInfo[] GetMember(string name, BindingFlags bindingAttr)
-            {
-                MemberInfo[] infos = _baseReflectionType.GetMember(name, bindingAttr);
-                return MergeMembers(infos);
-            }
-
-            //
-            // Member access
-            //
-            public override MemberInfo[] GetMembers(BindingFlags bindingAttr)
-            {
-                MemberInfo[] infos = _baseReflectionType.GetMembers(bindingAttr);
-                return MergeMembers(infos);
-            }
-
-            //
-            // Event access
-            //
-            public override EventInfo GetEvent(string name, BindingFlags bindingAttr)
-            {
-                EventInfo info = _baseReflectionType.GetEvent(name, bindingAttr);
-                return MergeEvent(info);
-            }
-
-            //
-            // Event access
-            //
-            public override EventInfo[] GetEvents()
-            {
-                EventInfo[] infos = _baseReflectionType.GetEvents();
-                return MergeEvents(infos);
-            }
-
-            //
-            // Event access
-            //
-            public override EventInfo[] GetEvents(BindingFlags bindingAttr)
-            {
-                EventInfo[] infos = _baseReflectionType.GetEvents(bindingAttr);
-                return MergeEvents(infos);
-            }
-
-            //
-            // Method access
-            //
-            protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
-            {
-                MethodInfo info;
-
-                if (types == null)
-                {
-                    info = _baseReflectionType.GetMethod(name, bindingAttr);
-                }
-                else
-                {
-                    info = _baseReflectionType.GetMethod(name, bindingAttr, binder, callConvention, types, modifiers);
-                }
-
-                if (info != null)
-                {
-                    info = MergeMethod(info);
-                }
-
-                return info;
-            }
-
-            //
-            // Method access
-            //
-            public override MethodInfo[] GetMethods(BindingFlags bindingAttr)
-            {
-                MethodInfo[] infos = _baseReflectionType.GetMethods(bindingAttr);
-                return MergeMethods(infos);
-            }
-
-            //
-            // Property access
-            //
-            public override PropertyInfo[] GetProperties(BindingFlags bindingAttr)
-            {
-                PropertyInfo[] infos = _baseReflectionType.GetProperties(bindingAttr);
-                return MergeProperties(infos);
-            }
-
-            //
-            // Property access
-            //
-            protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
-            {
-                PropertyInfo info;
-                if (types != null)
-                {
-                    info = _baseReflectionType.GetProperty(name, bindingAttr, binder, returnType, types, modifiers);
-                }
-                else
-                {
-                    info = _baseReflectionType.GetProperty(name, bindingAttr);
-                }
-
-                return MergeProperty(info);
-            }
-
-
-            // Merging APIs
-
-            //
-            // Returns true if the given attribute type is defined in any attribute table.
-            // This can take null for the member, in which case it searches type attributes.
-            // Table is assigned at construction and read-only, so no locking required.
-            //
-            private bool IsDefinedInTable(Type attributeType, MemberInfo member, bool inherit)
-            {
-                bool isDefined = false;
-                for (Type t = UnderlyingSystemType; t != null && !isDefined; t = t.BaseType)
-                {
-                    foreach (AttributeTable table in _tables)
-                    {
-                        IEnumerable attrEnum;
-                        if (member == null)
-                        {
-                            attrEnum = table.GetCustomAttributes(t);
-                        }
-                        else
-                        {
-                            attrEnum = table.GetCustomAttributes(t, member);
-                        }
-
-                        foreach (object a in attrEnum)
-                        {
-                            if (attributeType.IsInstanceOfType(a))
-                            {
-                                isDefined = true;
-                                break;
-                            }
-                        }
-
-                        if (isDefined) break;
-                    }
-
-                    if (!inherit) break;
-                }
-                return isDefined;
-            }
-
-            //
-            // Merging of an array of attributes.  This is called from 
-            // GetCustomAttributes for both types and members.  Attributes
-            // must be merged so the most derived and highest priority
-            // attributes are first in the list.  Metadata store attributes
-            // always take higher precidence than CLR attributes.
-            //
-            [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
-            private object[] MergeAttributes(Type filterType, MemberInfo member, bool inherit, ref AttributeMergeCache cache)
-            {
-
-                Type currentType = UnderlyingSystemType;
-                MemberInfo currentMember = member;
-
-                if (cache == null) cache = new AttributeMergeCache();
-                if (cache.FilterType != filterType ||
-                    cache.Member != member ||
-                    cache.Inherit != inherit)
-                {
-
-                    cache.FilterType = filterType;
-                    cache.Member = member;
-                    cache.Inherit = inherit;
-                    if (cache.Cache != null) cache.Cache.Clear();
-                }
-                else if (cache.Cache != null)
-                {
-                    // Cache is valid; return it
-                    return (object[])cache.Cache.ToArray(filterType ?? typeof(object));
-                }
-
-
-                // Cache is invalid or null.  Walk attributes.
-
-                if (cache.Cache == null) cache.Cache = new ArrayList();
-                ArrayList compiledAttributes = cache.Cache;
-
-                lock (_syncLock)
-                {
-
-                    if (_seenAttributes == null)
-                    {
-                        _seenAttributes = new Hashtable();
-                    }
-                    else
-                    {
-                        _seenAttributes.Clear();
-                    }
-
-                    bool firstIteration = true;
-                    bool isType = member is Type;
-                    bool includeClrAttributes = (isType || currentMember.DeclaringType == currentType);
-
-                    while (currentType != null && currentMember != null)
-                    {
-
-                        foreach (object attr in MergeAttributesIterator(currentType, currentMember, includeClrAttributes))
-                        {
-
-                            if (filterType != null && !filterType.IsAssignableFrom(attr.GetType()))
-                                continue;
-
-                            AttributeData attrData = AttributeDataCache.GetAttributeData(attr.GetType());
-                            bool haveSeenBefore = _seenAttributes.ContainsKey(attrData.AttributeType);
-
-                            // Can we have more than one?
-                            if (haveSeenBefore &&
-                                !attrData.AllowsMultiple)
-                                continue;
-
-                            // Is this attribute inheritable?
-                            if (!firstIteration &&
-                                !attrData.IsInheritable)
-                                continue;
-
-                            // We do a scan here for TypeDescriptionProviderAttribute.  Because we
-                            // are creating a custom type here and gathering metadata from 
-                            // our base type, it is very important that we don't offer this attribute.
-                            // Doing so could cause TypeDescriptor to add a provider for this type
-                            // and create a cycle
-                            if (attrData.AttributeType.Equals(typeof(TypeDescriptionProviderAttribute)))
-                                continue;
-
-                            compiledAttributes.Add(attr);
-                            _seenAttributes[attrData.AttributeType] = attr;
-                        }
-
-                        // Continue?
-                        if (!inherit)
-                            break;
-
-                        // Advance up the type hierarchy
-                        // 
-                        // Note: CLR attributes key off of currentMember.  MetadataStore attributes key
-                        // off of currentType and memberName.  Because we advance currentType independent of 
-                        // currentMember, it is possible for the currentMember to belong to some
-                        // ancestor of currentType.  As such, we wait with advancing currentMember until
-                        // currentType catches up.  While we wait, we do not include the CLR attributes in
-                        // the mix because they would be added multiple times as a result.
-
-                        // Is currentType caught up to currentMember.DeclaringType?
-                        if (isType || currentMember.DeclaringType == currentType)
-                        {
-                            currentMember = AttributeDataCache.GetBaseMemberInfo(currentMember);
-                        }
-
-                        currentType = currentType.BaseType;
-
-                        if (isType || currentMember == null || currentMember.DeclaringType == currentType)
-                        {
-                            includeClrAttributes = true;
-                        }
-                        else
-                        {
-                            includeClrAttributes = false;
-                        }
-
-                        firstIteration = false;
-                    }
-                }
-
-                return (object[])compiledAttributes.ToArray(filterType ?? typeof(object));
-            }
-
-            // 
-            // Enumerates through values contained in the attribute cache in 
-            // an order that returns the MetadataStore attributes before returning
-            // the CLR attributes (if requested)
-            //
-            private IEnumerable<object> MergeAttributesIterator(Type type, MemberInfo member, bool includeClrAttributes)
-            {
-                // MetadataStore uses member name string, instead of MemberInfo to store custom attributes,
-                // so figure out what the member name is.  For types, it will be null.
-                string memberName = GetMemberName(member);
-
-                // Go through the MetadataStore attributes first, as they take precedence over CLR attributes
-                foreach (object attr in AttributeDataCache.GetMetadataStoreAttributes(type, memberName, _tables))
-                    yield return attr;
-
-                if (type.IsGenericType && !type.IsGenericTypeDefinition && !string.IsNullOrEmpty(memberName))
-                {
-                    foreach (object attr in AttributeDataCache.GetMetadataStoreAttributes(type.GetGenericTypeDefinition(), memberName, _tables))
-                        yield return attr;
-                }
-
-                if (includeClrAttributes)
-                {
-                    // Go through the CLR attributes second
-                    foreach (object attr in AttributeDataCache.GetClrAttributes(member))
-                        yield return attr;
-                }
-            }
-
-            //
-            // Gets the member name from the specified MemberInfo that we use as key
-            // to get custom attributes from the MetadataStore.  Types will return null.
-            //
-            private static string GetMemberName(MemberInfo member)
-            {
-                if (member is Type)
-                    return null;
-
-                // The only methods supported in metadata store are those related to
-                // Get methods for DependencyProperties and they start with a "Get..."
-                if (member.MemberType == MemberTypes.Method)
-                {
-                    Fx.Assert(
-                        member.Name.StartsWith("Get", StringComparison.Ordinal) &&
-                        member.Name.Length > 3,
-                        "MetadataStore expects to only see Get[Foo] or Set[Foo] MethodInfos");
-
-                    return member.Name.Substring(3);
-                }
-
-                return member.Name;
-            }
-
-            //
-            // Merging of an event.
-            //
-            private EventInfo MergeEvent(EventInfo info)
-            {
-                if (info == null) return null;
-
-                MemberInfo cache;
-
-                lock (_syncLock)
-                {
-                    if (_memberCache == null || !_memberCache.TryGetValue(info, out cache))
-                    {
-
-                        if (_memberCache == null)
-                        {
-                            _memberCache = new Dictionary<MemberInfo, MemberInfo>();
-                        }
-
-                        EventInfo newInfo = new MetadataEventInfo(info, this);
-                        _memberCache[info] = newInfo;
-                        info = newInfo;
-                    }
-                    else
-                    {
-                        info = (EventInfo)cache;
-                    }
-                }
-
-                return info;
-            }
-
-            //
-            // Merging of an array of events.
-            //
-            private EventInfo[] MergeEvents(EventInfo[] infos)
-            {
-                for (int idx = 0; idx < infos.Length; idx++)
-                {
-                    infos[idx] = MergeEvent(infos[idx]);
-                }
-                return infos;
-            }
-
-            //
-            // Merging a generic member calls down to specific
-            // merge functions based on the type of the member.
-            // 
-            private MemberInfo MergeMember(MemberInfo info)
-            {
-                MethodInfo m;
-                PropertyInfo p;
-                EventInfo e;
-
-                if ((m = info as MethodInfo) != null)
-                {
-                    return MergeMethod(m);
-                }
-                else if ((p = info as PropertyInfo) != null)
-                {
-                    return MergeProperty(p);
-                }
-                else if ((e = info as EventInfo) != null)
-                {
-                    return MergeEvent(e);
-                }
-
-                return info;
-            }
-
-            //
-            // Merging a generic member calls down to specific
-            // merge functions based on the type of the member.
-            // 
-            private MemberInfo[] MergeMembers(MemberInfo[] infos)
-            {
-                for (int idx = 0; idx < infos.Length; idx++)
-                {
-                    infos[idx] = MergeMember(infos[idx]);
-                }
-                return infos;
-            }
-
-            //
-            // Merging of a method.  We only deal with 
-            // static methods in the format Get<member name>
-            // so we can support attached properties.  Otherwise,
-            // we let the method be.
-            //
-            private MethodInfo MergeMethod(MethodInfo info)
-            {
-                if (info == null) return null;
-
-                if (info.IsStatic && info.Name.StartsWith("Get", StringComparison.Ordinal))
-                {
-                    MemberInfo cache;
-
-                    lock (_syncLock)
-                    {
-                        if (_memberCache == null || !_memberCache.TryGetValue(info, out cache))
-                        {
-
-                            if (_memberCache == null)
-                            {
-                                _memberCache = new Dictionary<MemberInfo, MemberInfo>();
-                            }
-
-                            MethodInfo newInfo = new MetadataMethodInfo(info, this);
-                            _memberCache[info] = newInfo;
-                            info = newInfo;
-                        }
-                        else
-                        {
-                            info = (MethodInfo)cache;
-                        }
-                    }
-                }
-                return info;
-            }
-
-            //
-            // Merging of an array of methods.
-            //
-            private MethodInfo[] MergeMethods(MethodInfo[] infos)
-            {
-                for (int idx = 0; idx < infos.Length; idx++)
-                {
-                    infos[idx] = MergeMethod(infos[idx]);
-                }
-                return infos;
-            }
-
-            //
-            // Merging of a property.
-            //
-            private PropertyInfo MergeProperty(PropertyInfo info)
-            {
-                if (info == null) return null;
-
-                MemberInfo cache;
-
-                lock (_syncLock)
-                {
-                    if (_memberCache == null || !_memberCache.TryGetValue(info, out cache))
-                    {
-
-                        if (_memberCache == null)
-                        {
-                            _memberCache = new Dictionary<MemberInfo, MemberInfo>();
-                        }
-
-                        PropertyInfo newInfo = new MetadataPropertyInfo(info, this);
-                        _memberCache[info] = newInfo;
-                        info = newInfo;
-                    }
-                    else
-                    {
-                        info = (PropertyInfo)cache;
-                    }
-                }
-
-                return info;
-            }
-
-            //
-            // Merging of an array of properties.
-            //
-            private PropertyInfo[] MergeProperties(PropertyInfo[] infos)
-            {
-                for (int idx = 0; idx < infos.Length; idx++)
-                {
-                    infos[idx] = MergeProperty(infos[idx]);
-                }
-                return infos;
-            }
-
-
-            //
-            // A simple class that holds merged attribute data.
-            //
-            private class AttributeMergeCache
-            {
-                internal Type FilterType;
-                internal bool Inherit;
-                internal ArrayList Cache;
-                internal MemberInfo Member;
-            }
-
-            //
-            // A property info that contains our custom metadata.
-            //
-            private class MetadataPropertyInfo : PropertyInfo
-            {
-
-                private PropertyInfo _info;
-                private MetadataType _type;
-                private AttributeMergeCache _cache;
-
-                internal MetadataPropertyInfo(PropertyInfo info, MetadataType type)
-                {
-                    _info = info;
-                    _type = type;
-                }
-
-                //
-                // PropertyInfo overrides
-                //
-                public override PropertyAttributes Attributes { get { return _info.Attributes; } }
-                public override bool CanRead { get { return _info.CanRead; } }
-                public override bool CanWrite { get { return _info.CanWrite; } }
-                public override MethodInfo[] GetAccessors(bool nonPublic) { return _info.GetAccessors(nonPublic); }
-                public override MethodInfo GetGetMethod(bool nonPublic) { return _info.GetGetMethod(nonPublic); }
-                public override ParameterInfo[] GetIndexParameters() { return _info.GetIndexParameters(); }
-                public override MethodInfo GetSetMethod(bool nonPublic) { return _info.GetSetMethod(nonPublic); }
-                public override object GetValue(object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture) { return _info.GetValue(obj, invokeAttr, binder, index, culture); }
-                public override Type PropertyType { get { return _info.PropertyType; } }
-                public override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture) { _info.SetValue(obj, value, invokeAttr, binder, index, culture); }
-                public override Type DeclaringType { get { return _info.DeclaringType; } }
-                public override string Name { get { return _info.Name; } }
-                public override Type ReflectedType { get { return _info.ReflectedType; } }
-                public override bool Equals(object obj) { return object.ReferenceEquals(this, obj); }
-                public override int GetHashCode() { return _info.GetHashCode(); }
-                public override object GetConstantValue() { return _info.GetConstantValue(); }
-                public override Type[] GetOptionalCustomModifiers() { return _info.GetOptionalCustomModifiers(); }
-                public override object GetRawConstantValue() { return _info.GetRawConstantValue(); }
-                public override Type[] GetRequiredCustomModifiers() { return _info.GetRequiredCustomModifiers(); }
-                public override object GetValue(object obj, object[] index) { return _info.GetValue(obj, index); }
-                public override MemberTypes MemberType { get { return _info.MemberType; } }
-                public override int MetadataToken { get { return _info.MetadataToken; } }
-                public override Module Module { get { return _info.Module; } }
-                public override void SetValue(object obj, object value, object[] index) { _info.SetValue(obj, value, index); }
-                public override string ToString() { return _info.ToString(); }
-
-                //
-                // Merges our custom attributes in with those of the member info.
-                //
-                public override object[] GetCustomAttributes(Type attributeType, bool inherit)
-                {
-                    return _type.MergeAttributes(attributeType, _info, inherit, ref _cache);
-                }
-
-                //
-                // Merges our custom attributes in with those of the member info.
-                //
-                public override object[] GetCustomAttributes(bool inherit)
-                {
-                    return _type.MergeAttributes(null, _info, inherit, ref _cache);
-                }
-
-                //
-                // Determines if an attribute exists in the member info
-                // or in our own code.
-                //
-                public override bool IsDefined(Type attributeType, bool inherit)
-                {
-                    bool isDefined = _info.IsDefined(attributeType, inherit);
-                    if (!isDefined) isDefined = _type.IsDefinedInTable(attributeType, _info, inherit);
-                    return isDefined;
-                }
-            }
-
-            //
-            // An EventInfo that provides our custom attributes.
-            //
-            private class MetadataEventInfo : EventInfo
-            {
-
-                private EventInfo _info;
-                private MetadataType _type;
-                private AttributeMergeCache _cache;
-
-                internal MetadataEventInfo(EventInfo info, MetadataType type)
-                {
-                    _info = info;
-                    _type = type;
-                }
-
-                //
-                // EventInfo overrides
-                //
-                public override EventAttributes Attributes { get { return _info.Attributes; } }
-                public override string Name { get { return _info.Name; } }
-                public override Type ReflectedType { get { return _info.ReflectedType; } }
-                public override bool Equals(object obj) { return object.ReferenceEquals(this, obj); }
-                public override int GetHashCode() { return _info.GetHashCode(); }
-                public override MethodInfo[] GetOtherMethods(bool nonPublic) { return _info.GetOtherMethods(nonPublic); }
-                public override MemberTypes MemberType { get { return _info.MemberType; } }
-                public override int MetadataToken { get { return _info.MetadataToken; } }
-                public override Module Module { get { return _info.Module; } }
-                public override string ToString() { return _info.ToString(); }
-                public override MethodInfo GetAddMethod(bool nonPublic) { return _info.GetAddMethod(nonPublic); }
-                public override MethodInfo GetRaiseMethod(bool nonPublic) { return _info.GetRaiseMethod(nonPublic); }
-                public override MethodInfo GetRemoveMethod(bool nonPublic) { return _info.GetRemoveMethod(nonPublic); }
-                public override Type DeclaringType { get { return _info.DeclaringType; } }
-
-                //
-                // Merges our custom attributes in with those of the member info.
-                //
-                public override object[] GetCustomAttributes(Type attributeType, bool inherit)
-                {
-                    return _type.MergeAttributes(attributeType, _info, inherit, ref _cache);
-                }
-
-                //
-                // Merges our custom attributes in with those of the member info.
-                //
-                public override object[] GetCustomAttributes(bool inherit)
-                {
-                    return _type.MergeAttributes(null, _info, inherit, ref _cache);
-                }
-
-                //
-                // Determines if an attribute exists in the member info
-                // or in our own code.
-                //
-                public override bool IsDefined(Type attributeType, bool inherit)
-                {
-                    bool isDefined = _info.IsDefined(attributeType, inherit);
-                    if (!isDefined) isDefined = _type.IsDefinedInTable(attributeType, _info, inherit);
-                    return isDefined;
-                }
-            }
-
-            //
-            // A MethodInfo that provides our custom attributes.
-            //
-            private class MetadataMethodInfo : MethodInfo
-            {
-
-                private MethodInfo _info;
-                private MetadataType _type;
-                private AttributeMergeCache _cache;
-
-                internal MetadataMethodInfo(MethodInfo info, MetadataType type)
-                {
-                    _info = info;
-                    _type = type;
-                }
-
-                //
-                // MethodInfo overrides
-                //
-                public override ICustomAttributeProvider ReturnTypeCustomAttributes { get { return _info.ReturnTypeCustomAttributes; } }
-                public override MethodAttributes Attributes { get { return _info.Attributes; } }
-                public override MethodImplAttributes GetMethodImplementationFlags() { return _info.GetMethodImplementationFlags(); }
-                public override ParameterInfo[] GetParameters() { return _info.GetParameters(); }
-                public override object Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture) { return _info.Invoke(obj, invokeAttr, binder, parameters, culture); }
-                public override RuntimeMethodHandle MethodHandle { get { return _info.MethodHandle; } }
-                public override Type DeclaringType { get { return _info.DeclaringType; } }
-                public override string Name { get { return _info.Name; } }
-                public override Type ReflectedType { get { return _info.ReflectedType; } }
-                public override bool Equals(object obj) { return object.ReferenceEquals(this, obj); }
-                public override int GetHashCode() { return _info.GetHashCode(); }
-                public override CallingConventions CallingConvention { get { return _info.CallingConvention; } }
-                public override bool ContainsGenericParameters { get { return _info.ContainsGenericParameters; } }
-                public override MethodInfo GetBaseDefinition() { return _info.GetBaseDefinition(); }
-                public override Type[] GetGenericArguments() { return _info.GetGenericArguments(); }
-                public override MethodInfo GetGenericMethodDefinition() { return _info.GetGenericMethodDefinition(); }
-                public override MethodBody GetMethodBody() { return _info.GetMethodBody(); }
-                public override bool IsGenericMethod { get { return _info.IsGenericMethod; } }
-                public override bool IsGenericMethodDefinition { get { return _info.IsGenericMethodDefinition; } }
-                public override MethodInfo MakeGenericMethod(params Type[] typeArguments) { return _info.MakeGenericMethod(typeArguments); }
-                public override MemberTypes MemberType { get { return _info.MemberType; } }
-                public override int MetadataToken { get { return _info.MetadataToken; } }
-                public override Module Module { get { return _info.Module; } }
-                public override ParameterInfo ReturnParameter { get { return _info.ReturnParameter; } }
-                public override Type ReturnType { get { return _info.ReturnType; } }
-                public override string ToString() { return _info.ToString(); }
-
-                //
-                // Merges our custom attributes in with those of the member info.
-                //
-                public override object[] GetCustomAttributes(Type attributeType, bool inherit)
-                {
-                    return _type.MergeAttributes(attributeType, _info, inherit, ref _cache);
-                }
-
-                //
-                // Merges our custom attributes in with those of the member info.
-                //
-                public override object[] GetCustomAttributes(bool inherit)
-                {
-                    return _type.MergeAttributes(null, _info, inherit, ref _cache);
-                }
-
-                //
-                // Determines if an attribute exists in the member info
-                // or in our own code.
-                //
-                public override bool IsDefined(Type attributeType, bool inherit)
-                {
-                    bool isDefined = _info.IsDefined(attributeType, inherit);
-                    if (!isDefined) isDefined = _type.IsDefinedInTable(attributeType, _info, inherit);
-                    return isDefined;
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/OrderToken.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/OrderToken.cs
deleted file mode 100644 (file)
index 3d04de8..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-namespace System.Activities.Presentation
-{
-
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-    using System.Activities.Presentation;
-
-    /// <summary>
-    /// OrderToken is a generic class used to identify the sort
-    /// order of hierarchical items.  OrderTokens can be used
-    /// to define priority that is based on some predefined defaults or
-    /// based on other OrderTokens.
-    /// </summary>
-    abstract class OrderToken : IComparable<OrderToken>
-    {
-
-        private readonly OrderToken _reference;
-        private readonly OrderTokenPrecedence _precedence;
-        private readonly OrderTokenConflictResolution _conflictResolution;
-
-        private readonly int _depth;
-        private readonly int _index;
-        private int _nextChildIndex;
-
-        /// <summary>
-        /// Creates a new OrderToken instance based on the specified
-        /// referenced OrderToken, precedence, and conflict resolution
-        /// semantics.
-        /// </summary>
-        /// <param name="precedence">Precedence of this token based on the
-        /// referenced token.</param>
-        /// <param name="reference">Referenced token.  May be null for the
-        /// root token case (token that's not dependent on anything else).</param>
-        /// <param name="conflictResolution">Conflict resolution semantics.
-        /// Winning ConflictResultion semantic should only be used
-        /// on predefined, default OrderToken instances to ensure
-        /// their correct placement in more complex chain of order
-        /// dependencies.</param>
-        protected OrderToken(
-            OrderTokenPrecedence precedence,
-            OrderToken reference,
-            OrderTokenConflictResolution conflictResolution)
-        {
-
-            if (!EnumValidator.IsValid(precedence)) throw FxTrace.Exception.AsError(new ArgumentOutOfRangeException("precedence"));
-            if (!EnumValidator.IsValid(conflictResolution)) throw FxTrace.Exception.AsError(new ArgumentOutOfRangeException("conflictResolution"));
-
-            _reference = reference;
-            _precedence = precedence;
-            _conflictResolution = conflictResolution;
-            _depth = reference == null ? 0 : reference._depth + 1;
-            _index = reference == null ? -1 : reference._nextChildIndex++;
-        }
-
-        /// <summary>
-        /// Compares this order token with the specified order token.
-        /// The comparsion for OrderTokens that don't belong to the same
-        /// chain of OrderTokens will be resolved non-deterministically.
-        /// </summary>
-        /// <param name="other">The token to compare this token to.</param>
-        /// <returns>0 when the tokens have an equal order priority,
-        /// -1 if this order comes before the specified order,
-        /// 1 otherwise.</returns>
-        /// <exception cref="ArgumentNullException">When other is null</exception>
-        public virtual int CompareTo(OrderToken other)
-        {
-
-            if (other == null)
-                throw FxTrace.Exception.ArgumentNull("other");
-
-            if (other == this)
-                return 0;
-
-            OrderToken thisOrder = this;
-
-            // Find a common parent
-            while (thisOrder._reference != other._reference)
-            {
-
-                if (thisOrder._depth == other._depth)
-                {
-                    thisOrder = thisOrder._reference;
-                    other = other._reference;
-                }
-                else
-                {
-                    if (thisOrder._depth > other._depth)
-                    {
-                        if (thisOrder._reference == other) return thisOrder._precedence == OrderTokenPrecedence.After ? 1 : -1;
-                        thisOrder = thisOrder._reference;
-                    }
-                    else
-                    {
-                        if (other._reference == thisOrder) return other._precedence == OrderTokenPrecedence.After ? -1 : 1;
-                        other = other._reference;
-                    }
-                }
-            }
-
-            // One order "before", one order "after"?  Easy, return the
-            // "before" order.
-            if (thisOrder._precedence != other._precedence)
-                return thisOrder._precedence == OrderTokenPrecedence.Before ? -1 : 1;
-
-            // Both orders "before" the parent?  Roots win, otherwise call ResolveConflict().
-            if (thisOrder._precedence == OrderTokenPrecedence.Before)
-            {
-                if (thisOrder._conflictResolution == OrderTokenConflictResolution.Win)
-                    return -1;
-                else if (other._conflictResolution == OrderTokenConflictResolution.Win)
-                    return 1;
-                return ResolveConflict(thisOrder, other);
-            }
-
-            // Both orders "after" the parent?  Roots win, otherwise call ResolveConflict().
-            if (thisOrder._conflictResolution == OrderTokenConflictResolution.Win)
-                return 1;
-            else if (other._conflictResolution == OrderTokenConflictResolution.Win)
-                return -1;
-            return ResolveConflict(thisOrder, other);
-        }
-
-        /// <summary>
-        /// This method is called by CompareTo()'s default implementation when two OrderTokens
-        /// appear to be equivalent.  The base functionality of this method uses the instantiation
-        /// order of the two tokens as a tie-breaker.  Override this method to
-        /// implement custom algorithms.  Note that if this method ever returns 0
-        /// (indicating that the two tokens are equivalent) and if these tokens
-        /// belong to a list that gets sorted multiple times, the relative order in
-        /// which they appear in the list will not be guaranteed.  This side-effect
-        /// may or may not be a problem depending on the application.
-        /// </summary>
-        /// <param name="left">Left OrderToken</param>
-        /// <param name="right">Right OrderToken</param>
-        /// <returns>0, if the two are equal, -1, if left comes before right, 
-        /// 1 otherwise.</returns>
-        protected virtual int ResolveConflict(OrderToken left, OrderToken right)
-        {
-            return left._index.CompareTo(right._index);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/OrderTokenConflictResolution.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/OrderTokenConflictResolution.cs
deleted file mode 100644 (file)
index ed6f1d6..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-namespace System.Activities.Presentation {
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-
-    /// <summary>
-    /// Enum used to specify the winner of ordering ties.
-    /// Winning ConflictResultion marker should only be used
-    /// on predefined, default OrderToken instances to ensure
-    /// their correct placement in more complex chain of order
-    /// dependencies.
-    /// </summary>
-    enum OrderTokenConflictResolution {
-
-        /// <summary>
-        /// Indicates that this token should win during conflicts.
-        /// </summary>
-        Win,
-
-        /// <summary>
-        /// Indicates that this token should lose during conflicts.  
-        /// If two tokens are compared that are equivalent and both of 
-        /// which have their ConflictResolution set to Win, they will
-        /// be considered equal.
-        /// </summary>
-        Lose
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/OrderTokenPrecedence.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/OrderTokenPrecedence.cs
deleted file mode 100644 (file)
index 9696263..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-namespace System.Activities.Presentation {
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-
-    /// <summary>
-    /// Precedence specifies the precedence of order tokens.
-    /// </summary>
-    enum OrderTokenPrecedence {
-
-        /// <summary>
-        /// Indicates that this token comes before
-        /// </summary>
-        Before,
-
-        /// <summary>
-        /// Indicates that this token comes after
-        /// </summary>
-        After
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Properties/Resources.Designer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Properties/Resources.Designer.cs
deleted file mode 100644 (file)
index 7f3a865..0000000
+++ /dev/null
@@ -1,775 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.1433
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Internal.Properties {
-    using System;
-    
-    
-    /// <summary>
-    ///   A strongly-typed resource class, for looking up localized strings, etc.
-    /// </summary>
-    // This class was auto-generated by the StronglyTypedResourceBuilder
-    // class via a tool like ResGen or Visual Studio.
-    // To add or remove a member, edit your .ResX file then rerun ResGen
-    // with the /str option, or rebuild your VS project.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class Resources {
-        
-        private static global::System.Resources.ResourceManager resourceMan;
-        
-        private static global::System.Globalization.CultureInfo resourceCulture;
-        
-        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal Resources() {
-        }
-        
-        /// <summary>
-        ///   Returns the cached ResourceManager instance used by this class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager {
-            get {
-                if (object.ReferenceEquals(resourceMan, null)) {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Activities.Presentation.Properties." +
-                            "Resources", typeof(Resources).Assembly);
-                    resourceMan = temp;
-                }
-                return resourceMan;
-            }
-        }
-        
-        /// <summary>
-        ///   Overrides the current thread's CurrentUICulture property for all
-        ///   resource lookups using this strongly typed resource class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture {
-            get {
-                return resourceCulture;
-            }
-            set {
-                resourceCulture = value;
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The argument &apos;{0}&apos; must be of type &apos;{1}&apos;..
-        /// </summary>
-        internal static string Error_ArgIncorrectType {
-            get {
-                return ResourceManager.GetString("Error_ArgIncorrectType", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Cannot convert Value to string..
-        /// </summary>
-        internal static string Error_CannotConvertValueToString {
-            get {
-                return ResourceManager.GetString("Error_CannotConvertValueToString", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Cannot update Value from StringValue..
-        /// </summary>
-        internal static string Error_CannotUpdateValueFromStringValue {
-            get {
-                return ResourceManager.GetString("Error_CannotUpdateValueFromStringValue", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The context item type &apos;{0}&apos; derives from the base item type of &apos;{1}&apos;.  Always pass a the base context item type..
-        /// </summary>
-        internal static string Error_DerivedContextItem {
-            get {
-                return ResourceManager.GetString("Error_DerivedContextItem", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The service &apos;{0}&apos; has already been published by another object..
-        /// </summary>
-        internal static string Error_DuplicateService {
-            get {
-                return ResourceManager.GetString("Error_DuplicateService", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The ModelEditingScope has already been reverted..
-        /// </summary>
-        internal static string Error_EditingScopeReverted {
-            get {
-                return ResourceManager.GetString("Error_EditingScopeReverted", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The ModelEditingScope has already been completed..
-        /// </summary>
-        internal static string Error_EdtingScopeCompleted {
-            get {
-                return ResourceManager.GetString("Error_EdtingScopeCompleted", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The enumeration either has ended or has not yet been started..
-        /// </summary>
-        internal static string Error_EnumerationNotReady {
-            get {
-                return ResourceManager.GetString("Error_EnumerationNotReady", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to An object &apos;{0}&apos; has published a service of type &apos;{1}&apos; but the service instance was returned as &apos;{2}&apos;..
-        /// </summary>
-        internal static string Error_IncorrectServiceType {
-            get {
-                return ResourceManager.GetString("Error_IncorrectServiceType", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The argument &apos;{0}&apos; must be of type &apos;{1}&apos;..
-        /// </summary>
-        internal static string Error_InvalidArgumentType {
-            get {
-                return ResourceManager.GetString("Error_InvalidArgumentType", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The index &apos;{0}&apos; is beyond the bounds of the array..
-        /// </summary>
-        internal static string Error_InvalidArrayIndex {
-            get {
-                return ResourceManager.GetString("Error_InvalidArrayIndex", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to FactoryType must be set to a type that derives from NewItemFactory..
-        /// </summary>
-        internal static string Error_InvalidFactoryType {
-            get {
-                return ResourceManager.GetString("Error_InvalidFactoryType", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The method &apos;{0}&apos; has returned null, but that is not allowed in the implementation..
-        /// </summary>
-        internal static string Error_NullImplementation {
-            get {
-                return ResourceManager.GetString("Error_NullImplementation", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to An object &apos;{0}&apos; has published a service of type &apos;{1}&apos; but the returned instance was null..
-        /// </summary>
-        internal static string Error_NullService {
-            get {
-                return ResourceManager.GetString("Error_NullService", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Expected e.Parameter to be non-null and to be a PropertyValue. CommandParameter should have a Binding to the PropertyValue..
-        /// </summary>
-        internal static string Error_PropertyValueEditor_InvalidDialogValueEditorCommandInvocation {
-            get {
-                return ResourceManager.GetString("Error_PropertyValueEditor_InvalidDialogValueEditorCommandInvocation", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Expected PropertyValue.OwningEditor to be non-null and to be a subclass of PropertyValueEditorDialogBase..
-        /// </summary>
-        internal static string Error_PropertyValueEditor_InvalidDialogValueEditorEditorValue {
-            get {
-                return ResourceManager.GetString("Error_PropertyValueEditor_InvalidDialogValueEditorEditorValue", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to While resolving the service &apos;{0}&apos; a recursive request was made for the same service..
-        /// </summary>
-        internal static string Error_RecursionResolvingService {
-            get {
-                return ResourceManager.GetString("Error_RecursionResolvingService", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to This feature requires service &apos;{0}&apos; to be present, but it could not be located..
-        /// </summary>
-        internal static string Error_RequiredService {
-            get {
-                return ResourceManager.GetString("Error_RequiredService", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Validation of the attribute table has failed..
-        /// </summary>
-        internal static string Error_TableValidationFailed {
-            get {
-                return ResourceManager.GetString("Error_TableValidationFailed", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The tool &apos;{0}&apos; is already active in this editing context.  You cannot activate the same instance of a task tool more than once..
-        /// </summary>
-        internal static string Error_ToolAlreadyActive {
-            get {
-                return ResourceManager.GetString("Error_ToolAlreadyActive", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to MemberDescriptors of type &apos;{0}&apos; are not supported..
-        /// </summary>
-        internal static string Error_UnknownMemberDescriptor {
-            get {
-                return ResourceManager.GetString("Error_UnknownMemberDescriptor", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The member named &apos;{0}&apos; was found as both a property and an event on type &apos;{1}&apos;.  Members with the same name are not supported..
-        /// </summary>
-        internal static string Error_ValidationAmbiguousMember {
-            get {
-                return ResourceManager.GetString("Error_ValidationAmbiguousMember", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The member named &apos;{0}&apos; does not exist on type &apos;{1}&apos;..
-        /// </summary>
-        internal static string Error_ValidationNoMatchingMember {
-            get {
-                return ResourceManager.GetString("Error_ValidationNoMatchingMember", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Get of Value failed..
-        /// </summary>
-        internal static string Error_ValueGetFailed {
-            get {
-                return ResourceManager.GetString("Error_ValueGetFailed", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Set of Value failed..
-        /// </summary>
-        internal static string Error_ValueSetFailed {
-            get {
-                return ResourceManager.GetString("Error_ValueSetFailed", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Can only set FocusScopePriority on an element that is a FocusScope..
-        /// </summary>
-        internal static string FromExpression_CanOnlySetFocusScopePriorityOnAnElementThatIsAFocusScope {
-            get {
-                return ResourceManager.GetString("FromExpression_CanOnlySetFocusScopePriorityOnAnElementThatIsAFocusScope", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Loading CategoryEditor type threw an exception: {0}.
-        /// </summary>
-        internal static string FromExpression_CategoryEditorTypeLoadFailed {
-            get {
-                return ResourceManager.GetString("FromExpression_CategoryEditorTypeLoadFailed", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Category {0} returned invalid category icon: {1}.
-        /// </summary>
-        internal static string FromExpression_CategoryIconLoadFailed {
-            get {
-                return ResourceManager.GetString("FromExpression_CategoryIconLoadFailed", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to CollectionItemFactory {0} threw an exception: {1}.
-        /// </summary>
-        internal static string FromExpression_CollectionDialogEditorCollectionItemFactoryInstantiateFailed {
-            get {
-                return ResourceManager.GetString("FromExpression_CollectionDialogEditorCollectionItemFactoryInstantiateFailed", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The method or operation is not implemented..
-        /// </summary>
-        internal static string FromExpression_MethodOrOperationIsNotImplemented {
-            get {
-                return ResourceManager.GetString("FromExpression_MethodOrOperationIsNotImplemented", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to NewItemFactory {0} GetImage() threw an exception: {1}.
-        /// </summary>
-        internal static string FromExpression_NewItemFactoryIconLoadFailed {
-            get {
-                return ResourceManager.GetString("FromExpression_NewItemFactoryIconLoadFailed", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to No ConvertBack for ValueToIcon converter..
-        /// </summary>
-        internal static string FromExpression_NoConvertBackForValueToIconConverter {
-            get {
-                return ResourceManager.GetString("FromExpression_NoConvertBackForValueToIconConverter", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to A SwitchConverter cannot be used for a two-way bind..
-        /// </summary>
-        internal static string FromExpression_SwitchConverterIsOneWay {
-            get {
-                return ResourceManager.GetString("FromExpression_SwitchConverterIsOneWay", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Unexpected brush type {0}..
-        /// </summary>
-        internal static string FromExpression_UnexpectedBrushType {
-            get {
-                return ResourceManager.GetString("FromExpression_UnexpectedBrushType", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Unexpected drawing type {0}..
-        /// </summary>
-        internal static string FromExpression_UnexpectedDrawingType {
-            get {
-                return ResourceManager.GetString("FromExpression_UnexpectedDrawingType", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Unexpected image source type {0}..
-        /// </summary>
-        internal static string FromExpression_UnexpectedImageSourceType {
-            get {
-                return ResourceManager.GetString("FromExpression_UnexpectedImageSourceType", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Loading ValueEditor threw an exception: {0}.
-        /// </summary>
-        internal static string FromExpression_ValueEditorLoadFailed {
-            get {
-                return ResourceManager.GetString("FromExpression_ValueEditorLoadFailed", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Failed to load metadata assembly {0}.  Exception message: {1}.  Stack Trace: {2}.
-        /// </summary>
-        internal static string MetadataPluginLog_ErrorFailedToLoadMetadataAssembly {
-            get {
-                return ResourceManager.GetString("MetadataPluginLog_ErrorFailedToLoadMetadataAssembly", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to All Properties.
-        /// </summary>
-        internal static string PropertyCategoryAllProperties {
-            get {
-                return ResourceManager.GetString("PropertyCategoryAllProperties", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Advanced Category Editors.
-        /// </summary>
-        internal static string PropertyEditing_AdvancedCategoryEditors {
-            get {
-                return ResourceManager.GetString("PropertyEditing_AdvancedCategoryEditors", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Alphabetical.
-        /// </summary>
-        internal static string PropertyEditing_AlphabeticalCaption {
-            get {
-                return ResourceManager.GetString("PropertyEditing_AlphabeticalCaption", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Basic Category Editors.
-        /// </summary>
-        internal static string PropertyEditing_BasicCategoryEditors {
-            get {
-                return ResourceManager.GetString("PropertyEditing_BasicCategoryEditors", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Categorized.
-        /// </summary>
-        internal static string PropertyEditing_CategorizedCaption {
-            get {
-                return ResourceManager.GetString("PropertyEditing_CategorizedCaption", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Category container contains properties associated with a specific categories, along with any of its editors..
-        /// </summary>
-        internal static string PropertyEditing_CategoryContainerAutomationPeerHelp {
-            get {
-                return ResourceManager.GetString("PropertyEditing_CategoryContainerAutomationPeerHelp", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Category List.
-        /// </summary>
-        internal static string PropertyEditing_CategoryList {
-            get {
-                return ResourceManager.GetString("PropertyEditing_CategoryList", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Clear.
-        /// </summary>
-        internal static string PropertyEditing_ClearButtonCaption {
-            get {
-                return ResourceManager.GetString("PropertyEditing_ClearButtonCaption", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Cannot clear the value of an item in a collection..
-        /// </summary>
-        internal static string PropertyEditing_ClearIndexer {
-            get {
-                return ResourceManager.GetString("PropertyEditing_ClearIndexer", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Collection Editor: {0}.
-        /// </summary>
-        internal static string PropertyEditing_CollectionEditorTitle {
-            get {
-                return ResourceManager.GetString("PropertyEditing_CollectionEditorTitle", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to {0}.
-        /// </summary>
-        internal static string PropertyEditing_CollectionItemDisplayFormatType {
-            get {
-                return ResourceManager.GetString("PropertyEditing_CollectionItemDisplayFormatType", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to {0} ({1}).
-        /// </summary>
-        internal static string PropertyEditing_CollectionItemDisplayFormatTypeAndName {
-            get {
-                return ResourceManager.GetString("PropertyEditing_CollectionItemDisplayFormatTypeAndName", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to (Array).
-        /// </summary>
-        internal static string PropertyEditing_DefaultArrayStringValue {
-            get {
-                return ResourceManager.GetString("PropertyEditing_DefaultArrayStringValue", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to (Collection).
-        /// </summary>
-        internal static string PropertyEditing_DefaultCollectionStringValue {
-            get {
-                return ResourceManager.GetString("PropertyEditing_DefaultCollectionStringValue", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to (Enumerable).
-        /// </summary>
-        internal static string PropertyEditing_DefaultEnumerableStringValue {
-            get {
-                return ResourceManager.GetString("PropertyEditing_DefaultEnumerableStringValue", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Unexpected error occurred in value dialog editor..
-        /// </summary>
-        internal static string PropertyEditing_DialogError {
-            get {
-                return ResourceManager.GetString("PropertyEditing_DialogError", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Property Editor: {0}.
-        /// </summary>
-        internal static string PropertyEditing_DialogValueEditorTitle {
-            get {
-                return ResourceManager.GetString("PropertyEditing_DialogValueEditorTitle", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Collection cannot contain two or more items with the same name (&apos;{0}&apos;)..
-        /// </summary>
-        internal static string PropertyEditing_DuplicateNameInCollection {
-            get {
-                return ResourceManager.GetString("PropertyEditing_DuplicateNameInCollection", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Cannot abort a transaction because none have been opened..
-        /// </summary>
-        internal static string PropertyEditing_ErrorAbort_NoTransactionsOpened {
-            get {
-                return ResourceManager.GetString("PropertyEditing_ErrorAbort_NoTransactionsOpened", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Cannot commit a transaction because none have been opened..
-        /// </summary>
-        internal static string PropertyEditing_ErrorCommit_NoTransactionsOpened {
-            get {
-                return ResourceManager.GetString("PropertyEditing_ErrorCommit_NoTransactionsOpened", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to PropertyValues in a collection are read-only.  Use PropertyValueCollection APIs to manipulate the collection itself..
-        /// </summary>
-        internal static string PropertyEditing_ErrorSetValueOnIndexer {
-            get {
-                return ResourceManager.GetString("PropertyEditing_ErrorSetValueOnIndexer", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Cannot update PropertyValue because it is no longer part of a valid collection..
-        /// </summary>
-        internal static string PropertyEditing_InvalidIndexer {
-            get {
-                return ResourceManager.GetString("PropertyEditing_InvalidIndexer", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Multiple objects selected.
-        /// </summary>
-        internal static string PropertyEditing_MultipleObjectsSelected {
-            get {
-                return ResourceManager.GetString("PropertyEditing_MultipleObjectsSelected", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Multiple types selected.
-        /// </summary>
-        internal static string PropertyEditing_MultipleTypesSelected {
-            get {
-                return ResourceManager.GetString("PropertyEditing_MultipleTypesSelected", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Element rename.
-        /// </summary>
-        internal static string PropertyEditing_NameChangeUndoText {
-            get {
-                return ResourceManager.GetString("PropertyEditing_NameChangeUndoText", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to {0}:.
-        /// </summary>
-        internal static string PropertyEditing_NamePropertyDisplayFormat {
-            get {
-                return ResourceManager.GetString("PropertyEditing_NamePropertyDisplayFormat", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to The specified name could not be set..
-        /// </summary>
-        internal static string PropertyEditing_NameSetError {
-            get {
-                return ResourceManager.GetString("PropertyEditing_NameSetError", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Property &apos;{0}&apos; does not support String to Value conversion..
-        /// </summary>
-        internal static string PropertyEditing_NoStringToValueConversion {
-            get {
-                return ResourceManager.GetString("PropertyEditing_NoStringToValueConversion", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Properties Window.
-        /// </summary>
-        internal static string PropertyEditing_PropertyInspector {
-            get {
-                return ResourceManager.GetString("PropertyEditing_PropertyInspector", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to PropertyInspector lists properties of all selected objects and allows the user to view and change them as needed..
-        /// </summary>
-        internal static string PropertyEditing_PropertyInspectorAutomationPeerHelp {
-            get {
-                return ResourceManager.GetString("PropertyEditing_PropertyInspectorAutomationPeerHelp", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Selected Category: {0} (advanced properties).
-        /// </summary>
-        internal static string PropertyEditing_SelectionStatus_AdvancedCategory {
-            get {
-                return ResourceManager.GetString("PropertyEditing_SelectionStatus_AdvancedCategory", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Selected Category: {0}.
-        /// </summary>
-        internal static string PropertyEditing_SelectionStatus_Category {
-            get {
-                return ResourceManager.GetString("PropertyEditing_SelectionStatus_Category", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Selected Category Editor: {0}.
-        /// </summary>
-        internal static string PropertyEditing_SelectionStatus_CategoryEditor {
-            get {
-                return ResourceManager.GetString("PropertyEditing_SelectionStatus_CategoryEditor", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Nothing Selected.
-        /// </summary>
-        internal static string PropertyEditing_SelectionStatus_Empty {
-            get {
-                return ResourceManager.GetString("PropertyEditing_SelectionStatus_Empty", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Selected Property: {0}.
-        /// </summary>
-        internal static string PropertyEditing_SelectionStatus_Property {
-            get {
-                return ResourceManager.GetString("PropertyEditing_SelectionStatus_Property", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Unknown Selection: {0}.
-        /// </summary>
-        internal static string PropertyEditing_SelectionStatus_Unknown {
-            get {
-                return ResourceManager.GetString("PropertyEditing_SelectionStatus_Unknown", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Property value is not valid.
-        /// </summary>
-        internal static string PropertyEditing_SetError {
-            get {
-                return ResourceManager.GetString("PropertyEditing_SetError", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to SubPropertyEditor.
-        /// </summary>
-        internal static string PropertyEditing_SubPropertyEditorAutomationName {
-            get {
-                return ResourceManager.GetString("PropertyEditing_SubPropertyEditorAutomationName", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Change to {0} property..
-        /// </summary>
-        internal static string PropertyEditing_UndoText {
-            get {
-                return ResourceManager.GetString("PropertyEditing_UndoText", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Invalid value for property &apos;{0}&apos;: &apos;{1}&apos;.
-        /// </summary>
-        internal static string PropertyEditing_ValidationFailed {
-            get {
-                return ResourceManager.GetString("PropertyEditing_ValidationFailed", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to Create new &apos;{0}&apos;.
-        /// </summary>
-        internal static string ToolDescription_CreateInstance {
-            get {
-                return ResourceManager.GetString("ToolDescription_CreateInstance", resourceCulture);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/CategoryEditor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/CategoryEditor.cs
deleted file mode 100644 (file)
index 1a164ab..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing {
-    using System;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Globalization;
-    using System.Text;
-    using System.Windows;
-    using System.Windows.Media;
-    using System.Activities.Presentation.Internal.Properties;
-    using System.Activities.Presentation;
-
-    /// <summary>
-    /// Derive this class to provide a custom CategoryEditor for a set of Properties in a property
-    /// browser host.
-    /// </summary>
-    public abstract class CategoryEditor {
-
-        /// <summary>
-        /// This method is called once for each property in the category to determine which properties
-        /// are edited by this CategoryEditor.  When a property is consumed by a CategoryEditor, it does
-        /// not show up as a separate row in that category.
-        /// </summary>
-        /// <param name="propertyEntry">The PropertyEntry to check to see if its edited by this CategoryEditor</param>
-        /// <returns>true if this editor edits that property, otherwise false</returns>
-        public abstract bool ConsumesProperty(PropertyEntry propertyEntry);
-
-        /// <summary>
-        /// Returns a localized string that indicates which category this editor belongs to. CategoryEditors are
-        /// defined on types and, thus, at load time they need to indicate the actual category they belong to.
-        /// </summary>
-        public abstract string TargetCategory { get; }
-
-        /// <summary>
-        /// Returns a DataTemplate that is hosted by the PropertyInspector as the UI for a CategoryEditor.
-        /// The DataSource of this DataTemplate is set to a CategoryEntry.
-        /// </summary>
-        public abstract DataTemplate EditorTemplate { get; }
-
-        /// <summary>
-        /// Returns an object that the host can place into a ContentControl in order to display it.
-        /// This icon may be used to adorn the editor for this category in
-        /// a collapsed mode, should it support one.
-        /// </summary>
-        /// <param name="desiredSize">The desired size of the image to return.  This method should make
-        /// the best attempt in matching the requested size, but it doesn't guarantee it.</param>
-        public abstract object GetImage(Size desiredSize);
-
-        /// <summary>
-        /// Utility method that creates a new EditorAttribute for the specified
-        /// CategoryEditor
-        /// </summary>
-        /// <param name="editor">CategoryEditor instance for which to create
-        /// the new EditorAttribute</param>
-        /// <returns>New EditorAttribute for the specified CategoryEditor</returns>
-        public static EditorAttribute CreateEditorAttribute(CategoryEditor editor) {
-            if (editor == null)
-                throw FxTrace.Exception.ArgumentNull("editor");
-
-            return CreateEditorAttribute(editor.GetType());
-        }
-
-        /// <summary>
-        /// Utility method that creates a new EditorAttribute for the specified
-        /// CategoryEditor type
-        /// </summary>
-        /// <param name="categoryEditorType">CategoryEditor type for which to create
-        /// the new EditorAttribute</param>
-        /// <returns>New EditorAttribute for the specified CategoryEditor type</returns>
-        public static EditorAttribute CreateEditorAttribute(Type categoryEditorType) {
-            if (categoryEditorType == null)
-                throw FxTrace.Exception.ArgumentNull("categoryEditorType");
-
-            if (!typeof(CategoryEditor).IsAssignableFrom(categoryEditorType))
-                throw FxTrace.Exception.AsError(new ArgumentException(
-                    string.Format(
-                        CultureInfo.CurrentCulture,
-                        Resources.Error_ArgIncorrectType,
-                        "categoryEditorType",
-                        typeof(CategoryEditor).Name)));
-
-            return new EditorAttribute(categoryEditorType, categoryEditorType);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/DependencyPropertyValueSource.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/DependencyPropertyValueSource.cs
deleted file mode 100644 (file)
index 29f97b7..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing {
-    using System;
-
-    using System.Runtime;
-
-    /// <summary>
-    /// Concrete implementation of PropertyValueSource for a PropertyEntry that represents a Dependency Property
-    /// </summary>
-    [Fx.Tag.XamlVisible(false)]
-    public class DependencyPropertyValueSource : PropertyValueSource
-    {
-
-        private static DependencyPropertyValueSource _dataBound;
-        private static DependencyPropertyValueSource _systemResource;
-        private static DependencyPropertyValueSource _localDynamicResource;
-        private static DependencyPropertyValueSource _localStaticResource;
-        private static DependencyPropertyValueSource _templateBinding;
-        private static DependencyPropertyValueSource _customMarkupExtension;
-        private static DependencyPropertyValueSource _local;
-        private static DependencyPropertyValueSource _defaultValue;
-        private static DependencyPropertyValueSource _inherited;
-
-        private readonly ValueSource _source;
-
-        /// <summary>
-        /// The property is set to a value that is a data binding.
-        /// </summary>
-        public static DependencyPropertyValueSource DataBound {
-            get {
-                if (_dataBound == null) _dataBound = new DependencyPropertyValueSource(ValueSource.DataBound);
-                return _dataBound;
-            }
-        }
-
-        /// <summary>
-        /// The property is set to a system resource.
-        /// </summary>
-        public static DependencyPropertyValueSource SystemResource {
-            get {
-                if (_systemResource == null) _systemResource = new DependencyPropertyValueSource(ValueSource.SystemResource);
-                return _systemResource;
-            }
-        }
-
-        /// <summary>
-        /// The property is set to a DynamicResource reference.
-        /// </summary>
-        public static DependencyPropertyValueSource LocalDynamicResource {
-            get {
-                if (_localDynamicResource == null) _localDynamicResource = new DependencyPropertyValueSource(ValueSource.LocalDynamicResource);
-                return _localDynamicResource;
-            }
-        }
-
-        /// <summary>
-        /// The property is set to a StaticResource reference.
-        /// </summary>
-        public static DependencyPropertyValueSource LocalStaticResource {
-            get {
-                if (_localStaticResource == null) _localStaticResource = new DependencyPropertyValueSource(ValueSource.LocalStaticResource);
-                return _localStaticResource;
-            }
-        }
-
-        /// <summary>
-        /// The property is set to a TemplateBinding markup extension.
-        /// </summary>
-        public static DependencyPropertyValueSource TemplateBinding {
-            get {
-                if (_templateBinding == null) _templateBinding = new DependencyPropertyValueSource(ValueSource.TemplateBinding);
-                return _templateBinding;
-            }
-        }
-
-        /// <summary>
-        /// The property is set to a custom markup extension.
-        /// </summary>
-        public static DependencyPropertyValueSource CustomMarkupExtension {
-            get {
-                if (_customMarkupExtension == null) _customMarkupExtension = new DependencyPropertyValueSource(ValueSource.CustomMarkupExtension);
-                return _customMarkupExtension;
-            }
-        }
-
-        /// <summary>
-        /// The property is set to a local value.
-        /// </summary>
-        public static DependencyPropertyValueSource Local {
-            get {
-                if (_local == null) _local = new DependencyPropertyValueSource(ValueSource.Local);
-                return _local;
-            }
-        }
-
-        /// <summary>
-        /// The property is set to its default value (ie. it does not have a value set in XAML and 
-        /// it's not inheriting any value from its parent)
-        /// </summary>
-        public static DependencyPropertyValueSource DefaultValue {
-            get {
-                if (_defaultValue == null) _defaultValue = new DependencyPropertyValueSource(ValueSource.DefaultValue);
-                return _defaultValue;
-            }
-        }
-
-        /// <summary>
-        /// The property is inherited from a parent property.
-        /// </summary>
-        public static DependencyPropertyValueSource Inherited {
-            get {
-                if (_inherited == null) _inherited = new DependencyPropertyValueSource(ValueSource.Inherited);
-                return _inherited;
-            }
-        }
-
-        private DependencyPropertyValueSource(ValueSource source) {
-            _source = source;
-        }
-
-        /// <summary>
-        /// Read-only property that returns true if the property is set to an expression 
-        /// i.e. (DataBound, LocalDynamicResource, LocalStaticResource, SystemResource, TemplateBinding or
-        /// CustomMarkupExtension)
-        /// </summary>
-        public bool IsExpression {
-            get {
-                return _source == ValueSource.DataBound
-                    || _source == ValueSource.LocalDynamicResource
-                    || _source == ValueSource.LocalStaticResource
-                    || _source == ValueSource.SystemResource
-                    || _source == ValueSource.TemplateBinding
-                    || _source == ValueSource.CustomMarkupExtension;
-            }
-        }
-
-        /// <summary>
-        /// Read-only property that returns true if the property is set to a system or local resource
-        /// </summary>
-        public bool IsResource {
-            get {
-                return _source == ValueSource.SystemResource
-                    || _source == ValueSource.LocalDynamicResource
-                    || _source == ValueSource.LocalStaticResource;
-            }
-        }
-
-        /// <summary>
-        /// Read-only property that returns true if the property is set to a data binding expression.
-        /// </summary>
-        public bool IsDataBound {
-            get { return _source == ValueSource.DataBound; }
-        }
-
-        /// <summary>
-        /// Read-only property that returns true if the property is set to a system resource
-        /// </summary>
-        public bool IsSystemResource {
-            get { return _source == ValueSource.SystemResource; }
-        }
-
-        /// <summary>
-        /// Read-only property that returns true if the property is set to a DynamicResource
-        /// </summary>
-        public bool IsLocalResource {
-            get {
-                return _source == ValueSource.LocalDynamicResource
-                || _source == ValueSource.LocalStaticResource;
-            }
-        }
-
-        /// <summary>
-        /// Read-only property that returns true if the property is set to a TemplateBinding markup extension
-        /// </summary>
-        public bool IsTemplateBinding {
-            get { return _source == ValueSource.TemplateBinding; }
-        }
-
-        /// <summary>
-        /// Read-only property that returns true if the property is set to a custom markup extension.
-        /// </summary>
-        public bool IsCustomMarkupExtension {
-            get { return _source == ValueSource.CustomMarkupExtension; }
-        }
-
-        /// <summary>
-        /// Read-only property that returns true if the property is set to a local value.
-        /// </summary>
-        public bool IsLocal {
-            get { return _source == ValueSource.Local; }
-        }
-
-        /// <summary>
-        /// Read-only property that returns true if the property is set to its default value 
-        /// (ie. it does not have a value set in XAML and it's not inheriting any value from
-        /// its parent)
-        /// </summary>
-        public bool IsDefaultValue {
-            get { return _source == ValueSource.DefaultValue; }
-        }
-
-        /// <summary>
-        /// Read-only property that returns true if the property is inherited.
-        /// </summary>
-        public bool IsInherited {
-            get { return _source == ValueSource.Inherited; }
-        }
-
-        private enum ValueSource {
-            DataBound,
-            SystemResource,
-            LocalDynamicResource,
-            LocalStaticResource,
-            TemplateBinding,
-            CustomMarkupExtension,
-            Local,
-            DefaultValue,
-            Inherited
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/DialogPropertyValueEditor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/DialogPropertyValueEditor.cs
deleted file mode 100644 (file)
index 260eeec..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing {
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-    using System.Windows;
-
-    using System.Runtime;
-
-    /// <summary>
-    /// Container for any and all dialog-editing logic for PropertyEntries.  This class can hold
-    /// either a DataTemplate for a dialog editor or custom logic that will be called when
-    /// the dialog is invoked.
-    /// </summary>
-    public class DialogPropertyValueEditor : PropertyValueEditor {
-
-        private DataTemplate _dialogEditorTemplate;
-
-        /// <summary>
-        /// Creates a DialogPropertyValueEditor
-        /// </summary>
-        public DialogPropertyValueEditor()
-            : this(null, null) { }
-
-        /// <summary>
-        /// Creates a DialogPropertyValueEditor
-        /// </summary>
-        /// <param name="dialogEditorTemplate">A DataTemplate that is hosted in a host specific dialog chrome
-        /// and has its DataContext set to the PropertyValue that corresponds to the property being edited.</param>
-        /// <param name="inlineEditorTemplate">A DataTemplate that is used for the inline editor UI.  If used,
-        /// its DataContext will be set to the PropertyValue that corresponds to the property being edited.</param>
-        public DialogPropertyValueEditor(DataTemplate dialogEditorTemplate, DataTemplate inlineEditorTemplate) 
-            : base(inlineEditorTemplate) {
-            _dialogEditorTemplate = dialogEditorTemplate;
-        }
-
-        /// <summary>
-        /// Gets or sets the DataTemplate that is hosted by a host specific dialog and has its DataContext set to
-        /// a PropertyValue.  If this property returns null, ShowDialog() will be called instead.
-        /// </summary>
-        [Fx.Tag.KnownXamlExternalAttribute]
-        public DataTemplate DialogEditorTemplate
-        {
-            get { return _dialogEditorTemplate; }
-            set { _dialogEditorTemplate = value; }
-        }
-
-        /// <summary>
-        /// This method is called when the DialogEditorTemplate is null and a dialog has been invoked by the user.
-        /// Overriding this method allows you to implement any custom dialog logic, such invoking existing
-        /// system dialogs.
-        /// </summary>
-        /// <param name="propertyValue">The PropertyValue for the property being edited</param>
-        /// <param name="commandSource">The IInputElement that can be used as a source for execution of
-        /// PropertyValueEditorCommands.  Since these commands get handled by the host and since custom
-        /// dialogs are not going to be part of that visual tree, the commandSource exposes an IInputElement
-        /// that is part of the host's visual tree and which, therefore, may be used to execute property
-        /// editing commands in such a way that they will be handled correctly.</param>
-        public virtual void ShowDialog(PropertyValue propertyValue, IInputElement commandSource) {
-        }
-
-        internal override DataTemplate GetPropertyValueEditor(PropertyContainerEditMode mode) {
-            return base.GetPropertyValueEditor(mode) ??
-                (mode == PropertyContainerEditMode.Dialog ? _dialogEditorTemplate : (DataTemplate)null);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/EditModeSwitchButton.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/EditModeSwitchButton.cs
deleted file mode 100644 (file)
index 68652bc..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing {
-    using System;
-    using System.Windows;
-    using System.Windows.Input;
-    using System.Windows.Controls;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Diagnostics;
-
-    /// <summary>
-    /// Convenience button that allows the user to switch between the different PropertyContainer modes.
-    /// This button is styled to follow the look and feel specific to the host application.  It can operate
-    /// in two modes - either it always executes a specified mode-switching command, or it adapts to
-    /// the current mode of the containing PropertyContainer and "does the right thing".  If set manually,
-    /// SyncModeToOwningContainer must be set to false and the mode-switching command needs to be specified
-    /// using the TargetEditMode property.  To set the mode automatically, SyncModeToOwningContainer must
-    /// be set to true in which case the TargetEditMode property is ignored.
-    /// </summary>
-    [SuppressMessage("Microsoft.Maintainability", "CA1501:AvoidExcessiveInheritance")]
-    public class EditModeSwitchButton : Button {
-
-        private PropertyContainer _owningContainer;
-        private bool _attachedToContainerEvents;
-
-        /// <summary>
-        /// Basic ctor
-        /// </summary>
-        [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
-        public EditModeSwitchButton() {
-            this.Loaded += new RoutedEventHandler(OnLoaded);
-            this.Unloaded += new RoutedEventHandler(OnUnloaded);
-            this.FontSize = SystemFonts.IconFontSize;
-            this.FontFamily = SystemFonts.IconFontFamily;
-            this.FontWeight = SystemFonts.IconFontWeight;
-        }
-
-        // TargetEditMode DP
-
-        /// <summary>
-        /// The mode to switch to when this control is clicked.  Only used when 
-        /// SyncModeToOwningContainer is set to false.  Defaults to Inline.
-        /// </summary>
-        public static readonly DependencyProperty TargetEditModeProperty = DependencyProperty.Register(
-            "TargetEditMode",
-            typeof(PropertyContainerEditMode),
-            typeof(EditModeSwitchButton),
-            new FrameworkPropertyMetadata(
-                PropertyContainerEditMode.Inline,
-                null,  // PropertyChangedCallback
-                new CoerceValueCallback(OnCoerceEditModeProperty)));
-
-        /// <summary>
-        /// The mode to switch to when this control is clicked.  Only used when 
-        /// SyncModeToOwningContainer is set to false.  Defaults to Inline.
-        /// </summary>
-        public PropertyContainerEditMode TargetEditMode {
-            get { return (PropertyContainerEditMode) this.GetValue(TargetEditModeProperty); }
-            set { this.SetValue(TargetEditModeProperty, value); }
-        }
-
-        private static object OnCoerceEditModeProperty(DependencyObject obj, object value) {
-
-            EditModeSwitchButton theThis = (EditModeSwitchButton) obj;
-
-            // [....] to the owning PropertyContainer only if requested to do so
-            if (!theThis.SyncModeToOwningContainer)
-                return value;
-
-            // Do we have an owning PropertyContainer?
-            if (theThis._owningContainer == null)
-                return value;
-
-            PropertyContainerEditMode newMode;
-            PropertyContainer owningContainer = theThis._owningContainer;
-
-            switch (owningContainer.ActiveEditMode) {
-                case PropertyContainerEditMode.Inline:
-                    // when clicked, have this button switch to extended popup mode
-                    // or dialog mode (dialog takes precedence)
-                    if (owningContainer.SupportsEditMode(PropertyContainerEditMode.Dialog))
-                        newMode = PropertyContainerEditMode.Dialog;
-                    else if (owningContainer.SupportsEditMode(PropertyContainerEditMode.ExtendedPopup))
-                        newMode = PropertyContainerEditMode.ExtendedPopup;
-                    else
-                        newMode = PropertyContainerEditMode.Inline;
-
-                    break;
-
-                case PropertyContainerEditMode.ExtendedPopup:
-                    // when clicked, have this button switch to extended pinned mode
-                    newMode = PropertyContainerEditMode.ExtendedPinned;
-                    break;
-
-                case PropertyContainerEditMode.ExtendedPinned:
-                    // when clicked, have this button switch to inline mode
-                    newMode = PropertyContainerEditMode.Inline;
-                    break;
-
-                case PropertyContainerEditMode.Dialog:
-                    // do nothing
-                    newMode = theThis.TargetEditMode;
-                    break;
-
-                default:
-                    Debug.Fail(string.Format(
-                        System.Globalization.CultureInfo.CurrentCulture,
-                        "ModeSwitchControl does not yet support PropertyContainerEditMode '{0}'.",
-                        owningContainer.ActiveEditMode.ToString()));
-                    newMode = (PropertyContainerEditMode) value;
-                    break;
-            }
-
-            return newMode;
-        }
-
-
-        // SyncModeToOwningContainer DP
-
-        /// <summary>
-        /// When set to true, the TargetEditMode will be calculated automatically to match the ActiveEditMode
-        /// of the owning PropertyContainer. Otherwise, the mode to switch to will be based on the
-        /// TargetEditMode property.
-        /// </summary>
-        public static readonly DependencyProperty SyncModeToOwningContainerProperty = DependencyProperty.Register(
-            "SyncModeToOwningContainer",
-            typeof(bool),
-            typeof(EditModeSwitchButton),
-            new FrameworkPropertyMetadata(true, new PropertyChangedCallback(OnSyncModeToOwningContainerChanged)));
-
-        /// <summary>
-        /// When set to true, the TargetEditMode will be calculated automatically to match the ActiveEditMode
-        /// of the owning PropertyContainer. Otherwise, the mode to switch to will be based on the
-        /// TargetEditMode property.
-        /// </summary>
-        public bool SyncModeToOwningContainer {
-            get { return (bool)this.GetValue(SyncModeToOwningContainerProperty); }
-            set { this.SetValue(SyncModeToOwningContainerProperty, value); }
-        }
-
-        // When the SyncModeToOwningContainer changes, we may need to update the current
-        // TargetEditMode
-        private static void OnSyncModeToOwningContainerChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) {
-            EditModeSwitchButton theThis = (EditModeSwitchButton)obj;
-            theThis.CoerceValue(TargetEditModeProperty);
-        }
-
-
-        /// <summary>
-        /// Called when any DependencyProperties of this Control change.  If you override
-        /// this method, call the base implementation first to preserve the desired functionality.
-        /// </summary>
-        /// <param name="e">Event args</param>
-        protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e) {
-            // Check to see if this control has changed (or gained or lost) its owning PropertyContainer.
-            // If so, it may need to update its state / appearance accordingly
-            if (e.Property == PropertyContainer.OwningPropertyContainerProperty) {
-                PropertyContainer oldContainer = (PropertyContainer)e.OldValue;
-                PropertyContainer newContainer = (PropertyContainer)e.NewValue;
-                _owningContainer = newContainer;
-
-                if (oldContainer != null)
-                    DisassociateContainerEventHandlers(oldContainer);
-
-                if (newContainer != null)
-                    AssociateContainerEventHandlers(newContainer);
-
-                this.CoerceValue(TargetEditModeProperty);
-            }
-
-            base.OnPropertyChanged(e);
-        }
-
-        private void OnPropertyContainerDependencyPropertyChanged(object sender, DependencyPropertyChangedEventArgs e) {
-            // All of these properties changing have the potential of affecting the appearance
-            // of this control
-            if (e.Property == PropertyContainer.ActiveEditModeProperty ||
-                e.Property == PropertyContainer.PropertyEntryProperty ||
-                e.Property == PropertyContainer.DefaultStandardValuesPropertyValueEditorProperty ||
-                e.Property == PropertyContainer.DefaultPropertyValueEditorProperty) {
-
-                this.CoerceValue(TargetEditModeProperty);
-            }
-        }
-
-        private void AssociateContainerEventHandlers(PropertyContainer container) {
-            if (!_attachedToContainerEvents) {
-                container.DependencyPropertyChanged += new DependencyPropertyChangedEventHandler(OnPropertyContainerDependencyPropertyChanged);
-                _attachedToContainerEvents = true;
-            }
-        }
-
-        private void DisassociateContainerEventHandlers(PropertyContainer container) {
-            if (_attachedToContainerEvents) {
-                container.DependencyPropertyChanged -= new DependencyPropertyChangedEventHandler(OnPropertyContainerDependencyPropertyChanged);
-                _attachedToContainerEvents = false;
-            }
-        }
-
-
-        // When the control gets unloaded, unhook any remaining event handlers
-        // so that it can be garbage collected
-        private void OnUnloaded(object sender, RoutedEventArgs e) {
-            if (_owningContainer != null)
-                DisassociateContainerEventHandlers(_owningContainer);
-        }
-
-        // When the control gets re-loaded somewhere else in the tree, re-hook the
-        // event handlers back up
-        private void OnLoaded(object sender, RoutedEventArgs e) {
-            if (_owningContainer != null)
-                AssociateContainerEventHandlers(_owningContainer);
-        }
-
-        /// <summary>
-        /// Because of the nature of the popup capturing mouse and disappearing when the
-        /// user clicks outside of it, to pin an ExtendedEditor we listen to MouseDown event
-        /// rather than the Click event.
-        /// </summary>
-        /// <param name="e">Event args</param>
-        protected override void OnMouseDown(MouseButtonEventArgs e) {
-
-            if (e.LeftButton == MouseButtonState.Pressed) {
-
-                // Invoke the appropriate command
-                switch (this.TargetEditMode) {
-                    case PropertyContainerEditMode.Inline:
-                        PropertyValueEditorCommands.ShowInlineEditor.Execute(null, this);
-                        break;
-                    case PropertyContainerEditMode.ExtendedPopup:
-                        PropertyValueEditorCommands.ShowExtendedPopupEditor.Execute(null, this);
-                        break;
-                    case PropertyContainerEditMode.ExtendedPinned:
-                        PropertyValueEditorCommands.ShowExtendedPinnedEditor.Execute(null, this);
-                        break;
-                    case PropertyContainerEditMode.Dialog:
-                        PropertyValueEditorCommands.ShowDialogEditor.Execute(null, this);
-                        break;
-                    default:
-                        Debug.Fail(string.Format(
-                            System.Globalization.CultureInfo.CurrentCulture,
-                            "ModeSwitchControl does not yet support PropertyContainerEditMode '{0}'.",
-                            this.TargetEditMode.ToString()));
-                        break;
-                }
-            }
-
-            base.OnMouseDown(e);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/EditorReuseAttribute.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/EditorReuseAttribute.cs
deleted file mode 100644 (file)
index 644ac90..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.PropertyEditing
-{
-    using System.Runtime;
-
-    [Fx.Tag.XamlVisible(false)]
-    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Class)]
-    public sealed class EditorReuseAttribute : Attribute
-    {
-        bool reuseEditor;
-
-        public EditorReuseAttribute(bool reuseEditor)
-        {
-            this.reuseEditor = reuseEditor;
-        }
-        public bool ReuseEditor
-        { get { return this.reuseEditor; } }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/EnumValidator.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/EnumValidator.cs
deleted file mode 100644 (file)
index 86275e7..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.PropertyEditing
-{
-    using System;
-
-    // <summary>
-    // Class containing a single IsValid() method that ensures
-    // that the given public enum is of expected value.  Use this
-    // method to validate the enum value of all publicly exposed setters.
-    // </summary>
-    internal static partial class EnumValidator
-    {
-        public static bool IsValid(PropertyValueExceptionSource value)
-        {
-            return value == PropertyValueExceptionSource.Get || value == PropertyValueExceptionSource.Set;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/ExtendedPropertyValueEditor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/ExtendedPropertyValueEditor.cs
deleted file mode 100644 (file)
index 8448772..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing {
-    using System;
-    using System.Text;
-    using System.Windows;
-    using System.Runtime;
-
-    /// <summary>
-    /// Container for any and all exended editor logic for properties.  This class can hold
-    /// two DataTemplates - one for Inline editor and one for Extended editor.
-    /// </summary>
-    public class ExtendedPropertyValueEditor : PropertyValueEditor {
-
-        private DataTemplate _extendedEditorTemplate;
-
-        /// <summary>
-        /// Creates an ExtendedPropertyValueEditor
-        /// </summary>
-        public ExtendedPropertyValueEditor()
-            : this(null, null) { }
-
-        /// <summary>
-        /// Creates an ExtendedPropertyValueEditor with the specified extended and inline editor
-        /// DataTemplates
-        /// </summary>
-        /// <param name="extendedEditorTemplate">The DataTemplate used for the extended popup/pinned editor.  
-        /// When used, its DataContext will be set to a PropertyValue</param>
-        /// <param name="inlineEditorTemplate">The DataTemplate used for the inline editor.  
-        /// When used, its DataContext will be set to a PropertyValue</param>
-        public ExtendedPropertyValueEditor(DataTemplate extendedEditorTemplate, DataTemplate inlineEditorTemplate)
-            : base(inlineEditorTemplate) {
-            _extendedEditorTemplate = extendedEditorTemplate;
-        }
-
-        /// <summary>
-        /// The DataTemplate used for the extended popup/pinned editor.  
-        /// Its DataContext will be set to a PropertyValue
-        /// </summary>
-        [Fx.Tag.KnownXamlExternalAttribute]
-        public DataTemplate ExtendedEditorTemplate
-        {
-            get { return _extendedEditorTemplate; }
-            set { _extendedEditorTemplate = value; }
-        }
-
-        internal override DataTemplate GetPropertyValueEditor(PropertyContainerEditMode mode) {
-            return base.GetPropertyValueEditor(mode) ??
-                ((mode == PropertyContainerEditMode.ExtendedPinned ||
-                  mode == PropertyContainerEditMode.ExtendedPopup) ? _extendedEditorTemplate : (DataTemplate)null);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/IPropertyFilterTarget.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/IPropertyFilterTarget.cs
deleted file mode 100644 (file)
index af472c5..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing {
-    using System;
-    using System.Collections.Generic;
-
-    /// <summary>
-    /// Interface that is used by the host infrastructure for the PropertyEditing to handle sorting/filtering
-    /// functionality.  It is used to determine whether a particular object should be filtered out.
-    /// </summary>
-    public interface IPropertyFilterTarget {
-
-        /// <summary>
-        /// Event raised when a PropertyFilter is changed through a call to ApplyFilter.
-        /// </summary>
-        event EventHandler<PropertyFilterAppliedEventArgs> FilterApplied;
-        
-        /// <summary>
-        /// Read-only property that returns true if the PropertyFilter is a match for the object.
-        /// </summary>
-        bool MatchesFilter { get; }
-        
-        /// <summary>
-        /// Used to set a new PropertyFilter on the IPropertyFilterTarget
-        /// </summary>
-        /// <param name="filter">The new PropertyFilter instance.</param>
-        void ApplyFilter(PropertyFilter filter);
-        
-        /// <summary>
-        /// Used to determine if this IPropertyFilterTarget is a match for a particular PropertyFilterPredicate
-        /// </summary>
-        /// <param name="predicate">The PropertyFilterPredicate to match against</param>
-        /// <returns>True if it is a match, otherwise false</returns>
-        bool MatchesPredicate(PropertyFilterPredicate predicate);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyContainer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyContainer.cs
deleted file mode 100644 (file)
index 2871958..0000000
+++ /dev/null
@@ -1,804 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing
-{
-    using System.Windows.Controls;
-    using System.Windows;
-    using System;
-    using System.Windows.Data;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows.Input;
-    using System.Windows.Controls.Primitives;
-    using System.Windows.Media;
-    using System.ComponentModel;
-    using System.Collections.Generic;
-    using System.Activities.Presentation;
-    using System.Runtime;
-    using System.Activities.Presentation.Internal.PropertyEditing.Editors;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-
-    /// <summary>
-    /// This control is used as a graphical container for PropertyEntry instances.  The control is
-    /// look-less.  However, it is generally styled as a horizontal row that includes the
-    /// name of the property followed by an editor for its value.  This control, however, is
-    /// intended to be restiled by 3rd-parties to suite their needs.  The style is controled
-    /// by three ControlTemplates (InlineRowTemplate, ExtendedPopupRowTemplate, and
-    /// ExtendedPinnedRowTemplate) that are chosed by the logic within this control based
-    /// on the current value of ActiveEditMode.  This control also exposes three DataTemplates
-    /// (InlineEditor, ExtendedEditor, and DialogEditor) that each of the row templates can use 
-    /// to display the appropriate value editor for the PropertyValue being edited.
-    /// </summary>
-    class PropertyContainer : Control, INotifyPropertyChanged
-    {
-
-        private static RoutedCommand _openDialogWindow;
-
-        DataTemplate flagEditorTemplate;
-
-        /// <summary>
-        /// INotifyPropertyChanged event
-        /// </summary>
-        public event PropertyChangedEventHandler PropertyChanged;
-
-        internal event DependencyPropertyChangedEventHandler DependencyPropertyChanged;
-
-        private bool _attachedToPropertyEntryEvents;
-
-        /// <summary>
-        /// Creates a PropertyContainer
-        /// </summary>
-        [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
-        public PropertyContainer()
-        {
-
-            // Set the OwningPropertyContainer (attached, inherited DP) to self,
-            // so that all of the children of this control know which PropertyContainer
-            // they belong to
-            SetOwningPropertyContainer(this, this);
-
-            this.Loaded += new RoutedEventHandler(OnLoaded);
-            this.Unloaded += new RoutedEventHandler(OnUnloaded);
-        }
-
-        // Useful DPs
-
-        // PropertyEntry DP
-
-        public static readonly DependencyProperty IsValueEditEnabledProperty = DependencyProperty.Register(
-            "IsValueEditEnabled",
-            typeof(bool),
-            typeof(PropertyContainer),
-            new UIPropertyMetadata(true));
-
-
-        /// <summary>
-        /// Gets or sets the PropertyEntry instance on which this PropertyContainer operates. 
-        /// That is the context of the PropertyContainer.  The exposed editor templates 
-        /// (InlineEditor, ExtendedEditor, and DialogEditor) are based on the value of this property.
-        /// </summary>
-        public static readonly DependencyProperty PropertyEntryProperty =
-            DependencyProperty.Register(
-                "PropertyEntry",
-                typeof(PropertyEntry),
-                typeof(PropertyContainer),
-                new FrameworkPropertyMetadata(
-                    null,
-                    new PropertyChangedCallback(PropertyEntryPropertyChanged)));
-
-        /// <summary>
-        /// Gets or sets the PropertyEntry instance on which this PropertyContainer operates. 
-        /// That is the context of the PropertyContainer.  The exposed editor templates 
-        /// (InlineEditor, ExtendedEditor, and DialogEditor) are based on the value of this property.
-        /// </summary>
-        [Fx.Tag.KnownXamlExternalAttribute]
-        public PropertyEntry PropertyEntry
-        {
-            get { return (PropertyEntry)this.GetValue(PropertyContainer.PropertyEntryProperty); }
-            set { this.SetValue(PropertyContainer.PropertyEntryProperty, value); }
-        }
-
-        public bool IsValueEditEnabled
-        {
-            get { return (bool)GetValue(IsValueEditEnabledProperty); }
-            set { SetValue(IsValueEditEnabledProperty, value); }
-        }
-
-        private static void PropertyEntryPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
-        {
-            PropertyContainer theThis = (PropertyContainer)obj;
-
-            // Since the underlying property has changed, chances are that the inline or extended editors
-            // have changed as well, so fire events indicating that their values have changed
-            theThis.NotifyTemplatesChanged();
-            theThis.OnPropertyChanged("MatchesFilter");
-
-            // Switch back to Inline mode
-            theThis.ActiveEditMode = PropertyContainerEditMode.Inline;
-
-            // Ensure that the Template property of this control is set to the right ControlTemplate
-            UpdateControlTemplate(theThis);
-
-            // Hook into PropertyEntry's changed events
-            if (e.OldValue != null)
-                theThis.DisassociatePropertyEventHandlers((PropertyEntry)e.OldValue);
-            if (e.NewValue != null)
-                theThis.AssociatePropertyEventHandlers((PropertyEntry)e.NewValue);
-        }
-
-
-        // ActiveEditMode DP
-
-        // 
-
-
-
-
-        /// <summary>
-        /// Gets or sets currently displayed edit mode of this container (ie. ExtendedPopup,
-        /// ExtendedPinned, Inline or Dialog).  
-        /// </summary>
-        public static readonly DependencyProperty ActiveEditModeProperty =
-            DependencyProperty.Register(
-                "ActiveEditMode",
-                typeof(PropertyContainerEditMode),
-                typeof(PropertyContainer),
-                new FrameworkPropertyMetadata(
-                    PropertyContainerEditMode.Inline,
-                    new PropertyChangedCallback(OnActiveEditModePropertyChanged)));
-
-        /// <summary>
-        /// Gets or sets currently displayed edit mode of this container (ie. ExtendedPopup,
-        /// ExtendedPinned, Inline or Dialog).  
-        /// </summary>
-        public PropertyContainerEditMode ActiveEditMode
-        {
-            get { return (PropertyContainerEditMode)this.GetValue(PropertyContainer.ActiveEditModeProperty); }
-            set { this.SetValue(PropertyContainer.ActiveEditModeProperty, value); }
-        }
-
-        private static void OnActiveEditModePropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
-        {
-            PropertyContainer theThis = (PropertyContainer)obj;
-
-            // Ensure that the Template property of this control is set to the right ControlTemplate
-            UpdateControlTemplate(theThis);
-
-            // Invoke a dialog editor if needed
-            if (object.Equals(e.NewValue, PropertyContainerEditMode.Dialog))
-            {
-
-                if (OpenDialogWindow.CanExecute(null, theThis))
-                {
-                    // There is someone who handles this command, so let it deal with it
-                    // however it wants.
-                    OpenDialogWindow.Execute(null, theThis);
-                }
-                else
-                {
-                    // There is no-one handling this command, so see if there is a virtual
-                    // method we can invoke
-                    DialogPropertyValueEditor editor = theThis.FindDialogPropertyValueEditor();
-                    if (editor != null)
-                    {
-                        // If the DialogCommandSource is not explicitly set, use this control as the
-                        // command source
-                        IInputElement dialogCommandSource = theThis.DialogCommandSource ?? theThis;
-                        editor.ShowDialog(theThis.PropertyEntry.PropertyValue, dialogCommandSource);
-                    }
-                }
-
-                // And revert back to old edit mode once done
-                theThis.ActiveEditMode = (PropertyContainerEditMode)e.OldValue;
-            }
-        }
-
-
-        // DialogCommandSource DP
-
-        /// <summary>
-        /// Gets or sets the IInputElement to pass into the ShowDialog() method as the command source.
-        /// If null (default), _this_ will be passed in.
-        /// Note: ShowDialog() method is called on a DialogPropertyValueEditor instance if a dialog editor
-        /// is invoked and the editor does not specify any dialog DataTemplate.
-        /// </summary>
-        public static readonly DependencyProperty DialogCommandSourceProperty =
-            DependencyProperty.Register(
-                "DialogCommandSource",
-                typeof(IInputElement),
-                typeof(PropertyContainer),
-                new PropertyMetadata((IInputElement)null));
-
-        /// <summary>
-        /// Gets or sets the IInputElement to pass into the ShowDialog() method as the command source.
-        /// If null (default), _this_ will be passed in.
-        /// Note: ShowDialog() method is called on a DialogPropertyValueEditor instance if a dialog editor
-        /// is invoked and the editor does not specify any dialog DataTemplate.
-        /// </summary>
-        [Fx.Tag.KnownXamlExternalAttribute]
-        public IInputElement DialogCommandSource
-        {
-            get { return (IInputElement)this.GetValue(DialogCommandSourceProperty); }
-            set { this.SetValue(DialogCommandSourceProperty, value); }
-        }
-
-
-        // OwningPropertyContainer Attached, Inherited DP
-
-        /// <summary>
-        /// Attached, inherited DP that can be used by UI elements of PropertyValueEditors
-        /// to gain access to their parent PropertyContainer.
-        /// </summary>
-        public static readonly DependencyProperty OwningPropertyContainerProperty =
-            DependencyProperty.RegisterAttached(
-                "OwningPropertyContainer",
-                typeof(PropertyContainer),
-                typeof(PropertyContainer),
-                new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));
-
-        /// <summary>
-        /// Setter for attached, inherited DP that can be used by UI elements of PropertyValueEditors
-        /// to gain access to their parent PropertyContainer.
-        /// </summary>
-        /// <param name="dependencyObject">The DO to set the property on</param>
-        /// <param name="value">The Owning PropertyContainer</param>
-        public static void SetOwningPropertyContainer(DependencyObject dependencyObject, PropertyContainer value)
-        {
-            if (dependencyObject == null)
-                throw FxTrace.Exception.ArgumentNull("dependencyObject");
-
-            dependencyObject.SetValue(PropertyContainer.OwningPropertyContainerProperty, value);
-        }
-
-        /// <summary>
-        /// Getter for attached, inherited DP that can be used by UI elements of PropertyValueEditors
-        /// to gain access to their parent PropertyContainer.
-        /// </summary>
-        /// <param name="dependencyObject">The DO to get the property from</param>
-        /// <returns>The owning PropertyContainer</returns>
-        public static PropertyContainer GetOwningPropertyContainer(DependencyObject dependencyObject)
-        {
-            if (dependencyObject == null)
-                throw FxTrace.Exception.ArgumentNull("dependencyObject");
-
-            return (PropertyContainer)dependencyObject.GetValue(PropertyContainer.OwningPropertyContainerProperty);
-        }
-
-
-        // ControlTemplates for PropertyContainer to define the UI for the different edit modes
-
-        // InlineRowTemplate DP
-
-        /// <summary>
-        /// This DP is used to get/set the InlineRowTemplate for the PropertyContainer.  The 
-        /// InlineRowTemplate defines how the PropertyContainer renders itself when 
-        /// ActiveEditMode = Inline.
-        /// </summary>
-        public static readonly DependencyProperty InlineRowTemplateProperty =
-            DependencyProperty.Register(
-                "InlineRowTemplate",
-                typeof(ControlTemplate),
-                typeof(PropertyContainer),
-                new FrameworkPropertyMetadata(
-                    null,
-                    FrameworkPropertyMetadataOptions.None,
-                    new PropertyChangedCallback(RowTemplateChanged)));
-
-        /// <summary>
-        /// Gets or sets the InlineRowTemplate for the PropertyContainer.  The 
-        /// InlineRowTemplate defines how the PropertyContainer renders itself when 
-        /// ActiveEditMode = Inline.
-        /// </summary>
-        [Fx.Tag.KnownXamlExternalAttribute]
-        public ControlTemplate InlineRowTemplate
-        {
-            get { return (ControlTemplate)this.GetValue(PropertyContainer.InlineRowTemplateProperty); }
-            set { this.SetValue(PropertyContainer.InlineRowTemplateProperty, value); }
-        }
-
-        // Called when any of the row templates (InlineRowTemplate, ExtendedPopupRowTemplate, ExtendedPinnedRowTemplate)
-        // change
-        private static void RowTemplateChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
-        {
-            PropertyContainer theThis = (PropertyContainer)obj;
-            bool updateControlTemplate = false;
-
-            // Check InlineRowTemplate
-            updateControlTemplate = updateControlTemplate |
-                (e.Property == PropertyContainer.InlineRowTemplateProperty &&
-                theThis.ActiveEditMode == PropertyContainerEditMode.Inline);
-
-            // Check ExtendedPopup
-            updateControlTemplate = updateControlTemplate |
-                (e.Property == PropertyContainer.ExtendedPopupRowTemplateProperty &&
-                theThis.ActiveEditMode == PropertyContainerEditMode.ExtendedPopup);
-
-            // Check ExtendedPinned
-            updateControlTemplate = updateControlTemplate |
-                (e.Property == PropertyContainer.ExtendedPinnedRowTemplateProperty &&
-                theThis.ActiveEditMode == PropertyContainerEditMode.ExtendedPinned);
-
-            if (updateControlTemplate)
-                UpdateControlTemplate(theThis);
-        }
-
-
-        // ExtendedPopupRowTemplate DP
-
-        /// <summary>
-        /// This DP is used to get/set the ExtendedPopupRowTemplate for this PropertyContainer.
-        /// The ExtendedPopupRowTemplate defines how the PropertyContainer renders itself when 
-        /// ActiveEditMode = ExtendedPopup.  Generally, host implementations will define this
-        /// template to automatically include the InlineRowTemplate as well.
-        /// </summary>
-        public static readonly DependencyProperty ExtendedPopupRowTemplateProperty =
-            DependencyProperty.Register(
-                "ExtendedPopupRowTemplate",
-                typeof(ControlTemplate),
-                typeof(PropertyContainer),
-                new FrameworkPropertyMetadata(
-                    null,
-                    FrameworkPropertyMetadataOptions.None,
-                    new PropertyChangedCallback(RowTemplateChanged)));
-
-        /// <summary>
-        /// Gets or sets the ExtendedPopupRowTemplate for this PropertyContainer.  
-        /// The ExtendedPopupRowTemplate defines how the PropertyContainer renders itself when 
-        /// ActiveEditMode = ExtendedPopup.  Generally, host implementations will define this
-        /// template to automatically include the InlineRowTemplate as well.
-        /// </summary>
-        [Fx.Tag.KnownXamlExternalAttribute]
-        public ControlTemplate ExtendedPopupRowTemplate
-        {
-            get { return (ControlTemplate)this.GetValue(PropertyContainer.ExtendedPopupRowTemplateProperty); }
-            set { this.SetValue(PropertyContainer.ExtendedPopupRowTemplateProperty, value); }
-        }
-
-
-        // ExtendedPinnedRowTemplate DP
-
-        /// <summary>
-        /// This DP is used to get/set the ExtendedPinnedRowTemplate for this PropertyContainer.  
-        /// The ExtendedPinnedRowTemplate defines how the PropertyContainer renders itself when 
-        /// ActiveEditMode = ExtendedPinned.  Generally, host implementations will define this
-        /// template to automatically include the InlineRowTemplate as well.
-        /// </summary>
-        public static readonly DependencyProperty ExtendedPinnedRowTemplateProperty =
-            DependencyProperty.Register(
-                "ExtendedPinnedRowTemplate",
-                typeof(ControlTemplate),
-                typeof(PropertyContainer),
-                new FrameworkPropertyMetadata(
-                    null,
-                    FrameworkPropertyMetadataOptions.None,
-                    new PropertyChangedCallback(RowTemplateChanged)));
-
-        /// <summary>
-        /// Get/set the ExtendedPinnedRowTemplate for this PropertyContainer.  
-        /// The ExtendedPinnedRowTemplate defines how the PropertyContainer renders itself when 
-        /// ActiveEditMode = ExtendedPinned.  Generally, host implementations will define this
-        /// template to automatically include the InlineRowTemplate as well.
-        /// </summary>
-        [Fx.Tag.KnownXamlExternalAttribute]
-        public ControlTemplate ExtendedPinnedRowTemplate
-        {
-            get { return (ControlTemplate)this.GetValue(PropertyContainer.ExtendedPinnedRowTemplateProperty); }
-            set { this.SetValue(PropertyContainer.ExtendedPinnedRowTemplateProperty, value); }
-        }
-
-
-        // Default PropertyValueEditors to use when a given property doesn't specify its own
-
-        // DefaultStandardValuesPropertyValueEditor DP
-
-        /// <summary>
-        /// DP to get or set the default standard-values editor which is used when a PropertyEntry supports
-        /// StandardValues (enum or through a TypeConverter) and there isn't a PropertyValueEditor
-        /// defined for the PropertyEntry or Type explicitely.
-        /// </summary>
-        public static readonly DependencyProperty DefaultStandardValuesPropertyValueEditorProperty =
-            DependencyProperty.Register(
-                "DefaultStandardValuesPropertyValueEditor",
-                typeof(PropertyValueEditor),
-                typeof(PropertyContainer),
-                new FrameworkPropertyMetadata(
-                    null,
-                    new PropertyChangedCallback(DefaultPropertyValueEditorChanged)));
-
-        /// <summary>
-        /// Gets or set the default standard-values editor which is used when a PropertyEntry supports
-        /// StandardValues (enum or through a TypeConverter) and there isn't a PropertyValueEditor
-        /// defined for the PropertyEntry or Type explicitely.
-        /// </summary>
-        [Fx.Tag.KnownXamlExternalAttribute]
-        public PropertyValueEditor DefaultStandardValuesPropertyValueEditor
-        {
-            get { return (PropertyValueEditor)this.GetValue(PropertyContainer.DefaultStandardValuesPropertyValueEditorProperty); }
-            set { this.SetValue(PropertyContainer.DefaultStandardValuesPropertyValueEditorProperty, value); }
-        }
-
-        private static void DefaultPropertyValueEditorChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
-        {
-            PropertyContainer theThis = (PropertyContainer)obj;
-
-            // Since one of the default PVE's has changed, chances are that the Inline or the Extended
-            // editor template has changed as well.
-            theThis.NotifyTemplatesChanged();
-        }
-
-
-        // DefaultPropertyValueEditor DP
-
-        /// <summary>
-        /// DP to get or set the default PropertyValueEditor which is the editor used when the
-        /// PropertyEntry or Type does not explicitely define its own PropertyValueEditor and does not
-        /// support StandardValues.
-        /// </summary>
-        public static readonly DependencyProperty DefaultPropertyValueEditorProperty =
-            DependencyProperty.Register(
-                "DefaultPropertyValueEditor",
-                typeof(PropertyValueEditor),
-                typeof(PropertyContainer),
-                new FrameworkPropertyMetadata(
-                    null,
-                    new PropertyChangedCallback(DefaultPropertyValueEditorChanged)));
-
-        /// <summary>
-        /// Gets or sets the default PropertyValueEditor which is the editor used when the
-        /// PropertyEntry or Type does not explicitely define its own PropertyValueEditor and does not
-        /// support StandardValues.
-        /// </summary>
-        [Fx.Tag.KnownXamlExternalAttribute]
-        public PropertyValueEditor DefaultPropertyValueEditor
-        {
-            get { return (PropertyValueEditor)this.GetValue(PropertyContainer.DefaultPropertyValueEditorProperty); }
-            set { this.SetValue(PropertyContainer.DefaultPropertyValueEditorProperty, value); }
-        }
-
-
-        // Regular properties (read-only values for DataBinding)
-
-        // InlineEditorTemplate read-only CLR property
-
-        /// <summary>
-        /// Gets the most appropriate InlineEditorTemplate for the current PropertyEntry.
-        /// A row template may decide to use this value to render the editor on the appropriate place.
-        /// </summary>
-        [Fx.Tag.KnownXamlExternalAttribute]
-        public DataTemplate InlineEditorTemplate
-        {
-            get
-            {
-                return FindPropertyValueEditorTemplate(PropertyContainerEditMode.Inline);
-            }
-        }
-
-
-        // ExtendedEditorTemplate read-only CLR property
-
-        /// <summary>
-        /// Gets the most appropriate ExtendedEditorTemplate for the current PropertyEntry.
-        /// A row template may decide to use this value to render the editor on the appropriate place.
-        /// </summary>
-        [Fx.Tag.KnownXamlExternalAttribute]
-        public DataTemplate ExtendedEditorTemplate
-        {
-            get
-            {
-                return FindPropertyValueEditorTemplate(PropertyContainerEditMode.ExtendedPinned);
-            }
-        }
-
-
-        // DialogEditorTemplate read-only CLR property
-
-        /// <summary>
-        /// Gets the most appropriate DialogEditorTemplate for the current PropertyEntry.
-        /// A row template or a Dialog may decide to use this value to render the editor on the
-        /// appropriate place.
-        /// </summary>
-        [Fx.Tag.KnownXamlExternalAttribute]
-        public DataTemplate DialogEditorTemplate
-        {
-            get
-            {
-                return FindPropertyValueEditorTemplate(PropertyContainerEditMode.Dialog);
-            }
-        }
-
-
-        // MatchesFilter read-only CLR property
-
-        /// <summary>
-        /// Gets the value for MatchesFilter stored in the contained PropertyEntry.  If the PropertyEntry
-        /// is null, the value returned is false.
-        /// This property can be used to trigger UI changes to the PropertyContainer based on
-        /// whether the current PropertyEntry matches the current filter or not.
-        /// </summary>
-        public bool MatchesFilter
-        {
-            get
-            {
-                PropertyEntry property = this.PropertyEntry;
-                return property != null && property.MatchesFilter;
-            }
-        }
-
-
-        // OpenDialogWindow static, read-only command property
-
-        /// <summary>
-        /// Gets the command that is fired when someone changes the ActiveEditMode property to "Dialog".
-        /// The host may choose to handle this command and, display the DialogEditorTemplate
-        /// (if one exists) in a host-specific dialog container.  If the host does not handle
-        /// this command (OpenDialogWindow.CanExecute is false), the PropertyContainer itself
-        /// defaults to calling into the virtual DialogPropertyValueEditor.ShowDialog()
-        /// method, but only if DialogPropertyValueEditor is found.
-        /// </summary>
-        public static RoutedCommand OpenDialogWindow
-        {
-            get
-            {
-                if (_openDialogWindow == null)
-                    _openDialogWindow = new RoutedCommand("OpenDialogWindow", typeof(PropertyContainer));
-
-                return _openDialogWindow;
-            }
-        }
-
-
-        internal bool SupportsEditMode(PropertyContainerEditMode mode)
-        {
-            // special handling for dialog editor
-            if (mode == PropertyContainerEditMode.Dialog)
-                return FindDialogPropertyValueEditor() != null;
-
-            // for everything else
-            return FindPropertyValueEditorTemplate(mode) != null;
-        }
-
-        // When the control gets unloaded, unhook any remaining event handlers
-        // so that it can be garbage collected
-        private void OnUnloaded(object sender, RoutedEventArgs e)
-        {
-            PropertyEntry entry = this.PropertyEntry;
-            if (entry != null)
-                DisassociatePropertyEventHandlers(entry);
-        }
-
-        // When the control gets re-loaded, re-hook any previous event handlers
-        // that may have been disassociated during Unload
-        private void OnLoaded(object sender, RoutedEventArgs e)
-        {
-            PropertyEntry entry = this.PropertyEntry;
-            if (entry != null)
-                AssociatePropertyEventHandlers(entry);
-        }
-
-        // Helper that hooks into PropertyChanged events on the given Property
-        private void AssociatePropertyEventHandlers(PropertyEntry property)
-        {
-            if (!_attachedToPropertyEntryEvents)
-            {
-                property.PropertyChanged += new PropertyChangedEventHandler(OnPropertyPropertyChanged);
-                _attachedToPropertyEntryEvents = true;
-            }
-        }
-
-        // Helper that unhooks from PropertyChanged events on the given Property
-        private void DisassociatePropertyEventHandlers(PropertyEntry property)
-        {
-            if (_attachedToPropertyEntryEvents)
-            {
-                property.PropertyChanged -= new PropertyChangedEventHandler(OnPropertyPropertyChanged);
-                _attachedToPropertyEntryEvents = false;
-            }
-        }
-
-        // Called when the properties of the Property object change
-        private void OnPropertyPropertyChanged(object sender, PropertyChangedEventArgs e)
-        {
-            // Propagate MatchesFilter change notifications outwards so that
-            // people can set up triggers against it
-            if ("MatchesFilter".Equals(e.PropertyName))
-                this.OnPropertyChanged("MatchesFilter");
-            else if ("PropertyValueEditor".Equals(e.PropertyName))
-                this.NotifyTemplatesChanged();
-        }
-
-        /// <summary>
-        /// Helper class that attempts to find the DataTemplate for the requested PropertyContainerEditMode
-        /// given the currently displayed PropertyEntry and the currently set default PropertyValueEditors.
-        /// 
-        /// If the requested DataTemplate is found on the PropertyValueEditor associated with the displayed
-        /// control, is it returned.
-        /// 
-        /// Otherwise if the requested DataTemplate is found on DefaultStandardValuesPropertyValueEditor,
-        /// it is returned.
-        /// 
-        /// Otherwise if the requested DataTemplate is found on DefaultPropertyValueEditor,
-        /// it is returned.
-        /// 
-        /// Otherwise null is returned.
-        /// </summary>
-        /// <param name="editMode">The editMode for which the DataTemplate should be retrieved</param>
-        /// <returns>Most relevant DataTemplate for the specified edit mode based on the currently
-        /// displayed PropertyEntry and the current set of default PropertyValueEditors, or null if not
-        /// found.</returns>
-        private DataTemplate FindPropertyValueEditorTemplate(PropertyContainerEditMode editMode)
-        {
-            PropertyEntry property = this.PropertyEntry;
-            PropertyValueEditor editor = null;
-            DataTemplate requestedTemplate = null;
-
-            // Look at property
-            if (property != null)
-            {
-                editor = property.PropertyValueEditor;
-                if (editor != null)
-                {
-                    requestedTemplate = editor.GetPropertyValueEditor(editMode);
-                }
-            }
-
-            if (requestedTemplate != null)
-                return requestedTemplate;
-
-            // Is the property of type enum and used as flags?
-            if (IsFlagsProperty(property))
-            {
-                requestedTemplate = this.GetFlagEditorTemplate(editMode);
-            }
-
-            if (requestedTemplate != null)
-            {
-                return requestedTemplate;
-            }
-
-            // Does the property have standard values?
-            if (property != null && property.HasStandardValuesInternal)
-            {
-                editor = this.DefaultStandardValuesPropertyValueEditor;
-                if (editor != null)
-                {
-                    requestedTemplate = editor.GetPropertyValueEditor(editMode);
-                }
-            }
-
-            if (requestedTemplate != null)
-                return requestedTemplate;
-
-            // Use the default
-            editor = this.DefaultPropertyValueEditor;
-            if (editor != null)
-            {
-                requestedTemplate = editor.GetPropertyValueEditor(editMode);
-            }
-
-            return requestedTemplate;
-        }
-
-        bool IsFlagsProperty(PropertyEntry property)
-        {
-            return property != null && property.PropertyType != null && property.PropertyType.IsEnum &&
-                   ExtensibilityAccessor.GetAttribute<FlagsAttribute>(property.PropertyType) != null;
-        }
-
-        DataTemplate GetFlagEditorTemplate(PropertyContainerEditMode editMode)
-        {
-            Type propertyType = this.PropertyEntry.PropertyType;
-            if (editMode == PropertyContainerEditMode.Inline)
-            {
-                if (this.flagEditorTemplate == null)
-                {
-                    this.flagEditorTemplate = new DataTemplate();
-                    this.flagEditorTemplate.VisualTree = new FrameworkElementFactory(typeof(FlagEditor));
-                    this.flagEditorTemplate.VisualTree.SetValue(FlagEditor.FlagTypeProperty, propertyType);
-                    Binding binding = new Binding("Value");
-                    binding.Converter = new FlagStringConverter();
-                    binding.ConverterParameter = propertyType;
-                    binding.UpdateSourceTrigger = UpdateSourceTrigger.Explicit;
-                    this.flagEditorTemplate.VisualTree.SetBinding(FlagEditor.TextProperty, binding);
-                }
-                return this.flagEditorTemplate;
-            }
-            else
-            {
-                return null;
-            }
-        }
-
-        // Helper that tries to find the first applicable DialogPropertyValueEditor
-        private DialogPropertyValueEditor FindDialogPropertyValueEditor()
-        {
-            PropertyEntry property = this.PropertyEntry;
-            DialogPropertyValueEditor editor = null;
-
-            // Look at property
-            if (property != null)
-            {
-                editor = property.PropertyValueEditor as DialogPropertyValueEditor;
-            }
-
-            if (editor != null)
-                return editor;
-
-            // Does the property have standard values?
-            if (property != null && property.HasStandardValuesInternal)
-            {
-                editor = this.DefaultStandardValuesPropertyValueEditor as DialogPropertyValueEditor;
-            }
-
-            if (editor != null)
-                return editor;
-
-            // Use the default
-            editor = this.DefaultPropertyValueEditor as DialogPropertyValueEditor;
-
-            return editor;
-        }
-
-        // Updates the ControlTemplate of this control based on the currently ActiveEditMode
-        private static void UpdateControlTemplate(PropertyContainer container)
-        {
-
-            PropertyContainerEditMode editMode = container.ActiveEditMode;
-            ControlTemplate newTemplate = null;
-
-            switch (editMode)
-            {
-                case PropertyContainerEditMode.Inline:
-                    newTemplate = container.InlineRowTemplate;
-                    break;
-                case PropertyContainerEditMode.ExtendedPopup:
-                    newTemplate = container.ExtendedPopupRowTemplate;
-                    break;
-                case PropertyContainerEditMode.ExtendedPinned:
-                    newTemplate = container.ExtendedPinnedRowTemplate;
-                    break;
-                case PropertyContainerEditMode.Dialog:
-                    // In dialog case, just keep the same value
-                    return;
-                default:
-                    Debug.Fail(
-                        string.Format(
-                            System.Globalization.CultureInfo.CurrentCulture,
-                            "PropertyContainerEditMode does not yet support PropertyContainerEditMode '{0}'.",
-                            editMode.ToString()));
-                    newTemplate = container.Template;
-                    break;
-            }
-
-            if (newTemplate != container.Template)
-                container.Template = newTemplate;
-        }
-
-        private void NotifyTemplatesChanged()
-        {
-            OnPropertyChanged("InlineEditorTemplate");
-            OnPropertyChanged("ExtendedEditorTemplate");
-            OnPropertyChanged("DialogEditorTemplate");
-        }
-
-        /// <summary>
-        /// Called when a property changes
-        /// </summary>
-        /// <param name="propertyName">Name of the property</param>
-        protected virtual void OnPropertyChanged(string propertyName)
-        {
-            if (PropertyChanged != null)
-                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-        }
-
-        /// <summary>
-        /// Called when a property changes
-        /// </summary>
-        /// <param name="e">Name of the property</param>
-        protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
-        {
-            if (DependencyPropertyChanged != null)
-                DependencyPropertyChanged(this, e);
-
-            base.OnPropertyChanged(e);
-        }
-    }
-}
-
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyContainerEditMode.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyContainerEditMode.cs
deleted file mode 100644 (file)
index 7571329..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing {
-
-    /// <summary>
-    /// Enum that defines the different edit modes a PropertyContainer can be in
-    /// </summary>
-    public enum PropertyContainerEditMode {
-        /// <summary>
-        /// Inline editor mode
-        /// </summary>
-        Inline,
-
-        /// <summary>
-        /// Extended editor, popped up over the property inspector
-        /// </summary>
-        ExtendedPopup,
-
-        /// <summary>
-        /// Extended editor, pinned into place within the property inspector
-        /// </summary>
-        ExtendedPinned,
-
-        /// <summary>
-        /// Dialog popup editor
-        /// </summary>
-        Dialog
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyFilter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyFilter.cs
deleted file mode 100644 (file)
index dd9784c..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Runtime;
-    using System.Activities.Presentation;
-
-    /// <summary>
-    /// This class is used as part of the searching/filtering functionality that may provided
-    /// by the property editing host.  It contains a list of predicates (i.e. strings to match against)
-    /// </summary>
-    [Fx.Tag.XamlVisible(false)]
-    public class PropertyFilter
-    {
-
-        private List<PropertyFilterPredicate> _predicates = new List<PropertyFilterPredicate>();
-
-        /// <summary>
-        /// Creates a PropertyFilter.
-        /// </summary>
-        /// <param name="filterText">String representation of predicates, space delimited</param>
-        public PropertyFilter(string filterText)
-        {
-            SetPredicates(filterText);
-        }
-
-        /// <summary>
-        /// Creates a PropertyFilter.
-        /// </summary>
-        /// <param name="predicates">IEnumerable collection of predicates</param>
-        public PropertyFilter(IEnumerable<PropertyFilterPredicate> predicates)
-        {
-            SetPredicates(predicates);
-        }
-
-        /// <summary>
-        /// Readonly property that returns true if this PropertyFilter does not have any predicates
-        /// </summary>
-        public bool IsEmpty
-        {
-            get { return this._predicates == null || this._predicates.Count == 0; }
-        }
-
-        private void SetPredicates(string filterText)
-        {
-
-            if (string.IsNullOrEmpty(filterText))
-                return;
-
-            string[] filterParts = filterText.Split(' ');
-
-            for (int i = 0; i < filterParts.Length; i++)
-            {
-                if (!string.IsNullOrEmpty(filterParts[i]))
-                {
-                    _predicates.Add(new PropertyFilterPredicate(filterParts[i]));
-                }
-            }
-        }
-
-        private void SetPredicates(IEnumerable<PropertyFilterPredicate> predicates)
-        {
-
-            if (predicates == null)
-                return;
-
-            foreach (PropertyFilterPredicate predicate in predicates)
-            {
-                if (predicate != null)
-                {
-                    _predicates.Add(predicate);
-                }
-            }
-        }
-
-        /// <summary>
-        /// Matches this filter against a particular filter target. The
-        /// filter returns true if there are no predicates or if one or more 
-        /// predicates match the filter target.
-        /// </summary>
-        /// <param name="target">Target to attempt matching</param>
-        /// <returns>True if there are no predicates or if one or more 
-        /// predicates match the filter target, false otherwise</returns>
-        /// <exception cref="ArgumentNullException">If target is null.</exception>
-        public bool Match(IPropertyFilterTarget target)
-        {
-            if (target == null)
-                throw FxTrace.Exception.ArgumentNull("target");
-
-            if (this.IsEmpty)
-                return true;
-
-            // Perform an OR over all predicates
-            for (int i = 0; i < this._predicates.Count; i++)
-            {
-                if (target.MatchesPredicate(_predicates[i]))
-                    return true;
-            }
-
-            return false;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyFilterAppliedEventArgs.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyFilterAppliedEventArgs.cs
deleted file mode 100644 (file)
index 95b6946..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing
-{
-    using System;
-    using System.Runtime;
-
-    /// <summary>
-    /// EventArgs used to fire an event that some IPropertyFilter has been applied
-    /// </summary>
-    [Fx.Tag.XamlVisible(false)]
-    public class PropertyFilterAppliedEventArgs : EventArgs
-    {
-        private PropertyFilter _filter;
-
-        /// <summary>
-        /// Creates a new PropertyFilterAppliedEventArgs
-        /// </summary>
-        /// <param name="filter">The PropertyFilter that was applied.</param>
-        public PropertyFilterAppliedEventArgs(PropertyFilter filter)
-        {
-            _filter = filter;
-        }
-
-        /// <summary>
-        /// Readonly property that returns the PropertyFilter that was applied.
-        /// </summary>
-        public PropertyFilter Filter { get { return _filter; } }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyFilterPredicate.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyFilterPredicate.cs
deleted file mode 100644 (file)
index abea350..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing {
-    using System;
-    using System.Globalization;
-    using System.Runtime;
-    using System.Activities.Presentation;
-
-    /// <summary>
-    /// Represents a predicate for search/filtering 
-    /// </summary>
-    [Fx.Tag.XamlVisible(false)]
-    public class PropertyFilterPredicate
-    {
-        private string _matchText;
-
-        /// <summary>
-        /// Creates a PropertyFilterPredicate.
-        /// </summary>
-        /// <param name="matchText"></param>
-        /// <exception cref="ArgumentNullException">When matchText is null</exception>
-        public PropertyFilterPredicate(string matchText) {
-            if (matchText == null)
-                throw FxTrace.Exception.ArgumentNull("matchText");
-
-            _matchText = matchText.ToUpper(CultureInfo.CurrentCulture);
-        }
-
-        /// <summary>
-        /// Gets the string predicate
-        /// </summary>
-        protected string MatchText {
-            get {
-                return _matchText;
-            }
-        }
-
-        /// <summary>
-        /// Returns true if a case insensitive match of the predicate string is contained
-        /// within the target string.
-        /// </summary>
-        /// <param name="target">The string filter</param>
-        /// <returns></returns>
-        public virtual bool Match(string target) {
-            return target != null && target.ToUpper(CultureInfo.CurrentCulture).Contains(_matchText);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyMarker.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyMarker.cs
deleted file mode 100644 (file)
index 13d1cb6..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing {
-    using System;
-    using System.Windows;
-    using System.Windows.Controls;
-
-    /// <summary>
-    /// When this control is placed on a one of the PropertyContainer *RowTemplates, it acts as a
-    /// marker for the spowhere a host specific PropertyMarker should be put at runtime.
-    /// Some hosts may not provide a PropertyMarker, in which case this control will render
-    /// with Visibility.Collapsed.
-    /// </summary>
-    class PropertyMarker : Control {
-    }
-}
\ No newline at end of file
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyOrder.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyOrder.cs
deleted file mode 100644 (file)
index e5502bb..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing {
-    using System;
-    using System.ComponentModel;
-    using System.Runtime;
-    using System.Activities.Presentation;
-    using System.Diagnostics.CodeAnalysis;
-
-    /// <summary>
-    /// This class is used to set the order in which properties show up within a category, 
-    /// or within a list of sub-properties.  3rd parties may choose to derive from this class
-    /// and create their own custom order tokens, which can both guarantee property order as
-    /// well as property grouping.
-    /// </summary>
-    [Fx.Tag.XamlVisible(false)]
-    sealed class PropertyOrder : OrderToken
-    {
-        private static PropertyOrder _default;
-
-        /// <summary>
-        /// Creates a PropertyOrder.  
-        /// </summary>
-        /// <param name="precedence">Precedence of this token based on the
-        /// referenced token.</param>
-        /// <param name="reference">Referenced token.</param>
-        /// <param name="conflictResolution">Conflict resolution semantics.
-        /// Winning ConflictResultion semantic should only be used
-        /// on predefined, default OrderToken instances to ensure
-        /// their correct placement in more complex chain of order
-        /// dependencies.</param>
-        private PropertyOrder(OrderTokenPrecedence precedence, OrderToken reference, OrderTokenConflictResolution conflictResolution)
-            : base(precedence, reference, conflictResolution) {
-        }
-
-        /// <summary>
-        /// Creates a PropertyOrder that comes after the passed in token.
-        /// </summary>
-        /// <param name="reference">The reference token</param>
-        /// <returns>The new PropertyOrder</returns>
-        /// <exception cref="ArgumentNullException">When reference is null</exception>
-        public static PropertyOrder CreateAfter(OrderToken reference)
-        {
-            if (reference == null)
-                throw FxTrace.Exception.ArgumentNull("reference");
-
-            return new PropertyOrder(OrderTokenPrecedence.After, reference, OrderTokenConflictResolution.Lose);
-        }
-
-        /// <summary>
-        /// Treat equal orders as equal
-        /// </summary>
-        /// <param name="left">Left token</param>
-        /// <param name="right">Right token</param>
-        /// <returns>0</returns>
-        protected override int ResolveConflict(OrderToken left, OrderToken right) {
-            return 0;
-        }
-
-        /// <summary>
-        /// Gets the system defined Default order position.
-        /// </summary>
-        public static PropertyOrder Default {
-            get {
-                if (_default == null) {
-                    _default = new PropertyOrder(OrderTokenPrecedence.After, null, OrderTokenConflictResolution.Win);
-                }
-                return _default;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyOrderAttribute.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyOrderAttribute.cs
deleted file mode 100644 (file)
index cca74f2..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing {
-    using System;
-    using System.ComponentModel;
-    using System.Runtime;
-    using System.Activities.Presentation;
-
-    /// <summary>
-    /// Attribute that is used to attach a PropertyOrder to a property.
-    /// </summary>
-    [Fx.Tag.XamlVisible(false)]
-    [AttributeUsage(AttributeTargets.Property)]
-    sealed class PropertyOrderAttribute : Attribute {
-        private PropertyOrder _order;
-        
-        /// <summary>
-        /// Creates a PropertyOrderAttribute.
-        /// </summary>
-        /// <param name="order">The PropertyOrder to attach to the property</param>
-        /// <exception cref="ArgumentNullException">When order is null</exception>
-        public PropertyOrderAttribute(PropertyOrder order)
-        {
-            if (order == null)
-                throw FxTrace.Exception.ArgumentNull("order");
-
-            _order = order;
-        }
-
-        /// <summary>
-        /// Gets the associated PropertyOrder
-        /// </summary>
-        public PropertyOrder Order {
-            get { return _order; }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValue.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValue.cs
deleted file mode 100644 (file)
index 6720fe3..0000000
+++ /dev/null
@@ -1,406 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing {
-    using System.Globalization;
-    using System;
-    using System.Collections;
-    using System.ComponentModel;
-    using System.Collections.Generic;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Activities.Presentation.Internal.Properties;
-    using System.Activities.Presentation;
-
-    /// <summary>
-    /// This class provides a data model for the underlying property value.
-    /// </summary>
-    public abstract class PropertyValue : INotifyPropertyChanged {
-
-        private PropertyEntry _parentProperty;
-
-        /// <summary>
-        /// Creates a PropertyValue.  For host infrastructure.
-        /// </summary>
-        /// <param name="parentProperty">The PropertyEntry that corresponds to this PropertyValue</param>
-        /// <exception cref="ArgumentNullException">When parentProperty is null</exception>
-        protected PropertyValue(PropertyEntry parentProperty) {
-            if (parentProperty == null)
-                throw FxTrace.Exception.ArgumentNull("parentProperty");
-
-            _parentProperty = parentProperty;
-        }
-
-        /// <summary>
-        /// Event that gets fired when any properties of the PropertyValue class change.
-        /// Note that a "Value" and "StringValue" property changed notification gets fired
-        /// either when the Value or StringValue get set to a new instance OR when any
-        /// sub-properties of this PropertyValue change.
-        /// </summary>
-        public event PropertyChangedEventHandler PropertyChanged;
-
-        /// <summary>
-        /// Event fired when the Value or StringValue properties of this class
-        /// get updated with new instances.
-        /// </summary>
-        public event EventHandler RootValueChanged;
-
-        /// <summary>
-        /// Event fired when the any of the sub-properties of this PropertyValue
-        /// or its sub-properties get updated with new value instances.
-        /// </summary>
-        public event EventHandler SubPropertyChanged;
-
-        /// <summary>
-        /// Gets the parent PropertyEntry.
-        /// </summary>
-        public PropertyEntry ParentProperty { get { return _parentProperty; } }
-
-        /// <summary>
-        /// Gets a PropertyValueSource that contains information 
-        /// about where this value is coming from.
-        /// </summary>
-        public abstract PropertyValueSource Source { get; }
-
-        /// <summary>
-        /// Returns true if Value is the default value for the property
-        /// </summary>
-        public abstract bool IsDefaultValue { get; }
-
-        /// <summary>
-        /// Returns true if this value represents a property for multiple objects with 
-        /// more than one value - for example 2 Buttons with different values for Background
-        /// If this property is true then Value will return null and and StringValue will return 
-        /// String.Empty.
-        /// </summary>
-        public abstract bool IsMixedValue { get; }
-
-        /// <summary>
-        /// Throws if the value is invalid
-        /// </summary>
-        /// <param name="valueToValidate">value to validate</param>
-        protected abstract void ValidateValue(object valueToValidate);
-
-        /// <summary>
-        /// Gets a flag indicating whether the underlying value can be converted from a string 
-        /// </summary>
-        public abstract bool CanConvertFromString { get; }
-
-        /// <summary>
-        /// Returns the given string as a value - used to convert StringValue to Value
-        /// Typical implementations would use the TypeConverter for the underlying property
-        /// This method should not catch exceptions, it should propagate them.
-        /// </summary>
-        protected abstract object ConvertStringToValue(string value);
-
-        /// <summary>
-        /// Returns the value as a String - used to convert Value to StringValue
-        /// Typical implementations would use the TypeConverter for the underlying property
-        /// </summary>
-        protected abstract string ConvertValueToString(object value);
-
-        /// <summary>
-        /// Gets the underlying property value.
-        /// </summary>
-        protected abstract object GetValueCore();
-
-        /// <summary>
-        /// Sets the underlying property value.  This method should not catch
-        /// exceptions, but allow them to propagate.
-        /// </summary>
-        protected abstract void SetValueCore(object value);
-
-        /// <summary>
-        /// Clears this value such that it is unset.
-        /// </summary>
-        public abstract void ClearValue();
-
-        // Value Property
-
-        /// <summary>
-        /// Gets or sets the underlying property value.  Both Value and StringValue
-        /// will raise the appropriate change notifications.
-        /// </summary>
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Propagating the error might cause VS to crash")]
-        [SuppressMessage("Reliability", "Reliability108", Justification = "Propagating the error might cause VS to crash")]
-        public object Value
-        {
-            get {
-                object returnValue = null;
-
-                if (this.CatchExceptions) {
-                    try {
-                        returnValue = GetValueCore();
-                    }
-                    catch (Exception ex) {
-                        OnPropertyValueException(new PropertyValueExceptionEventArgs(
-                            string.Format(
-                                CultureInfo.CurrentCulture,
-                                Resources.Error_ValueGetFailed),
-                            this,
-                            PropertyValueExceptionSource.Get,
-                            ex));
-                    }
-                }
-                else {
-                    returnValue = GetValueCore();
-                }
-
-                return returnValue;
-            }
-            set 
-            {
-                try 
-                {
-                    SetValueImpl(value);
-                }
-                catch (Exception ex) 
-                {
-                    bool isValidationException = ex is ValidationException;
-
-                    //show error message if we do catch exception or exception is ValidationException
-                    if (this.CatchExceptions || isValidationException)
-                    {
-                        OnPropertyValueException(new PropertyValueExceptionEventArgs(
-                            string.Format(CultureInfo.CurrentCulture, Resources.Error_ValueSetFailed),
-                            this,
-                            PropertyValueExceptionSource.Set,
-                            ex));
-                    }
-
-                    //rethrow if we do not catch exception or exception is ValidationException (it should be handled by the control)
-                    if (!this.CatchExceptions || isValidationException)
-                    {
-                        throw;
-                    }
-                }
-            }
-        }
-
-        private void SetValueImpl(object value) {
-            ValidateValue(value);
-            SetValueCore(value);
-            NotifyValueChanged();
-            OnRootValueChanged();
-        }
-
-
-        // StringValue Property
-
-        /// <summary>
-        /// Gets or sets the underlying property value as a string.  Both Value and StringValue
-        /// will raise the appropriate change notifications.
-        /// </summary>
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Propagating the error might cause VS to crash")]
-        [SuppressMessage("Reliability", "Reliability108", Justification = "Propagating the error might cause VS to crash")]
-        public string StringValue
-        {
-            get {
-                string returnValue = string.Empty;
-
-                //If there is an error event handler then use it otherwise let the exception
-                //propogate
-                if (this.CatchExceptions) {
-                    try {
-                        //Caching opportunity here
-                        returnValue = this.ConvertValueToString(this.Value);
-                    }
-                    catch (Exception ex) {
-                        OnPropertyValueException(new PropertyValueExceptionEventArgs(
-                            string.Format(
-                                CultureInfo.CurrentCulture,
-                                Resources.Error_CannotConvertValueToString),
-                            this,
-                            PropertyValueExceptionSource.Get,
-                            ex));
-                    }
-                }
-                else {
-                    //Caching opportunity here
-                    returnValue = this.ConvertValueToString(this.Value);
-                }
-
-                return returnValue;
-            }
-            set {
-                //If there is an error event handler then use it otherwise let the exception
-                //propogate
-                if (CatchExceptions) {
-                    try {
-                        this.Value = this.ConvertStringToValue(value);
-                    }
-                    catch (Exception ex) {
-                        OnPropertyValueException(
-                            new PropertyValueExceptionEventArgs(
-                                string.Format(
-                                    CultureInfo.CurrentCulture,
-                                    Resources.Error_CannotUpdateValueFromStringValue),
-                                this,
-                                PropertyValueExceptionSource.Set,
-                                ex));
-                    }
-                }
-                else {
-                    this.Value = this.ConvertStringToValue(value);
-                }
-            }
-        }
-
-
-        // SubProperties
-
-        /// <summary>
-        /// Gets a flag indicating whether the type of this property 
-        /// supports sub-properties.  Typical implementations will use a TypeConverter
-        /// to verify whether sub-properties exist.
-        /// </summary>
-        public abstract bool HasSubProperties { get; }
-        
-        /// <summary>
-        /// Gets a collection of sub-properties as PropertyEntry instances
-        /// </summary>
-        public abstract PropertyEntryCollection SubProperties { get; }
-
-
-        // Collections
-
-        /// <summary>
-        /// Gets a flag indicating whether this PropertyValue models a property
-        /// whose value is a collection.
-        /// </summary>
-        public abstract bool IsCollection { get; }
-
-        /// <summary>
-        /// Gets a collection of PropertyValue instances that correspond to the items
-        /// in the collection when IsCollection is true.
-        /// </summary>
-        public abstract PropertyValueCollection Collection { get; }
-
-
-        // Error Handling
-
-        /// <summary>
-        /// Event for host implementations to use for error handling.  Raised when StringValue or Value throws 
-        /// and CatchExceptions is true.  If CatchExceptions is false, the exception will be thrown up the stack.
-        /// </summary>
-        public event EventHandler<PropertyValueExceptionEventArgs> PropertyValueException;
-
-        /// <summary>
-        /// Gets a boolean indicating whether exceptions thrown during value gets and sets 
-        /// should be caught or propagated directly to the caller.  By default, exceptions
-        /// are caught if there is at least one subscriber to the PropertyValueException event.
-        /// </summary>
-        protected virtual bool CatchExceptions {
-            get {
-                return PropertyValueException != null;
-            }
-        }
-
-        /// <summary>
-        /// Called when PropertyValue get or set fails.  Default implementation raises the
-        /// PropertyValueException event.
-        /// </summary>
-        /// <param name="e">PropertyValueExceptionEventArgs</param>
-        /// <exception cref="ArgumentNullException">When e is null</exception>
-        protected virtual void OnPropertyValueException(PropertyValueExceptionEventArgs e) {
-            if (e == null)
-                throw FxTrace.Exception.ArgumentNull("e");
-
-            if (PropertyValueException != null)
-                PropertyValueException(this, e);
-        }
-
-
-        // Notification Helpers
-
-        /// <summary>
-        /// Raises change notification for all properties.  This should be called when
-        /// the underlying object is changed externally (for example Button.Width is 
-        /// changed on the design surface)
-        /// </summary>
-        protected virtual void NotifyRootValueChanged() {
-            //When Value is updated or the model is reset we 
-            //need to fire an "everything has changed" notification
-
-            //This doesn't appear to work at all...
-            //PropertyChanged(this, new PropertyChangedEventArgs("")); 
-
-            //So notify these key changes individually
-            OnPropertyChanged("IsDefaultValue");
-            OnPropertyChanged("IsMixedValue");
-            OnPropertyChanged("IsCollection");
-            OnPropertyChanged("Collection");
-            OnPropertyChanged("HasSubProperties");
-            OnPropertyChanged("SubProperties");
-            OnPropertyChanged("Source");
-            OnPropertyChanged("CanConvertFromString");
-
-            NotifyValueChanged();
-            OnRootValueChanged();
-        }
-
-        /// <summary>
-        /// Called to raise the SubPropertyChanged event.  This method should be called
-        /// when one of the sub-properties of this property changes.  It raises changed
-        /// events for Value, StringValue, and SubProperty
-        /// </summary>
-        protected void NotifySubPropertyChanged() {
-            NotifyValueChanged();
-            OnSubPropertyChanged();
-        }
-
-        /// <summary>
-        /// Called to raise the changed events for Value and StringValue.  This method
-        /// should only be called to trigger the refresh of the visual representation
-        /// of this value.  If the value content actually changes, call NotifyRootValueChanged
-        /// instead.
-        /// </summary>
-        private void NotifyValueChanged() {
-            OnPropertyChanged("Value");
-            NotifyStringValueChanged();
-        }
-
-        /// <summary>
-        /// Raise change notification for StringValue
-        /// </summary>
-        private void NotifyStringValueChanged() {
-            OnPropertyChanged("StringValue");
-        }
-
-        /// <summary>
-        /// Called to raise the RootValueChanged event
-        /// </summary>
-        private void OnRootValueChanged() {
-            if (RootValueChanged != null)
-                RootValueChanged(this, EventArgs.Empty);
-        }
-
-        /// <summary>
-        /// Called to raise the SubPropertyChanged event
-        /// </summary>
-        private void OnSubPropertyChanged() {
-            if (SubPropertyChanged != null)
-                SubPropertyChanged(this, EventArgs.Empty);
-        }
-
-
-        // INotifyPropertyChanged
-
-        /// <summary>
-        /// Raises the PropertyChanged event.  Subclasses that override this method
-        /// should call the base class implementation.
-        /// </summary>
-        /// <param name="e"></param>
-        protected virtual void OnPropertyChanged(PropertyChangedEventArgs e) {
-            if (PropertyChanged != null)
-                PropertyChanged(this, e);
-        }
-
-        /// <summary>
-        /// Raises the PropertyChanged event.
-        /// </summary>
-        /// <param name="propertyName"></param>
-        protected virtual void OnPropertyChanged(string propertyName) {
-            if (PropertyChanged != null)
-                OnPropertyChanged(new PropertyChangedEventArgs(propertyName));
-        }
-
-    }
-}
-
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValueCollection.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValueCollection.cs
deleted file mode 100644 (file)
index cb440f1..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-    using System.Collections;
-    using System.Collections.Specialized;
-    using System.Activities.Presentation;
-
-    /// <summary>
-    /// This class encapsulates a collection of PropertyValue instances.  
-    /// It is used for properties whose type is a collection.
-    /// </summary>
-    public abstract class PropertyValueCollection : IEnumerable<PropertyValue>, INotifyCollectionChanged
-    {
-
-        /// <summary>
-        /// INotifyCollectionChanged event
-        /// </summary>
-        public event NotifyCollectionChangedEventHandler CollectionChanged;
-
-        private PropertyValue _parentValue;
-
-        /// <summary>
-        /// Creates a PropertyValueCollection.
-        /// </summary>
-        /// <param name="parentValue">The parent PropertyValue.  This will be the property whose
-        /// Type is a collection</param>
-        /// <exception cref="ArgumentNullException">When parentValue is null</exception>
-        protected PropertyValueCollection(PropertyValue parentValue)
-        {
-            if (parentValue == null)
-                throw FxTrace.Exception.ArgumentNull("parentValue");
-
-            _parentValue = parentValue;
-        }
-
-        /// <summary>
-        /// Gets the parent PropertyValue.
-        /// </summary>
-        public PropertyValue ParentValue { get { return _parentValue; } }
-
-        /// <summary>
-        /// Indexer that returns a PropertyValue for the given index.
-        /// </summary>
-        /// <param name="index">The index of the item in the collection</param>
-        /// <returns>The PropertyValue at that index</returns>
-        public abstract PropertyValue this[int index] { get; }
-
-        /// <summary>
-        /// Adds an object into the collection.
-        /// </summary>
-        /// <param name="value">The object to add to the collection</param>
-        /// <returns>The PropertyValue for the added object</returns>
-        public abstract PropertyValue Add(object value);
-
-        /// <summary>
-        /// Inserts an object into the collection at the specified index
-        /// </summary>
-        /// <param name="value">The object to add to the collection</param>
-        /// <param name="index">The index of where to add that object</param>
-        /// <returns>A PropertyValue for the added object</returns>
-        public abstract PropertyValue Insert(object value, int index);
-
-        /// <summary>
-        /// Removes the object from the collection.  The host needs to ensure that
-        /// the PropertyValue is invalid after the object is removed.
-        /// </summary>
-        /// <param name="propertyValue">The item to remove from the collection</param>
-        /// <returns>true if successful, otherwise false.</returns>
-        public abstract bool Remove(PropertyValue propertyValue);
-
-        /// <summary>
-        /// Removes the object from the collection at the specified index.  The host needs to ensure that
-        /// the PropertyValue is invalid after the object is removed.
-        /// </summary>
-        /// <param name="index">the index of the item to remove</param>
-        public abstract void RemoveAt(int index);
-
-        /// <summary>
-        /// Gets the number of items in the collection.
-        /// </summary>
-        public abstract int Count { get; }
-
-        /// <summary>
-        /// Used to reorder items in the collection (remove and add will invalidate the PropertyValue)
-        /// when an item is moved to a new index, the items below the new index and the item at the new 
-        /// index will slide down.
-        /// </summary>
-        /// <param name="currentIndex"></param>
-        /// <param name="newIndex"></param>
-        public abstract void SetIndex(int currentIndex, int newIndex);
-
-        /// <summary>
-        /// Returns a strongly typed IEnumerator for the collection of PropertyValues
-        /// </summary>
-        /// <returns></returns>
-        public abstract IEnumerator<PropertyValue> GetEnumerator();
-
-        IEnumerator IEnumerable.GetEnumerator()
-        {
-            return GetEnumerator();
-        }
-
-        /// <summary>
-        /// Used to raise the CollectionChanged event.
-        /// </summary>
-        /// <param name="e"></param>
-        protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
-        {
-            if (this.CollectionChanged != null)
-                this.CollectionChanged(this, e ?? new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValueEditor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValueEditor.cs
deleted file mode 100644 (file)
index 98ff50d..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing {
-    using System;
-    using System.ComponentModel;
-    using System.Globalization;
-    using System.Text;
-    using System.Windows;
-    using System.Activities.Presentation.Internal.Properties;
-    using System.Activities.Presentation;
-    using System.Runtime;
-
-    /// <summary>
-    /// Container for any and all inline editor logic for properties.  This class can hold
-    /// a single DataTemplates - one for Inline editor.
-    /// </summary>
-    public class PropertyValueEditor {
-
-        private DataTemplate _inlineEditorTemplate;
-
-        /// <summary>
-        /// Creates a PropertyValueEditor
-        /// </summary>
-        public PropertyValueEditor() {
-        }
-
-        /// <summary>
-        /// Creates a PropertyValueEditor
-        /// </summary>
-        /// <param name="inlineEditorTemplate">The DataTemplate that is used for an inline editor.  
-        /// This DataTemplate has its DataContext set to a PropertyValue</param>
-        public PropertyValueEditor(DataTemplate inlineEditorTemplate) {
-            _inlineEditorTemplate = inlineEditorTemplate;
-        }
-
-        /// <summary>
-        /// Gets or sets the InlineEditorTemplate -- the DataTemplate that is used for an inline editor.  
-        /// This DataTemplate has its DataContext set to a PropertyValue
-        /// </summary>
-        [Fx.Tag.KnownXamlExternalAttribute]
-        public DataTemplate InlineEditorTemplate
-        {
-            get { return _inlineEditorTemplate; }
-            set { _inlineEditorTemplate = value; }
-        }
-
-        internal virtual DataTemplate GetPropertyValueEditor(PropertyContainerEditMode mode) {
-            return (mode == PropertyContainerEditMode.Inline) ? _inlineEditorTemplate : null;
-        }
-
-        /// <summary>
-        /// Utility method that creates a new EditorAttribute for the specified
-        /// PropertyValueEditor
-        /// </summary>
-        /// <param name="editor">PropertyValueEditor instance for which to create
-        /// the new EditorAttribute</param>
-        /// <returns>New EditorAttribute for the specified PropertyValueEditor</returns>
-        public static EditorAttribute CreateEditorAttribute(PropertyValueEditor editor) {
-            if (editor == null)
-                throw FxTrace.Exception.ArgumentNull("editor");
-
-            return CreateEditorAttribute(editor.GetType());
-        }
-
-        /// <summary>
-        /// Utility method that creates a new EditorAttribute for the specified
-        /// PropertyValueEditor type
-        /// </summary>
-        /// <param name="propertyValueEditorType">PropertyValueEditor type for which to create
-        /// the new EditorAttribute</param>
-        /// <returns>New EditorAttribute for the specified PropertyValueEditor type</returns>
-        public static EditorAttribute CreateEditorAttribute(Type propertyValueEditorType) {
-            if (propertyValueEditorType == null)
-                throw FxTrace.Exception.ArgumentNull("propertyValueEditorType");
-
-            if (!typeof(PropertyValueEditor).IsAssignableFrom(propertyValueEditorType))
-                throw FxTrace.Exception.AsError(new ArgumentException(
-                    string.Format(
-                        CultureInfo.CurrentCulture,
-                        Resources.Error_ArgIncorrectType,
-                        "propertyValueEditorType",
-                        typeof(PropertyValueEditor).Name)));
-
-            return new EditorAttribute(propertyValueEditorType, typeof(PropertyValueEditor));
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValueEditorCommands.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValueEditorCommands.cs
deleted file mode 100644 (file)
index 28fc36b..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing {
-    using System;
-    using System.Windows;
-    using System.Windows.Input;
-
-    /// <summary>
-    /// Standard commands controling the PropertyValueEditing experience
-    /// </summary>
-    public static class PropertyValueEditorCommands {
-        // PropertyContainer mode-switching commands
-        private static RoutedCommand _showInlineEditor;
-        private static RoutedCommand _showExtendedPopupEditor;
-        private static RoutedCommand _showExtendedPinnedEditor;
-        private static RoutedCommand _showDialogEditor;
-
-        // Transaction commands
-        private static RoutedCommand _beginTransaction;
-        private static RoutedCommand _commitTransaction;
-        private static RoutedCommand _abortTransaction;
-
-        // Signal to the editor that PropertyContainer is done editing a particular value.
-        // It is up to the host to interpret this command as it sees fit.  Cider may decide
-        // to highlight the next property in the list.  Sparkle will return the focus back to
-        // the design surface.
-        private static RoutedCommand _finishEditing;
-
-        /// <summary>
-        /// Editors may raise this command to switch PropertyContainer mode Inline
-        /// </summary>
-        public static RoutedCommand ShowInlineEditor {
-            get {
-                if (_showInlineEditor == null)
-                    _showInlineEditor = new RoutedCommand("ShowInlineEditor", typeof(PropertyValueEditorCommands));
-                
-                return _showInlineEditor; 
-            }
-        }
-
-        /// <summary>
-        /// Editors may raise this command to switch PropertyContainer mode ExtendedPopup
-        /// </summary>
-        public static RoutedCommand ShowExtendedPopupEditor {
-            get {
-                if (_showExtendedPopupEditor == null)
-                    _showExtendedPopupEditor = new RoutedCommand("ShowExtendedPopupEditor", typeof(PropertyValueEditorCommands));
-                
-                return _showExtendedPopupEditor;
-            }
-        }
-
-        /// <summary>
-        /// Editors may raise this command to switch PropertyContainer mode ExtendedPinned
-        /// </summary>
-        public static RoutedCommand ShowExtendedPinnedEditor {
-            get {
-                if (_showExtendedPinnedEditor == null)
-                    _showExtendedPinnedEditor = new RoutedCommand("ShowExtendedPinnedEditor", typeof(PropertyValueEditorCommands));
-                
-                return _showExtendedPinnedEditor;
-            } 
-        }
-
-        /// <summary>
-        /// Editors may raise this command to switch PropertyContainer mode Dialog
-        /// </summary>
-        public static RoutedCommand ShowDialogEditor {
-            get {
-                if (_showDialogEditor == null)
-                    _showDialogEditor = new RoutedCommand("ShowDialogEditor", typeof(PropertyValueEditorCommands));
-                
-                return _showDialogEditor;
-            }
-        }
-
-        /// <summary>
-        /// Editors may raise this command to begin a transaction.
-        /// </summary>
-        public static RoutedCommand BeginTransaction {
-            get {
-                if (_beginTransaction == null)
-                    _beginTransaction = new RoutedCommand("BeginTransaction", typeof(PropertyValueEditorCommands));
-                
-                return _beginTransaction; 
-            }
-        }
-
-        /// <summary>
-        /// Editors may raise this command to commit a transaction. If this command is
-        /// executed when there aren't any open transactions, an exception will be thrown.
-        /// </summary>
-        public static RoutedCommand CommitTransaction {
-            get {
-                if (_commitTransaction == null)
-                    _commitTransaction = new RoutedCommand("CommitTransaction", typeof(PropertyValueEditorCommands));
-                
-                return _commitTransaction; 
-            } 
-        }
-
-        /// <summary>
-        /// Editors may raise this command to abort a transaction. If this command is
-        /// executed when there aren't any open transactions, an exception will be thrown.
-        /// </summary>
-        public static RoutedCommand AbortTransaction { 
-            get {
-                if (_abortTransaction == null)
-                    _abortTransaction = new RoutedCommand("AbortTransaction", typeof(PropertyValueEditorCommands));
-                
-                return _abortTransaction;
-            }
-        }
-
-        /// <summary>
-        /// Editors may raise this command to indicate to the host that they have finished editing.
-        /// This allows the host to do cleanup or potentially change the focus to a different UIElement.
-        /// </summary>
-        public static RoutedCommand FinishEditing {
-            get {
-                if (_finishEditing == null)
-                    _finishEditing = new RoutedCommand("FinishEditing", typeof(PropertyValueEditorCommands));
-                
-                return _finishEditing;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValueExceptionEventArgs.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValueExceptionEventArgs.cs
deleted file mode 100644 (file)
index 7bfaccd..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing
-{
-    using System;
-    using System.Globalization;
-    using System.Runtime;
-    using System.Activities.Presentation;
-
-    /// <summary>
-    /// EventArgs class for the PropertyValueException
-    /// </summary>
-    [Fx.Tag.XamlVisible(false)]
-    public class PropertyValueExceptionEventArgs : EventArgs
-    {
-
-        private string _message;
-        private PropertyValue _value;
-        private PropertyValueExceptionSource _source;
-        private Exception _exception;
-
-        /// <summary>
-        /// Creates a PropertyValueExceptionEventArgs
-        /// </summary>
-        /// <param name="message">A message indicating what failed</param>
-        /// <param name="value">The PropertyValue in which the exception is occuring</param>
-        /// <param name="source">The source that generated this exception (get or set)</param>
-        /// <param name="exception">The inner excpetion</param>
-        /// <exception cref="ArgumentNullException">When message is null</exception>
-        /// <exception cref="ArgumentNullException">When value is null</exception>
-        /// <exception cref="ArgumentNullException">When exception is null</exception>
-        public PropertyValueExceptionEventArgs(string message, PropertyValue value, PropertyValueExceptionSource source, Exception exception)
-        {
-            if (message == null) throw FxTrace.Exception.ArgumentNull("message");
-            if (value == null) throw FxTrace.Exception.ArgumentNull("value");
-            if (!EnumValidator.IsValid(source)) throw FxTrace.Exception.AsError(new ArgumentOutOfRangeException("source"));
-            if (exception == null) throw FxTrace.Exception.ArgumentNull("exception");
-
-            _message = message;
-            _value = value;
-            _source = source;
-            _exception = exception;
-        }
-
-        /// <summary>
-        /// Gets the message indicating what failed
-        /// </summary>
-        public string Message { get { return _message; } }
-
-        /// <summary>
-        /// Gets the PropertyValue for which the exception is occuring
-        /// </summary>
-        public PropertyValue PropertyValue { get { return _value; } }
-
-        /// <summary>
-        /// Gets the PropertyValueExceptionSource that generated the exception
-        /// </summary>
-        public PropertyValueExceptionSource Source { get { return _source; } }
-
-        /// <summary>
-        /// Gets returns the contained exception.
-        /// </summary>
-        public Exception Exception { get { return _exception; } }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValueExceptionSource.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValueExceptionSource.cs
deleted file mode 100644 (file)
index 33892d7..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing {
-    using System;
-
-    /// <summary>
-    /// Enum indicating the source of the exception thrown by PropertyValue
-    /// </summary>
-    public enum PropertyValueExceptionSource {
-        /// <summary>
-        /// Indicates that the exception occurred during a Get
-        /// </summary>
-        Get,
-
-        /// <summary>
-        /// Indicates that the exception occurred during a Set
-        /// </summary>
-        Set
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValueSource.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyValueSource.cs
deleted file mode 100644 (file)
index 8dab18e..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing {
-    using System;
-
-    /// <summary>
-    /// Abstract base class representing the source of a property value.  An example of a concrete
-    /// implementation is the DependencyPropertyValueSource which has the source information for 
-    /// a property value that is a Dependency Property.
-    /// </summary>
-    public abstract class PropertyValueSource { }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/categoryentry.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/categoryentry.cs
deleted file mode 100644 (file)
index 066ef06..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing {
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Activities.Presentation;
-    using System;
-
-    /// <summary>
-    /// The CategoryEntry class is a part of the property editing object model.  It models a 
-    /// Category which has a localized name along with a collection of properties.
-    /// </summary>
-    public abstract class CategoryEntry : INotifyPropertyChanged, IPropertyFilterTarget {
-
-        private string _name;
-        private bool _matchesFilter;
-
-        /// <summary>
-        /// Creates a new CategoryEntry.  For host Infrastructure use
-        /// </summary>
-        /// <param name="name">The localized name of the corresponding Category as defined by the 
-        /// CategoryAttribute</param>
-        /// <exception cref="ArgumentNullException">When name is either empty or null.</exception>
-        protected CategoryEntry(string name) {
-            if (string.IsNullOrEmpty(name))
-                throw FxTrace.Exception.ArgumentNull("name");
-
-            _name = name;
-        }
-
-        /// <summary>
-        /// Returns the localized Category name
-        /// </summary>
-        public string CategoryName {
-            get { return _name; }
-        }
-
-        /// <summary>
-        /// Returns an IEnumerable collection of all of the properties in the category.
-        /// </summary>
-        public abstract IEnumerable<PropertyEntry> Properties { get; }
-
-        /// <summary>
-        /// Indexer that returns a Property instance given the property name.
-        /// </summary>
-        /// <param name="propertyName">The string property name to return a Property instance for.</param>
-        /// <returns>Property corresponding to the passed in propertyName if it exists, otherwise null</returns>
-        public abstract PropertyEntry this[string propertyName] { get; }
-
-        // INotifyPropertyChanged Members
-
-        /// <summary>
-        /// INotifyPropertyChanged event
-        /// </summary>
-        public event PropertyChangedEventHandler PropertyChanged;
-
-        /// <summary>
-        /// Raises the INotifyPropertyChanged.PropertyChanged event
-        /// </summary>
-        /// <param name="propertyName">the name of the property that is changing</param>
-        /// <exception cref="ArgumentNullException">When propertyName is null</exception>
-        protected virtual void OnPropertyChanged(string propertyName) {
-            if (propertyName == null)
-                throw FxTrace.Exception.ArgumentNull("propertyName");
-
-            if (PropertyChanged != null) {
-                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-            }
-        }
-
-
-        // IPropertyFilterTarget Members
-
-        /// <summary>
-        /// IPropertyFilterTarget event
-        /// </summary>
-        public event EventHandler<PropertyFilterAppliedEventArgs> FilterApplied;
-
-        /// <summary>
-        /// Raises the IPropertyFilterTarget.FilterApplied event
-        /// </summary>
-        /// <param name="filter">The PropertyFilter being applied</param>
-        protected virtual void OnFilterApplied(PropertyFilter filter) {
-            if (FilterApplied != null) {
-                FilterApplied(this, new PropertyFilterAppliedEventArgs(filter));
-            }
-        }
-
-        /// <summary>
-        /// IPropertyFilterTarget method
-        /// </summary>
-        /// <param name="filter"></param>
-        public virtual void ApplyFilter(PropertyFilter filter) {
-            this.MatchesFilter = filter == null ? true : filter.Match(this);
-            OnFilterApplied(filter);
-        }
-        
-        /// <summary>
-        /// IPropertyFilterTarget property
-        /// </summary>
-        public virtual bool MatchesFilter {
-            get { return _matchesFilter; }
-            protected set {
-                if (_matchesFilter != value) {
-                    _matchesFilter = value;
-                    this.OnPropertyChanged("MatchesFilter");
-                }
-            }
-        }
-        
-        /// <summary>
-        /// IPropertyFilterTarget method
-        /// </summary>
-        /// <param name="predicate">The PropertyFilterPredicate to match against</param>
-        /// <returns>true if there is a match, otherwise false</returns>
-        public abstract bool MatchesPredicate(PropertyFilterPredicate predicate);
-
-    }
-}
-
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/newitemfactory.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/newitemfactory.cs
deleted file mode 100644 (file)
index 6d59f45..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing {
-    using System;
-    using System.Windows;
-    using System.Reflection;
-    using System.IO;
-    using System.Windows.Markup;
-    using System.Windows.Media.Imaging;
-    using System.Windows.Controls;
-    using System.Activities.Presentation.Internal;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Activities.Presentation;
-
-    /// <summary>
-    /// Base class that represents a factory for creating new items for a collection or
-    /// for a property value.  3rd party control developers may choose to derive from this class
-    /// to override the default behavior of specifying names and images that are used by
-    /// collection editor and sub-property editor when creating instances of custom controls.
-    /// </summary>
-    class NewItemFactory {
-
-        private Type[] NoTypes = new Type[0];
-
-        /// <summary>
-        /// Default constructor
-        /// </summary>
-        public NewItemFactory() { }
-
-        /// <summary>
-        /// Returns an object that can be set as the Content of a ContentControl 
-        /// and that will be used an icon for the requested type by the property editing host.
-        /// The default implementation of this method uses naming convention, searching for
-        /// the embedded resources in the same assembly as the control, that are named the 
-        /// same as the control (including namespace), followed by ".Icon", followed by
-        /// the extension for the file type itself.  Currently, only ".png", ".bmp", ".gif",
-        /// ".jpg", and ".jpeg" extensions are recognized.
-        /// </summary>
-        /// <param name="type">Type of the object to look up</param>
-        /// <param name="desiredSize">The desired size of the image to retrieve.  If multiple
-        /// images are available this method retrieves the image that most closely
-        /// resembles the requested size.  However, it is not guaranteed to return an image
-        /// that matches the desired size exactly.</param>
-        /// <returns>An image for the specified type.</returns>
-        /// <exception cref="ArgumentNullException">If type is null</exception>
-        public virtual object GetImage(Type type, Size desiredSize) {
-            if (type == null)
-                throw FxTrace.Exception.ArgumentNull("type");
-
-            return ManifestImages.GetImage(type, desiredSize);
-        }
-
-        /// <summary>
-        /// Returns the name for the item this factory adds for the passed in type.  This is 
-        /// the name that will be used in the "Add Item" drop down to identify the type being added.
-        /// The default implementation returns the short type name.
-        /// </summary>
-        /// <param name="type">Type to retrieve the display name for.</param>
-        /// <returns>The display name for the specified type</returns>
-        /// <exception cref="ArgumentNullException">If type is null</exception>
-        [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "The intended usage in the larger scope of the class is the stronger type")]
-        public virtual string GetDisplayName(Type type)
-        {
-            if (type == null)
-                throw FxTrace.Exception.ArgumentNull("type");
-
-            return type.Name;
-        }
-
-        /// <summary>
-        /// Returns an instance of an item that is added to the collection for the passed in Type.
-        /// The default implementation looks for public constructors that take no arguments.
-        /// If no such constructors are found, null is returned.
-        /// </summary>
-        /// <param name="type">Type of the object to create</param>
-        /// <returns>Instance of the specified type, or null if no appropriate constructor was found
-        /// </returns>
-        /// <exception cref="ArgumentNullException">If type is null</exception>
-        public virtual object CreateInstance(Type type) {
-            if (type == null)
-                throw FxTrace.Exception.ArgumentNull("type");
-
-            ConstructorInfo ctor = type.GetConstructor(
-                BindingFlags.Public | BindingFlags.Instance,
-                null,
-                NoTypes,
-                null);
-
-            return ctor == null ? null : ctor.Invoke(null);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/newitemtypesattribute.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/newitemtypesattribute.cs
deleted file mode 100644 (file)
index b0a1bd6..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Activities.Presentation.Internal;
-    using System.Activities.Presentation.Internal.Properties;
-    using System.Runtime;
-    using System.Diagnostics.CodeAnalysis;
-
-    /// <summary>
-    /// This attributes is used to specify which object Types can be assigned as the value of a given
-    /// property or as the value of a given property type.  If the property represents a collection,
-    /// this attribute specifies the object Types of which instances can be created as the items
-    /// of that collection.
-    /// </summary>
-    [Fx.Tag.XamlVisible(false)]
-    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, AllowMultiple = true)]
-    sealed class NewItemTypesAttribute : Attribute
-    {
-
-        private Type _factoryType;
-        private Type[] _types;
-
-        /// <summary>
-        /// Constructor for the attribute
-        /// </summary>
-        /// <param name="type">Type that this attribute declares as being valid new item Type.</param>
-        /// <exception cref="ArgumentNullException">If type is null.</exception>
-        public NewItemTypesAttribute(Type type)
-        {
-            if (type == null)
-                throw FxTrace.Exception.ArgumentNull("type");
-
-            _factoryType = typeof(NewItemFactory);
-            _types = new Type[] { type };
-        }
-
-        /// <summary>
-        /// Constructor for the attribute
-        /// </summary>
-        /// <param name="types">List of types that this attribute declares as being
-        /// valid new item Types.</param>
-        /// <exception cref="ArgumentNullException">If types is null or emtpy.</exception>
-        public NewItemTypesAttribute(params Type[] types)
-        {
-            if (types == null || types.Length < 1)
-                throw FxTrace.Exception.ArgumentNull("types");
-
-            _factoryType = typeof(NewItemFactory);
-            _types = types;
-        }
-
-        /// <summary>
-        /// Gets a list of Types that this attribute declares as being valid new item Types.
-        /// Guaranteed to be non-null.
-        /// </summary>
-        [SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods", Justification = "Suppress to avoid unnecessary change.")]
-        public Type Type
-        {
-            get
-            {
-                return _types[0];
-            }
-        }
-
-        /// <summary>
-        /// Gets a list of Types that this attribute declares as being valid new item Types.
-        /// Guaranteed to be non-null.
-        /// </summary>
-        public IEnumerable<Type> Types
-        {
-            get
-            {
-                return _types;
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the factory Type associated with this attribute.  The Type is
-        /// guaranteed to derive from NewItemFactory.
-        /// </summary>
-        /// <exception cref="ArgumentException">If type does not derive from NewItemFactory</exception>
-        /// <exception cref="ArgumentNullException">If type is null.</exception>
-        public Type FactoryType
-        {
-            get
-            {
-                return _factoryType;
-            }
-            set
-            {
-                if (value == null)
-                    throw FxTrace.Exception.ArgumentNull("value");
-                if (!typeof(NewItemFactory).IsAssignableFrom(value))
-                    throw FxTrace.Exception.AsError(new ArgumentException(Resources.Error_InvalidFactoryType));
-
-                _factoryType = value;
-            }
-        }
-
-        /// <summary>
-        /// Gets the TypeId for this attribute.  Returns an equality array unique to this attribute
-        /// type and the contained factory type.  The order in which the type attributes are passed
-        /// into the constructor of this class (if there are more than one) matters and is used in 
-        /// determining the equality of two NewItemTypesAttribute instances.
-        /// </summary>
-        public override object TypeId
-        {
-            get
-            {
-                object[] typeId = new object[_types.Length + 2];
-                for (int i = 0; i < _types.Length; i++)
-                {
-                    typeId[i + 2] = _types[i];
-                }
-                typeId[0] = typeof(NewItemTypesAttribute);
-                typeId[1] = _factoryType;
-                return new EqualityArray(typeId);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/propertyentry.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/propertyentry.cs
deleted file mode 100644 (file)
index 117f124..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-using System.Diagnostics.CodeAnalysis;
-
-namespace System.Activities.Presentation.PropertyEditing
-{
-    using System.ComponentModel;
-    using System.Collections;
-    using System;
-    using System.Diagnostics;
-    using System.Activities.Presentation;
-
-    /// <summary>
-    /// The PropertyEntry class provides additional, mostly type-specific data for a property.
-    /// </summary>
-    public abstract class PropertyEntry : INotifyPropertyChanged, IPropertyFilterTarget {
-
-        private PropertyValue _parentValue;
-        private bool _matchesFilter = true;
-        private PropertyValue _value;
-
-        /// <summary>
-        /// Creates a PropertyEntry.  For host infrastructure derived classes.
-        /// </summary>
-        protected PropertyEntry() : this(null) { }
-
-        /// <summary>
-        /// Creates a PropertyEntry that acts as a sub-property of the specified PropertyValue.
-        /// For host infrastructure derived classes.
-        /// </summary>
-        /// <param name="parentValue">The parent PropertyValue.
-        /// Root properties do not have a parent PropertyValue.</param>
-        protected PropertyEntry(PropertyValue parentValue) {
-            _parentValue = parentValue;
-        }
-
-        /// <summary>
-        /// Gets the name of the encapsulated property.
-        /// </summary>
-        public abstract string PropertyName { get; }
-
-        /// <summary>
-        /// Gets the DisplayName for the property. By default, it is the
-        /// PropertyName.
-        /// </summary>
-        public virtual string DisplayName { get { return this.PropertyName; } }
-
-        /// <summary>
-        /// Gets the Type of the encapsulated property.
-        /// </summary>
-        public abstract Type PropertyType { get; }
-
-        /// <summary>
-        /// Gets the name of the category that this property resides in.
-        /// </summary>
-        public abstract string CategoryName { get; }
-
-        /// <summary>
-        /// Gets the description of the encapsulated property.
-        /// </summary>
-        public abstract string Description { get; }
-
-        /// <summary>
-        /// Returns true if there are standard values for this property.
-        /// The default implementation checks if the StandardValues property
-        /// returns a non-null collection with a count > 0.
-        /// </summary>
-        protected virtual bool HasStandardValues {
-            get {
-                ICollection values = StandardValues;
-                return values != null && values.Count > 0;
-            }
-        }
-
-        /// <summary>
-        /// Accessor because we use this property in the property container.
-        /// </summary>
-        internal bool HasStandardValuesInternal {
-            get { return HasStandardValues; }
-        }
-
-        /// <summary>
-        /// Gets the read-only attribute of the encapsulated property.
-        /// </summary>
-        public abstract bool IsReadOnly { get; }
-
-        /// <summary>
-        /// Gets a flag indicating whether the encapsulated property is an advanced property.
-        /// </summary>
-        public abstract bool IsAdvanced { get; }
-
-        /// <summary>
-        /// Gets any StandardValues that the encapsulated property supports.
-        /// </summary>
-        public abstract ICollection StandardValues { get; }
-
-        /// <summary>
-        /// Gets to PropertyValueEditor to be used for editing of this PropertyEntry.
-        /// May be null.  PropertyContainer listens to changes made to this property.
-        /// If the value changes, it's the responsibility of the deriving class to fire the
-        /// appropriate PropertyChanged event.
-        /// </summary>
-        public abstract PropertyValueEditor PropertyValueEditor { get; }
-
-        /// <summary>
-        /// Gets the parent PropertyValue.  This is only used for sub-properties and,
-        /// hence, its balue may be null.
-        /// </summary>
-        public PropertyValue ParentValue {
-            get {
-                return _parentValue;
-            }
-        }
-
-        /// <summary>
-        /// Gets the PropertyValue (data model) for this PropertyEntry.
-        /// </summary>
-        public PropertyValue PropertyValue {
-            get {
-                if (_value == null)
-                    _value = CreatePropertyValueInstance();
-
-                return _value;
-            }
-        }
-
-        /// <summary>
-        /// Used by the host infrastructure to create a new host-specific PropertyValue instance.
-        /// </summary>
-        /// <returns>new PropertyValue</returns>
-        protected abstract PropertyValue CreatePropertyValueInstance();
-
-        // IPropertyFilterTarget Members
-
-        /// <summary>
-        /// IPropertyFilterTarget event
-        /// </summary>
-        public event EventHandler<PropertyFilterAppliedEventArgs> FilterApplied;
-
-        /// <summary>
-        /// IPropertyFilterTarget method. PropertyContainer listens to changes made to this property.
-        /// </summary>
-        public bool MatchesFilter {
-            get {
-                return _matchesFilter;
-            }
-            protected set {
-                if (value != _matchesFilter) {
-                    _matchesFilter = value;
-                    OnPropertyChanged("MatchesFilter");
-                }
-            }
-        }
-
-        /// <summary>
-        /// IPropertyFilterTarget method
-        /// </summary>
-        /// <param name="predicate">the predicate to match against</param>
-        /// <returns>true if there is a match</returns>
-        public virtual bool MatchesPredicate(PropertyFilterPredicate predicate) {
-            return predicate == null ?
-                false :
-                predicate.Match(this.DisplayName) || predicate.Match(this.PropertyType.Name);
-        }
-
-        /// <summary>
-        /// IPropertyFilterTarget method
-        /// </summary>
-        /// <param name="filter">the PropertyFilter to apply</param>
-        public virtual void ApplyFilter(PropertyFilter filter) {
-            this.MatchesFilter = filter == null ? true : filter.Match(this);
-            OnFilterApplied(filter);
-        }
-
-        /// <summary>
-        /// Used to raise the IPropertyFilterTarget FilterApplied event
-        /// </summary>
-        /// <param name="filter"></param>
-        protected virtual void OnFilterApplied(PropertyFilter filter) {
-            if (FilterApplied != null)
-                FilterApplied(this, new PropertyFilterAppliedEventArgs(filter));
-        }
-
-
-        // INotifyPropertyChanged
-
-        /// <summary>
-        /// INotifyPropertyChanged event
-        /// </summary>
-        public event PropertyChangedEventHandler PropertyChanged;
-
-        /// <summary>
-        /// Used to raise the INotifyPropertyChanged PropertyChanged event
-        /// </summary>
-        /// <param name="e">EventArgs for this event</param>
-        protected virtual void OnPropertyChanged(PropertyChangedEventArgs e) {
-            if (e == null)
-                throw FxTrace.Exception.ArgumentNull("e");
-
-            if (this.PropertyChanged != null)
-                this.PropertyChanged(this, e);
-        }
-
-        /// <summary>
-        /// Used to raise the INotifyPropertyChanged event
-        /// </summary>
-        /// <param name="propertyName"></param>
-        /// <exception cref="ArgumentNullException">When propertyName is null</exception>
-        protected virtual void OnPropertyChanged(string propertyName) {
-            if (propertyName == null)
-                throw FxTrace.Exception.ArgumentNull("propertyName");
-
-            if (this.PropertyChanged != null)
-                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-        }
-
-    }
-}
-
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/propertyentrycollection.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/propertyentrycollection.cs
deleted file mode 100644 (file)
index b1926e1..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-namespace System.Activities.Presentation.PropertyEditing
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-    using System.Activities.Presentation;
-    using System.Collections;
-
-    /// <summary>
-    /// Collection class that is used to keep the collection of PropertyEntry instances for 
-    /// subproperties of a given PropertyEntry
-    /// </summary>
-    public abstract class PropertyEntryCollection : IEnumerable<PropertyEntry>
-    {
-
-        private PropertyValue _parentValue;
-
-        /// <summary>
-        /// Creates a PropertyEntryCollection.  For host implementations.
-        /// </summary>
-        /// <param name="parentValue">The parent PropertyValue</param>
-        /// <exception cref="ArgumentNullException">When parentValue is null</exception>
-        protected PropertyEntryCollection(PropertyValue parentValue)
-        {
-            if (parentValue == null)
-                throw FxTrace.Exception.ArgumentNull("parentValue");
-
-            _parentValue = parentValue;
-        }
-
-        /// <summary>
-        /// Gets the parent PropertyValue
-        /// </summary>
-        public PropertyValue ParentValue { get { return _parentValue; } }
-
-        /// <summary>
-        /// Gets a PropertyEntry from this collection of the given name.  Used for
-        /// sub-property retrieval.
-        /// </summary>
-        /// <param name="propertyName">The name of the property</param>
-        /// <returns>PropertyEntry instance of the given name or null if it doesn't exist.</returns>
-        public abstract PropertyEntry this[string propertyName] { get; }
-
-        /// <summary>
-        /// Gets the number of PropertyEntry instances in this collection
-        /// (typically the number of sub-properties for the parent PropertyValue)
-        /// </summary>
-        public abstract int Count { get; }
-
-        /// <summary>
-        /// Returns an IEnumerator of all the PropertyEntry instances in this collection.
-        /// </summary>
-        /// <returns></returns>
-        public abstract IEnumerator<PropertyEntry> GetEnumerator();
-
-        IEnumerator IEnumerable.GetEnumerator()
-        {
-            return this.GetEnumerator();
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PublishServiceCallback.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PublishServiceCallback.cs
deleted file mode 100644 (file)
index 0c82275..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-
-namespace System.Activities.Presentation {
-
-    using System;
-
-    /// <summary>
-    /// A delegate that is called back when an object should publish an instance of a
-    /// service.
-    /// </summary>
-    /// <param name="serviceType">The type of service to be published.</param>
-    /// <returns>An instance of serviceType.</returns>
-    public delegate object PublishServiceCallback(Type serviceType);
-
-    /// <summary>
-    /// A generic delegate that is called back when an object should publish an 
-    /// instance of a service.
-    /// </summary>
-    /// <typeparam name="TServiceType">The type of service to be published.</typeparam>
-    /// <returns>An instance of TServiceType.</returns>
-    public delegate TServiceType PublishServiceCallback<TServiceType>();
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/ServiceManager.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/ServiceManager.cs
deleted file mode 100644 (file)
index 8a7d0f2..0000000
+++ /dev/null
@@ -1,427 +0,0 @@
-namespace System.Activities.Presentation
-{
-
-    using System.Activities.Presentation.Internal.Properties;
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Activities.Presentation;
-
-    /// <summary>
-    /// The service manager implements IServiceProvider and provides access 
-    /// to services offered by the editing context. 
-    /// </summary>
-    /// Suppressing FxCop from complaining about our use of naming, since it has been approved
-    [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
-    public abstract class ServiceManager : IServiceProvider, IEnumerable<Type>
-    {
-
-        /// <summary>
-        /// Creates a new ServiceManager.
-        /// </summary>
-        protected ServiceManager() { }
-
-        /// <summary>
-        /// Returns true if the service manager contains a service of the given type.
-        /// </summary>
-        /// <param name="serviceType">The type of service to check.</param>
-        /// <returns>True if a service of type serviceType has been published.</returns>
-        /// <exception cref="ArgumentNullException">if serviceType is null.</exception>
-        public abstract bool Contains(Type serviceType);
-
-        /// <summary>
-        /// Returns true if the service manager contains a service of the given type.
-        /// </summary>
-        /// <typeparam name="TServiceType">The type of service to check.</typeparam>
-        /// <returns>True if a service of type TServiceType has been published.</returns>
-        [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
-        public bool Contains<TServiceType>()
-        {
-            return Contains(typeof(TServiceType));
-        }
-
-        /// <summary>
-        /// Retrives the requested service.  Unlike GetService, GetRequiredService 
-        /// throws a NotSupportedException if the service isn’t available.  The reason 
-        /// we provide this method, and not a normal GetService method is our wish to 
-        /// move services to a more reliable contract.
-        /// </summary>
-        /// <typeparam name="TServiceType">The type of service to retrieve.</typeparam>
-        /// <returns>An instance of the service.  This never returns null.</returns>
-        /// <exception cref="NotSupportedException">if there is no service of the given type.</exception>
-        [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
-        [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
-        public TServiceType GetRequiredService<TServiceType>()
-        {
-            TServiceType service = GetService<TServiceType>();
-            if (service == null)
-            {
-                throw FxTrace.Exception.AsError(new NotSupportedException(
-                    string.Format(CultureInfo.CurrentCulture,
-                    Resources.Error_RequiredService, typeof(TServiceType).FullName)));
-            }
-            return service;
-        }
-
-        /// <summary>
-        /// Retrives the requested service.  This method returns null if the service could not be located.
-        /// </summary>
-        /// <typeparam name="TServiceType">The type of service to retrieve.</typeparam>
-        /// <returns>An instance of the service, or null if the service has not been published.</returns>
-        [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
-        public TServiceType GetService<TServiceType>()
-        {
-            object service = GetService(typeof(TServiceType));
-            return (TServiceType)service;
-        }
-
-        /// <summary>
-        /// Retrives the requested service.  This method returns null if the service could not be located.
-        /// </summary>
-        /// <param name="serviceType">The type of service to retrieve.</param>
-        /// <returns>An instance of the service, or null if the service has not been published.</returns>
-        /// <exception cref="ArgumentNullException">If serviceType is null.</exception>
-        public abstract object GetService(Type serviceType);
-
-        /// <summary>
-        /// Retrives an enumerator that can be used to enumerate all of the services that this 
-        /// service manager publishes.
-        /// </summary>
-        /// <returns>An enumeration of published services.</returns>
-        public abstract IEnumerator<Type> GetEnumerator();
-
-        /// <summary>
-        /// Calls back on the provided callback when someone has published the requested service.  
-        /// If the service was already available, this method invokes the callback immediately.
-        /// 
-        /// A generic version of this method is provided for convenience, and calls the non-generic 
-        /// method with appropriate casts.
-        /// </summary>
-        /// <param name="serviceType">The type of service to subscribe to.</param>
-        /// <param name="callback">A callback that will be notified when the service is available.</param>
-        /// <exception cref="ArgumentNullException">If serviceType or callback is null.</exception>
-        public abstract void Subscribe(Type serviceType, SubscribeServiceCallback callback);
-
-        /// <summary>
-        /// Calls back on the provided callback when someone has published the requested service.  
-        /// If the service was already available, this method invokes the callback immediately.
-        /// 
-        /// A generic version of this method is provided for convenience, and calls the non-generic 
-        /// method with appropriate casts.
-        /// </summary>
-        /// <typeparam name="TServiceType">The type of service to subscribe.</typeparam>
-        /// <param name="callback">A callback that will be invoked when the service is available.</param>
-        /// <exception cref="ArgumentNullException">If callback is null.</exception>
-        [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
-        public void Subscribe<TServiceType>(SubscribeServiceCallback<TServiceType> callback)
-        {
-            if (callback == null) throw FxTrace.Exception.ArgumentNull("callback");
-
-            // Call the standard Subscribe method and use a generic proxy
-            SubscribeProxy<TServiceType> proxy = new SubscribeProxy<TServiceType>(callback);
-            Subscribe(typeof(TServiceType), proxy.Callback);
-        }
-
-        /// <summary>
-        /// Publishes the given service type, but does not declare an instance yet.  When someone
-        /// requests the service the PublishServiceCallback will be invoked to create the instance.
-        /// The callback is only invoked once and after that the instance it returned is cached.
-        /// 
-        /// A generic version of this method is provided for convenience, and calls the non-generic 
-        /// method with appropriate casts.
-        /// </summary>
-        /// <param name="serviceType">The type of service to publish.</param>
-        /// <param name="callback">A callback that will be invoked when an instance of the service is needed.</param>
-        /// <exception cref="ArgumentNullException">If serviceType or callback is null.</exception>
-        /// <exception cref="ArgumentException">If serviceType has already been published.</exception>
-        public abstract void Publish(Type serviceType, PublishServiceCallback callback);
-
-        /// <summary>
-        /// Publishes the given service.  Once published, the service instance remains in the
-        /// service manager until the editing context is disposed.
-        /// </summary>
-        /// <param name="serviceType">The type of service to publish.</param>
-        /// <param name="serviceInstance">An instance of the service.</param>
-        /// <exception cref="ArgumentNullException">If serviceType or serviceInstance is null.</exception>
-        /// <exception cref="ArgumentException">If serviceInstance does not derive from or implement serviceType, or if serviceType has already been published.</exception>
-        public abstract void Publish(Type serviceType, object serviceInstance);
-
-        /// <summary>
-        /// Publishes the given service type, but does not declare an instance yet.  When someone
-        /// requests the service the PublishServiceCallback will be invoked to create the instance.
-        /// The callback is only invoked once and after that the instance it returned is cached.
-        /// </summary>
-        /// <typeparam name="TServiceType">The type of service to publish.</typeparam>
-        /// <param name="callback">A callback to be invoked when the service is required.</param>
-        /// <exception cref="ArgumentNullException">If callback is null.</exception>
-        /// <exception cref="ArgumentException">If TServiceType has already been published.</exception>
-        [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
-        public void Publish<TServiceType>(PublishServiceCallback<TServiceType> callback)
-        {
-            if (callback == null) throw FxTrace.Exception.ArgumentNull("callback");
-
-            // Call the standard Subscribe method and use a generic proxy
-            PublishProxy<TServiceType> proxy = new PublishProxy<TServiceType>(callback);
-            Publish(typeof(TServiceType), proxy.Callback);
-        }
-
-        /// <summary>
-        /// Publishes the given service.  Once published, the service instance remains in the
-        /// service manager until the editing context is disposed.
-        /// </summary>
-        /// <typeparam name="TServiceType">The type of service to publish.</typeparam>
-        /// <param name="serviceInstance">The instance of the service to publish.</param>
-        /// <exception cref="ArgumentException">If TServiceType has already been published.</exception>
-        public void Publish<TServiceType>(TServiceType serviceInstance)
-        {
-            if (serviceInstance == null) throw FxTrace.Exception.ArgumentNull("serviceInstance");
-            Publish(typeof(TServiceType), serviceInstance);
-        }
-
-        /// <summary>
-        /// Removes a subscription for the TServiceType.
-        /// </summary>
-        /// <typeparam name="TServiceType">The type of service to remove the subscription from.</typeparam>
-        /// <param name="callback">The callback object to remove from the subscription.</param>
-        /// <exception cref="ArgumentNullException">If callback is null.</exception>
-        [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
-        public void Unsubscribe<TServiceType>(SubscribeServiceCallback<TServiceType> callback)
-        {
-            if (callback == null) throw FxTrace.Exception.ArgumentNull("callback");
-            SubscribeProxy<TServiceType> proxy = new SubscribeProxy<TServiceType>(callback);
-            Unsubscribe(typeof(TServiceType), proxy.Callback);
-        }
-
-        /// <summary>
-        /// Removes a subscription for the serviceType.
-        /// </summary>
-        /// <param name="serviceType">The type of service to remove the subscription from.</param>
-        /// <param name="callback">The callback object to remove from the subscription.</param>
-        /// <exception cref="ArgumentNullException">If serviceType or callback is null.</exception>
-        public abstract void Unsubscribe(Type serviceType, SubscribeServiceCallback callback);
-
-        /// <summary>
-        ///     This is a helper method that returns the target object for a delegate.
-        ///     If the delegate was created to proxy a generic delegate, this will correctly
-        ///     return the original object, not the proxy.
-        /// </summary>
-        /// <param name="callback">The delegate to get the target for.</param>
-        /// <returns>The object that is the callback target.  This can return null if the callback represents a static object.</returns>
-        /// <exception cref="ArgumentNullException">If callback is null.</exception>
-        protected static object GetTarget(Delegate callback)
-        {
-            if (callback == null) throw FxTrace.Exception.ArgumentNull("callback");
-            ICallbackProxy proxy = callback.Target as ICallbackProxy;
-            if (proxy != null)
-            {
-                return proxy.OriginalTarget;
-            }
-
-            return callback.Target;
-        }
-
-        /// <summary>
-        ///     This is a helper method that performs a Delegate.Remove, but knows
-        ///     how to unwrap delegates that are proxies to generic callbacks.  Use
-        ///     this in your Unsubscribe implementations.
-        /// </summary>
-        /// <param name="existing">The existing delegate to remove the callback from.</param>
-        /// <param name="toRemove">The callback to remove.</param>
-        /// <returns>A new value to assign to the existing delegate.</returns>
-        protected static Delegate RemoveCallback(Delegate existing, Delegate toRemove)
-        {
-            if (existing == null) return null;
-            if (toRemove == null) return existing;
-
-            ICallbackProxy toRemoveProxy = toRemove.Target as ICallbackProxy;
-            if (toRemoveProxy == null)
-            {
-                // The item to be removed is a normal delegate.  Just call
-                // Delegate.Remove
-                return Delegate.Remove(existing, toRemove);
-            }
-
-            toRemove = toRemoveProxy.OriginalDelegate;
-
-            Delegate[] invocationList = existing.GetInvocationList();
-            bool removedItems = false;
-
-            for (int idx = 0; idx < invocationList.Length; idx++)
-            {
-                Delegate item = invocationList[idx];
-                ICallbackProxy itemProxy = item.Target as ICallbackProxy;
-                if (itemProxy != null)
-                {
-                    item = itemProxy.OriginalDelegate;
-                }
-
-                if (item.Equals(toRemove))
-                {
-                    invocationList[idx] = null;
-                    removedItems = true;
-                }
-            }
-
-            if (removedItems)
-            {
-                // We must create a new delegate containing the 
-                // invocation list that is is left
-                existing = null;
-                foreach (Delegate d in invocationList)
-                {
-                    if (d != null)
-                    {
-                        if (existing == null)
-                        {
-                            existing = d;
-                        }
-                        else
-                        {
-                            existing = Delegate.Combine(existing, d);
-                        }
-                    }
-                }
-            }
-
-            return existing;
-        }
-
-        /// <summary>
-        /// Implementation of default IEnumerable.
-        /// </summary>
-        IEnumerator IEnumerable.GetEnumerator()
-        {
-            return GetEnumerator();
-        }
-
-        /// <summary>
-        /// This is a simple proxy that converts a non-generic publish callback to a generic
-        /// one.
-        /// </summary>
-        /// <typeparam name="TServiceType"></typeparam>
-        private class PublishProxy<TServiceType>
-        {
-            private PublishServiceCallback<TServiceType> _genericCallback;
-
-            internal PublishProxy(PublishServiceCallback<TServiceType> callback)
-            {
-                _genericCallback = callback;
-            }
-
-            internal PublishServiceCallback Callback
-            {
-                get
-                {
-                    return new PublishServiceCallback(PublishService);
-                }
-            }
-
-            private object PublishService(Type serviceType)
-            {
-
-                if (serviceType == null) throw FxTrace.Exception.ArgumentNull("serviceType");
-
-                if (serviceType != typeof(TServiceType))
-                {
-                    // This is an invalid publisher
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(string.Format(
-                        CultureInfo.CurrentCulture,
-                        Resources.Error_IncorrectServiceType,
-                        typeof(ServiceManager).FullName,
-                        typeof(TServiceType).FullName,
-                        serviceType.FullName)));
-                }
-
-                object service = _genericCallback();
-
-                if (service == null)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(
-                        string.Format(
-                        CultureInfo.CurrentCulture,
-                        Resources.Error_NullService,
-                        _genericCallback.Method.DeclaringType.FullName,
-                        serviceType.FullName)));
-                }
-
-                if (!serviceType.IsInstanceOfType(service))
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(
-                        string.Format(
-                        CultureInfo.CurrentCulture,
-                        Resources.Error_IncorrectServiceType,
-                        _genericCallback.Method.DeclaringType.FullName,
-                        serviceType.FullName,
-                        service.GetType().FullName)));
-                }
-
-                return service;
-            }
-        }
-
-        /// <summary>
-        /// This is a simple proxy that converts a non-generic subscribe callback to a generic
-        /// one.
-        /// </summary>
-        /// <typeparam name="TServiceType"></typeparam>
-        private class SubscribeProxy<TServiceType> : ICallbackProxy
-        {
-            private SubscribeServiceCallback<TServiceType> _genericCallback;
-
-            internal SubscribeProxy(SubscribeServiceCallback<TServiceType> callback)
-            {
-                _genericCallback = callback;
-            }
-
-            internal SubscribeServiceCallback Callback
-            {
-                get
-                {
-                    return new SubscribeServiceCallback(SubscribeService);
-                }
-            }
-
-
-            private void SubscribeService(Type serviceType, object service)
-            {
-
-                if (serviceType == null) throw FxTrace.Exception.ArgumentNull("serviceType");
-                if (service == null) throw FxTrace.Exception.ArgumentNull("service");
-
-                if (!typeof(TServiceType).IsInstanceOfType(service))
-                {
-                    // This is an invalid subscriber
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(string.Format(
-                        CultureInfo.CurrentCulture,
-                        Resources.Error_IncorrectServiceType,
-                        typeof(TServiceType).FullName,
-                        serviceType.FullName)));
-                }
-
-                _genericCallback((TServiceType)service);
-            }
-
-            Delegate ICallbackProxy.OriginalDelegate
-            {
-                get { return _genericCallback; }
-            }
-
-            object ICallbackProxy.OriginalTarget
-            {
-                get
-                {
-                    return _genericCallback.Target;
-                }
-            }
-        }
-
-        private interface ICallbackProxy
-        {
-            Delegate OriginalDelegate { get; }
-            object OriginalTarget { get; }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/SubscribeContextCallback.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/SubscribeContextCallback.cs
deleted file mode 100644 (file)
index 4bfbbd2..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-namespace System.Activities.Presentation {
-
-    using System;
-
-    /// <summary>
-    /// Defines a callback method that will be invoked when a context item
-    /// changes.
-    /// </summary>
-    /// <param name="item">The context item that has changed.</param>
-    public delegate void SubscribeContextCallback(ContextItem item);
-
-    /// <summary>
-    /// Defines a callback method that will be invoked when a context item
-    /// changes.
-    /// </summary>
-    /// <typeparam name="TContextItemType">The type of context item this subscription is for.</typeparam>
-    /// <param name="item">The context item that has changed.</param>
-    public delegate void SubscribeContextCallback<TContextItemType>(
-        TContextItemType item) where TContextItemType : ContextItem;
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/SubscribeServiceCallback.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/SubscribeServiceCallback.cs
deleted file mode 100644 (file)
index 7cfd00c..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-
-namespace System.Activities.Presentation {
-
-    using System;
-
-    /// <summary>
-    /// A delegate that is a callback for service subscriptions.
-    /// </summary>
-    /// <param name="serviceType">The type of service that has just been published.</param>
-    /// <param name="serviceInstance">The instance of the service.</param>
-    public delegate void SubscribeServiceCallback(Type serviceType, object serviceInstance);
-
-    /// <summary>
-    /// A generic delegate that is a callback for service subscriptions
-    /// </summary>
-    /// <typeparam name="TServiceType">The type of service to listen to.</typeparam>
-    /// <param name="serviceInstance">The instance of the service.</param>
-    public delegate void SubscribeServiceCallback<TServiceType>(TServiceType serviceInstance);
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Documents/ViewManager.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Documents/ViewManager.cs
deleted file mode 100644 (file)
index dbc45a2..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-
-namespace System.Activities.Presentation.Documents {
-
-    using System;
-    using System.Collections.Generic;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows;
-    using System.Windows.Media;
-
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Services;
-    
-    /// <summary>
-    /// A ViewManager is a class that manages and provides the view
-    /// for the designer.  The view manager is used by MarkupDocumentManager
-    /// to provide the view for the designer.  
-    /// </summary>
-    abstract class ViewManager : IDisposable {
-
-        /// <summary>
-        /// Returns the view for the designer.  This will return null until
-        /// Initialize has been called.
-        /// </summary>
-        public abstract Visual View { get; }
-
-        /// <summary>
-        /// Initializes this view manager with the given model tree.  
-        /// </summary>
-        /// <param name="context">The editing context for the designer.</param>
-        /// <exception cref="ArgumentNullException">If model is null.</exception>
-        public abstract void Initialize(EditingContext context);
-
-        /// <summary>
-        /// Disposes this view manager.
-        /// </summary>
-        public void Dispose() {
-            Dispose(true);
-            GC.SuppressFinalize(this);
-        }
-
-        /// <summary>
-        /// Disposes this view manager.
-        /// <param name="disposing">True if this object is being disposed, or false if it is finalizing.</param>
-        /// </summary>
-        protected virtual void Dispose(bool disposing) {
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Documents/ViewManagerAttribute.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Documents/ViewManagerAttribute.cs
deleted file mode 100644 (file)
index 49825ad..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-
-namespace System.Activities.Presentation.Documents
-{
-
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.Internal.Properties;
-    using System;
-    using System.Globalization;
-
-    /// <summary>
-    /// This attribute can be placed on the root of a model
-    /// object graph to specify what view manager should be
-    /// used to present the view.
-    /// </summary>
-    [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)]
-    sealed class ViewManagerAttribute : Attribute
-    {
-        private Type _viewManagerType;
-
-
-        /// <summary>
-        /// An empty ViewManagerAttribute allows you to "unset" the view manager from a base class.
-        /// </summary>
-        public ViewManagerAttribute()
-        {
-        }
-
-        /// <summary>
-        /// Creates a new ViewManager attribute.
-        /// </summary>
-        /// <param name="viewManagerType">The type of view manager to use.  The type specified must derive from ViewManager.</param>
-        /// <exception cref="ArgumentNullException">If viewManagerType is null.</exception>
-        /// <exception cref="ArgumentException">If viewManagerType does not specify a type that derives from ViewManager.</exception>
-        public ViewManagerAttribute(Type viewManagerType)
-        {
-            if (viewManagerType == null) throw FxTrace.Exception.ArgumentNull("viewManagerType");
-            if (!typeof(ViewManager).IsAssignableFrom(viewManagerType))
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException(string.Format(CultureInfo.CurrentCulture,
-                    Resources.Error_InvalidArgumentType,
-                    "viewManagerType",
-                    typeof(ViewManager).FullName)));
-            }
-            _viewManagerType = viewManagerType;
-        }
-
-        /// <summary>
-        /// The type of view manager to create for the model.
-        /// </summary>
-        public Type ViewManagerType
-        {
-            get { return _viewManagerType; }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/CreateOptions.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/CreateOptions.cs
deleted file mode 100644 (file)
index d8cc2e4..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-
-namespace System.Activities.Presentation.Model {
-
-    using System;
-
-    /// <summary>
-    /// The CreateOptions flags are passed into ModelFactory
-    /// to dictate how to create a new item.  
-    /// </summary>
-    [Flags]
-    public enum CreateOptions {
-
-        /// <summary>
-        /// Just creates the object and does not perform
-        /// any operations on it.  This is the default.
-        /// </summary>
-        None = 0x00,
-
-        /// <summary>
-        /// Creates the item and asks the object to perform
-        /// any default initialization.  This flag is generally
-        /// passed in when a new control or object is being
-        /// created by a user.
-        /// </summary>
-        InitializeDefaults = 0x01
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/EnumValidator.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/EnumValidator.cs
deleted file mode 100644 (file)
index 5f0b9fb..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System;
-
-    // <summary>
-    // Class containing a single IsValid() method that ensures
-    // that the given public enum is of expected value.  Use this
-    // method to validate the enum value of all publicly exposed setters.
-    // </summary>
-    internal static partial class EnumValidator
-    {
-        public static bool IsValid(CreateOptions value)
-        {
-            return value == CreateOptions.None || value == CreateOptions.InitializeDefaults;
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelEditingScope.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelEditingScope.cs
deleted file mode 100644 (file)
index ea8cd41..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-//------------------------------------------------------------------------------
-// <copyright file="ModelEditingScope.cs" company="Microsoft">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//------------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-
-    using System;
-    using System.Collections.Generic;
-    using System.Globalization;
-    using System.Activities.Presentation;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-
-    /// <summary>
-    /// A ModelEditingScope represents a group of changes to the 
-    /// editing store.  Change groups are transactional:  
-    /// changes made under an editing scope can be committed 
-    /// or aborted as a unit.  
-    /// 
-    /// When an editing scope is committed, the editing store 
-    /// takes all changes that occurred within it and applies 
-    /// them to the model.  If the editing scope\92s Revert method 
-    /// is called, or the editing scope is disposed before Complete 
-    /// is called, the editing scope will instead reverse the 
-    /// changes made to the underlying objects, reapplying state 
-    /// from the editing store.  This provides a solid basis for 
-    /// an undo mechanism.
-    /// </summary>
-    public abstract class ModelEditingScope : IDisposable
-    {
-        private string _description;
-        private bool _completed;
-        private bool _reverted;
-
-        /// <summary>
-        /// Creates a new ModelEditingScope object.
-        /// </summary>
-        protected ModelEditingScope() { }
-
-        /// <summary>
-        /// Describes the group.  You may change this property 
-        /// anytime before the group is committed.
-        /// </summary>
-        public string Description
-        {
-            get { return (_description == null ? string.Empty : _description); }
-            set { _description = value; }
-        }
-
-        /// <summary>
-        /// Completes the editing scope.  If the editing scope has 
-        /// already been reverted or completed, this will throw an 
-        /// InvalidOperationException.  Calling Complete calls the 
-        /// protected OnComplete method.
-        /// </summary>
-        /// <exception cref="InvalidOperationException">If ModelEditingScope 
-        /// has already been complted or reverted.</exception>
-        [SuppressMessage("Microsoft.Usage", "CA1816:CallGCSuppressFinalizeCorrectly", Justification = "By design.")]
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "By design.")]
-        public void Complete()
-        {
-            if (_reverted) throw FxTrace.Exception.AsError(new InvalidOperationException(System.Activities.Presentation.Internal.Properties.Resources.Error_EditingScopeReverted));
-            if (_completed) throw FxTrace.Exception.AsError(new InvalidOperationException(System.Activities.Presentation.Internal.Properties.Resources.Error_EdtingScopeCompleted));
-
-            if (CanComplete())
-            {
-                bool successful = false;
-                _completed = true; // prevent recursive commits
-
-                try
-                {
-                    OnComplete();
-                    successful = true;
-                }
-                catch (Exception e)
-                {
-                    _completed = false;
-                    Revert();
-                    if (Fx.IsFatal(e))
-                    {
-                        throw;
-                    }
-                    if (!OnException(e))
-                    {
-                        throw;
-                    }
-                }
-                finally
-                {
-                    if (successful)
-                    {
-                        GC.SuppressFinalize(this);
-                    }
-                    else
-                    {
-                        _completed = false;
-                    }
-                }
-            }
-            else
-                Revert(); // We are not allowed to do completion, revert the change.
-        }
-
-        /// <summary>
-        /// Abandons the changes made during the editing scope.  If the 
-        /// group has already been committed or aborted, this will 
-        /// throw an InvalidOperationException.  Calling Revert calls 
-        /// the protected OnRevert with \93false?for the 
-        /// finalizing parameter.
-        /// </summary>
-        /// <exception cref="InvalidOperationException">If ModelEditingScope 
-        /// has already been committed.</exception>
-        [SuppressMessage("Microsoft.Usage", "CA1816:CallGCSuppressFinalizeCorrectly", Justification = "By design.")]
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "By design.")]
-        public void Revert()
-        {
-            if (_completed) throw FxTrace.Exception.AsError(new InvalidOperationException(System.Activities.Presentation.Internal.Properties.Resources.Error_EdtingScopeCompleted));
-            if (_reverted) return;
-
-            bool successful = false;
-            _reverted = true;
-
-            try
-            {
-                OnRevert(false);
-                successful = true;
-            }
-            catch (Exception e)
-            {
-                _reverted = false;
-                if (Fx.IsFatal(e))
-                {
-                    throw;
-                }
-                if (!OnException(e))
-                {
-                    throw;
-                }
-            }
-            finally
-            {
-                if (successful)
-                {
-                    GC.SuppressFinalize(this);
-                }
-                else
-                {
-                    _reverted = false;
-                }
-            }
-        }
-
-        /// <summary>
-        /// Implements IDisposable.Dispose as follows:
-        ///
-        /// 1.  If the editing scope has already been completed or reverted, do nothing.
-        /// 2.  Revert the editing scope.
-        /// </summary>
-        /// GC.SuppressFinalize(this) is called through Revert(), so suppress the FxCop violation.
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1816:DisposeMethodsShouldCallSuppressFinalize")]
-        public void Dispose()
-        {
-            Dispose(true);
-        }
-
-        /// <summary>
-        /// Disposes this object by aborting changes.
-        /// </summary>
-        /// <param name="disposing"></param>
-        protected virtual void Dispose(bool disposing)
-        {
-            if (!_completed && !_reverted)
-            {
-                if (disposing)
-                {
-                    Revert();
-                }
-                else
-                {
-                    OnRevert(true);
-                }
-            }
-        }
-
-        /// <summary>
-        /// Performs the actual complete of the editing scope.
-        /// </summary>
-        protected abstract void OnComplete();
-
-        /// <summary>
-        /// Determines if OnComplete should be called, or if the change should instead be reverted.  Reasons
-        /// for reverting may include file cannot be checked out of a source control system for modification.
-        /// </summary>
-        /// <returns>Returns true if completion can occur, false if the change should instead revert</returns>
-        protected abstract bool CanComplete();
-
-        /// <summary>
-        /// Performs the actual revert of the editing scope.
-        /// </summary>
-        /// <param name="finalizing">
-        /// True if the abort is ocurring because the object 
-        /// is being finalized.  Some undo systems may attempt to 
-        /// abort in this case, while others may abandon the 
-        /// change and record it as a reactive undo.
-        /// </param>
-        protected abstract void OnRevert(bool finalizing);
-
-        /// <summary>
-        /// Handle the exception during Complete and Revert.
-        /// </summary>
-        /// <param name="exception">
-        /// The exception to handle.
-        /// </param>
-        /// <returns>
-        /// True if the exception is handled, false if otherwise
-        /// </returns>
-        protected abstract bool OnException(Exception exception);
-    }
-}
-
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelFactory.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelFactory.cs
deleted file mode 100644 (file)
index 149981c..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-
-namespace System.Activities.Presentation.Model {
-
-    using System.Activities.Presentation.Services;
-    using System.Activities.Presentation;
-
-    using System;
-
-    /// <summary>
-    /// The ModelFactory class should be used to create instances 
-    /// of items in the designer. ModelFactory is designed to be 
-    /// a static API for convenience.  The underlying implementation 
-    /// of this API simply calls through to the ModelService\92
-    /// CreateItem method.
-    /// </summary>
-    public static class ModelFactory {
-
-        /// <summary>
-        /// Creates a new item for the given item type.
-        /// </summary>
-        /// <param name="context">
-        /// The designer's editing context.
-        /// </param>
-        /// <param name="itemType">
-        /// The type of item to create.
-        /// </param>
-        /// <param name="arguments">
-        /// An optional array of arguments that should be passed to the constructor of the item.
-        /// </param>
-        /// <returns>
-        /// The newly created item type.
-        /// </returns>
-        /// <exception cref="ArgumentNullException">if itemType or context is null.</exception>
-        /// <exception cref="InvalidOperationException">if there is no editing model in the context that can create new items.</exception>
-        public static ModelItem CreateItem(EditingContext context, Type itemType, params object[] arguments) {
-            return CreateItem(context, itemType, CreateOptions.None, arguments);
-        }
-
-        /// <summary>
-        /// Creates a new item for the given item type.
-        /// </summary>
-        /// <param name="context">
-        /// The designer's editing context.
-        /// </param>
-        /// <param name="itemType">
-        /// The type of item to create.
-        /// </param>
-        /// <param name="options">
-        /// A set of create options to use when creating the item.  The default value is CreateOptions.None.
-        /// </param>
-        /// <param name="arguments">
-        /// An optional array of arguments that should be passed to the constructor of the item.
-        /// </param>
-        /// <returns>
-        /// The newly created item type.
-        /// </returns>
-        /// <exception cref="ArgumentNullException">if itemType or context is null.</exception>
-        /// <exception cref="InvalidOperationException">if there is no editing model in the context that can create new items.</exception>
-        public static ModelItem CreateItem(EditingContext context, Type itemType, CreateOptions options, params object[] arguments) {
-            if (context == null) throw FxTrace.Exception.ArgumentNull("context");
-            if (itemType == null) throw FxTrace.Exception.ArgumentNull("itemType");
-            if (!EnumValidator.IsValid(options)) throw FxTrace.Exception.AsError(new ArgumentOutOfRangeException("options"));
-
-            ModelService ms = context.Services.GetRequiredService<ModelService>();
-            return ms.InvokeCreateItem(itemType, options, arguments);
-        }
-
-        /// <summary>
-        /// Creates a new model item by creating a deep copy of the isntance provided.
-        /// </summary>
-        /// <param name="context">
-        /// The designer's editing context.
-        /// </param>
-        /// <param name="item">
-        /// The item to clone.
-        /// </param>
-        /// <returns>
-        /// The newly created item.
-        /// </returns>
-        public static ModelItem CreateItem(EditingContext context, object item) {
-            if (context == null) throw FxTrace.Exception.ArgumentNull("context");
-            if (item == null) throw FxTrace.Exception.ArgumentNull("item");
-
-            ModelService ms = context.Services.GetRequiredService<ModelService>();
-            return ms.InvokeCreateItem(item);
-        }
-
-        /// <summary>
-        /// Create a new model item that represents a the value of a static member of a the given class.
-        /// For example, to add a reference to Brushes.Red to the model call this methods with 
-        /// typeof(Brushes) and the string "Red". This will be serialized into XAML as 
-        /// {x:Static Brushes.Red}.
-        /// </summary>
-        /// <param name="context">
-        /// The designer's editing context.
-        /// </param>
-        /// <param name="type">
-        /// The type that contains the static member being referenced.
-        /// </param>
-        /// <param name="memberName">
-        /// The name of the static member being referenced.
-        /// </param>
-        /// <returns></returns>
-        public static ModelItem CreateStaticMemberItem(EditingContext context, Type type, string memberName) {
-            if (context == null) throw FxTrace.Exception.ArgumentNull("context");
-            if (type == null) throw FxTrace.Exception.ArgumentNull("type");
-            if (memberName == null) throw FxTrace.Exception.ArgumentNull("memberName");
-
-            ModelService ms = context.Services.GetRequiredService<ModelService>();
-            return ms.InvokeCreateStaticMemberItem(type, memberName);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelItem.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelItem.cs
deleted file mode 100644 (file)
index e5d608a..0000000
+++ /dev/null
@@ -1,265 +0,0 @@
-//------------------------------------------------------------------------------
-// <copyright file="ModelItem.cs" company="Microsoft">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//------------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model 
-{
-
-    using System;
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows;
-    using System.Collections.Generic;
-
-    // <summary>
-    // The ModelItem class represents a single item in the editing model.  An
-    // item can be anything from a Window or Control down to a color or integer.
-    //
-    // You may access the item�s properties through its Properties collection
-    // and make changes to the values of the properties.
-    //
-    // A ModelItem is essentially a wrapper around the designer�s underlying
-    // data model.  You can access the underlying model through the
-    // GetCurrentValue method.  Note that you should never make any serializable
-    // changes to an object returned from the GetCurrentValue method:  it will
-    // not be reflected back in the designer�s serialization or undo systems.
-    // </summary>
-    public abstract class ModelItem : INotifyPropertyChanged 
-    {
-
-        // <summary>
-        // Creates a new ModelItem.
-        // </summary>
-        protected ModelItem() 
-        {
-        }
-
-        // <summary>
-        // Implements INotifyPropertyChanged.  This can be used to tell when a property
-        // on the model changes.  It is also useful because INotifyPropertyChanged can
-        // be used by the data binding features of WPF.
-        //
-        // You should take care to disconnect events from items when you are finished
-        // when them.  Otherwise you can prevent the item from garbage collecting.
-        // </summary>
-        public abstract event PropertyChangedEventHandler PropertyChanged;
-
-        // <summary>
-        // Returns the attributes declared on this item.
-        // </summary>
-        public abstract AttributeCollection Attributes { get; }
-
-        // <summary>
-        // If this item's ItemType declares a ContentPropertyAttribute,
-        // that property will be exposed here.  Otherwise, this will
-        // return null.
-        // </summary>
-        public abstract ModelProperty Content { get; }
-
-        // <summary>
-        // Returns the type of object the item represents.
-        // </summary>
-        public abstract Type ItemType { get; }
-
-        // <summary>
-        // This property represents the name or ID of the item.  Not
-        // all items need to have names so this may return null.  Also,
-        // depending on the type of item and where it sits in the
-        // hierarchy, it may not always be legal to set the name on
-        // an item.  If this item's ItemType declares a
-        // RuntimeNamePropertyAttribute, this Name property will be
-        // a direct mapping to the property dictated by that attribute.
-        // </summary>
-        public abstract string Name { get; set; }
-
-        // <summary>
-        // Returns the item that is the parent of this item.
-        // If an item is contained in a collection or dictionary
-        // the collection or dictionary is skipped, returning the
-        // object owns the collection or dictionary.
-        // </summary>
-        public abstract ModelItem Parent { get; }
-
-        // <summary>
-        // Returns the al the parents of this item.
-        // </summary>
-        public abstract IEnumerable<ModelItem> Parents { get; }
-
-        // <summary>
-        // Returns the item that is the root of this tree.
-        // If there is no root yet, as this isn't part of a tree
-        // returns null.
-        // </summary>
-        public abstract ModelItem Root { get; }
-
-        // <summary>
-        // Returns the public properties on this object.  The set of
-        // properties returned may change based on attached
-        // properties or changes to the editing scope.
-        // </summary>
-        public abstract ModelPropertyCollection Properties { get; }
-
-        // <summary>
-        // Returns the property that provided this value. If the item represents
-        // the root of the object graph, this will return null.  If an item is a
-        // member of a collection or dictionary, the property returned from Source
-        // will be a pseudo-property provided by the collection or dictionary.
-        // For other values, the Source property returns the property where the
-        // value was actually set.  Therefore, if a value is being inherited,
-        // Source allows you to find out who originally provided the value.
-        // </summary>
-        public abstract ModelProperty Source { get; }
-
-
-        // <summary>
-        // Returns all the properties that hold this value.
-        // </summary>
-        public abstract IEnumerable<ModelProperty> Sources { get; }
-
-        // <summary>
-        // Returns the visual or visual3D representing the UI for this item.  This
-        // may return null if there is no view for this object.
-        // </summary>
-        public abstract DependencyObject View { get; }
-
-        // <summary>
-        // If you are doing multiple operations on an object or group of objects
-        // you may call BeginEdit.  Once an editing scope is open, all changes
-        // across all objects will be saved into the scope.
-        //
-        // Editing scopes are global to the designer.  An editing scope may be
-        // created for any item in the designer; you do not need to create an
-        // editing scope for the specific item you are changing.
-        //
-        // Editing scopes can be nested, but must be committed in order.
-        // </summary>
-        // <returns>
-        // An editing scope that must be either completed or reverted.
-        // </returns>
-        public abstract ModelEditingScope BeginEdit();
-
-        // <summary>
-        // If you are doing multiple operations on an object or group of objects
-        // you may call BeginEdit.  Once an editing scope is open, all changes
-        // across all objects will be saved into the scope.
-        //
-        // Editing scopes are global to the designer.  An editing scope may be
-        // created for any item in the designer; you do not need to create an
-        // editing scope for the specific item you are changing.
-        //
-        // Editing scopes can be nested, but must be committed in order.
-        // </summary>
-        // <param name="description">
-        // An optional description that describes the change.  This will be set
-        // into the editing scope�s Description property.
-        // </param>
-        // <returns>
-        // An editing scope that must be either completed or reverted.
-        // </returns>
-        public abstract ModelEditingScope BeginEdit(string description);
-
-        // <summary>
-        // If you are doing multiple operations on an object or group of objects
-        // you may call BeginEdit.  Once an editing scope is open, all changes
-        // across all objects will be saved into the scope.
-        //
-        // Editing scopes are global to the designer.  An editing scope may be
-        // created for any item in the designer; you do not need to create an
-        // editing scope for the specific item you are changing.
-        //
-        // Editing scopes can be nested, but must be committed in order.
-        // </summary>
-        // <param name="shouldApplyChangesImmediately">
-        // A flag to control whether changes should take effect immediately.
-        // </param>
-        // <returns>
-        // An editing scope that must be either completed or reverted.
-        // </returns>
-        // <exception cref="NotImplementedException">
-        // If the derived class doesn't override this method.
-        // </exception>
-        // <exception cref="InvalidOperationException">
-        // If shouldApplyChangesImmediately == true but the outer editing scope is not null.
-        // </exception>
-        public virtual ModelEditingScope BeginEdit(bool shouldApplyChangesImmediately)
-        {
-            throw FxTrace.Exception.AsError(new NotImplementedException());
-        }
-
-        // <summary>
-        // If you are doing multiple operations on an object or group of objects
-        // you may call BeginEdit.  Once an editing scope is open, all changes
-        // across all objects will be saved into the scope.
-        //
-        // Editing scopes are global to the designer.  An editing scope may be
-        // created for any item in the designer; you do not need to create an
-        // editing scope for the specific item you are changing.
-        //
-        // Editing scopes can be nested, but must be committed in order.
-        // </summary>
-        // <param name="description">
-        // An optional description that describes the change.  This will be set
-        // into the editing scope�s Description property.
-        // </param>
-        // <param name="shouldApplyChangesImmediately">
-        // A flag to control whether changes should take effect immediately.
-        // </param>
-        // <returns>
-        // An editing scope that must be either completed or reverted.
-        // </returns>
-        // <exception cref="NotImplementedException">
-        // If the derived class doesn't override this method.
-        // </exception>
-        // <exception cref="InvalidOperationException">
-        // If shouldApplyChangesImmediately == true but the outer editing scope is not null.
-        // </exception>
-        public virtual ModelEditingScope BeginEdit(string description, bool shouldApplyChangesImmediately)
-        {
-            throw FxTrace.Exception.AsError(new NotImplementedException());
-        }
-
-        // <summary>
-        // Returns the current value of the underlying model object the ModelItem
-        // is wrapping.  You can inspect this object, but you should not make any
-        // changes to it.  Changes made to the object returned will not be incorporated
-        // into the designer.  The GetCurrentValue method may return either an existing
-        // or new cloned instance of the object.
-        // </summary>
-        // <returns>
-        // Returns the current value of the underlying model object the ModelItem is wrapping.
-        // </returns>
-        public abstract object GetCurrentValue();
-
-        // <summary>
-        // Returns string representation of the ModelItem which is the string representation 
-        // of underlying object the ModelItem is wrapping.
-        // </summary>
-        // <returns>
-        // Returns string representation of the ModelItem.
-        // </returns>        
-        public override string ToString()
-        {                        
-            object instance = this.GetCurrentValue();
-            if (instance != null)
-            {
-                return instance.ToString();
-            }
-            else 
-            {
-                return base.ToString();
-            }
-        }
-
-        internal virtual event PropertyReferenceChangedEventHandler PropertyReferenceChanged;
-
-        internal virtual void OnPropertyReferenceChanged(string targetProperty)
-        {
-            if (this.PropertyReferenceChanged != null)
-            {
-                this.PropertyReferenceChanged(this, new PropertyReferenceChangedEventArgs(targetProperty));
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelItemCollection.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelItemCollection.cs
deleted file mode 100644 (file)
index 9bf4914..0000000
+++ /dev/null
@@ -1,375 +0,0 @@
-//------------------------------------------------------------------------------
-// <copyright file="ModelItemCollection.cs" company="Microsoft">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//------------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model {
-
-    using System.Activities.Presentation.Internal.Properties;
-    using System.Activities.Presentation;
-
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Collections.Specialized;
-    using System.Globalization;
-    using System.Windows;
-
-    /// <summary>
-    /// ModelItemCollection derives from ModelItem and implements 
-    /// support for a collection of items.  
-    ///
-    /// ModelItemCollection defines a static attached property called 
-    /// Item.  This property is returned from the Properties 
-    /// enumeration of the collection, in addition to any properties 
-    /// defined on the collection.  The Item property represents all 
-    /// the items in the collection and is defined as type 
-    /// IEnumerable of ModelItem.  All items in the collection have 
-    /// their Source property set to this property.  The property\92s metadata 
-    /// marks it non browsable and non-serializable.  The Item property is a 
-    /// "pseudo" property because it is not actually set on the model.  The 
-    /// value it points to is the ModelItemCollection itself.
-    /// </summary>
-    public abstract class ModelItemCollection : ModelItem, IList<ModelItem>, IList, INotifyCollectionChanged {
-
-        /// <summary>
-        /// Creates a new ModelItemCollection.
-        /// </summary>
-        protected ModelItemCollection() { }
-
-        /// <summary>
-        /// Returns the item at the given index.  Sets the item at the 
-        /// given index to the given value.
-        /// </summary>
-        /// <param name="index">The zero-based index into the collection.</param>
-        /// <returns></returns>
-        /// <exception cref="ArgumentNullException">if value is null.</exception>
-        /// <exception cref="IndexOutOfRangeException">if index is less than 0 or greater than or equal to count.</exception>
-        public abstract ModelItem this[int index] { get; set; }
-
-        /// <summary>
-        /// Returns the count of items in the collection.
-        /// </summary>
-        public abstract int Count { get; }
-
-        /// <summary>
-        /// Returns true if the collection is a fixed size.  
-        /// The default implementation returns true if the
-        /// collection is read only.
-        /// </summary>
-        protected virtual bool IsFixedSize {
-            get { return IsReadOnly; }
-        }
-
-        /// <summary>
-        /// Returns true if the collection cannot be modified.
-        /// </summary>
-        public abstract bool IsReadOnly { get; }
-
-        /// <summary>
-        /// Protected access to ICollection.IsSynchronized.
-        /// </summary>
-        protected virtual bool IsSynchronized {
-            get { return false; }
-        }
-
-        /// <summary>
-        /// Protected access to the SyncRoot object used to synchronize
-        /// this collection.  The default value returns "this".
-        /// </summary>
-        protected virtual object SyncRoot {
-            get { return this; }
-        }
-
-        /// <summary>
-        /// This event is raised when the contents of this collection change.
-        /// </summary>
-        public abstract event NotifyCollectionChangedEventHandler CollectionChanged;
-
-        /// <summary>
-        /// Adds the item to the collection. 
-        /// </summary>
-        /// <param name="item"></param>
-        /// <exception cref="ArgumentNullException">if item is null.</exception>
-        /// <exception cref="InvalidOperationException">if the collection is read only.</exception>
-        public abstract void Add(ModelItem item);
-
-        /// <summary>
-        /// Adds the given value to the collection.  This will create an item
-        /// for the value.  It returns the newly created item.
-        /// </summary>
-        /// <param name="value"></param>
-        /// <returns>an item representing the value</returns>
-        /// <exception cref="ArgumentNullException">if value is null.</exception>
-        /// <exception cref="InvalidOperationException">if the collection is read only.</exception>
-        public abstract ModelItem Add(object value);
-
-        /// <summary>
-        /// Clears the contents of the collection.
-        /// </summary>
-        /// <exception cref="InvalidOperationException">if the collection is read only.</exception>
-        public abstract void Clear();
-
-        /// <summary>
-        /// Returns true if the collection contains the given item.
-        /// </summary>
-        /// <param name="item"></param>
-        /// <returns></returns>
-        /// <exception cref="ArgumentNullException">if item is null.</exception>
-        public abstract bool Contains(ModelItem item);
-
-        /// <summary>
-        /// Returns true if the collection contains the given value.
-        /// </summary>
-        /// <param name="value"></param>
-        /// <returns></returns>
-        /// <exception cref="ArgumentNullException">if value is null.</exception>
-        public abstract bool Contains(object value);
-
-        //
-        // Helper method that verifies that objects can be upcast to
-        // the correct type.
-        //
-        private static ModelItem ConvertType(object value) {
-            try {
-                return (ModelItem)value;
-            }
-            catch (InvalidCastException) {
-                throw FxTrace.Exception.AsError(new ArgumentException(
-                    string.Format(CultureInfo.CurrentCulture,
-                        Resources.Error_ArgIncorrectType,
-                        "value", typeof(ModelItem).FullName)));
-
-            }
-        }
-
-        /// <summary>
-        /// Copies the contents of the collection into the given array.
-        /// </summary>
-        /// <exception cref="ArgumentNullException">if array is null.</exception>
-        /// <exception cref="IndexOutOfRangeException">
-        /// if arrayIndex is outside the bounds of the items array or if there is 
-        /// insuffient space in the array to hold the collection.
-        /// </exception>
-        public abstract void CopyTo(ModelItem[] array, int arrayIndex);
-
-        /// <summary>
-        /// Returns an enumerator for the items in the collection.
-        /// </summary>
-        /// <returns></returns>
-        public abstract IEnumerator<ModelItem> GetEnumerator();
-
-        /// <summary>
-        /// Returns the index of the given item or -1 if the item does not exist.
-        /// </summary>
-        /// <param name="item"></param>
-        /// <returns></returns>
-        /// <exception cref="ArgumentNullException">if item is null.</exception>
-        public abstract int IndexOf(ModelItem item);
-
-        /// <summary>
-        /// Inserts the item at the given location.  To
-        /// move an item, use Move.  If index is == Count this will insert the item 
-        /// at the end.  If it is zero it will insert at the beginning.
-        /// </summary>
-        /// <param name="index"></param>
-        /// <param name="item"></param>
-        /// <exception cref="ArgumentNullException">if item is null.</exception>
-        /// <exception cref="IndexOutOfRangeException">if index is less than 0 or greater than count.</exception>
-        public abstract void Insert(int index, ModelItem item);
-
-        /// <summary>
-        /// Inserts the item at the given location.  To
-        /// move an item, use Move.  If index is == Count this will insert the item 
-        /// at the end.  If it is zero it will insert at the beginning.
-        /// </summary>
-        /// <param name="index"></param>
-        /// <param name="value"></param>
-        /// <returns>an item representing the value</returns>
-        /// <exception cref="ArgumentNullException">if value is null.</exception>
-        /// <exception cref="IndexOutOfRangeException">if index is less than 0 or greater than count.</exception>
-        public abstract ModelItem Insert(int index, object value);
-
-        /// <summary>
-        /// Moves the item at fromIndex to toIndex.  The value for toIndex is 
-        /// always where you want the item to be according to how the collection 
-        /// currently sits.  This means that if you are moving an item to a higher 
-        /// index you don\92t have to account for the fact that the indexes will 
-        /// shuffle when the item is removed from its current location.
-        /// </summary>
-        /// <param name="fromIndex">
-        /// The index of the item to move.
-        /// </param>
-        /// <param name="toIndex">
-        /// The index to move it to.
-        /// </param>
-        /// <exception cref="IndexOutOfRangeException">
-        /// if fromIndex or toIndex is less than zero or greater than or
-        /// equal to Count.
-        /// </exception>
-        public abstract void Move(int fromIndex, int toIndex);
-
-        /// <summary>
-        /// Removes the item from the collection.  This does nothing if the 
-        /// item does not exist in the collection.
-        /// </summary>
-        /// <param name="item"></param>
-        /// <exception cref="ArgumentNullException">if item is null.</exception>
-        public abstract bool Remove(ModelItem item);
-
-        /// <summary>
-        /// Removes the value from the collection.  This does nothing if the 
-        /// value does not exist in the collection.
-        /// </summary>
-        /// <param name="value"></param>
-        /// <exception cref="ArgumentNullException">if value is null.</exception>
-        public abstract bool Remove(object value);
-
-        /// <summary>
-        /// Removes the item at the given index.
-        /// </summary>
-        /// <param name="index"></param>
-        /// <exception cref="IndexOutOfRangeException">if index is less than 0 or greater than or equal to count.</exception>
-        public abstract void RemoveAt(int index);
-
-        /// <summary>
-        /// This property is returned from the Properties enumeration of 
-        /// the collection, in addition to any properties defined on the 
-        /// collection.  The Item property represents all the items in 
-        /// the collection and is defined as type IEnumerable of ModelItem.  
-        /// All items in the collection have their Source property set to 
-        /// this property.  The property\92s metadata marks it non browsable 
-        /// and non-serializable.  The Item property is a "pseudo"property 
-        /// because it is not actually set on the model.  The value it points 
-        /// to is the ModelItemCollection itself.
-        /// </summary>
-        public static readonly DependencyProperty ItemProperty = DependencyProperty.RegisterAttachedReadOnly(
-            "Item",
-            typeof(IEnumerable<ModelItem>),
-            typeof(ModelItemCollection), null).DependencyProperty;
-
-        #region IList Members
-
-        /// <summary>
-        /// IList Implementation maps back to public API.
-        /// </summary>
-        int IList.Add(object value) {
-            Add(value);
-            return Count - 1;
-        }
-
-        /// <summary>
-        /// IList Implementation maps back to public API.
-        /// </summary>
-        void IList.Clear() {
-            Clear();
-        }
-
-        /// <summary>
-        /// IList Implementation maps back to public API.
-        /// </summary>
-        bool IList.Contains(object value) {
-            return Contains(value);
-        }
-
-        /// <summary>
-        /// IList Implementation maps back to public API.
-        /// </summary>
-        int IList.IndexOf(object value) {
-            return IndexOf(ConvertType(value));
-        }
-
-        /// <summary>
-        /// IList Implementation maps back to public API.
-        /// </summary>
-        void IList.Insert(int index, object value) {
-            Insert(index, value);
-        }
-
-        /// <summary>
-        /// IList Implementation maps back to public API.
-        /// </summary>
-        bool IList.IsFixedSize {
-            get { return IsFixedSize; }
-        }
-
-        /// <summary>
-        /// IList Implementation maps back to public API.
-        /// </summary>
-        bool IList.IsReadOnly {
-            get { return IsReadOnly; }
-        }
-
-        /// <summary>
-        /// IList Implementation maps back to public API.
-        /// </summary>
-        void IList.Remove(object value) {
-            Remove(value);
-        }
-
-        /// <summary>
-        /// IList Implementation maps back to public API.
-        /// </summary>
-        void IList.RemoveAt(int index) {
-            RemoveAt(index);
-        }
-
-        /// <summary>
-        /// IList Implementation maps back to public API.
-        /// </summary>
-        object IList.this[int index] {
-            get { return this[index]; }
-            set { this[index] = ConvertType(value); }
-        }
-
-        #endregion
-
-        #region ICollection Members
-
-        /// <summary>
-        /// ICollection Implementation maps back to public API.
-        /// </summary>
-        void ICollection.CopyTo(Array array, int index) {
-            for (int idx = 0; idx < Count; idx++) {
-                array.SetValue(this[idx], idx + index);
-            }
-        }
-
-        /// <summary>
-        /// ICollection Implementation maps back to public API.
-        /// </summary>
-        int ICollection.Count {
-            get { return Count; }
-        }
-
-        /// <summary>
-        /// ICollection Implementation maps back to public API.
-        /// </summary>
-        bool ICollection.IsSynchronized {
-            get { return IsSynchronized; }
-        }
-
-        /// <summary>
-        /// ICollection Implementation maps back to public API.
-        /// </summary>
-        object ICollection.SyncRoot {
-            get { return SyncRoot; }
-        }
-
-        #endregion
-
-        #region IEnumerable Members
-
-        /// <summary>
-        /// IEnumerable Implementation maps back to public API.
-        /// </summary>
-        IEnumerator IEnumerable.GetEnumerator() {
-            foreach (object o in this) {
-                yield return o;
-            }
-        }
-
-        #endregion
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelItemDictionary.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelItemDictionary.cs
deleted file mode 100644 (file)
index 9e59868..0000000
+++ /dev/null
@@ -1,477 +0,0 @@
-//------------------------------------------------------------------------------
-// <copyright file="ModelItemDictionary.cs" company="Microsoft">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//------------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model {
-
-    using System.Activities.Presentation.Internal.Properties;
-    using System.Activities.Presentation;
-    using System.Runtime;
-
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Collections.Specialized;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Windows;
-
-    /// <summary>
-    /// ModelItemDictionary derives from ModelItem and implements support for a 
-    /// dictionary of key/value pairs.  Both the keys and values are items. 
-    /// 
-    /// ModelItemDictionary defines an attached property "Key", which is adds 
-    /// to all items contained in the dictionary.  The data type of the Key 
-    /// property is "ModelItem" and it is marked as non-browsable and 
-    /// non-serializable.
-    ///
-    /// In addition to the Key property, ModelItemDictionary also returns an 
-    /// Item property from its properties collection just like ModelItemCollection.  
-    /// ModelItemDictionary reuses the ModelProperty defined on ModelItemCollection.  
-    /// The value returned is an enumeration of the values in the dictionary.  
-    /// The Source property of all items in the dictionary refers to this Item 
-    /// property.
-    /// </summary>
-    public abstract class ModelItemDictionary : ModelItem, IDictionary<ModelItem, ModelItem>, IDictionary, INotifyCollectionChanged {
-
-        /// <summary>
-        /// Creates a new ModelItemDictionary.
-        /// </summary>
-        protected ModelItemDictionary() { }
-
-        /// <summary>
-        /// Returns the item at the given key.  Sets the item at the given 
-        /// key to the given value.  If there is no item for the given key 
-        /// this returns null because null is not a valid item.
-        /// </summary>
-        /// <param name="key"></param>
-        /// <returns></returns>
-        /// <exception cref="InvalidOperationException">if the dictionary is read only and you set a new value.</exception>
-        /// <exception cref="KeyNotFoundException">if the given key is not in the dictionary.</exception>
-        [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")]
-        public abstract ModelItem this[ModelItem key] { get; set; }
-
-        /// <summary>
-        /// Returns the item at the given key.  Sets the item at the given 
-        /// key to the given value.  If there is no item for the given key 
-        /// this returns null because null is not a valid item.
-        /// </summary>
-        /// <param name="key"></param>
-        /// <returns></returns>
-        /// <exception cref="InvalidOperationException">if the dictionary is read only and you set a new value.</exception>
-        /// <exception cref="KeyNotFoundException">if the given key is not in the dictionary.</exception>
-        [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")]
-        public abstract ModelItem this[object key] { get; set; }
-
-        /// <summary>
-        /// Returns the count of items in the dictionary.
-        /// </summary>
-        public abstract int Count { get; }
-
-        /// <summary>
-        /// Returns true if the dictionary is a fixed size.  
-        /// The default implementation returns true if the
-        /// dictionary is read only.
-        /// </summary>
-        protected virtual bool IsFixedSize {
-            get { return IsReadOnly; }
-        }
-
-        /// <summary>
-        /// Returns true if the dictionary cannot be modified.
-        /// </summary>
-        public abstract bool IsReadOnly { get; }
-
-        /// <summary>
-        /// Protected access to ICollection.IsSynchronized.
-        /// </summary>
-        protected virtual bool IsSynchronized {
-            get { return false; }
-        }
-
-        /// <summary>
-        /// Returns the keys of the collection.  The keys are guaranteed to be in 
-        /// the same order as the values.  The resulting collection is read-only.
-        /// </summary>
-        [Fx.Tag.KnownXamlExternalAttribute]
-        public abstract ICollection<ModelItem> Keys { get; }
-
-        /// <summary>
-        /// Protected access to the SyncRoot object used to synchronize
-        /// this collection.  The default value returns "this".
-        /// </summary>
-        protected virtual object SyncRoot {
-            get { return this; }
-        }
-
-        /// <summary>
-        /// Returns the values of the collection.  The values are guaranteed to be 
-        /// in the same order as the keys.  The resulting collection is read-only.
-        /// </summary>
-        [Fx.Tag.KnownXamlExternalAttribute]
-        public abstract ICollection<ModelItem> Values { get; }
-
-        /// <summary>
-        /// This event is raised when the contents of this collection change.
-        /// </summary>
-        public abstract event NotifyCollectionChangedEventHandler CollectionChanged;
-
-        /// <summary>
-        /// Adds the item to the dictionary under the given key. 
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="value"></param>
-        /// <exception cref="InvalidOperationException">if the dictionary is read only.</exception>
-        public abstract void Add(ModelItem key, ModelItem value);
-
-        /// <summary>
-        /// Adds the value to the dictionary under the given key.  This
-        /// will wrap the key and value in an item.  It returns the item
-        /// representing the key.
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="value"></param>
-        /// <returns>an item representing the key in the dictionary</returns>
-        /// <exception cref="InvalidOperationException">if the dictionary is read only.</exception>
-        public abstract ModelItem Add(object key, object value);
-
-        /// <summary>
-        /// Clears the contents of the dictionary.
-        /// </summary>
-        /// <exception cref="InvalidOperationException">if the dictionary is read only.</exception>
-        public abstract void Clear();
-
-        /// <summary>
-        /// Copies into the given array.
-        /// </summary>
-        /// <param name="array"></param>
-        /// <param name="arrayIndex"></param>
-        protected virtual void CopyTo(KeyValuePair<ModelItem, ModelItem>[] array, int arrayIndex) {
-            foreach (KeyValuePair<ModelItem, ModelItem> kv in this) {
-                array[arrayIndex++] = kv;
-            }
-        }
-
-        /// <summary>
-        /// Returns true if the dictionary contains the given key value pair.
-        /// </summary>
-        protected virtual bool Contains(KeyValuePair<ModelItem, ModelItem> item) {
-            ModelItem value;
-            return TryGetValue(item.Key, out value) && value == item.Value;
-        }
-
-        /// <summary>
-        /// Returns true if the dictionary contains the given key.
-        /// </summary>
-        /// <param name="key"></param>
-        /// <returns></returns>
-        public abstract bool ContainsKey(ModelItem key);
-
-        /// <summary>
-        /// Returns true if the dictionary contains the given key.
-        /// </summary>
-        /// <param name="key"></param>
-        /// <returns></returns>
-        public abstract bool ContainsKey(object key);
-
-        //
-        // Helper method that verifies that objects can be upcast to
-        // the correct type.
-        //
-        private static ModelItem ConvertType(object value) {
-            try {
-                return (ModelItem)value;
-            }
-            catch (InvalidCastException) {
-                throw FxTrace.Exception.AsError(new ArgumentException(
-                    string.Format(CultureInfo.CurrentCulture,
-                        Resources.Error_ArgIncorrectType,
-                        "value", typeof(ModelItem).FullName)));
-            }
-        }
-
-        /// <summary>
-        /// Returns an enumerator for the items in the dictionary.
-        /// </summary>
-        /// <returns></returns>
-        [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
-        public abstract IEnumerator<KeyValuePair<ModelItem, ModelItem>> GetEnumerator();
-
-        /// <summary>
-        /// Removes the item from the dictionary.  This does nothing if the item 
-        /// does not exist in the collection.
-        /// </summary>
-        /// <param name="key"></param>
-        /// <exception cref="InvalidOperationException">if the dictionary is read only.</exception>
-        public abstract bool Remove(ModelItem key);
-
-        /// <summary>
-        /// Removes the item from the dictionary.  This does nothing if the item 
-        /// does not exist in the collection.
-        /// </summary>
-        /// <param name="key"></param>
-        /// <exception cref="InvalidOperationException">if the dictionary is read only.</exception>
-        public abstract bool Remove(object key);
-
-        /// <summary>
-        /// Retrieves the value for the given key, or returns false if the 
-        /// value can\92t be found.
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="value"></param>
-        /// <returns></returns>
-        public abstract bool TryGetValue(ModelItem key, out ModelItem value);
-
-        /// <summary>
-        /// Retrieves the value for the given key, or returns false if the 
-        /// value can\92t be found.
-        /// </summary>
-        /// <param name="key"></param>
-        /// <param name="value"></param>
-        /// <returns></returns>
-        public abstract bool TryGetValue(object key, out ModelItem value);
-
-        /// <summary>
-        /// ModelItemDictionary provides an attached property "Key", which is adds to 
-        /// all items contained in the dictionary.  The data type of the Key 
-        /// property is "ModelItem".
-        /// </summary>
-        public static readonly DependencyProperty KeyProperty = DependencyProperty.RegisterAttachedReadOnly(
-            "Key",
-            typeof(ModelItem),
-            typeof(ModelItemDictionary), null).DependencyProperty;
-
-        // IDictionary API is synthesized on top of the generic API.
-
-        #region IDictionary Members
-
-        /// <summary>
-        /// IDictionary Implementation maps back to public API.
-        /// </summary>
-        void IDictionary.Add(object key, object value) {
-            Add(key, value);
-        }
-
-        /// <summary>
-        /// IDictionary Implementation maps back to public API.
-        /// </summary>
-        void IDictionary.Clear() {
-            Clear();
-        }
-
-        /// <summary>
-        /// IDictionary Implementation maps back to public API.
-        /// </summary>
-        [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
-        bool IDictionary.Contains(object key) {
-            return ContainsKey(key);
-        }
-
-        /// <summary>
-        /// IDictionary Implementation maps back to public API.
-        /// </summary>
-        IDictionaryEnumerator IDictionary.GetEnumerator() {
-            return new DictionaryEnumerator(GetEnumerator());
-        }
-
-        /// <summary>
-        /// IDictionary Implementation maps back to public API.
-        /// </summary>
-        bool IDictionary.IsFixedSize {
-            get { return IsFixedSize; }
-        }
-
-        /// <summary>
-        /// IDictionary Implementation maps back to public API.
-        /// </summary>
-        bool IDictionary.IsReadOnly {
-            get { return IsReadOnly; }
-        }
-
-        /// <summary>
-        /// IDictionary Implementation maps back to public API.
-        /// </summary>
-        ICollection IDictionary.Keys
-        {
-            get {
-                object[] keys = new object[Count];
-                int idx = 0;
-                foreach (KeyValuePair<ModelItem, ModelItem> kv in this) {
-                    keys[idx++] = kv.Key;
-                }
-                return keys;
-            }
-        }
-
-        /// <summary>
-        /// IDictionary Implementation maps back to public API.
-        /// </summary>
-        void IDictionary.Remove(object key) {
-            Remove(key);
-        }
-
-        /// <summary>
-        /// IDictionary Implementation maps back to public API.
-        /// </summary>
-        ICollection IDictionary.Values
-        {
-            get {
-                object[] values = new object[Count];
-                int idx = 0;
-                foreach (KeyValuePair<ModelItem, ModelItem> kv in this) {
-                    values[idx++] = kv.Value;
-                }
-                return values;
-            }
-        }
-
-        /// <summary>
-        /// IDictionary Implementation maps back to public API.
-        /// </summary>
-        object IDictionary.this[object key] {
-            get { return this[ConvertType(key)]; }
-            set { this[ConvertType(key)] = ConvertType(value); }
-        }
-
-        #endregion
-
-        #region ICollection Members
-
-        /// <summary>
-        /// ICollection Implementation maps back to public API.
-        /// </summary>
-        void ICollection.CopyTo(Array array, int index) {
-
-            if (Count > 0) {
-                int len = array.GetLength(0);
-                if (index >= len) {
-                    throw FxTrace.Exception.AsError(new ArgumentException(
-                        string.Format(CultureInfo.CurrentCulture,
-                        Resources.Error_InvalidArrayIndex, index)));
-                }
-
-                KeyValuePair<ModelItem, ModelItem>[] typedArray = new KeyValuePair<ModelItem, ModelItem>[len];
-
-                CopyTo(typedArray, index);
-
-                for (; index < typedArray.Length; index++) {
-                    array.SetValue(typedArray[index], index);
-                }
-            }
-        }
-
-        /// <summary>
-        /// ICollection Implementation maps back to public API.
-        /// </summary>
-        int ICollection.Count {
-            get { return Count; }
-        }
-
-        /// <summary>
-        /// ICollection Implementation maps back to public API.
-        /// </summary>
-        bool ICollection.IsSynchronized {
-            get { return IsSynchronized; }
-        }
-
-        /// <summary>
-        /// ICollection Implementation maps back to public API.
-        /// </summary>
-        object ICollection.SyncRoot {
-            get { return SyncRoot; }
-        }
-
-        #endregion
-
-        #region IEnumerable Members
-
-        /// <summary>
-        /// IEnumerator Implementation maps back to public API.
-        /// </summary>
-        IEnumerator IEnumerable.GetEnumerator() {
-            foreach (KeyValuePair<ModelItem, ModelItem> kv in this) {
-                yield return kv;
-            }
-        }
-
-        #endregion
-
-        #region ICollection<KeyValuePair<ModelItem,ModelItem>> Members
-
-        void ICollection<KeyValuePair<ModelItem, ModelItem>>.Add(KeyValuePair<ModelItem, ModelItem> item) {
-            Add(item.Key, item.Value);
-        }
-
-        bool ICollection<KeyValuePair<ModelItem, ModelItem>>.Contains(KeyValuePair<ModelItem, ModelItem> item) {
-            return Contains(item);
-        }
-
-        void ICollection<KeyValuePair<ModelItem, ModelItem>>.CopyTo(KeyValuePair<ModelItem, ModelItem>[] array, int arrayIndex) {
-            if (arrayIndex >= array.Length) {
-                throw FxTrace.Exception.AsError(new ArgumentException(
-                    string.Format(CultureInfo.CurrentCulture,
-                    Resources.Error_InvalidArrayIndex, arrayIndex)));
-            }
-
-            CopyTo(array, arrayIndex);
-        }
-
-        bool ICollection<KeyValuePair<ModelItem, ModelItem>>.Remove(KeyValuePair<ModelItem, ModelItem> item) {
-            ModelItem value;
-            if (TryGetValue(item.Key, out value) && value == item.Value) {
-                return Remove(item.Key);
-            }
-
-            return false;
-        }
-
-        #endregion
-
-        //
-        // This is a simple struct that implements a dictionary enumerator,
-        // since this isn't supported in the iterator pattern.
-        //
-        private struct DictionaryEnumerator : IDictionaryEnumerator {
-
-            private IEnumerator<KeyValuePair<ModelItem, ModelItem>> _real;
-
-            internal DictionaryEnumerator(IEnumerator<KeyValuePair<ModelItem, ModelItem>> real) {
-                _real = real;
-            }
-
-            #region IDictionaryEnumerator Members
-
-            public DictionaryEntry Entry {
-                get { return new DictionaryEntry(_real.Current.Key, _real.Current.Value); }
-            }
-
-            public object Key {
-                get { return _real.Current.Key; }
-            }
-
-            public object Value {
-                get { return _real.Current.Value; }
-            }
-
-            #endregion
-
-            #region IEnumerator Members
-
-            public object Current {
-                get { return Entry; }
-            }
-
-            public bool MoveNext() {
-                return _real.MoveNext();
-            }
-
-            public void Reset() {
-                _real.Reset();
-            }
-
-            #endregion
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelMemberCollection.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelMemberCollection.cs
deleted file mode 100644 (file)
index 83b8bf7..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-//------------------------------------------------------------------------------
-// <copyright file="ModelMemberCollection.cs" company="Microsoft">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//------------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model {
-
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Activities.Presentation;
-
-    /// <summary>
-    /// ModelMemberCollection is an abstract base class that 
-    /// ModelPropertyCollection and ModelEventCollection derive from.
-    /// </summary>
-    /// <typeparam name="TItemType">The type of item the collection represents.</typeparam>
-    /// <typeparam name="TFindType">The type that should be used as a key in "Find" methods.</typeparam>
-    public abstract class ModelMemberCollection<TItemType, TFindType> : IEnumerable<TItemType>, IEnumerable {
-
-        /// <summary>
-        /// Internal constructor.  Only our own collections can derive from this class.
-        /// </summary>
-        internal ModelMemberCollection() { }
-
-        /// <summary>
-        /// Searches the collection for the given key and returns it 
-        /// if it is found.  If not found, this throws an exception.
-        /// </summary>
-        /// <param name="name"></param>
-        /// <returns></returns>
-        /// <exception cref="ArgumentNullException">if name is null.</exception>
-        /// <exception cref="ArgumentException">if name is not found.</exception>
-        public TItemType this[string name] {
-            get {
-                if (name == null) throw FxTrace.Exception.ArgumentNull("name");
-                return Find(name, true);
-            }
-        }
-
-        /// <summary>
-        /// Searches the collection for the given key and returns it 
-        /// if it is found.  If not found, this throws an exception.
-        /// </summary>
-        /// <param name="value"></param>
-        /// <returns></returns>
-        /// <exception cref="ArgumentNullException">if value is null.</exception>
-        /// <exception cref="ArgumentException">if value is not found.</exception>
-        [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")]
-        public TItemType this[TFindType value] {
-            get {
-                if (value == null) throw FxTrace.Exception.ArgumentNull("value");
-                return Find(value, true);
-            }
-        }
-
-        /// <summary>
-        /// Searches the collection for the given key and returns it if it is 
-        /// found.  If not found, this returns null.
-        /// </summary>
-        /// <param name="name"></param>
-        /// <returns></returns>
-        /// <exception cref="ArgumentNullException">if name is null.</exception>
-        public TItemType Find(string name) {
-            if (name == null) throw FxTrace.Exception.ArgumentNull("name");
-            return Find(name, false);
-        }
-
-        /// <summary>
-        /// Searches the collection for the given key and returns it if it is 
-        /// found.  If not found, this throws an exception or returns null, 
-        /// depending on the value passed to throwOnError.
-        /// </summary>
-        /// <param name="name"></param>
-        /// <param name="throwOnError"></param>
-        /// <returns></returns>
-        /// <exception cref="ArgumentException">if name is not found and throwOnError is true.</exception>
-        protected abstract TItemType Find(string name, bool throwOnError);
-
-        /// <summary>
-        /// Searches the collection for the given key and returns it if it is 
-        /// found.  If not found, this returns null.
-        /// </summary>
-        /// <param name="value"></param>
-        /// <returns></returns>
-        /// <exception cref="ArgumentNullException">if value is null.</exception>
-        public TItemType Find(TFindType value) {
-            if (value == null) throw FxTrace.Exception.ArgumentNull("value");
-            return Find(value, false);
-        }
-
-        /// <summary>
-        /// Searches the collection for the given key and returns it if it is 
-        /// found.  If not found, this throws an exception or returns null, 
-        /// depending on the value passed to throwOnError.
-        /// </summary>
-        /// <param name="value"></param>
-        /// <param name="throwOnError"></param>
-        /// <returns></returns>
-        /// <exception cref="ArgumentException">if value is not found and throwOnError is true.</exception>
-        protected abstract TItemType Find(TFindType value, bool throwOnError);
-
-        /// <summary>
-        /// Returns an enumerator to enumerate values.
-        /// </summary>
-        /// <returns></returns>
-        public abstract IEnumerator<TItemType> GetEnumerator();
-
-        #region IEnumerable Members
-
-        /// <summary>
-        /// IEnumerable Implementation.
-        /// </summary>
-        /// <returns></returns>
-        IEnumerator IEnumerable.GetEnumerator() {
-            return GetEnumerator();
-        }
-
-        #endregion
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelProperty.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelProperty.cs
deleted file mode 100644 (file)
index 9a49ada..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-//------------------------------------------------------------------------------
-// <copyright file="ModelProperty.cs" company="Microsoft">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//------------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model {
-
-    using System.Activities.Presentation.Internal.Properties;
-    using System;
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Runtime;
-
-    /// <summary>
-    /// An ModelProperty represents a property on an item.  ModelProperties are 
-    /// associated with an instance of an item, which allows them to have simple 
-    /// Value get/set properties instead of the more cumbersome GetValue/SetValue 
-    /// mechanism of PropertyDescriptor.
-    /// 
-    /// A ModelProperty\92s value may come from a locally set value, or it may be 
-    /// inherited from somewhere higher up in the property mechanism.  Because 
-    /// all items in the tree contain Source properties, you can 
-    /// easily find out the real source of a property value simply using the 
-    /// following code:
-    /// 
-    ///     Console.WriteLine(property.Value.Source);
-    /// 
-    /// Value will return null if the property is not set anywhere in the hierarchy.
-    /// 
-    /// Type converters and editors defined on the underlying data model are 
-    /// wrapped so that they accept ModelItems as parameters.
-    /// </summary>
-    public abstract class ModelProperty {
-
-        /// <summary>
-        /// Creates a new ModelProperty.
-        /// </summary>
-        protected ModelProperty() { }
-
-        /// <summary>
-        /// Returns the attributes declared on this property.
-        /// </summary>
-        public abstract AttributeCollection Attributes { get; }
-
-        /// <summary>
-        /// Returns Value cast as a ModelItemCollection.  This property allows you to 
-        /// access collection properties easily without cluttering your code with casts:
-        /// 
-        ///     Property.Collection.Add(myItem);
-        /// 
-        /// If the property value is not a collection, this property will return null.
-        /// </summary>
-        [Fx.Tag.KnownXamlExternalAttribute]
-        public abstract ModelItemCollection Collection { get; }
-
-        /// <summary>
-        /// Returns the currently computed value for this property.  Setting a value
-        /// on this property is the same as calling SetValue, but can be used in
-        /// data binding expressions.
-        /// </summary>
-        public abstract object ComputedValue { get; set; }
-
-        /// <summary>
-        /// Returns the type converter to use with this property.  Underlying type 
-        /// converters are all wrapped so they accept Item objects.  When performing 
-        /// a conversion to a particular value, the type converter\92s return type is 
-        /// not wrapped.  Type converters which return standard values also return 
-        /// values as Item objects.
-        /// </summary>
-        public abstract TypeConverter Converter { get; }
-
-        /// <summary>
-        /// Returns the type which defines this property if IsAttached returns true.
-        /// Otherwhise, returns null.
-        /// </summary>
-        public abstract Type AttachedOwnerType { get; }
-
-        /// <summary>
-        /// Returns the default value for this property.  If the property does not 
-        /// define a default value this will return null.
-        /// </summary>
-        public abstract object DefaultValue { get; }
-
-        /// <summary>
-        /// Returns Value cast as a ItemDictionary.  This property allows you to 
-        /// access dictionary properties easily without cluttering your code with casts:
-        /// 
-        ///     Property.Dictionary[key] = value;
-        /// 
-        /// If the property value is not a dictionary, this property will return null.
-        /// </summary>
-        [Fx.Tag.KnownXamlExternalAttribute]
-        public abstract ModelItemDictionary Dictionary { get; }
-
-        /// <summary>
-        /// Returns true if the property can be shown in a property window.
-        /// </summary>
-        public abstract bool IsBrowsable { get; }
-
-        /// <summary>
-        /// Returns true if the value contained in the property is a ItemCollection.
-        /// </summary>
-        public abstract bool IsCollection { get; }
-
-        /// <summary>
-        /// Returns true if the value contained in the property is a ItemDictionary.
-        /// </summary>
-        public abstract bool IsDictionary { get; }
-
-        /// <summary>
-        /// Returns true if the property is read only.
-        /// </summary>
-        public abstract bool IsReadOnly { get; }
-
-        /// <summary>
-        /// Returns true if the property\92s value is set locally.
-        /// </summary>
-        public abstract bool IsSet { get; }
-
-        /// <summary>
-        /// Returns true if the property represents an attached property from a different type.
-        /// </summary>
-        public abstract bool IsAttached { get; }
-
-        /// <summary>
-        /// Returns the value set into this property.  A property may return a 
-        /// value that is inherited further up the element hierarchy, in which 
-        /// case this property will return a value whose source != this.  
-        /// If no value has ever been set for the property Value will return null.
-        /// </summary>
-        public abstract ModelItem Value { get; }
-
-        /// <summary>
-        /// Returns the name of this property.
-        /// </summary>
-        public abstract string Name { get; }
-
-        /// <summary>
-        /// Returns the parent of this property.  All properties have 
-        /// parents, so this never returns null.
-        /// </summary>
-        public abstract ModelItem Parent { get; }
-
-        /// <summary>
-        /// The data type of the property.
-        /// </summary>
-        public abstract Type PropertyType { get; }
-
-        /// <summary>
-        /// Clears the local value for the property.
-        /// </summary>
-        public abstract void ClearValue();
-
-        /// <summary>
-        /// Sets a local value on a property.  If this value is already 
-        /// a ModelItem, it will be used directly.  If it isn\92t, a ModelItem 
-        /// will be created.  Setting null into a property is valid, but 
-        /// this is not the same as calling ClearValue().
-        /// </summary>
-        /// <param name="value">
-        /// The new value to set.
-        /// </param>
-        /// <returns>
-        /// The input value, if the value is already a ModelItem, or a newly
-        /// created ModelItem wrapping the value.
-        /// </returns>
-        public abstract ModelItem SetValue(object value);
-
-        internal virtual string Reference
-        {
-            get
-            {
-                return null;
-            }
-        }
-
-        internal virtual void ClearReference()
-        {
-        }
-
-        internal virtual void SetReference(string sourceProperty)
-        {
-        }
-
-        /// <summary>
-        /// Equality operator.
-        /// </summary>
-        // FXCop: args are validated; fxcop does not seem to understand ReferenceEquals.
-        
-        public static bool operator ==(ModelProperty first, ModelProperty second) {
-            if (object.ReferenceEquals(first, second)) return true;
-            if (object.ReferenceEquals(first, null) || object.ReferenceEquals(second, null)) return false;
-            return (first.Parent == second.Parent && first.Name.Equals(second.Name));
-        }
-
-        /// <summary>
-        /// Inequality operator.
-        /// </summary>
-        // FXCop: args are validated; fxcop does not seem to understand ReferenceEquals.
-        
-        public static bool operator !=(ModelProperty first, ModelProperty second) {
-            if (object.ReferenceEquals(first, second)) return false;
-            if (object.ReferenceEquals(first, null) || object.ReferenceEquals(second, null)) return true;
-            return (first.Parent != second.Parent || !first.Name.Equals(second.Name));
-        }
-
-        /// <summary>
-        /// Equality for properties.  Properties are equal if
-        /// they have the same name and parent.
-        /// </summary>
-        /// <param name="obj"></param>
-        /// <returns></returns>
-        public override bool Equals(object obj) {
-            if (object.ReferenceEquals(obj, this)) return true;
-            ModelProperty prop = obj as ModelProperty;
-            if (object.ReferenceEquals(prop, null)) return false;
-            if (prop.Parent != Parent) return false;
-            return prop.Name.Equals(Name);
-        }
-
-        /// <summary>
-        /// Standard hashcode implementation.
-        /// </summary>
-        /// <returns></returns>
-        public override int GetHashCode() {
-            return Parent.GetHashCode() ^ Name.GetHashCode();
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelPropertyCollection.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Model/ModelPropertyCollection.cs
deleted file mode 100644 (file)
index a8f3a1a..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-//------------------------------------------------------------------------------
-// <copyright file="ModelPropertyCollection.cs" company="Microsoft">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//------------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model {
-
-    using System;
-    using System.Windows;
-
-    /// <summary>
-    /// A ModelPropertyCollection contains an enumeration of properties.  
-    /// It defines an enumerator and a variety of search mechanisms.
-    /// </summary>
-    public abstract class ModelPropertyCollection :
-        ModelMemberCollection<ModelProperty, DependencyProperty> {
-
-        /// <summary>
-        /// Creates a new ModelPropertyCollection.
-        /// </summary>
-        protected ModelPropertyCollection() : base() { }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Services/ModelChangeInfo.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Services/ModelChangeInfo.cs
deleted file mode 100644 (file)
index 6f9c5ea..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Services
-{
-    using System.Activities.Presentation.Model;
-
-    /// <summary>
-    /// Contains data for detailed model change information
-    /// </summary>
-    public abstract class ModelChangeInfo
-    {
-        /// <summary>
-        /// Gets model change type
-        /// </summary>
-        public abstract ModelChangeType ModelChangeType { get; }
-
-        /// <summary>
-        /// Gets modelitem where a model change happens
-        /// </summary>
-        public abstract ModelItem Subject { get; }
-
-        /// <summary>
-        /// Gets property name if it's a property change
-        /// </summary>
-        public abstract string PropertyName { get; }
-
-        /// <summary>
-        /// Gets key model item if it's a dictionary change
-        /// </summary>
-        public abstract ModelItem Key { get; }
-
-        /// <summary>
-        /// Gets old value if it's a property chagne or a dictionary value change
-        /// </summary>
-        public abstract ModelItem OldValue { get; }
-
-        /// <summary>
-        /// Gets object that is been added/removed or the new value if it's a property change
-        /// </summary>
-        public abstract ModelItem Value { get; }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Services/ModelChangeInfoImpl.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Services/ModelChangeInfoImpl.cs
deleted file mode 100644 (file)
index f22e628..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Services
-{
-    using System.Activities.Presentation.Model;
-
-    internal class ModelChangeInfoImpl : ModelChangeInfo
-    {
-        private ModelChangeType modelChangeType;
-        private ModelItem subject;
-        private string propertyName;
-        private ModelItem key;
-        private ModelItem oldValue;
-        private ModelItem value;
-
-        private ModelChangeInfoImpl(ModelChangeType modelChangeType, ModelItem subject, string propertyName, ModelItem key, ModelItem oldValue, ModelItem value)
-        {
-            this.modelChangeType = modelChangeType;
-            this.subject = subject;
-            this.propertyName = propertyName;
-            this.key = key;
-            this.oldValue = oldValue;
-            this.value = value;
-        }
-
-        public override ModelChangeType ModelChangeType
-        {
-            get { return this.modelChangeType; }
-        }
-
-        public override ModelItem Subject
-        {
-            get { return this.subject; }
-        }
-
-        public override string PropertyName
-        {
-            get { return this.propertyName; }
-        }
-
-        public override ModelItem Key
-        {
-            get { return this.key; }
-        }
-
-        public override ModelItem OldValue
-        {
-            get { return this.oldValue; }
-        }
-
-        public override ModelItem Value
-        {
-            get { return this.value; }
-        }
-
-        public static ModelChangeInfoImpl CreatePropertyChanged(ModelItem subject, string propertyName, ModelItem oldValue, ModelItem newValue)
-        {
-            return new ModelChangeInfoImpl(ModelChangeType.PropertyChanged, subject, propertyName, null, oldValue, newValue);
-        }
-
-        public static ModelChangeInfoImpl CreateCollectionItemAdded(ModelItem subject, ModelItem item)
-        {
-            return new ModelChangeInfoImpl(ModelChangeType.CollectionItemAdded, subject, null, null, null, item);
-        }
-
-        public static ModelChangeInfoImpl CreateCollectionItemRemoved(ModelItem subject, ModelItem item)
-        {
-            return new ModelChangeInfoImpl(ModelChangeType.CollectionItemRemoved, subject, null, null, null, item);
-        }
-
-        public static ModelChangeInfoImpl CreateDictionaryKeyValueAdded(ModelItem subject, ModelItem key, ModelItem value)
-        {
-            return new ModelChangeInfoImpl(ModelChangeType.DictionaryKeyValueAdded, subject, null, key, null, value);
-        }
-
-        public static ModelChangeInfoImpl CreateDictionaryKeyValueRemoved(ModelItem subject, ModelItem key, ModelItem value)
-        {
-            return new ModelChangeInfoImpl(ModelChangeType.DictionaryKeyValueRemoved, subject, null, key, null, value);
-        }
-
-        public static ModelChangeInfoImpl CreateDictionaryValueChanged(ModelItem subject, ModelItem key, ModelItem oldValue, ModelItem newValue)
-        {
-            return new ModelChangeInfoImpl(ModelChangeType.DictionaryValueChanged, subject, null, key, oldValue, newValue);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Services/ModelChangeType.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Services/ModelChangeType.cs
deleted file mode 100644 (file)
index 5448953..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Services
-{
-    /// <summary>
-    /// model change type
-    /// </summary>
-    public enum ModelChangeType
-    {
-        /// <summary>
-        /// none operation
-        /// </summary>
-        None,
-
-        /// <summary>
-        /// a property is changed
-        /// </summary>
-        PropertyChanged,
-
-        /// <summary>
-        /// a collection item is added
-        /// </summary>
-        CollectionItemAdded,
-
-        /// <summary>
-        /// a collection item is removed
-        /// </summary>
-        CollectionItemRemoved,
-
-        /// <summary>
-        /// a dictionary key value is added
-        /// </summary>
-        DictionaryKeyValueAdded,
-
-        /// <summary>
-        /// a dictionary key value is removed
-        /// </summary>
-        DictionaryKeyValueRemoved,
-
-        /// <summary>
-        /// a dictionay value is changed
-        /// </summary>
-        DictionaryValueChanged,
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Services/ModelChangedEventArgs.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Services/ModelChangedEventArgs.cs
deleted file mode 100644 (file)
index 0eb64b8..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//------------------------------------------------------------------------------
-// <copyright file="ModelChangedEventArgs.cs" company="Microsoft">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//------------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Services
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Activities.Presentation.Model;
-
-    /// <summary>
-    /// When the model raises change events, it creates an 
-    /// EventArgs that describes the change.
-    /// </summary>
-    public abstract class ModelChangedEventArgs : EventArgs {
-        
-        /// <summary>
-        /// Creates a new ModelChangedEventArgs.
-        /// </summary>
-        protected ModelChangedEventArgs() {
-        }
-
-        /// <summary>
-        /// An enumeration of objects that have been added.
-        /// </summary>
-        [Obsolete("Don't use this property. Use \"ModelChangeInfo\" instead.")]
-        public abstract IEnumerable<ModelItem> ItemsAdded { get; }
-
-        /// <summary>
-        /// An enumeration of objects that have been removed.
-        /// </summary>
-        [Obsolete("Don't use this property. Use \"ModelChangeInfo\" instead.")]
-        public abstract IEnumerable<ModelItem> ItemsRemoved { get; }
-
-        /// <summary>
-        /// An enumeration of properties that have been changed.
-        /// </summary>
-        [Obsolete("Don't use this property. Use \"ModelChangeInfo\" instead.")]
-        public abstract IEnumerable<ModelProperty> PropertiesChanged { get; }
-
-        /// <summary>
-        /// A ModelChangeInfo object that contains detailed model change information.
-        /// </summary>
-        public virtual ModelChangeInfo ModelChangeInfo
-        {
-            get { return null; }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Services/ViewService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Interaction/Services/ViewService.cs
deleted file mode 100644 (file)
index 996d777..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//------------------------------------------------------------------------------
-// <copyright file="ViewService.cs" company="Microsoft">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//------------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Services {
-
-    using System;
-    using System.Windows;
-    using System.Activities.Presentation.Model;
-
-    /// <summary>
-    /// This service allows you to move between the model and the view.
-    /// </summary>
-    public abstract class ViewService {
-
-        /// <summary>
-        /// Constructs a new ViewService.
-        /// </summary>
-        protected ViewService() {
-        }
-
-        /// <summary>
-        /// Returns the model corresponding to the view, or null if 
-        /// there is no model matching the view.
-        /// </summary>
-        /// <param name="view">
-        /// The view object you wish to find the model for.
-        /// </param>
-        /// <returns>
-        /// The corresponding model, or null if there is no model for the
-        /// given view object.
-        /// </returns>
-        /// <exception cref="ArgumentNullException">if view is null.</exception>
-        public abstract ModelItem GetModel(DependencyObject view);
-
-        /// <summary>
-        /// Returns the view corresponding to the given model.  This 
-        /// can return null if there is no view for the model.
-        /// </summary>
-        /// <param name="model">
-        /// The model to return the view object for.
-        /// </param>
-        /// <returns>
-        /// The view for this model, or null if there is no view.
-        /// </returns>
-        /// <exception cref="ArgumentNullException">if model is null.</exception>
-        /// <exception cref="ArgumentException">if model does not represent a valid model for this service.</exception>
-        public abstract DependencyObject GetView(ModelItem model);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Shared/Internal/EqualityArray.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Shared/Internal/EqualityArray.cs
deleted file mode 100644 (file)
index 7442dd3..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-namespace System.Activities.Presentation.Internal {
-
-    using System.Diagnostics;
-    using System.Runtime;
-
-    //
-    // An EqualityArray is an array of objects whose
-    // .Equals method runs against all items in the 
-    // array.  It is assumed that the data input
-    // into the array is constant.  We use this in attributes
-    // to offer a quick and accurate TypeId property.
-    //
-    internal class EqualityArray {
-        private object[] _values;
-
-        internal EqualityArray(params object[] values) {
-            _values = values;
-            Fx.Assert(_values != null && _values.Length > 0, "EqualityArray expects at least one value");
-        }
-
-        public override bool Equals(object other) {
-            EqualityArray otherArray = other as EqualityArray;
-            if (otherArray == null) return false;
-            if (otherArray._values.Length != _values.Length) return false;
-            for (int idx = 0; idx < _values.Length; idx++) {
-                if (_values[idx] != otherArray._values[idx]) return false;
-            }
-            return true;
-        }
-
-        public override int GetHashCode() {
-            return _values[0].GetHashCode();
-        }
-    }
-}
-
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/BookmarkUndoUnit.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/BookmarkUndoUnit.cs
deleted file mode 100644 (file)
index c3942b7..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Model;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Runtime;
-
-    internal sealed class BookmarkUndoUnit : UndoUnit
-    {
-        private ModelTreeManager modelTreeManager;
-
-        public BookmarkUndoUnit(EditingContext context, ModelTreeManager modelTreeManager)
-            : base(context)
-        {
-            Fx.Assert(modelTreeManager != null, "modelTreeManager cannot be null");
-
-            this.modelTreeManager = modelTreeManager;
-            this.DoList = new List<UndoUnit>();
-            this.RedoList = new List<UndoUnit>();
-        }
-
-        internal List<UndoUnit> DoList
-        {
-            get;
-            private set;
-        }
-
-        internal List<UndoUnit> RedoList
-        {
-            get;
-            private set;
-        }
-
-        public override void Redo()
-        {
-            this.modelTreeManager.StopTracking();
-            try
-            {
-                this.DoList = this.RedoList.Reverse<UndoUnit>().ToList();
-                using (EditingScope redoEditingScope = this.modelTreeManager.CreateEditingScope(this.Description, true))
-                {
-                    this.DoList.ForEach(unit => unit.Redo());
-                    redoEditingScope.Complete();
-                }
-                this.RedoList.Clear();
-            }
-            finally
-            {
-                this.modelTreeManager.StartTracking();
-            }
-        }
-
-        public override void Undo()
-        {
-            this.modelTreeManager.StopTracking();
-            try
-            {
-                this.RedoList = this.DoList.Reverse<UndoUnit>().ToList();
-                using (EditingScope undoEditingScope = this.modelTreeManager.CreateEditingScope(this.Description, true))
-                {
-                    this.RedoList.ForEach(unit => unit.Undo());
-                    undoEditingScope.Complete();
-                }
-                this.DoList.Clear();
-            }
-            finally
-            {
-                this.modelTreeManager.StartTracking();
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/CachedResourceDictionaryExtension.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/CachedResourceDictionaryExtension.cs
deleted file mode 100644 (file)
index 34aa3df..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Text;
-    using System.Windows;
-    using System.Windows.Markup;
-
-    [MarkupExtensionReturnType(typeof(ResourceDictionary))]
-    public class CachedResourceDictionaryExtension : MarkupExtension
-    {
-        static Dictionary<Uri, ResourceDictionary> Cache = new Dictionary<Uri, ResourceDictionary>();
-
-        public Uri Source { get; set; }
-
-        public override object ProvideValue(IServiceProvider serviceProvider)
-        {
-            ResourceDictionary resourceDictionary = null;
-            // disable caching till the wpf mergedictionaries in theme dictionary bug is fixed.
-            if (!Cache.TryGetValue(this.Source, out resourceDictionary))
-            {
-                resourceDictionary = new ResourceDictionary();
-                resourceDictionary.Source = this.Source;
-                Cache.Add(this.Source, resourceDictionary);
-            }
-            return resourceDictionary;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ClipboardData.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ClipboardData.cs
deleted file mode 100644 (file)
index 5d558a2..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Collections.Generic;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-
-    [Serializable]
-    public class ClipboardData
-    {
-        [SuppressMessage(FxCop.Category.Usage, FxCop.Rule.CollectionPropertiesShouldBeReadOnly,
-            Justification = "The setter of this property is used several places.")]
-        public List<object> Data { get; set;  }
-
-        [SuppressMessage(FxCop.Category.Usage, FxCop.Rule.CollectionPropertiesShouldBeReadOnly,
-            Justification = "The setter of this property is used several places.")]
-        public List<object> Metadata { get; set;  }
-
-        public string Version { get; set; }
-    }
-
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ContextMenuUtilities.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ContextMenuUtilities.cs
deleted file mode 100644 (file)
index 967e101..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Annotations;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.View;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Windows.Input;
-
-    internal static class ContextMenuUtilities
-    {
-        public static void OnAddAnnotationCommandCanExecute(CanExecuteRoutedEventArgs e, EditingContext editingContext)
-        {
-            OnAddAnnotationCommandCanExecute(e, editingContext, EditingContextUtilities.GetSingleSelectedModelItem(editingContext));
-        }
-
-        public static void OnAddAnnotationCommandCanExecute(CanExecuteRoutedEventArgs e, EditingContext editingContext, DataGrid dataGrid)
-        {
-            OnAddAnnotationCommandCanExecute(e, editingContext, DataGridHelper.GetSingleSelectedObject(dataGrid));
-        }
-
-        public static void OnAddAnnotationCommandCanExecute(CanExecuteRoutedEventArgs e, EditingContext editingContext, ModelItem modelItem)
-        {
-            e.Handled = true;
-
-            if (modelItem == null || !DesignerConfigurationServiceUtilities.IsAnnotationEnabled(editingContext) || EditingContextUtilities.IsReadOnly(editingContext))
-            {
-                e.CanExecute = false;
-                return;
-            }
-
-            e.CanExecute = !modelItem.HasAnnotation();
-        }
-
-        public static void OnDeleteAnnotationCommandCanExecute(CanExecuteRoutedEventArgs e, EditingContext editingContext)
-        {
-            OnDeleteAnnotationCommandCanExecute(e, editingContext, EditingContextUtilities.GetSingleSelectedModelItem(editingContext));
-        }
-
-        public static void OnDeleteAnnotationCommandCanExecute(CanExecuteRoutedEventArgs e, EditingContext editingContext, DataGrid dataGrid)
-        {
-            OnDeleteAnnotationCommandCanExecute(e, editingContext, DataGridHelper.GetSingleSelectedObject(dataGrid));
-        }
-
-        public static void OnDeleteAnnotationCommandCanExecute(CanExecuteRoutedEventArgs e, EditingContext editingContext, ModelItem modelItem)
-        {
-            e.Handled = true;
-
-            if (modelItem == null || !DesignerConfigurationServiceUtilities.IsAnnotationEnabled(editingContext) || EditingContextUtilities.IsReadOnly(editingContext))
-            {
-                e.CanExecute = false;
-                return;
-            }
-
-            e.CanExecute = modelItem.HasAnnotation();
-        }
-
-        public static void OnDeleteAllAnnotationCommandCanExecute(CanExecuteRoutedEventArgs e, EditingContext editingContext)
-        {
-            e.Handled = true;
-
-            if (!DesignerConfigurationServiceUtilities.IsAnnotationEnabled(editingContext) || EditingContextUtilities.IsReadOnly(editingContext))
-            {
-                e.CanExecute = false;
-            }
-            else
-            {
-                e.CanExecute = true;
-            }
-        }
-        
-        // var/arg designer
-        public static void OnDeleteCommandCanExecute(CanExecuteRoutedEventArgs e, DataGrid dataGrid)
-        {
-            e.Handled = true;
-
-            if (dataGrid == null || dataGrid.SelectedItems == null || dataGrid.SelectedItems.Count == 0)
-            {
-                e.CanExecute = false;
-            }
-
-            if (dataGrid.SelectedItems.Count == 1 && dataGrid.SelectedItems[0] == CollectionView.NewItemPlaceholder)
-            {
-                e.CanExecute = false;
-            }
-
-            e.CanExecute = true;
-        }
-
-        public static void OnAddAnnotationCommandExecuted(ExecutedRoutedEventArgs e, ModelItem modelItem)
-        {
-            ModelProperty property = modelItem.Properties.Find(Annotation.AnnotationTextPropertyName);
-            if (property != null)
-            {
-                using (ModelEditingScope editingScope = modelItem.BeginEdit(SR.AddAnnotationDescription))
-                {
-                    property.SetValue(string.Empty);
-                    ViewStateService viewStateService = modelItem.GetEditingContext().Services.GetService<ViewStateService>();
-                    viewStateService.StoreViewStateWithUndo(modelItem, Annotation.IsAnnotationDockedViewStateName, false);
-                    editingScope.Complete();
-                }
-
-                if (modelItem.View != null)
-                {
-                    WorkflowViewElement element = modelItem.View as WorkflowViewElement;
-                    if (element != null)
-                    {
-                        element.OnEditAnnotation();
-                    }
-                }
-            }
-
-            e.Handled = true;
-        }
-
-        public static void OnEditAnnotationCommandExecuted(ExecutedRoutedEventArgs e, ModelItem modelItem)
-        {
-            WorkflowViewElement element = modelItem.View as WorkflowViewElement;
-            if (element != null)
-            {
-                element.OnEditAnnotation();
-            }
-
-            e.Handled = true;
-        }
-
-        public static void OnDeleteAnnotationCommandExecuted(ExecutedRoutedEventArgs e, ModelItem modelItem)
-        {
-            using (ModelEditingScope editingScope = modelItem.BeginEdit(SR.DeleteAnnotationDescription))
-            {
-                modelItem.Properties[Annotation.AnnotationTextPropertyName].SetValue(null);
-                ViewStateService viewStateService = modelItem.GetEditingContext().Services.GetService<ViewStateService>();
-                viewStateService.StoreViewStateWithUndo(modelItem, Annotation.IsAnnotationDockedViewStateName, null);
-                editingScope.Complete();
-            }
-
-            e.Handled = true;
-        }
-
-        public static void OnAnnotationMenuLoaded(EditingContext editingContext, Control control, RoutedEventArgs e)
-        {
-            if (DesignerConfigurationServiceUtilities.IsAnnotationEnabled(editingContext))
-            {
-                control.Visibility = Visibility.Visible;
-            }
-            else
-            {
-                control.Visibility = Visibility.Collapsed;
-            }
-
-            e.Handled = true;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ActivityActionSearchableStringConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ActivityActionSearchableStringConverter.cs
deleted file mode 100644 (file)
index f0dd69a..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Converters
-{
-    using System.Collections.Generic;
-
-    class ActivityActionSearchableStringConverter<T> : SearchableStringConverter
-    {
-        public override IList<string> Convert(object value)
-        {
-            ActivityAction<T> action = value as ActivityAction<T>;
-            IList<string> results = new List<string>();
-            if (action != null)
-            {
-                results.Add(action.Argument.Name);
-            }
-            return results;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ArgumentSearchableStringConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ArgumentSearchableStringConverter.cs
deleted file mode 100644 (file)
index 840ec13..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Converters
-{
-    using System.Collections.Generic;
-
-    class ArgumentSearchableStringConverter : SearchableStringConverter
-    {
-        public override IList<string> Convert(object value)
-        {
-            IList<string> results = new List<string>();
-            if (value is Argument)
-            {
-                results.Add(ExpressionHelper.GetExpressionString(((Argument)value).Expression));
-            }
-            return results;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ArgumentToExpressionConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ArgumentToExpressionConverter.cs
deleted file mode 100644 (file)
index b2bdf86..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Converters
-{
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Windows.Data;
-    using System.Activities.Presentation.Model;
-    using System.Runtime;
-    using System.Activities.Presentation.Services;
-
-    // This type converter converts from Argument to Argument.Expression
-    // on the reverse direction it creates  a new Argument and sets the expression on it with the value
-    // The direction of the created argument is provided by the converter parameter.
-    public class ArgumentToExpressionConverter : IValueConverter
-    {
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            object convertedValue = null;
-            if (value != null)
-            {
-                ModelItem argumentModelItem = value as ModelItem;
-                if (argumentModelItem != null &&
-                    argumentModelItem.Properties["Expression"] != null &&
-                    argumentModelItem.Properties["Expression"].Value != null)
-                {
-                    convertedValue = argumentModelItem.Properties["Expression"].Value;
-                }
-            }
-            return convertedValue;
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            Argument target  = null;
-            ArgumentDirection direction = ArgumentDirection.In;
-            string directionString = parameter as string;
-            if (!string.IsNullOrEmpty(directionString))
-            {
-                direction = (ArgumentDirection)Enum.Parse(typeof(ArgumentDirection), directionString);
-            }
-
-            ActivityWithResult expression = value as ActivityWithResult;
-            ModelItem valueExpressionModelItem = value as ModelItem;
-            if (valueExpressionModelItem != null && typeof(ActivityWithResult).IsAssignableFrom(valueExpressionModelItem.ItemType))
-            {
-                expression = (ActivityWithResult)valueExpressionModelItem.GetCurrentValue();
-            }
-
-            if (expression != null)
-            {
-
-                // In the In case the expression is of type Activity<T> so we want to create InArgument<T>
-                // In Out and InOut case the expresion is Activity<Location<T>> we want to create OutArgument<T>,InOutArgument<T>
-                Type argumentType;
-                if (direction == ArgumentDirection.In)
-                {
-                    argumentType = expression.ResultType;
-                }
-                else
-                {
-                    // if expression type is Location<T> argument type is T
-                    if (expression.ResultType.IsGenericType)
-                    {
-                        argumentType = expression.ResultType.GetGenericArguments()[0];
-                    }
-                    //expression type is not a Location<T>, probably an error, but let's give it a try...
-                    else
-                    {
-                        argumentType = expression.ResultType;
-                    }
-                }
-                try
-                {
-                    target = Argument.Create(argumentType, direction);
-                    target.Expression = expression;
-                }
-                catch (Exception err)
-                {
-                    Trace.WriteLine(err.ToString());
-                    throw;
-                }
-
-            }
-            if (targetType == typeof(ModelItem))
-            {
-                if (valueExpressionModelItem == null)
-                {
-                    return null;
-                }
-                else
-                {
-                    return ((ModelServiceImpl)valueExpressionModelItem.GetEditingContext().Services.GetService<ModelService>()).WrapAsModelItem(target);
-                }
-            }
-            else
-            {
-                return target;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ArgumentToExpressionModelItemConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ArgumentToExpressionModelItemConverter.cs
deleted file mode 100644 (file)
index db8d4d7..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Converters
-{
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Windows.Data;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-
-    // This converter converts from Argument to Argument.Expression ModelItem using the ModelPropertyEntry instance.
-    // on the reverse direction it creates  a new Argument and sets the expression on it with the value
-    // The direction of the created argument is provided by the converter parameter.
-    //1st binding is to the PropertyValue
-    //2nd binding is to the ModelProprtyEntry (to get the modelItem).
-    public class ArgumentToExpressionModelItemConverter : IMultiValueConverter
-    {
-        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-        {
-            ModelItem convertedValue = null;
-            if (values[1] != null)
-            {
-                ModelPropertyEntry modelPropertyEntry = values[1] as ModelPropertyEntry;
-                if (modelPropertyEntry != null)
-                {
-                    ModelProperty property = modelPropertyEntry.FirstModelProperty;
-                    if (property != null)
-                    {
-                        ModelItem argumentModelItem = property.Value;
-                        if (argumentModelItem != null &&
-                                argumentModelItem.Properties["Expression"] != null &&
-                                argumentModelItem.Properties["Expression"].Value != null)
-                        {
-                            convertedValue = argumentModelItem.Properties["Expression"].Value;
-                        }
-                    }
-                }
-            }
-            return convertedValue;
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
-        {
-            Argument target = null;
-            ArgumentDirection direction = ArgumentDirection.In;
-            string directionString = parameter as string;
-            if (!string.IsNullOrEmpty(directionString))
-            {
-                direction = (ArgumentDirection)Enum.Parse(typeof(ArgumentDirection), directionString);
-            }
-
-            Activity expression = null;
-            ModelItem valueExpressionModelItem = value as ModelItem;
-            if (valueExpressionModelItem != null && typeof(Activity).IsAssignableFrom(valueExpressionModelItem.ItemType))
-            {
-                expression = (Activity)valueExpressionModelItem.GetCurrentValue();
-            }
-            ActivityWithResult activityWithResult = expression as ActivityWithResult;
-            if (expression != null && activityWithResult != null)
-            {
-                // In the In case the expression is of type Activity<T> so we want to create InArgument<T>
-                // In Out and InOut case the expresion is Activity<Location<T>> we want to create OutArgument<T>,InOutArgument<T>
-                Type argumentType;
-                if (direction == ArgumentDirection.In)
-                {
-                    argumentType = activityWithResult.ResultType;
-                }
-                else
-                {
-                    // if expression type is Location<T> argument type is T
-                    argumentType = activityWithResult.ResultType.GetGenericArguments()[0];
-                }
-                target = Argument.Create(argumentType, direction);
-                target.Expression = activityWithResult;
-            }
-            return new object[] { target };
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/EmptySearchableStringConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/EmptySearchableStringConverter.cs
deleted file mode 100644 (file)
index 35cfd46..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Converters
-{
-    using System;
-    using System.Collections.Generic;
-
-    internal class EmptySearchableStringConverter : SearchableStringConverter
-    {
-        public override IList<string> Convert(object value)
-        {
-            return new List<string>();
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/EncodingSearchableStringConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/EncodingSearchableStringConverter.cs
deleted file mode 100644 (file)
index cd76635..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Converters
-{
-    using System.Collections.Generic;
-    using System.Text;
-
-    internal class EncodingSearchableStringConverter : SearchableStringConverter
-    {
-        public override IList<string> Convert(object value)
-        {
-            IList<string> results = new List<string>();
-            if (value is Encoding)
-            {
-                results.Add(((Encoding)value).EncodingName.ToString());
-            }
-
-            return results;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ModelItemToAnnotationEnabledConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ModelItemToAnnotationEnabledConverter.cs
deleted file mode 100644 (file)
index 7c3a803..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Converters
-{
-    using System.Activities.Presentation.Model;
-    using System.Windows.Data;
-
-    internal class ModelItemToAnnotationEnabledConverter : IValueConverter
-    {
-        public object Convert(object value, Type targetType, object parameter, Globalization.CultureInfo culture)
-        {
-            ModelItem modelItem = value as ModelItem;
-
-            if (modelItem != null)
-            {
-                EditingContext editingContext = modelItem.GetEditingContext();
-                if (editingContext != null)
-                {
-                    return editingContext.Services.GetService<DesignerConfigurationService>().AnnotationEnabled;
-                }
-            }
-
-            return false;
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, Globalization.CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotImplementedException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ModelPropertyEntryToModelItemConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ModelPropertyEntryToModelItemConverter.cs
deleted file mode 100644 (file)
index bca6109..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Converters
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Globalization;
-    using System.Linq;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Runtime;
-    using System.Diagnostics.CodeAnalysis;
-
-    public sealed class ModelPropertyEntryToModelItemConverter : IMultiValueConverter, IValueConverter
-    {
-        ModelPropertyEntryToOwnerActivityConverter propertyEntryConverter = new ModelPropertyEntryToOwnerActivityConverter();
-
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            PropertyEntry propertyEntry = value as PropertyEntry;
-            if (null == propertyEntry)
-            {
-                PropertyValue propertyValue = value as PropertyValue;
-                if (null != propertyValue)
-                {
-                    propertyEntry = propertyValue.ParentProperty;
-                }
-            }
-
-            Container result = null;
-            if (null != propertyEntry)
-            {
-                ModelItem item = null;
-                ModelItem propertyParentItem = null;
-                EditingContext context = null;
-                GetPropertyData(propertyEntry, out item, out propertyParentItem, out context);
-                result = new Container(item, context, item.View, propertyEntry.PropertyValue);
-            }
-            return result;
-        }
-
-        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-        {
-            CategoryEntry category = (CategoryEntry)
-                values.FirstOrDefault<object>(p => p != null && typeof(CategoryEntry).IsAssignableFrom(p.GetType()));
-
-            FrameworkElement categoryEditorVisual = (FrameworkElement)
-                values.FirstOrDefault<object>(p => p != null && typeof(FrameworkElement).IsAssignableFrom(p.GetType()));
-            Container result = null;
-
-            if (null != category)
-            {
-                PropertyEntry property = GetPropertyEntry( category, parameter );
-
-                if (null != property)
-                {
-                    ModelItem item = null;
-                    ModelItem propertyParentItem = null;
-                    EditingContext context = null;
-                    GetPropertyData(property, out item, out propertyParentItem, out context);
-                    result = new Container(item, context, item.View, property.PropertyValue);
-
-                    category.PropertyChanged += (sender, e) =>
-                    {
-                        PropertyEntry selectedProperty = this.GetPropertyEntry((CategoryEntry)sender, parameter);
-                        if (null != selectedProperty)
-                        {
-                            this.UpdateCategoryEditorDataContext(selectedProperty, categoryEditorVisual, result);
-                        }
-                    };
-                }
-            }
-            return result;
-        }
-
-        PropertyEntry GetPropertyEntry(CategoryEntry category, object parameter)
-        {
-            PropertyEntry property = null;
-            IEnumerable<PropertyEntry> properties = (category == null ? null : category.Properties);
-            if (null != properties)
-            {
-                if (null == parameter)
-                {
-                    property = properties.ElementAtOrDefault<PropertyEntry>(0);
-                }
-                else
-                {
-                    property = properties.FirstOrDefault<PropertyEntry>(p => string.Equals(p.DisplayName, parameter));
-                }
-            }
-            return property;
-        }
-
-        void GetPropertyData(PropertyEntry property, out ModelItem activityItem, out ModelItem propertyParentItem, out EditingContext context)
-        {
-            activityItem = (ModelItem)this.propertyEntryConverter.Convert(property, typeof(ModelItem), false, null);
-            propertyParentItem = (ModelItem)this.propertyEntryConverter.Convert(property, typeof(ModelItem), true, null);
-            context = activityItem.GetEditingContext();
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", 
-            Justification = "Catch all exceptions to prevent crash.")]
-        [SuppressMessage("Reliability", "Reliability108:IsFatalRule",
-            Justification = "Catch all exceptions to prevent crash.")]
-        void UpdateCategoryEditorDataContext(PropertyEntry property, FrameworkElement editor, Container context)
-        {
-            try
-            {
-                editor.DataContext = null;
-                ModelItem modelItem = null;
-                ModelItem propertyParentItem = null;
-                EditingContext editingContext = null;
-                this.GetPropertyData(property, out modelItem, out propertyParentItem, out editingContext);
-                context.Context = editingContext;
-                context.WorkflowViewElement = (null == modelItem ? null : modelItem.View);
-                context.ModelItem = modelItem;
-                editor.DataContext = context;
-            }
-            catch (Exception err)
-            {
-                Fx.Assert(false, err.Message);
-            }
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-
-
-
-        internal sealed class Container : DependencyObject
-        {
-            public static readonly DependencyProperty ModelItemProperty =
-                DependencyProperty.Register("ModelItem", typeof(ModelItem), typeof(Container), new UIPropertyMetadata(null));
-
-            public static readonly DependencyProperty ContextProperty =
-                DependencyProperty.Register("Context", typeof(EditingContext), typeof(Container), new UIPropertyMetadata(null));
-
-            public static readonly DependencyProperty WorkflowViewElementProperty =
-                DependencyProperty.Register("WorkflowViewElement", typeof(DependencyObject), typeof(Container), new UIPropertyMetadata(null));
-
-            public static readonly DependencyProperty PropertyValueProperty =
-                DependencyProperty.Register("PropertyValue", typeof(PropertyValue), typeof(Container), new UIPropertyMetadata(null));
-
-            public Container(ModelItem item, EditingContext context, DependencyObject viewElement, PropertyValue value)
-            {
-                this.ModelItem = item;
-                this.Context = context;
-                this.WorkflowViewElement = viewElement;
-                this.PropertyValue = value;
-            }
-
-            public ModelItem ModelItem
-            {
-                get { return (ModelItem)GetValue(ModelItemProperty); }
-                set { SetValue(ModelItemProperty, value); }
-            }
-
-            public EditingContext Context
-            {
-                get { return (EditingContext)GetValue(ContextProperty); }
-                set { SetValue(ContextProperty, value); }
-            }
-
-            public DependencyObject WorkflowViewElement
-            {
-                get { return (DependencyObject)GetValue(WorkflowViewElementProperty); }
-                set { SetValue(WorkflowViewElementProperty, value); }
-            }
-
-            public PropertyValue PropertyValue
-            {
-                get { return (PropertyValue)GetValue(PropertyValueProperty); }
-                set { SetValue(PropertyValueProperty, value); }
-            }
-
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ModelPropertyEntryToOwnerActivityConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ModelPropertyEntryToOwnerActivityConverter.cs
deleted file mode 100644 (file)
index 2c2978c..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Converters
-{
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using System.Activities.Presentation.Model;
-    using System.Globalization;
-    using System.Runtime;
-    using System.ServiceModel.Activities;
-    using System.Windows.Data;
-
-    // This type converter converts from ModelPropertyEntry to ModelItem that owns the property
-    public class ModelPropertyEntryToOwnerActivityConverter : IValueConverter
-    {
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            //converter can be parametrized - by default, always return parent model item of type Activity or WorkflowService, 
-            //but if false is passed in - simply return first parent
-            bool returnParentWorkflowElement = true;
-            if (null != parameter && parameter is bool)
-            {
-                returnParentWorkflowElement = (bool)parameter;
-            }
-
-            return ModelPropertyEntryToOwnerActivityConverter.Convert(value as ModelPropertyEntry, returnParentWorkflowElement);
-        }
-
-        internal static ModelItem Convert(ModelPropertyEntry modelPropertyEntry, bool returnParentActivity)
-        {
-            ModelItem convertedValue = null;
-            if (modelPropertyEntry != null)
-            {
-                ModelProperty property = modelPropertyEntry.FirstModelProperty;
-                if (property != null)
-                {
-                    convertedValue = property.Parent;
-                    if (returnParentActivity)
-                    {
-                        while (convertedValue != null)
-                        {
-                            Type itemType = convertedValue.ItemType;
-                            if (typeof(Activity).IsAssignableFrom(itemType) || typeof(WorkflowService).IsAssignableFrom(itemType))
-                            {
-                                break;
-                            }
-
-                            convertedValue = convertedValue.Parent;
-                        }
-                    }
-                }
-            }
-
-            return convertedValue;
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            Fx.Assert("this value converter only works on the forward direction");
-            return null;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ModelToObjectValueConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ModelToObjectValueConverter.cs
deleted file mode 100644 (file)
index 0fc9ee3..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Converters
-{
-    using System.Windows.Data;
-    using System.Globalization;
-    using System.Activities.Presentation.Model;
-
-    // This class is used to convert a ModelItem to the innerobject, when binding to whole objectin xaml.
-    // reverse conversion is not required beacuse ModelProperty.SetValue accepts object as is.
-    public class ModelToObjectValueConverter : IValueConverter
-    {
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            object convertedValue = null;
-            if (value != null)
-            {
-                if (value is ModelItem)
-                {
-                    convertedValue = ((ModelItem)value).GetCurrentValue();
-                }
-                else
-                {
-                    convertedValue = value;
-                }
-            }
-            return convertedValue;
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            return value;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ObjectToModelValueConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/ObjectToModelValueConverter.cs
deleted file mode 100644 (file)
index 88c73e6..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Converters
-{
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Windows.Data;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-
-    //This value converter is used in propertygrid scenarios to convert an object into a ModelItem.
-    //It converts from ModelPropertyEntry to ModelItem that owns the property
-    //The first binding is a two way binding with the PropertyValue object 
-    //The second binding is a one way binding with the ModelPropertyEntry.
-    public class ObjectToModelValueConverter : IMultiValueConverter
-    {
-
-        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-        {
-            ModelItem convertedValue = null;
-            if (values[1] != null)
-            {
-                ModelPropertyEntry modelPropertyEntry = values[1] as ModelPropertyEntry;
-                if (modelPropertyEntry != null)
-                {
-                    ModelProperty property = modelPropertyEntry.FirstModelProperty;
-                    if (property != null)
-                    {
-                        convertedValue = property.Value;
-                    }
-                }
-            }
-            return convertedValue;
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
-        {
-            object[] returnValue = new object[] { null };
-            if (value != null)
-            {
-                returnValue[0] = ((ModelItem)value).GetCurrentValue();
-            }
-            return returnValue;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/OutlineViewTextConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/OutlineViewTextConverter.cs
deleted file mode 100644 (file)
index ae1b31f..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Converters
-{
-    using System.Activities.Presentation.Model;
-    using System.Globalization;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Data;
-    using Microsoft.Activities.Presentation;
-
-    internal class OutlineViewTextConverter : IMultiValueConverter
-    {
-        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-        {
-            string displayName = string.Empty;
-            if (values[0] != DependencyProperty.UnsetValue)
-            {
-                displayName = values[0] as string;
-            }
-
-            if (string.IsNullOrEmpty(displayName) && values[1] != DependencyProperty.UnsetValue)
-            {
-                ModelItem modelItem = values[1] as ModelItem;
-                if (modelItem != null)
-                {
-                    ModelProperty nameProperty = modelItem.Properties["Name"];
-                    if (nameProperty != null && nameProperty.Value != null)
-                    {
-                        displayName = nameProperty.Value.GetCurrentValue() as string;
-                    }
-
-                    if (string.IsNullOrEmpty(displayName))
-                    {
-                        Fx.Assert(modelItem.ItemType != null && modelItem.ItemType.Name != null, "ModelItem should always have a name");
-                        displayName = TypeNameHelper.GetDisplayName(modelItem.ItemType, false);
-                    }
-                }
-            }
-
-            return displayName;
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new InvalidOperationException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/SearchableStringConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/SearchableStringConverter.cs
deleted file mode 100644 (file)
index c1e7303..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Converters
-{
-    using System.Collections.Generic;
-
-    abstract class SearchableStringConverter
-    {
-        public abstract IList<string> Convert(object value);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/SearchableStringConverterAttribute.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/SearchableStringConverterAttribute.cs
deleted file mode 100644 (file)
index e93c337..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Converters
-{
-    using System;
-
-    internal sealed class SearchableStringConverterAttribute : Attribute
-    {
-        string converterTypeName;
-        public SearchableStringConverterAttribute(Type type)
-        {
-            this.converterTypeName = type.AssemblyQualifiedName;
-        }
-        public string ConverterTypeName
-        {
-            get
-            {
-                return this.converterTypeName;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/TypeSearchableStringConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/TypeSearchableStringConverter.cs
deleted file mode 100644 (file)
index 41e591d..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Converters
-{
-    using System;
-    using System.Activities.Presentation.View;
-    using System.Collections.Generic;
-
-    class TypeSearchableStringConverter : SearchableStringConverter
-    {
-        public override IList<string> Convert(object value)
-        {
-            IList<string> results = new List<string>();
-            if (value is Type)
-            {
-                results.Add(TypePresenter.ResolveTypeName(value as Type));
-            }
-            return results;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/VBIdentifierTrimConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/VBIdentifierTrimConverter.cs
deleted file mode 100644 (file)
index b3dc23e..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Converters
-{
-    using System.Windows.Data;
-
-    class VBIdentifierTrimConverter : IValueConverter
-    {
-        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
-        {
-            return value;
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
-        {
-            if (targetType == typeof(string) && value is string)
-            {
-                return ((string)value).Trim();
-            }
-            else
-            {
-                return value;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/VisualBasicValueSearchableStringConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/VisualBasicValueSearchableStringConverter.cs
deleted file mode 100644 (file)
index 7eb93fa..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Converters
-{
-    using System;
-    using System.Collections.Generic;
-    using Microsoft.VisualBasic.Activities;
-
-    class VisualBasicValueSearchableStringConverter : SearchableStringConverter
-    {
-        public override IList<string> Convert(object value)
-        {
-            if (value == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("value"));
-            }
-
-            IList<string> results = new List<string>();
-            Type t = value.GetType();
-            if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(VisualBasicValue<>))
-            {
-                results.Add(ExpressionHelper.GetExpressionString(value as Activity));
-            }
-            return results;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/XNameSearchableStringConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Converters/XNameSearchableStringConverter.cs
deleted file mode 100644 (file)
index f5d1363..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Converters
-{
-    using System.Collections.Generic;
-    using System.Xml.Linq;
-
-    class XNameSearchableStringConverter : SearchableStringConverter
-    {
-        public override IList<string> Convert(object value)
-        {
-            IList<string> results = new List<string>();
-            if (value is XName)
-            {
-                results.Add(new XNameConverter().ConvertToString(value));
-            }
-            return results;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/CutCopyPasteHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/CutCopyPasteHelper.cs
deleted file mode 100644 (file)
index d6dd727..0000000
+++ /dev/null
@@ -1,781 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Activities.Debugger;
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.View;
-    using System.Activities.Presentation.Xaml;
-    using System.Activities.Statements;
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.IO;
-    using System.Linq;
-    using System.Runtime;
-    using System.Runtime.InteropServices;
-    using System.Runtime.Versioning;
-    using System.ServiceModel.Activities;
-    using System.Windows;
-    using System.Windows.Documents;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using System.Xaml;
-    using Microsoft.Activities.Presentation;
-    using Microsoft.Activities.Presentation.Xaml;
-
-    public static class CutCopyPasteHelper
-    {
-        internal static readonly DependencyProperty ChildContainersProperty =
-            DependencyProperty.RegisterAttached("ChildContainers", typeof(HashSet<ICompositeView>), typeof(CutCopyPasteHelper), new UIPropertyMetadata(null));
-
-        static object workflowCallbackContext = null;
-
-        internal const string WorkflowClipboardFormat = "WorkflowXamlFormat";
-        internal const string WorkflowClipboardFormat_TargetFramework = "WorkflowXamlFormat_TargetFramework";
-
-        //define a workflow callback clipboard format - make it unique across all processes
-        static readonly string WorkflowCallbackClipboardFormat = string.Format(CultureInfo.InvariantCulture, "WorkflowCallbackFormat{0}", Guid.NewGuid());
-
-        const string versionInfo = "1.0";
-
-        static IList<Type> disallowedTypesForCopy;
-
-        static IEnumerable<Type> DisallowedTypesForCopy
-        {
-            get
-            {
-                if (null == disallowedTypesForCopy)
-                {
-                    disallowedTypesForCopy = new List<Type>();
-                    disallowedTypesForCopy.Add(typeof(ActivityBuilder));
-                    disallowedTypesForCopy.Add(typeof(ModelItemKeyValuePair<,>));
-                    disallowedTypesForCopy.Add(typeof(WorkflowService));
-                    disallowedTypesForCopy.Add(typeof(Catch));
-                }
-                return disallowedTypesForCopy;
-            }
-        }
-
-        internal static void AddDisallowedTypeForCopy(Type type)
-        {
-            if (!DisallowedTypesForCopy.Any(p => type == p))
-            {
-                disallowedTypesForCopy.Add(type);
-            }
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
-        static void AddChildContainer(WorkflowViewElement viewElement, ICompositeView sourceContainer)
-        {
-            if (viewElement == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("viewElement"));
-            }
-            if (sourceContainer == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("sourceContainer"));
-            }
-
-            HashSet<ICompositeView> containers = (HashSet<ICompositeView>)viewElement.GetValue(CutCopyPasteHelper.ChildContainersProperty);
-            if (containers == null)
-            {
-                containers = new HashSet<ICompositeView>();
-                viewElement.SetValue(CutCopyPasteHelper.ChildContainersProperty, containers);
-            }
-            containers.Add(sourceContainer);
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
-        static HashSet<ICompositeView> GetChildContainers(WorkflowViewElement workflowViewElement)
-        {
-            HashSet<ICompositeView> childContainers = null;
-            if (workflowViewElement != null && workflowViewElement.ShowExpanded)
-            {
-                childContainers = (HashSet<ICompositeView>)workflowViewElement.GetValue(CutCopyPasteHelper.ChildContainersProperty);
-            }
-            return childContainers;
-        }
-
-        //This enables us to get children ICompositeViews from WorkflowViewElements. 
-        //Eg. get the WorkflowItemsPresenter from SequenceDesigner.
-        //This is useful for Cut-Copy-Paste, Delete handling, etc.
-        internal static void RegisterWithParentViewElement(ICompositeView container)
-        {
-            WorkflowViewElement parent = GetParentViewElement(container);
-            if (parent != null)
-            {
-                CutCopyPasteHelper.AddChildContainer(parent, container);
-            }
-        }
-
-        //Returns the first WorkflowViewElement in the parent chain.
-        //If ICompositeView is a WorkflowViewElement this method returns the same object.
-        static WorkflowViewElement GetParentViewElement(ICompositeView container)
-        {
-            DependencyObject parent = container as DependencyObject;
-            return GetParentViewElement(parent);
-        }
-
-        //Returns the first WorkflowViewElement in the parent chain.
-        //Move this to a helper class.
-        internal static WorkflowViewElement GetParentViewElement(DependencyObject obj)
-        {
-            while (obj != null && !(obj is WorkflowViewElement))
-            {
-                obj = VisualTreeHelper.GetParent(obj);
-            }
-            return obj as WorkflowViewElement;
-        }
-        
-        internal static IList<object> SortFromMetaData(IList<object> itemsToPaste, List<object> metaData)
-        {
-            IList<object> mergedItemsToPaste = SortFromMetaDataOnly(metaData);
-            // append items that are not sorted
-            foreach (object itemToPaste in itemsToPaste)
-            {
-                if (!mergedItemsToPaste.Contains(itemToPaste))
-                {
-                    mergedItemsToPaste.Add(itemToPaste);
-                }
-            }
-            return mergedItemsToPaste;
-        }
-
-        internal static IList<object> SortFromMetaDataOnly(List<object> metaData)
-        {
-            List<object> mergedItemsToPaste = new List<object>();
-            if (metaData == null)
-            {
-                return mergedItemsToPaste;
-            }
-
-            foreach (object metaDataObject in metaData)
-            {
-                List<object> orderedItemsMetaData = metaDataObject as List<object>;
-                
-                if (orderedItemsMetaData == null)
-                {
-                    continue;
-                }
-
-                foreach (object objectToPaste in orderedItemsMetaData)
-                {
-                    if (!mergedItemsToPaste.Contains(objectToPaste))
-                    {
-                        mergedItemsToPaste.Add(objectToPaste);
-                    }
-                }
-            }
-           
-            return mergedItemsToPaste;
-        }
-
-        public static void DoCut(EditingContext context)
-        {
-            if (context == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("context"));
-            }
-            Selection currentSelection = context.Items.GetValue<Selection>();
-            List<ModelItem> modelItemsToCut = new List<ModelItem>(currentSelection.SelectedObjects);
-            CutCopyPasteHelper.DoCut(modelItemsToCut, context);
-        }
-
-        internal static void DoCut(List<ModelItem> modelItemsToCut, EditingContext context)
-        {
-            if (modelItemsToCut == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("modelItemsToCut"));
-            }
-            if (context == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("context"));
-            }
-            modelItemsToCut.RemoveAll((modelItem) => { return modelItem == null; });
-            if (modelItemsToCut.Count > 0)
-            {
-                using (EditingScope es = (EditingScope)modelItemsToCut[0].BeginEdit(SR.CutOperationEditingScopeDescription))
-                {
-                    try
-                    {
-                        CutCopyOperation(modelItemsToCut, context, true);
-                    }
-                    catch (ExternalException e)
-                    {
-                        es.Revert();
-                        ErrorReporting.ShowErrorMessage(e.Message);
-                        return;
-                    }
-                    DesignerView view = context.Services.GetService<DesignerView>();
-                    //Setting the selection to Breadcrumb root.
-                    Fx.Assert(view != null, "DesignerView Cannot be null during cut");
-                    WorkflowViewElement rootView = view.RootDesigner as WorkflowViewElement;
-                    if (rootView != null)
-                    {
-                        Selection.SelectOnly(context, rootView.ModelItem);
-                    }
-                    es.Complete();
-                }
-            }
-        }
-
-        public static void DoCopy(EditingContext context)
-        {
-            if (context == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("context"));
-            }
-
-            Selection currentSelection = context.Items.GetValue<Selection>();
-            List<ModelItem> modelItemsToCopy = new List<ModelItem>(currentSelection.SelectedObjects);
-            CutCopyPasteHelper.DoCopy(modelItemsToCopy, context);
-        }
-
-        private static void DoCopy(List<ModelItem> modelItemsToCopy, EditingContext context)
-        {
-            if (modelItemsToCopy == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("modelItemsToCopy"));
-            }
-
-            if (context == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("context"));
-            }
-
-            // copy only works if we have DesignerView up and running so check and throw here
-            if (context.Services.GetService<DesignerView>() == null)
-            {
-                throw FxTrace.Exception.AsError(new InvalidOperationException(SR.CutCopyRequiresDesignerView));
-            }
-            modelItemsToCopy.RemoveAll((modelItem) => { return modelItem == null; });
-            try
-            {
-                CutCopyOperation(modelItemsToCopy, context, false);
-            }
-            catch (ExternalException e)
-            {
-                ErrorReporting.ShowErrorMessage(e.Message);
-            }
-        }
-
-        static void CutCopyOperation(List<ModelItem> modelItemsToCutCopy, EditingContext context, bool isCutOperation)
-        {
-            List<object> objectsOnClipboard = null;
-            List<object> metaData = null;
-            if (modelItemsToCutCopy.Count > 0)
-            {
-                objectsOnClipboard = new List<object>(modelItemsToCutCopy.Count);
-                metaData = new List<object>();
-                Dictionary<ICompositeView, List<ModelItem>> notifyDictionary = new Dictionary<ICompositeView, List<ModelItem>>();
-                UIElement breadCrumbRootView = ((DesignerView)context.Services.GetService<DesignerView>()).RootDesigner;
-                foreach (ModelItem modelItem in modelItemsToCutCopy)
-                {
-                    object currentElement = modelItem.GetCurrentValue();
-
-                    if (typeof(Activity).IsAssignableFrom(currentElement.GetType()))
-                    {
-                        string fileName;
-                        if (AttachablePropertyServices.TryGetProperty(currentElement, XamlDebuggerXmlReader.FileNameName, out fileName))
-                        {
-                            AttachablePropertyServices.RemoveProperty(currentElement, XamlDebuggerXmlReader.FileNameName);
-                        }
-                    }
-
-                    if (modelItem.View != null)
-                    {
-                        //The case where the breadcrumbroot designer is Cut/Copied. We do not delete the root designer, we only copy it.
-                        if (breadCrumbRootView.Equals(modelItem.View))
-                        {
-                            notifyDictionary.Clear();
-                            objectsOnClipboard.Add(modelItem.GetCurrentValue());
-                            break;
-                        }
-                        else
-                        {
-                            ICompositeView container = (ICompositeView)DragDropHelper.GetCompositeView((WorkflowViewElement)modelItem.View);
-                            if (container != null)
-                            {
-                                //If the parent and some of its children are selected and cut/copied, we ignore the children. 
-                                //The entire parent will be cut/copied. 
-                                //HashSet parentModelItems contains all the model items in the parent chain of current modelItem.
-                                //We use HashSet.IntersectWith operation to determine if one of the parents is set to be cut.
-                                HashSet<ModelItem> parentModelItems = CutCopyPasteHelper.GetSelectableParentModelItems(modelItem);
-                                parentModelItems.IntersectWith(modelItemsToCutCopy);
-                                if (parentModelItems.Count == 0)
-                                {
-                                    if (!notifyDictionary.ContainsKey(container))
-                                    {
-                                        notifyDictionary[container] = new List<ModelItem>();
-                                    }
-                                    notifyDictionary[container].Add(modelItem);
-                                }
-                            }
-                        }
-
-                    }
-                }
-
-                foreach (ICompositeView container in notifyDictionary.Keys)
-                {
-                    object containerMetaData = false;
-                    if (isCutOperation)
-                    {
-                        containerMetaData = container.OnItemsCut(notifyDictionary[container]);
-                    }
-                    else
-                    {
-                        containerMetaData = container.OnItemsCopied(notifyDictionary[container]);
-                    }
-                    if (containerMetaData != null)
-                    {
-                        metaData.Add(containerMetaData);
-                    }
-                    //Put the actual activities and not the modelItems in the clipboard.
-                    foreach (ModelItem modelItem in notifyDictionary[container])
-                    {
-                        objectsOnClipboard.Add(modelItem.GetCurrentValue());
-                    }
-                }
-                if (metaData.Count == 0)
-                {
-                    metaData = null;
-                }
-            }
-            try
-            {
-                FrameworkName targetFramework = context.Services.GetService<DesignerConfigurationService>().TargetFrameworkName;
-                PutOnClipBoard(objectsOnClipboard, metaData, targetFramework);
-            }
-            catch (XamlObjectReaderException exception)
-            {
-                if (modelItemsToCutCopy.Count > 0 && ErrorActivity.GetHasErrorActivities(modelItemsToCutCopy[0].Root.GetCurrentValue()))
-                {
-                    ErrorReporting.ShowErrorMessage(SR.CutCopyErrorActivityMessage);
-                }
-                else
-                {
-                    ErrorReporting.ShowErrorMessage(exception.Message);
-                }
-            }
-        }
-
-        //This method collects all the ModelItems in the parent chain by calling the GetSelectableParentViewElements method 
-        //which walks the WPF Visual tree. We want to avoid walking ModelItem tree.
-        internal static HashSet<ModelItem> GetSelectableParentModelItems(ModelItem modelItem)
-        {
-            if (null == modelItem)
-            {
-                throw FxTrace.Exception.ArgumentNull("modelItem");
-            }
-            List<WorkflowViewElement> parentViewElements = GetSelectableParentViewElements(modelItem.View as WorkflowViewElement);
-            HashSet<ModelItem> parentModelItems = new HashSet<ModelItem>();
-            foreach (WorkflowViewElement view in parentViewElements)
-            {
-                parentModelItems.Add(view.ModelItem);
-            }
-            return parentModelItems;
-        }
-
-        //This is more efficient than walking up the VisualTree looking for WorkflowViewElements.
-        //Assuming that Cut-Copy will always be against selected elements. 
-        //This implies that only elements under the BreadCrumbRoot can be cut/copied.
-        static List<WorkflowViewElement> GetSelectableParentViewElements(WorkflowViewElement childElement)
-        {
-            List<WorkflowViewElement> parentViewElements = new List<WorkflowViewElement>();
-            if (childElement != null)
-            {
-                UIElement breadcrumbRoot = childElement.Context.Services.GetService<DesignerView>().RootDesigner;
-                ICompositeView container = (ICompositeView)DragDropHelper.GetCompositeView(childElement);
-                while (!childElement.Equals(breadcrumbRoot) && container != null)
-                {
-                    childElement = CutCopyPasteHelper.GetParentViewElement(container);
-                    Fx.Assert(childElement != null, "container should be present in a WorkflowViewElement");
-                    parentViewElements.Add(childElement);
-                    container = (ICompositeView)DragDropHelper.GetCompositeView(childElement);
-                }
-            }
-            return parentViewElements;
-        }
-
-        public static void DoPaste(EditingContext context)
-        {
-            if (context == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("context"));
-            }
-            DoPaste(context, new Point(-1, -1), null);
-        }
-
-        internal static void DoPaste(EditingContext context, Point pastePoint, WorkflowViewElement pastePointReference)
-        {
-            if (context == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("context"));
-            }
-
-            ModelItem modelItem = context.Items.GetValue<Selection>().PrimarySelection;
-            if (modelItem == null)
-            {
-                return;
-            }
-
-            //Get data from clipboard.
-            List<object> metaData = null;
-            List<object> clipboardObjects = GetFromClipboard(out metaData, context);
-            if (clipboardObjects != null)
-            {
-                using (EditingScope es = (EditingScope)modelItem.BeginEdit(SR.PasteUndoDescription))
-                {
-                    if (clipboardObjects.Count == 3 && clipboardObjects[1] is Func<ModelItem, object, object>)
-                    {
-                        var factoryMethod = (Func<ModelItem, object, object>)clipboardObjects[1];
-                        object result = factoryMethod(modelItem, clipboardObjects[2]);
-                        clipboardObjects = new List<object>();
-                        clipboardObjects.Add(result);
-                    }
-                    ICompositeView container = GetContainerForPaste(modelItem, pastePoint);
-                    if (container != null)
-                    {
-                        container.OnItemsPasted(clipboardObjects, metaData, pastePoint, pastePointReference);
-                    }
-                    es.Complete();
-                }
-            }
-        }
-
-        static ICompositeView GetClickedContainer(ModelItem clickedModelItem, Point clickPoint)
-        {
-            Visual parentVisual = clickedModelItem.View as Visual;
-            if (parentVisual == null)
-            {
-                return null;
-            }
-
-            DependencyObject visualHit = null;
-            HitTestResult hitTest = VisualTreeHelper.HitTest(parentVisual, clickPoint);
-            if (hitTest != null)
-            {
-                visualHit = hitTest.VisualHit;
-                while (visualHit != null && !visualHit.Equals(parentVisual) &&
-                    !typeof(ICompositeView).IsAssignableFrom(visualHit.GetType()))
-                {
-                    visualHit = VisualTreeHelper.GetParent(visualHit);
-                }
-            }
-            return visualHit as ICompositeView;
-
-        }
-
-        static ICompositeView GetContainerForPaste(ModelItem pasteModelItem, Point clickPoint)
-        {
-            ICompositeView pasteContainer = null;
-
-            if (null != pasteModelItem && null != pasteModelItem.View && pasteModelItem.View is WorkflowViewElement)
-            {
-                pasteContainer = ((WorkflowViewElement)pasteModelItem.View).ActiveCompositeView;
-            }
-            if (null == pasteContainer)
-            {
-                //Get clicked container.
-                if (clickPoint.X > 0 && clickPoint.Y > 0)
-                {
-                    pasteContainer = GetClickedContainer(pasteModelItem, clickPoint);
-                }
-
-                //If the container itself is a WVE, there's posibility that it's collapsed.
-                //Thus, we need to check this as well.
-                if (pasteContainer != null && pasteContainer is WorkflowViewElement)
-                {
-                    WorkflowViewElement view = pasteContainer as WorkflowViewElement;
-                    if (!view.ShowExpanded)
-                    {
-                        pasteContainer = null;
-                    }
-                }
-                else if (pasteContainer == null) //If the modelitem.View itself is a container.
-                {
-                    WorkflowViewElement view = pasteModelItem.View as WorkflowViewElement;
-                    if (view != null && view.ShowExpanded)
-                    {
-                        pasteContainer = pasteModelItem.View as ICompositeView;
-                    }
-                }
-
-                //Get the container registered with modelItem.View if unambigous
-                //If nothing works take the container with keyboard focus if one exists.
-                if (pasteContainer == null)
-                {
-                    HashSet<ICompositeView> childrenContainers = CutCopyPasteHelper.GetChildContainers(pasteModelItem.View as WorkflowViewElement);
-                    if ((childrenContainers == null || childrenContainers.Count == 0) && null != pasteModelItem.View)
-                    {
-                        pasteContainer = (ICompositeView)DragDropHelper.GetCompositeView((WorkflowViewElement)pasteModelItem.View);
-                    }
-                    else if (null != childrenContainers && childrenContainers.Count == 1)
-                    {
-                        pasteContainer = new List<ICompositeView>(childrenContainers)[0];
-                    }
-                    else
-                    {
-                        pasteContainer = Keyboard.FocusedElement as ICompositeView;
-                    }
-
-                }
-            }
-            return pasteContainer;
-        }
-
-        private static void PutOnClipBoard(List<object> selectedData, List<object> metaData, FrameworkName targetFramework)
-        {
-            CutCopyPasteHelper.workflowCallbackContext = null;
-            if (selectedData != null)
-            {
-                ClipboardData clipboardData = new ClipboardData();
-                clipboardData.Data = selectedData;
-                clipboardData.Metadata = metaData;
-                clipboardData.Version = versionInfo;
-
-                XamlReader reader = ViewStateXamlHelper.RemoveIdRefs(new XamlObjectReader(clipboardData));
-                StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture);
-                XamlServices.Transform(reader, new XamlXmlWriter(stringWriter, reader.SchemaContext), true);
-                string clipBoardString = stringWriter.ToString();
-
-                DataObject dataObject = new DataObject(WorkflowClipboardFormat, clipBoardString);
-                dataObject.SetData(DataFormats.Text, clipBoardString);
-                dataObject.SetData(WorkflowClipboardFormat_TargetFramework, targetFramework);
-                RetriableClipboard.SetDataObject(dataObject, true);
-            }
-        }
-
-        //PutCallbackOnClipBoard - tries to put into private (this application only) clipboard a callback 
-        //to a method. The method will be invoked when user retrieves clipboard content - i.e. by
-        //calling a paste command.
-        //the callback has to be:
-        //- static method
-        //- have return value (not void)
-        //- takes 2 input parameters:
-        //   * 1 parameter is modelitem - this is a target modelitem upon which callback is to be executed
-        //   * 2 parameter is user provided context - any object. Since this callback will be executed within
-        //    this application only, there is no need for context to be serializable.
-        internal static void PutCallbackOnClipBoard(Func<ModelItem, object, object> callbackMethod, Type callbackResultType, object context)
-        {
-            if (null == callbackMethod || null == context)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException(null == callbackMethod ? "callbackMethod" : "context"));
-            }
-            ClipboardData clipboardData = new ClipboardData();
-            List<object> data = new List<object>();
-            data.Add(callbackResultType);
-            data.Add(callbackMethod);
-            clipboardData.Data = data;
-            clipboardData.Version = versionInfo;
-            CutCopyPasteHelper.workflowCallbackContext = context;
-            try
-            {
-                RetriableClipboard.SetDataObject(new DataObject(WorkflowCallbackClipboardFormat, clipboardData, false), false);
-            }
-            catch (ExternalException e)
-            {
-                ErrorReporting.ShowErrorMessage(e.Message);
-            }
-        }
-
-        private static FrameworkName GetTargetFrameworkFromClipboard(DataObject dataObject)
-        {
-            Fx.Assert(dataObject != null, "dataObject should not be null");
-
-            FrameworkName clipboardFrameworkName = null;
-            if (dataObject.GetDataPresent(WorkflowClipboardFormat_TargetFramework))
-            {
-                clipboardFrameworkName = TryGetData(dataObject, WorkflowClipboardFormat_TargetFramework) as FrameworkName;
-            }
-
-            if (clipboardFrameworkName == null)
-            {
-                clipboardFrameworkName = FrameworkNameConstants.NetFramework40;
-            }
-
-            return clipboardFrameworkName;
-        }
-
-        //This method returns the list of objects put on clipboard by cut/copy. 
-        //Out parameter is the metaData information.
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.DoNotCatchGeneralExceptionTypes,
-            Justification = "Deserialization of cliboard data might fail. Propagating exceptions might lead to VS crash.")]
-        [SuppressMessage("Reliability", "Reliability108",
-            Justification = "Deserialization of cliboard data might fail. Propagating exceptions might lead to VS crash.")]
-        private static List<object> GetFromClipboard(out List<object> metaData, EditingContext editingContext)
-        {
-            Fx.Assert(editingContext != null, "editingContext should not be null");
-
-            MultiTargetingSupportService multiTargetingService = editingContext.Services.GetService<IMultiTargetingSupportService>() as MultiTargetingSupportService;
-            DesignerConfigurationService config = editingContext.Services.GetService<DesignerConfigurationService>();
-            DataObject dataObject = RetriableClipboard.GetDataObject() as DataObject;
-            List<object> workflowData = null;
-            metaData = null;
-
-            if (dataObject != null)
-            {
-                if (dataObject.GetDataPresent(WorkflowClipboardFormat))
-                {
-                    bool isCopyingFromHigherFrameworkToLowerFramework = false;
-
-                    if (multiTargetingService != null && config != null)
-                    {
-                        isCopyingFromHigherFrameworkToLowerFramework = GetTargetFrameworkFromClipboard(dataObject).Version > config.TargetFrameworkName.Version;
-                    }
-
-                    string clipBoardString = (string)TryGetData(dataObject, WorkflowClipboardFormat);
-                    using (StringReader stringReader = new StringReader(clipBoardString))
-                    {
-                        try
-                        {
-                            XamlSchemaContext schemaContext;
-                            if (isCopyingFromHigherFrameworkToLowerFramework)
-                            {
-                                schemaContext = new MultiTargetingXamlSchemaContext(multiTargetingService);
-                            }
-                            else
-                            {
-                                schemaContext = new XamlSchemaContext();
-                            }
-
-                            using (XamlXmlReader xamlXmlReader = new XamlXmlReader(stringReader, schemaContext))
-                            {
-                                ClipboardData clipboardData = (ClipboardData)XamlServices.Load(xamlXmlReader);
-                                metaData = clipboardData.Metadata;
-                                workflowData = clipboardData.Data;
-                            }
-                        }
-                        catch (Exception e)
-                        {
-                            Trace.WriteLine(e.Message);
-                        }
-                    }
-                }
-                else if (dataObject.GetDataPresent(WorkflowCallbackClipboardFormat))
-                {
-                    ClipboardData localData = (ClipboardData)TryGetData(dataObject, WorkflowCallbackClipboardFormat);
-                    metaData = null;
-                    workflowData = localData.Data;
-                    workflowData.Add(CutCopyPasteHelper.workflowCallbackContext);
-                }
-            }
-            return workflowData;
-        }
-
-        private static object TryGetData(DataObject dataObject, string dataFormat)
-        {
-            try
-            {
-                return dataObject.GetData(dataFormat);
-            }
-            catch (OutOfMemoryException)
-            {
-                Trace.TraceError("OutOfMemoryException thrown from DataObject.");
-            }
-            return null;
-        }
-
-        private static bool CanCopy(Type type)
-        {
-            foreach (Type disallowedType in CutCopyPasteHelper.DisallowedTypesForCopy)
-            {
-                if (disallowedType.IsAssignableFrom(type))
-                {
-                    return false;
-                }
-                if (type.IsGenericType && type.GetGenericTypeDefinition().Equals(disallowedType))
-                {
-                    return false;
-                }
-            }
-            return true;
-        }
-
-        private static bool CanCopy(ModelItem item)
-        {
-            return null != item.View && item.View is WorkflowViewElement &&
-                null != ((WorkflowViewElement)item.View).ModelItem &&
-                CanCopy(((WorkflowViewElement)item.View).ModelItem.ItemType);
-        }
-
-        public static bool CanCopy(EditingContext context)
-        {
-            if (context == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("context"));
-            }
-            Selection selection = context.Items.GetValue<Selection>();
-            return selection.SelectionCount > 0 && selection.SelectedObjects.All(p => CanCopy(p));
-        }
-
-        public static bool CanCut(EditingContext context)
-        {
-            if (context == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("context"));
-            }
-            bool result = false;
-            Selection selection = context.Items.GetValue<Selection>();
-            if (null != selection && selection.SelectionCount > 0)
-            {
-                DesignerView designerView = context.Services.GetService<DesignerView>();
-                result = selection.SelectedObjects.All(p =>
-                    CanCopy(p) && !p.View.Equals(designerView.RootDesigner));
-            }
-            return result;
-        }
-
-        public static bool CanPaste(EditingContext context)
-        {
-            if (context == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("context"));
-            }
-            bool result = false;
-            ModelItem primarySelection = context.Items.GetValue<Selection>().PrimarySelection;
-            if (null != primarySelection)
-            {
-                ICompositeView container = GetContainerForPaste(primarySelection, new Point(-1, -1));
-                if (null != container)
-                {
-                    DataObject dataObject = RetriableClipboard.GetDataObject() as DataObject;
-                    if (null != dataObject)
-                    {
-                        List<object> metaData = null;
-                        List<object> itemsToPaste = null;
-                        try
-                        {
-                            if (dataObject.GetDataPresent(WorkflowClipboardFormat))
-                            {
-                                itemsToPaste = GetFromClipboard(out metaData, context);
-                                result = container.CanPasteItems(itemsToPaste);
-                            }
-                            else if (dataObject.GetDataPresent(WorkflowCallbackClipboardFormat))
-                            {
-                                itemsToPaste = GetFromClipboard(out metaData, context);
-                                result = container.CanPasteItems(itemsToPaste.GetRange(0, 1));
-                            }
-                        }
-                        //This is being defensive for the case where user code for CanPasteITems throws a non-fatal exception.
-                        catch (Exception exp)
-                        {
-                            if (Fx.IsFatal(exp))
-                            {
-                                throw;
-                            }
-                        }
-                    }
-                }
-            }
-            return result;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Debugger/AllowBreakpointAttribute.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Debugger/AllowBreakpointAttribute.cs
deleted file mode 100644 (file)
index 5de5b0f..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation.Debug
-{
-    using System.Activities;
-    using System.Activities.Presentation.View;
-    using System.Runtime;
-
-    /// <summary>
-    /// AllowBreakpointAttribute is an attribute to describe whether a type allow a breakpoint to be set on it.
-    /// </summary>
-    [Fx.Tag.XamlVisible(false)]
-    [AttributeUsage(AttributeTargets.Class)]
-    internal sealed class AllowBreakpointAttribute : Attribute
-    {
-        internal static bool IsBreakpointAllowed(Type breakpointCandidateType)
-        {
-            return typeof(Activity).IsAssignableFrom(breakpointCandidateType) || WorkflowViewService.GetAttribute<AllowBreakpointAttribute>(breakpointCandidateType) != null;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Debugger/BreakpointType.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Debugger/BreakpointType.cs
deleted file mode 100644 (file)
index dd07d20..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-namespace System.Activities.Presentation.Debug
-{
-    using System;
-    [Flags]
-    public enum BreakpointTypes
-    {
-        None    = 0x00,
-        Enabled = 0x01,
-        Bounded = 0x02,
-        Conditional = 0x04
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Debugger/DebuggerService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Debugger/DebuggerService.cs
deleted file mode 100644 (file)
index b8f3ebf..0000000
+++ /dev/null
@@ -1,867 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Debug
-{
-    using System;
-    using System.Activities;
-    using System.Activities.Debugger;
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Services;
-    using System.Activities.Presentation.Validation;
-    using System.Activities.Presentation.View;
-    using System.Activities.Presentation.Xaml;
-    using System.Activities.XamlIntegration;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Runtime;
-    using System.Windows.Documents;
-    using System.Windows.Threading;
-
-    [Fx.Tag.XamlVisible(false)]
-    public class DebuggerService : IDesignerDebugView
-    {
-        EditingContext context;
-        ModelItem selectedModelItem;
-        SourceLocation currentLocation;
-        SourceLocation currentContext;
-        ModelItem currentModelItem;
-        ModelItem currentModelItemContext;
-        WorkflowViewService viewService;
-        ModelSearchServiceImpl modelSearchService;
-        ModelTreeManager modelTreeManager;
-        const string unresolvedPrefix = "unresolved:";
-
-        AttachedProperty<bool> isBreakpointEnabledProperty;
-        AttachedProperty<bool> isBreakpointBoundedProperty;
-        AttachedProperty<bool> isBreakpointConditionalProperty;
-        AttachedProperty<bool> isCurrentLocationProperty;
-        AttachedProperty<bool> isCurrentContextProperty;
-
-        Dictionary<object, SourceLocation> instanceToSourceLocationMapping;
-        Dictionary<ModelItem, SourceLocation> modelItemToSourceLocation;
-        Dictionary<SourceLocation, ModelItem> sourceLocationToModelItem;
-
-        Dictionary<ModelItem, BreakpointTypes> breakpoints;              // The map contains breakpoint that has its ModelItem on the modelTree.
-        Dictionary<ModelItem, BreakpointTypes> transientBreakpoints;     // The map contains breakpoint that has its ModelItem not on the modelTree.
-        Dictionary<SourceLocation, BreakpointTypes> unmappedBreakpoints; // The map contains breakpoint that has no ModelItem
-
-        // This is used to generate unique source line no when the view element does not have a source location
-        int lastSourceLineNo = 1;
-
-        bool isReadOnly = false;
-        bool isDebugging = false;
-        private string fileName;
-        private bool requiresUpdateSourceLocation;
-
-        // Storing background BringToViewCurrentLocation operation.
-        DispatcherOperation bringToViewCurrentLocationOperation = null;
-
-        public DebuggerService(EditingContext context)
-        {
-            if (context == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("context");
-            }
-
-            this.context = context;
-            this.modelItemToSourceLocation = new Dictionary<ModelItem, SourceLocation>();
-            this.sourceLocationToModelItem = new Dictionary<SourceLocation, ModelItem>();
-            this.breakpoints = new Dictionary<ModelItem, BreakpointTypes>();
-            // Breakpoints transiently removed from the document (copy/paste/undo/redo).
-            this.transientBreakpoints = new Dictionary<ModelItem, BreakpointTypes>();
-            this.unmappedBreakpoints = new Dictionary<SourceLocation, BreakpointTypes>(4);
-            this.instanceToSourceLocationMapping = new Dictionary<object, SourceLocation>();
-
-            this.context.Items.Subscribe<Selection>(new SubscribeContextCallback<Selection>(this.SelectionChanged));
-            this.context.Services.Subscribe<ViewService>(new SubscribeServiceCallback<ViewService>(this.OnViewServiceAvailable));
-            this.context.Services.Subscribe<ModelSearchService>(new SubscribeServiceCallback<ModelSearchService>(this.OnModelSearchServiceAvailable));
-            this.context.Services.Subscribe<AttachedPropertiesService>(new SubscribeServiceCallback<AttachedPropertiesService>(this.OnAttachedPropertiesServiceAvailable));
-            this.context.Services.Subscribe<ModelTreeManager>(new SubscribeServiceCallback<ModelTreeManager>(this.OnModelTreeManagerServiceAvailable));
-
-            this.requiresUpdateSourceLocation = true;
-        }
-
-        // IDesignerDebugView
-
-        // Get the currently selected location from the designer
-        // generally this is the location of the object currently selected by the user
-        public SourceLocation SelectedLocation
-        {
-            get
-            {
-                return (this.selectedModelItem != null && AllowBreakpointAttribute.IsBreakpointAllowed(this.selectedModelItem.ItemType)) ?
-                    this.GetSourceLocationFromModelItem(this.selectedModelItem) : null;
-            }
-        }
-
-        // Set current location of execution.
-        // The location to shown the "yellow" arrow.
-        public SourceLocation CurrentLocation
-        {
-            get
-            {
-                return this.currentLocation;
-            }
-
-            set
-            {
-                this.currentLocation = value;
-                ModelItem previousModelItem = this.currentModelItem;
-                UpdateCurrentModelItem();
-                if (this.currentLocation != null && this.currentModelItem == null)
-                {   // This is a rare case but it happens when the designer is not all done with bringing up the view but
-                    // Debugger already set this location.
-                    PostBringToViewCurrentLocation(previousModelItem);
-                }
-                else
-                {
-                    BringToViewCurrentLocation(previousModelItem);
-                }
-            }
-        }
-
-        public void EnsureVisible(SourceLocation sourceLocation)
-        {
-            SourceLocation exactLocation = GetExactLocation(sourceLocation);
-            ModelItem mi = this.GetModelItemFromSourceLocation(exactLocation, /* forceCreate */ true);
-            if (mi != null)
-            {
-                BringToView(mi);
-            }
-        }
-
-        void BringToViewCurrentLocation(ModelItem previousModelItem)
-        {
-            SetPropertyValue(previousModelItem, isCurrentLocationProperty, this.currentModelItem);
-            if (this.currentModelItem != this.currentModelItemContext)
-            {
-                BringToView(this.currentModelItem);
-            }
-        }
-
-        // Post new BringToViewCurrentLocation operation
-        void PostBringToViewCurrentLocation(ModelItem previousModelItem)
-        {
-            // Abort pending operation.
-            if (this.bringToViewCurrentLocationOperation != null)
-            {
-                this.bringToViewCurrentLocationOperation.Abort();
-                this.bringToViewCurrentLocationOperation = null;
-            }
-
-            // Post a new background operation.
-            this.bringToViewCurrentLocationOperation = Dispatcher.CurrentDispatcher.BeginInvoke(
-                DispatcherPriority.Background,
-                (DispatcherOperationCallback)delegate(object arg)
-                {
-                    this.UpdateCurrentModelItem();
-                    this.BringToViewCurrentLocation(previousModelItem);
-                    this.bringToViewCurrentLocationOperation = null;
-                    return null;
-                },
-                null);
-        }
-
-
-        // Set current context (stack frame scope).
-        // The highlighted scope of execution.
-        public SourceLocation CurrentContext
-        {
-            get
-            {
-                return this.currentContext;
-            }
-            set
-            {
-                this.currentContext = value;
-                ModelItem previousModelItem = this.currentModelItemContext;
-                UpdateCurrentModelItemContext();
-                SetPropertyValue(previousModelItem, this.isCurrentContextProperty, this.currentModelItemContext);
-                BringToView(this.currentModelItemContext);
-            }
-        }
-
-        // Set to true while debugging
-        public bool IsDebugging
-        {
-            get
-            {
-                return this.isDebugging;
-            }
-
-            set
-            {
-                ReadOnlyState readOnlyState = this.context.Items.GetValue<ReadOnlyState>();
-                if (readOnlyState != null)
-                {
-                    // start debugging
-                    if (value && !this.isDebugging)
-                    {
-                        this.isDebugging = true;
-                        // backup the read-only state
-                        this.isReadOnly = readOnlyState.IsReadOnly;
-                        readOnlyState.IsReadOnly = true;
-                    }
-                    // finish debugging
-                    else if (!value && this.isDebugging)
-                    {
-                        this.isDebugging = false;
-                        // restore to previous state before debugging
-                        readOnlyState.IsReadOnly = this.isReadOnly;
-                    }
-                    this.context.Items.SetValue(new ReadOnlyState() { IsReadOnly = readOnlyState.IsReadOnly });
-                }
-            }
-        }
-
-        public bool HideSourceFileName
-        {
-            get;
-            set;
-        }
-
-        void UpdateCurrentModelItem()
-        {
-            this.currentModelItem = this.GetModelItemFromSourceLocation(this.currentLocation, /* forceCreate */ true);
-        }
-
-        void UpdateCurrentModelItemContext()
-        {
-            this.currentModelItemContext = this.GetModelItemFromSourceLocation(this.currentContext, /* forceCreate */ true);
-        }
-
-        void BringToView(ModelItem modelItem)
-        {
-            if (modelItem != null)
-            {
-                modelItem.Focus();
-            }
-        }
-
-        void OnAttachedPropertiesServiceAvailable(AttachedPropertiesService attachedPropertiesService)
-        {
-            this.isBreakpointEnabledProperty = new AttachedProperty<bool>()
-                {
-                    Getter = (modelItem) => IsBreakpointOfType(modelItem, BreakpointTypes.Enabled),
-                    Name = "IsBreakpointEnabled",
-                    OwnerType = typeof(object)
-                };
-
-            this.isBreakpointBoundedProperty = new AttachedProperty<bool>()
-                {
-                    Getter = (modelItem) => IsBreakpointOfType(modelItem, BreakpointTypes.Bounded),
-                    Name = "IsBreakpointBounded",
-                    OwnerType = typeof(object)
-                };
-
-            this.isBreakpointConditionalProperty = new AttachedProperty<bool>()
-                {
-                    Getter = (modelItem) => IsBreakpointOfType(modelItem, BreakpointTypes.Conditional),
-                    Name = "IsBreakpointConditional",
-                    OwnerType = typeof(object)
-                };
-
-            this.isCurrentLocationProperty = new AttachedProperty<bool>()
-                {
-                    Getter = (modelItem) => IsCurrentLocation(modelItem),
-                    Name = "IsCurrentLocation",
-                    OwnerType = typeof(object)
-                };
-
-            this.isCurrentContextProperty = new AttachedProperty<bool>()
-                {
-                    Getter = (modelItem) => IsCurrentContext(modelItem),
-                    Name = "IsCurrentContext",
-                    OwnerType = typeof(object)
-                };
-
-            attachedPropertiesService.AddProperty(isBreakpointEnabledProperty);
-            attachedPropertiesService.AddProperty(isBreakpointBoundedProperty);
-            attachedPropertiesService.AddProperty(isBreakpointConditionalProperty);
-            attachedPropertiesService.AddProperty(isCurrentLocationProperty);
-            attachedPropertiesService.AddProperty(isCurrentContextProperty);
-        }
-
-        void OnModelTreeManagerServiceAvailable(ModelTreeManager modelTreeManager)
-        {
-            this.modelTreeManager = modelTreeManager;
-            this.modelTreeManager.EditingScopeCompleted += OnEditingScopeCompleted;
-        }
-
-        private void OnEditingScopeCompleted(object sender, EditingScopeEventArgs e)
-        {
-            Fx.Assert(e.EditingScope != null, "e.EditingScope should not be null.");
-            foreach (ModelItem removedModelItem in e.EditingScope.ItemsRemoved)
-            {
-                DeleteModelItem(removedModelItem);
-            }
-        }
-
-        private void DeleteModelItem(ModelItem modelItem)
-        {
-            if (modelItem != null)
-            {
-                BreakpointTypes breakpointType;
-                if (this.breakpoints.TryGetValue(modelItem, out breakpointType))
-                {
-                    this.transientBreakpoints[modelItem] = breakpointType;   // cache it in case it's added later (move case).
-                    SetBreakpointType(modelItem, BreakpointTypes.None); // clear breakpoint
-                }
-
-                DeleteFromMapping(modelItem.GetCurrentValue());
-            }
-        }
-
-        // Delete a single object from the mappings.
-        // We only delete unresolved object, i.e. object that never been 
-        // saved.  We leave the resolved object untouch (otherwise undoing
-        // the removed object will make it as "unresolved" the next time around).
-        void DeleteFromMapping(object unresolvedObject)
-        {
-            SourceLocation sourceLocation;
-            if (this.instanceToSourceLocationMapping.TryGetValue(unresolvedObject, out sourceLocation))
-            {
-                if (IsUnresolved(sourceLocation))
-                {
-                    this.instanceToSourceLocationMapping.Remove(unresolvedObject);
-                    ModelItem modelItem;
-                    if (this.sourceLocationToModelItem.TryGetValue(sourceLocation, out modelItem))
-                    {
-                        this.sourceLocationToModelItem.Remove(sourceLocation);
-                        this.modelItemToSourceLocation.Remove(modelItem);
-                    }
-                }
-            }
-        }
-
-        bool IsCurrentLocation(ModelItem modelItem)
-        {
-            UpdateCurrentModelItem();
-            return this.currentModelItem == modelItem;
-        }
-
-        bool IsCurrentContext(ModelItem modelItem)
-        {
-            UpdateCurrentModelItemContext();
-            return this.currentModelItemContext == modelItem;
-        }
-
-        void SelectionChanged(Selection selection)
-        {
-            this.selectedModelItem = selection.PrimarySelection;
-        }
-
-        // Check if unmapped breakpoint exists for the given sourceLocation,
-        // if so, mapped it to the given model item & remove it from unmapped breakpoints.
-        void TryActivateUnmappedBreakpoint(SourceLocation sourceLocation, ModelItem modelItem)
-        {
-            BreakpointTypes breakpointType;
-            if (this.unmappedBreakpoints.TryGetValue(sourceLocation, out breakpointType))
-            {
-                this.SetBreakpointType(modelItem, breakpointType);
-                this.unmappedBreakpoints.Remove(sourceLocation);
-            }
-        }
-
-        void TryActivateAllUnmappedBreakpoints()
-        {
-            if (this.unmappedBreakpoints.Count > 0)
-            {
-                List<SourceLocation> unmappedLocations = new List<SourceLocation>();
-                unmappedLocations.AddRange(this.unmappedBreakpoints.Keys);
-                foreach (SourceLocation unmappedLocation in unmappedLocations)
-                {
-                    ModelItem modelItem = this.GetModelItemFromSourceLocation(unmappedLocation);
-                    if (modelItem != null)
-                    {
-                        TryActivateUnmappedBreakpoint(unmappedLocation, modelItem);
-                    }
-                }
-            }
-        }
-
-        bool IsBreakpointOfType(ModelItem modelItem, BreakpointTypes breakpointType)
-        {
-            bool result = false;
-            BreakpointTypes actualBreakpointType;
-            TryActivateAllUnmappedBreakpoints();
-            if (this.breakpoints.TryGetValue(modelItem, out actualBreakpointType))
-            {
-                result = (actualBreakpointType & breakpointType) > 0;
-            }
-            return result;
-        }
-
-        void SetBreakpointType(ModelItem modelItem, BreakpointTypes newBreakpointType)
-        {
-            BreakpointTypes oldBreakpointType = BreakpointTypes.None;
-            if (this.breakpoints.TryGetValue(modelItem, out oldBreakpointType))
-            {
-                Fx.Assert(oldBreakpointType != BreakpointTypes.None, "Should not store BreakpointType.None");
-                if (newBreakpointType == BreakpointTypes.None)
-                {
-                    this.breakpoints.Remove(modelItem);
-                }
-                else
-                {
-                    this.breakpoints[modelItem] = newBreakpointType;
-                }
-            }
-            else if (newBreakpointType != BreakpointTypes.None)
-            {
-                this.breakpoints.Add(modelItem, newBreakpointType);
-            }
-
-            // Now notifying corresponding properties.
-            if ((oldBreakpointType & BreakpointTypes.Bounded) !=
-                (newBreakpointType & BreakpointTypes.Bounded))
-            {
-                this.isBreakpointBoundedProperty.NotifyPropertyChanged(modelItem);
-            }
-
-            if ((oldBreakpointType & BreakpointTypes.Enabled) !=
-                (newBreakpointType & BreakpointTypes.Enabled))
-            {
-                this.isBreakpointEnabledProperty.NotifyPropertyChanged(modelItem);
-            }
-
-            if ((oldBreakpointType & BreakpointTypes.Conditional) !=
-                (newBreakpointType & BreakpointTypes.Conditional))
-            {
-                this.isBreakpointConditionalProperty.NotifyPropertyChanged(modelItem);
-            }
-        }
-
-        // Return exact source location given approximate location.
-        public SourceLocation GetExactLocation(SourceLocation approximateLocation)
-        {
-            this.EnsureSourceLocationUpdated();
-
-            if (approximateLocation == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("approximateLocation");
-            }
-
-            SourceLocation exactLocation = null;
-
-            foreach (SourceLocation sourceLocation in this.instanceToSourceLocationMapping.Values)
-            {
-                if (sourceLocation.StartLine == approximateLocation.StartLine)
-                {
-                    exactLocation = sourceLocation;
-                    break;
-                }
-            }
-
-            if (exactLocation == null)
-            {
-                exactLocation = FindClosestSourceLocation(approximateLocation, this.instanceToSourceLocationMapping.Values);
-            }
-
-            return exactLocation;
-        }
-
-        // This method tries to find the inner most outer source location from a list
-        // The outer source locations of a source location is ones that contains it
-        // The inner most outer source location is the one nested most deeply, right outside of the source location being contained.
-        private static SourceLocation FindInnerMostContainer(SourceLocation approximateLocation, IEnumerable<SourceLocation> availableSourceLocations)
-        {
-            Fx.Assert(approximateLocation != null && availableSourceLocations != null, "Argument should not be null");
-
-            SourceLocation innerMostOuterSourceLocation = null;
-
-            foreach (SourceLocation sourceLocation in availableSourceLocations)
-            {
-                if (sourceLocation.Contains(approximateLocation))
-                {
-                    if (innerMostOuterSourceLocation == null)
-                    {
-                        innerMostOuterSourceLocation = sourceLocation;
-                    }
-                    else
-                    {
-                        if (innerMostOuterSourceLocation.Contains(sourceLocation))
-                        {
-                            innerMostOuterSourceLocation = sourceLocation;
-                        }
-                    }
-                }
-            }
-
-            return innerMostOuterSourceLocation;
-        }
-
-        internal static SourceLocation FindClosestSourceLocation(SourceLocation approximateLocation, IEnumerable<SourceLocation> availableSourceLocations)
-        {
-            Fx.Assert(approximateLocation != null && availableSourceLocations != null, "Argument should not be null");
-
-            SourceLocation exactLocation = null;
-            SourceLocation innerMostOuterSourceLocation =
-                FindInnerMostContainer(approximateLocation, availableSourceLocations);
-
-            if (innerMostOuterSourceLocation != null)
-            {
-                exactLocation = innerMostOuterSourceLocation;
-            }
-            else
-            {
-                // Find the next line of the approximateLocation.
-                int minimumDistance = int.MaxValue;
-                foreach (SourceLocation sourceLocation in availableSourceLocations)
-                {
-                    int lineDistance = sourceLocation.StartLine - approximateLocation.StartLine;
-                    if ((lineDistance > 0) &&
-                        ((lineDistance < minimumDistance) ||
-                         ((lineDistance == minimumDistance) && (sourceLocation.StartColumn < exactLocation.StartColumn))))  // if same distance, then compare the start column
-                    {
-                        exactLocation = sourceLocation;
-                        minimumDistance = lineDistance;
-                    }
-                }
-            }
-
-            return exactLocation;
-        }
-
-        // Called after a Save by AddIn to update breakpoints with new locations 
-        public IDictionary<SourceLocation, BreakpointTypes> GetBreakpointLocations()
-        {
-            IDictionary<SourceLocation, BreakpointTypes> breakpointLocations = new Dictionary<SourceLocation, BreakpointTypes>();
-
-            // Collect source locations of model items with breakpoints
-            if (this.breakpoints.Count > 0 || this.unmappedBreakpoints.Count > 0)
-            {
-                foreach (KeyValuePair<ModelItem, BreakpointTypes> entry in this.breakpoints)
-                {
-                    SourceLocation breakpointLocation = this.GetSourceLocationFromModelItem(entry.Key);
-                    // BreakpointLocation can be null, if the model item is deleted but without notification
-                    // through OnModelChanged.  This happens when the breakpoint is located inside child
-                    // of a deleted object.
-                    if (breakpointLocation != null)
-                    {
-                        breakpointLocations.Add(breakpointLocation, entry.Value);
-                    }
-                }
-                foreach (KeyValuePair<SourceLocation, BreakpointTypes> entry in this.unmappedBreakpoints)
-                {
-                    breakpointLocations.Add(entry.Key, entry.Value);
-                }
-            }
-            return breakpointLocations;
-        }
-
-        // Inserting a new breakpoint of a given type.
-        public void InsertBreakpoint(SourceLocation sourceLocation, BreakpointTypes breakpointType)
-        {
-            this.UpdateBreakpoint(sourceLocation, breakpointType);
-        }
-
-        // Update the appearance of a given breakpoint to show the given type.
-        public void UpdateBreakpoint(SourceLocation sourceLocation, BreakpointTypes newBreakpointType)
-        {
-            ModelItem modelItem = this.GetModelItemFromSourceLocation(sourceLocation);
-            if (modelItem != null)
-            {
-                SetBreakpointType(modelItem, newBreakpointType);
-            }
-            else
-            {
-                BreakpointTypes oldBreakpointType;
-                if (this.unmappedBreakpoints.TryGetValue(sourceLocation, out oldBreakpointType))
-                {
-                    if (newBreakpointType == BreakpointTypes.None)
-                    {
-                        this.unmappedBreakpoints.Remove(sourceLocation);
-                    }
-                    else
-                    {
-                        this.unmappedBreakpoints[sourceLocation] = newBreakpointType;
-                    }
-                }
-                else if (newBreakpointType != BreakpointTypes.None)
-                {
-                    this.unmappedBreakpoints.Add(sourceLocation, newBreakpointType);
-                }
-            }
-        }
-
-        // Delete a breakpoint.
-        public void DeleteBreakpoint(SourceLocation sourceLocation)
-        {
-            UpdateBreakpoint(sourceLocation, BreakpointTypes.None);
-        }
-
-        // Reset breakpoints: delete and prepare for breakpoint refresh.
-        public void ResetBreakpoints()
-        {
-            ModelItem[] oldModelItems = new ModelItem[this.breakpoints.Keys.Count];
-            this.breakpoints.Keys.CopyTo(oldModelItems, 0);
-            this.breakpoints.Clear();
-            this.unmappedBreakpoints.Clear();
-
-            // Now notifying update to corresponding properties.
-            foreach (ModelItem modelItem in oldModelItems)
-            {
-                this.isBreakpointBoundedProperty.NotifyPropertyChanged(modelItem);
-                this.isBreakpointEnabledProperty.NotifyPropertyChanged(modelItem);
-                this.isBreakpointConditionalProperty.NotifyPropertyChanged(modelItem);
-            }
-        }
-
-        public void UpdateSourceLocations(Dictionary<object, SourceLocation> newSourceLocationMapping)
-        {
-            if (newSourceLocationMapping == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("newSourceLocationMapping");
-            }
-
-            // Update unmappedBreakpoints before refreshing the instanceToSourceLocationMapping.
-            if (this.unmappedBreakpoints.Count > 0)
-            {
-                Dictionary<SourceLocation, BreakpointTypes> newUnmappedBreakpoints = new Dictionary<SourceLocation, BreakpointTypes>(this.unmappedBreakpoints.Count);
-                foreach (KeyValuePair<object, SourceLocation> kvpEntry in this.instanceToSourceLocationMapping)
-                {
-                    if (this.unmappedBreakpoints.ContainsKey(kvpEntry.Value))
-                    {
-                        if (newSourceLocationMapping.ContainsKey(kvpEntry.Key))
-                        {
-                            newUnmappedBreakpoints.Add(newSourceLocationMapping[kvpEntry.Key], this.unmappedBreakpoints[kvpEntry.Value]);
-                        }
-                    }
-                }
-                this.unmappedBreakpoints = newUnmappedBreakpoints;
-            }
-
-            // It is possible that after InvalidateSourceLocationMapping, before UpdateSourceLocations, we introduced new unresolvedEntries. 
-            // These entries should not be dropped, or we will not be able to add breakpoint before UpdateSourceLocation.
-            List<KeyValuePair<object, SourceLocation>> unresolvedEntries = this.instanceToSourceLocationMapping.Where(entry => IsUnresolved(entry.Value)).ToList();
-
-            this.instanceToSourceLocationMapping = newSourceLocationMapping;
-            this.sourceLocationToModelItem.Clear();
-            this.modelItemToSourceLocation.Clear();
-            this.transientBreakpoints.Clear();
-
-            if (this.modelTreeManager != null)
-            {
-                foreach (KeyValuePair<object, SourceLocation> kvp in newSourceLocationMapping)
-                {
-                    ModelItem modelItem = this.modelTreeManager.GetModelItem(kvp.Key);
-                    if (modelItem != null)
-                    {
-                        SourceLocation sourceLocation = kvp.Value;
-                        this.modelItemToSourceLocation.Add(modelItem, sourceLocation);
-                        this.sourceLocationToModelItem.Add(sourceLocation, modelItem);
-                    }
-                }
-
-                foreach (KeyValuePair<object, SourceLocation> unresolvedEntry in unresolvedEntries)
-                {
-                    object unresolvedObject = unresolvedEntry.Key;
-                    SourceLocation sourceLocation = unresolvedEntry.Value;
-                    if (!this.instanceToSourceLocationMapping.ContainsKey(unresolvedObject))
-                    {
-                        this.instanceToSourceLocationMapping.Add(unresolvedObject, sourceLocation);
-                        ModelItem modelItem = this.modelTreeManager.GetModelItem(unresolvedObject);
-                        if (modelItem != null)
-                        {
-                            this.modelItemToSourceLocation.Add(modelItem, sourceLocation);
-                            this.sourceLocationToModelItem.Add(sourceLocation, modelItem);
-                        }
-                    }
-                }
-            }
-
-            TryActivateAllUnmappedBreakpoints();
-        }
-
-        // Called by View Service when a new view element is created 
-        private void ViewCreated(object sender, ViewCreatedEventArgs e)
-        {
-            if (e.View != null)
-            {
-                ModelItem modelItem = e.View.ModelItem;
-                object addedObject = modelItem.GetCurrentValue();
-
-                // Create a mapping between SourceLocation and this View Element
-                SourceLocation sourceLocation = this.GetSourceLocationFromModelItemInstance(addedObject);
-                if (sourceLocation == null)
-                {
-                    // The current view element has not been saved yet to the Xaml file
-                    sourceLocation = GenerateUnresolvedLocation();
-                    this.instanceToSourceLocationMapping.Add(addedObject, sourceLocation);
-                }
-
-                this.modelItemToSourceLocation[modelItem] = sourceLocation;
-                this.sourceLocationToModelItem[sourceLocation] = modelItem;
-
-                BreakpointTypes breakpointType;
-                // check if it's in the transient breakpoint list.
-                if (this.transientBreakpoints.TryGetValue(modelItem, out breakpointType))
-                {
-                    this.transientBreakpoints.Remove(modelItem);
-                    SetBreakpointType(modelItem, breakpointType);
-                }
-                else
-                {
-                    TryActivateUnmappedBreakpoint(sourceLocation, modelItem);
-                }
-            }
-        }
-
-        private SourceLocation GenerateUnresolvedLocation()
-        {
-            return new SourceLocation(unresolvedPrefix + this.context.Items.GetValue<WorkflowFileItem>().LoadedFile, this.lastSourceLineNo++);
-        }
-
-        private static bool IsUnresolved(SourceLocation sourceLocation)
-        {
-            return !string.IsNullOrEmpty(sourceLocation.FileName) && sourceLocation.FileName.StartsWith(unresolvedPrefix, StringComparison.OrdinalIgnoreCase);
-        }
-
-        // This method is called during Load/Save - the resolved mapping should be invalidated.
-        internal void InvalidateSourceLocationMapping(string fileName)
-        {
-            this.fileName = fileName;
-            this.requiresUpdateSourceLocation = true;
-
-            // Remove, from the SourceLocationMappings, the entries with resolved SourceLocation - they are no longer valid and should be refreshed.
-            List<KeyValuePair<ModelItem, SourceLocation>> resolvedEntries = this.modelItemToSourceLocation.Where(entry => !IsUnresolved(entry.Value)).ToList();
-            foreach (KeyValuePair<ModelItem, SourceLocation> resolvedEntry in resolvedEntries)
-            {
-                this.modelItemToSourceLocation.Remove(resolvedEntry.Key);
-                this.sourceLocationToModelItem.Remove(resolvedEntry.Value);
-                this.instanceToSourceLocationMapping.Remove(resolvedEntry.Key.GetCurrentValue());
-            }
-
-            // All breakpoint should simply stay - unmappedBreakpoint will get updated to newSourceLocation when we have the newSourceLocation.
-        }
-
-        private void EnsureSourceLocationUpdated()
-        {
-            Fx.Assert(this.modelSearchService != null, "ModelSearchService should be available and is ensured in WorkflowDesigner constructor");
-            if (this.requiresUpdateSourceLocation)
-            {
-                Dictionary<object, SourceLocation> updatedSourceLocations = new Dictionary<object, SourceLocation>();
-                foreach (ModelItem key in this.modelSearchService.GetObjectsWithSourceLocation())
-                {
-                    // disallow expressions
-                    if (AllowBreakpointAttribute.IsBreakpointAllowed(key.ItemType) && !typeof(IValueSerializableExpression).IsAssignableFrom(key.ItemType))
-                    {
-                        SourceLocation sourceLocationWithoutFileName = this.modelSearchService.FindSourceLocation(key);
-
-                        // Appending the fileName
-                        SourceLocation sourceLocationWithFileName = new SourceLocation(this.fileName,
-                            sourceLocationWithoutFileName.StartLine,
-                            sourceLocationWithoutFileName.StartColumn,
-                            sourceLocationWithoutFileName.EndLine,
-                            sourceLocationWithoutFileName.EndColumn);
-                        updatedSourceLocations.Add(key.GetCurrentValue(), sourceLocationWithFileName);
-                    }
-                }
-
-                this.UpdateSourceLocations(updatedSourceLocations);
-                this.requiresUpdateSourceLocation = false;
-            }
-        }
-
-        private void OnModelSearchServiceAvailable(ModelSearchService modelSearchService)
-        {
-            this.modelSearchService = (ModelSearchServiceImpl)modelSearchService;
-        }
-
-        private void OnViewServiceAvailable(ViewService viewService)
-        {
-            this.viewService = (WorkflowViewService)viewService;
-            this.viewService.ViewCreated += this.ViewCreated;
-        }
-
-        private SourceLocation GetSourceLocationFromModelItemInstance(object instance)
-        {
-            SourceLocation sourceLocation;
-
-            // instanceToSourceLocationMapping contains source locations for all instances 
-            // immediately after a Load or save.  For instances that have been just dropped into
-            // the Designer from the Toolbox, we want to return null from here and treat them
-            // as "Unresolved" in the caller.
-            if (this.instanceToSourceLocationMapping.TryGetValue(instance, out sourceLocation))
-            {
-                return sourceLocation;
-            }
-            else
-            {
-                return null;
-            }
-        }
-
-        private void SetPropertyValue(ModelItem oldModelItem, AttachedProperty property, ModelItem newModelItem)
-        {
-            // update the previous ModelItem (what was current before)
-            if (oldModelItem != null)
-            {
-                property.NotifyPropertyChanged(oldModelItem);
-            }
-
-            // update the current Modelitem
-            if (newModelItem != null)
-            {
-                property.NotifyPropertyChanged(newModelItem);
-            }
-        }
-
-        private SourceLocation GetSourceLocationFromModelItem(ModelItem modelItem)
-        {
-            this.EnsureSourceLocationUpdated();
-            SourceLocation sourceLocation = null;
-            if (modelItem != null)
-            {
-                this.modelItemToSourceLocation.TryGetValue(modelItem, out sourceLocation);
-            }
-            return sourceLocation;
-        }
-
-        private ModelItem GetModelItemFromSourceLocation(SourceLocation sourceLocation)
-        {
-            return GetModelItemFromSourceLocation(sourceLocation, /* forceCreate = */ false);
-        }
-
-        private ModelItem GetModelItemFromSourceLocation(SourceLocation sourceLocation, bool forceCreate)
-        {
-            ModelItem modelItem = null;
-            if (sourceLocation != null)
-            {
-                if (!this.sourceLocationToModelItem.TryGetValue(sourceLocation, out modelItem))
-                {
-                    if (forceCreate)
-                    {
-                        object foundElement = null;
-                        foreach (KeyValuePair<object, SourceLocation> kvp in this.instanceToSourceLocationMapping)
-                        {
-                            if (kvp.Value.Equals(sourceLocation))
-                            {
-                                foundElement = kvp.Key;
-                                break;
-                            }
-                        }
-
-                        if (foundElement != null)
-                        {
-                            modelItem = Validation.ValidationService.FindModelItem(this.modelTreeManager, foundElement);
-                            
-                            if (modelItem != null)
-                            {
-                                this.modelItemToSourceLocation.Add(modelItem, sourceLocation);
-                                this.sourceLocationToModelItem.Add(sourceLocation, modelItem);
-                            }
-                        }
-                    }
-                }
-            }
-
-            return modelItem;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Debugger/IDesignerDebugView.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Debugger/IDesignerDebugView.cs
deleted file mode 100644 (file)
index 9022fcd..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Debug
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Activities;
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.Debug;
-    using System.Activities.Debugger;
-    using System.Activities.Presentation.Model;
-
-
-    public interface IDesignerDebugView
-    {
-        SourceLocation CurrentContext
-        {
-            get; set;
-        }
-        SourceLocation CurrentLocation
-        {
-            get; set;
-        }
-
-        bool IsDebugging
-        {
-            get; set;
-        }
-
-        // Hide source file name from the xaml.
-        bool HideSourceFileName
-        {
-            get;
-            set;
-        }
-
-        SourceLocation SelectedLocation
-        {
-            get;
-        }
-
-        IDictionary<SourceLocation, BreakpointTypes> GetBreakpointLocations();
-
-        void ResetBreakpoints();
-        void DeleteBreakpoint(SourceLocation sourceLocation);
-        SourceLocation GetExactLocation(SourceLocation approximateLocation);
-        void InsertBreakpoint(SourceLocation sourceLocation, BreakpointTypes breakpointType);
-        void UpdateBreakpoint(SourceLocation sourceLocation, BreakpointTypes breakpointType);
-        void EnsureVisible(SourceLocation sourceLocation);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DefaultCommandExtensionCallback.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DefaultCommandExtensionCallback.cs
deleted file mode 100644 (file)
index d0d055f..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.View;
-    using System.Activities.Presentation.Hosting;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Windows.Input;
-    using System.Globalization;
-    using System.Runtime;
-
-    //DefaultCommandExtensionCallback - provides default key input gestures for most of the 
-    //WF commands. user can either implmeent his own class or override this one and provide special 
-    //handling for specific commands
-    class DefaultCommandExtensionCallback : IWorkflowCommandExtensionCallback
-    {
-        Dictionary<ICommand, List<KeyGesture>> defaultGestures = new Dictionary<ICommand, List<KeyGesture>>();
-
-        public DefaultCommandExtensionCallback()
-        {
-            defaultGestures.Add(DesignerView.GoToParentCommand,
-                new List<KeyGesture> { new ChordKeyGesture(Key.E, Key.P) });
-            defaultGestures.Add(DesignerView.ExpandInPlaceCommand,
-                new List<KeyGesture> { new ChordKeyGesture(Key.E, Key.E) });
-            defaultGestures.Add(DesignerView.ExpandAllCommand,
-                new List<KeyGesture> { new ChordKeyGesture(Key.E, Key.X) });
-            defaultGestures.Add(DesignerView.CollapseCommand,
-                new List<KeyGesture> { new ChordKeyGesture(Key.E, Key.C) });
-            defaultGestures.Add(DesignerView.CollapseAllCommand,
-                new List<KeyGesture> { new ChordKeyGesture(Key.E, Key.Y) });
-            defaultGestures.Add(DesignerView.RestoreCommand,
-                new List<KeyGesture> { new ChordKeyGesture(Key.E, Key.R) });
-            defaultGestures.Add(DesignerView.ZoomInCommand,
-                new List<KeyGesture> { 
-                    new KeyGesture(Key.OemPlus, ModifierKeys.Control, "Ctrl +"),
-                    new KeyGesture(Key.Add, ModifierKeys.Control) });
-            defaultGestures.Add(DesignerView.ZoomOutCommand,
-                new List<KeyGesture> { 
-                    new KeyGesture(Key.OemMinus, ModifierKeys.Control, "Ctrl -"),
-                    new KeyGesture(Key.Subtract, ModifierKeys.Control) });
-            defaultGestures.Add(DesignerView.ToggleArgumentDesignerCommand,
-                new List<KeyGesture> { new ChordKeyGesture(Key.E, Key.A) });
-            defaultGestures.Add(DesignerView.ToggleVariableDesignerCommand,
-                new List<KeyGesture> { new ChordKeyGesture(Key.E, Key.V) });
-            defaultGestures.Add(DesignerView.ToggleImportsDesignerCommand,
-                new List<KeyGesture> { new ChordKeyGesture(Key.E, Key.I) });
-            defaultGestures.Add(DesignerView.ToggleMiniMapCommand,
-                new List<KeyGesture> { new ChordKeyGesture(Key.E, Key.O) });
-            defaultGestures.Add(DesignerView.CreateVariableCommand,
-                new List<KeyGesture> { new ChordKeyGesture(Key.E, Key.N) });
-            defaultGestures.Add(DesignerView.CycleThroughDesignerCommand,
-                new List<KeyGesture> { new KeyGesture(Key.F6, ModifierKeys.Control | ModifierKeys.Alt, "Ctrl + Alt + F6") });
-            defaultGestures.Add(ExpressionTextBox.CompleteWordCommand,
-                new List<KeyGesture> { new KeyGesture(Key.Right, ModifierKeys.Alt, "Alt + Right Arrow") });
-            defaultGestures.Add(ExpressionTextBox.GlobalIntellisenseCommand,
-                new List<KeyGesture> { new KeyGesture(Key.J, ModifierKeys.Control, "Ctrl + J") });
-            defaultGestures.Add(ExpressionTextBox.ParameterInfoCommand,
-                new List<KeyGesture> { new ChordKeyGesture(Key.K, Key.P) });
-            defaultGestures.Add(ExpressionTextBox.QuickInfoCommand,
-                new List<KeyGesture> { new ChordKeyGesture(Key.K, Key.I) });
-            defaultGestures.Add(DesignerView.MoveFocusCommand,
-                new List<KeyGesture> { new ChordKeyGesture(Key.E, Key.M) });
-            defaultGestures.Add(DesignerView.ToggleSelectionCommand,
-                new List<KeyGesture> { new ChordKeyGesture(Key.E, Key.S) });
-            defaultGestures.Add(DesignerView.CutCommand,
-               new List<KeyGesture> { new KeyGesture(Key.X, ModifierKeys.Control) });
-            defaultGestures.Add(DesignerView.CopyCommand,
-               new List<KeyGesture> { new KeyGesture(Key.C, ModifierKeys.Control) });
-            defaultGestures.Add(DesignerView.PasteCommand,
-               new List<KeyGesture> { new KeyGesture(Key.V, ModifierKeys.Control) });
-            defaultGestures.Add(DesignerView.SelectAllCommand,
-               new List<KeyGesture> { new KeyGesture(Key.A, ModifierKeys.Control) });
-            defaultGestures.Add(DesignerView.UndoCommand,
-               new List<KeyGesture> { new KeyGesture(Key.Z, ModifierKeys.Control) });
-            defaultGestures.Add(DesignerView.RedoCommand,
-               new List<KeyGesture> { new KeyGesture(Key.Y, ModifierKeys.Control) });
-            defaultGestures.Add(ExpressionTextBox.IncreaseFilterLevelCommand,
-                new List<KeyGesture> { new KeyGesture(Key.Decimal, ModifierKeys.Alt) });
-            defaultGestures.Add(ExpressionTextBox.DecreaseFilterLevelCommand,
-                new List<KeyGesture> { new KeyGesture(Key.OemComma, ModifierKeys.Alt) });
-
-
-        }
-
-        public void OnWorkflowCommandLoaded(CommandInfo commandInfo)
-        {
-            if (commandInfo == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("commandInfo"));
-            }
-            RoutedCommand cmd = commandInfo.Command as RoutedCommand;
-            if (cmd != null)
-            {
-                List<KeyGesture> gestures = null;
-                if (defaultGestures.TryGetValue(cmd, out gestures))
-                {
-                    gestures.ForEach((gesture) =>
-                    {
-                        if (!this.ContainsGesture(cmd, gesture))
-                        {
-                            cmd.InputGestures.Add(gesture);
-                        }
-                    });
-                }
-            }
-        }
-
-        protected bool ContainsGesture(RoutedCommand cmd, KeyGesture gesture)
-        {
-            return cmd.InputGestures.OfType<KeyGesture>().Any(p => string.Equals(p.DisplayString, gesture.DisplayString));
-        }
-
-
-        //ChordKeyGesture - class derived from KeyGesture - provides simple state machine implementation
-        //to handle chord keyboard navigation. Invoke when ChordKey or ChordKey + Ctrl is pressed after
-        //entering chord mode
-        internal sealed class ChordKeyGesture : KeyGesture
-        {
-            bool isInKeyChordMode = false;
-            Key chordKey;
-
-            private WeakReference ownerReference;
-
-            internal DesignerView Owner
-            {
-                get
-                {
-                    if (this.ownerReference != null)
-                    {
-                        return this.ownerReference.Target as DesignerView;
-                    }
-
-                    return null;
-                }
-                set
-                {
-                    if (value == null)
-                    {
-                        this.ownerReference = null;
-                    }
-                    else
-                    {
-                        this.ownerReference = new WeakReference(value);
-                    }
-                }
-            }
-
-            public ChordKeyGesture(Key key, Key chordKey) :
-                base(key, ModifierKeys.Control, string.Format(CultureInfo.InvariantCulture, "Ctrl+{0}, {1}", key, chordKey))
-            {
-                this.chordKey = chordKey;
-            }
-            public void ResetChordMode()
-            {
-                this.isInKeyChordMode = false;
-            }
-            public override bool Matches(object targetElement, InputEventArgs inputEventArgs)
-            {
-                bool result = false;
-                KeyEventArgs keyArgs = inputEventArgs as KeyEventArgs;
-                //lookup only for keyboard events
-                if (null != keyArgs)
-                {
-                    //by default - check if we are entering double key navigation
-                    if (!this.isInKeyChordMode)
-                    {
-                        //call base implementation to match Ctrl + actual key
-                        if (base.Matches(targetElement, keyArgs))
-                        {
-                            this.isInKeyChordMode = true;
-                        }
-                    }
-                    //if we are waiting for chord key
-                    else if (keyArgs.Key == this.chordKey && (Keyboard.Modifiers == ModifierKeys.None || Keyboard.Modifiers == ModifierKeys.Control))
-                    {
-                        //ok - we found a match, reset state to default
-                        System.Diagnostics.Debug.WriteLine(this.DisplayString);
-                        result = true;
-                        // reset all the chord key after this command
-                        if (this.Owner != null)
-                        {
-                            this.Owner.ResetAllChordKeyGesturesMode();
-                        }
-                    }
-                    //no, second key didn't match the chord
-                    //if ctrl is pressed, just let it stay in chord mode
-                    else if (Keyboard.Modifiers != ModifierKeys.Control)
-                    {
-                        this.isInKeyChordMode = false;
-                    }
-                }
-                //any other input event resets state to default
-                else
-                {
-                    this.isInKeyChordMode = false;
-                }
-                return result;
-            }
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DefaultTypeArgumentAttribute.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DefaultTypeArgumentAttribute.cs
deleted file mode 100644 (file)
index 8ce4ee1..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Runtime;
-    using System.Diagnostics.CodeAnalysis;
-
-    [Fx.Tag.XamlVisible(false)]
-    [AttributeUsage(AttributeTargets.Class)]
-    public sealed class DefaultTypeArgumentAttribute : Attribute
-    {
-        Type type;
-
-        public DefaultTypeArgumentAttribute(Type type)
-        {
-            this.type = type;
-        }
-
-        [SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods", Justification = "By design.")]
-        public Type Type
-        {
-            get
-            {
-                return this.type;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DeleteHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DeleteHelper.cs
deleted file mode 100644 (file)
index b6d14da..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.View;
-    using System.Collections.Generic;
-    using System.Linq;
-
-    static class DeleteHelper
-    {
-        public static bool CanDelete(EditingContext context)
-        {
-            if (context == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("context"));
-            }
-            bool canExecute = false;
-            Selection selection = context.Items.GetValue<Selection>();
-            if (null != selection && selection.SelectionCount > 0)
-            {
-                DesignerView designerView = context.Services.GetService<DesignerView>();
-                canExecute = selection.SelectedObjects.All(
-                    p => (null != p.View && p.View is WorkflowViewElement && !p.View.Equals(designerView.RootDesigner)));
-            }
-            return canExecute;
-        }
-
-        public static void Delete(EditingContext context)
-        {
-            if (context == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("context"));
-            }
-            Selection selection = context.Items.GetValue<Selection>();
-            if (null != selection)
-            {
-                bool selectRoot = false;
-
-                DesignerView designerView = context.Services.GetService<DesignerView>();
-                var toDelete = selection.SelectedObjects.Where(p => null != p.View && p.View is WorkflowViewElement && !p.View.Equals(designerView.RootDesigner));
-                if (toDelete.Count() > 0)
-                {
-                    using (EditingScope es = (EditingScope)toDelete.FirstOrDefault().BeginEdit(SR.DeleteOperationEditingScopeDescription))
-                    {
-                        Dictionary<ICompositeView, List<ModelItem>> containerToModelItemsDict = new Dictionary<ICompositeView, List<ModelItem>>();
-                        List<ModelItem> modelItemsPerContainer;
-                        foreach (var item in toDelete)
-                        {
-                            ICompositeView container = (ICompositeView)DragDropHelper.GetCompositeView((WorkflowViewElement)item.View);
-                            if (null != container)
-                            {
-                                if (!containerToModelItemsDict.TryGetValue(container, out modelItemsPerContainer))
-                                {
-                                    modelItemsPerContainer = new List<ModelItem>();
-                                    containerToModelItemsDict.Add(container, modelItemsPerContainer);
-                                }
-                                modelItemsPerContainer.Add(item);
-                            }
-                        }
-                        foreach (ICompositeView container in containerToModelItemsDict.Keys)
-                        {
-                            container.OnItemsDelete(containerToModelItemsDict[container]);
-                            selectRoot = true;
-                        }
-
-                        if (selectRoot)
-                        {
-                            DesignerView view = context.Services.GetService<DesignerView>();
-                            if (null != view)
-                            {
-                                WorkflowViewElement rootView = view.RootDesigner as WorkflowViewElement;
-                                if (rootView != null)
-                                {
-                                    Selection.SelectOnly(context, rootView.ModelItem);
-                                }
-                            }
-                        }
-                        es.Complete();
-                    }
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignObjectWrapper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignObjectWrapper.cs
deleted file mode 100644 (file)
index c9f5b65..0000000
+++ /dev/null
@@ -1,844 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Converters;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation.View;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Linq;
-    using System.Reflection;
-    using System.Runtime;
-    using System.Text;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Windows.Threading;
-
-    /// <summary>
-    /// DesignObjectWrapper. this class is used to enable more detailed control over edting model objects. especially, if underlying object 
-    /// requires some more complex logic when setting property values - i.e. value of a real property is splitted in the ui to different design properties
-    /// (like in ArgumentDesigner - actual argument's property depends on two factors: direction (in, out, ...) and actual CLR type.
-    /// the DesignObjectWrapper contains that logic and is able to interact with underlying real object, but from ui perspective offeres different set of properties.
-    /// 
-    /// the model can be presented as follows:
-    /// 
-    ///      UI                |           interaction logic             |           actual model
-    /// -----------------------+-----------------------------------------+-------------------------------
-    ///                         
-    ///    FakeModelItem  <---------------- DesignObjectWrapper ---------------------> ModelItem
-    ///                                             ^
-    ///                                             |
-    ///                            DesignObjectWrapper implementation
-    ///                            
-    ///  Where:
-    ///  - FakeModelItem - is a class which exposes any properties which are required to edit actual model. those properties do not have
-    ///                    to exist on the real object, you are responsible to provide getters (required),  setters (optional) and validation (optional)
-    ///                    code for them. In UI, you can access that property using Content property.
-    ///                    
-    /// - DesignObjectWrapper - implementing that class you have to provide a set of property descriptors (get, set, validate, name, type) methods for each of your property
-    ///                    It is required that you provide static implementation for following method:
-    ///                         PropertyDescriptorData[] InitializeTypeProperties()
-    ///                    After you are done with editing of this object, call Dispose, so it unhooks from property change notificatons
-    ///                         
-    /// - ModelItem      - actual model you bind to. DesignObjectWrapper implmentation registers for PropertyChanged notifications from that object, and will notify you via
-    ///                 OnReflectedObjectPropertyChanged. This object can be accessed using ReflectedObject property
-    /// 
-    /// </summary>
-    abstract class DesignObjectWrapper : ICustomTypeDescriptor, INotifyPropertyChanged, IDisposable
-    {
-        protected static readonly string HasErrorsProperty = "HasErrors";
-        protected static readonly string ContentProperty = "Content";
-        protected static readonly string ValidationErrorSuffix = "ValidationError";
-        protected static readonly string AutomationIdProperty = "AutomationId";
-        protected internal static readonly string TimestampProperty = "Timestamp";
-        readonly static string[] DefaultProperties = new string[] { HasErrorsProperty, AutomationIdProperty, TimestampProperty };
-        static IDictionary<Type, PropertyDescriptorCollection> TypePropertyCollection = new Dictionary<Type, PropertyDescriptorCollection>();
-
-        IDictionary<string, string> validationErrors = null;
-        IDictionary<string, PropertyValueEditor> customValueEditors = null;
-        FakeModelItemImpl content;
-        bool isDisposed = false;
-        DateTime timestamp;
-        HashSet<string> changingProperties;
-
-        protected DesignObjectWrapper()
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException(SR.InvalidConstructorCall));
-        }
-
-        [SuppressMessage(FxCop.Category.Usage, FxCop.Rule.DoNotCallOverridableMethodsInConstructors,
-            Justification = "This class is internal with limited usage inside framework assemblies only. The code written should be safe enough to allow such usage.")]
-        protected DesignObjectWrapper(ModelItem reflectedObject)
-        {
-            this.changingProperties = new HashSet<string>();
-            this.Initialize(reflectedObject);
-        }
-
-        internal void Initialize(ModelItem reflectedObject)
-        {
-            this.isDisposed = false;
-            this.changingProperties.Clear();
-            this.ReflectedObject = reflectedObject;
-            this.Context = ((IModelTreeItem)reflectedObject).ModelTreeManager.Context;
-            this.ModelTreeManager = ((IModelTreeItem)reflectedObject).ModelTreeManager;
-            this.ReflectedObject.PropertyChanged += OnReflectedObjectPropertyChanged;
-            this.RaisePropertyChangedEvent("ReflectedObject");
-            //update timestamp if we do reinitialize wrapper
-            this.UpdateTimestamp();
-            this.Content.PropertyChanged += this.OnFakeModelPropertyChanged;
-        }
-
-        void OnFakeModelPropertyChanged(object sender, PropertyChangedEventArgs e)
-        {
-            if (!this.changingProperties.Contains(e.PropertyName))
-            {
-                this.changingProperties.Add(e.PropertyName);
-                this.RaisePropertyChangedEvent(e.PropertyName);
-                this.changingProperties.Remove(e.PropertyName);
-            }
-        }
-
-        public ModelItem ReflectedObject
-        {
-            get;
-            private set;
-        }
-
-        public EditingContext Context
-        {
-            get;
-            private set;
-        }
-
-        protected ModelTreeManager ModelTreeManager
-        {
-            get;
-            private set;
-        }
-
-        public ModelItem Content
-        {
-            get
-            {
-                if (null == this.content)
-                {
-                    ModelTreeManager manager = this.Context.Services.GetService<ModelTreeManager>();
-                    this.content = new FakeModelItemImpl(manager, this.GetType(), this, null);
-                }
-                return this.content;
-            }
-            private set
-            {
-                this.content = (FakeModelItemImpl)value;
-            }
-        }
-
-        IDictionary<string, string> ValidationErrors
-        {
-            get
-            {
-                if (null == this.validationErrors)
-                {
-                    this.validationErrors = new Dictionary<string, string>();
-                }
-                return this.validationErrors;
-            }
-        }
-
-        protected IDictionary<string, PropertyValueEditor> CustomValueEditors
-        {
-            get
-            {
-                if (null == this.customValueEditors)
-                {
-                    this.customValueEditors = new Dictionary<string, PropertyValueEditor>();
-                }
-                return this.customValueEditors;
-            }
-        }
-
-        public bool HasErrors
-        {
-            get
-            {
-                return null != this.validationErrors && this.validationErrors.Count != 0;
-            }
-        }
-
-        protected abstract string AutomationId { get; }
-
-        #region ICustomTypeDescriptor Members
-
-        public AttributeCollection GetAttributes()
-        {
-            return new AttributeCollection(this.GetType().GetCustomAttributes(false).OfType<Attribute>().ToArray());
-        }
-
-        public string GetClassName()
-        {
-            return this.GetType().FullName;
-        }
-
-        public string GetComponentName()
-        {
-            return this.GetType().FullName;
-        }
-
-        public TypeConverter GetConverter()
-        {
-            object[] attributes = this.GetType().GetCustomAttributes(typeof(TypeConverterAttribute), false);
-            if (attributes.Length != 0)
-            {
-                TypeConverterAttribute attribute = (TypeConverterAttribute)attributes[0];
-                return (TypeConverter)Activator.CreateInstance(Type.GetType(attribute.ConverterTypeName));
-            }
-            return null;
-        }
-
-        public EventDescriptor GetDefaultEvent()
-        {
-            return null;
-        }
-
-        public PropertyDescriptor GetDefaultProperty()
-        {
-            return null;
-        }
-
-        public string GetValidationErrors(IList<string> invalidProperties)
-        {
-            var result = string.Empty;
-            if (this.HasErrors)
-            {
-                var content = new StringBuilder();
-                bool newRowRequired = false;
-                foreach (var entry in this.validationErrors)
-                {
-                    if (newRowRequired)
-                    {
-                        content.AppendLine();
-                    }
-                    content.Append(entry.Key);
-                    content.AppendLine(":");
-                    content.Append(entry.Value);
-                    newRowRequired = true;
-                    if (null != invalidProperties)
-                    {
-                        invalidProperties.Add(entry.Key);
-                    }
-                }
-                result = content.ToString();
-            }
-            return result;
-        }
-
-        public string GetValidationErrors()
-        {
-            return this.GetValidationErrors(null);
-        }
-
-        public void ClearValidationErrors()
-        {
-            this.ClearValidationErrors(null);
-        }
-
-        public void ClearValidationErrors(IEnumerable<string> properties)
-        {
-            if (null != this.validationErrors)
-            {
-                if (null != properties)
-                {
-                    foreach (var propertyName in properties)
-                    {
-                        if (this.validationErrors.ContainsKey(propertyName))
-                        {
-                            this.validationErrors.Remove(propertyName);
-                        }
-                    }
-                }
-                else
-                {
-                    this.validationErrors.Clear();
-                }
-            }
-        }
-
-        public object GetEditor(Type editorBaseType)
-        {
-            object[] attributes = this.GetType().GetCustomAttributes(typeof(EditorAttribute), false);
-            if (attributes.Length != 0)
-            {
-                EditorAttribute attribute = (EditorAttribute)attributes[0];
-                return Activator.CreateInstance(Type.GetType(attribute.EditorTypeName));
-            }
-            return null;
-        }
-
-        public EventDescriptorCollection GetEvents(Attribute[] attributes)
-        {
-            return null;
-        }
-
-        public EventDescriptorCollection GetEvents()
-        {
-            return null;
-        }
-
-        public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
-        {
-            return ((ICustomTypeDescriptor)this).GetProperties();
-        }
-
-        public PropertyDescriptorCollection GetProperties()
-        {
-            Type type = this.GetType();
-            if (!DesignObjectWrapper.TypePropertyCollection.ContainsKey(type))
-            {
-                MethodInfo initMethod = type.GetMethod("InitializeTypeProperties", BindingFlags.Static | BindingFlags.Public);
-                PropertyDescriptorData[] properties = (PropertyDescriptorData[])initMethod.Invoke(null, null);
-                List<DesignObjectPropertyDescriptor> descriptors = new List<DesignObjectPropertyDescriptor>(properties.Length);
-                for (int i = 0; i < properties.Length; ++i)
-                {
-                    properties[i].OwnerType = type;
-                    DesignObjectPropertyDescriptor descriptor = new DesignObjectPropertyDescriptor(properties[i]);
-                    if (null != properties[i].PropertyValidator)
-                    {
-                        string localPropertyName = properties[i].PropertyName;
-                        PropertyDescriptorData data = new PropertyDescriptorData()
-                        {
-                            OwnerType = type,
-                            PropertyAttributes = new Attribute[] { BrowsableAttribute.No },
-                            PropertyValidator = null,
-                            PropertySetter = null,
-                            PropertyType = typeof(string),
-                            PropertyName = string.Format(CultureInfo.InvariantCulture, "{0}{1}", localPropertyName, ValidationErrorSuffix),
-                            PropertyGetter = (instance) => (!instance.IsPropertyValid(localPropertyName) ? instance.validationErrors[localPropertyName] : string.Empty),
-                        };
-                        descriptors.Add(new DesignObjectPropertyDescriptor(data));
-                    }
-                    descriptors.Add(descriptor);
-                }
-                for (int i = 0; i < DesignObjectWrapper.DefaultProperties.Length; ++i)
-                {
-                    descriptors.Add(this.ConstructDefaultPropertyPropertyDescriptor(DesignObjectWrapper.DefaultProperties[i]));
-                }
-                DesignObjectWrapper.TypePropertyCollection[type] = new PropertyDescriptorCollection(descriptors.ToArray(), true);
-            }
-
-            return DesignObjectWrapper.TypePropertyCollection[type];
-        }
-
-        public object GetPropertyOwner(PropertyDescriptor pd)
-        {
-            return this;
-        }
-
-        #endregion
-
-        #region INotifyPropertyChanged Members
-
-        public event PropertyChangedEventHandler PropertyChanged;
-
-        #endregion
-
-        public bool IsPropertyValid(string propertyName)
-        {
-            return this.validationErrors == null || !this.validationErrors.ContainsKey(propertyName);
-        }
-
-        public virtual void Dispose()
-        {
-            if (null != this.ReflectedObject && !this.isDisposed)
-            {
-                this.isDisposed = true;
-                this.ReflectedObject.PropertyChanged -= this.OnReflectedObjectPropertyChanged;
-                this.Content.PropertyChanged -= this.OnFakeModelPropertyChanged;
-                if (null != this.customValueEditors)
-                {
-                    this.customValueEditors.Clear();
-                }
-                this.RaisePropertyChangedEvent("ReflectedObject");
-            }
-        }
-
-        //GetDynamicPropertyValueEditor - if user marks one of the properties with DesignObjectWrapperDynamicPropertyEditor attribte,
-        //it is expected that valid property value editor for each instance of design object wrapper will be provided
-        internal PropertyValueEditor GetDynamicPropertyValueEditor(string propertyName)
-        {
-            PropertyValueEditor result = null;
-            //look in the value editor cache - perhaps there is one available for given object
-            if (this.CustomValueEditors.ContainsKey(propertyName))
-            {
-                result = this.CustomValueEditors[propertyName];
-            }
-            else
-            {
-                //no, get type of the editor
-                Type editorType = this.GetDynamicPropertyValueEditorType(propertyName);
-                if (null == editorType)
-                {
-                    throw FxTrace.Exception.AsError(new ArgumentException("GetDynamicPropertyValueEditorType() returned null for propertyName."));
-                }
-                //create one
-                result = (PropertyValueEditor)Activator.CreateInstance(editorType);
-                //store it in cache
-                this.CustomValueEditors[propertyName] = result;
-            }
-            return result;
-        }
-
-        internal Type GetDynamicPropertyValueEditorType(string propertyName)
-        {
-            //get editor type for dynamic property
-            var editorType = this.OnGetDynamicPropertyValueEditorType(propertyName);
-            if (null == editorType)
-            {
-                //there should be always be one...
-                Fx.Assert(false, "PropertyValueEditor not defined for property '" + propertyName + "'");
-            }
-            //and it should be assignable from PropertyValueEditor
-            else if (!typeof(PropertyValueEditor).IsAssignableFrom(editorType))
-            {
-                Fx.Assert(false, "Type '" + editorType.FullName + "' is not assignable from PropertyValueEditor");
-                editorType = null;
-            }
-            return editorType;
-        }
-
-        //virtual OnGetDynamicProperyValueEditorType - if user marks property with DesignObjectWrapperDynamicPropertyEditor, 
-        //this method has to be overriden
-        protected virtual Type OnGetDynamicPropertyValueEditorType(string propertyName)
-        {
-            throw FxTrace.Exception.AsError(new NotImplementedException());
-        }
-
-        //bool GetPropertyChangeTriggerState(string propertyName)
-        //{
-        //    if (this.propertyChangeTriggerState.ContainsKey(propertyName))
-        //    {
-        //        return this.propertyChangeTriggerState[propertyName];
-        //    }
-        //    else
-        //    {
-        //        return false;
-        //    }
-        //}
-
-        //void SetPropertyChangeTriggerState(string propertyName, bool state)
-        //{
-        //    if (!this.propertyChangeTriggerState.ContainsKey(propertyName))
-        //    {
-        //        this.propertyChangeTriggerState.Add(propertyName, state);
-        //    }
-        //    else
-        //    {
-        //        this.propertyChangeTriggerState[propertyName] = state;
-        //    }
-        //}
-
-        internal void NotifyPropertyChanged(string propertyName)
-        {
-            if (!this.isDisposed)
-            {
-                (this.Content as IModelTreeItem).OnPropertyChanged(propertyName);
-            }
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.UseEventsWhereAppropriate, Justification = "Procedure to raise the event")]
-        protected void RaisePropertyChangedEvent(string propertyName)
-        {
-            //don't raise property changed events if object is disposed 
-            //- the underlying ModelItem might not be valid, doesn't make sense to do anything on it.
-            if (!this.isDisposed)
-            {
-                //let the implementation react on property change
-                this.OnPropertyChanged(propertyName);
-
-                if (null != this.PropertyChanged)
-                {
-                    this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-                }
-                if (!this.changingProperties.Contains(propertyName))
-                {
-                    if (this.Content.Properties[propertyName] != null)
-                    {
-                        this.changingProperties.Add(propertyName);
-                        (this.Content as IModelTreeItem).OnPropertyChanged(propertyName);
-                        this.changingProperties.Remove(propertyName);
-                    }
-                }
-            }
-        }
-
-        protected virtual void OnPropertyChanged(string propertyName)
-        {
-        }
-
-        DesignObjectPropertyDescriptor ConstructDefaultPropertyPropertyDescriptor(string propertyName)
-        {
-            DesignObjectPropertyDescriptor result = null;
-            if (string.Equals(propertyName, HasErrorsProperty))
-            {
-                PropertyDescriptorData data = new PropertyDescriptorData()
-                {
-                    OwnerType = this.GetType(),
-                    PropertyName = propertyName,
-                    PropertyAttributes = new Attribute[] { BrowsableAttribute.No },
-                    PropertySetter = null,
-                    PropertyType = typeof(bool),
-                    PropertyValidator = null,
-                    PropertyGetter = (instance) => (instance.HasErrors)
-                };
-                result = new DesignObjectPropertyDescriptor(data);
-            }
-            else if (string.Equals(propertyName, ContentProperty))
-            {
-                PropertyDescriptorData data = new PropertyDescriptorData()
-                {
-                    OwnerType = this.GetType(),
-                    PropertyName = propertyName,
-                    PropertyAttributes = new Attribute[] { BrowsableAttribute.No },
-                    PropertySetter = (instance, value) => { instance.Content = (ModelItem)value; },
-                    PropertyType = typeof(ModelItem),
-                    PropertyValidator = null,
-                    PropertyGetter = (instance) => (instance.content)
-                };
-                result = new DesignObjectPropertyDescriptor(data);
-            }
-            else if (string.Equals(propertyName, AutomationIdProperty))
-            {
-                PropertyDescriptorData data = new PropertyDescriptorData()
-                {
-                    OwnerType = this.GetType(),
-                    PropertyName = propertyName,
-                    PropertyAttributes = new Attribute[] { BrowsableAttribute.No },
-                    PropertySetter = null,
-                    PropertyType = typeof(string),
-                    PropertyValidator = null,
-                    PropertyGetter = (instance) => (instance.AutomationId)
-                };
-                result = new DesignObjectPropertyDescriptor(data);
-            }
-            else if (string.Equals(propertyName, TimestampProperty))
-            {
-                PropertyDescriptorData data = new PropertyDescriptorData()
-                {
-                    OwnerType = this.GetType(),
-                    PropertyName = propertyName,
-                    PropertyType = typeof(DateTime),
-                    PropertyValidator = null,
-                    PropertyAttributes = new Attribute[] { BrowsableAttribute.No },
-                    PropertySetter = (instance, value) => { instance.UpdateTimestamp(); },
-                    PropertyGetter = (instance) => (instance.GetTimestamp())
-                };
-                result = new DesignObjectPropertyDescriptor(data);
-            }
-            return result;
-        }
-
-        protected bool IsUndoRedoInProgress
-        {
-            get
-            {
-                return null != this.Context && this.Context.Services.GetService<UndoEngine>().IsUndoRedoInProgress;
-            }
-        }
-
-        void UpdateTimestamp()
-        {
-            this.timestamp = DateTime.Now;
-            this.RaisePropertyChangedEvent(TimestampProperty);
-        }
-
-        protected DateTime GetTimestamp()
-        {
-            return this.timestamp;
-        }
-
-        void OnReflectedObjectPropertyChanged(object s, PropertyChangedEventArgs e)
-        {
-            if (this.IsUndoRedoInProgress)
-            {
-                this.OnReflectedObjectPropertyChanged(e.PropertyName);
-                Type type = this.GetType();
-                if (DesignObjectWrapper.TypePropertyCollection.ContainsKey(type))
-                {
-                    PropertyDescriptorCollection properties = DesignObjectWrapper.TypePropertyCollection[type];
-                    for (int i = 0; i < properties.Count; ++i)
-                    {
-                        if (string.Equals(properties[i].Name, e.PropertyName))
-                        {
-                            this.RaisePropertyChangedEvent(e.PropertyName);
-                            break;
-                        }
-                    }
-                }
-            }
-
-            //whenever data within reflected object changes, we do update timestamp property on wrapped object - 
-            //this allows to create triggers and bindings which do need to be reevaluated whenever overal state of the object changes
-            this.UpdateTimestamp();
-        }
-
-        protected virtual void OnReflectedObjectPropertyChanged(string propertyName)
-        {
-        }
-
-        sealed class DesignObjectPropertyDescriptor : PropertyDescriptor
-        {
-            PropertyDescriptorData descriptorData;
-            string validationErrorPropertyName;
-
-            public DesignObjectPropertyDescriptor(PropertyDescriptorData descriptorData)
-                : base(descriptorData.PropertyName, descriptorData.PropertyAttributes)
-            {
-                this.descriptorData = descriptorData;
-                this.validationErrorPropertyName = (null != this.descriptorData.PropertyValidator ?
-                    string.Format(CultureInfo.InvariantCulture, "{0}{1}", this.descriptorData.PropertyName, DesignObjectWrapper.ValidationErrorSuffix) :
-                    null);
-            }
-
-            public override bool CanResetValue(object component)
-            {
-                return null != this.descriptorData.PropertySetter;
-            }
-
-            public override Type ComponentType
-            {
-                get { return this.descriptorData.OwnerType; }
-            }
-
-            public override object GetValue(object component)
-            {
-                DesignObjectWrapper instance = (DesignObjectWrapper)component;
-                return !instance.isDisposed ? this.descriptorData.PropertyGetter(instance) : null;
-            }
-
-            public override bool IsReadOnly
-            {
-                get { return null == this.descriptorData.PropertySetter; }
-            }
-
-            public override Type PropertyType
-            {
-                get { return this.descriptorData.PropertyType; }
-            }
-
-            public override void ResetValue(object component)
-            {
-                DesignObjectWrapper instance = (DesignObjectWrapper)component;
-                this.descriptorData.PropertySetter(instance, null);
-            }
-
-            [SuppressMessage("Reliability", "Reliability108",
-                Justification = "Exception not eaten away. If its a fatal exception we rethrow, else we wrap in another exception and throw.")]
-            public override void SetValue(object component, object value)
-            {
-                DesignObjectWrapper instance = (DesignObjectWrapper)component;
-                if (!instance.IsUndoRedoInProgress)
-                {
-                    if (null != this.descriptorData.PropertyValidator)
-                    {
-                        string error = null;
-                        ValidationException exception = null;
-                        try
-                        {
-                            List<string> errors = new List<string>();
-                            if (!this.descriptorData.PropertyValidator(instance, value, errors))
-                            {
-                                StringBuilder sb = new StringBuilder();
-                                errors.ForEach((errMessage) =>
-                                    {
-                                        sb.AppendLine(errMessage);
-                                    });
-                                error = sb.ToString();
-                                exception = new ValidationException(error);
-                            }
-                        }
-                        catch (Exception err)
-                        {
-                            if (Fx.IsFatal(err))
-                            {
-                                throw FxTrace.Exception.AsError(err);
-                            }
-                            else
-                            {
-                                exception = new ValidationException(err.Message, err);
-                            }
-                        }
-
-                        if (null != exception)
-                        {
-                            instance.ValidationErrors[this.Name] = exception.Message;
-                            instance.RaisePropertyChangedEvent(this.validationErrorPropertyName);
-                            instance.RaisePropertyChangedEvent(DesignObjectWrapper.HasErrorsProperty);
-                            throw FxTrace.Exception.AsError(exception);
-                        }
-                        else if (null != instance.validationErrors && instance.validationErrors.ContainsKey(this.Name))
-                        {
-                            instance.validationErrors.Remove(this.Name);
-                            if (0 == instance.validationErrors.Count)
-                            {
-                                instance.validationErrors = null;
-                            }
-                            instance.RaisePropertyChangedEvent(this.validationErrorPropertyName);
-                            instance.RaisePropertyChangedEvent(DesignObjectWrapper.HasErrorsProperty);
-                        }
-                    }
-
-                    this.descriptorData.PropertySetter(instance, value);
-
-                    (instance.Content as IModelTreeItem).ModelTreeManager.AddToCurrentEditingScope(new FakeModelNotifyPropertyChange(instance.Content as IModelTreeItem, this.Name));
-                }
-            }
-
-            public override bool ShouldSerializeValue(object component)
-            {
-                return false;
-            }
-        }
-    }
-
-    sealed class PropertyDescriptorData
-    {
-        public Type OwnerType { get; set; }
-        public string PropertyName { get; set; }
-        public Type PropertyType { get; set; }
-        public Func<DesignObjectWrapper, object> PropertyGetter { get; set; }
-        public Action<DesignObjectWrapper, object> PropertySetter { get; set; }
-        public Func<DesignObjectWrapper, object, List<string>, bool> PropertyValidator { get; set; }
-        [SuppressMessage(FxCop.Category.Performance, "CA1819:PropertiesShouldNotReturnArrays",
-            Justification = "Array type property does not clone the array in the getter. It references the same array instance.")]
-        public Attribute[] PropertyAttributes { get; set; }
-
-    }
-
-    //DesignObjectWrapperDynamicPropertyEditor - this class is used to allow defining different value editors for given set of DesignObjectWrappers.
-    //i.e. for generic Variable<T>, user may want to provide different editors for variable's value, depending on generic type placeholder -
-    // Variable<string> - would use default editor, but Variable<CustomType> can provide different editing expirience
-    sealed class DesignObjectWrapperDynamicPropertyEditor : DialogPropertyValueEditor
-    {
-        static DataTemplate dynamicExpressionTemplate;
-
-        //DynamicExpressionTemplate - this template defines a content presenter, which will be filled with default or custom type editor
-        static DataTemplate DynamicExpressionTemplate
-        {
-            get
-            {
-                if (null == dynamicExpressionTemplate)
-                {
-                    dynamicExpressionTemplate = new DataTemplate();
-                    var contentPresenterFactory = new FrameworkElementFactory(typeof(ContentPresenter));
-                    contentPresenterFactory.SetBinding(ContentPresenter.ContentProperty, new Binding());
-                    contentPresenterFactory.SetBinding(ContentPresenter.TagProperty, new Binding() { Converter = ModelPropertyEntryToOwnerActivityConverter, ConverterParameter = false, Path = new PropertyPath("ParentProperty") });
-                    MultiBinding binding = new MultiBinding() { Converter = new TemplateConverter() };
-                    binding.Bindings.Add(new Binding());
-                    binding.Bindings.Add(new Binding() { Path = new PropertyPath("Tag.Timestamp"), Mode = BindingMode.OneWay, RelativeSource = RelativeSource.Self });
-                    contentPresenterFactory.SetBinding(ContentPresenter.ContentTemplateProperty, binding);
-                    dynamicExpressionTemplate.VisualTree = contentPresenterFactory;
-                    dynamicExpressionTemplate.Seal();
-                }
-                //dynamicExpressionTemplate = (DataTemplate)EditorResources.GetResources()["dynamicExpressionTemplate"];
-                return dynamicExpressionTemplate;
-            }
-        }
-
-        static IValueConverter ModelPropertyEntryToModelItemConverter
-        {
-            get
-            {
-                return (ModelPropertyEntryToModelItemConverter)EditorResources.GetResources()["ModelPropertyEntryToContainerConverter"];
-            }
-        }
-
-        static IValueConverter ModelPropertyEntryToOwnerActivityConverter
-        {
-            get
-            {
-                return (ModelPropertyEntryToOwnerActivityConverter)EditorResources.GetResources()["ModelPropertyEntryToOwnerActivityConverter"];
-            }
-        }
-
-        //helper method - gets property value editor for property marked with DesignObjectWrapperDynamicPropertyEditor 
-        static PropertyValueEditor GetEditor(PropertyValue propertyValue)
-        {
-            //convert property value to set of { ModelItem, Context, PropertyValue } 
-            var content = (ModelPropertyEntryToModelItemConverter.Container)
-                DesignObjectWrapperDynamicPropertyEditor.ModelPropertyEntryToModelItemConverter.Convert(propertyValue, null, null, null);
-
-            //get current instance of design object wrapper
-            var wrapper = (DesignObjectWrapper)content.ModelItem.GetCurrentValue();
-
-            //query it for actual value editor
-            var editor = wrapper.GetDynamicPropertyValueEditor(propertyValue.ParentProperty.PropertyName);
-
-            if (null == editor)
-            {
-                Fx.Assert(false, "PropertyValue editor not found for '" + propertyValue.ParentProperty.PropertyName + "'");
-            }
-            return editor;
-        }
-
-        public DesignObjectWrapperDynamicPropertyEditor()
-        {
-            this.InlineEditorTemplate = DesignObjectWrapperDynamicPropertyEditor.DynamicExpressionTemplate;
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
-            Justification = "Propagating exceptions might lead to VS crash.")]
-        [SuppressMessage("Reliability", "Reliability108:IsFatalRule",
-            Justification = "Propagating exceptions might lead to VS crash.")]
-        public override void ShowDialog(PropertyValue propertyValue, IInputElement commandSource)
-        {
-            //get actual value editor
-            var editor = DesignObjectWrapperDynamicPropertyEditor.GetEditor(propertyValue);
-
-            Fx.Assert(editor is DialogPropertyValueEditor, "PropertyValueEditor is not assigned or is not derived from DialogPropertyValueEditor");
-
-            //if we are here, the editor must derive from DialogPropertyEditor, if it doesn't user provided wrong template
-            if (editor is DialogPropertyValueEditor)
-            {
-                try
-                {
-                    ((DialogPropertyValueEditor)editor).ShowDialog(propertyValue, commandSource);
-                }
-                catch (Exception err)
-                {
-                    ErrorReporting.ShowErrorMessage(err.ToString());
-                }
-            }
-        }
-
-        //helper class - allows pulling template definition for dynamic property value
-        private sealed class TemplateConverter : IMultiValueConverter
-        {
-            public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-            {
-                object template = Binding.DoNothing;
-                if (null != values[0])
-                {
-                    var editor = DesignObjectWrapperDynamicPropertyEditor.GetEditor((PropertyValue)values[0]);
-                    if (null != editor)
-                    {
-                        template = editor.InlineEditorTemplate;
-                    }
-                }
-                return template;
-            }
-
-            public object[] ConvertBack(object value, Type[] targetType, object parameter, CultureInfo culture)
-            {
-                throw FxTrace.Exception.AsError(new NotSupportedException());
-            }
-        }
-    }
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignTimeValidationFeature.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignTimeValidationFeature.cs
deleted file mode 100644 (file)
index c4b981d..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Runtime;
-    using System.Globalization;
-    using System.Activities.Presentation.Validation;
-    using System.Activities.Validation;
-    using System.Collections.Generic;
-
-    abstract class DesignTimeValidationFeature : Feature
-    {
-        public override void Initialize(EditingContext context, Type modelType)
-        {
-            if (modelType != this.ApplyTo)
-            {
-                throw FxTrace.Exception.AsError(new InvalidOperationException (
-                    string.Format(CultureInfo.CurrentCulture, SR.DesignTimeValidationFeatureOnlyAppliesToType, this.GetType(), this.ApplyTo, modelType)));
-            }
-
-            ValidationService validationService = context.Services.GetService<ValidationService>();
-            if (validationService != null)
-            {
-                validationService.Settings.AdditionalConstraints.Add(this.ApplyTo, this.DesignTimeConstraints);
-            }
-        }
-
-        protected abstract Type ApplyTo
-        {
-            get;
-        }
-
-        protected abstract IList<Constraint> DesignTimeConstraints
-        {
-            get;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignerConfigurationService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignerConfigurationService.cs
deleted file mode 100644 (file)
index dd000b3..0000000
+++ /dev/null
@@ -1,538 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Globalization;
-    using System.Runtime;
-    using System.Runtime.Versioning;
-    using Microsoft.Activities.Presentation;
-
-    internal enum WorkflowDesignerHostId
-    {
-        Rehost,
-        Dev10,
-        Dev11
-    }
-
-    /// <summary>
-    /// Stores configuration information of designer
-    /// </summary>
-    public sealed class DesignerConfigurationService
-    {
-        private static FrameworkName defaultTargetFrameworkName = FrameworkNameConstants.NetFramework40;
-
-        private bool annotationEnabled;
-        private bool autoConnectEnabled;
-        private bool autoSplitEnabled;
-        private bool autoSurroundWithSequenceEnabled;
-        private bool backgroundValidationEnabled;
-        private bool isAnnotationEnabledSetByUser;
-        private bool isAutoConnectEnabledSetByUser;
-        private bool isAutoSplitEnabledSetByUser;
-        private bool isAutoSurroundWithSequenceEnabledSetByUser;
-        private bool isBackgroundValidationEnabledSetByUser;
-        private bool isLoadingFromUntrustedSourceEnabledSetByUser;
-        private bool isMultipleItemsDragDropEnabledSetByUser;
-        private bool isMultipleItemsContextMenuEnabledSetByUser;
-        private bool isPanModeEnabledSetByUser;
-        private bool isRubberBandSelectionEnabledSetByUser;
-        private bool loadingFromUntrustedSourceEnabled;
-        private bool multipleItemsDragDropEnabled;
-        private bool multipleItemsContextMenuEnabled;
-        private bool namespaceConversionEnabled;
-        private bool panModeEnabled;
-        private bool rubberBandSelectionEnabled;
-        private FrameworkName targetFrameworkName;
-        private WorkflowDesignerHostId workflowDesignerHostId;
-
-        /// <summary>
-        /// Default constructor
-        /// </summary>
-        internal DesignerConfigurationService()
-        {
-            this.namespaceConversionEnabled = true;
-            this.loadingFromUntrustedSourceEnabled = true;
-        }
-
-        /// <summary>
-        /// Gets or sets a value indicating whether annotation feature is enabled.
-        /// Can only be set before WorkflowDesigner.Load()
-        /// Can only be enabled when target framework is 4.5 or higher
-        /// </summary>
-        public bool AnnotationEnabled
-        {
-            get
-            {
-                return this.annotationEnabled;
-            }
-
-            set
-            {
-                if (this.IsWorkflowLoaded)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.CouldNotSetPropertyAfterLoad));
-                }
-
-                this.isAnnotationEnabledSetByUser = true;
-                this.annotationEnabled = value;
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets a value indicating whether auto connect feature is enabled.
-        /// </summary>
-        public bool AutoConnectEnabled
-        {
-            get
-            {
-                return this.autoConnectEnabled;
-            }
-
-            set
-            {
-                this.isAutoConnectEnabledSetByUser = true;
-                this.autoConnectEnabled = value;
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets a value indicating whether auto split feature is enabled.
-        /// </summary>
-        public bool AutoSplitEnabled
-        {
-            get
-            {
-                return this.autoSplitEnabled;
-            }
-
-            set
-            {
-                this.isAutoSplitEnabledSetByUser = true;
-                this.autoSplitEnabled = value;
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets a value indicating whether auto surround with sequence is enabled.
-        /// </summary>
-        public bool AutoSurroundWithSequenceEnabled
-        {
-            get
-            {
-                return this.autoSurroundWithSequenceEnabled;
-            }
-
-            set
-            {
-                this.isAutoSurroundWithSequenceEnabledSetByUser = true;
-                this.autoSurroundWithSequenceEnabled = value;
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets a value indicating whether background validation is enabled.
-        /// </summary>
-        public bool BackgroundValidationEnabled
-        {
-            get
-            {
-                return this.backgroundValidationEnabled;
-            }
-
-            set
-            {
-                if (this.IsWorkflowLoaded)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.CouldNotSetPropertyAfterLoad));
-                }
-
-                this.isBackgroundValidationEnabledSetByUser = true;
-                this.backgroundValidationEnabled = value;
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets a value indicating whether allow loading from untrusted source is enabled. 
-        /// If false, loading from untrusted source will cause a SecurityException thrown out when WorkflowDesigner.Load(string fileName).
-        /// Can only be set before WorkflowDesigner.Load()
-        /// </summary>
-        public bool LoadingFromUntrustedSourceEnabled
-        {
-            get
-            {
-                return this.loadingFromUntrustedSourceEnabled;
-            }
-
-            set
-            {
-                if (this.IsWorkflowLoaded)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.CouldNotSetPropertyAfterLoad));
-                }
-
-                this.isLoadingFromUntrustedSourceEnabledSetByUser = true;
-                this.loadingFromUntrustedSourceEnabled = value;
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets a value indicating whether Context Menu can be displayed when selecting multiple items.
-        /// Can only be set before WorkflowDesigner.Load()
-        /// </summary>
-        public bool MultipleItemsContextMenuEnabled
-        {
-            get
-            {
-                return this.multipleItemsContextMenuEnabled;
-            }
-
-            set
-            {
-                if (this.IsWorkflowLoaded)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.CouldNotSetPropertyAfterLoad));
-                }
-
-                this.isMultipleItemsContextMenuEnabledSetByUser = true;
-                this.multipleItemsContextMenuEnabled = value;
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets a value indicating whether dragging multiple items is enabled.
-        /// Can only be set before WorkflowDesigner.Load()
-        /// </summary>
-        public bool MultipleItemsDragDropEnabled
-        {
-            get
-            {
-                return this.multipleItemsDragDropEnabled;
-            }
-
-            set
-            {
-                if (this.IsWorkflowLoaded)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.CouldNotSetPropertyAfterLoad));
-                }
-
-                this.isMultipleItemsDragDropEnabledSetByUser = true;
-                this.multipleItemsDragDropEnabled = value;
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets a value indicating whether namespace conversion is enabled.
-        /// Can only be set before WorkflowDesigner.Load()
-        /// </summary>
-        public bool NamespaceConversionEnabled
-        {
-            get
-            {
-                return this.namespaceConversionEnabled;
-            }
-
-            set
-            {
-                if (this.IsWorkflowLoaded)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.CouldNotSetPropertyAfterLoad));
-                }
-
-                this.namespaceConversionEnabled = value;
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets a value indicating whether pan mode is enabled.
-        /// Can only be set before WorkflowDesigner.Load()
-        /// </summary>
-        public bool PanModeEnabled
-        {
-            get
-            {
-                return this.panModeEnabled;
-            }
-
-            set
-            {
-                if (this.IsWorkflowLoaded)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.CouldNotSetPropertyAfterLoad));
-                }
-
-                this.isPanModeEnabledSetByUser = true;
-                this.panModeEnabled = value;
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets a value indicating whether rubberband selection is enabled.
-        /// Can only be set before WorkflowDesigner.Load()
-        /// </summary>
-        public bool RubberBandSelectionEnabled
-        {
-            get
-            {
-                return this.rubberBandSelectionEnabled;
-            }
-
-            set
-            {
-                if (this.IsWorkflowLoaded)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.CouldNotSetPropertyAfterLoad));
-                }
-
-                this.isRubberBandSelectionEnabledSetByUser = true;
-                this.rubberBandSelectionEnabled = value;
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets a value indicating the target framework.
-        /// Can only be set before WorkflowDesigner.Load()
-        /// The framework identifier only supports '.NET Framework' and '.NETFramework'.
-        /// The framework profile only supports string.Empty or 'Client'.
-        /// </summary>
-        public FrameworkName TargetFrameworkName
-        {
-            get
-            {
-                if (this.targetFrameworkName == null)
-                {
-                    this.targetFrameworkName = defaultTargetFrameworkName;
-                }
-
-                return this.targetFrameworkName;
-            }
-
-            set
-            {
-                if (value == null)
-                {
-                    throw FxTrace.Exception.ArgumentNull("TargetFrameworkName");
-                }
-
-                if (value.Identifier != FrameworkNameConstants.NetFramework
-                 && value.Identifier != FrameworkNameConstants.NetFrameworkWithSpace)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(string.Format(CultureInfo.CurrentUICulture, SR.NotSupportedFrameworkIdentifier, value.Identifier)));
-                }
-
-                if (!value.IsProfileSupported())
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(string.Format(CultureInfo.CurrentUICulture, SR.NotSupportedFrameworkProfile, value.Profile)));
-                }
-
-                if (value.IsLessThan40())
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(string.Format(CultureInfo.CurrentUICulture, SR.NotSupportedFrameworkVersion, value.Version.ToString())));
-                }
-
-                if (this.IsWorkflowLoaded)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.CouldNotSetPropertyAfterLoad));
-                }
-
-                this.targetFrameworkName = value;
-            }
-        }
-
-        internal static FrameworkName DefaultTargetFrameworkName
-        {
-            get
-            {
-                return defaultTargetFrameworkName;
-            }
-        }
-
-        internal WorkflowDesignerHostId WorkflowDesignerHostId
-        {
-            get
-            {
-                return this.workflowDesignerHostId;
-            }
-
-            set
-            {
-                if (this.IsWorkflowLoaded)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.CouldNotSetPropertyAfterLoad));
-                }
-
-                this.workflowDesignerHostId = value;
-            }
-        }
-
-        internal bool IsWorkflowLoaded { get; set; }
-
-        /// <summary>
-        /// Apply default preference based on TargetFramework and hoster.
-        /// If some flags were already set by user, don't set it to default.
-        /// </summary>
-        internal void ApplyDefaultPreference()
-        {
-            Fx.Assert(!this.IsWorkflowLoaded, "Cannot be invoked after WorkflowDesigner.Load");
-
-            if (this.TargetFrameworkName.Is45OrHigher())
-            {
-                // Dev11 + 4.5 and Rehost + 4.5, open all features.
-                // Dev10 + 4.5, invalid case.
-                this.SetAnnotationIfNotSetByUser(true);
-                this.SetAutoConnectIfNotSetByUser(true);
-                this.SetAutoSplitIfNotSetByUser(true);
-                this.SetAutoSurroundWithSequenceIfNotSetByUser(true);
-                this.SetBackgroundValidationIfNotSetByUser(true);
-                this.SetMultipleItemsContextMenuIfNotSetByUser(true);
-                this.SetMultipleItemsDragDropIfNotSetByUser(true);
-                this.SetPanModeIfNotSetByUser(true);
-                this.SetRubberBandSelectionIfNotSetByUser(true);
-            }
-            else
-            {
-                switch (this.workflowDesignerHostId)
-                {
-                    case WorkflowDesignerHostId.Rehost:
-                    case WorkflowDesignerHostId.Dev10:
-                        this.SetAnnotationIfNotSetByUser(false);
-                        this.SetAutoConnectIfNotSetByUser(false);
-                        this.SetAutoSplitIfNotSetByUser(false);
-                        this.SetAutoSurroundWithSequenceIfNotSetByUser(false);
-                        this.SetBackgroundValidationIfNotSetByUser(false);
-                        this.SetMultipleItemsContextMenuIfNotSetByUser(false);
-                        this.SetMultipleItemsDragDropIfNotSetByUser(false);
-                        this.SetPanModeIfNotSetByUser(false);
-                        this.SetRubberBandSelectionIfNotSetByUser(false);
-                        break;
-                    case WorkflowDesignerHostId.Dev11:
-                        this.SetAnnotationIfNotSetByUser(false);
-                        this.SetAutoConnectIfNotSetByUser(true);
-                        this.SetAutoSplitIfNotSetByUser(true);
-                        this.SetAutoSurroundWithSequenceIfNotSetByUser(true);
-                        this.SetBackgroundValidationIfNotSetByUser(true);
-                        this.SetMultipleItemsContextMenuIfNotSetByUser(true);
-                        this.SetMultipleItemsDragDropIfNotSetByUser(true);
-                        this.SetPanModeIfNotSetByUser(true);
-                        this.SetRubberBandSelectionIfNotSetByUser(true);
-                        break;
-                    default:
-                        break;
-                }
-            }
-        }
-
-        /// <summary>
-        /// The method should be invoked at WorkflowDesigner.Load(string fileName)
-        /// </summary>
-        internal void SetDefaultOfLoadingFromUntrustedSourceEnabled()
-        {
-            Fx.Assert(!this.IsWorkflowLoaded, "Cannot be invoked after WorkflowDesigner.Load");
-
-            // Only Rehost need to apply this flag's default value.
-            // Dev11 will opt-off this feature and handle this by itself.
-            if (this.WorkflowDesignerHostId == Presentation.WorkflowDesignerHostId.Rehost)
-            {
-                if (this.TargetFrameworkName.Is45OrHigher())
-                {
-                    this.SetLoadingFromUntrustedSourceEnabledIfNotSetByUser(false);
-                }
-            }
-        }
-
-        internal void Validate()
-        {
-            if (this.TargetFrameworkName.IsLessThan45())
-            {
-                if (this.annotationEnabled)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.CantEnableAnnotationBefore45));
-                }
-            }
-        }
-
-        private void SetAnnotationIfNotSetByUser(bool annotationEnable)
-        {
-            if (!this.isAnnotationEnabledSetByUser)
-            {
-                this.annotationEnabled = annotationEnable;
-            }
-        }
-
-        private void SetAutoConnectIfNotSetByUser(bool autoConnectEnabled)
-        {
-            if (!this.isAutoConnectEnabledSetByUser)
-            {
-                this.autoConnectEnabled = autoConnectEnabled;
-            }
-        }
-
-        private void SetAutoSplitIfNotSetByUser(bool autoSplitEnabled)
-        {
-            if (!this.isAutoSplitEnabledSetByUser)
-            {
-                this.autoSplitEnabled = autoSplitEnabled;
-            }
-        }
-
-        private void SetAutoSurroundWithSequenceIfNotSetByUser(bool autoSurroundWithSequenceEnabled)
-        {
-            if (!this.isAutoSurroundWithSequenceEnabledSetByUser)
-            {
-                this.autoSurroundWithSequenceEnabled = autoSurroundWithSequenceEnabled;
-            }
-        }
-
-        private void SetBackgroundValidationIfNotSetByUser(bool backgroundValidationEnabled)
-        {
-            if (!this.isBackgroundValidationEnabledSetByUser)
-            {
-                this.backgroundValidationEnabled = backgroundValidationEnabled;
-            }
-        }
-
-        private void SetMultipleItemsContextMenuIfNotSetByUser(bool multipleItemsContextMenuEnabled)
-        {
-            if (!this.isMultipleItemsContextMenuEnabledSetByUser)
-            {
-                this.multipleItemsContextMenuEnabled = multipleItemsContextMenuEnabled;
-            }
-        }
-
-        private void SetMultipleItemsDragDropIfNotSetByUser(bool multipleItemsDragDropEnabled)
-        {
-            if (!this.isMultipleItemsDragDropEnabledSetByUser)
-            {
-                this.multipleItemsDragDropEnabled = multipleItemsDragDropEnabled;
-            }
-        }
-
-        private void SetPanModeIfNotSetByUser(bool panModeEnabled)
-        {
-            if (!this.isPanModeEnabledSetByUser)
-            {
-                this.panModeEnabled = panModeEnabled;
-            }
-        }
-
-        private void SetRubberBandSelectionIfNotSetByUser(bool rubberBandSelectionEnabled)
-        {
-            if (!this.isRubberBandSelectionEnabledSetByUser)
-            {
-                this.rubberBandSelectionEnabled = rubberBandSelectionEnabled;
-            }
-        }
-
-        private void SetLoadingFromUntrustedSourceEnabledIfNotSetByUser(bool loadingFromUntrustedSourceEnabled)
-        {
-            if (!this.isLoadingFromUntrustedSourceEnabledSetByUser)
-            {
-                this.loadingFromUntrustedSourceEnabled = loadingFromUntrustedSourceEnabled;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignerConfigurationServiceUtilities.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignerConfigurationServiceUtilities.cs
deleted file mode 100644 (file)
index 461baa0..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation
-{
-    using System.Runtime;
-
-    internal static class DesignerConfigurationServiceUtilities
-    {
-        public static bool IsAnnotationEnabled(EditingContext editingContext)
-        {
-            Fx.Assert(editingContext != null, "editingContext should not be null");
-            DesignerConfigurationService config = editingContext.Services.GetService<DesignerConfigurationService>();
-
-            if (config != null)
-            {
-                return config.AnnotationEnabled;
-            }
-
-            return false;
-        }
-
-        public static bool IsBackgroundValidationEnabled(EditingContext editingContext)
-        {
-            Fx.Assert(editingContext != null, "editingContext should not be null");
-            DesignerConfigurationService config = editingContext.Services.GetService<DesignerConfigurationService>();
-
-            if (config != null)
-            {
-                return config.BackgroundValidationEnabled;
-            }
-
-            return false;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignerMetadata.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignerMetadata.cs
deleted file mode 100644 (file)
index 15b3c69..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Expressions;
-    using System.Activities.Presentation.Converters;
-    using System.Activities.Presentation.Expressions;
-    using System.Activities.Presentation.Metadata;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation.View;
-    using System.Activities.Presentation.View.OutlineView;
-    using System.Collections.ObjectModel;
-    using System.ComponentModel;
-    using System.Reflection;
-    using System.ServiceModel.Activities;
-    using System.Text;
-    using System.Xml.Linq;
-    using Microsoft.VisualBasic.Activities;
-
-    class DesignerMetadata : IRegisterMetadata
-    {
-        // Called by the designer to register  design-time metadata.
-        public void Register()
-        {
-            AttributeTableBuilder builder = new AttributeTableBuilder();
-
-            // Register Designers.
-            builder.AddCustomAttributes(typeof(Activity), new DesignerAttribute(typeof(ActivityDesigner)));
-            builder.AddCustomAttributes(typeof(ActivityBuilder), new DesignerAttribute(typeof(ActivityTypeDesigner)));
-            builder.AddCustomAttributes(typeof(ActivityBuilder<>), new DesignerAttribute(typeof(GenericActivityTypeDesigner)));
-
-            // Register PropertyValueEditors
-            builder.AddCustomAttributes(typeof(Argument), new EditorAttribute(typeof(ExpressionValueEditor), typeof(PropertyValueEditor)));
-            builder.AddCustomAttributes(typeof(Type), PropertyValueEditor.CreateEditorAttribute(typeof(TypePropertyEditor)));
-
-            builder.AddCustomAttributes(typeof(Activity<>), new EditorAttribute(typeof(ExpressionValueEditor), typeof(PropertyValueEditor)));
-
-            // Disable reuse of propertyvalueeditors for Arguments
-            builder.AddCustomAttributes(typeof(Argument), new EditorReuseAttribute(false));
-            builder.AddCustomAttributes(typeof(Activity<>), new EditorReuseAttribute(false));
-
-            //Removing all the properties except "Name" from property grid for the type SchemaType.            
-            foreach (MemberInfo mi in typeof(ActivityBuilder).GetMembers())
-            {
-                if (mi.MemberType == MemberTypes.Property && !mi.Name.Equals("Name") && !mi.Name.Equals("ImplementationVersion"))
-                {
-                    builder.AddCustomAttributes(typeof(ActivityBuilder), mi, new BrowsableAttribute(false));
-                }
-            }
-
-            // Removing all the properties property grid for the type SchemaType.            
-            foreach (MemberInfo mi in typeof(ActivityBuilder<>).GetMembers())
-            {
-                builder.AddCustomAttributes(typeof(ActivityBuilder<>), mi, new BrowsableAttribute(false));
-            }
-
-            builder.AddCustomAttributes(typeof(Argument), new SearchableStringConverterAttribute(typeof(ArgumentSearchableStringConverter)));
-            builder.AddCustomAttributes(typeof(VisualBasicValue<>), new SearchableStringConverterAttribute(typeof(VisualBasicValueSearchableStringConverter)));
-            builder.AddCustomAttributes(typeof(Type), new SearchableStringConverterAttribute(typeof(TypeSearchableStringConverter)));
-            builder.AddCustomAttributes(typeof(ActivityAction<>),
-                new SearchableStringConverterAttribute(typeof(ActivityActionSearchableStringConverter<>)));
-            builder.AddCustomAttributes(typeof(XName), new SearchableStringConverterAttribute(typeof(XNameSearchableStringConverter)));
-            builder.AddCustomAttributes(typeof(Encoding), new SearchableStringConverterAttribute(typeof(EncodingSearchableStringConverter)));
-            builder.AddCustomAttributes(typeof(ErrorActivity), new SearchableStringConverterAttribute(typeof(EmptySearchableStringConverter)));
-
-            builder.AddCustomAttributes(typeof(XName), new TypeConverterAttribute(typeof(XNameConverter)));
-
-            builder.AddCustomAttributes(typeof(VBIdentifierName), new EditorAttribute(typeof(VBIdentifierNameEditor), typeof(PropertyValueEditor)));            
-            builder.AddCustomAttributes(typeof(VBIdentifierName), new EditorReuseAttribute(false));
-
-            ExpressionTextBox.RegisterExpressionActivityEditor(VisualBasicEditor.ExpressionLanguageName, typeof(VisualBasicEditor), VisualBasicEditor.CreateExpressionFromString);
-            builder.AddCustomAttributes(typeof(VisualBasicValue<>), new ExpressionMorphHelperAttribute(typeof(VisualBasicExpressionMorphHelper)));
-            builder.AddCustomAttributes(typeof(VisualBasicReference<>), new ExpressionMorphHelperAttribute(typeof(VisualBasicExpressionMorphHelper)));
-            builder.AddCustomAttributes(typeof(VisualBasicValue<>), new FeatureAttribute(typeof(VisualBasicValueValidationFeature)));
-            builder.AddCustomAttributes(typeof(VisualBasicReference<>), new FeatureAttribute(typeof(VisualBasicReferenceValidationFeature)));
-
-            builder.AddCustomAttributes(typeof(Literal<>), new ExpressionMorphHelperAttribute(typeof(NonTextualExpressionMorphHelper)));
-            builder.AddCustomAttributes(typeof(VariableValue<>), new ExpressionMorphHelperAttribute(typeof(NonTextualExpressionMorphHelper)));
-            builder.AddCustomAttributes(typeof(VariableReference<>), new ExpressionMorphHelperAttribute(typeof(NonTextualExpressionMorphHelper)));
-
-            builder.AddCustomAttributes(typeof(Activity), new ShowInOutlineViewAttribute());
-            builder.AddCustomAttributes(typeof(Collection<Activity>), new ShowInOutlineViewAttribute());
-
-
-
-            Type type = typeof(ActivityDelegate);
-            builder.AddCustomAttributes(type, new ShowInOutlineViewAttribute() { PromotedProperty = "Handler" });
-
-            type = typeof(ActivityBuilder);
-            builder.AddCustomAttributes(type, new ShowInOutlineViewAttribute());
-            builder.AddCustomAttributes(type, type.GetProperty("Implementation"), new ShowPropertyInOutlineViewAttribute() { CurrentPropertyVisible = false });
-
-            type = typeof(WorkflowService);
-            builder.AddCustomAttributes(type, type.GetProperty("Body"), new ShowPropertyInOutlineViewAttribute() { CurrentPropertyVisible = false });
-
-            builder.AddCustomAttributes(typeof(WorkflowIdentity), new TypeConverterAttribute(typeof(ExpandableObjectConverter)));
-            builder.AddCustomAttributes(typeof(Version), new EditorAttribute(typeof(VersionPropertyValueEditor), typeof(PropertyValueEditor)));
-
-            // Apply the metadata
-            MetadataStore.AddAttributeTable(builder.CreateTable());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignerPerfEventProvider.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignerPerfEventProvider.cs
deleted file mode 100644 (file)
index ce36e0a..0000000
+++ /dev/null
@@ -1,319 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-    using System.Diagnostics.Eventing;
-
-    class DesignerPerfEventProvider
-    {
-        EventProvider provider = null;
-
-        public DesignerPerfEventProvider()
-        {
-            try
-            {
-                this.provider = new EventProvider(new Guid("{B5697126-CBAF-4281-A983-7851DAF56454}"));
-            }
-            catch (PlatformNotSupportedException)
-            {
-                this.provider = null;
-            }
-        }
-
-        public void WorkflowDesignerApplicationIdleAfterLoad()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.WorkflowDesignerApplicationIdleAfterLoad);
-            }
-        }
-
-        public void WorkflowDesignerDeserializeEnd()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.WorkflowDesignerDeserializeEnd);
-            }
-        }
-
-        public void WorkflowDesignerDeserializeStart()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.WorkflowDesignerDeserializeStart);
-            }
-        }
-
-        public void WorkflowDesignerDrop()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.WorkflowDesignerDrop);
-            }
-        }
-
-        public void WorkflowDesignerIdleAfterDrop()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.WorkflowDesignerIdleAfterDrop);
-            }
-        }
-
-        public void WorkflowDesignerLoadComplete()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.WorkflowDesignerLoadComplete);
-            }
-        }
-
-        public void WorkflowDesignerLoadStart()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.WorkflowDesignerLoadStart);
-            }
-        }
-
-        public void WorkflowDesignerSerializeEnd()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.WorkflowDesignerSerializeEnd);
-            }
-        }
-
-        public void WorkflowDesignerSerializeStart()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.WorkflowDesignerSerializeStart);
-            }
-        }
-
-        public void WorkflowDesignerExpressionEditorCompilationEnd()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.WorkflowDesignerExpressionEditorCompilationEnd);
-            }
-        }
-
-        public void WorkflowDesignerExpressionEditorCompilationStart()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.WorkflowDesignerExpressionEditorCompilationStart);
-            }
-        }
-
-        public void WorkflowDesignerExpressionEditorLoaded()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.WorkflowDesignerExpressionEditorLoaded);
-            }
-        }
-
-        public void WorkflowDesignerExpressionEditorLoadStart()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.WorkflowDesignerExpressionEditorLoadStart);
-            }
-        }
-
-        public void WorkflowDesignerValidationEnd()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.WorkflowDesignerValidationEnd);
-            }
-        }
-
-        public void WorkflowDesignerValidationStart()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.WorkflowDesignerValidationStart);
-            }
-        }
-
-        public void FlowchartDesignerLoadEnd()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.FlowchartDesignerLoadEnd);
-            }
-        }
-
-        public void FlowchartDesignerLoadStart()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.FlowchartDesignerLoadStart);
-            }
-        }
-
-        public void FreeFormPanelMeasureEnd()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.FreeFormPanelMeasureEnd);
-            }
-        }
-
-        public void FreeFormPanelMeasureStart()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.FreeFormPanelMeasureStart);
-            }
-        }
-
-        public void WorkflowDesignerCopyStart()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.WorkflowDesignerCopyStart);
-            }
-        }
-
-        public void WorkflowDesignerCopyEnd()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.WorkflowDesignerCopyEnd);
-            }
-        }
-
-        public void WorkflowDesignerPasteStart()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.WorkflowDesignerPasteStart);
-            }
-        }
-
-        public void WorkflowDesignerPasteEnd()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.WorkflowDesignerPasteEnd);
-            }
-        }
-
-        public void DesignerTreeViewLoadChildrenStart()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.DesignerTreeViewLoadChildrenStart);
-            }
-        }
-
-        public void DesignerTreeViewLoadChildrenEnd()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.DesignerTreeViewLoadChildrenEnd);
-            }
-        }
-
-        public void DesignerTreeViewUpdateStart()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.DesignerTreeViewUpdateStart);
-            }
-        }
-
-        public void DesignerTreeViewUpdateEnd()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.DesignerTreeViewUpdateEnd);
-            }
-        }
-
-        public void DesignerTreeViewExpandStart()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.DesignerTreeViewExpandStart);
-            }
-        }
-
-        public void DesignerTreeViewExpandEnd()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.DesignerTreeViewExpandEnd);
-            }
-        }
-
-        public void TypeBrowserApplicationIdleAfterShowDialog()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.TypeBrowserApplicationIdleAfterShowDialog);
-            }
-        }
-
-        public void TypeBrowserOkPressed()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.TypeBrowserOkPressed);
-            }
-        }
-
-        public void SelectionChangedStart()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.SelectionChangedStart);
-            }
-        }
-
-        public void PropertyInspectorUpdatePropertyListStart()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.PropertyInspectorUpdatePropertyListStart);
-            }
-        }
-
-        public void PropertyInspectorUpdatePropertyListEnd()
-        {
-            if (this.IsEnabled())
-            {
-                WriteEventHelper((int)DesignerPerfEvents.PropertyInspectorUpdatePropertyListEnd);
-            }
-        }
-
-        private bool IsEnabled()
-        {
-            bool isEnabled = false;
-            if (this.provider != null)
-            {
-                isEnabled = this.provider.IsEnabled();
-            }
-            return isEnabled;
-        }
-
-        private void WriteEventHelper(int eventId)
-        {
-            if (this.provider != null)
-            {
-                EventDescriptor descriptor = new EventDescriptor(eventId, 0, 0, 0, 0, 0, 0);
-                this.provider.WriteEvent(ref descriptor);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignerPerfEvents.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DesignerPerfEvents.cs
deleted file mode 100644 (file)
index b8308c0..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    enum DesignerPerfEvents
-    {
-        WorkflowDesignerLoadStart = 0,
-        WorkflowDesignerLoadComplete,
-        WorkflowDesignerDeserializeStart,
-        WorkflowDesignerDeserializeEnd,
-        WorkflowDesignerApplicationIdleAfterLoad,
-        WorkflowDesignerSerializeStart,
-        WorkflowDesignerSerializeEnd,
-        WorkflowDesignerDrop,
-        WorkflowDesignerIdleAfterDrop,
-        WorkflowDesignerExpressionEditorLoadStart,
-        WorkflowDesignerExpressionEditorLoaded,
-        WorkflowDesignerExpressionEditorCompilationStart,
-        WorkflowDesignerExpressionEditorCompilationEnd,
-        WorkflowDesignerValidationStart,
-        WorkflowDesignerValidationEnd,
-        FlowchartDesignerLoadEnd,
-        FlowchartDesignerLoadStart,
-        FreeFormPanelMeasureStart,
-        FreeFormPanelMeasureEnd,
-        WorkflowDesignerCopyStart,
-        WorkflowDesignerCopyEnd,
-        WorkflowDesignerPasteStart,
-        WorkflowDesignerPasteEnd,
-        DesignerTreeViewLoadChildrenStart,
-        DesignerTreeViewLoadChildrenEnd,
-        DesignerTreeViewUpdateStart,
-        DesignerTreeViewUpdateEnd,
-        DesignerTreeViewExpandStart,
-        DesignerTreeViewExpandEnd,
-        TypeBrowserApplicationIdleAfterShowDialog,
-        TypeBrowserOkPressed,
-        SelectionChangedStart,
-        PropertyInspectorUpdatePropertyListStart,
-        PropertyInspectorUpdatePropertyListEnd,
-    };
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DialogWindow.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DialogWindow.cs
deleted file mode 100644 (file)
index df2fe17..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Windows;
-    using System.Activities.Presentation.View;
-    using System.Windows.Interop;
-    using System.Windows.Input;
-    using System.ComponentModel;
-    using Microsoft.Tools.Common;
-
-    internal class DialogWindow : Window
-    {        
-        public static readonly DependencyProperty ContextProperty =
-            DependencyProperty.Register("Context",
-            typeof(EditingContext),
-            typeof(DialogWindow));
-
-        string helpKeyword = HelpKeywords.HomePage;
-
-        public EditingContext Context
-        {
-            get { return (EditingContext)GetValue(ContextProperty); }
-            set { SetValue(ContextProperty, value); }
-        }
-
-        protected string HelpKeyword
-        {
-            get
-            {
-                return this.helpKeyword;
-            }
-            set
-            {
-                this.helpKeyword = value;
-            }
-        }
-
-        protected override void OnSourceInitialized(EventArgs e)
-        {
-            base.OnSourceInitialized(e);
-
-            this.HideMinMaxButton();
-            this.ShowContextHelpButton();
-            this.HideIcon();
-            this.AddWindowsHook(OnHookedWindowMessage);
-            this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Help, new ExecutedRoutedEventHandler(OnHelpExecuted)));
-            this.Closing += new CancelEventHandler(OnWindowClosing);
-        }
-
-        static IntPtr OnHookedWindowMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
-        {
-            if (msg == Win32Interop.WM_SYSCOMMAND && wParam.ToInt64() == (long)Win32Interop.SC_CONTEXTHELP)
-            {
-                var rootVisual = HwndSource.FromHwnd(hwnd).RootVisual;
-                var focusedElement = FocusManager.GetFocusedElement(rootVisual);
-                if (focusedElement == null)
-                {
-                    focusedElement = rootVisual as IInputElement;
-                }
-                ApplicationCommands.Help.Execute(null, focusedElement);
-                handled = true;
-            }
-
-            // According to MSDN, zero should be returned after handling WM_SYSCOMMAND.
-            // If this message is unhandled, it's still safe to return zero
-            // because WPF framework (HwndSource) will return zero anyway if the
-            // message is unhandled.
-            return IntPtr.Zero;
-        }       
-        
-        void OnWindowClosing(object sender, CancelEventArgs e)
-        {
-            // Note: Do NOT remove the hook if the close operation needs to be canceled.
-            this.RemoveWindowsHook(OnHookedWindowMessage);
-        }
-
-        void OnHelpExecuted(Object sender, ExecutedRoutedEventArgs e)
-        {
-            if (this.Context != null)            
-            {
-                IIntegratedHelpService help = this.Context.Services.GetService<IIntegratedHelpService>();
-                if (help != null)
-                {
-                    help.ShowHelpFromKeyword(this.helpKeyword);
-                    return;
-                }
-            }
-            System.Diagnostics.Process.Start(SR.DefaultHelpUrl);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DictionaryItemsCollection.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DictionaryItemsCollection.cs
deleted file mode 100644 (file)
index 22e8761..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Model;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Runtime;
-
-    class DictionaryItemsCollection<TKey, TValue> : Collection<ModelItemKeyValuePair<TKey, TValue>>, IItemsCollection
-    {
-        IDictionary<TKey, TValue> dictionary;
-        public bool ShouldUpdateDictionary { get; set; }
-        public ModelItemDictionaryImpl ModelDictionary { get; set; }
-
-        public DictionaryItemsCollection(object dictionary)
-        {
-            this.ShouldUpdateDictionary = true;
-            this.dictionary = dictionary as IDictionary<TKey, TValue>;
-            Fx.Assert(this.dictionary != null, "dictionary should be instantiated");
-            foreach (KeyValuePair<TKey, TValue> kvpair in this.dictionary)
-            {
-                ModelItemKeyValuePair<TKey, TValue> item = new ModelItemKeyValuePair<TKey, TValue>(kvpair.Key, kvpair.Value);
-                item.collection = this;
-                base.InsertItem(this.Count, item);
-            }
-        }
-
-        internal void PostUpdateKey()
-        {
-            this.UpdateDictionary();
-        }
-
-        internal void PreUpdateKey(TKey oldKey, TKey newKey)
-        {
-            this.dictionary.Remove(oldKey);
-            if (this.dictionary.ContainsKey(newKey))
-            {
-                this.UpdateDictionary();
-                throw FxTrace.Exception.AsError(new ArgumentException(SR.DuplicateKey));
-            }
-            if (this.ModelDictionary != null)
-            {
-                this.ModelDictionary.UpdateKey(oldKey, newKey);
-            }
-        }
-
-        internal void UpdateValue(TKey key, TValue value)
-        {
-            if (ShouldUpdateDictionary)
-            {
-                this.dictionary[key] = value;
-                if (this.ModelDictionary != null)
-                {
-                    this.ModelDictionary.UpdateValue(key, value);
-                }
-            }
-        }
-
-        protected override void ClearItems()
-        {
-            if (ShouldUpdateDictionary)
-            {
-                this.dictionary.Clear();
-            }
-            base.ClearItems();
-        }
-
-        protected override void InsertItem(int index, ModelItemKeyValuePair<TKey, TValue> item)
-        {
-            if (item == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("item"));
-            }
-
-            if (ShouldUpdateDictionary && this.dictionary.ContainsKey(item.Key))
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException(SR.DuplicateKey));
-            }
-
-            item.collection = this;
-            base.InsertItem(index, item);
-
-            this.UpdateDictionary();
-        }
-
-        protected override void RemoveItem(int index)
-        {
-            ModelItemKeyValuePair<TKey, TValue> item = this[index];
-            Fx.Assert(item != null, "Item should not be null.");
-            if (ShouldUpdateDictionary)
-            {
-                this.dictionary.Remove(item.Key);
-            }
-
-            base.RemoveItem(index);
-        }
-
-        protected override void SetItem(int index, ModelItemKeyValuePair<TKey, TValue> item)
-        {
-            if (item == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("item"));
-            }
-            item.collection = this;
-            ModelItemKeyValuePair<TKey, TValue> oldItem = this[index];
-            Fx.Assert(oldItem != null, "Item should not be null.");
-            this.PreUpdateKey(oldItem.Key, item.Key);
-            base.SetItem(index, item);
-            this.PostUpdateKey();
-        }
-
-        void UpdateDictionary()
-        {
-            if (ShouldUpdateDictionary)
-            {
-                // Make sure the order of KVPairs in the dictionary is the same as the order of items in the collection
-                this.dictionary.Clear();
-                foreach (ModelItemKeyValuePair<TKey, TValue> item in this)
-                {
-                    this.dictionary.Add(new KeyValuePair<TKey, TValue>(item.Key, item.Value));
-                }
-            }
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DockedAnnotationDecorator.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DockedAnnotationDecorator.cs
deleted file mode 100644 (file)
index cdca6e4..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Windows;
-    using System.Windows.Controls;
-
-    internal class DockedAnnotationDecorator : Decorator
-    {
-        protected override Size MeasureOverride(Size availableSize)
-        {
-            Size size = new Size();
-
-            if (this.Child != null)
-            {
-                this.Child.Measure(availableSize);
-                size.Height = this.Child.DesiredSize.Height;
-            }
-
-            return size;
-        }
-
-        protected override Size ArrangeOverride(Size finalSize)
-        {
-            if (this.Child != null)
-            {
-                this.Child.Arrange(new Rect(finalSize));
-            }
-
-            return finalSize;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DragDropHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DragDropHelper.cs
deleted file mode 100644 (file)
index c0aee6e..0000000
+++ /dev/null
@@ -1,938 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Diagnostics;
-    using System.Windows;
-    using System.Windows.Documents;
-    using System.Windows.Media;
-    using System.Windows.Shapes;
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.View;
-    using System.Windows.Threading;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Runtime;
-    using System.Reflection;
-    using System.Activities.Presentation.Sqm;
-    using System.Collections.Generic;
-    using System.Windows.Controls;
-    using System.Linq;
-    using Microsoft.Activities.Presentation;
-
-
-    // This is a helper class for making dragdrop inside workflow designer easy. This abstracts out te encoding formats used in the
-    // DataObject that is passed on from Drag source to target.
-    public static class DragDropHelper
-    {
-        // Using a DependencyProperty as the backing store for MyProperty.  This enables animation, styling, binding, etc...
-        public static readonly DependencyProperty DragSourceProperty =
-            DependencyProperty.RegisterAttached("DragSource", typeof(UIElement), typeof(DragDropHelper), new UIPropertyMetadata(null));
-        public static readonly string ModelItemDataFormat;
-        public static readonly string CompositeViewFormat;
-        public static readonly string CompletedEffectsFormat = "DragCompletedEffectsFormat";
-        public static readonly string WorkflowItemTypeNameFormat = "WorkflowItemTypeNameFormat";
-        public static readonly string DragAnchorPointFormat;
-        internal static readonly string ModelItemsDataFormat;
-        internal static readonly string MovedViewElementsFormat;
-
-        [SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")]
-        static DragDropHelper()
-        {
-            string postfix = Guid.NewGuid().ToString();
-            //set per process unique data format names - this will disable possibility of trying to drag & drop operation 
-            //between designers in two different VS instances (use Cut-Copy-Paste for that)
-            ModelItemDataFormat = string.Format(CultureInfo.InvariantCulture, "ModelItemFormat_{0}", postfix);
-            CompositeViewFormat = string.Format(CultureInfo.InvariantCulture, "CompositeViewFormat_{0}", postfix);
-            DragAnchorPointFormat = string.Format(CultureInfo.InvariantCulture, "DragAnchorFormat_{0}", postfix);
-            ModelItemsDataFormat = string.Format(CultureInfo.InvariantCulture, "ModelItemsFormat_{0}", postfix);
-            MovedViewElementsFormat = string.Format(CultureInfo.InvariantCulture, "MovedViewElementsFormat_{0}", postfix);
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
-        public static void SetCompositeView(WorkflowViewElement workflowViewElement, UIElement dragSource)
-        {
-            if (workflowViewElement == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("workflowViewElement");
-            }
-            if (dragSource == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("dragSource");
-            }
-            workflowViewElement.SetValue(DragDropHelper.DragSourceProperty, dragSource);
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
-        public static UIElement GetCompositeView(WorkflowViewElement workflowViewElement)
-        {
-            if (workflowViewElement == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("workflowViewElement");
-            }
-            return (UIElement)workflowViewElement.GetValue(DragDropHelper.DragSourceProperty);
-        }
-
-        internal static DataObject DoDragMoveImpl(IEnumerable<WorkflowViewElement> draggedViewElements, Point referencePoint)
-        {
-            List<ModelItem> draggedModelItems = new List<ModelItem>();
-            bool first = true;
-            WorkflowViewElement viewElement = null;
-            foreach (WorkflowViewElement view in draggedViewElements)
-            {
-                if (view != null)
-                {
-                    if (first)
-                    {
-                        viewElement = view;
-                        first = false;
-                    }
-                    draggedModelItems.Add(view.ModelItem);
-                    view.IsHitTestVisible = false;
-                }
-            }
-            DataObject dataObject = new DataObject(ModelItemsDataFormat, draggedModelItems);
-
-            // For compatiblity
-            if (viewElement != null)
-            {
-                dataObject.SetData(ModelItemDataFormat, viewElement.ModelItem);
-                dataObject.SetData(CompositeViewFormat, GetCompositeView(viewElement));
-            }
-
-            dataObject.SetData(DragAnchorPointFormat, referencePoint);
-
-            if (viewElement != null)
-            {
-                DesignerView designerView = viewElement.Context.Services.GetService<DesignerView>();
-                ViewElementDragShadow dragShadow = new ViewElementDragShadow(designerView.scrollableContent, draggedViewElements, referencePoint, designerView.ZoomFactor);
-                designerView.BeginDragShadowTracking(dragShadow);
-                //whenever drag drop fails - ensure getting rid of drag shadow
-                try
-                {
-                    DragDrop.DoDragDrop(designerView, dataObject, DragDropEffects.Move | DragDropEffects.Copy | DragDropEffects.Scroll | DragDropEffects.Link);
-                }
-                catch
-                {
-                    //let the caller handle exception
-                    throw;
-                }
-                finally
-                {
-                    designerView.EndDragShadowTracking(dragShadow);
-                    foreach (WorkflowViewElement view in draggedViewElements)
-                    {
-                        if (view != null)
-                        {
-                            view.IsHitTestVisible = true;
-                        }
-                    }
-                }
-            }
-            return dataObject;
-        }
-
-        [Obsolete("This method does not support dragging multiple items. Use \"public static IEnumerable<WorkflowViewElement> DoDragMove(IEnumerable<WorkflowViewElement> draggedViewElements, Point referencePoint)\" instead.")]
-        public static DragDropEffects DoDragMove(WorkflowViewElement draggedViewElement, Point referencePoint)
-        {
-            if (draggedViewElement == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("draggedViewElement");
-            }
-            if (referencePoint == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("referencePoint");
-            }
-            ModelItem draggedActivityModelItem = draggedViewElement.ModelItem;
-            DataObject dataObject = new DataObject(ModelItemDataFormat, draggedActivityModelItem);
-            dataObject.SetData(CompositeViewFormat, GetCompositeView(draggedViewElement));
-            dataObject.SetData(DragAnchorPointFormat, referencePoint);
-            List<ModelItem> draggedModelItems = new List<ModelItem>();
-            draggedModelItems.Add(draggedActivityModelItem);
-            dataObject.SetData(ModelItemsDataFormat, draggedModelItems);
-
-            DesignerView view = draggedViewElement.Context.Services.GetService<DesignerView>();
-            ViewElementDragShadow dragShadow = new ViewElementDragShadow(view.scrollableContent, draggedViewElement, referencePoint, view.ZoomFactor);
-
-            draggedViewElement.IsHitTestVisible = false;
-            view.BeginDragShadowTracking(dragShadow);
-
-            //whenever drag drop fails - ensure getting rid of drag shadow
-            try
-            {
-                DragDrop.DoDragDrop(GetCompositeView(draggedViewElement), dataObject, DragDropEffects.Move | DragDropEffects.Copy | DragDropEffects.Scroll | DragDropEffects.Link);
-            }
-            catch
-            {
-                //let the caller handle exception
-                throw;
-            }
-            finally
-            {
-                view.EndDragShadowTracking(dragShadow);
-                draggedViewElement.IsHitTestVisible = true;
-            }
-
-            return GetDragDropCompletedEffects(dataObject);
-        }
-
-        public static bool AllowDrop(IDataObject draggedDataObject, EditingContext context, params Type[] allowedItemTypes)
-        {
-
-            if (draggedDataObject == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("draggedDataObject");
-            }
-            if (context == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("context");
-            }
-            if (allowedItemTypes == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("allowedItemTypes");
-            }
-            ReadOnlyState readOnlyState = context.Items.GetValue<ReadOnlyState>();
-            if (readOnlyState != null && readOnlyState.IsReadOnly)
-            {
-                return false;
-            }
-            if (!AllowDrop(draggedDataObject, context))
-            {
-                return false;
-            }
-            List<Type> draggedTypes = GetDraggedTypes(draggedDataObject);
-            return draggedTypes != null
-                && draggedTypes.Count != 0
-                && draggedTypes.All<Type>((p) =>
-                {
-                    for (int i = 0; i < allowedItemTypes.Length; ++i)
-                    {
-                        if (allowedItemTypes[i] == null)
-                        {
-                            throw FxTrace.Exception.ArgumentNull(string.Format(CultureInfo.InvariantCulture, "allowedItemTypes[{0}]", i));
-                        }
-                        if (AllowDrop(p, allowedItemTypes[i]))
-                        {
-                            return true;
-                        }
-                    }
-                    return false;
-                });
-        }
-
-        static bool AllowDrop(IDataObject draggedDataObject, EditingContext context)
-        {
-            ModelItem droppedModelItem = draggedDataObject.GetData(ModelItemDataFormat) as ModelItem;
-            if (droppedModelItem == null)
-            {
-                return true;
-            }
-            return ((IModelTreeItem)droppedModelItem).ModelTreeManager.Context.Equals(context);
-        }
-
-        internal static bool AllowDrop(Type draggedType, Type allowedItemType)
-        {
-            if (draggedType == null)
-            {
-                // This is the case where some external stuff (e.g. Recycle bin) get dragged over.
-                return false;
-            }
-            // This is a special case in GetDroppedObject() and replicated here.
-            // Check whether dragged type is IActivityTemplateFactory, if true, use Factory's implement type instead.
-            Type factoryType;
-            if (draggedType.TryGetActivityTemplateFactory(out factoryType))
-            {
-                draggedType = factoryType;
-            }
-
-            if (allowedItemType.IsAssignableFrom(draggedType))
-            {
-                return true;
-            }
-            else if (allowedItemType.IsGenericTypeDefinition && draggedType.IsGenericType)
-            {
-                // We don't have inheritance relationship for GenericTypeDefinition, therefore the right check is equality
-                return allowedItemType.Equals(draggedType.GetGenericTypeDefinition());
-            }
-            else if (allowedItemType.IsGenericType && draggedType.IsGenericTypeDefinition)
-            {
-                // Allow GenericTypeDefinition to be dropped with GenericType constraint, if user select a correct argument type, drop should work.
-                return draggedType.Equals(allowedItemType.GetGenericTypeDefinition());
-            }
-            else if (allowedItemType.IsGenericType && draggedType.IsGenericType && draggedType.ContainsGenericParameters)
-            {
-                // If the draggedType is generic type but it contains generic parameters, which may happen to match the constraint.
-                return allowedItemType.GetGenericTypeDefinition() == draggedType.GetGenericTypeDefinition();
-            }
-            else
-            {
-                return false;
-            }
-        }
-
-        internal static List<Type> GetDraggedTypes(IDataObject draggedDataObject)
-        {
-            List<Type> types = new List<Type>();
-            if (draggedDataObject != null)
-            {
-                if (draggedDataObject.GetDataPresent(ModelItemsDataFormat))
-                {
-                    IEnumerable<ModelItem> modelItems = draggedDataObject.GetData(ModelItemsDataFormat) as IEnumerable<ModelItem>;
-                    foreach (ModelItem modelItem in modelItems)
-                    {
-                        if (modelItem != null)
-                        {
-                            types.Add(modelItem.ItemType);
-                        }
-                    }
-                }
-                else if (draggedDataObject.GetDataPresent(ModelItemDataFormat))
-                {
-                    ModelItem modelItem = draggedDataObject.GetData(ModelItemDataFormat) as ModelItem;
-                    if (modelItem != null)
-                    {
-                        types.Add(modelItem.ItemType);
-                    }
-                }
-
-                // This is an object dragged from somewhere else other than from within the designer surface
-                if (draggedDataObject.GetDataPresent(WorkflowItemTypeNameFormat))
-                {
-                    // This is the case where the object is dropped from the toolbox
-                    string text = draggedDataObject.GetData(WorkflowItemTypeNameFormat) as string;
-                    if (!string.IsNullOrEmpty(text))
-                    {
-                        types.Add(Type.GetType(text));
-                    }
-                }
-            }
-
-            return types;
-        }
-
-        internal static bool IsDraggingFromToolbox(DragEventArgs e)
-        {
-            return e.Data.GetDataPresent(WorkflowItemTypeNameFormat);
-        }
-
-        public static IEnumerable<object> GetDroppedObjects(DependencyObject dropTarget, DragEventArgs e, EditingContext context)
-        {
-            List<object> droppedObjects = new List<object>();
-            if (e.Data.GetDataPresent(ModelItemsDataFormat))
-            {
-                IEnumerable<ModelItem> droppedModelItems = e.Data.GetData(ModelItemsDataFormat) as IEnumerable<ModelItem>;
-                foreach (ModelItem modelItem in droppedModelItems)
-                {
-                    droppedObjects.Add(modelItem);
-                }
-            }
-            else
-            {
-                object droppedObject = e.Data.GetData(ModelItemDataFormat) as ModelItem;
-                // could have been dropped from toolbox.
-                if (droppedObject == null)
-                {
-                    Type type = null;
-                    if (e.Data.GetDataPresent(WorkflowItemTypeNameFormat))
-                    {
-                        string text = e.Data.GetData(WorkflowItemTypeNameFormat) as string;
-                        if (!string.IsNullOrEmpty(text))
-                        {
-                            //try to use the text format to see if it holds a type name and  try to create an object out of it.
-                            type = Type.GetType(text);
-                        }
-                    }
-                    droppedObject = GetDroppedObjectInstance(dropTarget, context, type, e.Data);
-                }
-                if (droppedObject != null)
-                {
-                    droppedObjects.Add(droppedObject);
-                }
-            }
-            e.Handled = true;
-            context.Services.GetService<DesignerPerfEventProvider>().WorkflowDesignerDrop();
-
-            Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle,
-                    new Action(() =>
-                    {
-                        context.Services.GetService<DesignerPerfEventProvider>().WorkflowDesignerIdleAfterDrop();
-
-                    }));
-            return droppedObjects;
-        }
-
-        internal static void ValidateItemsAreOnView(IList<ModelItem> items, ICollection<ModelItem> modelItemsOnView)
-        {
-            Fx.Assert(items != null, "items");
-            Fx.Assert(modelItemsOnView != null, "modelItemsOnView");
-
-            for (int index = 0; index < items.Count; ++index)
-            {
-                if (!modelItemsOnView.Contains(items[index]))
-                {
-                    throw FxTrace.Exception.AsError(
-                        new ArgumentException(string.Format(CultureInfo.CurrentCulture, SR.Error_ItemNotOnView, index)));
-                }
-            }
-        }
-
-        [Obsolete("This method does not support dropping multiple items. Use \"public static IEnumerable<object> GetDroppedObjects(DependencyObject dropTarget, DragEventArgs e, EditingContext context)\" instead.")]
-        public static object GetDroppedObject(DependencyObject dropTarget, DragEventArgs e, EditingContext context)
-        {
-            IEnumerable<object> droppedObjects = GetDroppedObjects(dropTarget, e, context);
-            if (droppedObjects.Count() > 0)
-            {
-                return droppedObjects.First();
-            }
-            return null;
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.DoNotCatchGeneralExceptionTypes,
-            Justification = "Any exception can be thrown from custom code. We don't want to crash VS.")]
-        [SuppressMessage("Reliability", "Reliability108",
-            Justification = "Any exception can be thrown from custom code. We don't want to crash VS.")]
-        internal static object GetDroppedObjectInstance(DependencyObject dropTarget, EditingContext context, Type type, IDataObject dataObject)
-        {
-            if (type != null)
-            {
-                //check if type is generic
-                if (type.IsGenericTypeDefinition)
-                {
-                    type = ResolveGenericParameters(dropTarget, context, type);
-                }
-            }
-
-            object droppedObject = null;
-            if (null != type)
-            {
-                try
-                {
-                    droppedObject = Activator.CreateInstance(type);
-
-                    if (type.IsActivityTemplateFactory() && type.IsClass)
-                    {
-                        //find parent WorkflowViewElement - in case of mouse drop, current drop target most likely is ISourceContainer
-                        if (!(dropTarget is WorkflowViewElement))
-                        {
-                            dropTarget = VisualTreeUtils.FindVisualAncestor<WorkflowViewElement>(dropTarget);
-                        }
-
-                        Type templateFactoryInterface2 = type.GetInterface(typeof(IActivityTemplateFactory<>).FullName);
-                        if (templateFactoryInterface2 != null)
-                        {
-                            droppedObject = templateFactoryInterface2.InvokeMember("Create", BindingFlags.InvokeMethod, null, droppedObject, new object[] { dropTarget, dataObject }, CultureInfo.InvariantCulture);
-                        }
-                        else if (droppedObject is IActivityTemplateFactory)
-                        {
-                            droppedObject = ((IActivityTemplateFactory)droppedObject).Create(dropTarget);
-                        }
-
-                    }
-
-                    // SQM: Log activity usage count
-                    ActivityUsageCounter.ReportUsage(context.Services.GetService<IVSSqmService>(), type);
-                }
-                catch (Exception ex)
-                {
-                    if (Fx.IsFatal(ex))
-                    {
-                        throw;
-                    }
-
-                    string details = ex.Message;
-                    if (ex is TargetInvocationException && ex.InnerException != null)
-                    {
-                        details = ex.InnerException.Message;
-                    }
-
-
-                    ErrorReporting.ShowErrorMessage(string.Format(CultureInfo.CurrentUICulture, SR.CannotCreateInstance, TypeNameHelper.GetDisplayName(type, false)), details);
-                }
-            }
-
-            return droppedObject;
-        }
-
-        static Type ResolveGenericParameters(DependencyObject dropTarget, EditingContext context, Type type)
-        {
-            // look to see if there is a DefaultTypeArgumentAttribute on it 
-            DefaultTypeArgumentAttribute typeArgumentAttribute = ExtensibilityAccessor.GetAttribute<DefaultTypeArgumentAttribute>(type);
-            if (typeArgumentAttribute != null && typeArgumentAttribute.Type != null)
-            {
-                type = type.MakeGenericType(typeArgumentAttribute.Type);
-            }
-            else //require user to resolve generic arguments
-            {
-                ActivityTypeResolver wnd = new ActivityTypeResolver();
-                if (null != context)
-                {
-                    WindowHelperService service = context.Services.GetService<WindowHelperService>();
-                    if (null != service)
-                    {
-                        service.TrySetWindowOwner(dropTarget, wnd);
-                    }
-                }
-
-                TypeResolvingOptions dropTargetOptions = null;
-                TypeResolvingOptions activityTypeOptions = null;
-
-                //try to see if the container has any customization for type resolver
-                ICompositeView container = dropTarget as ICompositeView;
-                if (container != null)
-                {
-                    dropTargetOptions = container.DroppingTypeResolvingOptions;
-                }
-
-                //try to see if the activity type in discourse has any customization for type resolver
-                TypeResolvingOptionsAttribute attr = WorkflowViewService.GetAttribute<TypeResolvingOptionsAttribute>(type);
-                if (attr != null)
-                {
-                    activityTypeOptions = attr.TypeResolvingOptions;
-                }
-                //if both have type resolver, try to merge them
-                TypeResolvingOptions options = TypeResolvingOptions.Merge(dropTargetOptions, activityTypeOptions);
-                if (options != null)
-                {
-                    wnd.Options = options;
-                }
-
-                wnd.Context = context;
-                wnd.EditedType = type;
-                wnd.Width = 340;
-                wnd.Height = 200;
-                type = (true == wnd.ShowDialog() ? wnd.ConcreteType : null);
-            }
-            return type;
-        }
-
-        [Obsolete("This method does not support dragging multiple items. Use \"public static IEnumerable<ModelItem> GetDraggedModelItems(DragEventArgs e)\" instead.")]
-        public static ModelItem GetDraggedModelItem(DragEventArgs e)
-        {
-            return GetDraggedModelItemInternal(e);
-        }
-
-        internal static ModelItem GetDraggedModelItemInternal(DragEventArgs e)
-        {
-            IEnumerable<ModelItem> draggedModelItems = GetDraggedModelItems(e);
-            if (draggedModelItems.Count() > 0)
-            {
-                return draggedModelItems.First();
-            }
-            return null;
-        }
-
-        public static IEnumerable<ModelItem> GetDraggedModelItems(DragEventArgs e)
-        {
-            IEnumerable<ModelItem> draggedModelItems = e.Data.GetData(ModelItemsDataFormat) as IEnumerable<ModelItem>;
-            if (draggedModelItems != null)
-            {
-                return draggedModelItems;
-            }
-            else
-            {
-                ModelItem draggedItem = e.Data.GetData(ModelItemDataFormat) as ModelItem;
-                if (draggedItem != null)
-                {
-                    return new ModelItem[] { draggedItem };
-                }
-            }
-            return new ModelItem[] { };
-        }
-
-        internal static bool AreListsIdenticalExceptOrder<T>(IList<T> sourceList, IList<T> destinationList)
-        {
-            // User does not 
-            // 1) introduce unseen object into the collection.
-            // 2) remove object from the collection.
-            // 3) introduce null in the collection.
-            // 4) return null
-            if (sourceList == null)
-            {
-                return destinationList == null;
-            }
-
-            if (destinationList == null)
-            {
-                return false;
-            }
-
-            if (sourceList.Count != destinationList.Count)
-            {
-                return false;
-            }
-            HashSet<T> checkingMap = new HashSet<T>();
-
-            // create set
-            foreach (T item in sourceList)
-            {
-                bool ret = checkingMap.Add(item);
-                // an internal error, the item in src should be identical.
-                Fx.Assert(ret, "item in source list is not identical?");
-            }
-
-            foreach (T item in destinationList)
-            {
-                if (!checkingMap.Remove(item))
-                {
-                    return false;
-                }
-            }
-            return checkingMap.Count == 0;
-        }
-
-        // 1) obj with CompositeView2: sort by IMultipleDragEnabledCompositeView SortSelectedItems.
-        // 2) obj with CompoisteView: no sort.
-        // 3) obj without CompositeView: just put them at the end of the list as the order in selectedObjects.
-        internal static List<object> SortSelectedObjects(IEnumerable<object> selectedObjects)
-        {
-            //1) Separate objects
-            Dictionary<ICompositeView, List<ModelItem>> viewItemListDictionary = new Dictionary<ICompositeView, List<ModelItem>>();
-            List<object> nonCompositeView = new List<object>();
-            List<object> retList = new List<object>();
-            foreach (object obj in selectedObjects)
-            {
-                ModelItem modelItem = obj as ModelItem;
-                if (modelItem == null || modelItem.View == null)
-                {
-                    nonCompositeView.Add(obj);
-                    continue;
-                }
-                ICompositeView container = DragDropHelper
-                    .GetCompositeView(modelItem.View as WorkflowViewElement) as ICompositeView;
-                if (container == null)
-                {
-                    nonCompositeView.Add(obj);
-                    continue;
-                }
-
-                // add to dictionary.
-                if (!viewItemListDictionary.ContainsKey(container))
-                {
-                    viewItemListDictionary.Add(container, new List<ModelItem>());
-                }
-
-                viewItemListDictionary[container].Add(modelItem);
-            }
-
-            // 2) sort when possible
-            foreach (KeyValuePair<ICompositeView, List<ModelItem>> pair in viewItemListDictionary)
-            {
-                IMultipleDragEnabledCompositeView view2 = pair.Key as IMultipleDragEnabledCompositeView;
-                List<ModelItem> sortedList = view2 == null ?
-                    pair.Value : view2.SortSelectedItems(new List<ModelItem>(pair.Value));
-                if (!AreListsIdenticalExceptOrder(pair.Value, sortedList))
-                {
-                    // check consistens.
-                    throw FxTrace.Exception.AsError(
-                        new InvalidOperationException(SR.Error_BadOutputFromSortSelectedItems));
-                }
-                retList.AddRange(sortedList);
-            }
-
-            retList.AddRange(nonCompositeView);
-            return retList;
-        }
-
-        [Obsolete("This method does not support dragging multiple items. Use \"public static UIElement GetCompositeView(WorkflowViewElement workflowViewElement)\" instead.")]
-        public static ICompositeView GetCompositeView(DragEventArgs e)
-        {
-            return (ICompositeView)e.Data.GetData(CompositeViewFormat);
-        }
-
-        public static Point GetDragDropAnchorPoint(DragEventArgs e)
-        {
-            Point referencePoint;
-            if (e.Data.GetDataPresent(DragAnchorPointFormat))
-            {
-                referencePoint = (Point)e.Data.GetData(DragAnchorPointFormat);
-            }
-            else
-            {
-                referencePoint = new Point(-1, -1);
-            }
-            return referencePoint;
-        }
-
-        [Obsolete("This method does not support dragging multiple items. Consider using \"public static void SetDragDropMovedViewElements(DragEventArgs e, IEnumerable<WorkflowViewElement> movedViewElements)\" instead.")]
-        public static void SetDragDropCompletedEffects(DragEventArgs e, DragDropEffects completedEffects)
-        {
-            try
-            {
-                e.Data.SetData(CompletedEffectsFormat, completedEffects);
-            }
-            catch (InvalidOperationException exception)
-            {
-                Trace.WriteLine(exception.ToString());
-            }
-        }
-
-        [Obsolete("This method does not support dragging multiple items. Consider using \"public static IEnumerable<WorkflowViewElement> GetDragDropMovedViewElements(DataObject data)\" instead.")]
-        public static DragDropEffects GetDragDropCompletedEffects(DataObject data)
-        {
-            if (data == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("data");
-            }
-            DragDropEffects completedEffects = DragDropEffects.None;
-            if (data.GetDataPresent(CompletedEffectsFormat))
-            {
-                completedEffects = (DragDropEffects)data.GetData(CompletedEffectsFormat);
-            }
-            return completedEffects;
-        }
-
-        internal static void SetDragDropMovedViewElements(DragEventArgs e, IEnumerable<WorkflowViewElement> movedViewElements)
-        {
-            if (e == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("e");
-            }
-
-            if (movedViewElements == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("movedViewElements");
-            }
-
-            try
-            {
-                e.Data.SetData(MovedViewElementsFormat, movedViewElements);
-            }
-            catch (InvalidOperationException exception)
-            {
-                Trace.WriteLine(exception.ToString());
-            }
-        }
-
-        internal static IEnumerable<WorkflowViewElement> GetDragDropMovedViewElements(DataObject data)
-        {
-            if (data == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("data");
-            }
-
-            if (data.GetDataPresent(MovedViewElementsFormat))
-            {
-                return (IEnumerable<WorkflowViewElement>)data.GetData(MovedViewElementsFormat);
-            }
-            return null;
-        }
-
-        internal static int GetDraggedObjectCount(DragEventArgs e)
-        {
-            return GetDraggedTypes(e.Data).Count;
-        }
-
-        internal static Dictionary<WorkflowViewElement, Point> GetViewElementRelativeLocations(IEnumerable<WorkflowViewElement> viewElements)
-        {
-            DesignerView designerView = null;
-            Dictionary<WorkflowViewElement, Point> locations = new Dictionary<WorkflowViewElement, Point>();
-            Point topLeftPoint = new Point(double.PositiveInfinity, double.PositiveInfinity);
-            foreach (WorkflowViewElement viewElement in viewElements)
-            {
-                if (designerView == null)
-                {
-                    designerView = viewElement.Context.Services.GetService<DesignerView>();
-                }
-
-                Point location = new Point(0, 0);
-                if (designerView.scrollableContent.IsAncestorOf(viewElement))
-                {
-                    GeneralTransform transform = viewElement.TransformToAncestor(designerView.scrollableContent);
-                    location = transform.Transform(new Point(0, 0));
-                }
-
-                if (location.X < topLeftPoint.X)
-                {
-                    topLeftPoint.X = location.X;
-                }
-
-                if (location.Y < topLeftPoint.Y)
-                {
-                    topLeftPoint.Y = location.Y;
-                }
-
-                locations.Add(viewElement, location);
-            }
-
-            foreach (WorkflowViewElement viewElement in viewElements)
-            {
-                locations[viewElement] = Vector.Add(new Vector(-topLeftPoint.X, -topLeftPoint.Y), locations[viewElement]);
-            }
-            return locations;
-        }
-
-        internal static Dictionary<WorkflowViewElement, Point> GetDraggedViewElementRelativeLocations(DragEventArgs e)
-        {
-            List<WorkflowViewElement> draggedViewElements = new List<WorkflowViewElement>();
-            if (e.Data.GetDataPresent(ModelItemsDataFormat))
-            {
-                IEnumerable<ModelItem> draggedModelItems = e.Data.GetData(ModelItemsDataFormat) as IEnumerable<ModelItem>;
-                if (draggedModelItems != null)
-                {
-                    foreach (ModelItem draggedModelItem in draggedModelItems)
-                    {
-                        if (draggedModelItem != null && draggedModelItem.View != null)
-                        {
-                            draggedViewElements.Add((WorkflowViewElement)draggedModelItem.View);
-                        }
-                    }
-                }
-            }
-            else if (e.Data.GetDataPresent(ModelItemDataFormat))
-            {
-                ModelItem draggedModelItem = e.Data.GetData(ModelItemDataFormat) as ModelItem;
-                if (draggedModelItem != null && draggedModelItem.View != null)
-                {
-                    draggedViewElements.Add((WorkflowViewElement)draggedModelItem.View);
-                }
-            }
-            return GetViewElementRelativeLocations(draggedViewElements);
-        }
-
-        // Get rid of descendant model items when both ancestor and descendant and ancestor model items are selected
-        internal static IEnumerable<ModelItem> GetModelItemsToDrag(IEnumerable<ModelItem> modelItems)
-        {
-            HashSet<ModelItem> modelItemsToDrag = new HashSet<ModelItem>();
-            foreach (ModelItem modelItem in modelItems)
-            {
-                HashSet<ModelItem> parentModelItems = CutCopyPasteHelper.GetSelectableParentModelItems(modelItem);
-                parentModelItems.IntersectWith(modelItems);
-                if (parentModelItems.Count == 0)
-                {
-                    modelItemsToDrag.Add(modelItem);
-                }
-            }
-            return modelItemsToDrag;
-        }
-
-
-        internal sealed class ViewElementDragShadow : Adorner
-        {
-            Rectangle content;
-            double x;
-            double y;
-            double offsetX;
-            double offsetY;
-            double scaleFactor;
-            double width;
-            double height;
-            AdornerLayer layer;
-
-            public ViewElementDragShadow(UIElement owner, WorkflowViewElement viewElement, Point offset, double scaleFactor)
-                : base(owner)
-            {
-                Rect bounds = VisualTreeHelper.GetDescendantBounds(viewElement);
-                this.width = bounds.Width;
-                this.height = bounds.Height;
-
-                this.content = new Rectangle()
-                {
-                    Width = this.width,
-                    Height = this.height,
-                    Fill = new VisualBrush(viewElement)
-                    {
-                        Opacity = 0.6
-                    }
-                };
-                this.InitializeCommon(offset, scaleFactor);
-            }
-
-            public ViewElementDragShadow(UIElement owner, IEnumerable<WorkflowViewElement> viewElements, Point offset, double scaleFactor)
-                : base(owner)
-            {
-                Dictionary<WorkflowViewElement, Point> locations = DragDropHelper.GetViewElementRelativeLocations(viewElements);
-
-                Grid grid = new Grid();
-                foreach (WorkflowViewElement viewElement in viewElements)
-                {
-                    Rect bounds = VisualTreeHelper.GetDescendantBounds(viewElement);
-                    Rectangle rectangle = new Rectangle()
-                    {
-                        Width = bounds.Width,
-                        Height = bounds.Height,
-                        Fill = new VisualBrush(viewElement),
-                        Margin = new Thickness(locations[viewElement].X, locations[viewElement].Y, 0, 0),
-                        VerticalAlignment = VerticalAlignment.Top,
-                        HorizontalAlignment = HorizontalAlignment.Left
-                    };
-                    grid.Children.Add(rectangle);
-                }
-                grid.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
-                this.width = grid.DesiredSize.Width;
-                this.height = grid.DesiredSize.Height;
-
-                this.content = new Rectangle()
-                {
-                    Width = this.width,
-                    Height = this.height,
-                    Fill = new VisualBrush(grid)
-                    {
-                        Opacity = 0.6
-                    }
-                };
-                this.InitializeCommon(offset, scaleFactor);
-            }
-
-            internal void UpdatePosition(double x, double y)
-            {
-                if (this.Visibility == Visibility.Hidden)
-                {
-                    this.Visibility = Visibility.Visible;
-                }
-                double oldX = this.x;
-                double oldY = this.y;
-                this.x = x - this.offsetX;
-                this.y = y - this.offsetY;
-                if (oldX != this.x || oldY != this.y)
-                {
-                    this.layer = this.Parent as AdornerLayer;
-                    this.layer.Update(this.AdornedElement);
-                }
-            }
-
-            public override GeneralTransform GetDesiredTransform(GeneralTransform transform)
-            {
-                GeneralTransformGroup result = new GeneralTransformGroup();
-                result.Children.Add(new TranslateTransform(this.x, this.y));
-                result.Children.Add(new ScaleTransform(this.scaleFactor, this.scaleFactor, this.x, this.y));
-                return result;
-            }
-
-            protected override Visual GetVisualChild(int index)
-            {
-                return this.content;
-            }
-
-            protected override int VisualChildrenCount
-            {
-                get { return 1; }
-            }
-
-            protected override Size ArrangeOverride(Size finalSize)
-            {
-                this.content.Arrange(new Rect(this.content.DesiredSize));
-                System.Diagnostics.Debug.WriteLine("DragShadow.ArrangeOverride " + this.content.DesiredSize);
-                return this.content.DesiredSize;
-            }
-
-            protected override Size MeasureOverride(Size constraint)
-            {
-                this.content.Measure(constraint);
-                System.Diagnostics.Debug.WriteLine("DragShadow.MeasureOverride " + this.content.DesiredSize);
-                return this.content.DesiredSize;
-            }
-
-            private void InitializeCommon(Point offset, double scaleFactor)
-            {
-                this.offsetX = offset.X * scaleFactor;
-                this.offsetY = offset.Y * scaleFactor;
-                this.Visibility = Visibility.Hidden;
-                this.scaleFactor = scaleFactor;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DropAnimation.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DropAnimation.xaml.cs
deleted file mode 100644 (file)
index a126bbc..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Windows.Media.Animation;
-
-    internal partial class DropAnimation : DoubleAnimationUsingKeyFrames
-    {
-        internal DropAnimation()
-        {
-            InitializeComponent();
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DynamicActivityPropertyUtilities.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/DynamicActivityPropertyUtilities.cs
deleted file mode 100644 (file)
index 133a9c1..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Model;
-
-    internal static class DynamicActivityPropertyUtilities
-    {
-        public static DynamicActivityProperty Find(ModelItemCollection properties, string propertyName)
-        {
-            foreach (ModelItem entry in properties)
-            {
-                DynamicActivityProperty property = (DynamicActivityProperty)entry.GetCurrentValue();
-
-                if (StringComparer.Ordinal.Equals(property.Name, propertyName))
-                {
-                    return property;
-                }
-            }
-
-            return null;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/EditingContextUtilities.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/EditingContextUtilities.cs
deleted file mode 100644 (file)
index e32d311..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.View;
-    using System.Runtime;
-
-    internal static class EditingContextUtilities
-    {
-        public static bool IsReadOnly(EditingContext editingContext)
-        {
-            Fx.Assert(editingContext != null, "editingContext should not be null");
-
-            return editingContext.Items.GetValue<ReadOnlyState>().IsReadOnly;
-        }
-
-        public static ModelItem GetSingleSelectedModelItem(EditingContext editingContext)
-        {
-            Fx.Assert(editingContext != null, "editingContext should not be null");
-
-            Selection selection = editingContext.Items.GetValue<Selection>();
-            if (selection.SelectionCount == 1)
-            {
-                return selection.PrimarySelection;
-            }
-            else
-            {
-                return null;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/EditingScopeUndoUnit.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/EditingScopeUndoUnit.cs
deleted file mode 100644 (file)
index 4873f75..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Model;
-    using System.Runtime;
-
-    internal class EditingScopeUndoUnit : UndoUnit
-    {
-        private ModelTreeManager modelTreeManager;
-        private EditingScope editingScope;
-        private EditingContext context;
-
-        public EditingScopeUndoUnit(EditingContext context, ModelTreeManager modelTreeManager, EditingScope editingScope)
-            : base(context)
-        {
-            Fx.Assert(context != null, "context cannot be null");
-            Fx.Assert(modelTreeManager != null, "modelTreeManager cannot be null");
-            Fx.Assert(editingScope != null, "editingScope cannot be null");
-
-            this.context = context;
-            this.modelTreeManager = modelTreeManager;
-            this.editingScope = editingScope;
-            this.Description = this.editingScope.Description;
-
-            SaveGlobalState();
-        }
-
-        public override void Redo()
-        {
-            this.modelTreeManager.StopTracking();
-            try
-            {
-                EditingScope redoEditingScope = this.modelTreeManager.CreateEditingScope(this.editingScope.Description);
-                redoEditingScope.Changes.AddRange(editingScope.Changes);
-                redoEditingScope.Complete();
-            }
-            finally
-            {
-                this.modelTreeManager.StartTracking();
-            }
-            ApplyGlobalState();
-        }
-
-        public override void Undo()
-        {
-            this.modelTreeManager.StopTracking();
-            try
-            {
-                EditingScope undoEditingScope = this.modelTreeManager.CreateEditingScope(this.editingScope.Description);
-                foreach (Change change in editingScope.Changes)
-                {
-                    Change inverseChange = change.GetInverse();
-                    if (inverseChange != null)
-                    {
-                        undoEditingScope.Changes.Add(inverseChange);
-                    }
-                }
-                undoEditingScope.Changes.Reverse();
-                undoEditingScope.Complete();
-            }
-            finally
-            {
-                this.modelTreeManager.StartTracking();
-            }
-            ApplyGlobalState();
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/EditorOptionAttribute.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/EditorOptionAttribute.cs
deleted file mode 100644 (file)
index cee86e0..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.PropertyEditing
-{
-    using System.Runtime;
-    using System.Collections;
-
-    [Fx.Tag.XamlVisible(false)]
-    [AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
-    public sealed class EditorOptionAttribute : Attribute
-    {
-        public string Name { get; set; }
-        public object Value { get; set; }
-        //TypeId is needed so that multiple EditorOptionsAttribute could be added to the same property
-        public override object TypeId
-        {
-            get
-            {
-                return new EditorOptionsAttributeTypeId
-                {
-                    BaseTypeId = base.TypeId,
-                    Name = this.Name,
-                    Value = this.Value
-                };
-            }
-        }
-
-        public static bool TryGetOptionValue(IEnumerable attributes, string optionName, out object optionValue)
-        {            
-            foreach (Attribute attribute in attributes)
-            {
-                EditorOptionAttribute optionAttribute = attribute as EditorOptionAttribute;
-                if (optionAttribute != null && optionAttribute.Name.Equals(optionName))
-                {
-                    optionValue = optionAttribute.Value;
-                    return true;
-                }
-            }
-            optionValue = null;
-            return false;
-        }
-
-        //A class to uniquely identify a name-value pair
-        class EditorOptionsAttributeTypeId
-        {
-            public object BaseTypeId { get; set; }
-            public string Name { get; set; }
-            public object Value { get; set; }
-
-            public override bool Equals(object obj)
-            {
-                EditorOptionsAttributeTypeId that = obj as EditorOptionsAttributeTypeId;
-                if (that == null) return false;
-                return this.BaseTypeId == that.BaseTypeId &&
-                    string.Equals(this.Name, that.Name) &&
-                    object.Equals(this.Value, that.Value);
-            }
-
-            public override int GetHashCode()
-            {
-                return
-                    (BaseTypeId == null ? 0 : BaseTypeId.GetHashCode()) ^
-                    (Name == null ? 0 : Name.GetHashCode()) ^
-                    (Value == null ? 0 : Value.GetHashCode());
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ErrorActivity.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ErrorActivity.cs
deleted file mode 100644 (file)
index 7ddf876..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Activities;
-    using System.Activities.Presentation.View;
-    using System.ComponentModel;
-    using System.Runtime;
-    using System.Xaml;
-    using XamlDeferLoad = System.Windows.Markup.XamlDeferLoadAttribute;
-
-    [Designer(typeof(ErrorActivity.ErrorActivityView))]
-    internal class ErrorActivity : Activity
-    {
-        static readonly AttachableMemberIdentifier HasErrorActivitiesProperty =
-            new AttachableMemberIdentifier(typeof(ErrorActivity), "HasErrorActivities");
-        internal const string ErrorNodesProperty = "ErrorNodes";
-
-        [Browsable(false)]
-        [XamlDeferLoad(typeof(NodeListLoader), typeof(object))]
-        public XamlNodeList ErrorNodes { get; set; }
-
-        internal static bool GetHasErrorActivities(object target)
-        {
-            object result;
-            if (AttachablePropertyServices.TryGetProperty(target, HasErrorActivitiesProperty, out result))
-            {
-                return (bool)result;
-            }
-            return false;
-        }
-
-        internal static void SetHasErrorActivities(object target, bool value)
-        {
-            AttachablePropertyServices.SetProperty(target, HasErrorActivitiesProperty, value);
-        }
-
-        internal static void WriteNodeList(XamlWriter writer, XamlNodeList nodeList)
-        {
-            // We need to pass the ErrorNodes contents through as a NodeList, because XOW doesn't
-            // currently support unknown types, even inside a DeferLoad block.
-            // But if a NodeList is written to XOW as a Value, XOW will unpack, forcing us to re-buffer
-            // the nodes in our deferring loader. So we wrap the NodeList value inside a dummy StartObject.
-            writer.WriteStartObject(XamlLanguage.Object);
-            writer.WriteStartMember(XamlLanguage.Initialization);
-            writer.WriteValue(nodeList);
-            writer.WriteEndMember();
-            writer.WriteEndObject();
-        }
-
-        internal class NodeListLoader : XamlDeferringLoader
-        {
-            public override object Load(XamlReader xamlReader, IServiceProvider serviceProvider)
-            {
-                // Expects a nodestream produced by WriteNodesList
-                xamlReader.Read();
-                xamlReader.Read();
-                xamlReader.Read();
-                Fx.Assert(xamlReader.NodeType == XamlNodeType.Value, "Expected Value node");
-                return (XamlNodeList)xamlReader.Value;
-            }
-
-            public override XamlReader Save(object value, IServiceProvider serviceProvider)
-            {
-                return ((XamlNodeList)value).GetReader();
-            }
-        }
-
-        internal class ErrorActivityView : WorkflowViewElement
-        {
-            public ErrorActivityView()
-            {
-                WorkflowViewService.ShowErrorInViewElement(this, SR.ActivityLoadError, null);
-            }
-        }
-    }
-
-    [Designer(typeof(ErrorActivity.ErrorActivityView))]
-    internal class ErrorActivity<T> : Activity<T>
-    {
-        [Browsable(false)]
-        [XamlDeferLoad(typeof(ErrorActivity.NodeListLoader), typeof(object))]
-        public XamlNodeList ErrorNodes { get; set; }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ErrorItem.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ErrorItem.cs
deleted file mode 100644 (file)
index 8bfcd8d..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    class ErrorItem : ContextItem
-    {
-        public string Message
-        { get; set; }
-
-        public string Details
-        { get; set; }
-
-        public override Type ItemType
-        {
-            get
-            {
-                return typeof(ErrorItem);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ErrorReporting.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ErrorReporting.cs
deleted file mode 100644 (file)
index b6af118..0000000
+++ /dev/null
@@ -1,229 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Activities.Presentation.View;
-    using System.Diagnostics;
-    using System.Runtime;
-    using System.Text;
-    using System.Threading;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Input;
-    using System.Globalization;
-    using System.Diagnostics.CodeAnalysis;
-
-    [Fx.Tag.XamlVisible(false)]
-    internal static class ErrorReporting
-    {
-        private static WeakReference activeDesignerViewReference;
-
-        internal static DesignerView ActiveDesignerView
-        {
-            get
-            {
-                if (activeDesignerViewReference != null)
-                {
-                    return activeDesignerViewReference.Target as DesignerView;
-                }
-
-                return null;
-            }
-            set
-            {
-                if (value == null)
-                {
-                    activeDesignerViewReference = null;
-                }
-                else
-                {
-                    activeDesignerViewReference = new WeakReference(value);
-                }
-            }
-        }
-
-        public static void ShowErrorMessage(string message)
-        {
-            ShowErrorMessage(message, false);
-        }
-
-        public static void ShowAlertMessage(string message)
-        {
-            ShowAlertMessage(message, false);
-        }
-
-        public static void ShowErrorMessage(string message, string details)
-        {
-            if (string.IsNullOrEmpty(details))
-            {
-                ShowErrorMessage(message);
-            }
-            else
-            {
-                ShowErrorMessage(string.Format(CultureInfo.CurrentUICulture, "{0}\n\n\"{1}\"", message, details));
-            }
-        }
-
-        public static void ShowErrorMessage(string message, bool includeStackTrace)
-        {
-            string stackTrace = null;
-            if (includeStackTrace)
-            {
-                //generate stack trace
-                stackTrace = new StackTrace().ToString();
-                //remove top frame from the trace (which is a call to ShowErrorMessage)
-                stackTrace = stackTrace.Remove(0, stackTrace.IndexOf(Environment.NewLine, StringComparison.Ordinal) + 1);
-            }
-            ShowMessageBox(message, MessageBoxImage.Error, stackTrace);
-        }
-
-        public static void ShowAlertMessage(string message, bool includeStackTrace)
-        {
-            string stackTrace = null;
-            if (includeStackTrace)
-            {
-                //generate stack trace
-                stackTrace = new StackTrace().ToString();
-                //remove top frame from the trace (which is a call to ShowAlertMessage)
-                stackTrace = stackTrace.Remove(0, stackTrace.IndexOf(Environment.NewLine, StringComparison.Ordinal) + 1);
-            }
-            ShowMessageBox(message, MessageBoxImage.Warning, stackTrace);
-        }
-
-        public static void ShowErrorMessage(Exception err)
-        {
-            if (null != err)
-            {
-                ShowMessageBox(string.Format(CultureInfo.InvariantCulture, "{0}:\r\n{1}", err.GetType().Name, err.Message), MessageBoxImage.Error, err.StackTrace);
-            }
-        }
-
-        static void ShowMessageBox(string message, MessageBoxImage icon, string stackTrace)
-        {
-            //determine an icon
-            string iconName = icon == MessageBoxImage.Error ? "TextBoxErrorIcon" :
-                icon == MessageBoxImage.Warning ? "WarningValidationIcon" : string.Empty;
-
-            //set properties
-            var dlg = new ErrorDialog()
-            {
-                ErrorDescription = message ?? "<null>",
-                Icon = EditorResources.GetIcons()[iconName],
-                StackTrace = stackTrace,
-                StackTraceVisibility = string.IsNullOrEmpty(stackTrace) ? Visibility.Collapsed : Visibility.Visible,
-                Context = null != ActiveDesignerView ? ActiveDesignerView.Context : null,
-                Owner = ActiveDesignerView,
-            };
-            //show error window
-            dlg.Show();
-        }
-
-        sealed class ErrorDialog : WorkflowElementDialog
-        {
-            public string ErrorDescription { get; set; }
-
-            public Visibility StackTraceVisibility { get; set; }
-
-            public string StackTrace { get; set; }
-
-            [SuppressMessage(FxCop.Category.Performance, FxCop.Rule.AvoidUncalledPrivateCode,
-                Justification = "This property is accessed by XAML")]
-            public object Icon { get; set; }
-
-            protected override void OnInitialized(EventArgs e)
-            {
-                this.Title = SR.WorkflowDesignerErrorPresenterTitle;
-                this.Content = new ContentPresenter()
-                {
-                    ContentTemplate = (DataTemplate)EditorResources.GetResources()["ErrorPresenterDialogTemplate"],
-                    Content = this,
-                };
-                this.MinWidth = 365;
-                this.WindowResizeMode = ResizeMode.NoResize;
-                this.WindowSizeToContent = SizeToContent.WidthAndHeight;
-                //handle loaded event
-                this.Loaded += this.OnDialogWindowLoaded;
-                base.OnInitialized(e);
-            }
-
-            void OnDialogWindowLoaded(object s, RoutedEventArgs e)
-            {
-                //get the containing window
-                var parentWindow = VisualTreeUtils.FindVisualAncestor<Window>(this);
-                //and handle KeyDown event - in case of Esc, we should close the dialog
-                parentWindow.KeyDown += OnWindowKeyDown;
-
-                //add Copy command support - when user presses Ctrl+C, copy content of the error into clipboard
-                var copyBinding = new CommandBinding(ApplicationCommands.Copy);
-                copyBinding.PreviewCanExecute += OnCopyCanExecute;
-                copyBinding.Executed += OnCopyExecuted;
-                parentWindow.CommandBindings.Add(copyBinding);
-            }
-
-            void OnWindowKeyDown(object s, KeyEventArgs e)
-            {
-                //Esc - close the dialog box
-                if (e.Key == Key.Escape)
-                {
-                    ((Window)s).DialogResult = false;
-                    e.Handled = true;
-                }
-            }
-
-            void OnCopyCanExecute(object s, CanExecuteRoutedEventArgs e)
-            {
-                //do not allow text boxes to handle the ApplicationCommand.Copy, i will handle it myself
-                e.CanExecute = true;
-                e.ContinueRouting = false;
-                e.Handled = true;
-            }
-
-            void OnCopyExecuted(object s, ExecutedRoutedEventArgs e)
-            {
-                //build a string with detailed error description
-                StringBuilder error = new StringBuilder();
-                error.Append('-', 25);
-                error.Append(Environment.NewLine);
-                error.Append(this.Title);
-                error.Append(Environment.NewLine);
-                error.Append('-', 25);
-                error.Append(Environment.NewLine);
-                error.Append(this.ErrorDescription);
-                error.Append(Environment.NewLine);
-                if (this.StackTraceVisibility == Visibility.Visible)
-                {
-                    error.Append('-', 25);
-                    error.Append(Environment.NewLine);
-                    error.Append(this.StackTrace);
-                    error.Append(Environment.NewLine);
-                }
-                error.Append('-', 25);
-                error.Append(Environment.NewLine);
-                string result = error.ToString();
-
-                //attempt to set the value into clipboard - according to MSDN - if a call fails, it means some other process is accessing clipboard
-                //so sleep and retry
-                for (int i = 0; i < 10; ++i)
-                {
-                    try
-                    {
-                        Clipboard.SetText(result);
-                        break;
-                    }
-                    catch (Exception err)
-                    {
-                        if (Fx.IsFatal(err))
-                        {
-                            throw;
-                        }
-                        Thread.Sleep(50);
-                    }
-                }
-                e.Handled = true;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ExpandButtonVisibilityConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ExpandButtonVisibilityConverter.cs
deleted file mode 100644 (file)
index f10a4e7..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Windows.Data;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using System.Windows;
-    using System.Activities.Presentation.View;
-    using System.Runtime;
-
-    internal class ExpandButtonVisibilityConverter : IMultiValueConverter
-    {
-
-        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-        {
-            bool isRootDesigner = true;
-            if (values[0] is bool)
-            {
-                isRootDesigner = (bool)values[0];
-            }
-            ModelItem modelItem = values[1] as ModelItem;
-            WorkflowViewElement viewElement = values[2] as WorkflowViewElement;
-            Fx.Assert(viewElement != null, "TemplatedParent should be of type WorkflowViewElement");
-            return GetExpandCollapseButtonVisibility(viewElement);
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-
-        public static Visibility GetExpandCollapseButtonVisibility(WorkflowViewElement viewElement)
-        {
-            ActivityDesigner designer = viewElement as ActivityDesigner;
-            bool hasDelegates = (designer != null) && designer.HasActivityDelegates;
-
-            Visibility visibility = Visibility.Visible;
-            if (viewElement == null || viewElement.IsRootDesigner || viewElement.DoesParentAlwaysExpandChild() ||
-                viewElement.DoesParentAlwaysCollapseChildren() || (viewElement.Content == null && !hasDelegates) ||
-                !viewElement.Collapsible || !(viewElement is ActivityDesigner))
-            {
-                visibility = Visibility.Collapsed;
-            }
-            return visibility;
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ExpandCollapseIsCheckedConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ExpandCollapseIsCheckedConverter.cs
deleted file mode 100644 (file)
index 01c1907..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Windows.Data;
-    using System.Windows;
-    class ExpandCollapseIsCheckedConverter : IMultiValueConverter
-    {
-        public object Convert(object[] values, Type targetType, object parameter, global::System.Globalization.CultureInfo culture)
-        {
-            bool expandState = (bool)values[0];
-            bool pinState = (bool)values[1];
-            bool showExpanded = false;
-            if (values[2] != DependencyProperty.UnsetValue)
-            {
-                showExpanded = (bool)values[2];
-            }
-           
-            return showExpanded;
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, global::System.Globalization.CultureInfo culture)
-        {
-            //Return ExpandState and PinState.
-            return new object[] { value, true };
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ExpressionHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ExpressionHelper.cs
deleted file mode 100644 (file)
index 1362d9a..0000000
+++ /dev/null
@@ -1,234 +0,0 @@
-using System;
-using System.Activities.Expressions;
-using System.Activities.Presentation.Expressions;
-using System.Activities.Presentation.Internal.PropertyEditing;
-using System.Activities.Presentation.Model;
-using System.Activities.Presentation.View;
-using System.Activities.XamlIntegration;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics.CodeAnalysis;
-using System.Globalization;
-using System.Linq;
-using System.Reflection;
-using System.Runtime;
-using System.Runtime.Versioning;
-using System.Text;
-using Microsoft.Activities.Presentation;
-using Microsoft.VisualBasic.Activities;
-
-namespace System.Activities.Presentation
-{
-    internal static class ExpressionHelper
-    {
-        internal static string GetExpressionString(Activity expression)
-        {
-            return ExpressionHelper.GetExpressionString(expression, null as ParserContext);
-        }
-
-        internal static string GetExpressionString(Activity expression, ModelItem owner)
-        {
-            ParserContext context = new ParserContext(owner);
-            return ExpressionHelper.GetExpressionString(expression, context);
-        }
-
-        internal static string GetExpressionString(Activity expression, ParserContext context)
-        {
-            string expressionString = null;            
-            if (expression != null)
-            {
-                Type expressionType = expression.GetType();
-                Type expressionArgumentType = expressionType.IsGenericType ? expressionType.GetGenericArguments()[0] : typeof(object);
-                bool isLiteral = expressionType.IsGenericType ? Type.Equals(typeof(Literal<>), expressionType.GetGenericTypeDefinition()) : false;
-
-                //handle ITextExpression
-                if (expression is ITextExpression)
-                {
-                    ITextExpression textExpression = expression as ITextExpression;
-                    expressionString = textExpression.ExpressionText;
-                }
-                //handle Literal Expression
-                else if (isLiteral)
-                {
-                    TypeConverter converter = XamlUtilities.GetConverter(expressionArgumentType);
-                    if (converter != null && converter.CanConvertTo(context, typeof(string)))
-                    {
-                        PropertyInfo literalValueProperty = expressionType.GetProperty("Value");
-                        Fx.Assert(literalValueProperty != null && literalValueProperty.GetGetMethod() != null, "Literal<T> must have the Value property with a public get accessor.");
-                        object literalValue = literalValueProperty.GetValue(expression, null);
-                        string convertedString = null;
-                        if (literalValue != null)
-                        {
-                            try
-                            {
-                                convertedString = converter.ConvertToString(context, literalValue);
-                            }
-                            catch (ArgumentException)
-                            {
-                                convertedString = literalValue.ToString();
-                            }
-                        }
-                        expressionString = expressionArgumentType == typeof(string) ? ("\"" + convertedString + "\"") : convertedString;
-                    }
-                }
-                else if (expressionType.IsGenericType &&
-                (expressionType.GetGenericTypeDefinition() == typeof(VariableValue<>) ||
-                expressionType.GetGenericTypeDefinition() == typeof(VariableReference<>)))
-                {
-                    PropertyInfo variableProperty = expression.GetType().GetProperty("Variable");
-                    Variable variable = variableProperty.GetValue(expression, null) as Variable;
-                    if (variable != null)
-                    {
-                        expressionString = variable.Name;
-                    }
-                }
-            }
-
-            return expressionString;
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
-    Justification = "The conversion to an expression might fail due to invalid user input. Propagating exceptions might lead to VS crash.")]
-        [SuppressMessage("Reliability", "Reliability108:IsFatalRule",
-            Justification = "The conversion to an expression might fail due to invalid user input. Propagating exceptions might lead to VS crash.")]
-        internal static ActivityWithResult TryCreateLiteral(Type type, string expressionText, ParserContext context)
-        {
-            //try easy way first - look if there is a type conversion which supports conversion between expression type and string
-            TypeConverter literalValueConverter = null;
-            bool isQuotedString = false;
-            if (CanTypeBeSerializedAsLiteral(type))
-            {
-                bool shouldBeQuoted = typeof(string) == type;
-
-                //whether string begins and ends with quotes '"'. also, if there are
-                //more quotes within than those begining and ending ones, do not bother with literal - assume this is an expression.
-                isQuotedString = shouldBeQuoted &&
-                        expressionText.StartsWith("\"", StringComparison.CurrentCulture) &&
-                        expressionText.EndsWith("\"", StringComparison.CurrentCulture) &&
-                        expressionText.IndexOf("\"", 1, StringComparison.CurrentCulture) == expressionText.Length - 1;
-
-                //if expression is a string, we must ensure it is quoted, in case of other types - just get the converter
-                if ((shouldBeQuoted && isQuotedString) || !shouldBeQuoted)
-                {
-                    literalValueConverter = TypeDescriptor.GetConverter(type);
-                }
-            }
-
-            //if there is converter - try to convert
-            if (null != literalValueConverter && literalValueConverter.CanConvertFrom(context, typeof(string)))
-            {
-                try
-                {
-                    var valueToConvert = isQuotedString ? expressionText.Substring(1, expressionText.Length - 2) : expressionText;
-                    var converterValue = literalValueConverter.ConvertFrom(context, CultureInfo.CurrentCulture, valueToConvert);
-                    //ok, succeeded - create literal of given type
-                    var concreteExpType = typeof(Literal<>).MakeGenericType(type);
-                    return (ActivityWithResult)Activator.CreateInstance(concreteExpType, converterValue);
-                }
-                //conversion failed - do nothing, let VB compiler take care of the expression
-                catch { }
-            }
-
-            return null;
-        }
-
-        internal static bool CanTypeBeSerializedAsLiteral(Type type)
-        {
-            //type must be set and cannot be object
-            if (null == type || typeof(object) == type)
-            {
-                return false;
-            }
-
-            return type.IsPrimitive || type == typeof(string) || type == typeof(TimeSpan) || type == typeof(DateTime);
-        }
-
-        // Test whether this activity is Expression
-        internal static bool IsExpression(this Activity activity)
-        {
-            return activity is ActivityWithResult;
-        }
-
-        internal static bool IsGenericLocationExpressionType(ActivityWithResult expression)
-        {
-            Type expressionType = expression.ResultType;
-            return expressionType.IsGenericType && typeof(Location<>) == expressionType.GetGenericTypeDefinition();
-        }
-
-        internal static bool TryMorphExpression(ActivityWithResult originalExpression, bool isLocation, Type targetType, 
-            EditingContext context, out ActivityWithResult morphedExpression)
-        {
-            bool succeeded = false;            
-            morphedExpression = null;
-            if (originalExpression != null)
-            {
-                Type resultType = originalExpression.ResultType;
-                if ((isLocation) && (ExpressionHelper.IsGenericLocationExpressionType(originalExpression) && (targetType == resultType.GetGenericArguments()[0])) ||
-                    (!isLocation) && (resultType == targetType))
-                {
-                    //no need to morph
-                    succeeded = true;
-                    morphedExpression = originalExpression;
-                }
-                else
-                {
-                    Type expressionType = originalExpression.GetType();
-                    if (expressionType.IsGenericType)
-                    {
-                        expressionType = expressionType.GetGenericTypeDefinition();
-                    }
-
-                    ExpressionMorphHelperAttribute morphHelperAttribute = ExtensibilityAccessor.GetAttribute<ExpressionMorphHelperAttribute>(expressionType);
-                    if (morphHelperAttribute != null)
-                    {
-                        ExpressionMorphHelper morphHelper = Activator.CreateInstance(morphHelperAttribute.ExpressionMorphHelperType) as ExpressionMorphHelper;
-                        if (morphHelper != null)
-                        {
-                            succeeded = morphHelper.TryMorphExpression(originalExpression, isLocation, targetType, context, out morphedExpression);
-                            if (succeeded && morphedExpression != null)
-                            {
-                                string editorName = ExpressionActivityEditor.GetExpressionActivityEditor(originalExpression);
-                                if (!string.IsNullOrWhiteSpace(editorName))
-                                {
-                                    ExpressionActivityEditor.SetExpressionActivityEditor(morphedExpression, editorName);
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-            else
-            {
-                succeeded = true;
-            }
-            return succeeded;
-        }
-
-        // this method may has side effect, it may modify model.
-        internal static bool TryInferReturnType(ActivityWithResult expression, EditingContext context, out Type returnType)
-        {
-            bool succeeded = false;
-            returnType = null;
-            Type expressionType = expression.GetType();
-            if (expressionType.IsGenericType)
-            {
-                expressionType = expressionType.GetGenericTypeDefinition();
-                ExpressionMorphHelperAttribute morphHelperAttribute = ExtensibilityAccessor.GetAttribute<ExpressionMorphHelperAttribute>(expressionType);
-                if (morphHelperAttribute != null)
-                {
-                    ExpressionMorphHelper morphHelper = Activator.CreateInstance(morphHelperAttribute.ExpressionMorphHelperType) as ExpressionMorphHelper;
-                    if (morphHelper != null)
-                    {
-                        succeeded = morphHelper.TryInferReturnType(expression, context, out returnType);
-                    }
-                }
-            }
-            return succeeded;   
-        }
-
-        internal static string GetRootEditorSetting(ModelTreeManager modelTreeManager, FrameworkName targetFramework)
-        {
-            return ExpressionSettingHelper.GetRootEditorSetting(modelTreeManager, targetFramework);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ExpressionSelection.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ExpressionSelection.cs
deleted file mode 100644 (file)
index 99b81a8..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Model;
-
-    class ExpressionSelection : ContextItem
-    {
-
-        ModelItem modelItem;
-
-        public ExpressionSelection()
-        {
-        }
-
-        public ExpressionSelection(ModelItem modelItem)        
-        {
-            this.modelItem = modelItem;
-        }
-
-        public ModelItem ModelItem
-        {
-            get { return this.modelItem; }
-        }
-
-        public override Type ItemType
-        {
-            get
-            {
-                return typeof(ExpressionSelection);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Expressions/CreateExpressionFromString.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Expressions/CreateExpressionFromString.cs
deleted file mode 100644 (file)
index f335f55..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation.Expressions
-{
-    /// <summary>
-    /// This is the delegate supplied by custom expression editor to create expression activity from string text 
-    /// </summary>
-    /// <param name="expressionText">String text used to create the expression</param>
-    /// <param name="useLocationExpression">Should create location expression or not</param>
-    /// <param name="expressionType">Return type of the expression</param>
-    /// <returns>the created expression activity</returns>
-    public delegate ActivityWithResult CreateExpressionFromStringCallback(string expressionText, bool useLocationExpression, Type expressionType);
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Expressions/ExpressionActivityEditor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Expressions/ExpressionActivityEditor.cs
deleted file mode 100644 (file)
index 2464414..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.Expressions
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Text;
-    using System.Windows.Controls;
-    using System.Activities.Presentation.Model;
-    using System.Windows;
-    using System.Runtime;
-    using System.Windows.Automation.Peers;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Xaml;
-    using System.Globalization;
-
-    public abstract class ExpressionActivityEditor : UserControl
-    {
-        public static readonly DependencyProperty HintTextProperty = DependencyProperty.Register("HintText", typeof(string), typeof(ExpressionActivityEditor));
-
-        public static readonly DependencyProperty ExpressionProperty = DependencyProperty.Register("Expression", typeof(ModelItem), typeof(ExpressionActivityEditor),
-                new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
-
-        public static readonly DependencyProperty ExpressionTypeProperty = DependencyProperty.Register("ExpressionType", typeof(Type), typeof(ExpressionActivityEditor),
-                new FrameworkPropertyMetadata(null));
-
-        public static readonly DependencyProperty OwnerActivityProperty = DependencyProperty.Register("OwnerActivity", typeof(ModelItem), typeof(ExpressionActivityEditor),
-                new FrameworkPropertyMetadata(null));
-
-        public static readonly DependencyProperty UseLocationExpressionProperty = DependencyProperty.Register("UseLocationExpression", typeof(bool), typeof(ExpressionActivityEditor),
-                new FrameworkPropertyMetadata(false));
-
-        public static readonly DependencyProperty PathToArgumentProperty = DependencyProperty.Register("PathToArgument", typeof(string), typeof(ExpressionActivityEditor),
-                new FrameworkPropertyMetadata(null));
-
-        public static readonly DependencyProperty IsSupportedExpressionProperty = DependencyProperty.Register("IsSupportedExpression", typeof(bool), typeof(ExpressionActivityEditor),
-                new FrameworkPropertyMetadata(true));
-
-        public static readonly DependencyProperty VerticalScrollBarVisibilityProperty = DependencyProperty.Register("VerticalScrollBarVisibility", typeof(ScrollBarVisibility), typeof(ExpressionActivityEditor),
-                new FrameworkPropertyMetadata(ScrollBarVisibility.Hidden));
-
-        public static readonly DependencyProperty HorizontalScrollBarVisibilityProperty = DependencyProperty.Register("HorizontalScrollBarVisibility", typeof(ScrollBarVisibility), typeof(ExpressionActivityEditor),
-                new FrameworkPropertyMetadata(ScrollBarVisibility.Hidden));
-
-        public static readonly DependencyProperty ExplicitCommitProperty = DependencyProperty.Register("ExplicitCommit", typeof(bool), typeof(ExpressionActivityEditor),
-                new FrameworkPropertyMetadata(false));
-
-        public static readonly DependencyProperty AcceptsReturnProperty = DependencyProperty.Register("AcceptsReturn", typeof(bool), typeof(ExpressionActivityEditor),
-                new FrameworkPropertyMetadata(true));
-
-        public static readonly DependencyProperty AcceptsTabProperty = DependencyProperty.Register("AcceptsTab", typeof(bool), typeof(ExpressionActivityEditor),
-                new FrameworkPropertyMetadata(false));
-
-        public static readonly DependencyProperty IsReadOnlyProperty = DependencyProperty.Register("IsReadOnly", typeof(bool), typeof(ExpressionActivityEditor),
-                new FrameworkPropertyMetadata(false));
-
-        public static readonly DependencyProperty IsIndependentExpressionProperty = DependencyProperty.Register("IsIndependentExpression", typeof(bool), typeof(ExpressionActivityEditor),
-                new FrameworkPropertyMetadata(false));
-
-        public string HintText
-        {
-            get { return (string)GetValue(HintTextProperty); }
-            set { SetValue(HintTextProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public ModelItem Expression
-        {
-            get { return (ModelItem)GetValue(ExpressionProperty); }
-            set { SetValue(ExpressionProperty, value); }
-        }
-
-        public Type ExpressionType
-        {
-            get { return (Type)GetValue(ExpressionTypeProperty); }
-            set { SetValue(ExpressionTypeProperty, value); }
-        }
-
-        public bool UseLocationExpression
-        {
-            get { return (bool)GetValue(UseLocationExpressionProperty); }
-            set { SetValue(UseLocationExpressionProperty, value); }
-        }
-
-        public bool IsIndependentExpression
-        {
-            get { return (bool)GetValue(IsIndependentExpressionProperty); }
-            set { SetValue(IsIndependentExpressionProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public ModelItem OwnerActivity
-        {
-            get { return (ModelItem)GetValue(OwnerActivityProperty); }
-            set { SetValue(OwnerActivityProperty, value); }
-        }
-
-        public string PathToArgument
-        {
-            get { return (string)GetValue(PathToArgumentProperty); }
-            set { SetValue(PathToArgumentProperty, value); }
-        }
-
-        public bool IsSupportedExpression
-        {
-            get { return (bool)GetValue(IsSupportedExpressionProperty); }
-            set { SetValue(IsSupportedExpressionProperty, value); }
-        }
-
-        public bool AcceptsReturn
-        {
-            get { return (bool)GetValue(AcceptsReturnProperty); }
-            set { SetValue(AcceptsReturnProperty, value); }
-        }
-
-        public bool AcceptsTab
-        {
-            get { return (bool)GetValue(AcceptsTabProperty); }
-            set { SetValue(AcceptsTabProperty, value); }
-        }
-
-        public bool IsReadOnly
-        {
-            get { return (bool)GetValue(IsReadOnlyProperty); }
-            set { SetValue(IsReadOnlyProperty, value); }
-        }
-
-        public ScrollBarVisibility VerticalScrollBarVisibility
-        {
-            get { return (ScrollBarVisibility)GetValue(VerticalScrollBarVisibilityProperty); }
-            set { SetValue(VerticalScrollBarVisibilityProperty, value); }
-        }
-
-        public ScrollBarVisibility HorizontalScrollBarVisibility
-        {
-            get { return (ScrollBarVisibility)GetValue(HorizontalScrollBarVisibilityProperty); }
-            set { SetValue(HorizontalScrollBarVisibilityProperty, value); }
-        }
-
-        public bool ExplicitCommit
-        {
-            get { return (bool)GetValue(ExplicitCommitProperty); }
-            set { SetValue(ExplicitCommitProperty, value); }
-        }
-
-        static AttachableMemberIdentifier editorPropertyID = new AttachableMemberIdentifier(typeof(ExpressionActivityEditor), "ExpressionActivityEditor");
-
-        public static void SetExpressionActivityEditor(object target, string name)
-        {
-            ValidateExpressionActivityEditorName(name);
-            AttachablePropertyServices.SetProperty(target, editorPropertyID, name);
-        }
-
-        public static string GetExpressionActivityEditor(object target)
-        {
-            string value;
-            return AttachablePropertyServices.TryGetProperty(target, editorPropertyID, out value) ? value : null;
-        }
-
-        internal static void ValidateExpressionActivityEditorName(string name)
-        {
-            if (name != null && name.Trim().Length == 0)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException(string.Format(CultureInfo.CurrentUICulture, SR.InvalidExpressionEditorNameToSet,
-                    name)));
-            }
-        }
-
-        internal string ItemStatus
-        {
-            get
-            {
-                return this.OnCreateAutomationPeer().GetItemStatus();
-            }
-        }
-
-        protected EditingContext Context
-        {
-            get
-            {
-                if (this.OwnerActivity != null)
-                {
-                    return this.OwnerActivity.GetEditingContext();
-                }
-                else
-                {
-                    return null;
-                }
-            }
-        }
-
-        protected ExpressionActivityEditor()
-        { }
-        
-        public virtual void BeginEdit() { }
-        public virtual bool CanCommit() { return true; }
-        public abstract bool Commit(bool isExplicitCommit);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Expressions/ExpressionMorphHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Expressions/ExpressionMorphHelper.cs
deleted file mode 100644 (file)
index d40e94f..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Expressions
-{
-    public abstract class ExpressionMorphHelper
-    {     
-        //By default expression cannot infer the type.
-        public virtual bool TryInferReturnType(ActivityWithResult expression, EditingContext context, out Type returnType)
-        {
-            returnType = null;
-            return false;
-        }        
-
-        public abstract bool TryMorphExpression(ActivityWithResult expression, bool isLocationExpression, Type newType, 
-            EditingContext context, out ActivityWithResult newExpression);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Expressions/ExpressionMorphHelperAttribute.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Expressions/ExpressionMorphHelperAttribute.cs
deleted file mode 100644 (file)
index ea5e6d4..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Expressions
-{
-    using System.Runtime;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-
-    [Fx.Tag.XamlVisible(false)]
-    [AttributeUsage(AttributeTargets.Class)]
-    public sealed class ExpressionMorphHelperAttribute : Attribute
-    {
-        Type helperType;
-
-        public ExpressionMorphHelperAttribute(Type expressionMorphHelperType)
-        {
-            if (typeof(ExpressionMorphHelper).IsAssignableFrom(expressionMorphHelperType))
-            {
-                this.helperType = expressionMorphHelperType;
-            }
-            else
-            {                
-                throw FxTrace.Exception.AsError(new ArgumentException(string.Format(CultureInfo.CurrentUICulture, 
-                    SR.InvalidExpressionMorphHelperType, expressionMorphHelperType.FullName, typeof(ExpressionMorphHelper).FullName)));
-            }
-        }
-        
-        public Type ExpressionMorphHelperType
-        {
-            get
-            {
-                return this.helperType;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Expressions/TextualExpressionEditor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Expressions/TextualExpressionEditor.cs
deleted file mode 100644 (file)
index b94a5b7..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.Expressions
-{
-    using System;
-    using System.Activities.Presentation.View;
-    using System.Collections.Generic;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Linq;
-    using System.Runtime;
-    using System.Text;
-    using System.Windows;
-    using System.Windows.Input;
-
-    public abstract class TextualExpressionEditor : ExpressionActivityEditor
-    {
-        public static readonly DependencyProperty MaxLinesProperty = DependencyProperty.Register("MaxLines", typeof(int), typeof(TextualExpressionEditor),
-                new FrameworkPropertyMetadata(Int32.MaxValue));
-
-        public static readonly DependencyProperty MinLinesProperty = DependencyProperty.Register("MinLines", typeof(int), typeof(TextualExpressionEditor),
-                new FrameworkPropertyMetadata(1));
-
-        public static readonly DependencyProperty DefaultValueProperty = DependencyProperty.Register("DefaultValue", typeof(string), typeof(TextualExpressionEditor),
-                new FrameworkPropertyMetadata(null));
-
-        public int MaxLines
-        {
-            get { return (int)GetValue(MaxLinesProperty); }
-            set { SetValue(MaxLinesProperty, value); }
-        }
-
-        public int MinLines
-        {
-            get { return (int)GetValue(MinLinesProperty); }
-            set { SetValue(MinLinesProperty, value); }
-        }
-
-        public string DefaultValue
-        {
-            get { return (string)GetValue(DefaultValueProperty); }
-            set { SetValue(DefaultValueProperty, value); }
-        }
-
-        public virtual IExpressionEditorService ExpressionEditorService
-        {
-            get { return null; }
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.ConsiderPassingBaseTypesAsParameters,
-            Justification = "This is virtual method, the overriden method may need to access the members of derived type")]
-        public virtual void OnCompleteWordCommandCanExecute(CanExecuteRoutedEventArgs e)
-        {
-            e.Handled = false;
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.ConsiderPassingBaseTypesAsParameters,
-            Justification = "This is virtual method, the overriden method may need to access the members of derived type")]
-        public virtual void OnCompleteWordCommandExecute(ExecutedRoutedEventArgs e)
-        {
-            e.Handled = false;
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.ConsiderPassingBaseTypesAsParameters,
-            Justification = "This is virtual method, the overriden method may need to access the members of derived type")]
-        public virtual void OnGlobalIntellisenseCommandCanExecute(CanExecuteRoutedEventArgs e)
-        {
-            e.Handled = false;
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.ConsiderPassingBaseTypesAsParameters,
-            Justification = "This is virtual method, the overriden method may need to access the members of derived type")]
-        public virtual void OnGlobalIntellisenseCommandExecute(ExecutedRoutedEventArgs e)
-        {
-            e.Handled = false;
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.ConsiderPassingBaseTypesAsParameters,
-            Justification = "This is virtual method, the overriden method may need to access the members of derived type")]
-        public virtual void OnParameterInfoCommandCanExecute(CanExecuteRoutedEventArgs e)
-        {
-            e.Handled = false;
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.ConsiderPassingBaseTypesAsParameters,
-            Justification = "This is virtual method, the overriden method may need to access the members of derived type")]
-        public virtual void OnParameterInfoCommandExecute(ExecutedRoutedEventArgs e)
-        {
-            e.Handled = false;
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.ConsiderPassingBaseTypesAsParameters,
-            Justification = "This is virtual method, the overriden method may need to access the members of derived type")]
-        public virtual void OnQuickInfoCommandCanExecute(CanExecuteRoutedEventArgs e)
-        {
-            e.Handled = false;
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.ConsiderPassingBaseTypesAsParameters,
-            Justification = "This is virtual method, the overriden method may need to access the members of derived type")]
-        public virtual void OnQuickInfoCommandExecute(ExecutedRoutedEventArgs e)
-        {
-            e.Handled = false;
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.ConsiderPassingBaseTypesAsParameters,
-            Justification = "This is virtual method, the overriden method may need to access the members of derived type")]
-        public virtual void OnIncreaseFilterLevelCommandCanExecute(CanExecuteRoutedEventArgs e)
-        {
-            e.Handled = false;
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.ConsiderPassingBaseTypesAsParameters,
-            Justification = "This is virtual method, the overriden method may need to access the members of derived type")]
-        public virtual void OnDecreaseFilterLevelCommandExecute(ExecutedRoutedEventArgs e)
-        {
-            e.Handled = false;
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.ConsiderPassingBaseTypesAsParameters,
-            Justification = "This is virtual method, the overriden method may need to access the members of derived type")]
-        public virtual void OnDecreaseFilterLevelCommandCanExecute(CanExecuteRoutedEventArgs e)
-        {
-            e.Handled = false;
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.ConsiderPassingBaseTypesAsParameters,
-            Justification = "This is virtual method, the overriden method may need to access the members of derived type")]
-        public virtual void OnIncreaseFilterLevelCommandExecute(ExecutedRoutedEventArgs e)
-        {
-            e.Handled = false;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Feature.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Feature.cs
deleted file mode 100644 (file)
index 57d2121..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    abstract class Feature
-    {
-        public abstract void Initialize(EditingContext context, Type modelType);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FeatureAttribute.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FeatureAttribute.cs
deleted file mode 100644 (file)
index 08325a0..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Runtime;
-    using System.Diagnostics.CodeAnalysis;
-
-    [Fx.Tag.XamlVisible(false)]
-    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
-    sealed class FeatureAttribute : Attribute
-    {
-        Type type;
-
-        public FeatureAttribute(Type type)
-        {
-            Fx.Assert(type != null, "type should not be null");
-
-            this.type = type;
-        }
-
-        [SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods", Justification = "By design.")]
-        public Type Type
-        {
-            get
-            {
-                return this.type;
-            }
-        }
-
-        public override object TypeId
-        {
-            get
-            {
-                return this.type;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FeatureManager.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FeatureManager.cs
deleted file mode 100644 (file)
index 7ab6d20..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Collections.Generic;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Runtime;
-
-    class FeatureManager
-    {
-        EditingContext context;
-
-        HashSet<Type> initializedTypes;
-
-        public FeatureManager(EditingContext context)
-        {
-            this.context = context;
-            initializedTypes = new HashSet<Type>();
-        }
-
-        public void InitializeFeature(Type modelType)
-        {
-            Fx.Assert(modelType != null, "Why would anyone initialize a feature that is not associated with a type");
-
-            if (!initializedTypes.Contains(modelType))
-            {
-                initializedTypes.Add(modelType);
-                foreach (FeatureAttribute featureAttribute in ExtensibilityAccessor.GetAttributes<FeatureAttribute>(modelType))
-                {
-                    if (typeof(Feature).IsAssignableFrom(featureAttribute.Type))
-                    {
-                        Feature feature = (Feature)Activator.CreateInstance(featureAttribute.Type);
-                        if (feature != null)
-                        {
-                            feature.Initialize(this.context, modelType);
-                        }
-                    }
-                }
-                if (modelType.IsGenericType)
-                {
-                    InitializeFeature(modelType.GetGenericTypeDefinition());
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoConnectAdorner.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoConnectAdorner.cs
deleted file mode 100644 (file)
index 0fa3813..0000000
+++ /dev/null
@@ -1,229 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.View;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Runtime;
-    using System.Text;
-    using System.Windows;
-    using System.Windows.Documents;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using System.Windows.Shapes;
-    
-    internal sealed class AutoConnectAdorner : Adorner
-    {
-        private const double TriangleBaseLength = 15;
-        private const double TriangleHeight = 10;
-        private const double HitTestWidth = 20;
-        private const double HitTestHeight = 30;
-        private const double DropTargetOffset = 15;
-        private AutoConnectDirections highlightedDirection = AutoConnectDirections.None;
-        private AutoConnectDirections directions;
-        private Rect[] hitTestRects;
-        private PathGeometry[] renderGeometries;
-        private Rect adornedElementRect;
-        private SolidColorBrush hitTestBrush = Brushes.Transparent;
-        private Pen hitTestPen = new Pen(Brushes.Transparent, 0);
-        private SolidColorBrush renderBrush = Brushes.Azure;
-        private Pen renderPen = new Pen(Brushes.LightBlue, 1.0);
-        private SolidColorBrush highlightBrush = Brushes.LightBlue;
-        private Pen highlightPen = new Pen(Brushes.SteelBlue, 1);
-        private FreeFormPanel panel;
-        
-        public AutoConnectAdorner(UIElement adornedElement, FreeFormPanel panel, AutoConnectDirections directions) 
-            : base(adornedElement)
-        {
-            this.panel = panel;
-            this.directions = directions;
-
-            Size size = FreeFormPanel.GetChildSize(this.AdornedElement);
-            this.adornedElementRect = new Rect(new Point(0, 0), size);
-            this.hitTestRects = new Rect[] 
-            { 
-                new Rect(-HitTestHeight, (size.Height / 2) - (HitTestWidth / 2), HitTestHeight, HitTestWidth),
-                new Rect(size.Width, (size.Height / 2) - (HitTestWidth / 2), HitTestHeight, HitTestWidth),
-                new Rect((size.Width / 2) - (HitTestWidth / 2), -HitTestHeight, HitTestWidth, HitTestHeight),
-                new Rect((size.Width / 2) - (HitTestWidth / 2), size.Height, HitTestWidth, HitTestHeight)
-            };
-
-            this.renderGeometries = new PathGeometry[]
-            {
-                new PathGeometry() 
-                { 
-                    Figures =
-                    {
-                        new PathFigure()
-                        {
-                            StartPoint = new Point(-DropTargetOffset - TriangleHeight, size.Height / 2), Segments = 
-                            { 
-                                new LineSegment() { Point = new Point(-DropTargetOffset, (size.Height / 2) - (TriangleBaseLength / 2)) },
-                                new LineSegment() { Point = new Point(-DropTargetOffset, (size.Height / 2) + (TriangleBaseLength / 2)) },
-                                new LineSegment() { Point = new Point(-DropTargetOffset - TriangleHeight, size.Height / 2) }
-                            }
-                        }
-                    } 
-                },
-                new PathGeometry() 
-                { 
-                    Figures =
-                    {
-                        new PathFigure()
-                        {
-                            StartPoint = new Point(size.Width + DropTargetOffset, (size.Height / 2) - (TriangleBaseLength / 2)), Segments = 
-                            { 
-                                new LineSegment() { Point = new Point(size.Width + DropTargetOffset + TriangleHeight, size.Height / 2) },
-                                new LineSegment() { Point = new Point(size.Width + DropTargetOffset, (size.Height / 2) + (TriangleBaseLength / 2)) },
-                                new LineSegment() { Point = new Point(size.Width + DropTargetOffset, (size.Height / 2) - (TriangleBaseLength / 2)) }
-                            }
-                        }
-                    }
-                },
-                new PathGeometry() 
-                { 
-                    Figures =
-                    {
-                        new PathFigure()
-                        {
-                            StartPoint = new Point((size.Width / 2) - (TriangleBaseLength / 2), -DropTargetOffset), Segments = 
-                            { 
-                                new LineSegment() { Point = new Point((size.Width / 2), -DropTargetOffset - TriangleHeight) },
-                                new LineSegment() { Point = new Point((size.Width / 2) + (TriangleBaseLength / 2), -DropTargetOffset) },
-                                new LineSegment() { Point = new Point((size.Width / 2) - (TriangleBaseLength / 2), -DropTargetOffset) }
-                            }
-                        }
-                    }
-                },
-                new PathGeometry() 
-                { 
-                    Figures = 
-                    {
-                        new PathFigure()
-                        {
-                            StartPoint = new Point((size.Width / 2) - (TriangleBaseLength / 2), size.Height + DropTargetOffset), Segments = 
-                            { 
-                                new LineSegment() { Point = new Point((size.Width / 2) + (TriangleBaseLength / 2), size.Height + DropTargetOffset) },
-                                new LineSegment() { Point = new Point((size.Width / 2), size.Height + TriangleHeight + DropTargetOffset) },
-                                new LineSegment() { Point = new Point((size.Width / 2) - (TriangleBaseLength / 2), size.Height + DropTargetOffset) }
-                            }
-                        }
-                    }
-                }
-            };
-        }
-
-        internal AutoConnectDirections AutoConnectDirection
-        {
-            get
-            {
-                return this.highlightedDirection;
-            }
-        }
-
-        internal void OnDrag(DragEventArgs e)
-        {
-            Point position = e.GetPosition(this.AdornedElement);
-            this.UpdateHighlightedDirection(position);
-            e.Effects |= DragDropEffects.Move;
-            e.Handled = true;
-        }
-
-        internal void UpdateHighlightedDirection(Point position)
-        {
-            Size size = FreeFormPanel.GetChildSize(this.AdornedElement);
-            if (position.X < 0 && this.highlightedDirection != AutoConnectDirections.Left)
-            {
-                this.highlightedDirection = AutoConnectDirections.Left;
-                this.InvalidateVisual();
-            }
-            else if (position.X > size.Width && this.highlightedDirection != AutoConnectDirections.Right)
-            {
-                this.highlightedDirection = AutoConnectDirections.Right;
-                this.InvalidateVisual();
-            }
-            else if (position.Y < 0 && this.highlightedDirection != AutoConnectDirections.Top)
-            {
-                this.highlightedDirection = AutoConnectDirections.Top;
-                this.InvalidateVisual();
-            }
-            else if (position.Y > size.Height && this.highlightedDirection != AutoConnectDirections.Bottom)
-            {
-                this.highlightedDirection = AutoConnectDirections.Bottom;
-                this.InvalidateVisual();
-            }
-        }
-
-        protected override void OnInitialized(EventArgs e)
-        {
-            base.OnInitialized(e);
-            this.AllowDrop = true;
-        }
-
-        protected override void OnDragEnter(DragEventArgs e)
-        {
-            base.OnDragEnter(e);
-            this.OnDrag(e);
-        }
-
-        protected override void OnDragOver(DragEventArgs e)
-        {
-            base.OnDragOver(e);
-            this.OnDrag(e);
-        }
-
-        protected override void OnDragLeave(DragEventArgs e)
-        {
-            base.OnDragLeave(e);
-            this.highlightedDirection = AutoConnectDirections.None;
-            this.InvalidateVisual();
-        }
-
-        protected override void OnDrop(DragEventArgs e)
-        {
-            if (this.panel.AutoConnectContainer != null)
-            {
-                try
-                {
-                    this.panel.AutoConnectContainer.DoAutoConnect(e, this.AdornedElement, this.AutoConnectDirection);
-                }
-                finally
-                {
-                    e.Handled = true;
-                    this.panel.RemoveAutoConnectAdorner();
-                }
-            }
-
-            base.OnDrop(e);
-        }
-
-        protected override void OnRender(DrawingContext drawingContext)
-        {
-            base.OnRender(drawingContext);
-
-            for (int i = 0; i < 4; i++)
-            {
-                if ((AutoConnectHelper.GetAutoConnectDirection(i) & this.directions) != 0)
-                {
-                    drawingContext.DrawRectangle(this.hitTestBrush, this.hitTestPen, this.hitTestRects[i]);
-                    drawingContext.DrawGeometry(
-                        (AutoConnectHelper.GetAutoConnectDirection(i) == this.highlightedDirection) ? this.highlightBrush : this.renderBrush,
-                        (AutoConnectHelper.GetAutoConnectDirection(i) == this.highlightedDirection) ? this.highlightPen : this.renderPen,
-                        this.renderGeometries[i]);
-                }
-            }
-
-            if (this.AutoConnectDirection != AutoConnectDirections.None)
-            {
-                drawingContext.DrawRectangle(null, this.highlightPen, this.adornedElementRect);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoConnectDirections.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoConnectDirections.cs
deleted file mode 100644 (file)
index c1e980c..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    /// <summary>
-    /// Defines to which direction should the auto connection be allowed
-    /// </summary>
-    [Flags]
-    internal enum AutoConnectDirections
-    {
-        /// <summary>
-        /// Invalid direction
-        /// </summary>
-        None = 0,
-
-        /// <summary>
-        /// Left direction
-        /// </summary>
-        Left = 1,
-
-        /// <summary>
-        /// Right direction
-        /// </summary>
-        Right = 2,
-
-        /// <summary>
-        /// Top direction
-        /// </summary>
-        Top = 4,
-
-        /// <summary>
-        /// Bottom direction
-        /// </summary>
-        Bottom = 8
-    }
-}
\ No newline at end of file
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoConnectHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoConnectHelper.cs
deleted file mode 100644 (file)
index ad6f8f1..0000000
+++ /dev/null
@@ -1,321 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System.Activities.Presentation.Model;
-    using System.Collections.Generic;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Documents;
-    using System.Windows.Media;
-
-    internal sealed class AutoConnectHelper
-    {
-        private const double HitRegionOffset = 30;
-        private const double DropTargetWidth = 20;
-        private const double DropPointOffset = 50;
-
-        private FreeFormPanel panel = null;
-        private UIElement currentTarget = null;
-
-        public AutoConnectHelper(FreeFormPanel panel)
-        {
-            this.panel = panel;
-        }
-
-        internal UIElement CurrentTarget
-        {
-            get
-            {
-                UIElement target = this.currentTarget;
-                
-                // It is possible that currentTarget has been removed from the FreeFormPanel
-                if (target != null && VisualTreeHelper.GetParent(target) == null)
-                {
-                    this.currentTarget = null;
-                    return null;
-                }
-
-                return target;
-            }
-
-            set
-            {
-                this.currentTarget = value;
-            }
-        }
-
-        internal static Rect GetAutoConnectHitRect(DependencyObject target)
-        {
-            Size size = FreeFormPanel.GetChildSize(target);
-            Point location = FreeFormPanel.GetLocation(target);
-            Rect rect = new Rect(new Point(location.X - HitRegionOffset, location.Y - HitRegionOffset), new Size(size.Width + (HitRegionOffset * 2), size.Height + (HitRegionOffset * 2)));
-            return rect;
-        }
-
-        // *                                                                   
-        // * Diagram: Hit test rect for auto connect (best view with Courier New)                           
-        // *                                                                   
-        // *                        ├         W         ┤                      
-        // *                                 ┤a├                               
-        // *               ├   O    ┤                   ├    O   ┤             
-        // *                                 ┌─┐                    ┬          
-        // *                                 │ │                               
-        // *                                 │ │                    O          
-        // *                                 │ │                               
-        // *                        ┌────────┴─┴────────┐           ┴       ┬  
-        // *                        │                   │                      
-        // *               ┌────────┤                   ├────────┐     ┴ a  H  
-        // *               └────────┤                   ├────────┘     ┬       
-        // *                        │                   │                      
-        // *                        └────────┬─┬────────┘           ┬       ┴  
-        // *                                 │ │                               
-        // *                                 │ │                    O          
-        // *                                 │ │                               
-        // *                                 └─┘                    ┴          
-        // *                                                                   
-        // * W: Width                                                          
-        // * H: Height                                                         
-        // * O: HitRegionOffset                                                
-        // * a: DropTargetWidth                                                
-        // *                                                                   
-        internal static List<Rect> CreateHitTestRects(Point targetLocation, Size targetSize)
-        {
-            List<Rect> rects = new List<Rect>();
-
-            // See the diagram above for these rects
-            rects.Add(new Rect(new Point(targetLocation.X - HitRegionOffset, targetLocation.Y + ((targetSize.Height - DropTargetWidth) / 2)), new Size(HitRegionOffset, DropTargetWidth)));
-            rects.Add(new Rect(new Point(targetLocation.X + targetSize.Width, targetLocation.Y + ((targetSize.Height - DropTargetWidth) / 2)), new Size(HitRegionOffset, DropTargetWidth)));
-            rects.Add(new Rect(new Point(targetLocation.X + ((targetSize.Width - DropTargetWidth) / 2), targetLocation.Y - HitRegionOffset), new Size(DropTargetWidth, HitRegionOffset)));
-            rects.Add(new Rect(new Point(targetLocation.X + ((targetSize.Width - DropTargetWidth) / 2), targetLocation.Y + targetSize.Height), new Size(DropTargetWidth, HitRegionOffset)));
-            return rects;
-        }
-
-        internal static AutoConnectDirections GetAutoConnectDirection(int index)
-        {
-            switch (index)
-            {
-                case 0:
-                    return AutoConnectDirections.Left;
-                case 1:
-                    return AutoConnectDirections.Right;
-                case 2:
-                    return AutoConnectDirections.Top;
-                case 3:
-                    return AutoConnectDirections.Bottom;
-                default:
-                    return AutoConnectDirections.None;
-            }
-        }
-
-        internal static Point CalculateDropLocation(Size droppedSize, DependencyObject autoConnectTarget, AutoConnectDirections direction, HashSet<Point> shapeLocations)
-        {
-            Point dropPoint = new Point(-1, -1);
-            if (autoConnectTarget != null)
-            {
-                Point location = FreeFormPanel.GetLocation(autoConnectTarget);
-                Size size = FreeFormPanel.GetChildSize(autoConnectTarget);
-                switch (direction)
-                {
-                    case AutoConnectDirections.Left:
-                        dropPoint = new Point(location.X - DropPointOffset - droppedSize.Width, location.Y + ((size.Height - droppedSize.Height) / 2));
-                        break;
-                    case AutoConnectDirections.Right:
-                        dropPoint = new Point(location.X + size.Width + DropPointOffset, location.Y + ((size.Height - droppedSize.Height) / 2));
-                        break;
-                    case AutoConnectDirections.Top:
-                        dropPoint = new Point(location.X + ((size.Width - droppedSize.Width) / 2), location.Y - DropPointOffset - droppedSize.Height);
-                        break;
-                    case AutoConnectDirections.Bottom:
-                        dropPoint = new Point(location.X + ((size.Width - droppedSize.Width) / 2), location.Y + DropPointOffset + size.Height);
-                        break;
-                    default:
-                        Fx.Assert(false, "Should not be here");
-                        break;
-                }
-
-                dropPoint = new Point(dropPoint.X < 0 ? 0 : dropPoint.X, dropPoint.Y < 0 ? 0 : dropPoint.Y);
-                if (shapeLocations != null)
-                {
-                    while (shapeLocations.Contains(dropPoint))
-                    {
-                        dropPoint.Offset(FreeFormPanel.GridSize, FreeFormPanel.GridSize);
-                    }
-                }
-            }
-
-            return dropPoint;
-        }
-
-        internal static EdgeLocation AutoConnectDirection2EdgeLocation(AutoConnectDirections direction)
-        {
-            EdgeLocation edgeLocation = EdgeLocation.Right;
-            switch (direction)
-            {
-                case AutoConnectDirections.Left:
-                    edgeLocation = EdgeLocation.Left;
-                    break;
-                case AutoConnectDirections.Right:
-                    edgeLocation = EdgeLocation.Right;
-                    break;
-                case AutoConnectDirections.Top:
-                    edgeLocation = EdgeLocation.Top;
-                    break;
-                case AutoConnectDirections.Bottom:
-                    edgeLocation = EdgeLocation.Bottom;
-                    break;
-            }
-
-            return edgeLocation;
-        }
-        
-        internal static DependencyObject GetShapeContainingPoint(Point point, List<DependencyObject> shapes)
-        {
-            DependencyObject result = null;
-
-            foreach (DependencyObject shape in shapes)
-            {
-                Rect rect = GetAutoConnectHitRect(shape);
-                if (rect.Contains(point))
-                {
-                    // The design is that if the point is inside of multiple hit test regions, we do not 
-                    // show any drop targets to avoid confusion.
-                    if (result != null)
-                    {
-                        return null;
-                    }
-
-                    result = shape;
-                }
-            }
-
-            return result;
-        }
-
-        internal DependencyObject FindTarget(Point point, DependencyObject dragged, out AutoConnectDirections directions)
-        {
-            directions = AutoConnectDirections.None;
-            List<DependencyObject> childShapes = this.panel.GetChildShapes(dragged);
-            DependencyObject target = GetShapeContainingPoint(point, childShapes);
-
-            if (target != null)
-            {
-                directions = this.GetAutoConnectDirections(directions, childShapes, target);
-            }
-
-            return target;
-        }
-
-        internal void OnPreviewDragOverPanel(DragEventArgs e)
-        {
-            // Do not do auto-connect if we are currently auto-splitting.
-            if (this.panel.CurrentAutoSplitTarget != null)
-            {
-                return;
-            }
-
-            DependencyObject currentTarget = this.CurrentTarget;
-            if (currentTarget != null)
-            {
-                Rect rect = GetAutoConnectHitRect(currentTarget);
-                if (rect.Contains(e.GetPosition(this.panel)))
-                {
-                    // Do not update the adorner if the cursor is still in the hit region of the current target
-                    return;
-                }
-            }
-
-            ModelItem draggedModelItem = DragDropHelper.GetDraggedModelItemInternal(e);
-            DependencyObject draggedView = draggedModelItem != null ? draggedModelItem.View : null;
-            AutoConnectDirections direction;
-            UIElement target = this.FindTarget(e.GetPosition(this.panel), draggedView, out direction) as UIElement;
-            this.RemoveDropTargets();
-            if (target != null && (direction & this.panel.AutoConnectContainer.GetDirectionsAllowed(e, target)) != AutoConnectDirections.None)
-            {
-                this.AddDropTargets(e, target, direction);
-            }  
-        }
-
-        internal void RemoveDropTargets()
-        {
-            UIElement adornedElement = this.CurrentTarget;
-            if (adornedElement != null)
-            {
-                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(adornedElement);
-                Fx.Assert(adornerLayer != null, "AdornerLayer should not be null.");
-                Adorner[] adorners = adornerLayer.GetAdorners(adornedElement);
-                foreach (Adorner adorner in adorners)
-                {
-                    if (adorner is AutoConnectAdorner)
-                    {
-                        adornerLayer.Remove(adorner);
-                        this.CurrentTarget = null;
-                        return;
-                    }
-                }
-            }
-        }
-
-        // Check if hit test rects collide with any children of the FreeFormPanel, and remove that direction in case a collision is found.
-        private static void RemoveDirectionsInCollision(List<DependencyObject> childShapes, DependencyObject target, List<Rect> hitTestRects, ref AutoConnectDirections directions)
-        {
-            foreach (DependencyObject shape in childShapes)
-            {
-                if (directions == AutoConnectDirections.None)
-                {
-                    break;
-                }
-
-                if (object.Equals(shape, target))
-                {
-                    continue;
-                }
-
-                Point shapeLocation = FreeFormPanel.GetLocation(shape);
-                Size shapeSize = FreeFormPanel.GetChildSize(shape);
-                Rect shapeRect = new Rect(shapeLocation, shapeSize);
-                for (int i = 0; i < hitTestRects.Count; i++)
-                {
-                    if (hitTestRects[i].IntersectsWith(shapeRect))
-                    {
-                        directions &= ~AutoConnectHelper.GetAutoConnectDirection(i);
-                    }
-                }
-            }
-        }
-
-        // Check if hit test rects are completely within the FreeFormPanel rect, and remove that direction in case it's not.
-        private void RemoveDirectionsOutsideOfPanel(List<Rect> hitTestRects, ref AutoConnectDirections directions)
-        {
-            Rect panelRect = new Rect(0, 0, this.panel.Width, this.panel.Height);
-            for (int i = 0; i < hitTestRects.Count; i++)
-            {
-                if (!panelRect.Contains(hitTestRects[i]))
-                {
-                    directions &= ~AutoConnectHelper.GetAutoConnectDirection(i);
-                }
-            }
-        }
-
-        private AutoConnectDirections GetAutoConnectDirections(AutoConnectDirections directions, List<DependencyObject> childShapes, DependencyObject target)
-        {
-            directions = AutoConnectDirections.Top | AutoConnectDirections.Bottom | AutoConnectDirections.Left | AutoConnectDirections.Right;
-            List<Rect> hitTestRects = CreateHitTestRects(FreeFormPanel.GetLocation(target), FreeFormPanel.GetChildSize(target));
-            this.RemoveDirectionsOutsideOfPanel(hitTestRects, ref directions);
-            RemoveDirectionsInCollision(childShapes, target, hitTestRects, ref directions);
-            return directions;
-        }
-
-        private void AddDropTargets(DragEventArgs e, UIElement adornedElement, AutoConnectDirections directions)
-        {
-            AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(adornedElement);
-            Fx.Assert(adornerLayer != null, "AdornerLayer should not be null.");
-            adornerLayer.Add(new AutoConnectAdorner(adornedElement, this.panel, (directions & this.panel.AutoConnectContainer.GetDirectionsAllowed(e, adornedElement))));
-            this.CurrentTarget = adornedElement;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoSplitAdorner.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoSplitAdorner.cs
deleted file mode 100644 (file)
index b81a6d2..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System;
-    using System.Windows;
-    using System.Windows.Documents;
-    using System.Windows.Media;
-
-    internal sealed class AutoSplitAdorner : Adorner
-    {
-        private Rect adornedElementRect;
-        private Pen pen = new Pen(Brushes.SteelBlue, 1);
-
-        public AutoSplitAdorner(UIElement adornedElement)
-            : base(adornedElement)
-        {
-            Size size = FreeFormPanel.GetChildSize(this.AdornedElement);
-            this.adornedElementRect = new Rect(new Point(0, 0), size);
-        }
-
-        protected override void OnRender(DrawingContext drawingContext)
-        {
-            base.OnRender(drawingContext);
-            drawingContext.DrawRectangle(null, this.pen, this.adornedElementRect);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoSplitAlignment.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoSplitAlignment.cs
deleted file mode 100644 (file)
index ff4a253..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    /// <summary>
-    /// Defines alignment for auto-split
-    /// </summary>
-    internal enum AutoSplitAlignment
-    {
-        /// <summary>
-        /// No alignment
-        /// </summary>
-        None,
-
-        /// <summary>
-        /// Vertical alignment
-        /// </summary>
-        Vertical,
-
-        /// <summary>
-        /// Horizontal alignment
-        /// </summary>
-        Horizontal
-    }
-}
\ No newline at end of file
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoSplitHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoSplitHelper.cs
deleted file mode 100644 (file)
index 36edb8d..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System.Collections.Generic;
-    using System.Windows;
-
-    internal static class AutoSplitHelper
-    {
-        private const double ShapeMargin = 40;
-
-        public static void CalculateEntryExitEdges(Point mousePosition, Connector connector, out EdgeLocation entryEdge, out EdgeLocation exitEdge)
-        {
-            UIElement srcShape = FreeFormPanel.GetSourceConnectionPoint(connector).ParentDesigner;
-            UIElement destShape = FreeFormPanel.GetDestinationConnectionPoint(connector).ParentDesigner;
-            Point srcLocation = FreeFormPanel.GetLocation(srcShape);
-            Point destLocation = FreeFormPanel.GetLocation(destShape);
-            Size srcSize = FreeFormPanel.GetChildSize(srcShape);
-            Size destSize = FreeFormPanel.GetChildSize(destShape);
-
-            Point srcCenter = new Point(srcLocation.X + (srcSize.Width / 2), srcLocation.Y + (srcSize.Height / 2));
-            Point destCenter = new Point(destLocation.X + (destSize.Width / 2), destLocation.Y + (destSize.Height / 2));
-
-            entryEdge = CalculateEdgeLocation(mousePosition, srcCenter);
-            exitEdge = CalculateEdgeLocation(mousePosition, destCenter);
-
-            if (exitEdge == entryEdge)
-            {
-                switch (entryEdge)
-                {
-                    case EdgeLocation.Top:
-                        exitEdge = EdgeLocation.Bottom;
-                        break;
-
-                    case EdgeLocation.Bottom:
-                        exitEdge = EdgeLocation.Top;
-                        break;
-
-                    case EdgeLocation.Left:
-                        exitEdge = EdgeLocation.Right;
-                        break;
-
-                    case EdgeLocation.Right:
-                        exitEdge = EdgeLocation.Left;
-                        break;
-                }
-            }
-        }
-
-        public static Point CalculateDropLocation(Point mousePosition, Point originalDropLocation, Connector connector, Size droppedSize, HashSet<Point> shapeLocations)
-        {
-            UIElement srcShape = FreeFormPanel.GetSourceConnectionPoint(connector).ParentDesigner;
-            UIElement destShape = FreeFormPanel.GetDestinationConnectionPoint(connector).ParentDesigner;
-            Point srcLocation = FreeFormPanel.GetLocation(srcShape);
-            Point destLocation = FreeFormPanel.GetLocation(destShape);
-            Size srcSize = FreeFormPanel.GetChildSize(srcShape);
-            Size destSize = FreeFormPanel.GetChildSize(destShape);
-
-            return CalculateDropLocation(mousePosition, originalDropLocation, droppedSize, srcLocation, destLocation, srcSize, destSize, shapeLocations);
-        }
-
-        internal static Point CalculateDropLocation(Point mousePosition, Point originalDropLocation, Size droppedSize, Point srcLocation, Point destLocation, Size srcSize, Size destSize, HashSet<Point> shapeLocations)
-        {
-            Point dropLocation = originalDropLocation;
-
-            double distToSrc = DesignerGeometryHelper.ManhattanDistanceBetweenPoints(mousePosition, new Point(srcLocation.X + (srcSize.Width / 2), srcLocation.Y + (srcSize.Height / 2)));
-            double distToDest = DesignerGeometryHelper.ManhattanDistanceBetweenPoints(mousePosition, new Point(destLocation.X + (destSize.Width / 2), destLocation.Y + (destSize.Height / 2)));
-
-            AutoSplitAlignment srcAlignment = GetAlignment(mousePosition, srcLocation, srcSize);
-            AutoSplitAlignment destAlignment = GetAlignment(mousePosition, destLocation, destSize);
-
-            if ((distToSrc <= distToDest || destAlignment == AutoSplitAlignment.None) && srcAlignment == AutoSplitAlignment.Vertical)
-            {
-                dropLocation = CalculateDropLocationToAlignVertically(dropLocation, droppedSize, srcLocation, srcSize);
-            }
-            else if ((distToSrc <= distToDest || destAlignment == AutoSplitAlignment.None) && srcAlignment == AutoSplitAlignment.Horizontal)
-            {
-                dropLocation = CalculateDropLocationToAlignHorizontally(dropLocation, droppedSize, srcLocation, srcSize);
-            }
-            else if ((distToSrc >= distToDest || srcAlignment == AutoSplitAlignment.None) && destAlignment == AutoSplitAlignment.Vertical)
-            {
-                dropLocation = CalculateDropLocationToAlignVertically(dropLocation, droppedSize, destLocation, destSize);
-            }
-            else if ((distToSrc >= distToDest || srcAlignment == AutoSplitAlignment.None) && destAlignment == AutoSplitAlignment.Horizontal)
-            {
-                dropLocation = CalculateDropLocationToAlignHorizontally(dropLocation, droppedSize, destLocation, destSize);
-            }
-
-            dropLocation.X = dropLocation.X < 0 ? 0 : dropLocation.X;
-            dropLocation.Y = dropLocation.Y < 0 ? 0 : dropLocation.Y;
-
-            // To avoid overlaps with existing shapes
-            if (shapeLocations != null)
-            {
-                while (shapeLocations.Contains(dropLocation))
-                {
-                    dropLocation.Offset(FreeFormPanel.GridSize, FreeFormPanel.GridSize);
-                }
-            }
-
-            return dropLocation;
-        }
-
-        internal static AutoSplitAlignment GetAlignment(Point mousePosition, Point targetLocation, Size targetSize)
-        {
-            AutoSplitAlignment alignment = AutoSplitAlignment.None;
-            if (mousePosition.X >= targetLocation.X && mousePosition.X <= targetLocation.X + targetSize.Width)
-            {
-                alignment = AutoSplitAlignment.Vertical;
-            }
-            else if (mousePosition.Y >= targetLocation.Y && mousePosition.Y <= targetLocation.Y + targetSize.Height)
-            {
-                alignment = AutoSplitAlignment.Horizontal;
-            }
-
-            return alignment;
-        }
-
-        internal static Point CalculateDropLocationToAlignVertically(Point originalDropLocation, Size droppedSize, Point targetLocation, Size targetSize)
-        {
-            Point dropLocation = originalDropLocation;
-            dropLocation.X = targetLocation.X + ((targetSize.Width - droppedSize.Width) / 2);
-            if (dropLocation.Y >= targetLocation.Y && dropLocation.Y <= targetLocation.Y + targetSize.Height + ShapeMargin)
-            {
-                dropLocation.Y = targetLocation.Y + targetSize.Height + ShapeMargin;
-            }
-            else if (dropLocation.Y + droppedSize.Height + ShapeMargin >= targetLocation.Y && dropLocation.Y <= targetLocation.Y)
-            {
-                dropLocation.Y = targetLocation.Y - droppedSize.Height - ShapeMargin;
-            }
-
-            return dropLocation;
-        }
-
-        internal static Point CalculateDropLocationToAlignHorizontally(Point originalDropLocation, Size droppedSize, Point targetLocation, Size targetSize)
-        {
-            Point dropLocation = originalDropLocation;
-            dropLocation.Y = targetLocation.Y + ((targetSize.Height - droppedSize.Height) / 2);
-            if (dropLocation.X >= targetLocation.X && dropLocation.X <= targetLocation.X + targetSize.Width + ShapeMargin)
-            {
-                dropLocation.X = targetLocation.X + targetSize.Width + ShapeMargin;
-            }
-            else if (dropLocation.X + droppedSize.Width + ShapeMargin >= targetLocation.X && dropLocation.X <= targetLocation.X)
-            {
-                dropLocation.X = targetLocation.X - droppedSize.Width - ShapeMargin;
-            }
-
-            return dropLocation;
-        }
-
-        internal static EdgeLocation CalculateEdgeLocation(Point mousePosition, Point shapeCenter)
-        {
-            double distX = Math.Abs(shapeCenter.X - mousePosition.X);
-            double distY = Math.Abs(shapeCenter.Y - mousePosition.Y);
-            if (distX > distY)
-            {
-                return shapeCenter.X < mousePosition.X ? EdgeLocation.Left : EdgeLocation.Right;
-            }
-            else
-            {
-                return shapeCenter.Y < mousePosition.Y ? EdgeLocation.Top : EdgeLocation.Bottom;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectionPoint.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectionPoint.cs
deleted file mode 100644 (file)
index 925bff0..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Windows;
-    using System.Runtime;
-    class ConnectionPoint : UIElement
-    {
-        public static readonly DependencyProperty LocationProperty = DependencyProperty.Register("Location", typeof(Point), typeof(ConnectionPoint));
-
-        private List<Connector> attachedConnectors;
-        private UIElement parentDesigner;
-        private ConnectionPointKind pointType;
-
-        // Size constants for the rectangle drawn
-        internal const double DrawingSmallSide = 4;
-        internal const double DrawingLargeSide = 10;
-
-        // Size constants for the hit test area.
-        internal const double HitTestSmallSide = 14;
-        internal const double HitTestLargeSide = 20;
-
-        public ConnectionPoint()
-        {
-            pointType = ConnectionPointKind.Default;
-            attachedConnectors = new List<Connector>();
-            this.parentDesigner = null;
-        }
-
-        public List<Connector> AttachedConnectors
-        {
-            get
-            {
-                return this.attachedConnectors;
-            }
-        }
-
-        public Point Location
-        {
-            get { return (Point)GetValue(ConnectionPoint.LocationProperty); }
-            set { SetValue(ConnectionPoint.LocationProperty, value); }
-        }
-
-        // This is the vector from the point on the Edge to the top left of the rectangle being drawn.
-        public Vector DrawingOffset
-        {
-            get
-            {
-                return GetOffset(DrawingSmallSide, DrawingLargeSide);
-            }
-        }
-
-        // This is the vector from the point on the Edge to the top left of the rectangle being used for hit test.
-        public Vector HitTestOffset
-        {
-            get
-            {
-                return GetOffset(HitTestSmallSide, HitTestLargeSide);
-            }
-        }
-
-        // This is the size for the rectangle drawn (size is independent of coordinate system)
-        public Size DrawingSize
-        {
-            get
-            {
-                return this.GetSize(ConnectionPoint.DrawingSmallSide, ConnectionPoint.DrawingLargeSide);
-            }
-        }
-
-        // This is the size for the hit test area (size is independent of coordinate system)
-        public Size HitTestSize
-        {
-            get
-            {
-                return this.GetSize(ConnectionPoint.HitTestSmallSide, ConnectionPoint.HitTestLargeSide);
-            }
-        }
-
-        public UIElement ParentDesigner
-        {
-            get
-            {
-                return this.parentDesigner;
-            }
-            set
-            {
-                this.parentDesigner = value;
-            }
-        }
-
-        public ConnectionPointKind PointType
-        {
-            get
-            {
-                return this.pointType;
-            }
-            set
-            {
-                this.pointType = value;
-            }
-        }
-
-        // The list of Points representing the edge of the parent designer where this ConnectionPoint locates with respect to (0,0) of the FreeFormPanel.
-        public List<Point> Edge
-        {
-            get
-            {
-                FrameworkElement parent = this.ParentDesigner as FrameworkElement;
-                Fx.Assert(parent != null, "shape should be a FrameworkElement");
-                Point topLeft = FreeFormPanel.GetLocation(parent);
-                topLeft.Offset(parent.Margin.Left, parent.Margin.Top);
-                double parentWidth = parent.DesiredSize.Width - parent.Margin.Left - parent.Margin.Right;
-                double parentHeight = parent.DesiredSize.Height - parent.Margin.Top - parent.Margin.Bottom;
-                if (this.Location.X == topLeft.X)
-                { //Left Edge
-                    return new List<Point> { topLeft, new Point(topLeft.X, topLeft.Y + parentHeight) };
-                }
-                else if (this.Location.X == topLeft.X + parentWidth)
-                { //Right edge
-                    return new List<Point> { new Point(topLeft.X + parentWidth, topLeft.Y), new Point(topLeft.X + parentWidth, topLeft.Y + parentHeight) };
-                }
-                else if (this.Location.Y == topLeft.Y)
-                { //Top Edge
-                    return new List<Point> { topLeft, new Point(topLeft.X + parentWidth, topLeft.Y) };
-                }
-                else if (this.Location.Y == topLeft.Y + parentHeight)
-                { //Bottom edge
-                    return new List<Point> { new Point(topLeft.X, topLeft.Y + parentHeight), new Point(topLeft.X + parentWidth, topLeft.Y + parentHeight) };
-                }
-                return null;
-            }
-        }
-
-        public EdgeLocation EdgeLocation
-        {
-            get;
-            set;
-        }
-
-        public static ConnectionPoint GetClosestConnectionPoint(List<ConnectionPoint> connectionPoints, Point refPoint, out double minDist)
-        {
-            minDist = double.PositiveInfinity;
-            if (connectionPoints == null || connectionPoints.Count == 0)
-            {
-                return null;
-            }
-            double dist = 0;
-            ConnectionPoint closestPoint = null;
-            foreach (ConnectionPoint point in connectionPoints)
-            {
-                dist = DesignerGeometryHelper.DistanceBetweenPoints(refPoint, point.Location);
-                if (dist < minDist)
-                {
-                    minDist = dist;
-                    closestPoint = point;
-                }
-            }
-
-            return closestPoint;
-        }
-
-        // This is the vector from the point on the Edge to the top left of a rectangle with a particular (small, large) pair.
-        Vector GetOffset(double small, double large)
-        {
-            return this.EdgeToDrawnMidPointOffset() + this.MidPointToTopLeftOffset(small, large);
-        }
-
-        // This is the vector from the point on the Edge to the midpoint of the "drawn" rectangle.
-        Vector EdgeToDrawnMidPointOffset()
-        {
-            double small = ConnectionPoint.DrawingSmallSide;
-            switch (this.EdgeLocation)
-            {
-                case EdgeLocation.Left: return new Vector(-small / 2, 0);
-                case EdgeLocation.Right: return new Vector(small / 2, 0);
-                case EdgeLocation.Top: return new Vector(0, -small / 2);
-                case EdgeLocation.Bottom: return new Vector(0, small / 2);
-            }
-            Fx.Assert("There is no other possibilities for EdgeDirections");
-            // To please compiler
-            return new Vector();
-        }
-
-        // This is the vector from the midpoint of the rectangle to the top left of the rectangle with a particular (small, large) pair.
-        Vector MidPointToTopLeftOffset(double small, double large)
-        {
-            Size rectSize = GetSize(small, large);
-            return new Vector(-rectSize.Width / 2, -rectSize.Height / 2);
-        }
-
-        // This is the size for the rectangle with a particular (small, large) pair
-        Size GetSize(double small, double large)
-        {
-            if (this.EdgeLocation == EdgeLocation.Left || this.EdgeLocation == EdgeLocation.Right)
-            {
-                return new Size(small, large);
-            }
-            else
-            {
-                return new Size(large, small);
-            }
-        }
-    }
-
-    enum EdgeLocation
-    {
-        Left,
-        Right,
-        Top,
-        Bottom
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectionPointConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectionPointConverter.cs
deleted file mode 100644 (file)
index 2fce6b4..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Diagnostics.CodeAnalysis;
-
-    class ConnectionPointConverter : IMultiValueConverter
-    {
-        //This converter returns the actual location of the connection point on the panel.
-        //values[0] is the Size of the shape, values[1] is the Location of the shape.
-        //Parameters define at what width/height fraction of the shape, should the connectionpoint be located.
-        [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", Justification = "The class is only used internally and not accessible externally.")]
-        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
-        {
-            Size shapeSize = (Size)values[0];
-            double width = shapeSize.Width;
-            double height = shapeSize.Height;
-            Point origin = (Point)values[1];
-            List<object> parameters = (List<object>)parameter;
-            double widthFraction = (double)parameters[0];
-            double heightFraction = (double)parameters[1];
-            Thickness margin = (Thickness)parameters[2];
-            origin.X += margin.Left;
-            origin.Y += margin.Top;
-            width = width - margin.Left - margin.Right;
-            height = height - margin.Top - margin.Bottom;
-            Point connectionPointLocation = new Point(width * widthFraction + origin.X, height * heightFraction + origin.Y);
-            return connectionPointLocation;
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotImplementedException());
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectionPointKind.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectionPointKind.cs
deleted file mode 100644 (file)
index 5112ed0..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    enum ConnectionPointKind
-    {        
-        Default,
-        Incoming,
-        Outgoing,
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectionPointsAdorner.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectionPointsAdorner.cs
deleted file mode 100644 (file)
index 48258ff..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.View;
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Windows;
-    using System.Windows.Documents;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using System.Runtime;
-
-    internal class ConnectionPointsAdorner : Adorner
-    {
-        SolidColorBrush renderBrush;
-        Pen renderPen;
-        protected List<ConnectionPoint> connectionPoints;
-
-        internal List<ConnectionPoint> ConnectionPoints
-        {
-            get { return this.connectionPoints; }
-        }
-
-        public ConnectionPointsAdorner(UIElement adornedElement, List<ConnectionPoint> connectionPointsToShow, bool isParentShapeSelected)
-            : base(adornedElement)
-        {
-            Fx.Assert(adornedElement != null, "adornedElement is null");
-            this.connectionPoints = connectionPointsToShow;
-            if (isParentShapeSelected)
-            {
-                this.renderBrush = new SolidColorBrush(WorkflowDesignerColors.WorkflowViewElementSelectedBackgroundColor);
-                this.renderPen = new Pen(new SolidColorBrush(WorkflowDesignerColors.WorkflowViewElementSelectedBorderColor), 1.0);
-            }
-            else
-            {
-                this.renderBrush = new SolidColorBrush(WorkflowDesignerColors.WorkflowViewElementBackgroundColor);
-                this.renderPen = new Pen(new SolidColorBrush(WorkflowDesignerColors.WorkflowViewElementBorderColor), 1.0);
-            }
-        }
-
-        protected override void OnInitialized(EventArgs e)
-        {
-            base.OnInitialized(e);
-            this.IsHitTestVisible = true;
-        }
-
-        protected override void OnMouseMove(MouseEventArgs e)
-        {
-            base.OnMouseMove(e);
-            AdornedElement.RaiseEvent(e);
-        }
-
-        protected void DrawConnectionPoint(ConnectionPoint connPoint, Point actualLocation, DrawingContext drawingContext)
-        {
-            if (connPoint.IsEnabled)
-            {
-                // actualLocation is the point on the Edge with respect to the coordinate system defined by the top left corner of the adorned element
-                // We will need this transparent rectangle to make sure OnMouseOver event can be triggered, for hit test.
-                drawingContext.DrawRectangle(Brushes.Transparent, new Pen(Brushes.Transparent, 0),
-                    new Rect(actualLocation + connPoint.HitTestOffset, connPoint.HitTestSize));
-                drawingContext.DrawRectangle(this.renderBrush, this.renderPen,
-                    new Rect(actualLocation + connPoint.DrawingOffset, connPoint.DrawingSize));
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/Connector.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/Connector.cs
deleted file mode 100644 (file)
index d7f0464..0000000
+++ /dev/null
@@ -1,317 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.View;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Automation;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Controls;
-    using System.Windows.Documents;
-    using System.Windows.Media;
-
-    internal class Connector : UserControl
-    {
-        public const double ArrowShapeWidth = 5;
-        
-        public static readonly DependencyProperty PointsProperty = DependencyProperty.Register(
-            "Points", 
-            typeof(PointCollection), 
-            typeof(Connector), 
-            new FrameworkPropertyMetadata(new PointCollection()));
-        
-        public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register(
-            "IsSelected", 
-            typeof(bool), 
-            typeof(Connector), 
-            new FrameworkPropertyMetadata(false));
-        
-        public static readonly DependencyProperty LabelTextProperty = DependencyProperty.Register(
-            "LabelText", 
-            typeof(string), 
-            typeof(Connector), 
-            new FrameworkPropertyMetadata(null));
-
-        public static readonly DependencyProperty HighlightOnHoverProperty = DependencyProperty.Register(
-            "HighlightOnHover",
-            typeof(bool),
-            typeof(Connector),
-            new FrameworkPropertyMetadata(false));
-
-        public static readonly DependencyProperty IsHighlightedForAutoSplitProperty = DependencyProperty.Register(
-            "IsHighlightedForAutoSplit",
-            typeof(bool),
-            typeof(Connector),
-            new FrameworkPropertyMetadata(false));
-
-        public static readonly DependencyProperty IdentityProperty = DependencyProperty.Register(
-            "Identity", 
-            typeof(Guid), 
-            typeof(Connector));
-
-        // Label will be shown only if there is one segment in the connector whose length is greater than this.
-        internal const int MinConnectorSegmentLengthForLabel = 30;
-
-        private DesignerConfigurationService designerConfigurationService = null;
-
-        private FreeFormPanel panel = null;
-        
-        public Connector()
-        {
-            this.Loaded += (sender, e) =>
-            {
-                this.Identity = Guid.NewGuid();
-            };
-        }
-
-        [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly",
-            Justification = "PointCollection is a special WPF class and got special Clone logic, the setter of this property is used several places.")]
-        public PointCollection Points
-        {
-            get { return (PointCollection)GetValue(Connector.PointsProperty); }
-            set { SetValue(Connector.PointsProperty, value); }
-        }
-
-        public bool IsSelected
-        {
-            get { return (bool)GetValue(Connector.IsSelectedProperty); }
-            set { SetValue(Connector.IsSelectedProperty, value); }
-        }
-
-        public string LabelText
-        {
-            get { return (string)GetValue(Connector.LabelTextProperty); }
-            set { SetValue(Connector.LabelTextProperty, value); }
-        }
-
-        public bool HighlightOnHover
-        {
-            get { return (bool)GetValue(Connector.HighlightOnHoverProperty); }
-            set { SetValue(Connector.HighlightOnHoverProperty, value); }
-        }
-
-        public bool IsHighlightedForAutoSplit
-        {
-            get { return (bool)GetValue(Connector.IsHighlightedForAutoSplitProperty); }
-            set { SetValue(Connector.IsHighlightedForAutoSplitProperty, value); }
-        }
-
-        public Guid Identity
-        {
-            get { return (Guid)GetValue(Connector.IdentityProperty); }
-            set { SetValue(Connector.IdentityProperty, value); }
-        }
-
-        public UIElement SourceShape
-        {
-            get
-            {
-                ConnectionPoint sourceConnectionPoint = FreeFormPanel.GetSourceConnectionPoint(this);
-                if (sourceConnectionPoint != null)
-                {
-                    return sourceConnectionPoint.ParentDesigner;
-                }
-
-                return null;
-            }
-        }
-
-        public UIElement DestinationShape
-        {
-            get
-            {
-                ConnectionPoint destinationConnectionPoint = FreeFormPanel.GetDestinationConnectionPoint(this);
-                if (destinationConnectionPoint != null)
-                {
-                    return destinationConnectionPoint.ParentDesigner;
-                }
-
-                return null;
-            }
-        }
-
-        public IAutoSplitContainer AutoSplitContainer
-        {
-            get;
-            set;
-        }
-
-        public virtual FrameworkElement StartDot
-        {
-            get
-            {
-                return null;
-            }
-        }
-
-        private FreeFormPanel Panel
-        {
-            get
-            {
-                if (this.panel == null)
-                {
-                    this.panel = VisualTreeUtils.FindVisualAncestor<FreeFormPanel>(this);
-                }
-
-                return this.panel;
-            }
-        }
-
-        private bool AutoSplitEnabled
-        {
-            get
-            {
-                if (this.designerConfigurationService == null)
-                {
-                    DesignerView view = VisualTreeUtils.FindVisualAncestor<DesignerView>(this);
-                    if (view != null)
-                    {
-                        this.designerConfigurationService = view.Context.Services.GetService<DesignerConfigurationService>();
-                        return this.designerConfigurationService.AutoSplitEnabled;
-                    }
-                    else
-                    {
-                        return false;
-                    }
-                }
-                else
-                {
-                    return this.designerConfigurationService.AutoSplitEnabled;
-                }
-            }
-        }
-
-        public virtual void SetLabelToolTip(object toolTip)
-        {
-            // subclass should be able to override this method to provide ToolTip of connector
-        }
-
-        protected override AutomationPeer OnCreateAutomationPeer()
-        {
-            return new ConnectorAutomationPeer(this, base.OnCreateAutomationPeer());
-        }
-
-        protected override void OnDragEnter(DragEventArgs e)
-        {
-            if (this.AutoSplitEnabled && this.AutoSplitContainer != null && DragDropHelper.GetDraggedObjectCount(e) == 1 && this.AutoSplitContainer.CanAutoSplit(e))
-            {
-                this.HighlightForAutoSplit();
-                this.Panel.RemoveAutoConnectAdorner();
-                this.Panel.CurrentAutoSplitTarget = this;
-            }
-
-            base.OnDragEnter(e);
-        }
-
-        protected override void OnDragLeave(DragEventArgs e)
-        {
-            if (this.IsHighlightedForAutoSplit)
-            {
-                this.DehighlightForAutoSplit();
-                this.Panel.CurrentAutoSplitTarget = null;
-            }
-
-            base.OnDragLeave(e);
-        }
-
-        protected override void OnDrop(DragEventArgs e)
-        {
-            if (this.AutoSplitEnabled && this.IsHighlightedForAutoSplit)
-            {
-                try
-                {
-                    this.AutoSplitContainer.DoAutoSplit(e, this);
-                }
-                finally
-                {
-                    this.DehighlightForAutoSplit();
-                    this.Panel.CurrentAutoSplitTarget = null;
-                    e.Handled = true;
-                }
-            }
-
-            base.OnDrop(e);
-        }
-
-        private void AddAutoSplitAdorner(UIElement shape)
-        {
-            AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(shape);
-            Fx.Assert(adornerLayer != null, "AdornerLayer should not be null.");
-            adornerLayer.Add(new AutoSplitAdorner(shape));
-        }
-
-        private void RemoveAutoSplitAdorner(UIElement shape)
-        {
-            AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(shape);
-            Fx.Assert(adornerLayer != null, "AdornerLayer should not be null.");
-            Adorner[] adorners = adornerLayer.GetAdorners(shape);
-            foreach (Adorner adorner in adorners)
-            {
-                if (adorner is AutoSplitAdorner)
-                {
-                    adornerLayer.Remove(adorner);
-                    return;
-                }
-            }
-        }
-
-        private void HighlightForAutoSplit()
-        {
-            this.IsHighlightedForAutoSplit = true;
-            this.AddAutoSplitAdorner(this.SourceShape);
-            this.AddAutoSplitAdorner(this.DestinationShape);
-        }
-
-        private void DehighlightForAutoSplit()
-        {
-            this.IsHighlightedForAutoSplit = false;
-            this.RemoveAutoSplitAdorner(this.SourceShape);
-            this.RemoveAutoSplitAdorner(this.DestinationShape);
-        }
-
-        private class ConnectorAutomationPeer : UIElementAutomationPeer
-        {
-            private AutomationPeer wrappedAutomationPeer;
-
-            public ConnectorAutomationPeer(FrameworkElement owner, AutomationPeer wrappedAutomationPeer)
-                : base(owner)
-            {
-                this.wrappedAutomationPeer = wrappedAutomationPeer;
-            }
-
-            protected override string GetItemStatusCore()
-            {
-                UIElement sourceDesigner = VirtualizedContainerService.TryGetVirtualizedElement(FreeFormPanel.GetSourceConnectionPoint(this.Owner).ParentDesigner);
-                string sourceId = sourceDesigner.GetValue(AutomationProperties.ItemStatusProperty) as string;
-                UIElement destinationDesigner = VirtualizedContainerService.TryGetVirtualizedElement(FreeFormPanel.GetDestinationConnectionPoint(this.Owner).ParentDesigner);
-                string destinationId = destinationDesigner.GetValue(AutomationProperties.ItemStatusProperty) as string;
-                return string.Format(CultureInfo.InvariantCulture, "Source={0} Destination={1} Points={2}", sourceId, destinationId, ((Connector)this.Owner).Points);
-            }
-
-            protected override string GetClassNameCore()
-            {
-                return this.wrappedAutomationPeer.GetClassName();
-            }
-
-            protected override string GetNameCore()
-            {
-                return this.wrappedAutomationPeer.GetName();
-            }
-
-            protected override string GetAutomationIdCore()
-            {
-                return this.wrappedAutomationPeer.GetAutomationId();
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorCreationAdorner.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorCreationAdorner.cs
deleted file mode 100644 (file)
index ee73e28..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System.Activities.Presentation;
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Windows;
-    using System.Windows.Documents;
-    using System.Windows.Media;
-    using System.Runtime;
-
-    sealed class ConnectorCreationAdorner : Adorner
-    {
-        List<Point> linkPoints;
-        public ConnectorCreationAdorner(UIElement adornedElement, List<Point> linkPoints)
-            : base(adornedElement)
-        {
-            Fx.Assert(adornedElement != null, "adornedElement is null");
-            this.IsHitTestVisible = false;
-            this.linkPoints = linkPoints;
-        }
-
-        protected override void OnRender(DrawingContext drawingContext)
-        {
-            if (drawingContext != null)
-            {
-                SolidColorBrush renderBrush = new SolidColorBrush(WorkflowDesignerColors.WorkflowViewElementSelectedBorderColor);
-                Pen renderPen = new Pen(renderBrush, FreeFormPanel.ConnectorEditorThickness);
-                for (int i = 0; i < linkPoints.Count - 1; i++)
-                {
-                    drawingContext.DrawLine(renderPen, linkPoints[i], linkPoints[i + 1]);
-                }
-            }
-            base.OnRender(drawingContext);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorEditor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorEditor.cs
deleted file mode 100644 (file)
index 79f0062..0000000
+++ /dev/null
@@ -1,620 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System;
-    using System.Activities.Presentation;
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Documents;
-    using System.Windows.Input;
-    using System.Runtime;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows.Media;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-
-    internal class ConnectorEditor
-    {
-        const double EditPointRadius = 4;
-        const double EditPointHitTestRadius = 9;
-        const int minLengthForSegmentEditPoint = 10;
-        EditPoint activeEditPoint;
-        AdornerLayer adornerLayer;
-        Connector editedConnector;
-        List<EditPoint> editPoints;
-        FreeFormPanel parentPanel;
-
-        public ConnectorEditor(FreeFormPanel panel, Connector connector)
-        {
-            if (panel == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("panel"));
-            }
-            if (connector == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("connector"));
-            }
-            this.editPoints = new List<EditPoint>();
-            this.parentPanel = panel;
-            this.editedConnector = connector;
-            this.activeEditPoint = null;
-            connector.IsSelected = true;
-            // When the ConnectorEditor is active, we allow reconnecting the start point of the Connector instead
-            // of creating a new transition that shares the same trigger. So we need to disable tooltips and 
-            // highlighting effects for all overlapping start dots.
-            this.SetIsHitTestVisibleForOverlappingStartDots(false);
-            DisplayEditPoints();
-        }
-        public bool BeingEdited
-        {
-            get
-            {
-                return (this.activeEditPoint != null);
-            }
-        }
-
-        public bool IsConnectorStartBeingMoved
-        {
-            get
-            {
-                return (this.BeingEdited && this.activeEditPoint.Type == EditPoint.EditPointTypes.ConnectionEditPoint
-                    && this.editedConnector.Points[0] != this.EditPoints[0].Location);
-            }
-        }
-
-        public bool IsConnectorEndBeingMoved
-        {
-            get
-            {
-                return (this.BeingEdited && this.activeEditPoint.Type == EditPoint.EditPointTypes.ConnectionEditPoint
-                    && this.editedConnector.Points[this.editedConnector.Points.Count - 1] != this.EditPoints[this.EditPoints.Count - 1].Location);
-            }
-        }
-
-        public Connector Connector
-        {
-            get
-            {
-                return this.editedConnector;
-            }
-
-            set
-            {
-                this.editedConnector = value;
-            }
-        }
-
-        List<EditPoint> EditPoints
-        {
-            get
-            {
-                return this.editPoints;
-            }
-        }
-
-        public List<Point> ConnectorEditorLocation
-        {
-            get
-            {
-                return this.GetPointsFromEditPoints();
-            }
-        }
-
-        void SetIsHitTestVisibleForOverlappingStartDots(bool hitTestVisible)
-        {
-            ConnectionPoint srcConnectionPoint = FreeFormPanel.GetSourceConnectionPoint(this.Connector);
-            foreach (Connector overlappingConnector in srcConnectionPoint.AttachedConnectors)
-            {
-                if (overlappingConnector.StartDot != null)
-                {
-                    overlappingConnector.StartDot.IsHitTestVisible = hitTestVisible;
-                }
-            }
-        }
-
-        //If the result is true this method also sets the currently active edit point.
-        public bool EditPointsHitTest(Point pt)
-        {
-            if (this.EditPoints.Count > 0)
-            {
-                foreach (EditPoint editPoint in this.EditPoints)
-                {
-                    if (DesignerGeometryHelper.DistanceBetweenPoints(pt, editPoint.Location) <= EditPointHitTestRadius)
-                    {
-                        this.activeEditPoint = editPoint;
-                        return true;
-                    }
-                }
-            }
-            return false;
-        }
-
-        //Connector editing is completed. This function saves the state of the connectorEditor into the corresponding connector.
-        //Returns whether the Editor was persisted or not. It might not be persisted if Connector end points do not lie on a designer.
-        public bool Persist(Point finalSnappedPoint)
-        {
-            List<Point> segments = new List<Point>();
-            this.Update(finalSnappedPoint);
-            if (this.activeEditPoint.Type == EditPoint.EditPointTypes.ConnectionEditPoint)
-            {
-                return false;
-            }
-            segments = this.GetPointsFromEditPoints();
-            this.parentPanel.UpdateConnectorPoints(Connector, segments);
-            this.activeEditPoint = null;
-            RemoveAdorners();
-            DisplayEditPoints();
-            return true;
-        }
-
-        //The Connector editor is to be destroyed. Remove the adorners on the editor. activeEditPoint=null sets BeingEdited property to false.
-        public void Remove()
-        {
-            this.activeEditPoint = null;
-            RemoveAdorners();
-            this.EditPoints.Clear();
-            this.Connector.IsSelected = false;
-            // Restore the IsHitTestVisible property
-            this.SetIsHitTestVisibleForOverlappingStartDots(true);
-            this.Connector = null;
-            this.parentPanel = null;
-        }
-
-        //This method removes the existing adorner on the edited connector, updates the active edit points and creates new adorners.
-        public void Update(Point newPoint)
-        {
-            RemoveAdorners();
-            UpdateEditPoints(newPoint);
-            Fx.Assert(this.activeEditPoint != null, "activeEditPoint is null");
-            adornerLayer.Add(new EditPointAdorner(this, editedConnector, true));
-        }
-
-        //Add edit points of specified type
-        void AddEditPoints(EditPoint.EditPointTypes editPointType)
-        {
-            if (editPointType == EditPoint.EditPointTypes.ConnectionEditPoint)
-            {
-                if (this.editPoints.Count == 0 || !this.editPoints[0].Location.Equals(editedConnector.Points[0]))
-                {
-                    this.editPoints.Insert(0, new EditPoint(EditPoint.EditPointTypes.ConnectionEditPoint, editedConnector.Points[0]));
-                }
-
-                if (this.editPoints.Count < 2 || !this.editPoints[this.editPoints.Count - 1].Equals(editedConnector.Points[editedConnector.Points.Count - 1]))
-                {
-                    editPoints.Add(new EditPoint(EditPoint.EditPointTypes.ConnectionEditPoint, editedConnector.Points[editedConnector.Points.Count - 1]));
-                }
-            }
-            else if (editPointType == EditPoint.EditPointTypes.MultiSegmentEditPoint)
-            {
-                if (this.editPoints.Count == 2)
-                {
-                    List<Point> segments = new List<Point>(this.editedConnector.Points);
-                    if (segments.Count > 0)
-                    {
-                        segments.RemoveAt(0);
-                        segments.RemoveAt(segments.Count - 1);
-                    }
-
-                    for (int i = 0; i < segments.Count; i++)
-                    {
-                        this.editPoints.Insert(this.editPoints.Count - 1, new EditPoint(EditPoint.EditPointTypes.MultiSegmentEditPoint, segments[i]));
-                    }
-                }
-                else
-                {
-                    Fx.Assert(false, "EditPoints.Count is not 2.");
-                }
-            }
-        }
-
-        void CreateEditPoints()
-        {
-            this.editPoints.Clear();
-
-            AddEditPoints(EditPoint.EditPointTypes.ConnectionEditPoint);
-            AddEditPoints(EditPoint.EditPointTypes.MultiSegmentEditPoint);
-
-            bool validEditPoints = ValidateEditPoints();
-            Fx.Assert(validEditPoints, "Validating EditPoints failed.");
-        }
-
-        void DisplayEditPoints()
-        {
-            CreateEditPoints();
-            adornerLayer = AdornerLayer.GetAdornerLayer(editedConnector);
-            if (adornerLayer != null)
-            {
-                adornerLayer.Add(new EditPointAdorner(this, editedConnector, false));
-            }
-        }
-
-        List<Point> GetPointsFromEditPoints()
-        {
-            List<Point> segments = new List<Point>();
-            //Connection end points will never be moved/removed in following two function calls. Hence passing null as pointsToRetain.
-            RemoveEditPointSegmentsWithinTolerance(null);
-            RemoveCoincidingEditPoints(null);
-            for (int i = 0; i < this.EditPoints.Count; i++)
-            {
-                segments.Add(this.EditPoints[i].Location);
-            }
-            return segments;
-        }
-
-        void RemoveAdorners()
-        {
-            if (adornerLayer != null && editedConnector != null)
-            {
-                Adorner[] adorners = adornerLayer.GetAdorners(editedConnector);
-                if (adorners != null)
-                {
-                    foreach (Adorner adorner in adorners)
-                    {
-                        adornerLayer.Remove(adorner);
-                    }
-                }
-            }
-        }
-
-        //Remove points with the same slope
-        void RemoveCoincidingEditPoints()
-        {
-            if (this.editPoints.Count < 2 ||
-                this.editPoints[0].Type != EditPoint.EditPointTypes.ConnectionEditPoint ||
-                this.editPoints[this.editPoints.Count - 1].Type != EditPoint.EditPointTypes.ConnectionEditPoint ||
-                (this.activeEditPoint != null && this.activeEditPoint.Type == EditPoint.EditPointTypes.ConnectionEditPoint))
-            {
-                return;
-            }
-
-            //Create list of points to retain
-            List<EditPoint> editPointsToRetain = new List<EditPoint>(this.editPoints.Count);
-            for (int i = 0; i < this.editPoints.Count; i++)
-            {
-                if (this.editPoints[i].Type != EditPoint.EditPointTypes.MultiSegmentEditPoint ||
-                    this.editPoints[i] == this.activeEditPoint)
-                {
-                    editPointsToRetain.Add(this.editPoints[i]);
-                }
-            }
-
-            //Step1: Get rid of all the line segments which are within tolerance range
-            RemoveEditPointSegmentsWithinTolerance(editPointsToRetain);
-
-            //Step2: We should make sure that the active edit point is always retained but those points which are coincidental are always removed
-            RemoveCoincidingEditPoints(editPointsToRetain);
-
-            //Step3: Go through each segment and ensure that all the segments are either vertical or horizontal
-            for (int i = 0; i < this.editPoints.Count - 1; i++)
-            {
-                EditPoint current = this.editPoints[i];
-                EditPoint next = this.editPoints[i + 1];
-
-                double slope = DesignerGeometryHelper.SlopeOfLineSegment(current.Location, next.Location);
-                if (slope != 0 && slope != double.MaxValue)
-                {
-                    Point location = (slope < 1) ? new Point(next.Location.X, current.Location.Y) : new Point(current.Location.X, next.Location.Y);
-                    this.editPoints.Insert(i + 1, new EditPoint(EditPoint.EditPointTypes.MultiSegmentEditPoint, location));
-                }
-            }
-        }
-
-        void RemoveEditPointSegmentsWithinTolerance(List<EditPoint> pointsToRetain)
-        {
-            for (int i = 1; i < this.editPoints.Count - 1; i++)
-            {
-                EditPoint previous = this.editPoints[i - 1];
-                EditPoint current = this.editPoints[i];
-                EditPoint next = this.editPoints[i + 1];
-
-                if (pointsToRetain == null || !pointsToRetain.Contains(current))
-                {
-                    double distance = DesignerGeometryHelper.DistanceOfLineSegments(new Point[] { previous.Location, current.Location });
-                    if (distance < ConnectorEditor.EditPointRadius && next.Type == EditPoint.EditPointTypes.MultiSegmentEditPoint)
-                    {
-                        double slope = DesignerGeometryHelper.SlopeOfLineSegment(current.Location, next.Location);
-                        next.Location = (slope < 1) ? new Point(next.Location.X, previous.Location.Y) : new Point(previous.Location.X, next.Location.Y);
-                        this.editPoints.Remove(current);
-                        i -= 1;
-                    }
-                    else
-                    {
-                        distance = DesignerGeometryHelper.DistanceOfLineSegments(new Point[] { current.Location, next.Location });
-                        if (distance < ConnectorEditor.EditPointRadius && previous.Type == EditPoint.EditPointTypes.MultiSegmentEditPoint)
-                        {
-                            double slope = DesignerGeometryHelper.SlopeOfLineSegment(previous.Location, current.Location);
-                            previous.Location = (slope < 1) ? new Point(previous.Location.X, next.Location.Y) : new Point(next.Location.X, previous.Location.Y);
-                            this.editPoints.Remove(current);
-                            i--;
-                        }
-                    }
-                }
-            }
-
-        }
-
-        void RemoveCoincidingEditPoints(List<EditPoint> pointsToRetain)
-        {
-            for (int i = 1; i < this.EditPoints.Count - 1; i++)
-            {
-                EditPoint current = this.EditPoints[i];
-                if (pointsToRetain == null || !pointsToRetain.Contains(current))
-                {
-                    EditPoint previous = this.EditPoints[i - 1];
-                    EditPoint next = this.EditPoints[i + 1];
-                    double slope1 = DesignerGeometryHelper.SlopeOfLineSegment(previous.Location, current.Location);
-                    double slope2 = DesignerGeometryHelper.SlopeOfLineSegment(current.Location, next.Location);
-                    if (Math.Abs(slope1) == Math.Abs(slope2))
-                    {
-                        this.EditPoints.Remove(current);
-                        i -= 1;
-                    }
-                }
-            }
-        }
-
-        //Remove edit points of specified type
-        //This method does not remove this.activeEditPoint.
-        void RemoveEditPoints(EditPoint.EditPointTypes editPointType)
-        {
-            List<EditPoint> editPointsToRemove = new List<EditPoint>();
-            for (int i = 0; i < this.editPoints.Count; i++)
-            {
-                EditPoint editPoint = this.editPoints[i];
-                if (editPoint.Type == editPointType)
-                {
-                    editPointsToRemove.Add(editPoint);
-                }
-            }
-
-            for (int i = 0; i < editPointsToRemove.Count; i++)
-            {
-                EditPoint editPoint = editPointsToRemove[i];
-                if (editPoint != this.activeEditPoint)
-                {
-                    this.editPoints.Remove(editPoint);
-                }
-            }
-        }
-
-        [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "This is a legacy algorithm.")]
-        void UpdateEditPoints(Point newPoint)
-        {
-            if (this.editPoints.Count < 2 ||
-                this.editPoints[0].Type != EditPoint.EditPointTypes.ConnectionEditPoint ||
-                this.editPoints[this.editPoints.Count - 1].Type != EditPoint.EditPointTypes.ConnectionEditPoint)
-            {
-                Fx.Assert(false, "EditPoints are invalid");
-                return;
-            }
-
-            if (this.activeEditPoint != null)
-            {
-                int activeEditPointIndex = this.editPoints.IndexOf(this.activeEditPoint);
-                EditPoint previous = (activeEditPointIndex > 0) ? this.editPoints[activeEditPointIndex - 1] : null;
-                EditPoint next = (activeEditPointIndex < this.editPoints.Count - 1) ? this.editPoints[activeEditPointIndex + 1] : null;
-
-                //Note that extra edit points are only added if we are connected to connection point
-                if (previous != null && previous.Type == EditPoint.EditPointTypes.ConnectionEditPoint)
-                {
-                    double slopeOfLine = DesignerGeometryHelper.SlopeOfLineSegment(previous.Location, this.activeEditPoint.Location);
-                    Orientation orientation = (Math.Abs(slopeOfLine) < 1) ? Orientation.Horizontal : Orientation.Vertical;
-
-                    int editPointOffset = Convert.ToInt32(DesignerGeometryHelper.DistanceBetweenPoints(previous.Location, (next != null) ? next.Location : this.activeEditPoint.Location)) / 4;
-                    if (orientation == Orientation.Horizontal)
-                    {
-                        editPointOffset *= (previous.Location.X < this.activeEditPoint.Location.X) ? 1 : -1;
-                    }
-                    else
-                    {
-                        editPointOffset *= (previous.Location.Y < this.activeEditPoint.Location.Y) ? 1 : -1;
-                    }
-
-                    activeEditPointIndex = this.editPoints.IndexOf(this.activeEditPoint);
-                    Point editPointLocation = (orientation == Orientation.Horizontal) ? new Point(previous.Location.X + editPointOffset, previous.Location.Y) : new Point(previous.Location.X, previous.Location.Y + editPointOffset);
-                    previous = new EditPoint(EditPoint.EditPointTypes.MultiSegmentEditPoint, editPointLocation);
-                    this.editPoints.InsertRange(activeEditPointIndex, new EditPoint[] { new EditPoint(EditPoint.EditPointTypes.MultiSegmentEditPoint, editPointLocation), previous });
-                }
-
-                if (next != null && next.Type == EditPoint.EditPointTypes.ConnectionEditPoint)
-                {
-                    double slopeOfLine = DesignerGeometryHelper.SlopeOfLineSegment(this.activeEditPoint.Location, next.Location);
-                    Orientation orientation = (Math.Abs(slopeOfLine) < 1) ? Orientation.Horizontal : Orientation.Vertical;
-
-                    int editPointOffset = Convert.ToInt32(DesignerGeometryHelper.DistanceBetweenPoints((previous != null) ? previous.Location : this.activeEditPoint.Location, next.Location)) / 4;
-                    if (orientation == Orientation.Horizontal)
-                    {
-                        editPointOffset *= (this.activeEditPoint.Location.X < next.Location.X) ? -1 : 1;
-                    }
-                    else
-                    {
-                        editPointOffset *= (this.activeEditPoint.Location.Y < next.Location.Y) ? -1 : 1;
-                    }
-
-                    activeEditPointIndex = this.editPoints.IndexOf(this.activeEditPoint);
-                    Point editPointLocation = (orientation == Orientation.Horizontal) ? new Point(next.Location.X + editPointOffset, next.Location.Y) : new Point(next.Location.X, next.Location.Y + editPointOffset);
-                    next = new EditPoint(EditPoint.EditPointTypes.MultiSegmentEditPoint, editPointLocation);
-                    this.editPoints.InsertRange(activeEditPointIndex + 1, new EditPoint[] { next, new EditPoint(EditPoint.EditPointTypes.MultiSegmentEditPoint, editPointLocation) });
-                }
-
-                if (this.activeEditPoint.Type == EditPoint.EditPointTypes.ConnectionEditPoint)
-                {
-                    Fx.Assert(this.editPoints[0].Type == EditPoint.EditPointTypes.ConnectionEditPoint, "EditPoint type is wrong.");
-                    Fx.Assert(this.editPoints[editPoints.Count - 1].Type == EditPoint.EditPointTypes.ConnectionEditPoint, "EditPoint type is wrong.");
-                    this.activeEditPoint.Location = newPoint;
-
-                    Fx.Assert(this.editPoints.Count > 0, "Some edit point should exist");
-                    ConnectionPoint targetConnPt = null;
-                    Point[] points = null;
-                    Point begin = this.editPoints[0].Location;
-                    Point end = this.editPoints[this.editPoints.Count - 1].Location;
-
-                    if (typeof(ConnectionPointsAdorner).IsAssignableFrom(Mouse.DirectlyOver.GetType()))
-                    {
-                        ConnectionPointsAdorner connPtsAdorner = Mouse.DirectlyOver as ConnectionPointsAdorner;
-                        targetConnPt = FreeFormPanel.ConnectionPointHitTest(newPoint, connPtsAdorner);
-                    }
-
-                    if (activeEditPointIndex == 0)
-                    {
-                        // We are dragging the source point of a connector.
-                        ConnectionPoint destConnPt = FreeFormPanel.GetDestinationConnectionPoint(this.editedConnector);
-                        if (targetConnPt != null)
-                        {
-                            points = ConnectorRouter.Route(parentPanel, targetConnPt, destConnPt);
-                            this.activeEditPoint.Location = targetConnPt.Location;
-                        }
-                        else
-                        {
-                            points = ConnectorRouter.Route(parentPanel, begin, destConnPt);
-                        }
-                    }
-                    else
-                    {
-                        // We are dragging the destination point of a connector.
-                        ConnectionPoint srcConnPt = FreeFormPanel.GetSourceConnectionPoint(this.editedConnector);
-                        if (targetConnPt != null)
-                        {
-                            points = ConnectorRouter.Route(parentPanel, srcConnPt, targetConnPt);
-                            this.activeEditPoint.Location = targetConnPt.Location;
-                        }
-                        else
-                        {
-                            points = ConnectorRouter.Route(parentPanel, srcConnPt, end);
-                        }
-                    }
-
-                    //When we start editing the end point we need to clear the slate and start over
-                    List<EditPoint> newEditPoints = new List<EditPoint>();
-                    if (points != null && points.Length > 1)
-                    {
-                        RemoveEditPoints(EditPoint.EditPointTypes.MultiSegmentEditPoint);
-                        for (int i = 1; i < points.Length - 1; ++i)
-                        {
-                            newEditPoints.Add(new EditPoint(EditPoint.EditPointTypes.MultiSegmentEditPoint, points[i]));
-                        }
-                        this.editPoints.InsertRange(1, newEditPoints.ToArray());
-                    }
-                }
-                else if (this.activeEditPoint.Type == EditPoint.EditPointTypes.MultiSegmentEditPoint)
-                {
-                    if (previous != null && previous.Type != EditPoint.EditPointTypes.ConnectionEditPoint && next != null && next.Type != EditPoint.EditPointTypes.ConnectionEditPoint)
-                    {
-                        //Update the previous point
-                        double slopeOfLine = DesignerGeometryHelper.SlopeOfLineSegment(previous.Location, this.activeEditPoint.Location);
-                        Orientation orientation = (Math.Abs(slopeOfLine) < 1) ? Orientation.Horizontal : Orientation.Vertical;
-                        previous.Location = (orientation == Orientation.Horizontal) ? new Point(previous.Location.X, newPoint.Y) : new Point(newPoint.X, previous.Location.Y);
-
-                        //Update the next point
-                        slopeOfLine = DesignerGeometryHelper.SlopeOfLineSegment(this.activeEditPoint.Location, next.Location);
-                        orientation = (Math.Abs(slopeOfLine) < 1) ? Orientation.Horizontal : Orientation.Vertical;
-                        next.Location = (orientation == Orientation.Horizontal) ? new Point(next.Location.X, newPoint.Y) : new Point(newPoint.X, next.Location.Y);
-
-                        //Update the current point
-                        this.activeEditPoint.Location = newPoint;
-                    }
-                    else
-                    {
-                        Fx.Assert(false, "Should not be here. UpdateEditPoints failed.");
-                    }
-                }
-            }
-
-            // Remove all the redundant edit points
-            RemoveCoincidingEditPoints();
-
-            bool validEditPoints = ValidateEditPoints();
-            Fx.Assert(validEditPoints, "Validating EditPoints failed.");
-        }
-
-        bool ValidateEditPoints()
-        {
-            if (this.editPoints.Count < 2)
-            {
-                return false;
-            }
-
-            return true;
-        }
-
-        class EditPoint
-        {
-            EditPointTypes editPointType;
-            Point point;
-
-            public EditPoint(EditPointTypes editPointType, Point point)
-            {
-                this.editPointType = editPointType;
-                this.point = point;
-            }
-
-            public Point Location
-            {
-                get
-                {
-                    return this.point;
-                }
-
-                set
-                {
-                    this.point = value;
-                }
-            }
-
-            public EditPointTypes Type
-            {
-                get
-                {
-                    return this.editPointType;
-                }
-            }
-
-            public enum EditPointTypes
-            {
-                ConnectionEditPoint = 1, MultiSegmentEditPoint
-            }
-        }
-
-        sealed class EditPointAdorner : Adorner
-        {
-            ConnectorEditor adornedEditor;
-            bool drawLines;
-
-            public EditPointAdorner(ConnectorEditor cEditor, UIElement adornedElement, bool shouldDrawLines)
-                : base(adornedElement)
-            {
-                Fx.Assert(adornedElement != null, "Adorned element is null.");
-                adornedEditor = cEditor;
-                this.IsHitTestVisible = false;
-                this.drawLines = shouldDrawLines;
-            }
-
-            protected override void OnRender(DrawingContext drawingContext)
-            {
-                if (drawingContext != null)
-                {
-                    int i = 0;
-                    SolidColorBrush renderBrush = new SolidColorBrush(WorkflowDesignerColors.WorkflowViewElementSelectedBackgroundColor);
-                    renderBrush.Opacity = FreeFormPanel.ConnectorEditorOpacity;
-                    Pen renderPen = new Pen(new SolidColorBrush(WorkflowDesignerColors.WorkflowViewElementSelectedBorderColor), FreeFormPanel.ConnectorEditorThickness);
-                    double renderRadius = ConnectorEditor.EditPointRadius;
-                    for (i = 0; i < adornedEditor.EditPoints.Count - 1; i++)
-                    {
-                        drawingContext.DrawEllipse(renderBrush, renderPen, adornedEditor.EditPoints[i].Location, renderRadius, renderRadius);
-                        if (drawLines)
-                        {
-                            drawingContext.DrawLine(renderPen, adornedEditor.EditPoints[i].Location, adornedEditor.EditPoints[i + 1].Location);
-                        }
-                    }
-                    drawingContext.DrawEllipse(renderBrush, renderPen, adornedEditor.EditPoints[i].Location, renderRadius, renderRadius);
-                }
-                base.OnRender(drawingContext);
-                Keyboard.Focus(adornedEditor.Connector);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorIdentityConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorIdentityConverter.cs
deleted file mode 100644 (file)
index 0a5d8b1..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System.Windows.Data;
-    using System.Runtime;
-    using System.Windows.Media;
-    using System.Globalization;
-
-    class ConnectorIdentityConverter : IMultiValueConverter
-    {
-        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-        {
-            Fx.Assert(values[0] is Guid, "The first value should be a Guid");
-            Fx.Assert(values[1] is PointCollection, "The second value should be a PointCollection");
-            Guid identityGuid = (Guid)values[0];
-            PointCollection points = (PointCollection)values[1];
-            return identityGuid + "," + points.ToString();
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorLabelMarginConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorLabelMarginConverter.cs
deleted file mode 100644 (file)
index cd82239..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System;
-    using System.Globalization;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Windows.Media;
-    using System.Diagnostics.CodeAnalysis;
-
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "The class is used in xaml.")]
-    class ConnectorLabelMarginConverter : IMultiValueConverter
-    {
-        const double EPS = 1e-6;
-
-        [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", Justification = "The class is only used internally and not accessible externally.")]
-        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-        {
-            Thickness margin = new Thickness(0);
-            PointCollection connectorPoints = values[0] as PointCollection;
-            // 8 and 4 is calcuated from the margin / padding settings related to the label in xaml
-            double labelBorderWidth = (double)values[1] + 8;
-            double labelBorderHeight = (double)values[2] + 4;
-            if (connectorPoints != null)
-            {
-                int longestSegmentIndex;
-                DesignerGeometryHelper.LongestSegmentLength(connectorPoints, out longestSegmentIndex);
-                if (longestSegmentIndex >= 0)
-                {
-                    Point labelLocation = DesignerGeometryHelper.MidPointOfLineSegment(connectorPoints[longestSegmentIndex], connectorPoints[longestSegmentIndex + 1]);
-                    labelLocation.X = (int)(labelLocation.X - labelBorderWidth / 2 + EPS);
-                    labelLocation.Y = (int)(labelLocation.Y - labelBorderHeight / 2 + EPS);
-                    margin.Top = labelLocation.Y;
-                    margin.Left = labelLocation.X;
-                }
-            }
-            return margin;
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorLabelVisibilityConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorLabelVisibilityConverter.cs
deleted file mode 100644 (file)
index e904ae4..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System;
-    using System.Globalization;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Windows.Media;
-    using System.Diagnostics.CodeAnalysis;
-
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "The class in used in xaml.")]
-    class ConnectorLabelVisibilityConverter : IMultiValueConverter
-    {
-
-        [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", Justification = "The class is only used internally and not accessible externally.")]
-        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-        {
-            Visibility connectorLabelVisibility = Visibility.Collapsed;
-            string labelText = values[0] as string;
-            PointCollection connectorPoints = values[1] as PointCollection;
-            if (!String.IsNullOrEmpty(labelText) && connectorPoints != null)
-            {
-                int maxSegmentStartPoint;
-                if (DesignerGeometryHelper.LongestSegmentLength(connectorPoints, out maxSegmentStartPoint) > Connector.MinConnectorSegmentLengthForLabel)
-                {
-                    connectorLabelVisibility = Visibility.Visible;
-                }
-            }
-            return connectorLabelVisibility;
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorMovedEventArgs.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorMovedEventArgs.cs
deleted file mode 100644 (file)
index 0e19b47..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Windows;
-
-    class ConnectorMovedEventArgs : EventArgs
-    {
-        List<Point> newConnectorLocation;
-
-        public ConnectorMovedEventArgs(List<Point> newConnectorLocation)
-        {
-            this.newConnectorLocation = newConnectorLocation;
-        }
-
-        public List<Point> NewConnectorLocation
-        {
-            get
-            {
-                return this.newConnectorLocation;
-            }
-        }
-    }
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorMovedEventHandler.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorMovedEventHandler.cs
deleted file mode 100644 (file)
index bb1a648..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    internal delegate void ConnectorMovedEventHandler(object sender, ConnectorMovedEventArgs e);
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorPointsToArrowMarginConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorPointsToArrowMarginConverter.cs
deleted file mode 100644 (file)
index 53d9d78..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System;
-    using System.Globalization;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Windows.Media;
-    using System.Diagnostics.CodeAnalysis;
-
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "The class is used in xaml.")]
-    class ConnectorPointsToArrowMarginConverter : IMultiValueConverter
-    {
-        [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", Justification = "The class is only used internally and not accessible externally.")]
-        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-        {
-
-            Thickness margin = new Thickness(0);
-            PointCollection points = values[0] as PointCollection;
-            RotateTransform transform = values[1] as RotateTransform;
-            int offset = int.Parse(parameter.ToString(), CultureInfo.InvariantCulture);
-            if (points != null && points.Count > 0)
-            {
-                margin.Left = points[points.Count - 1].X - offset;
-                margin.Top = points[points.Count - 1].Y - offset;
-            }
-            if (transform != null)
-            {
-                switch ((int)transform.Angle)
-                {
-                    case 0:
-                        margin.Left -= offset;
-                        break;
-                    case 90:
-                        margin.Top -= offset;
-                        break;
-                    case 180:
-                        margin.Left += offset;
-                        break;
-                    case 270:
-                        margin.Top += offset;
-                        break;
-                }
-            }
-            return margin;
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorPointsToArrowTransformConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorPointsToArrowTransformConverter.cs
deleted file mode 100644 (file)
index b78118b..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System;
-    using System.Diagnostics;
-    using System.Runtime;
-    using System.Globalization;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Windows.Media;
-    using System.Diagnostics.CodeAnalysis;
-
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "The class is used in xaml.")]
-    class ConnectorPointsToArrowTransformConverter : IValueConverter
-    {
-        [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", Justification = "The class is only used internally and not accessible externally.")]
-        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
-        {
-            RotateTransform rotateTransform = new RotateTransform(0, double.Parse(parameter.ToString(), CultureInfo.InvariantCulture), double.Parse(parameter.ToString(), CultureInfo.InvariantCulture));
-            PointCollection points = value as PointCollection;
-            if (points != null && points.Count >= 2)
-            {
-                rotateTransform.Angle = (int)GetArrowOrientation(points);
-            }
-            return rotateTransform;
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-
-        static ArrowOrientation GetArrowOrientation(PointCollection points)
-        {
-            Fx.Assert(points.Count >= 2, "Invalid connector");
-            ArrowOrientation orientation;
-            Point srcPoint = points[points.Count - 2];
-            Point destPoint = points[points.Count - 1];
-
-            if (srcPoint.X == destPoint.X)
-            {
-                orientation = ArrowOrientation.Top;
-                if (destPoint.Y > srcPoint.Y)
-                {
-                    orientation = ArrowOrientation.Bottom;
-                }
-            }
-            else
-            {
-                orientation = ArrowOrientation.Left;
-                if (destPoint.X > srcPoint.X)
-                {
-                    orientation = ArrowOrientation.Right;
-                }
-            }
-            return orientation;
-        }
-
-        enum ArrowOrientation
-        {
-            Right = 0, Bottom = 90, Left = 180, Top = 270
-        };
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorPointsToSegmentsConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorPointsToSegmentsConverter.cs
deleted file mode 100644 (file)
index 7f2ac38..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Windows.Media;
-    using System.Diagnostics.CodeAnalysis;
-
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "The class is used in xaml.")]
-    class ConnectorPointsToSegmentsConverter : IValueConverter
-    {
-        const double RoundRadius = 4.0;
-
-        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
-        {
-            PathSegmentCollection retVal = new PathSegmentCollection();
-            PointCollection pointCollection = value as PointCollection;
-            if (RoundRadius > 0)
-            {
-                if (pointCollection != null && pointCollection.Count > 0)
-                {
-                    retVal.Add(new LineSegment(pointCollection[0], true));
-                    double curSegmentArcUsed = 0;
-                    for (int i = 1; i < pointCollection.Count - 1; i++)
-                    {
-                        double dist1 = DesignerGeometryHelper.DistanceBetweenPoints(pointCollection[i - 1], pointCollection[i]);
-                        double dist2 = DesignerGeometryHelper.DistanceBetweenPoints(pointCollection[i], pointCollection[i + 1]);
-                        if (dist1 - curSegmentArcUsed > RoundRadius &&
-                            dist2 > RoundRadius)
-                        {
-                            //build rounded arc at line join.
-                            curSegmentArcUsed = RoundRadius;
-                            Vector firstSegmentPointingVector = new Vector(pointCollection[i].X - pointCollection[i - 1].X, pointCollection[i].Y - pointCollection[i - 1].Y);
-                            Vector secondSegmentPointingVector = new Vector(pointCollection[i + 1].X - pointCollection[i].X, pointCollection[i + 1].Y - pointCollection[i].Y);
-                            firstSegmentPointingVector.Normalize();
-                            secondSegmentPointingVector.Normalize();
-                            Point turningPoint1 = Point.Add(pointCollection[i - 1], Vector.Multiply(dist1 - RoundRadius, firstSegmentPointingVector));
-                            Point turningPoint2 = Point.Add(pointCollection[i], Vector.Multiply(RoundRadius, secondSegmentPointingVector));
-                            double crossProductZ = firstSegmentPointingVector.X * secondSegmentPointingVector.Y - firstSegmentPointingVector.Y * secondSegmentPointingVector.X;
-                            retVal.Add(new LineSegment(turningPoint1, true));
-                            retVal.Add(new ArcSegment(turningPoint2, new Size(RoundRadius, RoundRadius), 0, false, crossProductZ > 0 ? SweepDirection.Clockwise : SweepDirection.Counterclockwise, true));
-                        }
-                        else
-                        {
-                            curSegmentArcUsed = 0;
-                            retVal.Add(new LineSegment(pointCollection[i], true));
-                        }
-                    }
-                    retVal.Add(new LineSegment(pointCollection[pointCollection.Count - 1], true));
-                }
-            }
-            return retVal;
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorRouter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorRouter.cs
deleted file mode 100644 (file)
index 01defeb..0000000
+++ /dev/null
@@ -1,1515 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Runtime;
-    using System.Activities.Presentation.View;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Windows.Input;
-
-    //
-    // ConnectorRouter class implements the cannonical Hightower's algorithm.
-    // See reference paper: Hightower, "A solution to line-routing problem on the continuous plane", DAC-69.
-    //
-    // Algorithm advantages: 
-    //      1. Very fast.
-    //      2. Low memory requirement.
-    //      2. Very flexible.
-    //
-    // Algorithm disadvantages:
-    //      1. Do not guarantee to generate the shortest path.
-    //      2. May fail to find a route even if it does exist.
-    //
-
-    internal static class ConnectorRouter
-    {
-        const int connectorMargin = 30;
-        // Used for second refinement algorithm: prevent segment overlapping with the shape edge.
-        const int lineMargin = 10;
-        // Used for inner blockage of the source/destination shape.
-        const double delta = 1;
-        // The tolerance between the end point of the routed line and the source/destination ConnectionPoint.
-        internal const double EndPointTolerance = 1;
-
-        [Flags]
-        enum DesignerEdges
-        {
-            None = 0,
-            Left = 1,
-            Top = 2,
-            Right = 4,
-            Bottom = 8,
-            All = 15
-        }
-
-        //This is used for dragging source point of a connector.(In this case we know only the destination connection point).
-        internal static Point[] Route(FreeFormPanel panel, Point srPoint, ConnectionPoint destConnPoint)
-        {
-            Fx.Assert(panel.IsOutmostPanel(), "panel should be the outmost FreeFormPanel");
-            UIElement destElement = destConnPoint.ParentDesigner;
-            return Route(panel, srPoint, FreeFormPanel.GetLocationRelativeToOutmostPanel(destConnPoint), null, FreeFormPanel.GetEdgeRelativeToOutmostPanel(destConnPoint), null, destElement);
-        }
-
-        //This is used for link creation gesture to show the adorner.(In this case we know only the source connection point).
-        internal static Point[] Route(FreeFormPanel panel, ConnectionPoint srcConnPoint, Point destPoint)
-        {
-            Fx.Assert(panel.IsOutmostPanel(), "panel should be the outmost FreeFormPanel");
-            UIElement srcElement = srcConnPoint.ParentDesigner;
-            return Route(panel, FreeFormPanel.GetLocationRelativeToOutmostPanel(srcConnPoint), destPoint, FreeFormPanel.GetEdgeRelativeToOutmostPanel(srcConnPoint), null, srcElement, null);
-        }
-
-        //This is used for link creation gesture to show the adorner.
-        internal static Point[] Route(FreeFormPanel panel, ConnectionPoint srcConnectionPoint, MouseEventArgs e)
-        {
-            Fx.Assert(panel.IsOutmostPanel(), "panel should be the outmost FreeFormPanel");
-            Point[] points = null;
-            // Used to keep consistency between preview and actual result.
-            // Check if we are hiting a connection point
-            if (typeof(ConnectionPointsAdorner).IsAssignableFrom(Mouse.DirectlyOver.GetType()))
-            {
-                ConnectionPointsAdorner destConnPtsAdorner = Mouse.DirectlyOver as ConnectionPointsAdorner;
-                ConnectionPoint destConnPoint = FreeFormPanel.ConnectionPointHitTest(e.GetPosition(panel), destConnPtsAdorner);
-                if (destConnPoint != null && !destConnPoint.Equals(srcConnectionPoint))
-                {
-                    return Route(panel, FreeFormPanel.GetLocationRelativeToOutmostPanel(srcConnectionPoint), FreeFormPanel.GetLocationRelativeToOutmostPanel(destConnPoint),
-                        FreeFormPanel.GetEdgeRelativeToOutmostPanel(srcConnectionPoint), FreeFormPanel.GetEdgeRelativeToOutmostPanel(destConnPoint), srcConnectionPoint.ParentDesigner, destConnPtsAdorner.AdornedElement);
-                }
-                else
-                {
-                    return null;
-                }
-            }
-            else
-            {
-                points = ConnectorRouter.Route(panel, srcConnectionPoint, e.GetPosition(panel));
-            }
-            return points;
-        }
-
-        //This is used when we know both the source and destination connection points.
-        internal static Point[] Route(FreeFormPanel panel, ConnectionPoint srcConnPoint, ConnectionPoint destConnPoint)
-        {
-            Fx.Assert(panel.IsOutmostPanel(), "panel should be the outmost FreeFormPanel");
-            UIElement srcElement = srcConnPoint.ParentDesigner;
-            UIElement destElement = destConnPoint.ParentDesigner;
-            return Route(panel, FreeFormPanel.GetLocationRelativeToOutmostPanel(srcConnPoint), FreeFormPanel.GetLocationRelativeToOutmostPanel(destConnPoint),
-                FreeFormPanel.GetEdgeRelativeToOutmostPanel(srcConnPoint), FreeFormPanel.GetEdgeRelativeToOutmostPanel(destConnPoint), srcElement, destElement);
-        }
-        
-        internal static Point GetDirection(Point from, Point to)
-        {
-            Vector vec = to - from;
-            return new Point(
-                vec.X.IsEqualTo(0) ? 0 : Math.Sign(vec.X),
-                vec.Y.IsEqualTo(0) ? 0 : Math.Sign(vec.Y)
-                );
-        }
-
-        static ConnectorSegment SrcEdge;
-        static ConnectorSegment DestEdge;
-
-        static void AddExcludedAndSrcDestRects(FreeFormPanel outmostPanel, FreeFormPanel panel, Point srcPoint, Point destPoint, UIElement srcElement, UIElement destElement, List<Rect> excludedRects, List<Rect> srcDestRects)
-        {
-            foreach (UIElement child in panel.Children)
-            {
-                if (!(child is Connector))
-                {
-                    Thickness margin = new Thickness(0);
-                    FrameworkElement frameworkChild = child as FrameworkElement;
-                    if (frameworkChild != null)
-                    {
-                        margin = frameworkChild.Margin;
-                    }
-                    Size childSize = new Size(frameworkChild.DesiredSize.Width - margin.Left - margin.Right, frameworkChild.DesiredSize.Height - margin.Top - margin.Bottom);
-                    Rect rect = new Rect(Point.Add(panel.TranslatePoint(FreeFormPanel.GetLocation(child), outmostPanel), new Vector(margin.Left, margin.Top)), childSize);
-                    // We don't want to add containing rectangles to the exclusion list, otherwise the algorithm will fail to find a path
-                    Rect shrunk = new Rect(rect.X + delta, rect.Y + delta, rect.Width - delta * 2, rect.Height - delta * 2);
-                    if (!shrunk.Contains(srcPoint) && !shrunk.Contains(destPoint))
-                    {
-                        excludedRects.Add(rect);
-                    }
-
-                    if (srcElement == child)
-                    {
-                        srcDestRects.Add(rect);
-                    }
-                    else if (destElement == child)
-                    {
-                        srcDestRects.Add(rect);
-                    }
-
-                    UIElement element = VirtualizedContainerService.TryGetVirtualizedElement(child);
-                    if (element != null && typeof(INestedFreeFormPanelContainer).IsAssignableFrom(element.GetType()))
-                    {
-                        FreeFormPanel childPanel = ((INestedFreeFormPanelContainer)element).GetChildFreeFormPanel();
-                        if (childPanel != null)
-                        {
-                            AddExcludedAndSrcDestRects(outmostPanel, childPanel, srcPoint, destPoint, srcElement, destElement, excludedRects, srcDestRects);
-                        }
-                    }
-                }
-            }
-        }
-
-        internal static Point[] Route(FreeFormPanel panel, Point srcPoint, Point destPoint, List<Point> srcEdge, List<Point> destEdge, UIElement srcElement, UIElement destElement)
-        {
-            if (panel == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("panel"));
-            }
-            List<Rect> excludedRects = new List<Rect>();
-            List<Rect> srcDestRects = new List<Rect>();
-            List<Point> excludedLines = new List<Point>();
-            foreach (UIElement child in panel.Children)
-            {
-                if (child.GetType() == typeof(Connector))
-                {
-                    Connector connector = (Connector)child;
-                    for (int i = 0; i < connector.Points.Count - 1; i++)
-                    {
-                        excludedLines.Add(new Point(connector.Points[i].X, connector.Points[i].Y));
-                        excludedLines.Add(new Point(connector.Points[i + 1].X, connector.Points[i + 1].Y));
-                    }
-                }
-            }
-
-            AddExcludedAndSrcDestRects(panel, panel, srcPoint, destPoint, srcElement, destElement, excludedRects, srcDestRects);
-
-            return Route(srcPoint, destPoint, srcEdge, destEdge, excludedRects, excludedLines, srcDestRects);
-        }
-
-        internal static Point[] Route(Point srcPoint, Point destPoint, List<Point> srcEdge, List<Point> destEdge, List<Rect> excludedRects, List<Point> excludedLines, List<Rect> srcDestRects)
-        {
-            ConnectorRouter.SrcEdge = null;
-            ConnectorRouter.DestEdge = null;
-            if (srcEdge != null)
-            {
-                //ConnectorSegment should only be a segment from left to right or top to bottom.
-                int smallerIndex = (srcEdge[0].X < srcEdge[1].X || srcEdge[0].Y < srcEdge[1].Y) ? 0 : 1;
-                ConnectorRouter.SrcEdge = new ConnectorSegment(srcEdge[smallerIndex], srcEdge[1 - smallerIndex]);
-            }
-            if (destEdge != null)
-            {
-                int smallerIndex = (destEdge[0].X < destEdge[1].X || destEdge[0].Y < destEdge[1].Y) ? 0 : 1;
-                ConnectorRouter.DestEdge = new ConnectorSegment(destEdge[smallerIndex], destEdge[1 - smallerIndex]);
-            }
-
-            Rect[] srcDestRectsCopy = srcDestRects.ToArray();
-            foreach (Rect rect in srcDestRectsCopy)
-            {
-                // Add shrunk rectangle to avoid connector passing through the inner area of the src/dest rectangle
-                Rect shrunk = new Rect(rect.X + delta, rect.Y + delta, rect.Width - delta * 2, rect.Height - delta * 2);
-                srcDestRects.Add(shrunk);
-                excludedRects.Add(shrunk);
-            }
-
-            return TryRoute(srcPoint, destPoint, excludedRects, excludedLines, srcDestRects);
-        }
-
-        static Point[] TryRoute(Point srcPoint, Point destPoint, List<Rect> excludedRects, List<Point> excludedLines, List<Rect> srcDestRects)
-        {
-            Point[] segments = GetRoutedLineSegments(srcPoint, destPoint, new Size(connectorMargin, connectorMargin), excludedRects.ToArray(), excludedLines.ToArray());
-
-            // If we failed to find a routed path, ignore all the lines and try again.
-            if (!AreSegmentsValid(segments))
-            {
-                segments = GetRoutedLineSegments(srcPoint, destPoint, new Size(connectorMargin, connectorMargin), excludedRects.ToArray(), new Point[] { });
-            }
-
-            // If we failed to find a routed path, ignore all other shapes except the source and destination shape.
-            if (!AreSegmentsValid(segments))
-            {
-                segments = GetRoutedLineSegments(srcPoint, destPoint, new Size(connectorMargin, connectorMargin), srcDestRects.ToArray(), new Point[] { });
-            }
-
-            // If we still don't find a routed path, return the direct path.
-            if (!AreSegmentsValid(segments))
-            {
-                double slope = DesignerGeometryHelper.SlopeOfLineSegment(srcPoint, destPoint);
-                Point intermediatePoint = (slope < 1) ? new Point(destPoint.X, srcPoint.Y) : new Point(srcPoint.X, destPoint.Y);
-                segments = new Point[] { srcPoint, intermediatePoint, destPoint };
-            }
-            segments = RemoveRedundantPoints(new List<Point>(segments));
-            return segments;
-        }
-
-        //In a list of points specifying a connector, remove consecutive equivalent points.
-        internal static Point[] RemoveRedundantPoints(List<Point> points)
-        {
-            for (int i = points.Count - 1; i > 0; i--)
-            {
-                if (points[i].IsEqualTo(points[i - 1]))
-                {
-                    points.RemoveAt(i);
-                }
-            }
-
-            List<int> toRemove = new List<int>();
-            int index1 = 0;
-            int index2 = 1;
-            int index3 = 2;
-            while (index3 < points.Count)
-            {
-                if (points[index1].X.IsEqualTo(points[index3].X) ||
-                    points[index1].Y.IsEqualTo(points[index3].Y))
-                {
-                    toRemove.Add(index2);
-                }
-                else
-                {
-                    index1 = index2;
-                }
-                ++index2;
-                ++index3;
-            }
-
-            for (int i = points.Count - 1; i > 0; i--)
-            {
-                if (toRemove.Contains(i))
-                {
-                    points.RemoveAt(i);
-                }
-            }
-
-            return points.ToArray();
-        }
-        
-        static void AddBoundPoint(ref List<DistanceFromPoint> extremitiesList, Point p, ConnectorSegment segment, Point Z)
-        {
-            if (p.X != int.MinValue && p.X != int.MaxValue && p.Y != int.MinValue && p.Y != int.MaxValue)
-            {
-                extremitiesList.Add(new DistanceFromPoint(segment, Z, p));
-            }
-        }
-
-        internal static bool AreSegmentsValid(Point[] segments)
-        {
-            if (segments == null || segments.Length < 2)
-            {
-                return false;
-            }
-
-            for (int i = 1; i < segments.Length; i++)
-            {
-                if (!segments[i - 1].X.IsEqualTo(segments[i].X) && !segments[i - 1].Y.IsEqualTo(segments[i].Y))
-                {
-                    return false;
-                }
-            }
-
-            return true;
-        }
-
-        [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "This is a legacy algorithm.")]
-        static Nullable<Point> EscapeAlgorithm(CoverSet coverSet, Point Z,
-            ref List<Point> escapePointsA, ref List<ConnectorSegment> horizontalSegmentsA, ref List<ConnectorSegment> verticalSegmentsA, ref List<ConnectorSegment> horizontalSegmentsB, ref List<ConnectorSegment> verticalSegmentsB,
-            ref Orientation orientationA, out ConnectorSegment intersectionSegmentA, out ConnectorSegment intersectionSegmentB, Size margin, ref bool noEscapeA)
-        {
-            Nullable<Point> intersection = null;
-            intersectionSegmentA = null;
-            intersectionSegmentB = null;
-
-            ConnectorSegment leftCover = coverSet.GetCover(Z, DesignerEdges.Left);
-            ConnectorSegment rightCover = coverSet.GetCover(Z, DesignerEdges.Right);
-            ConnectorSegment bottomCover = coverSet.GetCover(Z, DesignerEdges.Bottom);
-            ConnectorSegment topCover = coverSet.GetCover(Z, DesignerEdges.Top);
-
-            ConnectorSegment h = ConnectorSegment.SegmentFromLeftToRightCover(coverSet, Z);
-            // We do not want the routed line to coincide with the source or dest edge. 
-            // Hence the edge should never be an escape line. 
-            if (h.Overlaps(ConnectorRouter.SrcEdge) || h.Overlaps(ConnectorRouter.DestEdge))
-            {
-                h = null;
-            }
-            else
-            {
-                horizontalSegmentsA.Add(h);
-            }
-
-            ConnectorSegment v = ConnectorSegment.SegmentFromBottomToTopCover(coverSet, Z);
-            if (v.Overlaps(ConnectorRouter.SrcEdge) || v.Overlaps(ConnectorRouter.DestEdge))
-            {
-                v = null;
-            }
-            else
-            {
-                verticalSegmentsA.Add(v);
-            }
-
-
-            // Check if the new escape line(s) intersect with the existing ones
-            if (h != null)
-            {
-                for (int i = 0; i < verticalSegmentsB.Count; i++)
-                {
-                    ConnectorSegment segment = verticalSegmentsB[i];
-                    intersection = h.Intersect(segment);
-                    if (intersection != null)
-                    {
-                        intersectionSegmentA = h;
-                        intersectionSegmentB = segment;
-                        return intersection;
-                    }
-                }
-            }
-
-            if (v != null)
-            {
-                for (int i = 0; i < horizontalSegmentsB.Count; i++)
-                {
-                    ConnectorSegment segment = horizontalSegmentsB[i];
-                    intersection = v.Intersect(segment);
-                    if (intersection != null)
-                    {
-                        intersectionSegmentA = v;
-                        intersectionSegmentB = segment;
-                        return intersection;
-                    }
-                }
-            }
-
-            Nullable<Point> escapePoint = null;
-            if (v != null)
-            {
-                escapePoint = EscapeProcessI(coverSet, Z, v, Orientation.Horizontal, margin);
-                if (escapePoint != null)
-                {
-                    orientationA = Orientation.Vertical;
-                    escapePointsA.Add((Point)escapePoint);
-                    return null;
-                }
-            }
-
-            if (h != null)
-            {
-                escapePoint = EscapeProcessI(coverSet, Z, h, Orientation.Vertical, margin);
-                if (escapePoint != null)
-                {
-                    orientationA = Orientation.Horizontal;
-                    escapePointsA.Add((Point)escapePoint);
-                    return null;
-                }
-            }
-
-            bool intersectionFlag = false;
-
-            // Flags indicating if we can still continue in the given directions
-            bool continue1, continue2, continue3, continue4;
-
-            Point r1 = new Point(), r2 = new Point(), r3 = new Point(), r4 = new Point();
-
-            if (topCover != null)
-            {
-                r1 = new Point(Z.X, topCover.A.Y);
-            }
-            if (rightCover != null)
-            {
-                r2 = new Point(rightCover.A.X, Z.Y);
-            }
-            if (bottomCover != null)
-            {
-                r3 = new Point(Z.X, bottomCover.A.Y);
-            }
-            if (leftCover != null)
-            {
-                r4 = new Point(leftCover.A.X, Z.Y);
-            }
-            do
-            {
-                continue1 = continue2 = continue3 = continue4 = false;
-                if (topCover != null && v != null)
-                {
-                    r1.Y -= margin.Height;
-                    if (r1.Y > Z.Y)
-                    {
-                        continue1 = true;
-                        Nullable<Point> escape = EscapeProcessII(coverSet, Orientation.Vertical,
-                            ref escapePointsA, ref horizontalSegmentsA, ref verticalSegmentsA, ref horizontalSegmentsB, ref verticalSegmentsB, r1, margin, out intersectionFlag, out intersectionSegmentA, out intersectionSegmentB);
-                        if (escape != null)
-                        {
-                            verticalSegmentsA.Add(v);
-                            if (intersectionFlag)
-                            {
-                                return escape;
-                            }
-
-                            orientationA = Orientation.Horizontal;
-                            coverSet.AddUsedEscapeLine(new ConnectorSegment(Z, r1));
-                            coverSet.AddUsedEscapeLine(new ConnectorSegment(r1, (Point)escape));
-                            escapePointsA.Add((Point)escape);
-                            return null;
-                        }
-                    }
-                }
-
-                if (rightCover != null && h != null)
-                {
-                    r2.X -= margin.Width;
-                    if (r2.X > Z.X)
-                    {
-                        continue2 = true;
-                        Nullable<Point> escape = EscapeProcessII(coverSet, Orientation.Horizontal,
-                            ref escapePointsA, ref horizontalSegmentsA, ref verticalSegmentsA, ref horizontalSegmentsB, ref verticalSegmentsB, r2, margin, out intersectionFlag, out intersectionSegmentA, out intersectionSegmentB);
-                        if (escape != null)
-                        {
-                            horizontalSegmentsA.Add(h);
-                            if (intersectionFlag)
-                            {
-                                return escape;
-                            }
-
-                            orientationA = Orientation.Vertical;
-                            coverSet.AddUsedEscapeLine(new ConnectorSegment(Z, r2));
-                            coverSet.AddUsedEscapeLine(new ConnectorSegment(r2, (Point)escape));
-                            escapePointsA.Add((Point)escape);
-                            return null;
-                        }
-                    }
-                }
-
-                if (bottomCover != null && v != null)
-                {
-                    r3.Y += margin.Height;
-                    if (r3.Y < Z.Y)
-                    {
-                        continue3 = true;
-                        Nullable<Point> escape = EscapeProcessII(coverSet, Orientation.Vertical,
-                            ref escapePointsA, ref horizontalSegmentsA, ref verticalSegmentsA, ref horizontalSegmentsB, ref verticalSegmentsB, r3, margin, out intersectionFlag, out intersectionSegmentA, out intersectionSegmentB);
-                        if (escape != null)
-                        {
-                            verticalSegmentsA.Add(v);
-                            if (intersectionFlag)
-                            {
-                                return escape;
-                            }
-
-                            orientationA = Orientation.Horizontal;
-                            coverSet.AddUsedEscapeLine(new ConnectorSegment(Z, r3));
-                            coverSet.AddUsedEscapeLine(new ConnectorSegment(r3, (Point)escape));
-                            escapePointsA.Add((Point)escape);
-                            return null;
-                        }
-                    }
-                }
-
-                if (leftCover != null && h != null)
-                {
-                    r4.X += margin.Width;
-                    if (r4.X < Z.X)
-                    {
-                        continue4 = true;
-                        Nullable<Point> escape = EscapeProcessII(coverSet, Orientation.Horizontal,
-                            ref escapePointsA, ref horizontalSegmentsA, ref verticalSegmentsA, ref horizontalSegmentsB, ref verticalSegmentsB, r4, margin, out intersectionFlag, out intersectionSegmentA, out intersectionSegmentB);
-                        if (escape != null)
-                        {
-                            horizontalSegmentsA.Add(h);
-                            if (intersectionFlag)
-                            {
-                                return escape;
-                            }
-
-                            orientationA = Orientation.Vertical;
-                            coverSet.AddUsedEscapeLine(new ConnectorSegment(Z, r4));
-                            coverSet.AddUsedEscapeLine(new ConnectorSegment(r4, (Point)escape));
-                            escapePointsA.Add((Point)escape);
-                            return null;
-                        }
-                    }
-                }
-            } while (continue1 || continue2 || continue3 || continue4);
-
-            noEscapeA = true;
-            return null;
-        }
-
-        static Nullable<Point> EscapeProcessI(CoverSet coverSet, Point Z,
-            ConnectorSegment escapeLine, Orientation orientation, Size margin)
-        {
-            List<DistanceFromPoint> extremitiesList = new List<DistanceFromPoint>(4);
-
-            ConnectorSegment lesserCover = coverSet.GetCover(Z, (orientation == Orientation.Horizontal) ? DesignerEdges.Left : DesignerEdges.Bottom);
-            if (lesserCover != null)
-            {
-                AddBoundPoint(ref extremitiesList, lesserCover.A, lesserCover, Z);
-                AddBoundPoint(ref extremitiesList, lesserCover.B, lesserCover, Z);
-            }
-
-            ConnectorSegment higherCover = coverSet.GetCover(Z, (orientation == Orientation.Horizontal) ? DesignerEdges.Right : DesignerEdges.Top);
-            if (higherCover != null)
-            {
-                AddBoundPoint(ref extremitiesList, higherCover.A, higherCover, Z);
-                AddBoundPoint(ref extremitiesList, higherCover.B, higherCover, Z);
-            }
-
-            if (extremitiesList.Count == 0)
-            {
-                return null;
-            }
-
-            DistanceSorter.Sort(ref extremitiesList);
-            for (int i = 0; i < extremitiesList.Count; i++)
-            {
-                Point p = extremitiesList[i].P;
-                Point direction = GetDirection(Z, p);
-                if (((orientation == Orientation.Vertical) ? direction.X : direction.Y).IsEqualTo(0))
-                {
-                    ConnectorSegment segment = extremitiesList[i].ConnectorSegment;
-                    p = segment.ExtendPointOutwards(p);
-                    direction = GetDirection(Z, p);
-                    p = extremitiesList[i].P;
-                }
-
-                DesignerEdges side;
-                if (orientation == Orientation.Vertical)
-                {
-                    side = (direction.Y < 0) ? DesignerEdges.Bottom : DesignerEdges.Top;
-                }
-                else
-                {
-                    side = (direction.X < 0) ? DesignerEdges.Left : DesignerEdges.Right;
-                }
-
-                Point escapePoint;
-                if ((orientation == Orientation.Vertical))
-                {
-                    escapePoint = new Point(p.X + direction.X * margin.Width, Z.Y);
-                }
-                else
-                {
-                    escapePoint = new Point(Z.X, p.Y + direction.Y * margin.Height);
-                }
-
-                ConnectorSegment newEscapeLine = new ConnectorSegment(Z, escapePoint);
-                if (!coverSet.EscapeLineHasBeenUsed(escapePoint) &&
-                    escapeLine.IsPointOnSegment(escapePoint) && !escapeLine.A.IsEqualTo(escapePoint) && !escapeLine.B.IsEqualTo(escapePoint) &&
-                    coverSet.IsEscapePoint(Z, escapePoint, side))
-                {
-                    coverSet.AddUsedEscapeLine(newEscapeLine);
-                    return escapePoint;
-                }
-            }
-
-            return null;
-        }
-
-        static Nullable<Point> EscapeProcessII(CoverSet coverSet, Orientation orientation, ref List<Point> escapePointsA,
-            ref List<ConnectorSegment> horizontalSegmentsA, ref List<ConnectorSegment> verticalSegmentsA, ref List<ConnectorSegment> horizontalSegmentsB, ref List<ConnectorSegment> verticalSegmentsB,
-            Point R, Size margin, out bool intersectionFlag, out ConnectorSegment intersectionSegmentA, out ConnectorSegment intersectionSegmentB)
-        {
-            intersectionFlag = false;
-            intersectionSegmentA = null;
-            intersectionSegmentB = null;
-
-            ConnectorSegment h = ConnectorSegment.SegmentFromLeftToRightCover(coverSet, R);
-            ConnectorSegment v = ConnectorSegment.SegmentFromBottomToTopCover(coverSet, R);
-
-            for (int i = 0; i < verticalSegmentsB.Count; i++)
-            {
-                ConnectorSegment segment = verticalSegmentsB[i];
-                Nullable<Point> intersection = h.Intersect(segment);
-                if (intersection != null)
-                {
-                    intersectionFlag = true;
-                    intersectionSegmentA = h;
-                    intersectionSegmentB = segment;
-                    escapePointsA.Add(R);
-                    return intersection;
-                }
-            }
-            for (int i = 0; i < horizontalSegmentsB.Count; i++)
-            {
-                ConnectorSegment segment = horizontalSegmentsB[i];
-                Nullable<Point> intersection = v.Intersect(segment);
-                if (intersection != null)
-                {
-                    intersectionFlag = true;
-                    intersectionSegmentA = v;
-                    intersectionSegmentB = segment;
-                    escapePointsA.Add(R);
-                    return intersection;
-                }
-            }
-
-            Nullable<Point> escapePointI = null;
-
-            if (orientation == Orientation.Horizontal)
-            {
-                escapePointI = EscapeProcessI(coverSet, R, v, Orientation.Horizontal, margin);
-                if (escapePointI != null)
-                {
-                    verticalSegmentsA.Add(v);
-                    escapePointsA.Add(R);
-                    return escapePointI;
-                }
-
-                escapePointI = EscapeProcessI(coverSet, R, h, Orientation.Vertical, margin);
-                if (escapePointI != null)
-                {
-                    horizontalSegmentsA.Add(h);
-                    escapePointsA.Add(R);
-                    return escapePointI;
-                }
-            }
-            else
-            {
-                escapePointI = EscapeProcessI(coverSet, R, h, Orientation.Vertical, margin);
-                if (escapePointI != null)
-                {
-                    horizontalSegmentsA.Add(h);
-                    escapePointsA.Add(R);
-                    return escapePointI;
-                }
-
-                escapePointI = EscapeProcessI(coverSet, R, v, Orientation.Horizontal, margin);
-                if (escapePointI != null)
-                {
-                    verticalSegmentsA.Add(v);
-                    escapePointsA.Add(R);
-                    return escapePointI;
-                }
-            }
-
-            return null;
-        }
-
-        static List<Point> FirstRefinementAlgorithm(List<Point> points, ConnectorSegment intersectionSegment)
-        {
-            List<Point> refinedSet = new List<Point>();
-            ConnectorSegment k = intersectionSegment;
-
-            while (points.Count > 0)
-            {
-                Point point;
-                int i = points.Count - 1;
-
-                while (!k.PointLiesOnThisLine(points[i]) && i > 0)
-                {
-                    i--;
-                }
-
-                while (i > 0 && k.PointLiesOnThisLine(points[i - 1]))
-                {
-                    i--;
-                }
-                point = points[i];
-                refinedSet.Add(point);
-
-                while (points.Count > i)
-                {
-                    points.RemoveAt(i);
-                }
-
-                k = k.PerpendicularThroughPoint(point);
-            }
-
-            return refinedSet;
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
-            Justification = "Catch all exceptions to prevent crash.")]
-        [SuppressMessage("Reliability", "Reliability108:IsFatalRule",
-            Justification = "Catch all exceptions to prevent crash.")]
-        static Point[] GetRoutedLineSegments(Point begin, Point end, Size margin, Rect[] rectanglesToExclude, Point[] linesToExclude)
-        {
-            if (rectanglesToExclude == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("rectanglesToExclude"));
-            }
-
-            if (linesToExclude == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("linesToExclude"));
-            }
-
-            if ((linesToExclude.Length % 2) > 0)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException("Error"));
-            }
-
-
-            CoverSet coverSet = new CoverSet(rectanglesToExclude, linesToExclude);
-            coverSet.ClearUsedLines();
-
-            Point A = begin;
-            Point B = end;
-
-            //escape points
-            List<Point> escapePointsA = new List<Point>(); //escape points from begin to end
-            List<Point> escapePointsB = new List<Point>(); //escape points from end to begin
-
-            //horizontal/vertical escape segments from A
-            List<ConnectorSegment> horizontalEscapeSegmentsA = new List<ConnectorSegment>();
-            List<ConnectorSegment> verticalEscapeSegmentsA = new List<ConnectorSegment>();
-
-            //horizontal/vertical escape segments from B
-            List<ConnectorSegment> horizontalEscapeSegmentsB = new List<ConnectorSegment>();
-            List<ConnectorSegment> verticalEscapeSegmentsB = new List<ConnectorSegment>();
-
-            Orientation orientationA = Orientation.Horizontal;
-            Orientation orientationB = Orientation.Horizontal;
-
-            escapePointsA.Add(begin);
-            escapePointsB.Add(end);
-
-            bool noEscapeA = false;
-            bool noEscapeB = false;
-
-            Nullable<Point> intersection = null;
-            ConnectorSegment intersectionSegmentA = null;
-            ConnectorSegment intersectionSegmentB = null;
-
-            try
-            {
-                do
-                {
-                    if (noEscapeA)
-                    {
-                        if (noEscapeB)
-                        {
-                            break;
-                        }
-                        else
-                        {
-                            List<Point> tempList = escapePointsA;
-                            escapePointsA = escapePointsB;
-                            escapePointsB = tempList;
-
-                            Point tempPoint = A;
-                            A = B;
-                            B = tempPoint;
-
-                            bool tempBool = noEscapeA;
-                            noEscapeA = noEscapeB;
-                            noEscapeB = tempBool;
-
-                            Orientation tempOrientation = orientationA;
-                            orientationA = orientationB;
-                            orientationB = tempOrientation;
-
-                            List<ConnectorSegment> tempListSegm = horizontalEscapeSegmentsA;
-                            horizontalEscapeSegmentsA = horizontalEscapeSegmentsB;
-                            horizontalEscapeSegmentsB = tempListSegm;
-
-                            tempListSegm = verticalEscapeSegmentsA;
-                            verticalEscapeSegmentsA = verticalEscapeSegmentsB;
-                            verticalEscapeSegmentsB = tempListSegm;
-
-                            continue;
-                        }
-                    }
-
-                    Point objectPoint = escapePointsA[escapePointsA.Count - 1];
-
-                    intersection = EscapeAlgorithm(coverSet, objectPoint,
-                        ref escapePointsA, ref horizontalEscapeSegmentsA, ref verticalEscapeSegmentsA, ref horizontalEscapeSegmentsB, ref verticalEscapeSegmentsB, ref orientationA,
-                        out intersectionSegmentA, out intersectionSegmentB, margin, ref noEscapeA);
-                    if (intersection != null)
-                    {
-                        break;
-                    }
-                    else
-                    {
-                        List<Point> tempList = escapePointsA;
-                        escapePointsA = escapePointsB;
-                        escapePointsB = tempList;
-
-                        Point tempPoint = A;
-                        A = B;
-                        B = tempPoint;
-
-                        bool tempBool = noEscapeA;
-                        noEscapeA = noEscapeB;
-                        noEscapeB = tempBool;
-
-                        Orientation tempOrientation = orientationA;
-                        orientationA = orientationB;
-                        orientationB = tempOrientation;
-
-                        List<ConnectorSegment> tempListSegm = horizontalEscapeSegmentsA;
-                        horizontalEscapeSegmentsA = horizontalEscapeSegmentsB;
-                        horizontalEscapeSegmentsB = tempListSegm;
-
-                        tempListSegm = verticalEscapeSegmentsA;
-                        verticalEscapeSegmentsA = verticalEscapeSegmentsB;
-                        verticalEscapeSegmentsB = tempListSegm;
-                    }
-
-                } while (true);
-
-                if (intersection == null)
-                {
-                    return null;
-                }
-
-                List<Point> refinedPath = new List<Point>();
-
-                escapePointsA = FirstRefinementAlgorithm(escapePointsA, intersectionSegmentA);
-                escapePointsB = FirstRefinementAlgorithm(escapePointsB, intersectionSegmentB);
-
-                for (int j = escapePointsA.Count - 1; j >= 0; j--)
-                {
-                    refinedPath.Add(escapePointsA[j]);
-                }
-                refinedPath.Add((Point)intersection);
-                for (int j = 0; j < escapePointsB.Count; j++)
-                {
-                    refinedPath.Add(escapePointsB[j]);
-                }
-
-                SecondRefinementAlgorithm(coverSet, ref refinedPath, margin);
-
-                if (refinedPath.Count > 1 && refinedPath[refinedPath.Count - 1].IsEqualTo(begin))
-                {
-                    refinedPath.Reverse();
-                }
-
-                return refinedPath.ToArray();
-            }
-            catch (Exception)
-            {
-                return null;
-            }
-        }
-
-        static void EraseRedundentWarps(CoverSet coverSet, ref List<Point> refinedPath)
-        {
-            bool structureChanged;
-            do
-            {
-                structureChanged = false;
-                List<Point> newPath = new List<Point>();
-                int currentSegment = 0;
-                while (currentSegment < refinedPath.Count - 1)
-                {
-                    Point a1 = refinedPath[currentSegment];
-                    Point a2 = refinedPath[currentSegment + 1];
-
-                    ConnectorSegment a = ConnectorSegment.ConstructBoundSegment(coverSet, a1, a2);
-
-                    int intersectingSegment = currentSegment + 2;
-                    while (intersectingSegment < refinedPath.Count - 1)
-                    {
-                        Point b1 = refinedPath[intersectingSegment];
-                        Point b2 = refinedPath[intersectingSegment + 1];
-                        ConnectorSegment b = ConnectorSegment.ConstructBoundSegment(coverSet, b1, b2);
-
-                        Nullable<Point> intersection = a.Intersect(b);
-                        if (intersection != null)
-                        {
-                            structureChanged = true;
-                            newPath.Clear();
-                            for (int i = 0; i <= currentSegment; i++)
-                            {
-                                newPath.Add(refinedPath[i]);
-                            }
-                            newPath.Add((Point)intersection);
-                            for (int i = intersectingSegment + 1; i < refinedPath.Count; i++)
-                            {
-                                newPath.Add(refinedPath[i]);
-                            }
-
-                            List<Point> temp = refinedPath;
-                            refinedPath = newPath;
-                            newPath = temp;
-                            newPath.Clear();
-
-                            intersectingSegment = currentSegment + 2;
-                        }
-                        else
-                        {
-                            intersectingSegment++;
-                        }
-                    }
-                    currentSegment++;
-                }
-            } while (structureChanged);
-        }
-
-        static void SecondRefinementAlgorithm(CoverSet coverSet, ref List<Point> refinedPath, Size margin)
-        {
-            EraseRedundentWarps(coverSet, ref refinedPath);
-            List<Point> newPath = new List<Point>();
-            int currentSegment = 0;
-            while (currentSegment < refinedPath.Count - 1)
-            {
-                Point a1 = refinedPath[currentSegment];
-                Point a2 = refinedPath[currentSegment + 1];
-
-                bool intersected = false;
-                ConnectorSegment a = ConnectorSegment.ConstructBoundSegment(coverSet, a1, a2);
-                if (a != null)
-                {
-                    Vector sub = a2 - a1;
-                    int steps = (int)Math.Max(Math.Abs(sub.X / margin.Width), Math.Abs(sub.Y / margin.Height)); //one of the values will be null
-                    Point direction = GetDirection(a1, a2);
-                    // Prevent segments overlapping with shape edges.
-                    ExtendCoversOutwards(coverSet, a.Orientation, lineMargin);
-
-                    for (int i = 1; i <= steps; i++)
-                    {
-                        Point k = new Point(a1.X + i * margin.Width * direction.X, a1.Y + i * margin.Height * direction.Y);
-                        if (k.IsEqualTo(a2))
-                        {
-                            break;
-                        }
-
-                        ConnectorSegment b = ConnectorSegment.ConstructBoundSegment(coverSet, k, (a.Orientation == Orientation.Horizontal) ? Orientation.Vertical : Orientation.Horizontal);
-                        int intersectingSegment = currentSegment + 2;
-                        while (intersectingSegment < refinedPath.Count - 1 && !intersected)
-                        {
-                            Point c1 = refinedPath[intersectingSegment];
-                            Point c2 = refinedPath[intersectingSegment + 1];
-                            ConnectorSegment c = new ConnectorSegment(c1, c2);
-
-                            Nullable<Point> intersection = b.Intersect(c);
-                            if (intersection != null && c.IsPointOnSegment((Point)intersection))
-                            {
-                                intersected = true;
-
-                                newPath.Clear();
-                                for (int j = 0; j <= currentSegment; j++)
-                                {
-                                    newPath.Add(refinedPath[j]);
-                                }
-                                newPath.Add(k);
-                                newPath.Add((Point)intersection);
-                                for (int j = intersectingSegment + 1; j < refinedPath.Count; j++)
-                                {
-                                    newPath.Add(refinedPath[j]);
-                                }
-                                List<Point> temp = refinedPath;
-                                refinedPath = newPath;
-                                newPath = temp;
-                                newPath.Clear();
-                                break;
-                            }
-
-                            intersectingSegment++;
-                        }
-
-                        if (intersected)
-                        {
-                            break;
-                        }
-                    }
-                    // Restore shape edges.
-                    ShrinkCoversInwards(coverSet, a.Orientation, lineMargin);
-                }
-                if (!intersected)
-                {
-                    currentSegment++;
-                }
-            }
-        }
-
-        static List<ConnectorSegment> GetSegmentsForOrientation(CoverSet coverSet, Orientation orientation)
-        {
-            List<ConnectorSegment> connectorSegments = null;
-            if (orientation == Orientation.Horizontal)
-            {
-                connectorSegments = coverSet.HorizontalCovers;
-            }
-            else
-            {
-                connectorSegments = coverSet.VerticalCovers;
-            }
-            return connectorSegments;
-        }
-
-        static void ShrinkCoversInwards(CoverSet coverSet, Orientation orientation, double shrunkLength)
-        {
-            List<ConnectorSegment> connectorSegments = GetSegmentsForOrientation(coverSet, orientation);
-            foreach (ConnectorSegment connSeg in connectorSegments)
-            {
-                connSeg.ShrinkSegmentInwards(shrunkLength);
-            }
-        }
-
-        static void ExtendCoversOutwards(CoverSet coverSet, Orientation orientation, double extendedLength)
-        {
-            List<ConnectorSegment> connectorSegments = GetSegmentsForOrientation(coverSet, orientation);
-            foreach (ConnectorSegment connSeg in connectorSegments)
-            {
-                connSeg.ExtendSegmentOutwards(extendedLength);
-            }
-        }
-
-
-        struct DistanceFromPoint
-        {
-            public ConnectorSegment ConnectorSegment;
-            public double Distance;
-            public Point P;
-
-            public DistanceFromPoint(ConnectorSegment segment, Point z, Point p)
-            {
-                this.ConnectorSegment = segment;
-                this.P = p;
-                this.Distance = DesignerGeometryHelper.DistanceBetweenPoints(z, p);
-            }
-        }
-
-        // Represents a segment - the main entity in the routing algorithm
-        sealed class ConnectorSegment
-        {
-            Orientation orientation;
-            Point point1;
-            Point point2;
-
-            public ConnectorSegment(Point point1, Point point2)
-            {
-                if (!point1.X.IsEqualTo(point2.X) && !point1.Y.IsEqualTo(point2.Y))
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
-                        SR.CannotConstructConnectionSegment, point1.ToString(), point2.ToString())));
-                }
-
-                this.point1 = point1;
-                this.point2 = point2;
-                this.orientation = (this.point1.X.IsEqualTo(this.point2.X) ? Orientation.Vertical : Orientation.Horizontal);
-            }
-
-            public Point A
-            {
-                get
-                {
-                    return this.point1;
-                }
-            }
-
-            public Point B
-            {
-                get
-                {
-                    return this.point2;
-                }
-            }
-
-            public Orientation Orientation
-            {
-                get
-                {
-                    return this.orientation;
-                }
-            }
-
-            public static ConnectorSegment ConstructBoundSegment(CoverSet coverSet, Point a, Point b)
-            {
-                if (!a.X.IsEqualTo(b.X) && !a.Y.IsEqualTo(b.Y))
-                {
-                    return null;
-                }
-
-                return ConstructBoundSegment(coverSet, a, a.X.IsEqualTo(b.X) ? Orientation.Vertical : Orientation.Horizontal);
-            }
-
-            public static ConnectorSegment ConstructBoundSegment(CoverSet coverSet, Point a, Orientation orientation)
-            {
-                return (orientation == Orientation.Horizontal) ? SegmentFromLeftToRightCover(coverSet, a) : SegmentFromBottomToTopCover(coverSet, a);
-            }
-
-            public static ConnectorSegment SegmentFromBottomToTopCover(CoverSet coverSet, Point p)
-            {
-                ConnectorSegment bottomCover = coverSet.GetCover(p, DesignerEdges.Bottom);
-                ConnectorSegment topCover = coverSet.GetCover(p, DesignerEdges.Top);
-
-                //construct vertical escape segment
-                Point bottom = new Point(p.X, (bottomCover != null) ? bottomCover.A.Y : int.MinValue);
-                Point top = new Point(p.X, (topCover != null) ? topCover.A.Y : int.MaxValue);
-                ConnectorSegment v = new ConnectorSegment(bottom, top);
-                return v;
-            }
-
-            public static ConnectorSegment SegmentFromLeftToRightCover(CoverSet coverSet, Point p)
-            {
-                ConnectorSegment leftCover = coverSet.GetCover(p, DesignerEdges.Left);
-                ConnectorSegment rightCover = coverSet.GetCover(p, DesignerEdges.Right);
-
-                //construct horizontal escape segment
-                Point left = new Point((leftCover != null) ? leftCover.A.X : int.MinValue, p.Y);
-                Point right = new Point((rightCover != null) ? rightCover.A.X : int.MaxValue, p.Y);
-                ConnectorSegment h = new ConnectorSegment(left, right);
-                return h;
-            }
-
-            public bool Covers(Point p)
-            {
-                return (this.orientation == Orientation.Horizontal) ?
-                    (p.X.IsNoLessThan(Math.Min(this.point1.X, this.point2.X)) && p.X.IsNoGreaterThan(Math.Max(this.point1.X, this.point2.X))) :
-                    (p.Y.IsNoLessThan(Math.Min(this.point1.Y, this.point2.Y)) && p.Y.IsNoGreaterThan(Math.Max(this.point1.Y, this.point2.Y)));
-            }
-
-            public override bool Equals(object obj)
-            {
-                ConnectorSegment segment = obj as ConnectorSegment;
-                if (segment == null)
-                {
-                    return false;
-                }
-                return (this.point1.IsEqualTo(segment.A) && this.point2.IsEqualTo(segment.B) && Orientation == segment.Orientation);
-            }
-
-            public bool Overlaps(ConnectorSegment segment)
-            {
-                if (segment == null)
-                {
-                    return false;
-                }
-                if (this.Orientation == segment.Orientation)
-                {
-                    return this.IsPointOnSegment(segment.point1) || this.IsPointOnSegment(segment.point2) || segment.IsPointOnSegment(this.point1) || segment.IsPointOnSegment(this.point2);
-                }
-                return false;
-            }
-
-            public Point ExtendPointOutwards(Point p)
-            {
-                if (!p.IsEqualTo(this.point1) && !p.IsEqualTo(this.point2))
-                {
-                    return p;
-                }
-
-                double k = ((this.orientation == Orientation.Horizontal) ? p.X : p.Y);
-                double k1 = ((this.orientation == Orientation.Horizontal) ? this.point1.X : this.point1.Y);
-                double k2 = ((this.orientation == Orientation.Horizontal) ? this.point2.X : this.point2.Y);
-                k += k.IsEqualTo(Math.Min(k1, k2)) ? -1.0 : 1.0;
-                return new Point((this.orientation == Orientation.Horizontal) ? k : p.X, (this.orientation == Orientation.Horizontal) ? p.Y : k);
-            }
-
-            public void ExtendSegmentOutwards(double extendedLength)
-            {
-                if (this.Orientation == Orientation.Horizontal)
-                {
-                    if (this.point1.X > this.point2.X)
-                    {
-                        this.point1 = Point.Add(this.point1, new Vector(extendedLength, 0));
-                        this.point2 = Point.Add(this.point2, new Vector(-extendedLength, 0));
-                    }
-                    else
-                    {
-                        this.point1 = Point.Add(this.point1, new Vector(-extendedLength, 0));
-                        this.point2 = Point.Add(this.point2, new Vector(extendedLength, 0));
-                    }
-                }
-                else
-                {
-                    if (this.point1.Y > this.point2.Y)
-                    {
-                        this.point1 = Point.Add(this.point1, new Vector(0, extendedLength));
-                        this.point2 = Point.Add(this.point2, new Vector(0, -extendedLength));
-                    }
-                    else
-                    {
-                        this.point1 = Point.Add(this.point1, new Vector(0, -extendedLength));
-                        this.point2 = Point.Add(this.point2, new Vector(0, extendedLength));
-                    }
-                }
-            }
-
-            public void ShrinkSegmentInwards(double shrunkLength)
-            {
-                this.ExtendSegmentOutwards(-shrunkLength);
-            }
-
-            public override int GetHashCode()
-            {
-                return this.point1.GetHashCode() ^ this.point2.GetHashCode() ^ Orientation.GetHashCode();
-            }
-
-            public Nullable<Point> Intersect(ConnectorSegment segment)
-            {
-                if (this.orientation == segment.Orientation)
-                {
-                    return null;
-                }
-
-                ConnectorSegment vertical = (this.orientation == Orientation.Vertical) ? this : segment;
-                ConnectorSegment horizontal = (this.orientation == Orientation.Vertical) ? segment : this;
-
-                if (vertical.A.X < Math.Min(horizontal.A.X, horizontal.B.X) || vertical.A.X > Math.Max(horizontal.A.X, horizontal.B.X))
-                {
-                    return null;
-                }
-
-                if (horizontal.A.Y < Math.Min(vertical.A.Y, vertical.B.Y) || horizontal.A.Y > Math.Max(vertical.A.Y, vertical.B.Y))
-                {
-                    return null;
-                }
-
-                return new Point(vertical.A.X, horizontal.A.Y);
-            }
-
-            public bool IsPointOnSegment(Point p)
-            {
-                if ((this.orientation == Orientation.Horizontal && !p.Y.IsEqualTo(this.point1.Y)) || (this.orientation == Orientation.Vertical && !p.X.IsEqualTo(this.point1.X)))
-                {
-                    return false;
-                }
-
-                double k = (this.orientation == Orientation.Horizontal) ? p.X : p.Y;
-                double k1 = (this.orientation == Orientation.Horizontal) ? this.point1.X : this.point1.Y;
-                double k2 = (this.orientation == Orientation.Horizontal) ? this.point2.X : this.point2.Y;
-                return k.IsNoLessThan(Math.Min(k1, k2)) && k.IsNoGreaterThan(Math.Max(k1, k2));
-            }
-
-            public ConnectorSegment PerpendicularThroughPoint(Point p)
-            {
-                Orientation newOrientation = (this.orientation == Orientation.Horizontal) ? Orientation.Vertical : Orientation.Horizontal;
-                Point newPoint = new Point(p.X, p.Y);
-                if (newOrientation == Orientation.Horizontal)
-                {
-                    newPoint.X = int.MaxValue;
-                }
-                else
-                {
-                    newPoint.Y = int.MaxValue;
-                }
-
-                return new ConnectorSegment(p, newPoint);
-            }
-
-            // We consider the whole line to which this segment belongs for this test
-            public bool PointLiesOnThisLine(Point p)
-            {
-                return (this.orientation == Orientation.Horizontal) ? p.Y.IsEqualTo(this.point1.Y) : p.X.IsEqualTo(this.point1.X);
-            }
-        }
-
-        sealed class CoverSet
-        {
-            List<ConnectorSegment> horizontalCovers = new List<ConnectorSegment>();
-            List<ConnectorSegment> usedEscapeLine = new List<ConnectorSegment>();
-            List<ConnectorSegment> verticalCovers = new List<ConnectorSegment>();
-
-            public List<ConnectorSegment> HorizontalCovers
-            {
-                get { return this.horizontalCovers; }
-            }
-
-            public List<ConnectorSegment> VerticalCovers
-            {
-                get { return this.verticalCovers; }
-            }
-
-            public CoverSet(Rect[] rectanglesToExclude, Point[] linesToExclude)
-            {
-                foreach (Rect rectangle in rectanglesToExclude)
-                {
-                    AddCover(new ConnectorSegment(new Point(rectangle.Left, rectangle.Top), new Point(rectangle.Left, rectangle.Bottom)));
-                    AddCover(new ConnectorSegment(new Point(rectangle.Right, rectangle.Top), new Point(rectangle.Right, rectangle.Bottom)));
-                    AddCover(new ConnectorSegment(new Point(rectangle.Left, rectangle.Top), new Point(rectangle.Right, rectangle.Top)));
-                    AddCover(new ConnectorSegment(new Point(rectangle.Left, rectangle.Bottom), new Point(rectangle.Right, rectangle.Bottom)));
-                }
-
-                for (int i = 0; i < linesToExclude.Length / 2; i++)
-                {
-                    AddCover(new ConnectorSegment(linesToExclude[i * 2], linesToExclude[(i * 2) + 1]));
-                }
-            }
-
-            public void AddCover(ConnectorSegment cover)
-            {
-                List<ConnectorSegment> covers = (cover.Orientation == Orientation.Vertical) ? this.verticalCovers : this.horizontalCovers;
-
-                for (int i = 0; i < covers.Count; i++)
-                {
-                    ConnectorSegment existingCover = covers[i];
-                    if (cover.IsPointOnSegment(existingCover.A) && cover.IsPointOnSegment(existingCover.B))
-                    {
-                        covers.RemoveAt(i);
-                        break;
-                    }
-                    else if (existingCover.IsPointOnSegment(cover.A) && existingCover.IsPointOnSegment(cover.B))
-                    {
-                        return;
-                    }
-                }
-
-                covers.Add(cover);
-            }
-
-
-            public void AddUsedEscapeLine(ConnectorSegment segment)
-            {
-                this.usedEscapeLine.Add(segment);
-            }
-
-            public void ClearUsedLines()
-            {
-                this.usedEscapeLine.Clear();
-            }
-
-            public bool EscapeLineHasBeenUsed(Point escapePoint)
-            {
-                for (int i = 0; i < this.usedEscapeLine.Count; i++)
-                {
-                    ConnectorSegment usedSegment = this.usedEscapeLine[i];
-                    if (usedSegment.IsPointOnSegment(escapePoint))
-                    {
-                        return true;
-                    }
-                }
-                return false;
-            }
-
-            // Gets the cover on the given side (closest cover to the given side) for the point out of all stored segments
-            public ConnectorSegment GetCover(Point p, DesignerEdges side)
-            {
-                ConnectorSegment cover = null;
-                int distance = 0;
-
-                if (side == DesignerEdges.Left || side == DesignerEdges.Right)
-                {
-                    for (int i = 0; i < this.verticalCovers.Count; i++)
-                    {
-                        ConnectorSegment segment = this.verticalCovers[i];
-                        int currentDistance = (int)((side == DesignerEdges.Left) ? p.X - segment.A.X : segment.A.X - p.X);
-                        if (currentDistance > 0 && segment.Covers(p))
-                        {
-                            if (cover == null || distance > currentDistance)
-                            {
-                                cover = segment;
-                                distance = currentDistance;
-                            }
-                        }
-                    }
-                }
-                else
-                {
-                    for (int i = 0; i < this.horizontalCovers.Count; i++)
-                    {
-                        ConnectorSegment segment = this.horizontalCovers[i];
-                        int currentDistance = (int)((side == DesignerEdges.Bottom) ? p.Y - segment.A.Y : segment.A.Y - p.Y);
-                        if (currentDistance > 0 && segment.Covers(p))
-                        {
-                            if (cover == null || distance > currentDistance)
-                            {
-                                cover = segment;
-                                distance = currentDistance;
-                            }
-                        }
-                    }
-                }
-
-                return cover;
-            }
-
-            public List<ConnectorSegment> GetCovers(Point p, DesignerEdges side)
-            {
-                List<ConnectorSegment> covers = new List<ConnectorSegment>();
-
-                if (side == DesignerEdges.Left || side == DesignerEdges.Right)
-                {
-                    for (int i = 0; i < this.verticalCovers.Count; i++)
-                    {
-                        ConnectorSegment segment = this.verticalCovers[i];
-                        int currentDistance = (int)((side == DesignerEdges.Left) ? p.X - segment.A.X : segment.A.X - p.X);
-                        if (currentDistance > 0 && segment.Covers(p))
-                        {
-                            covers.Add(segment);
-                        }
-                    }
-                }
-                else
-                {
-                    for (int i = 0; i < this.horizontalCovers.Count; i++)
-                    {
-                        ConnectorSegment segment = this.horizontalCovers[i];
-                        int currentDistance = (int)((side == DesignerEdges.Bottom) ? p.Y - segment.A.Y : segment.A.Y - p.Y);
-                        if (currentDistance > 0 && segment.Covers(p))
-                        {
-                            covers.Add(segment);
-                        }
-                    }
-                }
-
-                return covers;
-            }
-
-            public bool IsEscapePoint(Point origin, Point escape, DesignerEdges side)
-            {
-                ConnectorSegment originalCover = this.GetCover(origin, side);
-                int originalDistance;
-                if (side == DesignerEdges.Left || side == DesignerEdges.Right)
-                {
-                    originalDistance = (int)(originalCover.A.X - escape.X);
-                }
-                else
-                {
-                    originalDistance = (int)(originalCover.A.Y - escape.Y);
-                }
-
-                if (originalCover.Covers(escape))
-                {
-                    return false;
-                }
-
-                List<ConnectorSegment> newCovers = this.GetCovers(escape, side);
-                for (int i = 0; i < newCovers.Count; i++)
-                {
-                    ConnectorSegment newCover = newCovers[i];
-                    if (newCover == originalCover)
-                    {
-                        return false;
-                    }
-
-                    int newDistance;
-                    if (side == DesignerEdges.Left || side == DesignerEdges.Right)
-                    {
-                        newDistance = (int)Math.Abs(newCover.A.X - escape.X);
-                    }
-                    else
-                    {
-                        newDistance = (int)Math.Abs(newCover.A.Y - escape.Y);
-                    }
-
-                    if (Math.Sign(newDistance) == Math.Sign(originalDistance) && Math.Abs(newDistance) < Math.Abs(originalDistance))
-                    {
-                        return false;
-                    }
-                }
-
-                return true;
-            }
-        }
-
-        sealed class DistanceSorter : IComparer<DistanceFromPoint>
-        {
-            DistanceSorter()
-            {
-            }
-
-            public static void Sort(ref List<DistanceFromPoint> distances)
-            {
-                DistanceSorter sorter = new DistanceSorter();
-                distances.Sort(sorter);
-            }
-
-            int IComparer<DistanceFromPoint>.Compare(DistanceFromPoint lhs, DistanceFromPoint rhs)
-            {
-                if (lhs.Distance.IsEqualTo(rhs.Distance))
-                {
-                    return 0;
-                }
-                else if (lhs.Distance > rhs.Distance)
-                {
-                    return 1;
-                }
-                else
-                {
-                    return -1;
-                }
-            }
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorStartDotConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorStartDotConverter.cs
deleted file mode 100644 (file)
index 7caa42e..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Diagnostics.CodeAnalysis;
-
-    [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "The class is used in xaml.")]
-    class ConnectorStartDotConverter : IValueConverter
-    {
-        const double Radius = 5.0;
-        const double RadiusForHitTest = 10.0;
-
-        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
-        {
-            Point point = (Point)value;
-            bool[] parameters = (bool[])parameter;
-            double radius = Radius;
-            if (parameters[1])
-            {
-                radius = RadiusForHitTest;
-            }
-            if (parameters[0]) // left point
-            {
-                return new Point((point.X - radius), point.Y);
-            }
-            else // right point
-            {
-                return new Point((point.X + radius), point.Y);
-            }
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorWithStartDot.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorWithStartDot.xaml.cs
deleted file mode 100644 (file)
index 5311b1d..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Input;
-    using System.Windows.Media;
-
-    internal partial class ConnectorWithStartDot : Connector
-    {
-        public ConnectorWithStartDot()
-        {
-            this.InitializeComponent();
-        }
-
-        public override FrameworkElement StartDot
-        {
-            get
-            {
-                return this.startDotGrid;
-            }
-        }
-
-        public override void SetLabelToolTip(object toolTip)
-        {
-            this.labelTextBlock.ToolTip = toolTip;
-        }
-
-        protected override void OnDragEnter(DragEventArgs e)
-        {
-            if (!this.IsMouseOnStartDot(e))
-            {
-                base.OnDragEnter(e);
-            }
-        }
-
-        protected override void OnMouseEnter(MouseEventArgs e)
-        {
-            System.Windows.Controls.Panel.SetZIndex(this, 999);
-            base.OnMouseEnter(e);
-        }
-
-        protected override void OnMouseLeave(MouseEventArgs e)
-        {
-            System.Windows.Controls.Panel.SetZIndex(this, 1);
-            base.OnMouseLeave(e);
-        }
-
-        private bool IsMouseOnStartDot(DragEventArgs e)
-        {
-            HitTestResult result = VisualTreeHelper.HitTest(this, e.GetPosition(this));
-            if (result != null && this.startDotGrid.IsAncestorOf(result.VisualHit))
-            {
-                return true;
-            }
-
-            return false;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorWithoutStartDot.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/ConnectorWithoutStartDot.xaml.cs
deleted file mode 100644 (file)
index 41da30e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    internal partial class ConnectorWithoutStartDot : Connector
-    {
-        public ConnectorWithoutStartDot()
-        {
-            this.InitializeComponent();
-        }
-
-        public override void SetLabelToolTip(object toolTip)
-        {
-            this.labelTextBlock.ToolTip = toolTip;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/DesignerGeometryHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/DesignerGeometryHelper.cs
deleted file mode 100644 (file)
index 34d1729..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System;
-    using System.Windows;
-    using System.Windows.Media;
-
-    internal static class DesignerGeometryHelper
-    {
-        public const double EPS = 1e-6;
-
-        public static double ManhattanDistanceBetweenPoints(Point begin, Point end)
-        {
-            return Math.Abs(begin.X - end.X) + Math.Abs(begin.Y - end.Y);
-        }
-
-        public static double DistanceBetweenPoints(Point point1, Point point2)
-        {
-            return Math.Sqrt(Math.Pow(point2.X - point1.X, 2) + Math.Pow(point2.Y - point1.Y, 2));
-        }
-
-        //This function calculates the total length of line segments by adding individual lengths
-        public static double DistanceOfLineSegments(Point[] segments)
-        {
-            double distance = 0;
-            for (int i = 1; i < segments.Length; i++)
-            {
-                distance += DistanceBetweenPoints(segments[i - 1], segments[i]);
-            }
-            return distance;
-        }
-
-        public static Point MidPointOfLineSegment(Point point1, Point point2)
-        {
-            return new Point(Math.Round((point1.X + point2.X) / 2), Math.Round((point1.Y + point2.Y) / 2));
-        }
-
-        public static double SlopeOfLineSegment(Point start, Point end)
-        {
-            //If line is vertical then the slope is infinite
-            if (start.X == end.X)
-            {
-                return double.MaxValue;
-            }
-
-            //If the line is horizontal then slope is 0
-            if (start.Y == end.Y)
-            {
-                return 0;
-            }
-
-            return ((end.Y - start.Y) / (end.X - start.X));
-        }
-
-
-        //This function returns the length of the longest segment in a PointsCollection.
-        //The segments are assumed to be HORIZONTAL or VERTICAL.
-        //the out parameter returns the start point of the longest segment.
-        //We always choose the first segment among the segments with max length.
-        public static double LongestSegmentLength(PointCollection points, out int longestSegmentIndex)
-        {
-            double maxLength = 0;
-            longestSegmentIndex = -1;
-            for (int i = 0; i < points.Count - 1; i++)
-            {
-                double length = Math.Abs((points[i].X == points[i + 1].X) ? points[i].Y - points[i + 1].Y : points[i].X - points[i + 1].X);
-                if (!length.IsEqualTo(maxLength) && length > maxLength) 
-                {
-                    maxLength = length;
-                    longestSegmentIndex = i;
-                }
-            }
-            
-            return maxLength;
-        }
-    }
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/DoubleExtensions.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/DoubleExtensions.cs
deleted file mode 100644 (file)
index 1be8156..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System;
-    using System.Windows;
-
-    internal static class DoubleExtensions
-    {
-        public static bool IsEqualTo(this double a, double b)
-        {
-            return Math.Abs(a - b) < DesignerGeometryHelper.EPS;
-        }
-
-        public static bool IsNoGreaterThan(this double a, double b)
-        {
-            return a <= b + DesignerGeometryHelper.EPS;
-        }
-
-        public static bool IsNoLessThan(this double a, double b)
-        {
-            return a >= b - DesignerGeometryHelper.EPS;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/FreeFormPanel.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/FreeFormPanel.cs
deleted file mode 100644 (file)
index 1548e6c..0000000
+++ /dev/null
@@ -1,630 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Documents;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using System.Windows.Threading;
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.View;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Runtime;
-    using System.Linq;
-    using System.Activities.Presentation.Model;
-
-    internal class FreeFormPanel : Panel
-    {
-        public static readonly DependencyProperty ChildSizeProperty = DependencyProperty.RegisterAttached("ChildSize", typeof(Size), typeof(FreeFormPanel), new FrameworkPropertyMetadata());
-        public static readonly DependencyProperty LocationProperty = DependencyProperty.RegisterAttached("Location", typeof(Point), typeof(FreeFormPanel), new FrameworkPropertyMetadata(new Point(-1, -1)));
-        public static readonly DependencyProperty RequiredWidthProperty = DependencyProperty.Register("RequiredWidth", typeof(Double), typeof(FreeFormPanel), new FrameworkPropertyMetadata(double.NaN));
-        public static readonly DependencyProperty RequiredHeightProperty = DependencyProperty.Register("RequiredHeight", typeof(Double), typeof(FreeFormPanel), new FrameworkPropertyMetadata(double.NaN));
-        public static readonly DependencyProperty DestinationConnectionPointProperty = DependencyProperty.RegisterAttached("DestinationConnectionPoint", typeof(ConnectionPoint), typeof(FreeFormPanel), new FrameworkPropertyMetadata());
-        public static readonly DependencyProperty SourceConnectionPointProperty = DependencyProperty.RegisterAttached("SourceConnectionPoint", typeof(ConnectionPoint), typeof(FreeFormPanel), new FrameworkPropertyMetadata());
-        public static readonly DependencyProperty DisabledProperty = DependencyProperty.Register("Disabled", typeof(bool), typeof(FreeFormPanel), new UIPropertyMetadata(false));
-        public static readonly DependencyProperty AutoConnectContainerProperty = DependencyProperty.Register("AutoConnectContainer", typeof(IAutoConnectContainer), typeof(FreeFormPanel), new UIPropertyMetadata(null));
-
-        public const double ConnectorEditorOpacity = 1.0;
-        public const double ConnectorEditorThickness = 1.5;
-        public const double LeftStackingMargin = 50;
-        public const double TopStackingMargin = 80;
-        public const double VerticalStackingDistance = 50;
-        public const double GridSize = 10;
-        public ConnectorEditor connectorEditor;
-        double lastYPosition;
-        bool measureConnectors = false;
-        bool measureConnectorsPosted = false;
-        AutoConnectHelper autoConnectHelper = null;
-        DesignerConfigurationService designerConfigurationService = null;
-
-        public FreeFormPanel()
-        {
-            connectorEditor = null;
-            this.autoConnectHelper = new AutoConnectHelper(this);
-            lastYPosition = FreeFormPanel.TopStackingMargin;
-
-            this.Unloaded += (sender, e) =>
-            {
-                this.RemoveConnectorEditor();
-            };
-        }
-
-        public event LocationChangedEventHandler LocationChanged;
-        public event ConnectorMovedEventHandler ConnectorMoved;
-        public event RequiredSizeChangedEventHandler RequiredSizeChanged;
-
-        public static Size GetChildSize(DependencyObject obj)
-        {
-            return (Size)obj.GetValue(FreeFormPanel.ChildSizeProperty);
-        }
-
-        public static void SetChildSize(DependencyObject obj, Size size)
-        {
-            obj.SetValue(FreeFormPanel.ChildSizeProperty, size);
-        }
-
-        public double RequiredHeight
-        {
-            get { return (double)GetValue(FreeFormPanel.RequiredHeightProperty); }
-            private set { SetValue(FreeFormPanel.RequiredHeightProperty, value); }
-        }
-
-        public double RequiredWidth
-        {
-            get { return (double)GetValue(FreeFormPanel.RequiredWidthProperty); }
-            private set { SetValue(FreeFormPanel.RequiredWidthProperty, value); }
-        }
-
-        public bool Disabled
-        {
-            get { return (bool)GetValue(DisabledProperty); }
-            set { SetValue(DisabledProperty, value); }
-        }
-
-        public IAutoConnectContainer AutoConnectContainer
-        {
-            get { return (IAutoConnectContainer)GetValue(AutoConnectContainerProperty); }
-            set { SetValue(AutoConnectContainerProperty, value); }
-        }
-
-        public static Vector CalculateMovement(Key key, bool isRightToLeft)
-        {
-            Vector moveDir;
-            switch (key)
-            {
-                case Key.Down:
-                    moveDir = new Vector(0, FreeFormPanel.GridSize);
-                    break;
-                case Key.Up:
-                    moveDir = new Vector(0, -FreeFormPanel.GridSize);
-                    break;
-                case Key.Right:
-                    moveDir = new Vector(FreeFormPanel.GridSize, 0);
-                    break;
-                case Key.Left:
-                    moveDir = new Vector(-FreeFormPanel.GridSize, 0);
-                    break;
-                default:
-                    Fx.Assert(false, "Invalid case");
-                    moveDir = new Vector(0, 0);
-                    break;
-            }
-
-            if (isRightToLeft)
-            {
-                moveDir.X = -moveDir.X;
-            }
-
-            return moveDir;
-        }
-
-        public static double ZeroIfNegative(double val)
-        {
-            return val.IsNoGreaterThan(0) ? 0 : val;
-        }
-
-        internal UIElement CurrentAutoConnectTarget
-        {
-            get
-            {
-                return this.autoConnectHelper.CurrentTarget;
-            }
-        }
-
-        internal Connector CurrentAutoSplitTarget
-        {
-            get;
-            set;
-        }
-
-        bool AutoConnectEnabled
-        {
-            get
-            {
-                if (this.designerConfigurationService == null)
-                {
-                    DesignerView view = VisualTreeUtils.FindVisualAncestor<DesignerView>(this);
-                    if (view != null)
-                    {
-                        this.designerConfigurationService = view.Context.Services.GetService<DesignerConfigurationService>();
-                        return this.designerConfigurationService.AutoConnectEnabled;
-                    }
-                    else
-                    {
-                        return false;
-                    }
-                }
-                else
-                {
-                    return this.designerConfigurationService.AutoConnectEnabled;
-                }
-            }
-        }
-
-        public static ConnectionPoint GetDestinationConnectionPoint(DependencyObject obj)
-        {
-            return (ConnectionPoint)obj.GetValue(FreeFormPanel.DestinationConnectionPointProperty);
-        }
-
-        public static void SetDestinationConnectionPoint(DependencyObject obj, ConnectionPoint connectionPoint)
-        {
-            obj.SetValue(FreeFormPanel.DestinationConnectionPointProperty, connectionPoint);
-        }
-
-        public static ConnectionPoint GetSourceConnectionPoint(DependencyObject obj)
-        {
-            return (ConnectionPoint)obj.GetValue(FreeFormPanel.SourceConnectionPointProperty);
-        }
-
-        public static void SetSourceConnectionPoint(DependencyObject obj, ConnectionPoint connectionPoint)
-        {
-            obj.SetValue(FreeFormPanel.SourceConnectionPointProperty, connectionPoint);
-        }
-
-        public static Point GetLocation(DependencyObject obj)
-        {
-            return (Point)obj.GetValue(FreeFormPanel.LocationProperty);
-        }
-
-        public static void SetLocation(DependencyObject obj, Point point)
-        {
-            obj.SetValue(FreeFormPanel.LocationProperty, point);
-        }
-
-        protected override void OnInitialized(EventArgs e)
-        {
-            base.OnInitialized(e);
-            this.SnapsToDevicePixels = true;
-            this.AllowDrop = true;
-        }
-
-        internal void RemoveAutoConnectAdorner()
-        {
-            this.autoConnectHelper.RemoveDropTargets();
-        }
-
-        internal List<DependencyObject> GetChildShapes(DependencyObject excluded)
-        {
-            List<DependencyObject> children = new List<DependencyObject>();
-            foreach (UIElement element in this.Children)
-            {
-                if (element is Connector)
-                {
-                    continue;
-                }
-                if (object.Equals(element, excluded))
-                {
-                    continue;
-                }
-                else if (element is VirtualizedContainerService.VirtualizingContainer)
-                {
-                    if (object.Equals(excluded, ((VirtualizedContainerService.VirtualizingContainer)element).Child))
-                    {
-                        continue;
-                    }
-                }
-                children.Add(element);
-            }
-            return children;
-        }
-
-        protected override void OnPreviewDragOver(DragEventArgs e)
-        {
-            if (this.IsOutmostPanel())
-            {
-                if (this.AutoConnectEnabled && DragDropHelper.GetDraggedObjectCount(e) == 1)
-                {
-                    this.autoConnectHelper.OnPreviewDragOverPanel(e);
-                }
-            }
-            base.OnPreviewDragOver(e);
-        }
-
-        public void UpdateConnectorPoints(Connector connector, List<Point> points)
-        {
-            PointCollection pointCollection = new PointCollection();
-            foreach (Point point in points)
-            {
-                pointCollection.Add(new Point(point.X < 0 ? 0 : point.X, point.Y < 0 ? 0 : point.Y));
-            }
-            connector.Points = pointCollection;
-            OnLocationChanged(connector, null);
-        }
-
-        static public List<Point> GetEdgeRelativeToOutmostPanel(ConnectionPoint connectionPoint)
-        {
-            return connectionPoint.Edge;
-        }
-
-        static public Point GetLocationRelativeToOutmostPanel(ConnectionPoint connectionPoint)
-        {
-            return connectionPoint.Location;
-        }
-
-        public Point GetLocationRelativeToOutmostPanel(Point location)
-        {
-            return this.TranslatePoint(location, this.GetOutmostPanel());
-        }
-
-        FreeFormPanel GetOutmostPanel()
-        {
-            DependencyObject obj = this;
-            do
-            {
-                obj = VisualTreeHelper.GetParent(obj);
-            }
-            while (obj != null && !typeof(INestedFreeFormPanelContainer).IsAssignableFrom(obj.GetType()));
-
-            if (obj != null)
-            {
-                INestedFreeFormPanelContainer container = (INestedFreeFormPanelContainer)obj;
-                if (container.GetChildFreeFormPanel() == this)
-                {
-                    return container.GetOutmostFreeFormPanel();
-                }
-            }
-            return this;
-        }
-
-        internal bool IsOutmostPanel()
-        {
-            return this == this.GetOutmostPanel();
-        }
-
-        internal static ConnectionPoint ConnectionPointHitTest(Point hitPoint, ConnectionPointsAdorner adorner)
-        {
-            FreeFormPanel panel = VisualTreeUtils.FindVisualAncestor<FreeFormPanel>(adorner.AdornedElement);
-            return ConnectionPointHitTest(hitPoint, adorner.ConnectionPoints, panel);
-        }
-
-        internal static ConnectionPoint ConnectionPointHitTest(Point hitPoint, List<ConnectionPoint> connectionPoints, FreeFormPanel panel)
-        {
-            ConnectionPoint hitConnectionPoint = null;
-            FreeFormPanel outmost = panel.GetOutmostPanel();
-            foreach (ConnectionPoint connPoint in connectionPoints)
-            {
-                if (connPoint != null && connPoint.IsEnabled)
-                {
-                    if (new Rect(panel.TranslatePoint(connPoint.Location, outmost) + connPoint.HitTestOffset, connPoint.HitTestSize).Contains(hitPoint))
-                    {
-                        hitConnectionPoint = connPoint;
-                        break;
-                    }
-                }
-            }
-            return hitConnectionPoint;
-        }
-
-        protected override Size ArrangeOverride(Size finalSize)
-        {
-            double height = 0;
-            double width = 0;
-            for (int i = 0; i < Children.Count; i++)
-            {
-                Point pt = new Point(0, 0);
-                Size size = Children[i].DesiredSize;
-                if (Children[i].GetType() == typeof(Connector))
-                {
-                    ((UIElement)Children[i]).Arrange(new Rect(pt, size));
-                }
-                else
-                {
-                    pt = FreeFormPanel.GetLocation(Children[i]);
-                    ((UIElement)Children[i]).Arrange(new Rect(pt, size));
-                }
-                if (width < (size.Width + pt.X))
-                {
-                    width = size.Width + pt.X;
-                }
-                if (height < (size.Height + pt.Y))
-                {
-                    height = size.Height + pt.Y;
-                }
-            }
-            width = (width < this.MinWidth) ? this.MinWidth : width;
-            width = (width < this.Width) ? (this.Width < Double.MaxValue ? this.Width : width) : width;
-
-            height = (height < this.MinHeight) ? this.MinHeight : height;
-            height = (height < this.Height) ? (this.Height < Double.MaxValue ? this.Height : height) : height;
-
-            return new Size(width, height);
-        }
-
-        protected override Size MeasureOverride(Size availableSize)
-        {
-            bool isOutmostPanel = this.IsOutmostPanel();
-            base.MeasureOverride(availableSize);
-            double height;
-            double width;
-            this.MeasureChildren(out height, out width);
-            if (this.RequiredSizeChanged != null)
-            {
-                this.RequiredSizeChanged(this, new RequiredSizeChangedEventArgs(new Size(width, height)));
-            }
-            this.RequiredWidth = width;
-            this.RequiredHeight = height;
-
-            if (isOutmostPanel)
-            {
-                Action MeasureConnectors = () =>
-                {
-                    //This action will execute at Input priority. 
-                    //Enabling measuring on Connectors and forcing a MeasureOverride by calling InvalidateMeasure.
-                    this.measureConnectors = true;
-                    this.InvalidateMeasure();
-                };
-                if (!measureConnectorsPosted)
-                {
-                    this.Dispatcher.BeginInvoke(DispatcherPriority.Input, MeasureConnectors);
-                    measureConnectorsPosted = true;
-                }
-                if (measureConnectors)
-                {
-                    measureConnectors = false;
-                    measureConnectorsPosted = false;
-                }
-            }
-            width = (width < this.Width) ? (this.Width < Double.MaxValue ? this.Width : width) : width;
-            height = (height < this.Height) ? (this.Height < Double.MaxValue ? this.Height : height) : height;
-            return new Size(width, height);
-        }
-
-        private void MeasureChildren(out double height, out double width)
-        {
-            height = 0;
-            width = 0;
-            Point pt = new Point(0, 0);
-            bool isOutmostPanel = this.IsOutmostPanel();
-            foreach (UIElement child in Children)
-            {
-                Connector connectorChild = child as Connector;
-                if (connectorChild != null && isOutmostPanel)
-                {
-                    pt = new Point(0, 0);
-
-                    if (measureConnectors)
-                    {
-                        Point srcPoint = FreeFormPanel.GetLocationRelativeToOutmostPanel(FreeFormPanel.GetSourceConnectionPoint(connectorChild));
-                        Point destPoint = FreeFormPanel.GetLocationRelativeToOutmostPanel(FreeFormPanel.GetDestinationConnectionPoint(connectorChild));
-                        if (connectorChild.Points.Count == 0 || !this.Disabled &&
-                            ((DesignerGeometryHelper.ManhattanDistanceBetweenPoints(connectorChild.Points[0], srcPoint) > ConnectorRouter.EndPointTolerance)
-                            || (DesignerGeometryHelper.ManhattanDistanceBetweenPoints(connectorChild.Points[connectorChild.Points.Count - 1], destPoint) > ConnectorRouter.EndPointTolerance)))
-                        {
-                            connectorChild.Points = new PointCollection();
-                            RoutePolyLine(connectorChild);
-                        }
-                        connectorChild.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));
-                    }
-                    else
-                    {
-                        continue;
-                    }
-                }
-                else //Measure non-connector elements.
-                {
-                    child.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));
-                    if (!child.DesiredSize.Equals(((Size)FreeFormPanel.GetChildSize(child))))
-                    {
-                        FreeFormPanel.SetChildSize(child, child.DesiredSize);
-                    }
-                    pt = FreeFormPanel.GetLocation(child);
-                    if (!IsLocationValid(pt))
-                    {
-                        pt = new Point(LeftStackingMargin, lastYPosition);
-                        OnLocationChanged(child, new LocationChangedEventArgs(pt));
-                        FreeFormPanel.SetLocation(child, pt);
-                        lastYPosition += child.DesiredSize.Height + VerticalStackingDistance;
-                    }
-                }
-                if (height < child.DesiredSize.Height + pt.Y)
-                {
-                    height = child.DesiredSize.Height + pt.Y;
-                }
-                if (width < child.DesiredSize.Width + pt.X)
-                {
-                    width = child.DesiredSize.Width + pt.X;
-                }
-            }
-
-            width = (width < this.MinWidth) ? this.MinWidth : width;
-            height = (height < this.MinHeight) ? this.MinHeight : height;
-        }
-
-        static bool IsLocationValid(Point location)
-        {
-            return location.X >= 0 && location.Y >= 0;
-        }
-
-        void OnLocationChanged(Object sender, LocationChangedEventArgs e)
-        {
-            if (LocationChanged != null)
-            {
-                LocationChanged(sender, e);
-            }
-        }
-
-        protected override void OnMouseLeave(MouseEventArgs e)
-        {
-            if (e != null && !this.Disabled && this.IsOutmostPanel())
-            {
-                if (connectorEditor != null && connectorEditor.BeingEdited
-                    && Mouse.DirectlyOver != null
-                    && !(Mouse.DirectlyOver is ConnectionPointsAdorner))
-                {
-                    SaveConnectorEditor(e.GetPosition(this));
-                }
-            }
-            base.OnMouseLeave(e);
-        }
-
-        protected override void OnMouseMove(System.Windows.Input.MouseEventArgs e)
-        {
-            if (e != null && !this.Disabled && this.IsOutmostPanel())
-            {
-                if (this.AutoConnectEnabled)
-                {
-                    this.RemoveAutoConnectAdorner();
-                }
-                if (e.LeftButton == MouseButtonState.Pressed)
-                {
-                    if (connectorEditor != null && connectorEditor.BeingEdited)
-                    {
-                        AutoScrollHelper.AutoScroll(e, this, 1);
-                        connectorEditor.Update(e.GetPosition(this));
-                        e.Handled = true;
-                    }
-                }
-            }
-            base.OnMouseMove(e);
-        }
-
-        protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
-        {
-            if (e != null && !this.Disabled && this.IsOutmostPanel())
-            {
-                if (connectorEditor != null && connectorEditor.BeingEdited)
-                {
-                    SaveConnectorEditor(e.GetPosition(this));
-                }
-            }
-            base.OnMouseLeftButtonUp(e);
-        }
-
-        public void RemoveConnectorEditor()
-        {
-            if (connectorEditor != null)
-            {
-                connectorEditor.Remove();
-                connectorEditor = null;
-            }
-
-        }
-
-        protected override void OnKeyDown(KeyEventArgs e)
-        {
-            if (e != null && !this.Disabled && this.IsOutmostPanel())
-            {
-                if (connectorEditor != null && connectorEditor.BeingEdited)
-                {
-                    if (e.Key == Key.Escape)
-                    {
-                        //If escape key is hit while dragging a connector, end dragging.
-
-                        Connector affectedConnector = connectorEditor.Connector;
-                        RemoveConnectorEditor();
-                        this.connectorEditor = new ConnectorEditor(this, affectedConnector);
-                    }
-
-                    // Ignore all other Keyboard input when rerouting connector
-                    e.Handled = true;
-                }
-            }
-
-            base.OnKeyDown(e);
-        }
-
-        static bool ShouldCreateNewConnectorEditor(MouseButtonEventArgs e)
-        {
-            Connector connector = e.Source as Connector;
-            // Don't create new connector editor when clicking on the start dot.
-            if (connector == null || (connector.StartDot != null && connector.StartDot.IsAncestorOf(e.MouseDevice.DirectlyOver as DependencyObject)))
-            {
-                return false;
-            }
-            return true;
-        }
-
-        protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
-        {
-            if (e != null && !this.Disabled && this.IsOutmostPanel() && e.ClickCount == 1)
-            {
-                //If one of the edit points is clicked, update the connector editor.
-                if ((connectorEditor != null) && connectorEditor.EditPointsHitTest(e.GetPosition(this)))
-                {
-                    connectorEditor.Update(e.GetPosition(this));
-                    e.Handled = true;
-                }
-                else if (ShouldCreateNewConnectorEditor(e))
-                {
-                    CreateNewConnectorEditor(e);
-                }
-            }
-            base.OnPreviewMouseLeftButtonDown(e);
-        }
-
-        void CreateNewConnectorEditor(MouseButtonEventArgs e)
-        {
-            if (connectorEditor == null || !e.Source.Equals(connectorEditor.Connector))
-            {
-                //If user clicks anywhere other than the connector editor, destroy it.
-                RemoveConnectorEditor();
-                if (typeof(Connector).IsAssignableFrom(e.Source.GetType()))
-                {
-                    this.connectorEditor = new ConnectorEditor(this, e.Source as Connector);
-                }
-            }
-        }
-
-        //Calls the Line routing algorithm and populates the points collection of the connector.
-        void RoutePolyLine(Connector connector)
-        {
-            Point[] pts = ConnectorRouter.Route(this, FreeFormPanel.GetSourceConnectionPoint(connector), FreeFormPanel.GetDestinationConnectionPoint(connector));
-            List<Point> points = new List<Point>(pts);
-            if (pts != null)
-            {
-                UpdateConnectorPoints(connector, points);
-            }
-        }
-
-
-        //Connector editing is complete, save the final connectorEditor state into the connector.
-        void SaveConnectorEditor(Point pt)
-        {
-            bool isConnectionEndPointMoved = !connectorEditor.Persist(pt);
-
-            if (this.ConnectorMoved != null)
-            {
-                Connector connector = this.connectorEditor.Connector;
-                List<Point> points = this.connectorEditor.ConnectorEditorLocation;
-                ConnectorMoved(connector, new ConnectorMovedEventArgs(points));
-            }
-
-            if (isConnectionEndPointMoved)
-            {
-                //Persist will return false, when the ConnectionEndPoint has been moved.
-                RemoveConnectorEditor();
-            }
-            else
-            {
-                this.InvalidateMeasure();
-            }
-        }
-    }
-}
-
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/IAutoConnectContainer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/IAutoConnectContainer.cs
deleted file mode 100644 (file)
index 0a89204..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System.Windows;
-
-    /// <summary>
-    /// Defines the interface for the container that enables auto-connect
-    /// </summary>
-    internal interface IAutoConnectContainer
-    {
-        void DoAutoConnect(DragEventArgs e, UIElement targetElement, AutoConnectDirections direction);
-
-        AutoConnectDirections GetDirectionsAllowed(DragEventArgs e, UIElement targetElement);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/IAutoSplitContainer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/IAutoSplitContainer.cs
deleted file mode 100644 (file)
index 07c67c4..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System.Windows;
-
-    /// <summary>
-    /// Defines the interface for the container that enables auto-split
-    /// </summary>
-    internal interface IAutoSplitContainer
-    {
-        bool CanAutoSplit(DragEventArgs e);
-
-        void DoAutoSplit(DragEventArgs e, Connector connector);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/INestedFreeFormPanelContainer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/INestedFreeFormPanelContainer.cs
deleted file mode 100644 (file)
index 1900d4e..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    interface INestedFreeFormPanelContainer
-    {
-        FreeFormPanel GetChildFreeFormPanel();
-        FreeFormPanel GetOutmostFreeFormPanel();
-    }
-}
\ No newline at end of file
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/LocationChangedEventArgs.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/LocationChangedEventArgs.cs
deleted file mode 100644 (file)
index 77a8fbf..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System;
-    using System.Windows;
-
-    class LocationChangedEventArgs : EventArgs
-    {
-        Point newLocation;
-               
-        public LocationChangedEventArgs(Point newLocation)
-        {
-            this.newLocation = newLocation;
-        }
-
-        public Point NewLocation
-        {
-            get
-            {
-                return this.newLocation;
-            }
-        }
-    }
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/LocationChangedEventHandler.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/LocationChangedEventHandler.cs
deleted file mode 100644 (file)
index babccd3..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    internal delegate void LocationChangedEventHandler(object sender, LocationChangedEventArgs e);
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/PointExtensions.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/PointExtensions.cs
deleted file mode 100644 (file)
index cbc0823..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System.Windows;
-
-    internal static class PointExtensions
-    {
-        public static bool IsEqualTo(this Point point1, Point point2)
-        {
-            return DesignerGeometryHelper.DistanceBetweenPoints(point1, point2) < DesignerGeometryHelper.EPS;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/RequiredSizeChangedEventArgs.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/RequiredSizeChangedEventArgs.cs
deleted file mode 100644 (file)
index 15564ba..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    using System;
-    using System.Windows;
-
-    class RequiredSizeChangedEventArgs : EventArgs
-    {
-        public RequiredSizeChangedEventArgs(Size newRequiredSize)
-        {
-            this.NewRequiredSize = newRequiredSize;
-        }
-
-        public Size NewRequiredSize
-        {
-            get;
-            private set;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/RequiredSizeChangedEventHandler.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/RequiredSizeChangedEventHandler.cs
deleted file mode 100644 (file)
index 97283b0..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.FreeFormEditing
-{
-    internal delegate void RequiredSizeChangedEventHandler(object sender, RequiredSizeChangedEventArgs e);
-}
\ No newline at end of file
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/GenericTypeParameterConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/GenericTypeParameterConverter.cs
deleted file mode 100644 (file)
index fd92bc3..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Windows.Data;
-    using System.Globalization;
-    
-    internal sealed class GenericTypeParameterConverter : IValueConverter
-    {
-        bool useFullName = false;
-
-        public GenericTypeParameterConverter() : this(false)
-        {
-        }
-
-        public GenericTypeParameterConverter(bool useFullName)
-        {
-            this.useFullName = useFullName;
-        }
-
-        static IValueConverter baseFullNameConverter =
-            new System.Activities.Presentation.Core.GenericTypeParameterConverter(true);
-        static IValueConverter baseShortNameConverter = 
-            new System.Activities.Presentation.Core.GenericTypeParameterConverter(false);
-
-        IValueConverter Converter
-        {
-            get
-            {
-                return this.useFullName ? 
-                    GenericTypeParameterConverter.baseFullNameConverter : GenericTypeParameterConverter.baseShortNameConverter;
-            }
-        }
-
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            return this.Converter.Convert(value, targetType, parameter, culture);
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            return this.Converter.ConvertBack(value, targetType, parameter, culture);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/HelpKeywords.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/HelpKeywords.cs
deleted file mode 100644 (file)
index bcb0518..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.ComponentModel.Design;
-    using System.Diagnostics.CodeAnalysis;
-
-    internal static class HelpKeywords
-    {
-        public const string HomePage = "DefaultWorkflowDesigner";
-        public const string TypeBrowser = "TypeBrowser";
-        public const string ActivityTypeResolver = "ActivityTypeResolver";
-        public const string ExpressionEditorPage = "System.Activities.Presentation.View.ExpressionTextBox";
-        public const string TypeCollectionEditor = "TypeCollectionEditor";
-        public const string DynamicArgumentDialog = "AddParameters";
-        public const string MessageContentDialog = "MessageContent";
-        public const string UriBuilderDialog = "UriBuilder";
-        public const string AddCorrelationInitializersDialog = "AddCorrelationInitializers";
-        public const string CorrelatesOnDefinitionDialog = "CorrelatesOnDefinition";
-        public const string InitializeCorrelationDialog = "InitializeCorrelation";
-        public const string ErrorView = "System.Activities.Presentation.View.ErrorView";
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/ICommandService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/ICommandService.cs
deleted file mode 100644 (file)
index b60620b..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Hosting
-{
-    using System.Collections.Generic;
-
-    //commanding interface - used for integration of workflow designer actions (like context menu) with custom provided
-    //implementation - i.e. property browser service, debugging service, etc.
-    public interface ICommandService
-    {
-        //returns if given command id is supported 
-        bool IsCommandSupported(int commandId);
-        //verifies if given command can be executed, throws NotSupportedExecption if command is not supported
-        bool CanExecuteCommand(int commandId);
-        //executes command with given id and parameters, throws NotSupportedException if command is not supported
-        void ExecuteCommand(int commandId, Dictionary<string, object> parameters);
-    }
-
-    public static class CommandValues
-    {
-        public const int ShowProperties = 5;
-        public const int InsertBreakpoint = 6;
-        public const int DeleteBreakpoint = 7;
-        public const int EnableBreakpoint = 8;
-        public const int DisableBreakpoint = 9;
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/IDocumentPersistenceService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/IDocumentPersistenceService.cs
deleted file mode 100644 (file)
index 073b47d..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Hosting
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Text;
-    using System.Reflection;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-    using System.Activities.Presentation.Model;
-
-
-    public interface IDocumentPersistenceService
-    {
-        object Load(string fileName);
-        void Flush(object documentRoot);
-        void OnModelChanged(object documentRoot);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/IMultiTargetingSupportService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/IMultiTargetingSupportService.cs
deleted file mode 100644 (file)
index cc81182..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Hosting
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Text;
-    using System.Reflection;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-
-    [SuppressMessage(FxCop.Category.Naming, FxCop.Rule.IdentifiersShouldBeSpelledCorrectly,
-                         Justification = "MultiTargetingSupportService is the correct name")]
-    public interface IMultiTargetingSupportService
-    {
-        Assembly GetReflectionAssembly(AssemblyName targetAssemblyName);
-        Type GetRuntimeType(Type reflectionType);
-        bool IsSupportedType(Type type);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/IWorkflowCommandExtensionCallback.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/IWorkflowCommandExtensionCallback.cs
deleted file mode 100644 (file)
index 0879a50..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Hosting
-{
-    using System.Runtime;
-    using System.Windows.Input;
-
-    [Fx.Tag.XamlVisible(false)]
-    public sealed class CommandInfo
-    {
-        internal CommandInfo(ICommand command)
-        {
-            this.Command = command;
-            this.IsBindingEnabledInDesigner = true;
-        }
-
-        public ICommand Command
-        {
-            get;
-            internal set;
-        }
-
-        public bool IsBindingEnabledInDesigner
-        {
-            get;
-            set;
-        }
-    }
-
-    public interface IWorkflowCommandExtensionCallback
-    {
-        void OnWorkflowCommandLoaded(CommandInfo commandInfo);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/MultiTargetingSupportService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/MultiTargetingSupportService.cs
deleted file mode 100644 (file)
index 37a5354..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Hosting
-{
-    using System.Diagnostics.CodeAnalysis;
-    using System.Reflection;
-    using System.Runtime;
-
-    /// <summary>
-    /// abstract class for multi-targeting support service
-    /// </summary>
-    [SuppressMessage(FxCop.Category.Naming, FxCop.Rule.IdentifiersShouldBeSpelledCorrectly,
-                     Justification = "MultiTargetingSupportService is the correct name")]
-    public abstract class MultiTargetingSupportService : IMultiTargetingSupportService
-    {
-        /// <summary>
-        /// Get reflection assembly given an assembly name
-        /// </summary>
-        /// <param name="targetAssemblyName">target assembly name</param>
-        /// <returns>reflection assembly if target assembly name could be resolved</returns>
-        public abstract Assembly GetReflectionAssembly(AssemblyName targetAssemblyName);
-
-        /// <summary>
-        /// Get runtime type given a reflection type
-        /// </summary>
-        /// <param name="reflectionType">reflection type</param>
-        /// <returns>runtime type associated with the reflection type</returns>
-        public abstract Type GetRuntimeType(Type reflectionType);
-
-        /// <summary>
-        /// Check if a given type is supported by target framework
-        /// </summary>
-        /// <param name="type">type to be checkec</param>
-        /// <returns>true is type is supported by target framework</returns>
-        public abstract bool IsSupportedType(Type type);
-
-        /// <summary>
-        /// Get the reflection type give an object type
-        /// </summary>
-        /// <param name="objectType">object type</param>
-        /// <returns>reflection type</returns>
-        public abstract Type GetReflectionType(Type objectType);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/WindowHelperService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/WindowHelperService.cs
deleted file mode 100644 (file)
index a4b11aa..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Hosting
-{
-    using System;
-    using System.Windows;
-    using System.Windows.Interop;
-    using System.Runtime;
-    using System.Diagnostics.CodeAnalysis;
-    using Microsoft.Tools.Common;
-
-    public delegate void WindowMessage(int msgId, IntPtr parameter1, IntPtr parameter2 );
-
-    [Fx.Tag.XamlVisible(false)]
-    public class WindowHelperService
-    {
-        HwndSource hwndSource;
-        WindowMessage listeners;
-
-        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "hwnd is a well known name.")]
-        public WindowHelperService(IntPtr hwnd)
-        {
-            this.ParentWindowHwnd = hwnd;
-        }
-
-        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "hwnd is a well known name.")]
-        public IntPtr ParentWindowHwnd
-        {
-            get;
-            private set;
-        }
-
-        internal FrameworkElement View
-        {
-            get;
-            set;
-        }
-
-        public bool TrySetWindowOwner(DependencyObject source, Window target)
-        {
-            bool result = false;
-            Fx.Assert(target != null, "Target window cannot be null");
-            if (null != target)
-            {
-                if (source != null)
-                {
-                    //try the easy way first
-                    Window owner = Window.GetWindow(source);
-                    if (null != owner)
-                    {
-                        target.Owner = owner;
-                        result = true;
-                    }
-                }
-                //no - it didn't work
-                if (!result)
-                {
-                    IntPtr ownerHwnd = Win32Interop.GetActiveWindow();
-                    if (ownerHwnd == IntPtr.Zero)
-                    {
-                        ownerHwnd = this.ParentWindowHwnd;
-                    }
-                    WindowInteropHelper interopHelper = new WindowInteropHelper(target);
-                    interopHelper.Owner = ownerHwnd;
-                    result = true;
-                }
-            }
-
-            return result;
-        }
-
-        public bool RegisterWindowMessageHandler(WindowMessage callback)
-        {
-            bool result = true;
-            if (null == callback)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("callback"));
-            }
-
-            //if there are no other callbacks registered - create initial multicast delegate 
-            //and hookup message processing
-            if (null == this.listeners)
-            {
-                this.listeners = (WindowMessage)Delegate.Combine(callback);
-                this.HookupMessageProcessing();
-            }
-                //otherwise, check if callback is not in the list already
-            else 
-            {
-                Delegate[] initial = this.listeners.GetInvocationList();
-                //if it isn't - add it to callback list
-                if (-1 == Array.IndexOf<Delegate>(initial, callback))
-                {
-                    Delegate[] combined = new Delegate[initial.Length + 1];
-                    combined[initial.Length] = callback;
-                    Array.Copy(initial, combined, initial.Length);
-
-                    this.listeners = (WindowMessage)Delegate.Combine(combined);
-                }
-                else
-                {
-                    result = false;
-                }
-            }
-            return result;
-        }
-
-        public bool UnregisterWindowMessageHandler(WindowMessage callback)
-        {
-            bool result = false;
-            if (null == callback)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("callback"));
-            }
-            //if there are any callbacks
-            if (null != this.listeners)
-            {
-                Delegate[] list = this.listeners.GetInvocationList();
-                //check if given delegate belongs to the list
-                if (-1 != Array.IndexOf<Delegate>(list, callback))
-                {
-                    //if list contained 1 element - there is nobody listening for events - remove hook
-                    if (list.Length == 1)
-                    {
-                        this.hwndSource.RemoveHook(new HwndSourceHook(OnMessage));
-                    }
-                    //yes - remove it
-                    this.listeners = (WindowMessage)Delegate.Remove(this.listeners, callback);
-                    result = true;
-                }
-            }
-            if (!result)
-            {
-                System.Diagnostics.Debug.WriteLine("UnregisterWindowMessageHandler - callback not in list");
-            }
-            return result;
-        }
-
-        internal static void TrySetWindowOwner(DependencyObject owner, EditingContext editingContext, Window wnd)
-        {
-            if (null != editingContext)
-            {
-                WindowHelperService service = editingContext.Services.GetService<WindowHelperService>();
-                if (null != service)
-                {
-                    service.TrySetWindowOwner(owner, wnd);
-                }
-            }
-        }
-
-        void HookupMessageProcessing()
-        {
-            //try to create hwnd source object
-            if (null == this.hwndSource)
-            {
-                //first - try to create it using ParentWindow handle
-                if (IntPtr.Zero != this.ParentWindowHwnd)
-                {
-                    this.hwndSource = HwndSource.FromHwnd(this.ParentWindowHwnd);
-                }
-                //if didn't succeed - (either handle is null or we are hosted in [....] app)
-                //try to create hwnd source out of designer's view 
-                if (null == this.hwndSource)
-                {
-                    this.hwndSource = HwndSource.FromVisual(this.View) as HwndSource;
-                }
-            }
-            Fx.Assert(null != this.hwndSource, "HwndSource should not be null!");
-            if (null != this.hwndSource)
-            {
-                //register for event notifications
-                this.hwndSource.AddHook(new HwndSourceHook(OnMessage));
-            }
-        }
-
-        IntPtr OnMessage(IntPtr hwnd, int msgId, IntPtr wParam, IntPtr lParam, ref bool handled)
-        {
-            //notify all listeners about window message
-            this.listeners(msgId, wParam, lParam);
-            return IntPtr.Zero;
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/WorkflowCommandExtensionItem.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Hosting/WorkflowCommandExtensionItem.cs
deleted file mode 100644 (file)
index 0739f8a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Hosting
-{
-    //WorkflowCommandExtensionItem - this class allows user to update each workflow's designer command 
-    //(i.e. input gestures collection). user has to provide IWorkflowCommandExtensionCallback implementation
-    //to get notifications flowing in.
-    public sealed class WorkflowCommandExtensionItem : ContextItem
-    {
-        public WorkflowCommandExtensionItem()
-        {
-        }
-
-        public WorkflowCommandExtensionItem(IWorkflowCommandExtensionCallback callback)
-        {
-            if (null == callback)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("callback"));
-            }
-            this.CommandExtensionCallback = callback;
-        }
-
-        public override Type ItemType
-        {
-            get { return typeof(WorkflowCommandExtensionItem); }
-        }
-
-        internal IWorkflowCommandExtensionCallback CommandExtensionCallback
-        {
-            get;
-            private set;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IActivityDelegateFactory.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IActivityDelegateFactory.cs
deleted file mode 100644 (file)
index 82a0580..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    internal interface IActivityDelegateFactory
-    {
-        Type DelegateType { get; }
-
-        ActivityDelegate Create();
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IActivityToolboxService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IActivityToolboxService.cs
deleted file mode 100644 (file)
index 6b7bd3b..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Collections.Generic;
-
-    // Service used to update Toolbox contents from a Designer.
-    public interface IActivityToolboxService
-    {
-        void AddCategory(string categoryName);
-        void RemoveCategory(string categoryName);
-        void AddItem(string qualifiedTypeName, string categoryName);
-        void RemoveItem(string qualifiedTypeName, string categoryName);
-        IList<string> EnumCategories();
-        IList<string> EnumItems(string categoryName);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ICompositeView.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ICompositeView.cs
deleted file mode 100644 (file)
index a6077b9..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Collections.Generic;
-    using System.Windows;
-    using System.Activities.Presentation.Model;
-using System.Activities.Presentation.View;
-
-    public interface ICompositeView
-    {
-        void OnItemMoved(ModelItem modelItem);
-        object OnItemsCut(List<ModelItem> itemsToCut);
-        object OnItemsCopied(List<ModelItem> itemsToCopy);
-        void OnItemsPasted(List<object> itemsToPaste, List<object> metadata, Point pastePoint, WorkflowViewElement pastePointReference);
-        void OnItemsDelete(List<ModelItem> itemsToDelete);
-        bool CanPasteItems(List<object> itemsToPaste);
-
-        bool IsDefaultContainer { get; }
-        TypeResolvingOptions DroppingTypeResolvingOptions { get; }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ICompositeViewEvents.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ICompositeViewEvents.cs
deleted file mode 100644 (file)
index e33ae91..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-
-    public interface ICompositeViewEvents
-    {
-        void RegisterDefaultCompositeView(ICompositeView container);
-        void UnregisterDefaultCompositeView(ICompositeView container);
-        void RegisterCompositeView(ICompositeView container);
-        void UnregisterCompositeView(ICompositeView container);
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IExpandChild.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IExpandChild.cs
deleted file mode 100644 (file)
index f113fab..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-using System.Activities.Presentation.Model;
-namespace System.Activities.Presentation
-{
-    //Marker interface to support expanded children inside ActivityDesigner/ServiceDesigner.
-    internal interface IExpandChild
-    {
-        ModelItem ExpandedChild
-        {
-            get;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IIntegratedHelpService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IIntegratedHelpService.cs
deleted file mode 100644 (file)
index b0eb4ee..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.ComponentModel.Design;
-    using System.Diagnostics.CodeAnalysis;
-
-    public interface IIntegratedHelpService
-    {
-        void AddContextAttribute(string name, string value, HelpKeywordType keywordType);
-        void RemoveContextAttribute(string name, string value);
-        void ShowHelpFromKeyword(string helpKeyword);
-        [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings",
-          Justification = "This is to keep consistent with IHelpService")]
-        void ShowHelpFromUrl(string helpUrl);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IModalService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IModalService.cs
deleted file mode 100644 (file)
index 4562995..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    public interface IModalService
-    {
-        void SetModalState(bool isModal);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IMultipleDragEnabledCompositeView.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IMultipleDragEnabledCompositeView.cs
deleted file mode 100644 (file)
index 9ff3538..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.View;
-    using System.Collections.Generic;
-    using System.Windows;
-
-    /// <summary>
-    /// An extention interface for ICompositeView to better surpport
-    /// multiple drag/drop.
-    /// </summary>
-    public interface IMultipleDragEnabledCompositeView : ICompositeView
-    {
-        /// <summary>
-        /// This method will be used when item order is needed
-        /// </summary>
-        /// <param name="selectedItems">Selected items to sort.</param>
-        /// <returns>Sorted items</returns>
-        List<ModelItem> SortSelectedItems(List<ModelItem> selectedItems);
-
-        /// <summary>
-        /// After drag/drop, the source container will be notified which 
-        /// items are moved out.
-        /// After implement this interface, ICompositeView.OnItemMoved will
-        /// not be called even in single element drag/drop.
-        /// </summary>
-        /// <param name="movedItems">moved items</param>
-        void OnItemsMoved(List<ModelItem> movedItems);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IUndoEngineOperations.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IUndoEngineOperations.cs
deleted file mode 100644 (file)
index 781dcf8..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    interface IUndoEngineOperations
-    {
-        void AddUndoUnitCore(UndoUnit unit);
-        bool UndoCore();
-        bool RedoCore();
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IWorkflowDesignerStorageService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IWorkflowDesignerStorageService.cs
deleted file mode 100644 (file)
index 6ade40f..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation
-{
-    // WorkflowDesignerStorageService is available in the designer's primary host, Visual Studio. Developers can 
-    // store/retrieve data using this service at any time. The data stored is cleared when the designer is closed
-    // and re-opened manually. But if the designer is automatically reloaded by Visual Studio after build is done
-    // or the reference assemblies are updated, the data stored will not be lost.
-    
-    // The data stored must be serialzable, otherwise exception will be thrown by SetData/AddData.
-    public interface IWorkflowDesignerStorageService
-    {
-        void AddData(string key, object value);
-        void RemoveData(string key);
-        object GetData(string key);
-        void SetData(string key, object value);
-        bool ContainsKey(string key);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IXamlLoadErrorService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/IXamlLoadErrorService.cs
deleted file mode 100644 (file)
index adfbb2e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Collections.Generic;
-
-    public interface IXamlLoadErrorService
-    {
-        void ShowXamlLoadErrors(IList<XamlLoadErrorInfo> errors);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Metadata/ActivityArgumentHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Metadata/ActivityArgumentHelper.cs
deleted file mode 100644 (file)
index f7dfcac..0000000
+++ /dev/null
@@ -1,404 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Metadata
-{
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Validation;
-    using System.Activities.Statements;
-    using System.Activities.Validation;
-    using System.Collections.Generic;
-    using System.Globalization;
-    using System.Linq;
-    using System.Runtime;
-
-    /// <summary>
-    /// A helper class to provide additional functionalities regarding Activity arguments.
-    /// </summary>
-    public static class ActivityArgumentHelper
-    {
-        private static Dictionary<Type, Func<Activity, IEnumerable<ArgumentAccessor>>> argumentAccessorsGenerators = new Dictionary<Type, Func<Activity, IEnumerable<ArgumentAccessor>>>();
-
-        /// <summary>
-        /// Registers with an activity type a function to generate a list of ArgumentAccessors.
-        /// </summary>
-        /// <param name="activityType">The activity type.</param>
-        /// <param name="argumentAccessorsGenerator">A function which takes in an activity instance (of type activityType) and returns a list of ArgumentAccessors.</param>
-        public static void RegisterAccessorsGenerator(Type activityType, Func<Activity, IEnumerable<ArgumentAccessor>> argumentAccessorsGenerator)
-        {
-            if (activityType == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("activityType");
-            }
-
-            if (argumentAccessorsGenerator == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("argumentAccessorsGenerator");
-            }
-
-            // IsAssignableFrom() returns true if activityType is the generic type definition inheriting from Activity.
-            if (!typeof(Activity).IsAssignableFrom(activityType))
-            {
-                throw FxTrace.Exception.Argument("activityType", string.Format(CultureInfo.CurrentCulture, SR.TypeDoesNotInheritFromActivity, activityType.Name));
-            }
-
-            argumentAccessorsGenerators[activityType] = argumentAccessorsGenerator;
-        }
-
-        internal static bool TryGetArgumentAccessorsGenerator(Type activityType, out Func<Activity, IEnumerable<ArgumentAccessor>> argumentAccessorsGenerator)
-        {
-            Fx.Assert(activityType != null, "activityType cannot be null.");
-
-            bool argumentAccessorsGeneratorFound = argumentAccessorsGenerators.TryGetValue(activityType, out argumentAccessorsGenerator);
-            if (!argumentAccessorsGeneratorFound && activityType.IsGenericType && !activityType.IsGenericTypeDefinition)
-            {
-                argumentAccessorsGeneratorFound = argumentAccessorsGenerators.TryGetValue(activityType.GetGenericTypeDefinition(), out argumentAccessorsGenerator);
-            }
-
-            return argumentAccessorsGeneratorFound;
-        }
-
-        internal static void UpdateInvalidArgumentsIfNecessary(object sender, ValidationService.ErrorsMarkedEventArgs args)
-        {
-            if (args.Reason != ValidationReason.ModelChange)
-            {
-                return;
-            }
-
-            if (args.Errors.Count == 0)
-            {
-                return;
-            }
-
-            using (EditingScope editingScope = args.ModelTreeManager.CreateEditingScope(string.Empty))
-            {
-                // Prevent the validation -> fix arguments -> validation loop.
-                editingScope.SuppressUndo = true;
-
-                // Suppress validation. We will do it ourselves (see below)
-                editingScope.SuppressValidationOnComplete = true;
-
-                // Re-compile erroreous expressions to see if update is necessary
-                ValidationService validationService = args.Context.Services.GetRequiredService<ValidationService>();
-                ArgumentAccessorWrapperCache argumentAccessorWrapperCache = new ArgumentAccessorWrapperCache();
-                List<ExpressionReplacement> expressionReplacements = ComputeExpressionReplacements(args.Errors.Select(error => error.Source).OfType<ActivityWithResult>(), args.Context, argumentAccessorWrapperCache);
-                bool argumentReplacementOccurred = false;
-                if (expressionReplacements.Count > 0)
-                {
-                    try
-                    {
-                        foreach (ExpressionReplacement expressionReplacement in expressionReplacements)
-                        {
-                            if (expressionReplacement.TryReplaceArgument(args.ModelTreeManager, validationService))
-                            {
-                                argumentReplacementOccurred = true;
-                            }
-                        }
-
-                        if (argumentReplacementOccurred)
-                        {
-                            args.Handled = true;
-                            editingScope.Complete();
-                        }
-                    }
-                    catch (Exception e)
-                    {
-                        if (Fx.IsFatal(e))
-                        {
-                            throw;
-                        }
-
-                        // We handle exception here instead of letting WF Designer handle it, so that the validation below will run even
-                        // if any of the ArgumentAccessor.Setter methods throw exceptions.
-                        ErrorReporting.ShowErrorMessage(e);
-                    }
-
-                    // Since any pending validation will be canceled if argument replacement occured (=has model change), we need to re-validate the workflow.
-                    // We suppressed validation upon EditingScope completion and do it ourselves, because
-                    // the argument replacement could have been done directly to the underlying activity instance, rather than thru ModelItem.
-                    if (argumentReplacementOccurred)
-                    {
-                        validationService.ValidateWorkflow();
-                    }
-                }
-            }
-        }
-
-        internal static List<ExpressionReplacement> ComputeExpressionReplacements(IEnumerable<ActivityWithResult> expressions, EditingContext context, ArgumentAccessorWrapperCache argumentAccessorWrapperCache)
-        {
-            Fx.Assert(expressions != null, "expressions cannot be null.");
-            Fx.Assert(context != null, "context cannot be null.");
-            Fx.Assert(argumentAccessorWrapperCache != null, "argumentAccessorWrapperCache cannot be null.");
-
-            HashSet<Assign> assignsWithRValueToFix = new HashSet<Assign>();
-            Dictionary<Assign, Type> assignLValueTypes = new Dictionary<Assign, Type>();
-            List<ExpressionReplacement> expressionReplacements = new List<ExpressionReplacement>();
-            foreach (ActivityWithResult expression in expressions)
-            {
-                Activity parentActivity = ValidationService.GetParent(expression);
-                if (parentActivity == null)
-                {
-                    continue;
-                }
-
-                Assign assignActivity = parentActivity as Assign;
-                if (assignActivity != null && !ExpressionHelper.IsGenericLocationExpressionType(expression))
-                {
-                    assignsWithRValueToFix.Add(assignActivity);
-                }
-                else
-                {
-                    ExpressionReplacement expressionReplacement = ComputeExpressionReplacement(expression, parentActivity, context, argumentAccessorWrapperCache);
-                    if (expressionReplacement != null)
-                    {
-                        expressionReplacements.Add(expressionReplacement);
-                        if (assignActivity != null)
-                        {
-                            Type expectedReturnType = expressionReplacement.NewArgument.ArgumentType;
-                            assignLValueTypes[assignActivity] = expectedReturnType;
-                        }
-                    }
-                }
-            }
-
-            // Special handle Assign R-Values: Assign.To.ArgumentType must be the same as Assign.Value.ArgumentType.
-            foreach (Assign assignWithRValueToFix in assignsWithRValueToFix)
-            {
-                Type expectedReturnType;
-                if (assignLValueTypes.TryGetValue(assignWithRValueToFix, out expectedReturnType))
-                {
-                    assignLValueTypes.Remove(assignWithRValueToFix);
-                }
-                else if (assignWithRValueToFix.To != null)
-                {
-                    expectedReturnType = assignWithRValueToFix.To.ArgumentType;
-                }
-
-                ExpressionReplacement expressionReplacement = ComputeExpressionReplacement(assignWithRValueToFix.Value.Expression, assignWithRValueToFix, context, argumentAccessorWrapperCache, expectedReturnType);
-                if (expressionReplacement != null)
-                {
-                    expressionReplacements.Add(expressionReplacement);
-                }
-            }
-
-            // These Assign activities have their L-value argument (To) changed but not the R-value argument (Value).
-            // Now make sure that the R-value arguments are compatible with the L-value argument.
-            foreach (KeyValuePair<Assign, Type> kvp in assignLValueTypes)
-            {
-                Assign remainingAssign = kvp.Key;
-                Type expectedReturnType = kvp.Value;
-                if (remainingAssign.Value != null && remainingAssign.Value.Expression != null)
-                {
-                    ActivityWithResult expression = remainingAssign.Value.Expression;
-                    if (expression.ResultType != expectedReturnType)
-                    {
-                        ExpressionReplacement expressionReplacement = ComputeExpressionReplacement(expression, remainingAssign, context, argumentAccessorWrapperCache, expectedReturnType);
-                        if (expressionReplacement != null)
-                        {
-                            expressionReplacements.Add(expressionReplacement);
-                        }
-                    }
-                }
-            }
-
-            return expressionReplacements;
-        }
-
-        internal static ExpressionReplacement ComputeExpressionReplacement(ActivityWithResult expression, Activity parentActivity, EditingContext context, ArgumentAccessorWrapperCache argumentAccessorWrapperCache, Type preferredReturnType = null)
-        {
-            Fx.Assert(expression != null, "expressions cannot be null.");
-            Fx.Assert(parentActivity != null, "parentActivity cannot be null.");
-            Fx.Assert(context != null, "context cannot be null.");
-            Fx.Assert(argumentAccessorWrapperCache != null, "argumentAccessorWrapperCache cannot be null.");
-
-            IEnumerable<ArgumentAccessorWrapper> argumentAccessorWrappers = argumentAccessorWrapperCache.GetArgumentAccessorWrappers(parentActivity);
-            if (argumentAccessorWrappers != null)
-            {
-                ArgumentAccessorWrapper argumentAccessorWrapper = argumentAccessorWrappers.FirstOrDefault(wrapper => object.ReferenceEquals(wrapper.Argument.Expression, expression));
-                if (argumentAccessorWrapper != null)
-                {
-                    bool isLocationExpression = ExpressionHelper.IsGenericLocationExpressionType(expression);
-                    bool canInferType = true;
-                    Type expectedReturnType;
-                    ActivityWithResult morphedExpression;
-                    if (preferredReturnType != null)
-                    {
-                        expectedReturnType = preferredReturnType;
-                    }
-                    else
-                    {
-                        canInferType = ExpressionHelper.TryInferReturnType(expression, context, out expectedReturnType);
-                    }
-
-                    if (canInferType && expectedReturnType != null && ExpressionHelper.TryMorphExpression(expression, isLocationExpression, expectedReturnType, context, out morphedExpression))
-                    {
-                        Type expressionResultType = isLocationExpression ? expression.ResultType.GetGenericArguments()[0] : expression.ResultType;
-                        if (expressionResultType != expectedReturnType)
-                        {
-                            Argument newArgument = Argument.Create(expectedReturnType, argumentAccessorWrapper.Argument.Direction);
-                            newArgument.Expression = morphedExpression;
-                            return new ExpressionReplacement(expression, argumentAccessorWrapper.Argument, newArgument, argumentAccessorWrapper.ArgumentAccessor);
-                        }
-                    }
-                }
-            }
-
-            return null;
-        }
-
-        internal sealed class ArgumentAccessorWrapper
-        {
-            public ArgumentAccessorWrapper(ArgumentAccessor argumentAccessor, Argument argument)
-            {
-                Fx.Assert(argumentAccessor != null, "argumentAccessor cannot be null.");
-                Fx.Assert(argument != null, "argument cannot be null.");
-
-                this.ArgumentAccessor = argumentAccessor;
-                this.Argument = argument;
-            }
-
-            public ArgumentAccessor ArgumentAccessor { get; private set; }
-
-            public Argument Argument { get; private set; }
-        }
-
-        // This cache ensures that during the entire argument-fixing process (i.e. within UpdateInvalidArgumentsIfNecessary):
-        // 1) An argument accessor generator function is called on an activity instance at most once.
-        // 2) An argument accessor Getter function is called on an activity instance at most once.
-        internal sealed class ArgumentAccessorWrapperCache
-        {
-            private Dictionary<Activity, List<ArgumentAccessorWrapper>> argumentAccessorWrappersCache;
-
-            public ArgumentAccessorWrapperCache()
-            {
-                this.argumentAccessorWrappersCache = new Dictionary<Activity, List<ArgumentAccessorWrapper>>();
-            }
-
-            public List<ArgumentAccessorWrapper> GetArgumentAccessorWrappers(Activity activity)
-            {
-                Fx.Assert(activity != null, "activity cannot be null.");
-
-                List<ArgumentAccessorWrapper> argumentAccessorWrappers = null;
-                if (!this.argumentAccessorWrappersCache.TryGetValue(activity, out argumentAccessorWrappers))
-                {
-                    Func<Activity, IEnumerable<ArgumentAccessor>> argumentAccessorsGenerator;
-                    if (ActivityArgumentHelper.TryGetArgumentAccessorsGenerator(activity.GetType(), out argumentAccessorsGenerator))
-                    {
-                        IEnumerable<ArgumentAccessor> argumentAccessors = argumentAccessorsGenerator(activity);
-                        if (argumentAccessors != null)
-                        {
-                            argumentAccessorWrappers = new List<ArgumentAccessorWrapper>();
-                            foreach (ArgumentAccessor argumentAccessor in argumentAccessors)
-                            {
-                                if (argumentAccessor != null && argumentAccessor.Getter != null)
-                                {
-                                    Argument argument = argumentAccessor.Getter(activity);
-                                    if (argument != null)
-                                    {
-                                        ArgumentAccessorWrapper argumentAccessorWrapper = new ArgumentAccessorWrapper(argumentAccessor, argument);
-                                        argumentAccessorWrappers.Add(argumentAccessorWrapper);
-                                    }
-                                }
-                            }
-
-                            this.argumentAccessorWrappersCache.Add(activity, argumentAccessorWrappers);
-                        }
-                    }
-                }
-
-                return argumentAccessorWrappers;
-            }
-        }
-
-        internal sealed class ExpressionReplacement
-        {
-            public ExpressionReplacement(ActivityWithResult expressionToReplace, Argument oldArgument, Argument newArgument, ArgumentAccessor argumentAccessor)
-            {
-                Fx.Assert(expressionToReplace != null, "expressionToReplace cannot be null.");
-                Fx.Assert(oldArgument != null, "oldArgument cannot be null.");
-                Fx.Assert(newArgument != null, "newArgument cannot be null.");
-                Fx.Assert(argumentAccessor != null, "argumentAccessor cannot be null.");
-
-                this.ExpressionToReplace = expressionToReplace;
-                this.OldArgument = oldArgument;
-                this.NewArgument = newArgument;
-                this.ArgumentAccessor = argumentAccessor;
-            }
-
-            public ActivityWithResult ExpressionToReplace
-            {
-                get;
-                private set;
-            }
-
-            public Argument OldArgument
-            {
-                get;
-                private set;
-            }
-
-            public Argument NewArgument
-            {
-                get;
-                private set;
-            }
-
-            public ArgumentAccessor ArgumentAccessor
-            {
-                get;
-                private set;
-            }
-
-            public bool TryReplaceArgument(ModelTreeManager modelTreeManager, ValidationService validationService)
-            {
-                Fx.Assert(modelTreeManager != null, "modelTreeManager cannot be null.");
-                Fx.Assert(validationService != null, "validationService cannot be null.");
-
-                ModelItem expressionModelItem = modelTreeManager.GetModelItem(this.ExpressionToReplace);
-                if (expressionModelItem != null)
-                {
-                    ModelItem argumentModelItem = expressionModelItem.Parent;
-                    ModelItem parentObject = argumentModelItem.Parent;
-
-                    if (argumentModelItem.Source != null)
-                    {
-                        ModelProperty argumentProperty = parentObject.Properties[argumentModelItem.Source.Name];
-                        Type argumentPropertyType = argumentProperty.PropertyType;
-                        if (argumentPropertyType == typeof(InArgument) || argumentPropertyType == typeof(OutArgument) || argumentPropertyType == typeof(InOutArgument))
-                        {
-                            ModelItem oldArgumentModel = argumentProperty.Value;
-                            ModelItem newArgumentModel = argumentProperty.SetValue(this.NewArgument);
-
-                            // Make sure argument.Expression is wrapped in ModelItem as well
-                            ModelItem newExpressionModel = newArgumentModel.Properties["Expression"].Value;
-
-                            return true;
-                        }
-                    }
-                }
-                else
-                {
-                    Activity parentActivity = ValidationService.GetParent(this.ExpressionToReplace);
-                    if (this.ArgumentAccessor.Setter != null)
-                    {
-                        try
-                        {
-                            validationService.DeactivateValidation();
-                            this.ArgumentAccessor.Setter(parentActivity, this.NewArgument);
-                            return true;
-                        }
-                        finally
-                        {
-                            validationService.ActivateValidation();
-                        }
-                    }
-                }
-
-                return false;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Metadata/ActivityDelegateArgumentDirection.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Metadata/ActivityDelegateArgumentDirection.cs
deleted file mode 100644 (file)
index ce40545..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Metadata
-{
-    internal enum ActivityDelegateArgumentDirection
-    {
-        In = 0,
-        Out = 1
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Metadata/ActivityDelegateArgumentMetadata.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Metadata/ActivityDelegateArgumentMetadata.cs
deleted file mode 100644 (file)
index 1cc80e5..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Metadata
-{
-    internal class ActivityDelegateArgumentMetadata
-    {
-        public string Name
-        {
-            get;
-            set;
-        }
-
-        public ActivityDelegateArgumentDirection Direction
-        {
-            get;
-            set;
-        }
-
-        public Type Type
-        {
-            get;
-            set;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Metadata/ActivityDelegateMetadata.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Metadata/ActivityDelegateMetadata.cs
deleted file mode 100644 (file)
index fde9398..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Metadata
-{
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-
-    internal class ActivityDelegateMetadata : Collection<ActivityDelegateArgumentMetadata>
-    {
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/MiniMap/MiniMapControl.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/MiniMap/MiniMapControl.xaml.cs
deleted file mode 100644 (file)
index ad3bc0d..0000000
+++ /dev/null
@@ -1,514 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-#if DEBUG
-//#define MINIMAP_DEBUG
-#endif
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using System.Windows.Shapes;
-    using System.Diagnostics;
-    using System.Windows.Threading;
-    using System.Globalization;
-
-    // This class is a control displaying minimap of the attached scrollableview control
-    // this class's functionality is limited to delegating events to minimap view controller
-
-    partial class MiniMapControl : UserControl
-    {
-        public static readonly DependencyProperty MapSourceProperty =
-                DependencyProperty.Register("MapSource",
-                typeof(ScrollViewer),
-                typeof(MiniMapControl),
-                new FrameworkPropertyMetadata(null,
-                FrameworkPropertyMetadataOptions.AffectsRender,
-                new PropertyChangedCallback(OnMapSourceChanged)));
-
-        MiniMapViewController lookupWindowManager;
-        bool isMouseDown = false;
-
-        public MiniMapControl()
-        {
-            InitializeComponent();
-            this.lookupWindowManager = new MiniMapViewController(this.lookupCanvas, this.lookupWindow, this.contentGrid);
-        }
-
-        public ScrollViewer MapSource
-        {
-            get { return GetValue(MapSourceProperty) as ScrollViewer; }
-            set { SetValue(MapSourceProperty, value); }
-        }
-
-        static void OnMapSourceChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
-        {
-            MiniMapControl mapControl = (MiniMapControl)sender;
-            mapControl.lookupWindowManager.MapSource = mapControl.MapSource;
-        }
-
-        protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
-        {
-            base.OnMouseLeftButtonDown(e);
-            if (this.lookupWindowManager.StartMapLookupDrag(e))
-            {
-                this.CaptureMouse();
-                this.isMouseDown = true;
-            }
-        }
-
-        protected override void OnMouseMove(MouseEventArgs e)
-        {
-            base.OnMouseMove(e);
-            if (this.isMouseDown)
-            {
-                this.lookupWindowManager.DoMapLookupDrag(e);
-            }
-        }
-
-        protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
-        {
-            base.OnMouseLeftButtonUp(e);
-            if (this.isMouseDown)
-            {
-                Mouse.Capture(null);
-                this.isMouseDown = false;
-                this.lookupWindowManager.StopMapLookupDrag();
-            }
-        }
-
-        protected override void OnMouseDoubleClick(MouseButtonEventArgs e)
-        {
-            this.lookupWindowManager.CenterView(e);
-            e.Handled = true;
-            base.OnMouseDoubleClick(e);
-        }
-
-        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
-        {
-            base.OnRenderSizeChanged(sizeInfo);
-            this.lookupWindowManager.MapViewSizeChanged(sizeInfo);
-        }
-
-        // This class wraps positioning and calculating logic of the map view lookup window
-        // It is also responsible for handling mouse movements
-
-        internal class LookupWindow
-        {
-            Point mousePosition;
-            Rectangle lookupWindowRectangle;
-            MiniMapViewController parent;
-
-
-            public LookupWindow(MiniMapViewController parent, Rectangle lookupWindowRectangle)
-            {
-                this.mousePosition = new Point();
-                this.parent = parent;
-                this.lookupWindowRectangle = lookupWindowRectangle;
-            }
-
-            public double Left
-            {
-                get { return Canvas.GetLeft(this.lookupWindowRectangle); }
-                set
-                {
-                    //check if left corner is within minimap's range - clip if necessary
-                    double left = Math.Max(value - this.mousePosition.X, 0.0);
-                    //check if right corner is within minimap's range - clip if necessary
-                    left = (left + Width > this.parent.MapWidth ? this.parent.MapWidth - Width : left);
-                    //update canvas
-                    Canvas.SetLeft(this.lookupWindowRectangle, left);
-                }
-            }
-
-            public double Top
-            {
-                get { return Canvas.GetTop(this.lookupWindowRectangle); }
-                set
-                {
-                    //check if top corner is within minimap's range - clip if necessary
-                    double top = Math.Max(value - this.mousePosition.Y, 0.0);
-                    //check if bottom corner is within minimap's range - clip if necessary
-                    top = (top + Height > this.parent.MapHeight ? this.parent.MapHeight - Height : top);
-                    //update canvas
-                    Canvas.SetTop(this.lookupWindowRectangle, top);
-                }
-            }
-
-            public double Width
-            {
-                get { return this.lookupWindowRectangle.Width; }
-                set { this.lookupWindowRectangle.Width = value; }
-            }
-
-            public double Height
-            {
-                get { return this.lookupWindowRectangle.Height; }
-                set { this.lookupWindowRectangle.Height = value; }
-            }
-
-            public double MapCenterXPoint
-            {
-                get { return this.Left + (this.Width / 2.0); }
-            }
-
-            public double MapCenterYPoint
-            {
-                get { return this.Top + (this.Height / 2.0); }
-            }
-
-            public double MousePositionX
-            {
-                get { return this.mousePosition.X; }
-            }
-
-            public double MousePositionY
-            {
-                get { return this.mousePosition.Y; }
-            }
-
-            public bool IsSelected
-            {
-                get;
-                private set;
-            }
-
-            public void SetPosition(double left, double top)
-            {
-                Left = left;
-                Top = top;
-            }
-
-            public void SetSize(double width, double height)
-            {
-                Width = width;
-                Height = height;
-            }
-
-            //whenever user clicks on the minimap, i check if clicked object is 
-            //a lookup window - if yes - i store mouse offset within the window
-            //and mark it as selected
-            public bool Select(object clickedItem, Point clickedPosition)
-            {
-                if (clickedItem == this.lookupWindowRectangle)
-                {
-                    this.mousePosition = clickedPosition;
-                    this.IsSelected = true;
-                }
-                else
-                {
-                    Unselect();
-                }
-                return this.IsSelected;
-            }
-
-            public void Unselect()
-            {
-                this.mousePosition.X = 0;
-                this.mousePosition.Y = 0;
-                this.IsSelected = false;
-            }
-
-            public void Center(double x, double y)
-            {
-                Left = x - (Width / 2.0);
-                Top = y - (Height / 2.0);
-            }
-
-            public void Refresh(bool unselect)
-            {
-                if (unselect)
-                {
-                    Unselect();
-                }
-                SetPosition(Left, Top);
-            }
-        }
-
-        // This class is responsible for calculating size of the minimap's view area, as well as
-        // maintaining the bi directional link between minimap and control beeing visualized.
-        // Whenever minimap's view window position is updated, the control's content is scrolled 
-        // to calculated position
-        // Whenever control's content is resized or scrolled, minimap reflects that change in 
-        // recalculating view's window size and/or position
-
-        internal class MiniMapViewController
-        {
-            Canvas lookupCanvas;
-            Grid contentGrid;
-            ScrollViewer mapSource;
-            LookupWindow lookupWindow;
-
-            public MiniMapViewController(Canvas lookupCanvas, Rectangle lookupWindowRectangle, Grid contentGrid)
-            {
-                this.lookupWindow = new LookupWindow(this, lookupWindowRectangle);
-                this.lookupCanvas = lookupCanvas;
-                this.contentGrid = contentGrid;
-            }
-
-            public ScrollViewer MapSource
-            {
-                get { return this.mapSource; }
-                set
-                {
-                    this.mapSource = value;
-                    //calculate view's size and set initial position
-                    this.lookupWindow.Unselect();
-                    this.CalculateLookupWindowSize();
-                    this.lookupWindow.SetPosition(0.0, 0.0);
-                    CalculateMapPosition(this.lookupWindow.Left, this.lookupWindow.Top);
-                    this.UpdateContentGrid();
-
-                    if (null != this.mapSource && null != this.mapSource.Content && this.mapSource.Content is FrameworkElement)
-                    {
-                        FrameworkElement content = (FrameworkElement)this.mapSource.Content;
-                        //hook up for all content size changes - handle them in OnContentSizeChanged method
-                        content.SizeChanged += (s, e) =>
-                            {
-                                this.contentGrid.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle,
-                                    new Action(() => { OnContentSizeChanged(s, e); }));
-                            };
-
-                        //in case of scroll viewer - there are two different events to handle in one notification:
-                        this.mapSource.ScrollChanged += (s, e) =>
-                        {
-                            this.contentGrid.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle,
-                                new Action(() =>
-                                    {
-                                        //when user changes scroll position - delegate it to OnMapSourceScrollChange
-                                        if (0.0 != e.HorizontalChange || 0.0 != e.VerticalChange)
-                                        {
-                                            OnMapSourceScrollChanged(s, e);
-                                        }
-                                        //when size of the scroll changes delegate it to OnContentSizeChanged
-                                        if (0.0 != e.ViewportWidthChange || 0.0 != e.ViewportHeightChange)
-                                        {
-                                            OnContentSizeChanged(s, e);
-                                        }
-                                    }));
-                        };
-                        this.OnMapSourceScrollChanged(this, null);
-                        this.OnContentSizeChanged(this, null);
-                    }
-                }
-            }
-
-            //bunch of helper getters - used to increase algorithm readability and provide default
-            //values, always valid values, so no additional divide-by-zero checks are neccessary
-
-            public double MapWidth
-            {
-                get { return this.contentGrid.ActualWidth - 2 * (this.contentGrid.ColumnDefinitions[0].MinWidth); }
-            }
-
-            public double MapHeight
-            {
-                get { return this.contentGrid.ActualHeight - 2 * (this.contentGrid.RowDefinitions[0].MinHeight); }
-            }
-
-            internal LookupWindow LookupWindow
-            {
-                get { return this.lookupWindow; }
-            }
-
-            double VisibleSourceWidth
-            {
-                get { return (null == MapSource || 0.0 == MapSource.ViewportWidth ? 1.0 : MapSource.ViewportWidth); }
-            }
-
-            double VisibleSourceHeight
-            {
-                get { return (null == MapSource || 0.0 == MapSource.ViewportHeight ? 1.0 : MapSource.ViewportHeight); }
-            }
-
-
-            public void CenterView(MouseEventArgs args)
-            {
-                Point pt = args.GetPosition(this.lookupCanvas);
-                this.lookupWindow.Unselect();
-                this.lookupWindow.Center(pt.X, pt.Y);
-                CalculateMapPosition(this.lookupWindow.Left, this.lookupWindow.Top);
-            }
-
-            public void MapViewSizeChanged(SizeChangedInfo sizeInfo)
-            {
-                this.OnContentSizeChanged(this, EventArgs.Empty);
-                this.lookupWindow.Unselect();
-                this.CalculateLookupWindowSize();
-                if (sizeInfo.WidthChanged && 0.0 != sizeInfo.PreviousSize.Width)
-                {
-                    this.lookupWindow.Left =
-                        this.lookupWindow.Left * (sizeInfo.NewSize.Width / sizeInfo.PreviousSize.Width);
-                }
-                if (sizeInfo.HeightChanged && 0.0 != sizeInfo.PreviousSize.Height)
-                {
-                    this.lookupWindow.Top =
-                        this.lookupWindow.Top * (sizeInfo.NewSize.Height / sizeInfo.PreviousSize.Height);
-                }
-            }
-
-            public bool StartMapLookupDrag(MouseEventArgs args)
-            {
-                bool result = false;
-                HitTestResult hitTest =
-                    VisualTreeHelper.HitTest(this.lookupCanvas, args.GetPosition(this.lookupCanvas));
-
-                if (null != hitTest && null != hitTest.VisualHit)
-                {
-                    Point clickedPosition = args.GetPosition(hitTest.VisualHit as IInputElement);
-                    result = this.lookupWindow.Select(hitTest.VisualHit, clickedPosition);
-                }
-                return result;
-            }
-
-            public void StopMapLookupDrag()
-            {
-                this.lookupWindow.Unselect();
-            }
-
-            public void DoMapLookupDrag(MouseEventArgs args)
-            {
-                if (args.LeftButton == MouseButtonState.Released && this.lookupWindow.IsSelected)
-                {
-                    this.lookupWindow.Unselect();
-                }
-                if (this.lookupWindow.IsSelected)
-                {
-                    Point to = args.GetPosition(this.lookupCanvas);
-                    this.lookupWindow.SetPosition(to.X, to.Y);
-                    CalculateMapPosition(
-                        to.X - this.lookupWindow.MousePositionX,
-                        to.Y - this.lookupWindow.MousePositionY);
-                }
-            }
-
-            void CalculateMapPosition(double left, double top)
-            {
-                if (null != MapSource && 0 != this.lookupWindow.Width && 0 != this.lookupWindow.Height)
-                {
-                    MapSource.ScrollToHorizontalOffset((left / this.lookupWindow.Width) * VisibleSourceWidth);
-                    MapSource.ScrollToVerticalOffset((top / this.lookupWindow.Height) * VisibleSourceHeight);
-                }
-            }
-
-            //this method calculates position of the lookup window on the minimap - it should be triggered when:
-            // - user modifies a scroll position by draggin a scroll bar
-            // - scroll sizes are updated by change of the srcollviewer size
-            // - user drags minimap view - however, in this case no lookup update takes place
-            void OnMapSourceScrollChanged(object sender, ScrollChangedEventArgs e)
-            {
-                if (!this.lookupWindow.IsSelected && null != MapSource)
-                {
-                    this.lookupWindow.Unselect();
-                    this.lookupWindow.Left =
-                        this.lookupWindow.Width * (MapSource.HorizontalOffset / VisibleSourceWidth);
-
-                    this.lookupWindow.Top =
-                        this.lookupWindow.Height * (MapSource.VerticalOffset / VisibleSourceHeight);
-                }
-                DumpData("OnMapSourceScrollChange");
-            }
-
-            //this method calculates size and position of the minimap view - it should be triggered when:
-            // - zoom changes
-            // - visible size of the scrollviewer (which is map source) changes
-            // - visible size of the minimap control changes 
-            void OnContentSizeChanged(object sender, EventArgs e)
-            {
-                //get old center point coordinates
-                double centerX = this.lookupWindow.MapCenterXPoint;
-                double centeryY = this.lookupWindow.MapCenterYPoint;
-                //update the minimap itself
-                this.UpdateContentGrid();
-                //calculate new size
-                this.CalculateLookupWindowSize();
-                //try to center around old center points (window may be moved if doesn't fit)
-                this.lookupWindow.Center(centerX, centeryY);
-                DumpData("OnContentSizeChanged");
-            }
-
-            //this method calculates size of the lookup rectangle, based on the visible size of the object, 
-            //including current map width
-            void CalculateLookupWindowSize()
-            {
-                double width = this.MapWidth;
-                double height = this.MapHeight;
-
-                if (this.MapSource.ScrollableWidth != 0 && this.MapSource.ExtentWidth != 0)
-                {
-                    width = (this.MapSource.ViewportWidth / this.MapSource.ExtentWidth) * this.MapWidth;
-                }
-                else
-                {
-                    //width = 
-                }
-                if (this.MapSource.ScrollableHeight != 0 && this.MapSource.ExtentHeight != 0)
-                {
-                    height = (this.MapSource.ViewportHeight / this.MapSource.ExtentHeight) * this.MapHeight;
-                }
-                this.lookupWindow.SetSize(width, height);
-            }
-
-            //this method updates content grid of the minimap - most likely, minimap view will be scaled to fit
-            //the window - so there will be some extra space visible on the left and right sides or above and below actual
-            //mini map view - we don't want lookup rectangle to navigate within that area, since it is not representing
-            //actual view - we increase margins of the minimap to disallow this
-            void UpdateContentGrid()
-            {
-                bool resetToDefault = true;
-                if (this.MapSource.ExtentWidth != 0 && this.MapSource.ExtentHeight != 0)
-                {
-                    //get width to height ratio from map source - we want to display our minimap in the same ratio
-                    double widthToHeightRatio = this.MapSource.ExtentWidth / this.MapSource.ExtentHeight;
-
-                    //calculate current width to height ratio on the minimap
-                    double height = this.contentGrid.ActualHeight;
-                    double width = this.contentGrid.ActualWidth;
-                    //ideally - it should be 1 - whole view perfectly fits minimap 
-                    double minimapWidthToHeightRatio = (height * widthToHeightRatio) / (width > 1.0 ? width : 1.0);
-
-                    //if value is greater than one - we have to reduce height
-                    if (minimapWidthToHeightRatio > 1.0)
-                    {
-                        double margin = (height - (height / minimapWidthToHeightRatio)) / 2.0;
-
-                        this.contentGrid.ColumnDefinitions[0].MinWidth = 0.0;
-                        this.contentGrid.ColumnDefinitions[2].MinWidth = 0.0;
-                        this.contentGrid.RowDefinitions[0].MinHeight = margin;
-                        this.contentGrid.RowDefinitions[2].MinHeight = margin;
-                        resetToDefault = false;
-                    }
-                    //if value is less than one - we have to reduce width
-                    else if (minimapWidthToHeightRatio < 1.0)
-                    {
-                        double margin = (width - (width * minimapWidthToHeightRatio)) / 2.0;
-                        this.contentGrid.ColumnDefinitions[0].MinWidth = margin;
-                        this.contentGrid.ColumnDefinitions[2].MinWidth = margin;
-                        this.contentGrid.RowDefinitions[0].MinHeight = 0.0;
-                        this.contentGrid.RowDefinitions[2].MinHeight = 0.0;
-                        resetToDefault = false;
-                    }
-                }
-                //perfect match or nothing to display - no need to setup margins
-                if (resetToDefault)
-                {
-                    this.contentGrid.ColumnDefinitions[0].MinWidth = 0.0;
-                    this.contentGrid.ColumnDefinitions[2].MinWidth = 0.0;
-                    this.contentGrid.RowDefinitions[0].MinHeight = 0.0;
-                    this.contentGrid.RowDefinitions[2].MinHeight = 0.0;
-                }
-            }
-
-            [Conditional("MINIMAP_DEBUG")]
-            void DumpData(string prefix)
-            {
-                System.Diagnostics.Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, "{0} ScrollViewer: EWidth {1}, EHeight {2}, AWidth {3}, AHeight {4}, ViewPortW {5} ViewPortH {6}", prefix, mapSource.ExtentWidth, mapSource.ExtentHeight, mapSource.ActualWidth, mapSource.ActualHeight, mapSource.ViewportWidth, mapSource.ViewportHeight));
-            }
-
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/AttachablePropertyChange.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/AttachablePropertyChange.cs
deleted file mode 100644 (file)
index 340b428..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System.Xaml;
-
-    internal class AttachablePropertyChange : ModelChange
-    {
-        public ModelItem Owner { get; set; }
-        
-        public AttachableMemberIdentifier AttachablePropertyIdentifier { get; set; }
-        
-        public object OldValue { get; set; }
-        
-        public object NewValue { get; set; }
-        
-        public string PropertyName { get; set; }
-
-        public override string Description
-        {
-            get { return SR.PropertyChangeEditingScopeDescription; }
-        }
-
-        public override bool Apply()
-        {
-            if (this.NewValue == null)
-            {
-                AttachablePropertyServices.RemoveProperty(this.Owner.GetCurrentValue(), this.AttachablePropertyIdentifier);
-            }
-            else
-            {
-                AttachablePropertyServices.SetProperty(this.Owner.GetCurrentValue(), this.AttachablePropertyIdentifier, this.NewValue);
-            }
-
-            // notify observer
-            if (!string.IsNullOrEmpty(this.PropertyName))
-            {
-                ((IModelTreeItem)this.Owner).OnPropertyChanged(this.PropertyName);
-            }
-
-            return true;
-        }
-
-        public override Change GetInverse()
-        {
-            return new AttachablePropertyChange()
-            {
-                Owner = this.Owner,
-                AttachablePropertyIdentifier = this.AttachablePropertyIdentifier,
-                OldValue = this.NewValue,
-                NewValue = this.OldValue,
-                PropertyName = this.PropertyName
-            };
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/AttachedPropertiesService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/AttachedPropertiesService.cs
deleted file mode 100644 (file)
index 3340503..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Text;
-    using System.Runtime;
-    
-    public class AttachedPropertiesService
-    {
-        List<AttachedProperty> properties;
-
-        public AttachedPropertiesService()
-        {
-            this.properties = new List<AttachedProperty>();
-        }
-
-        public void AddProperty(AttachedProperty property)
-        {
-            if (property == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("property"));
-            }
-            if (string.IsNullOrEmpty(property.Name))
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException(SR.AttachedPropertyNameShouldNotBeEmpty));
-            }
-            this.properties.Add(property);
-        }
-
-        internal IEnumerable<AttachedProperty> GetAttachedProperties(Type modelItemType)
-        {
-            var properties = from property in this.properties
-                where property.OwnerType.IsAssignableFrom(modelItemType) select property;
-
-            if (modelItemType.IsGenericType)
-            {
-                var propertiesFromGenericRoot = from property in this.properties
-                                                where property.OwnerType.IsAssignableFrom(modelItemType.GetGenericTypeDefinition())
-                                                select property;
-                properties = properties.Concat(propertiesFromGenericRoot).Distinct();
-            }
-
-            return properties;
-        }
-    }
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/AttachedProperty.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/AttachedProperty.cs
deleted file mode 100644 (file)
index 5dbcfb5..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Text;
-    using System.Activities.Presentation.Model;
-    using System.Runtime;
-    using System.Diagnostics.CodeAnalysis;
-
-    public abstract class AttachedProperty
-    {
-        Type ownerType = typeof(object);
-
-        [SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods", Justification = "By design.")]
-        public abstract Type Type
-        {
-            get;
-        }
-
-        public abstract bool IsReadOnly
-        {
-            get;
-        }
-
-        public bool IsBrowsable
-        {
-            get;
-            set;
-        }
-
-        internal bool IsVisibleToModelItem
-        {
-            get;
-            set;
-        }
-
-        public string Name
-        { 
-            get; set; 
-        }
-
-        public Type OwnerType
-        {
-            get
-            {
-                return this.ownerType;
-            }
-            set
-            {
-                this.ownerType = value;
-            }
-        }
-
-        public abstract object GetValue(ModelItem modelItem);
-        public abstract void SetValue(ModelItem modelItem, object value);
-        public abstract void ResetValue(ModelItem modelItem);
-
-        public void NotifyPropertyChanged(ModelItem modelItem)
-        {
-            if (null != modelItem)
-            {
-                ((IModelTreeItem)modelItem).OnPropertyChanged(this.Name);
-            }
-        }
-    }
-
-    
-    public class AttachedProperty<T> : AttachedProperty
-    {
-        [Fx.Tag.KnownXamlExternal]
-        public Func<ModelItem, T> Getter
-        { 
-            get; set; 
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public Action<ModelItem, T> Setter
-        { 
-            get; set; 
-        }
-
-        public override Type Type
-        {
-            get { return typeof(T); }
-        }
-
-        public override bool IsReadOnly
-        {
-            get { return (this.Setter == null); }
-        }
-
-        public override object GetValue(ModelItem modelItem)
-        {
-            return this.Getter(modelItem);
-        }
-
-        public override void SetValue(ModelItem modelItem, object Value)
-        {
-            if (this.IsReadOnly)
-            {
-                throw FxTrace.Exception.AsError(new InvalidOperationException(SR.PropertyIsReadOnly));
-            }
-            this.Setter(modelItem, (T)Value);
-            this.NotifyPropertyChanged(modelItem);
-        }
-
-        public override void ResetValue(ModelItem modelItem)
-        {
-            SetValue(modelItem, default(T));
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/AttachedPropertyDescriptor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/AttachedPropertyDescriptor.cs
deleted file mode 100644 (file)
index 4894df0..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Text;
-    using System.ComponentModel;
-    using System.Activities.Presentation.Model;
-
-    class AttachedPropertyDescriptor : PropertyDescriptor
-    {
-        AttachedProperty AttachedProperty;
-        ModelItem owner;
-
-        public AttachedPropertyDescriptor(AttachedProperty AttachedProperty, ModelItem owner)
-            : base(AttachedProperty.Name, null)
-        {
-            this.AttachedProperty = AttachedProperty;
-            this.owner = owner;
-        }
-
-        public override AttributeCollection Attributes
-        {
-            get
-            {
-                List<Attribute> attributeList = new List<Attribute>();
-                foreach (Attribute attr in TypeDescriptor.GetAttributes(this.PropertyType))
-                {
-                    attributeList.Add(attr);
-                }
-                BrowsableAttribute browsableAttribute = new BrowsableAttribute(this.IsBrowsable);
-                attributeList.Add(browsableAttribute);
-                return new AttributeCollection(attributeList.ToArray());
-            }
-        }
-
-        public override Type ComponentType
-        {
-            get { return this.owner.ItemType; }
-        }
-
-        public override bool IsReadOnly
-        {
-            get
-            {
-                return this.AttachedProperty.IsReadOnly;
-            }
-        }
-
-        public override Type PropertyType
-        {
-            get
-            {
-                return this.AttachedProperty.Type;
-            }
-        }
-
-        public override bool IsBrowsable
-        {
-            get
-            {
-                return this.AttachedProperty.IsBrowsable;
-            }
-        }
-        public override bool CanResetValue(object component)
-        {
-            return false;
-        }
-
-        public override object GetValue(object component)
-        {
-
-            return this.AttachedProperty.GetValue(owner);
-        }
-
-        public override void ResetValue(object component)
-        {
-            this.AttachedProperty.ResetValue(owner);
-        }
-
-        public override void SetValue(object component, object value)
-        {
-            this.AttachedProperty.SetValue(owner, value);
-        }
-
-        public override bool ShouldSerializeValue(object component)
-        {
-            return false;
-        }
-    }
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/AttachedPropertyInfo.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/AttachedPropertyInfo.cs
deleted file mode 100644 (file)
index ca9ce00..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System.Activities.Presentation;
-
-    public abstract class AttachedPropertyInfo
-    {
-        bool isBrowsable = true;
-        bool? isVisibleToModelItem;
-
-        public string PropertyName { get; set; }
-
-        internal bool IsBrowsable
-        {
-            get { return isBrowsable; }
-            set { this.isBrowsable = value; }
-        }
-
-        internal bool IsVisibleToModelItem
-        {
-            get { return this.isVisibleToModelItem.HasValue ? this.isVisibleToModelItem.Value : this.isBrowsable; }
-            set { this.isVisibleToModelItem = value; }
-        }
-
-        internal abstract void Register(ViewStateAttachedPropertyFeature viewStateAttachedPropertyFeature);
-    }
-
-    public sealed class AttachedPropertyInfo<T> : AttachedPropertyInfo
-    {
-        public T DefaultValue { get; set; }
-
-        internal override void Register(ViewStateAttachedPropertyFeature viewStateAttachedPropertyFeature)
-        {
-            viewStateAttachedPropertyFeature.RegisterAttachedProperty<T>(this.PropertyName, this.IsBrowsable, this.IsVisibleToModelItem, this.DefaultValue);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/BackPointer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/BackPointer.cs
deleted file mode 100644 (file)
index 7e04df6..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    internal class BackPointer : LinkBase
-    {
-        public BackPointer(ModelItem sourceVertex, ModelItem destinationVertex)
-            : base(sourceVertex, destinationVertex)
-        {
-        }
-
-        public BackPointer(string propertyName, ModelItem sourceVertex, ModelItem destinationVertex)
-            : base(propertyName, sourceVertex, destinationVertex)
-        {
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/Change.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/Change.cs
deleted file mode 100644 (file)
index f32428c..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-
-    public abstract class Change
-    {
-        public abstract string Description { get; }
-        public abstract bool Apply();
-        public abstract Change GetInverse();
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/CollectionChange.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/CollectionChange.cs
deleted file mode 100644 (file)
index 6c7eebd..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System.Runtime;
-    using System.Activities.Presentation.Services;
-
-    class CollectionChange : ModelChange
-    {
-        public ModelItemCollection Collection { get; set; }
-
-        public int Index { get; set; }
-
-        public ModelItem Item { get; set; }
-
-        public OperationType Operation { get; set; }
-
-        public ModelTreeManager ModelTreeManager { get; set; }
-
-        public override string Description
-        {
-            get
-            {
-                return this.Operation == OperationType.Insert ? SR.CollectionAddEditingScopeDescription : SR.CollectionRemoveEditingScopeDescription;
-            }
-        }
-
-        public override bool Apply()
-        {
-            switch (this.Operation)
-            {
-                case OperationType.Insert:
-                    ApplyInsert();
-                    break;
-                case OperationType.Delete:
-                    ApplyDelete();
-                    break;
-                default:
-                    Fx.Assert("Operation should be Insert or Delete");
-                    break;
-
-            }
-            return true;
-        }
-
-        private void ApplyDelete()
-        {
-            Fx.Assert(this.ModelTreeManager != null, "ModelTreeManager cannot be null.");
-            Fx.Assert(this.Collection != null, "this.Collection cannot be null.");
-
-            if (this.Index >= 0)
-            {
-                ((ModelItemCollectionImpl)this.Collection).RemoveAtCore(this.Index);
-            }
-            else
-            {
-                Fx.Assert(this.Index == -1, "-1 must be used to indicate Remove(item)");
-                this.Index = this.Collection.IndexOf(this.Item);
-                ((ModelItemCollectionImpl)this.Collection).RemoveCore(this.Item);
-            }
-
-            ModelChangeInfo changeInfo = ModelChangeInfoImpl.CreateCollectionItemRemoved(this.Collection, this.Item);
-            this.ModelTreeManager.NotifyCollectionRemove(this.Item, changeInfo);
-        }
-
-        private void ApplyInsert()
-        {
-            Fx.Assert(this.ModelTreeManager != null, "ModelTreeManager cannot be null.");
-            Fx.Assert(this.Collection != null, "this.Collection cannot be null.");
-
-            if (this.Index >= 0)
-            {
-                ((ModelItemCollectionImpl)this.Collection).InsertCore(this.Index, this.Item);
-            }
-            else
-            {
-                Fx.Assert(this.Index == -1, "-1 must be used to indicate Add(item)");
-                this.Index = this.Collection.Count;
-                ((ModelItemCollectionImpl)this.Collection).AddCore(this.Item);
-            }
-
-            ModelChangeInfo changeInfo = ModelChangeInfoImpl.CreateCollectionItemAdded(this.Collection, this.Item);
-            this.ModelTreeManager.NotifyCollectionInsert(this.Item, changeInfo);
-        }
-
-        public override Change GetInverse()
-        {
-            OperationType reverseOperation = this.Operation == OperationType.Insert ? OperationType.Delete : OperationType.Insert;
-            return new CollectionChange()
-                {
-                    Collection = this.Collection,
-                    Operation = reverseOperation,
-                    Item = this.Item,
-                    ModelTreeManager = this.ModelTreeManager,
-                    Index = this.Index
-                };
-
-        }
-
-        public enum OperationType 
-        { 
-            Insert, Delete
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/DictionaryChange.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/DictionaryChange.cs
deleted file mode 100644 (file)
index 97a84ca..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System;
-    using System.Activities.Presentation.Services;
-    using System.Collections.Generic;
-    using System.Runtime;
-    using System.Text;
-
-    class DictionaryChange : ModelChange
-    {
-        public ModelItemDictionary Dictionary { get; set; }
-
-        public OperationType Operation { get; set; }
-
-        public ModelItem Key { get; set; }
-
-        public ModelItem Value { get; set; }
-
-        public ModelTreeManager ModelTreeManager { get; set; }
-
-        public override string Description
-        {
-            get
-            {
-                return this.Operation == OperationType.Insert ? SR.DictionaryAddEditingScopeDescription : SR.DictionaryRemoveEditingScopeDescription;
-            }
-        }
-
-        public override bool Apply()
-        {
-            switch (this.Operation)
-            {
-                case OperationType.Insert:
-                    ApplyInsert();
-                    break;
-                case OperationType.Delete:
-                    ApplyDelete();
-                    break;
-                default:
-                    Fx.Assert("Operation should be Insert or Delete");
-                    break;
-            }
-            return true;
-        }
-
-        private void ApplyDelete()
-        {
-            ((ModelItemDictionaryImpl)this.Dictionary).RemoveCore(this.Key);
-
-            ModelChangeInfo changeInfo = ModelChangeInfoImpl.CreateDictionaryKeyValueRemoved(this.Dictionary, this.Key, this.Value);
-
-            if (this.Key != null)
-            {
-                this.ModelTreeManager.modelService.OnModelItemRemoved(this.Key, changeInfo);
-                changeInfo = null;
-            }
-
-            if (this.Value != null)
-            {
-                this.ModelTreeManager.modelService.OnModelItemRemoved(this.Value, changeInfo);
-                changeInfo = null;
-            }
-
-            if (changeInfo != null)
-            {
-                this.ModelTreeManager.modelService.EmitModelChangeInfo(changeInfo);
-            }
-        }
-
-        private void ApplyInsert()
-        {
-            ((ModelItemDictionaryImpl)this.Dictionary).AddCore(this.Key, this.Value);
-
-            ModelChangeInfo changeInfo = ModelChangeInfoImpl.CreateDictionaryKeyValueAdded(this.Dictionary, this.Key, this.Value);
-
-            if (this.Key != null)
-            {
-                this.ModelTreeManager.modelService.OnModelItemAdded(this.Key, changeInfo);
-                changeInfo = null;
-            }
-
-            if (this.Value != null)
-            {
-                this.ModelTreeManager.modelService.OnModelItemAdded(this.Value, changeInfo);
-                changeInfo = null;
-            }
-
-            if (changeInfo != null)
-            {
-                this.ModelTreeManager.modelService.EmitModelChangeInfo(changeInfo);
-            }
-        }
-
-        public override Change GetInverse()
-        {
-            OperationType reverseOperation = this.Operation == OperationType.Insert ? OperationType.Delete : OperationType.Insert;
-            return new DictionaryChange()
-                {
-                    Dictionary = this.Dictionary,
-                    Operation = reverseOperation,
-                    Key = this.Key,
-                    Value = this.Value,
-                    ModelTreeManager = this.ModelTreeManager,
-                };
-        }
-
-        public enum OperationType 
-        { 
-            Insert, Delete 
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/DictionaryEditChange.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/DictionaryEditChange.cs
deleted file mode 100644 (file)
index 19d0432..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-    using System.Activities.Presentation.Services;
-
-    class DictionaryEditChange : ModelChange
-    {
-        public ModelItemDictionary Dictionary { get; set; }
-
-        public ModelItem Key { get; set; }
-
-        public ModelItem OldValue { get; set; }
-
-        public ModelItem NewValue { get; set; }
-
-        public ModelTreeManager ModelTreeManager { get; set; }
-
-
-        public override string Description
-        {
-            get 
-            {
-                return SR.DictionaryEditEditingScopeDescription;
-            }
-        }
-
-        public override bool Apply()
-        {
-            ModelItem oldValue = this.Dictionary[this.Key];
-            if ((oldValue == null && this.NewValue == null) ||
-               (oldValue != null && this.NewValue != null && oldValue.GetCurrentValue().Equals(this.NewValue.GetCurrentValue())))
-            {
-                return false;
-            }
-
-            ((ModelItemDictionaryImpl)this.Dictionary).EditCore(this.Key, this.NewValue);
-
-            ModelChangeInfo changeInfo = ModelChangeInfoImpl.CreateDictionaryValueChanged(this.Dictionary, this.Key, this.OldValue, this.NewValue);
-
-            if (this.OldValue != null)
-            {
-                this.ModelTreeManager.modelService.OnModelItemRemoved(this.OldValue, changeInfo);
-                changeInfo = null;
-            }
-            if (this.NewValue != null)
-            {
-                this.ModelTreeManager.modelService.OnModelItemAdded(this.NewValue, changeInfo);
-            }
-            return true;
-        }
-
-
-
-        public override Change GetInverse()
-        {
-            return new DictionaryEditChange()
-                {
-                    Dictionary = this.Dictionary,
-                    Key = this.Key,
-                    OldValue = this.NewValue,
-                    NewValue = this.OldValue,
-                    ModelTreeManager = this.ModelTreeManager,
-                };
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/Edge.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/Edge.cs
deleted file mode 100644 (file)
index 59477d2..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    internal class Edge : LinkBase
-    {
-        public Edge(ModelItem sourceVertex, ModelItem destinationVertex)
-            : base(sourceVertex, destinationVertex)
-        {
-        }
-
-        public Edge(string propertyName, ModelItem sourceVertex, ModelItem destinationVertex)
-            : base(propertyName, sourceVertex, destinationVertex)
-        {
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/EditingScope.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/EditingScope.cs
deleted file mode 100644 (file)
index fbf082e..0000000
+++ /dev/null
@@ -1,287 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System;
-    using System.Activities.Presentation.Validation;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Linq;
-    using System.Runtime;
-    using System.Text;
-
-    [Fx.Tag.XamlVisible(false)]
-    public class EditingScope : ModelEditingScope
-    {
-        ModelTreeManager modelTreeManager;
-        EditingScope outerScope;
-        List<Change> changes;
-        List<Change> appliedChanges;
-        bool suppressUndo;
-        private HashSet<ModelItem> itemsAdded;
-        private HashSet<ModelItem> itemsRemoved;
-
-        // this is intended for ImmediateEditingScope only
-        private bool? hasEffectiveChanges;
-
-        internal EditingScope(ModelTreeManager modelTreeManager, EditingScope outerScope)
-        {
-            this.modelTreeManager = modelTreeManager;
-            this.changes = new List<Change>();
-            this.outerScope = outerScope;
-            this.HasModelChanges = false;
-            this.itemsAdded = new HashSet<ModelItem>();
-            this.itemsRemoved = new HashSet<ModelItem>();
-        }
-
-        private EditingScope()
-        {
-        }
-
-        public bool HasEffectiveChanges
-        {
-            get
-            {
-                if (this.hasEffectiveChanges.HasValue)
-                {
-                    Fx.Assert(this.GetType() == typeof(ImmediateEditingScope), "we should only set this property on an ImmediateEditingScope");
-
-                    return this.hasEffectiveChanges.Value;
-                }
-
-                return this.appliedChanges != null && this.appliedChanges.Count > 0;
-            }
-
-            internal set
-            {
-                Fx.Assert(this.GetType() == typeof(ImmediateEditingScope), "we should only set this property on an ImmediateEditingScope");
-
-                this.hasEffectiveChanges = value;
-            }
-        }
-
-        internal bool HasModelChanges
-        {
-            get;
-
-            // setter is only expected to be called by EditingScope and ImmediateEditingScope
-            set;
-        }
-
-        internal bool SuppressUndo
-        {
-            get
-            {
-                return this.suppressUndo;
-            }
-            set
-            {
-                Fx.Assert(!value || this.outerScope == null, "If we are suppressing undo, then we are not nested within another editingScope, otherwise suppress undo won't work.");
-                this.suppressUndo = value;
-            }
-        }
-
-        internal ReadOnlyCollection<ModelItem> ItemsAdded
-        {
-            get
-            {
-                return new ReadOnlyCollection<ModelItem>(this.itemsAdded.ToList());
-            }
-        }
-
-        internal ReadOnlyCollection<ModelItem> ItemsRemoved
-        {
-            get
-            {
-                return new ReadOnlyCollection<ModelItem>(this.itemsRemoved.ToList());
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets whether validation should be suppressed when this EditingScope completes.
-        /// </summary>
-        internal bool SuppressValidationOnComplete
-        {
-            get;
-            set;
-        }
-
-        public List<Change> Changes
-        {
-            get
-            {
-                return changes;
-            }
-        }
-
-        internal void EditingScope_ModelItemsAdded(object sender, ModelItemsAddedEventArgs e)
-        {
-            this.HandleModelItemsAdded(e.ModelItemsAdded);
-        }
-
-        internal void EditingScope_ModelItemsRemoved(object sender, ModelItemsRemovedEventArgs e)
-        {
-            this.HandleModelItemsRemoved(e.ModelItemsRemoved);
-        }
-
-        internal void HandleModelItemsAdded(IEnumerable<ModelItem> modelItems)
-        {
-            foreach (ModelItem addedItem in modelItems)
-            {
-                if (this.itemsRemoved.Contains(addedItem))
-                {
-                    this.itemsRemoved.Remove(addedItem);
-                }
-                else
-                {
-                    Fx.Assert(!this.itemsAdded.Contains(addedItem), "One ModelItem should not be added more than once.");
-                    this.itemsAdded.Add(addedItem);
-                }
-            }
-        }
-
-        internal void HandleModelItemsRemoved(IEnumerable<ModelItem> modelItems)
-        {
-            foreach (ModelItem removedItem in modelItems)
-            {
-                if (this.itemsAdded.Contains(removedItem))
-                {
-                    this.itemsAdded.Remove(removedItem);
-                }
-                else
-                {
-                    Fx.Assert(!itemsRemoved.Contains(removedItem), "One ModelItem should not be removed more than once.");
-                    this.itemsRemoved.Add(removedItem);
-                }
-            }
-        }
-
-        protected override void OnComplete()
-        {
-            Fx.Assert(this.itemsAdded.Count == 0 && this.itemsRemoved.Count == 0, "There should not be items changed before completed.");
-            this.modelTreeManager.RegisterModelTreeChangeEvents(this);
-
-            bool modelChangeBegin = false;
-            try
-            {
-                if (this.outerScope == null)
-                {
-                    appliedChanges = new List<Change>();
-                    int startIndex = 0;
-                    // pump all changes, applying changes can add more changes to the end of the change list.
-                    while (startIndex < this.Changes.Count)
-                    {
-                        // pickup the new changes
-                        List<Change> changesToApply = this.Changes.GetRange(startIndex, this.Changes.Count - startIndex);
-                        startIndex = this.Changes.Count;
-
-                        foreach (Change change in changesToApply)
-                        {
-                            if (change != null)
-                            {
-                                if (change is ModelChange && !modelChangeBegin)
-                                {
-                                    this.BeginModelChange();
-                                    modelChangeBegin = true;
-                                }
-
-                                if (change.Apply())
-                                {
-                                    appliedChanges.Add(change);
-                                }
-                            }
-
-                            if (change is ModelChange)
-                            {
-                                this.HasModelChanges = true;
-                            }
-                        }
-                    }
-                }
-                else
-                {
-                    outerScope.Changes.AddRange(this.Changes);
-                }
-            }
-            finally
-            {
-                if (modelChangeBegin)
-                {
-                    this.EndModelChange();
-                }
-
-                this.modelTreeManager.UnregisterModelTreeChangeEvents(this);
-            }
-
-            this.modelTreeManager.OnEditingScopeCompleted(this);
-        }
-
-        private void BeginModelChange()
-        {
-            ValidationService validationService = this.modelTreeManager.Context.Services.GetService<ValidationService>();
-            if (validationService != null)
-            {
-                validationService.DeactivateValidation();
-            }
-        }
-
-        private void EndModelChange()
-        {
-            ValidationService validationService = this.modelTreeManager.Context.Services.GetService<ValidationService>();
-            if (validationService != null)
-            {
-                validationService.ActivateValidation();
-            }
-        }
-
-        protected override bool CanComplete()
-        {
-            return this.modelTreeManager.CanEditingScopeComplete(this);
-        }
-
-        protected override void OnRevert(bool finalizing)
-        {
-            bool modelChangeBegin = false;
-            try
-            {
-                if (this.appliedChanges != null)
-                {
-                    List<Change> revertChanges = new List<Change>();
-                    foreach (Change change in this.appliedChanges)
-                    {
-                        revertChanges.Add(change.GetInverse());
-                    }
-                    revertChanges.Reverse();
-                    foreach (Change change in revertChanges)
-                    {
-                        if (change is ModelChange && !modelChangeBegin)
-                        {
-                            this.BeginModelChange();
-                            modelChangeBegin = true;
-                        }
-
-                        change.Apply();
-                        this.appliedChanges.RemoveAt(this.appliedChanges.Count - 1);
-                    }
-                }
-            }
-            finally
-            {
-                if (modelChangeBegin)
-                {
-                    this.EndModelChange();
-                }
-            }
-
-            this.modelTreeManager.UnregisterModelTreeChangeEvents(this);
-            this.modelTreeManager.OnEditingScopeReverted(this);
-        }
-
-        protected override bool OnException(Exception e)
-        {
-            return false;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/EditingScopeEventArgs.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/EditingScopeEventArgs.cs
deleted file mode 100644 (file)
index b62fd3c..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-    using System.Runtime;
-
-    [Fx.Tag.XamlVisible(false)]
-    public class EditingScopeEventArgs : EventArgs
-    {
-        public EditingScope EditingScope { get; set; }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/FakeModelItemImpl.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/FakeModelItemImpl.cs
deleted file mode 100644 (file)
index 57cd1bb..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-
-    /// <summary>
-    /// FakeModelItemImpl - purpose of this class is to allow full model editing expirience, without need to participate within model tree operations
-    /// If you use this class, even though it contains reference to ModelTreeManager, you are not affecting actual model tree. Any changes made to the 
-    /// model, do not result in any undo/redo operations
-    /// see aslo DesignObjectWrapper class for more usage details
-    /// </summary>
-    sealed class FakeModelItemImpl : ModelItemImpl
-    {
-        public FakeModelItemImpl(ModelTreeManager modelTreeManager, Type itemType, object instance, FakeModelItemImpl parent) 
-            : base(modelTreeManager, itemType, instance, parent)
-        {
-        }
-
-        public override ModelItem Root
-        {
-            get 
-            {
-                if (this.Parent == null)
-                {
-                    return this;
-                }
-                else
-                {
-                    return this.Parent.Root;
-                }
-            }
-        }
-
-        protected override void OnPropertyChanged(string propertyName)
-        {
-            IModelTreeItem modelTreeItem = (IModelTreeItem)this;
-            ModelItem currentValue;
-            //if property value has changed - remove existing value, so the ModelPropertyImplementation will 
-            //force reading the value from the underlying object
-            if (modelTreeItem.ModelPropertyStore.TryGetValue(propertyName, out currentValue))
-            {
-                IModelTreeItem valueAsTreeItem = (IModelTreeItem)currentValue;
-                //cleanup references
-                valueAsTreeItem.RemoveParent(this);
-                valueAsTreeItem.RemoveSource(this.Properties[propertyName]);
-                //remove from store
-                modelTreeItem.ModelPropertyStore.Remove(propertyName);
-            }
-            base.OnPropertyChanged(propertyName);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/FakeModelPropertyImpl.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/FakeModelPropertyImpl.cs
deleted file mode 100644 (file)
index c0efc58..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Globalization;
-
-    /// <summary>
-    /// FakeModelPropertyImpl. This class is used with FakeModelItemImpl. it is used to allow full model editing expirience
-    /// without actually modyfing actual model tree. Even though reference to ModelTreeManager is availabe, changes made to object
-    /// using this class are not reflected in actual model. Especially, any changes made here do not affect undo/redo stack.
-    /// see aslo DesignObjectWrapper class for more usage details
-    /// </summary>
-    sealed class FakeModelPropertyImpl : ModelPropertyImpl
-    {
-        IModelTreeItem parentModelTreeItem;
-        FakeModelItemImpl temporaryValue;
-        bool isSettingValue = false;
-
-        public FakeModelPropertyImpl(FakeModelItemImpl parent, PropertyDescriptor propertyDescriptor)
-            : base(parent, propertyDescriptor, false)
-        {
-            this.parentModelTreeItem = (IModelTreeItem)parent;
-        }
-
-        //no collection support
-        public override ModelItemCollection Collection
-        {
-            get { return null; }
-        }
-
-        public override bool IsCollection
-        {
-            get { return false; }
-        }
-
-        //no dictionary support
-        public override ModelItemDictionary Dictionary
-        {
-            get { return null; }
-        }
-
-        public override bool IsDictionary
-        {
-            get { return false; }
-        }
-
-        public override ModelItem Value
-        {
-            get
-            {
-                ModelItem result = null;
-                object parentObject = this.parentModelTreeItem.ModelItem.GetCurrentValue();
-                result = this.StoreValue(this.PropertyDescriptor.GetValue(parentObject));
-                return result;
-            }
-        }
-
-        public override void ClearValue()
-        {
-            //try setting default value
-            this.SetValue(this.DefaultValue);
-        }
-
-        public override ModelItem SetValue(object value)
-        {
-            //are we already setting value? 
-            if (!isSettingValue)
-            {
-                try
-                {
-                    this.isSettingValue = true;
-                    //create new value
-                    this.temporaryValue = this.WrapValue(value);
-                    //is there a value stored already?
-                    if (this.parentModelTreeItem.ModelPropertyStore.ContainsKey(this.Name))
-                    {
-                        //yes - cleanup references
-                        IModelTreeItem item = (IModelTreeItem)this.parentModelTreeItem.ModelPropertyStore[this.Name];
-                        item.RemoveSource(this);
-                        item.RemoveParent(this.parentModelTreeItem.ModelItem);
-                        //and remove it
-                        this.parentModelTreeItem.ModelPropertyStore.Remove(this.Name);
-                    }
-                    //set it onto underlying object
-                    this.PropertyDescriptor.SetValue(this.Parent.GetCurrentValue(), (null != this.temporaryValue ? this.temporaryValue.GetCurrentValue() : null));
-                    //store it in parent's store
-                    this.temporaryValue = this.StoreValue(this.temporaryValue);
-
-                    //notify listeners - notification must be postponed until actual underlying object value is updated, otherwise, listeners might get old value
-                    this.parentModelTreeItem.ModelTreeManager.AddToCurrentEditingScope(new FakeModelNotifyPropertyChange(this.parentModelTreeItem, this.Name));
-                }
-                catch (ValidationException e)
-                {
-                    Trace.WriteLine(e.ToString());
-                    //it is important to rethrow exception here - otherwise, DataGrid will assume operation completed successfully
-                    throw;
-                }
-                finally
-                {
-                    this.isSettingValue = false;
-                }
-            }
-
-            return this.temporaryValue;
-        }
-
-        FakeModelItemImpl WrapValue(object value)
-        {
-            FakeModelItemImpl wrappedValue = value as FakeModelItemImpl;
-            if (null == wrappedValue && null != value)
-            {
-                wrappedValue = new FakeModelItemImpl(this.parentModelTreeItem.ModelTreeManager, this.PropertyType, value, (FakeModelItemImpl)this.Parent);
-            }
-            return wrappedValue;
-        }
-
-        FakeModelItemImpl StoreValue(object value)
-        {
-            FakeModelItemImpl wrappedValue = WrapValue(value);
-            if (null != wrappedValue)
-            {
-                this.parentModelTreeItem.ModelPropertyStore[this.Name] = wrappedValue;
-                IModelTreeItem modelTreeItem = (IModelTreeItem)wrappedValue;
-                modelTreeItem.SetSource(this);
-            }
-            else
-            {
-                ModelItem existing = null;
-                if (this.parentModelTreeItem.ModelPropertyStore.TryGetValue(this.Name, out existing))
-                {
-                    IModelTreeItem modelTreeItem = (IModelTreeItem)existing;
-                    modelTreeItem.RemoveSource(this);
-                    modelTreeItem.RemoveParent(this.Parent);
-                }
-                this.parentModelTreeItem.ModelPropertyStore.Remove(this.Name);
-            }
-            return wrappedValue;
-        }
-    }
-
-    //helper class - implements change
-    //FakeModelPropery uses instance of this class to notify all listeners that property value has changed. the notification is deffered untill all editing operations
-    //have completed, so the listener will get notified after edit is completed
-    sealed class FakeModelNotifyPropertyChange : ModelChange
-    {
-        IModelTreeItem modelTreeItem;
-        string propertyName;
-
-        public FakeModelNotifyPropertyChange(IModelTreeItem modelTreeItem, string propertyName)
-        {
-            this.modelTreeItem = modelTreeItem;
-            this.propertyName = propertyName;
-        }
-
-        public override string Description
-        {
-            get { return this.GetType().Name; }
-        }
-
-        public override bool Apply()
-        {
-            if (this.modelTreeItem != null)
-            {
-                EditingContext context = this.modelTreeItem.ModelTreeManager.Context;
-                //this change shouldn't participate in Undo/Redo
-                if (null != context && !context.Services.GetService<UndoEngine>().IsUndoRedoInProgress)
-                {
-                    this.modelTreeItem.OnPropertyChanged(this.propertyName);
-                }
-            }
-            //return false here - i don't need that change in the change list
-            return false;
-        }
-
-        public override Change GetInverse()
-        {
-            //this change shouldn't participate in Undo/Redo
-            return null;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/GenericArgumentsUpdater.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/GenericArgumentsUpdater.cs
deleted file mode 100644 (file)
index affa0ab..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-
-    using System;
-    using System.Activities;
-    using System.Diagnostics;
-    using System.Linq;
-    using System.Runtime;
-    using System.Activities.Presentation.View;
-    using System.Windows.Threading;
-
-    class GenericArgumentUpdater
-    {
-        EditingContext context;
-        const string TypeArgumentPropertyName = "TypeArgument";
-
-        public GenericArgumentUpdater(EditingContext context)
-        {
-            this.context = context;
-        }
-
-        public void AddSupportForUpdatingTypeArgument(Type modelItemType)
-        {
-            AttachedProperty<Type> typeArgumentProperty = new AttachedProperty<Type>
-            {
-                Name = TypeArgumentPropertyName,
-                OwnerType = modelItemType,
-                Getter = (modelItem) => modelItem.Parent == null ? null : GetTypeArgument(modelItem),
-                Setter = (modelItem, value) => UpdateTypeArgument(modelItem, value),
-                IsBrowsable = true
-            };
-            this.context.Services.GetService<AttachedPropertiesService>().AddProperty(typeArgumentProperty);
-        }
-
-        private static void UpdateTypeArgument(ModelItem modelItem, Type value)
-        {
-            if (value != null)
-            {
-                Type oldModelItemType = modelItem.ItemType;
-                Fx.Assert(oldModelItemType.GetGenericArguments().Count() == 1, "we only support changing a single type parameter ?");
-                Type newModelItemType = oldModelItemType.GetGenericTypeDefinition().MakeGenericType(value);
-                Fx.Assert(newModelItemType != null, "New model item type needs to be non null or we cannot proceed further");
-                ModelItem newModelItem = ModelFactory.CreateItem(modelItem.GetEditingContext(), Activator.CreateInstance(newModelItemType));
-                MorphHelper.MorphObject(modelItem, newModelItem);
-                MorphHelper.MorphProperties(modelItem, newModelItem);
-
-                if (oldModelItemType.IsSubclassOf(typeof(Activity)) && newModelItemType.IsSubclassOf(typeof(Activity)))
-                {
-                    if (string.Equals((string)modelItem.Properties["DisplayName"].ComputedValue, GetActivityDefaultName(oldModelItemType), StringComparison.Ordinal))
-                    {
-                        newModelItem.Properties["DisplayName"].SetValue(GetActivityDefaultName(newModelItemType));
-                    }
-                }
-
-                DesignerView designerView = modelItem.GetEditingContext().Services.GetService<DesignerView>();
-                if (designerView != null)
-                {
-                    Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Render, (Action)(() =>
-                    {
-                        if (designerView.RootDesigner != null && ((WorkflowViewElement)designerView.RootDesigner).ModelItem == modelItem)
-                        {
-                            designerView.MakeRootDesigner(newModelItem, true);
-                        }
-                        Selection.SelectOnly(modelItem.GetEditingContext(), newModelItem);
-                    }));
-                }
-            }
-        }
-
-        private static Type GetTypeArgument(ModelItem modelItem)
-        {
-            Fx.Assert(modelItem.ItemType.GetGenericArguments().Count() == 1, "we only support changing a single type parameter ?");
-            return modelItem.ItemType.GetGenericArguments()[0];
-        }
-
-        private static string GetActivityDefaultName(Type activityType)
-        {
-            Fx.Assert(activityType.IsSubclassOf(typeof(Activity)), "activityType is not a subclass of System.Activities.Activity");
-            Activity activity = (Activity)Activator.CreateInstance(activityType);
-            return activity.DisplayName;
-        }
-    }
-
-
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/GraphManager.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/GraphManager.cs
deleted file mode 100644 (file)
index 4d4c2de..0000000
+++ /dev/null
@@ -1,279 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System;
-    using System.Activities.Presentation;
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Linq;
-    using System.Runtime;
-    using System.Text;
-    using Microsoft.Activities.Presentation.Xaml;
-
-    // The graph is completely defined by a collection of vertices and a collection of edges. The back pointers are not part of the graph
-    // definition, but as an auxiliary to quickly trace back to the root vertex if it is reachable from the root. A vertex should have
-    // no back pointers if it's not reachable from the root.
-    // This abstract base class is responsible for managing back pointers while the dervied class is responsible for managing vertices and edges.
-    internal abstract class GraphManager<TVertex, TEdge, TBackPointer> where TVertex : class
-    {
-        protected abstract TVertex Root { get; }
-
-        internal void VerifyBackPointers()
-        {
-            ICollection<TVertex> reachableVertices = this.CalculateReachableVertices(true);
-
-            foreach (TVertex vertex in this.GetVertices())
-            {
-                if (reachableVertices.Contains(vertex))
-                {
-                    foreach (TBackPointer backPointer in this.GetBackPointers(vertex))
-                    {
-                        if (!reachableVertices.Contains(this.GetDestinationVertexFromBackPointer(backPointer)))
-                        {
-                            Fx.Assert(false, "a reachable vertex's back pointer should not point to a vertex that is not reachable");
-                        }
-
-                        if (!this.HasAssociatedEdge(backPointer))
-                        {
-                            Fx.Assert(false, "a reachable vertex doesn't have an outgoing edge to one of the vertex that have a back pointer to it");
-                        }
-                    }
-                }
-                else
-                {
-                    if (this.GetBackPointers(vertex).Count() != 0)
-                    {
-                        Fx.Assert(false, "an unreachable vertex should not have any back pointer");
-                    }
-                }
-            }
-        }
-
-        protected ICollection<TVertex> CalculateReachableVertices(bool verifyBackPointers = false)
-        {
-            HashSet<TVertex> reachableVertices = new HashSet<TVertex>(ObjectReferenceEqualityComparer<TVertex>.Default);
-
-            if (this.Root == null)
-            {
-                return reachableVertices;
-            }
-
-            Queue<TVertex> queue = new Queue<TVertex>();
-            queue.Enqueue(this.Root);
-            reachableVertices.Add(this.Root);
-
-            while (queue.Count > 0)
-            {
-                TVertex vertex = queue.Dequeue();
-
-                foreach (TEdge edge in this.GetOutEdges(vertex))
-                {
-                    if (verifyBackPointers && !this.HasBackPointer(edge))
-                    {
-                        Fx.Assert(false, "a reachable vertex doesn't have a back pointer to one of its incoming edges");
-                    }
-
-                    TVertex to = this.GetDestinationVertexFromEdge(edge);
-                    if (!reachableVertices.Contains(to))
-                    {
-                        reachableVertices.Add(to);
-                        queue.Enqueue(to);
-                    }
-                }
-            }
-
-            return reachableVertices;
-        }
-
-        protected void OnRootChanged(TVertex oldRoot, TVertex newRoot)
-        {
-            if (oldRoot != null)
-            {
-                this.RemoveBackPointers(oldRoot, true);
-            }
-
-            if (newRoot != null)
-            {
-                this.AddBackPointers(newRoot);
-            }
-        }
-
-        protected abstract IEnumerable<TVertex> GetVertices();
-
-        protected abstract IEnumerable<TEdge> GetOutEdges(TVertex vertex);
-
-        protected abstract IEnumerable<TBackPointer> GetBackPointers(TVertex vertex);
-
-        protected abstract TVertex GetDestinationVertexFromEdge(TEdge edge);
-
-        protected abstract TVertex GetSourceVertexFromEdge(TEdge edge);
-
-        protected abstract TVertex GetDestinationVertexFromBackPointer(TBackPointer backPointer);
-
-        // call this method when an edge is removed
-        protected void OnEdgeRemoved(TEdge edgeRemoved)
-        {
-            Fx.Assert(edgeRemoved != null, "edgeRemoved should not be null");
-
-            TVertex sourceVertex = this.GetSourceVertexFromEdge(edgeRemoved);
-            if (!this.CanReachRootViaBackPointer(sourceVertex))
-            {
-                return;
-            }
-
-            this.RemoveAssociatedBackPointer(edgeRemoved);
-            TVertex destinationVertex = this.GetDestinationVertexFromEdge(edgeRemoved);
-
-            this.RemoveBackPointers(destinationVertex);
-        }
-
-        // call this method when an edge is added
-        protected void OnEdgeAdded(TEdge edgeAdded)
-        {
-            Fx.Assert(edgeAdded != null, "edgeAdded should not be null");
-
-            TVertex sourceVertex = this.GetSourceVertexFromEdge(edgeAdded);
-            if (!this.CanReachRootViaBackPointer(sourceVertex))
-            {
-                return;
-            }
-
-            TVertex destinationVertex = this.GetDestinationVertexFromEdge(edgeAdded);
-            bool wasReachable = this.CanReachRootViaBackPointer(destinationVertex);
-            this.AddAssociatedBackPointer(edgeAdded);
-
-            if (wasReachable)
-            {
-                return;
-            }
-
-            this.AddBackPointers(destinationVertex);
-        }
-
-        protected abstract void RemoveAssociatedBackPointer(TEdge edge);
-
-        protected abstract void AddAssociatedBackPointer(TEdge edge);
-
-        protected abstract bool HasBackPointer(TEdge edge);
-
-        protected abstract bool HasAssociatedEdge(TBackPointer backPointer);
-
-        protected abstract void OnVerticesBecameReachable(IEnumerable<TVertex> reachableVertices);
-
-        protected abstract void OnVerticesBecameUnreachable(IEnumerable<TVertex> unreachableVertices);
-
-        private bool CanReachRootViaBackPointer(TVertex vertex)
-        {
-            Fx.Assert(vertex != null, "vertex should not be null");
-
-            if (vertex == this.Root)
-            {
-                return true;
-            }
-
-            HashSet<TVertex> visited = new HashSet<TVertex>(ObjectReferenceEqualityComparer<TVertex>.Default);
-            Queue<TVertex> queue = new Queue<TVertex>();
-
-            visited.Add(vertex);
-            queue.Enqueue(vertex);
-
-            while (queue.Count > 0)
-            {
-                TVertex current = queue.Dequeue();
-                foreach (TBackPointer backPointer in this.GetBackPointers(current))
-                {
-                    TVertex destinationVertex = this.GetDestinationVertexFromBackPointer(backPointer);
-                    if (object.ReferenceEquals(destinationVertex, this.Root))
-                    {
-                        return true;
-                    }
-
-                    if (!visited.Contains(destinationVertex))
-                    {
-                        visited.Add(destinationVertex);
-                        queue.Enqueue(destinationVertex);
-                    }
-                }
-            }
-
-            return false;
-        }
-
-        // traverse the sub-graph starting from vertex and add back pointers
-        private void AddBackPointers(TVertex vertex)
-        {
-            HashSet<TVertex> verticesBecameReachable = new HashSet<TVertex>(ObjectReferenceEqualityComparer<TVertex>.Default);
-            Queue<TVertex> queue = new Queue<TVertex>();
-
-            verticesBecameReachable.Add(vertex);
-            queue.Enqueue(vertex);
-
-            while (queue.Count > 0)
-            {
-                TVertex currentVertex = queue.Dequeue();
-
-                foreach (TEdge edge in this.GetOutEdges(currentVertex))
-                {
-                    TVertex destinationVertex = this.GetDestinationVertexFromEdge(edge);
-                    bool wasReachable = this.GetBackPointers(destinationVertex).Count() > 0;
-                    this.AddAssociatedBackPointer(edge);
-                    if (!wasReachable && !verticesBecameReachable.Contains(destinationVertex))
-                    {
-                        verticesBecameReachable.Add(destinationVertex);
-                        queue.Enqueue(destinationVertex);
-                    }
-                }
-            }
-
-            this.OnVerticesBecameReachable(verticesBecameReachable);
-        }
-
-        // traverse the sub-graph starting from vertex, if a vertex is reachable then stop traversing its descendents,
-        // otherwise remove back pointers that pointer to it and continue traversing its descendents
-        private void RemoveBackPointers(TVertex vertex, bool isAllVerticesUnreachable = false)
-        {
-            ICollection<TVertex> reachableVertices = new HashSet<TVertex>(ObjectReferenceEqualityComparer<TVertex>.Default);
-
-            if (!isAllVerticesUnreachable)
-            {
-                reachableVertices = this.CalculateReachableVertices();
-            }
-
-            if (reachableVertices.Contains(vertex))
-            {
-                return;
-            }
-
-            Queue<TVertex> queue = new Queue<TVertex>();
-            HashSet<TVertex> unreachableVertices = new HashSet<TVertex>(ObjectReferenceEqualityComparer<TVertex>.Default);
-
-            unreachableVertices.Add(vertex);
-            queue.Enqueue(vertex);
-
-            while (queue.Count > 0)
-            {
-                TVertex unreachableVertex = queue.Dequeue();
-                foreach (TEdge edge in this.GetOutEdges(unreachableVertex))
-                {
-                    this.RemoveAssociatedBackPointer(edge);
-                    TVertex to = this.GetDestinationVertexFromEdge(edge);
-                    if (isAllVerticesUnreachable || !reachableVertices.Contains(to))
-                    {
-                        if (!unreachableVertices.Contains(to))
-                        {
-                            unreachableVertices.Add(to);
-                            queue.Enqueue(to);
-                        }
-                    }
-                }
-            }
-
-            this.OnVerticesBecameUnreachable(unreachableVertices);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/IItemsCollection.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/IItemsCollection.cs
deleted file mode 100644 (file)
index b3e4980..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// <copyright>
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation.Model
-{
-    using System.Activities.Presentation.Model;
-
-    /// <summary>
-    /// Interface for DictionaryItemsCollection
-    /// </summary>
-    internal interface IItemsCollection
-    {
-        bool ShouldUpdateDictionary { get; set; }
-
-        ModelItemDictionaryImpl ModelDictionary { get; set; }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/IModelTreeItem.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/IModelTreeItem.cs
deleted file mode 100644 (file)
index 39ecc59..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System.Windows;
-    using System.Collections.Generic;
-    using System.Activities.Presentation.Model;
-
-    // Interface for the things common among ModelItemImpl and ModelItemCollectionImpl and ModelItemDictionaryImpl.
-
-    interface IModelTreeItem
-    {
-        ModelItem ModelItem
-        { 
-            get; 
-        }
-
-        Dictionary<string, ModelItem> ModelPropertyStore
-        { 
-            get; 
-        }
-
-        ModelTreeManager ModelTreeManager
-        { 
-            get; 
-        }
-
-        IEnumerable<ModelItem> ItemBackPointers { get; }
-
-        // In case instance has implemented ICustomTypeDescriptor, IModelTreeItem.ModelPropertyStore may contain some property that ModelItem.Properties doesn't contain.
-        // The BackPointers to those properties will be added to this collection.
-        List<BackPointer> ExtraPropertyBackPointers { get; }
-
-        void OnPropertyChanged(string propertyName);
-
-        void SetParent(ModelItem dataModelItem);
-
-        // This is needed because the source property in the ModelItem Base class is get only
-        // and we want a common setter for ModelItemImpl and ModelItemCollectionImpl.
-        void SetSource(ModelProperty dataModelProperty);
-
-        void RemoveParent(ModelItem oldParent);
-
-        void RemoveSource(ModelProperty oldModelProperty);
-
-        void RemoveSource(ModelItem parent, string propertyName);
-
-        // Used to set the  the current view for this Model item.
-        void SetCurrentView(DependencyObject view);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ImmediateEditingScope.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ImmediateEditingScope.cs
deleted file mode 100644 (file)
index a867b1a..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System.Activities.Presentation.Hosting;
-    using System.Runtime;
-
-    internal class ImmediateEditingScope : EditingScope
-    {
-        private ModelTreeManager modelTreeManager;
-        private UndoEngine.Bookmark undoEngineBookmark;
-
-        public ImmediateEditingScope(ModelTreeManager modelTreeManager, UndoEngine.Bookmark undoEngineBookmark)
-            : base(modelTreeManager, null)
-        {
-            Fx.Assert(modelTreeManager != null, "modelTreeManager should never be null!");
-            Fx.Assert(undoEngineBookmark != null, "undoEngineBookmark should never be null!");
-            this.modelTreeManager = modelTreeManager;
-            this.undoEngineBookmark = undoEngineBookmark;
-        }
-
-        protected override void OnComplete()
-        {
-            this.undoEngineBookmark.CommitBookmark();
-            this.undoEngineBookmark = null;
-            this.modelTreeManager.OnEditingScopeCompleted(this);
-        }
-
-        protected override void OnRevert(bool finalizing)
-        {
-            this.undoEngineBookmark.RollbackBookmark();
-            this.undoEngineBookmark = null;
-            this.modelTreeManager.OnEditingScopeReverted(this);
-        }
-
-        protected override bool CanComplete()
-        {
-            ReadOnlyState readOnlyState = this.modelTreeManager.Context.Items.GetValue<ReadOnlyState>();
-            return readOnlyState == null || !readOnlyState.IsReadOnly;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/LinkBase.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/LinkBase.cs
deleted file mode 100644 (file)
index 53877b0..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System.Runtime;
-
-    internal class LinkBase
-    {
-        public LinkBase(ModelItem sourceVertex, ModelItem destinationVertex)
-            : this(LinkType.Item, null, sourceVertex, destinationVertex)
-        {
-        }
-
-        public LinkBase(string propertyName, ModelItem sourceVertex, ModelItem destinationVertex)
-            : this(LinkType.Property, propertyName, sourceVertex, destinationVertex)
-        {
-        }
-
-        private LinkBase(LinkType linkType, string propertyName, ModelItem sourceVertex, ModelItem destinationVertex)
-        {
-            Fx.Assert(linkType != LinkType.Item || propertyName == null, "propertyName should be null when linkType is LinkType.Item");
-            Fx.Assert(sourceVertex != null, "sourceVertex should not be null");
-            Fx.Assert(destinationVertex != null, "destinationVertex should not be null");
-
-            this.LinkType = linkType;
-            this.PropertyName = propertyName;
-            this.SourceVertex = sourceVertex;
-            this.DestinationVertex = destinationVertex;
-        }
-
-        public LinkType LinkType { get; private set; }
-
-        public string PropertyName { get; private set; }
-
-        public ModelItem DestinationVertex { get; private set; }
-
-        public ModelItem SourceVertex { get; private set; }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/LinkType.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/LinkType.cs
deleted file mode 100644 (file)
index 8386e7a..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    internal enum LinkType
-    {
-        Property = 0,
-        Item,
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelChange.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelChange.cs
deleted file mode 100644 (file)
index 9e8a6c1..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-
-    abstract class ModelChange : Change
-    {
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelChangedEventArgsImpl.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelChangedEventArgsImpl.cs
deleted file mode 100644 (file)
index ecb09c0..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System.Collections.Generic;
-    using System.Activities.Presentation.Services;
-
-    // Implementation of ModelChangedEventArgs used by the ModelServiceImpl
-
-    class ModelChangedEventArgsImpl : ModelChangedEventArgs
-    {
-        List<ModelItem> itemsAdded;
-        List<ModelItem> itemsRemoved;
-        List<ModelProperty> propertiesChanged;
-        ModelChangeInfo modelChangeInfo;
-
-        public ModelChangedEventArgsImpl(List<ModelItem> itemsAdded, List<ModelItem> itemsRemoved, List<ModelProperty> propertiesChanged)
-            : this(itemsAdded, itemsRemoved, propertiesChanged, null)
-        {
-        }
-
-        public ModelChangedEventArgsImpl(List<ModelItem> itemsAdded, List<ModelItem> itemsRemoved, List<ModelProperty> propertiesChanged, ModelChangeInfo modelChangeInfo)
-        {
-            this.itemsAdded = itemsAdded;
-            this.itemsRemoved = itemsRemoved;
-            this.propertiesChanged = propertiesChanged;
-            this.modelChangeInfo = modelChangeInfo;
-        }
-
-        [Obsolete("Don't use this property. Use \"ModelChangeInfo\" instead.")]
-        public override IEnumerable<ModelItem> ItemsAdded
-        {
-            get
-            {
-                return itemsAdded;
-            }
-        }
-
-        [Obsolete("Don't use this property. Use \"ModelChangeInfo\" instead.")]
-        public override IEnumerable<ModelItem> ItemsRemoved
-        {
-            get
-            {
-                return itemsRemoved;
-            }
-        }
-
-        [Obsolete("Don't use this property. Use \"ModelChangeInfo\" instead.")]
-        public override IEnumerable<ModelProperty> PropertiesChanged
-        {
-            get
-            {
-                return propertiesChanged;
-            }
-        }
-
-        public override ModelChangeInfo ModelChangeInfo
-        {
-            get
-            {
-                return this.modelChangeInfo;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemCollectionImpl.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemCollectionImpl.cs
deleted file mode 100644 (file)
index 4c1578a..0000000
+++ /dev/null
@@ -1,696 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Collections.Specialized;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Windows;
-    using System.Windows.Markup;
-    using System.Activities.Presentation.Services;
-    using System.Linq;
-    using System.Runtime;
-
-    // This class provides the implementation for the ModelItemCollection. This provides
-    // a container for the child modelItems for the entries in a collection.
-
-    class ModelItemCollectionImpl : ModelItemCollection, IModelTreeItem
-    {
-        ModelProperty contentProperty;
-        object instance;
-        Type itemType;
-        List<ModelItem> modelItems;
-        Dictionary<string, ModelItem> modelPropertyStore;
-        ModelTreeManager modelTreeManager;
-        ModelProperty nameProperty;
-        List<ModelItem> parents;
-        ModelPropertyCollectionImpl properties;
-        List<ModelProperty> sources;
-        ModelTreeItemHelper helper;
-        List<ModelItem> subTreeNodesThatNeedBackLinkPatching;
-        DependencyObject view;
-        ModelItem manuallySetParent;
-
-        public ModelItemCollectionImpl(ModelTreeManager modelTreeManager, Type itemType, Object instance, ModelItem parent)
-        {
-            Fx.Assert(modelTreeManager != null, "modelTreeManager cannot be null");
-            Fx.Assert(itemType != null, "item type cannot be null");
-            Fx.Assert(instance != null, "instance cannot be null");
-            this.itemType = itemType;
-            this.instance = instance;
-            this.modelTreeManager = modelTreeManager;
-            this.parents = new List<ModelItem>(1);
-            this.sources = new List<ModelProperty>(1);
-            this.helper = new ModelTreeItemHelper();
-            if (parent != null)
-            {
-                this.manuallySetParent = parent;
-            }
-            this.modelPropertyStore = new Dictionary<string, ModelItem>();
-            this.subTreeNodesThatNeedBackLinkPatching = new List<ModelItem>();
-            this.modelItems = new List<ModelItem>();
-            UpdateInstance(instance);
-        }
-
-        public override event NotifyCollectionChangedEventHandler CollectionChanged;
-
-        public override event PropertyChangedEventHandler PropertyChanged;
-
-        public override AttributeCollection Attributes
-        {
-            get
-            {
-                Fx.Assert(this.itemType != null, "item type cannot be null");
-                return TypeDescriptor.GetAttributes(this.itemType);
-            }
-        }
-
-        public override ModelProperty Content
-        {
-            get
-            {
-                if (this.contentProperty == null)
-                {
-                    Fx.Assert(this.instance != null, "instance cannot be null");
-                    ContentPropertyAttribute contentAttribute = TypeDescriptor.GetAttributes(this.instance)[typeof(ContentPropertyAttribute)] as ContentPropertyAttribute;
-                    if (contentAttribute != null && !String.IsNullOrEmpty(contentAttribute.Name))
-                    {
-                        this.contentProperty = this.Properties.Find(contentAttribute.Name);
-                    }
-                }
-                return contentProperty;
-            }
-        }
-
-        public override int Count
-        {
-            get
-            {
-                Fx.Assert(instance != null, "instance cannot be null");
-                if (instance != null)
-                {
-                    return ((ICollection)instance).Count;
-                }
-                return 0;
-            }
-        }
-
-        public override bool IsReadOnly
-        {
-            get
-            {
-                IList instanceList = instance as IList;
-                Fx.Assert(instanceList != null, "instance should be IList");
-                return instanceList.IsReadOnly;
-            }
-        }
-
-        public override Type ItemType
-        {
-            get
-            {
-                return this.itemType;
-            }
-        }
-
-        public override string Name
-        {
-            get
-            {
-                string name = null;
-                if ((this.NameProperty != null) && (this.NameProperty.Value != null))
-                {
-                    name = (string)this.NameProperty.Value.GetCurrentValue();
-                }
-                return name;
-            }
-            set
-            {
-                this.NameProperty.SetValue(value);
-            }
-        }
-
-        public override ModelItem Parent
-        {
-            get
-            {
-                return (this.Parents.Count() > 0) ? this.Parents.First() : null;
-            }
-
-        }
-
-        public override ModelPropertyCollection Properties
-        {
-            get
-            {
-                if (this.properties == null)
-                {
-                    properties = new ModelPropertyCollectionImpl(this);
-                }
-                return properties;
-            }
-        }
-
-        public override ModelItem Root
-        {
-            get
-            {
-                return this.modelTreeManager.Root;
-            }
-        }
-
-        public override ModelProperty Source
-        {
-            get
-            {
-                return (this.sources.Count > 0) ? this.sources.First() : null;
-            }
-        }
-
-        public override DependencyObject View
-        {
-            get
-            {
-                return this.view;
-            }
-        }
-
-        public override IEnumerable<ModelItem> Parents
-        {
-            get
-            {
-                if (this.manuallySetParent != null)
-                {
-                    List<ModelItem> list = new List<ModelItem>();
-                    list.Add(this.manuallySetParent);
-                    return list.Concat(this.parents).Concat(
-                        from source in this.sources
-                        select source.Parent);
-                }
-
-                return this.parents.Concat(
-                    from source in this.sources
-                    select source.Parent);
-            }
-        }
-
-        public override IEnumerable<ModelProperty> Sources
-        {
-            get
-            {
-                return this.sources;
-            }
-        }
-
-        internal List<ModelItem> Items
-        {
-            get
-            {
-                return modelItems;
-            }
-        }
-
-        internal Dictionary<string, ModelItem> ModelPropertyStore
-        {
-            get
-            {
-                return modelPropertyStore;
-            }
-        }
-
-        protected ModelProperty NameProperty
-        {
-            get
-            {
-                if (this.nameProperty == null)
-                {
-                    Fx.Assert(this.instance != null, "instance cannot be null");
-                    RuntimeNamePropertyAttribute runtimeNamePropertyAttribute = TypeDescriptor.GetAttributes(this.instance)[typeof(RuntimeNamePropertyAttribute)] as RuntimeNamePropertyAttribute;
-                    if (runtimeNamePropertyAttribute != null && !String.IsNullOrEmpty(runtimeNamePropertyAttribute.Name))
-                    {
-                        this.nameProperty = this.Properties.Find(runtimeNamePropertyAttribute.Name);
-                    }
-                }
-                return nameProperty;
-            }
-        }
-
-        ModelItem IModelTreeItem.ModelItem
-        {
-            get
-            {
-                return this;
-            }
-        }
-
-        Dictionary<string, ModelItem> IModelTreeItem.ModelPropertyStore
-        {
-            get
-            {
-                return modelPropertyStore;
-            }
-        }
-
-
-        ModelTreeManager IModelTreeItem.ModelTreeManager
-        {
-            get
-            {
-                return modelTreeManager;
-            }
-        }
-
-        public override ModelItem this[int index]
-        {
-            get
-            {
-                return this.modelItems[index];
-            }
-            set
-            {
-                this.Insert(index, value);
-            }
-        }
-
-        public void SetCurrentView(DependencyObject view)
-        {
-            this.view = view;
-        }
-
-        public override ModelItem Add(object value)
-        {
-            ModelItem item = value as ModelItem;
-            if (item == null)
-            {
-                item = this.modelTreeManager.WrapAsModelItem(value);
-            }
-            if (item == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("value"));
-            }
-            Add(item);
-            return item;
-        }
-
-        public override void Add(ModelItem item)
-        {
-            if (item == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("item"));
-            }
-            this.modelTreeManager.CollectionAdd(this, item);
-        }
-
-
-        public override ModelEditingScope BeginEdit(string description, bool shouldApplyChangesImmediately)
-        {
-            return ModelItemHelper.ModelItemBeginEdit(this.modelTreeManager, description, shouldApplyChangesImmediately);
-        }
-
-        public override ModelEditingScope BeginEdit(bool shouldApplyChangesImmediately)
-        {
-            return this.BeginEdit(null, shouldApplyChangesImmediately);
-        }
-
-        public override ModelEditingScope BeginEdit(string description)
-        {
-            return this.BeginEdit(description, false);
-        }
-
-        public override ModelEditingScope BeginEdit()
-        {
-            return this.BeginEdit(null);
-        }
-
-        public override void Clear()
-        {
-            if (!this.IsReadOnly && (this.modelItems.Count > 0))
-            {
-                this.modelTreeManager.CollectionClear(this);
-            }
-        }
-
-        public override bool Contains(object value)
-        {
-            ModelItem item = value as ModelItem;
-            if (item == null)
-            {
-                return ((IList)instance).Contains(value);
-            }
-            return Contains(item);
-        }
-
-        public override bool Contains(ModelItem item)
-        {
-            return this.Items.Contains(item);
-        }
-
-        public override void CopyTo(ModelItem[] array, int arrayIndex)
-        {
-            if (array == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("array"));
-            }
-            if (this.Items != null)
-            {
-                this.Items.CopyTo(array, arrayIndex);
-            }
-        }
-
-        public override object GetCurrentValue()
-        {
-            return this.instance;
-        }
-
-        public override IEnumerator<ModelItem> GetEnumerator()
-        {
-            foreach (ModelItem modelItem in modelItems)
-            {
-                yield return modelItem;
-            }
-        }
-
-        void IModelTreeItem.OnPropertyChanged(string propertyName)
-        {
-            if (PropertyChanged != null)
-            {
-                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-            }
-        }
-
-        IEnumerable<ModelItem> IModelTreeItem.ItemBackPointers
-        {
-            get { return this.parents; }
-        }
-
-        List<BackPointer> IModelTreeItem.ExtraPropertyBackPointers
-        {
-            get { return this.helper.ExtraPropertyBackPointers; }
-        }
-
-        void IModelTreeItem.SetParent(ModelItem dataModelItem)
-        {
-            if (this.manuallySetParent == dataModelItem)
-            {
-                this.manuallySetParent = null;
-            }
-
-            if (!this.parents.Contains(dataModelItem))
-            {
-                this.parents.Add(dataModelItem);
-            }
-        }
-
-        void IModelTreeItem.SetSource(ModelProperty property)
-        {
-            if (!this.sources.Contains(property))
-            {
-                // also check if the same parent.property is in the list as a different instance of oldModelProperty
-                ModelProperty foundProperty = this.sources.Find((modelProperty) => modelProperty.Name.Equals(property.Name) && property.Parent == modelProperty.Parent);
-                if (foundProperty == null)
-                {
-                    this.sources.Add(property);
-                }
-            }
-        }
-
-        public override int IndexOf(ModelItem item)
-        {
-            if (item == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("item"));
-            }
-            return this.modelItems.IndexOf(item);
-        }
-
-        public override ModelItem Insert(int index, object value)
-        {
-            ModelItem item = value as ModelItem;
-            if (item == null)
-            {
-                item = this.modelTreeManager.WrapAsModelItem(value);
-            }
-            if (item == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("value"));
-            }
-            Insert(index, item);
-            return item;
-        }
-
-        public override void Insert(int index, ModelItem item)
-        {
-            if (item == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("item"));
-            }
-            this.modelTreeManager.CollectionInsert(this, index, item);
-        }
-
-        public override void Move(int fromIndex, int toIndex)
-        {
-            if (fromIndex > this.Items.Count)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentOutOfRangeException("fromIndex"));
-            }
-            if (toIndex > this.Items.Count)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentOutOfRangeException("toIndex"));
-            }
-            ModelItem movingItem = this.Items[fromIndex];
-            this.RemoveAt(fromIndex);
-            this.Insert(toIndex, movingItem);
-        }
-
-        public override bool Remove(object value)
-        {
-            ModelItem item = value as ModelItem;
-            if (item == null)
-            {
-                Fx.Assert(this.Items != null, "Items collection is null when trying to iterate over it");
-                foreach (ModelItem childItem in this.Items)
-                {
-                    if (childItem.GetCurrentValue() == value)
-                    {
-                        item = childItem;
-                        break;
-                    }
-                }
-                if (item == null)
-                {
-                    return false;
-                }
-            }
-            return Remove(item);
-        }
-
-        public override bool Remove(ModelItem item)
-        {
-            this.modelTreeManager.CollectionRemove(this, item);
-            return true;
-        }
-
-        public override void RemoveAt(int index)
-        {
-            if (index >= this.Count)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentOutOfRangeException("index"));
-            }
-            this.modelTreeManager.CollectionRemoveAt(this, index);
-        }
-
-
-
-        internal void AddCore(ModelItem item)
-        {
-            Fx.Assert(instance is IList, "instance should be IList");
-            Fx.Assert(instance != null, "instance should not be null");
-
-            IList instanceList = (IList)instance;
-            instanceList.Add(item.GetCurrentValue());
-            bool wasInCollection = this.modelItems.Contains(item);
-            this.modelItems.Add(item);
-            if (!wasInCollection)
-            {
-                this.modelTreeManager.OnItemEdgeAdded(this, item);
-            }
-
-            if (this.PropertyChanged != null)
-            {
-                this.PropertyChanged(this, new PropertyChangedEventArgs("Count"));
-            }
-            if (this.CollectionChanged != null)
-            {
-                this.CollectionChanged(this, new System.Collections.Specialized.NotifyCollectionChangedEventArgs(System.Collections.Specialized.NotifyCollectionChangedAction.Add, item, this.Count - 1));
-            }
-        }
-
-
-
-        internal void ClearCore()
-        {
-            Fx.Assert(instance is IList, " Instance needs to be Ilist for clear to work");
-            Fx.Assert(instance != null, "Instance should not be null");
-
-            IList instanceList = (IList)instance;
-            instanceList.Clear();
-
-            List<ModelItem> modelItemsRemoved = new List<ModelItem>(this.modelItems);
-            this.modelItems.Clear();
-
-            foreach (ModelItem item in modelItemsRemoved.Distinct())
-            {
-                if (item != null)
-                {
-                    this.modelTreeManager.OnItemEdgeRemoved(this, item);
-                }
-            }
-
-            if (this.PropertyChanged != null)
-            {
-                this.PropertyChanged(this, new PropertyChangedEventArgs("Count"));
-            }
-        }
-
-
-        internal void InsertCore(int index, ModelItem item)
-        {
-            Fx.Assert(instance is IList, "instance needs to be IList");
-            Fx.Assert(instance != null, "instance should not be null");
-            IList instanceList = (IList)instance;
-            instanceList.Insert(index, item.GetCurrentValue());
-
-            bool wasInCollection = this.modelItems.Contains(item);
-            
-            this.modelItems.Insert(index, item);
-
-            if (!wasInCollection)
-            {
-                this.modelTreeManager.OnItemEdgeAdded(this, item);
-            }
-
-            if (this.PropertyChanged != null)
-            {
-                this.PropertyChanged(this, new PropertyChangedEventArgs("Count"));
-            }
-            if (this.CollectionChanged != null)
-            {
-                this.CollectionChanged(this, new System.Collections.Specialized.NotifyCollectionChangedEventArgs(System.Collections.Specialized.NotifyCollectionChangedAction.Add, item, index));
-            }
-        }
-
-        internal void RemoveCore(ModelItem item)
-        {
-
-            Fx.Assert(instance is IList, "Instance needs to be IList for remove to work");
-            Fx.Assert(instance != null, "instance should not be null");
-
-            IList instanceList = (IList)instance;
-            int index = instanceList.IndexOf(item.GetCurrentValue());
-            instanceList.Remove(item.GetCurrentValue());
-            this.modelItems.Remove(item);
-
-            if (!this.modelItems.Contains(item))
-            {
-                this.modelTreeManager.OnItemEdgeRemoved(this, item);
-            }
-
-            if (this.PropertyChanged != null)
-            {
-                this.PropertyChanged(this, new PropertyChangedEventArgs("Count"));
-            }
-
-            if (this.CollectionChanged != null)
-            {
-                this.CollectionChanged(this, new System.Collections.Specialized.NotifyCollectionChangedEventArgs(System.Collections.Specialized.NotifyCollectionChangedAction.Remove, item, index));
-            }
-        }
-
-        internal void RemoveAtCore(int index)
-        {
-            Fx.Assert(instance is IList, "Instance needs to be IList for remove to work");
-            Fx.Assert(instance != null, "instance should not be null");
-
-            IList instanceList = (IList)instance;
-            ModelItem item = this.modelItems[index];
-            instanceList.RemoveAt(index);
-            this.modelItems.RemoveAt(index);
-            if (!this.modelItems.Contains(item))
-            {
-                this.modelTreeManager.OnItemEdgeRemoved(this, item);
-            }
-
-            if (this.PropertyChanged != null)
-            {
-                this.PropertyChanged(this, new PropertyChangedEventArgs("Count"));
-            }
-
-            if (this.CollectionChanged != null)
-            {
-                this.CollectionChanged(this, new System.Collections.Specialized.NotifyCollectionChangedEventArgs(System.Collections.Specialized.NotifyCollectionChangedAction.Remove, item, index));
-            }
-        }
-
-        void UpdateInstance(object instance)
-        {
-            this.instance = instance;
-            IEnumerable instanceCollection = this.instance as IEnumerable;
-            if (instanceCollection != null)
-            {
-                foreach (object item in instanceCollection)
-                {
-                    ModelItem modelItem = this.modelTreeManager.WrapAsModelItem(item);
-                    bool wasInCollection = item != null && this.modelItems.Contains(item);
-                    this.modelItems.Add(modelItem);
-                    if (item != null && !wasInCollection)
-                    {
-                        this.modelTreeManager.OnItemEdgeAdded(this, modelItem);
-                    }
-                }
-            }
-        }
-
-        void IModelTreeItem.RemoveParent(ModelItem oldParent)
-        {
-            if (this.manuallySetParent == oldParent)
-            {
-                this.manuallySetParent = null;
-            }
-
-            if (this.parents.Contains(oldParent))
-            {
-                this.parents.Remove(oldParent);
-            }
-        }
-
-        void IModelTreeItem.RemoveSource(ModelProperty oldModelProperty)
-        {
-            if (this.sources.Contains(oldModelProperty))
-            {
-                this.sources.Remove(oldModelProperty);
-            }
-            else
-            {
-                ((IModelTreeItem)this).RemoveSource(oldModelProperty.Parent, oldModelProperty.Name);
-            }
-        }
-
-        void IModelTreeItem.RemoveSource(ModelItem parent, string propertyName)
-        {
-            // also check if the same parent.property is in the list as a different instance of oldModelProperty
-            ModelProperty foundProperty = this.sources.FirstOrDefault<ModelProperty>((modelProperty) => modelProperty.Name.Equals(propertyName) && modelProperty.Parent == parent);
-            if (foundProperty != null)
-            {
-                this.sources.Remove(foundProperty);
-            }
-            else
-            {
-                this.helper.RemoveExtraPropertyBackPointer(parent, propertyName);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemDictionaryImpl.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemDictionaryImpl.cs
deleted file mode 100644 (file)
index 8be4b90..0000000
+++ /dev/null
@@ -1,1288 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Model
-{
-    using System.Activities.Presentation.Services;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Collections.Specialized;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Linq;
-    using System.Reflection;
-    using System.Runtime;
-    using System.Runtime.Collections;
-    using System.Windows;
-    using System.Windows.Markup;
-
-    internal class ModelItemDictionaryImpl : ModelItemDictionary, IModelTreeItem, ICustomTypeDescriptor
-    {
-        ModelProperty contentProperty;
-        DictionaryWrapper instance;
-        Type itemType;
-        private NullableKeyDictionary<ModelItem, ModelItem> modelItems;
-        internal ModelItem updateKeySavedValue;
-        Dictionary<string, ModelItem> modelPropertyStore;
-        ModelTreeManager modelTreeManager;
-        ModelProperty nameProperty;
-        List<ModelItem> parents;
-        ModelPropertyCollectionImpl properties;
-        List<ModelProperty> sources;
-        ModelTreeItemHelper helper;
-        List<ModelItem> subTreeNodesThatNeedBackLinkPatching;
-        DependencyObject view;
-        ModelItem manuallySetParent;
-
-        [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors", Justification = "This is internal code with no derived class")]
-        public ModelItemDictionaryImpl(ModelTreeManager modelTreeManager, Type itemType, Object instance, ModelItem parent)
-        {
-            Fx.Assert(modelTreeManager != null, "modelTreeManager cannot be null");
-            Fx.Assert(itemType != null, "item type cannot be null");
-            Fx.Assert(instance != null, "instance cannot be null");
-            this.itemType = itemType;
-            this.instance = new DictionaryWrapper(instance);
-            this.modelTreeManager = modelTreeManager;
-            this.parents = new List<ModelItem>(1);
-            this.sources = new List<ModelProperty>(1);
-            this.helper = new ModelTreeItemHelper();
-            if (parent != null)
-            {
-                this.manuallySetParent = parent;
-            }
-            this.modelPropertyStore = new Dictionary<string, ModelItem>();
-            this.subTreeNodesThatNeedBackLinkPatching = new List<ModelItem>();
-            this.modelItems = new NullableKeyDictionary<ModelItem, ModelItem>();
-            UpdateInstance();
-
-
-            if (ItemsCollectionObject != null)
-            {
-                ItemsCollectionModelItemCollection.CollectionChanged += new NotifyCollectionChangedEventHandler(itemsCollection_CollectionChanged);
-                this.ItemsCollectionObject.ModelDictionary = this;
-            }
-        }
-
-        Type itemsCollectionKVPType = null;
-        Type ItemsCollectionKVPType
-        {
-            get
-            {
-                if (itemsCollectionKVPType == null)
-                {
-                    if (ItemsCollectionModelItemCollection != null)
-                    {
-                        Type itemsCollectionType = ItemsCollectionModelItemCollection.ItemType;
-                        Type[] genericArguments = itemsCollectionType.GetGenericArguments();
-                        this.itemsCollectionKVPType = typeof(ModelItemKeyValuePair<,>).MakeGenericType(genericArguments);
-                    }
-                }
-                return itemsCollectionKVPType;
-            }
-        }
-
-        ModelItemCollection ItemsCollectionModelItemCollection
-        {
-            get
-            {
-                return this.Properties["ItemsCollection"].Collection;
-            }
-        }
-
-        IItemsCollection ItemsCollectionObject
-        {
-            get
-            {
-                IItemsCollection itemsCollectionObject = null;
-                if (this.ItemsCollectionModelItemCollection != null)
-                {
-                    itemsCollectionObject = ItemsCollectionModelItemCollection.GetCurrentValue() as IItemsCollection;
-                }
-                return itemsCollectionObject;
-            }
-        }
-
-        private bool EditInProgress { get; set; }
-
-        internal void UpdateValue(object keyObj, object valueObj)
-        {
-            ModelItem key = null;
-            bool keyFound = this.KeyAsModelItem(keyObj, false, out key);
-            Fx.Assert(keyFound, "The key should already exist in the current dictionary");
-            ModelItem value = this.WrapObject(valueObj);
-            this.EditCore(key, value, false);
-        }
-
-        internal void UpdateKey(object oldKeyObj, object newKeyObj)
-        {
-            if (oldKeyObj != newKeyObj)
-            {
-                ModelItem newKey = null;
-                this.KeyAsModelItem(newKeyObj, true, out newKey);
-                ModelItem oldKey = null;
-                bool oldKeyFound = this.KeyAsModelItem(oldKeyObj, false, out oldKey);
-                Fx.Assert(oldKeyFound, "The old key should already exist in the current dictionary");
-                
-                try
-                {
-                    this.EditInProgress = true;
-                    Fx.Assert(this.instance != null, "instance should not be null");
-
-                    bool wasNewKeyInKeysOrValuesCollection = newKey != null && this.IsInKeysOrValuesCollection(newKey);
-
-                    ModelItem value = this.modelItems[oldKey];
-                    this.modelItems.Remove(oldKey);
-
-                    this.updateKeySavedValue = value;
-
-                    if (oldKey != null && !this.IsInKeysOrValuesCollection(oldKey))
-                    {
-                        this.modelTreeManager.OnItemEdgeRemoved(this, oldKey);
-                    }
-
-                    this.updateKeySavedValue = null;
-                    this.modelItems[newKey] = value;
-
-                    if (newKey != null && !wasNewKeyInKeysOrValuesCollection)
-                    {
-                        this.modelTreeManager.OnItemEdgeAdded(this, newKey);
-                    }
-
-                    if (null != this.CollectionChanged)
-                    {
-                        this.CollectionChanged(this,
-                            new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace,
-                            new KeyValuePair<ModelItem, ModelItem>(newKey, value),
-                            new KeyValuePair<ModelItem, ModelItem>(oldKey, value)));
-                    }
-                }
-                finally
-                {
-                    this.EditInProgress = false;
-                }
-            }
-        }
-
-        void itemsCollection_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
-        {
-            //If we're in editing, then we don't trigger an update
-            if (EditInProgress)
-            {
-                return;
-            }
-
-            if (e.Action == NotifyCollectionChangedAction.Add)
-            {
-                foreach (ModelItem item in e.NewItems)
-                {
-                    ModelItem key = item.Properties["Key"] == null ? null : item.Properties["Key"].Value;
-                    ModelItem value = item.Properties["Value"] == null ? null : item.Properties["Value"].Value;
-                    this.AddCore(key, value, false);
-                }
-            }
-            else if (e.Action == NotifyCollectionChangedAction.Remove)
-            {
-                foreach (ModelItem item in e.OldItems)
-                {
-                    object keyObject = item.Properties["Key"].Value == null ? null : item.Properties["Key"].Value.GetCurrentValue();
-                    ModelItem key = null;
-                    bool keyFound = KeyAsModelItem(keyObject, false, out key);
-                    Fx.Assert(keyFound, "Key should exist in the current dictionary");
-                    this.RemoveCore(key, false);
-                }
-            }
-            else if (e.Action == NotifyCollectionChangedAction.Replace)
-            {
-                Fx.Assert(e.NewItems != null && e.OldItems != null && e.NewItems.Count == e.OldItems.Count,
-                    "there must be equal number of old and new items");
-
-                foreach (ModelItem item in e.NewItems)
-                {
-                    object keyObject = item.Properties["Key"].Value == null ? null : item.Properties["Key"].Value.GetCurrentValue();
-                    ModelItem key = null;
-                    bool keyFound = KeyAsModelItem(keyObject, false, out key);
-                    Fx.Assert(keyFound, "Key should exist in the current dictionary");
-                    ModelItem value = item.Properties["Value"] == null ? null : item.Properties["Value"].Value;
-                    this.EditCore(key, value, false);
-                }
-            }
-            else if (e.Action == NotifyCollectionChangedAction.Reset)
-            {
-                UpdateInstance();
-                if (this.CollectionChanged != null)
-                {
-                    this.CollectionChanged(this,
-                        new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
-                }
-            }
-            //note we do not handle NotifyCollectionChangedAction.Move as we don't expect it nor can Dictionary do a move operation
-        }
-
-        public override event NotifyCollectionChangedEventHandler CollectionChanged;
-
-        public override event PropertyChangedEventHandler PropertyChanged;
-
-        public override int Count
-        {
-            get { return this.instance.Count; }
-        }
-
-        public override bool IsReadOnly
-        {
-            get { return this.instance.IsReadOnly; }
-        }
-
-        public override ICollection<ModelItem> Keys
-        {
-            get { return this.modelItems.Keys; }
-        }
-
-        public override ICollection<ModelItem> Values
-        {
-            get { return this.modelItems.Values; }
-        }
-
-        public override AttributeCollection Attributes
-        {
-            get
-            {
-                Fx.Assert(null != this.itemType, "ItemType cannot be null!");
-                return TypeDescriptor.GetAttributes(this.itemType);
-            }
-        }
-
-        public override ModelProperty Content
-        {
-            get
-            {
-                if (this.contentProperty == null)
-                {
-                    Fx.Assert(this.instance != null, "instance cannot be null");
-                    ContentPropertyAttribute contentAttribute = TypeDescriptor.GetAttributes(this.instance.Value)[typeof(ContentPropertyAttribute)] as ContentPropertyAttribute;
-                    if (contentAttribute != null && !String.IsNullOrEmpty(contentAttribute.Name))
-                    {
-                        this.contentProperty = this.Properties.Find(contentAttribute.Name);
-                    }
-                }
-                return contentProperty;
-            }
-        }
-
-        public override Type ItemType
-        {
-            get { return this.itemType; }
-        }
-
-        public override string Name
-        {
-            get
-            {
-                string name = null;
-                if ((this.NameProperty != null) && (this.NameProperty.Value != null))
-                {
-                    name = (string)this.NameProperty.Value.GetCurrentValue();
-                }
-                return name;
-            }
-            set
-            {
-                if (null != this.NameProperty)
-                {
-                    this.NameProperty.SetValue(value);
-                }
-            }
-        }
-
-        public override ModelItem Parent
-        {
-            get
-            {
-                return (this.Parents.Count() > 0) ? this.Parents.First() : null;
-            }
-
-        }
-
-        public override ModelItem Root
-        {
-            get { return this.modelTreeManager.Root; }
-        }
-
-        public override ModelPropertyCollection Properties
-        {
-            get
-            {
-                if (this.properties == null)
-                {
-                    this.properties = new ModelPropertyCollectionImpl(this);
-                }
-                return this.properties;
-            }
-        }
-
-        public override ModelProperty Source
-        {
-            get
-            {
-                return (this.sources.Count > 0) ? this.sources.First() : null;
-            }
-        }
-
-        public override DependencyObject View
-        {
-            get { return this.view; }
-        }
-
-        public ModelItem ModelItem
-        {
-            get { return this; }
-        }
-
-        public Dictionary<string, ModelItem> ModelPropertyStore
-        {
-            get { return this.modelPropertyStore; }
-        }
-
-        public ModelTreeManager ModelTreeManager
-        {
-            get { return this.modelTreeManager; }
-        }
-
-
-        public override IEnumerable<ModelItem> Parents
-        {
-            get
-            {
-                if (this.manuallySetParent != null)
-                {
-                    List<ModelItem> list = new List<ModelItem>();
-                    list.Add(this.manuallySetParent);
-                    return list.Concat(this.parents).Concat(
-                        from source in this.sources
-                        select source.Parent);
-                }
-
-                return this.parents.Concat(
-                    from source in this.sources
-                    select source.Parent);
-            }
-        }
-
-        public override IEnumerable<ModelProperty> Sources
-        {
-            get
-            {
-                return this.sources;
-            }
-        }
-
-        protected ModelProperty NameProperty
-        {
-            get
-            {
-                if (this.nameProperty == null)
-                {
-                    Fx.Assert(this.instance != null, "instance cannot be null");
-                    RuntimeNamePropertyAttribute runtimeNamePropertyAttribute = TypeDescriptor.GetAttributes(this.instance.Value)[typeof(RuntimeNamePropertyAttribute)] as RuntimeNamePropertyAttribute;
-                    if (runtimeNamePropertyAttribute != null && !String.IsNullOrEmpty(runtimeNamePropertyAttribute.Name))
-                    {
-                        this.nameProperty = this.Properties.Find(runtimeNamePropertyAttribute.Name);
-                    }
-                    else
-                    {
-                        this.nameProperty = this.Properties.FirstOrDefault<ModelProperty>(p => (0 == string.Compare(p.Name, "Name", StringComparison.OrdinalIgnoreCase)));
-                    }
-                }
-                return nameProperty;
-            }
-        }
-
-        public override ModelItem this[ModelItem key]
-        {
-            get
-            {
-                return this.modelItems[key];
-            }
-            set
-            {
-                if (this.instance.IsReadOnly)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.CollectionIsReadOnly));
-                }
-
-                ModelItem oldValue = null;
-                if (this.modelItems.TryGetValue(key, out oldValue))
-                {
-                    this.modelTreeManager.DictionaryEdit(this, key, value, oldValue);
-                }
-                else
-                {
-                    this.modelTreeManager.DictionaryAdd(this, key, value);
-                }
-            }
-        }
-
-        public override ModelItem this[object key]
-        {
-            get
-            {
-                ModelItem keyItem = null;
-                bool keyFound = this.KeyAsModelItem(key, false, out keyItem);
-                if (!keyFound)
-                {
-                    throw FxTrace.Exception.AsError(new KeyNotFoundException(key.ToString()));
-                }
-
-                return this[keyItem];
-            }
-            set
-            {
-                if (this.instance.IsReadOnly)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.CollectionIsReadOnly));
-                }
-
-                ModelItem keyItem = null;
-                this.KeyAsModelItem(key, true, out keyItem);
-                this[keyItem] = value;
-            }
-        }
-
-        public override void Add(ModelItem key, ModelItem value)
-        {
-            if (this.instance.IsReadOnly)
-            {
-                throw FxTrace.Exception.AsError(new InvalidOperationException(SR.CollectionIsReadOnly));
-            }
-            this.modelTreeManager.DictionaryAdd(this, key, value);
-        }
-
-        public override ModelItem Add(object key, object value)
-        {
-            if (this.instance.IsReadOnly)
-            {
-                throw FxTrace.Exception.AsError(new InvalidOperationException(SR.CollectionIsReadOnly));
-            }
-            ModelItem keyModelItem = key as ModelItem ?? this.WrapObject(key);
-            ModelItem valueModelItem = value as ModelItem ?? this.WrapObject(value);
-            this.Add(keyModelItem, valueModelItem);
-            return valueModelItem;
-        }
-
-        public override void Clear()
-        {
-            this.modelTreeManager.DictionaryClear(this);
-        }
-
-        public override bool ContainsKey(ModelItem key)
-        {
-            return this.modelItems.Keys.Contains<ModelItem>(key);
-        }
-
-        public override bool ContainsKey(object key)
-        {
-            ModelItem keyItem = key as ModelItem;
-
-            if (keyItem != null)
-            {
-                return this.ContainsKey(keyItem);
-            }
-
-            return this.KeyAsModelItem(key, false, out keyItem);
-        }
-
-        public override IEnumerator<KeyValuePair<ModelItem, ModelItem>> GetEnumerator()
-        {
-            return this.modelItems.GetEnumerator();
-        }
-
-        public override bool Remove(ModelItem key)
-        {
-            this.modelTreeManager.DictionaryRemove(this, key);
-            return true;
-        }
-
-        public override bool Remove(object key)
-        {
-            ModelItem keyItem = null;
-            if (!this.KeyAsModelItem(key, false, out keyItem))
-            {
-                return false;
-            }
-
-            return this.Remove(keyItem);
-        }
-
-        public override bool TryGetValue(ModelItem key, out ModelItem value)
-        {
-            return this.modelItems.TryGetValue(key, out value);
-        }
-
-        public override bool TryGetValue(object key, out ModelItem value)
-        {
-            ModelItem keyItem = null;
-            if (!this.KeyAsModelItem(key, false, out keyItem))
-            {
-                value = null;
-                return false;
-            }
-
-            return this.TryGetValue(keyItem, out value);
-        }
-
-        public override ModelEditingScope BeginEdit(string description, bool shouldApplyChangesImmediately)
-        {
-            return ModelItemHelper.ModelItemBeginEdit(this.modelTreeManager, description, shouldApplyChangesImmediately);
-        }
-
-        public override ModelEditingScope BeginEdit(bool shouldApplyChangesImmediately)
-        {
-            return this.BeginEdit(null, shouldApplyChangesImmediately);
-        }
-
-        public override ModelEditingScope BeginEdit(string description)
-        {
-            return this.BeginEdit(description, false);
-        }
-
-        public override ModelEditingScope BeginEdit()
-        {
-            return this.BeginEdit(null);
-        }
-
-        public override object GetCurrentValue()
-        {
-            return this.instance.Value;
-        }
-
-        #region IModelTreeItem Members
-
-        public void OnPropertyChanged(string propertyName)
-        {
-            if (null != this.PropertyChanged)
-            {
-                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-            }
-        }
-
-        void IModelTreeItem.SetParent(ModelItem dataModelItem)
-        {
-            if (this.manuallySetParent == dataModelItem)
-            {
-                this.manuallySetParent = null;
-            }
-
-            if (!this.parents.Contains(dataModelItem))
-            {
-                this.parents.Add(dataModelItem);
-            }
-        }
-
-        void IModelTreeItem.SetSource(ModelProperty property)
-        {
-            if (!this.sources.Contains(property))
-            {
-                // also check if the same parent.property is in the list as a different instance of oldModelProperty
-                ModelProperty foundProperty = this.sources.Find((modelProperty) => modelProperty.Name.Equals(property.Name) && property.Parent == modelProperty.Parent);
-                if (foundProperty == null)
-                {
-                    this.sources.Add(property);
-                }
-            }
-        }
-
-        public void SetCurrentView(DependencyObject view)
-        {
-            this.view = view;
-        }
-
-        #endregion
-
-        void IModelTreeItem.RemoveParent(ModelItem oldParent)
-        {
-            if (this.manuallySetParent == oldParent)
-            {
-                this.manuallySetParent = null;
-            }
-
-            if (this.parents.Contains(oldParent))
-            {
-                this.parents.Remove(oldParent);
-            }
-        }
-
-        IEnumerable<ModelItem> IModelTreeItem.ItemBackPointers
-        {
-            get { return this.parents; }
-        }
-
-        List<BackPointer> IModelTreeItem.ExtraPropertyBackPointers
-        {
-            get { return this.helper.ExtraPropertyBackPointers; }
-        }
-
-        void IModelTreeItem.RemoveSource(ModelProperty oldModelProperty)
-        {
-            if (this.sources.Contains(oldModelProperty))
-            {
-                this.sources.Remove(oldModelProperty);
-            }
-            else
-            {
-                ((IModelTreeItem)this).RemoveSource(oldModelProperty.Parent, oldModelProperty.Name);
-            }
-        }
-
-        void IModelTreeItem.RemoveSource(ModelItem parent, string propertyName)
-        {
-            // also check if the same parent.property is in the list as a different instance of oldModelProperty
-            ModelProperty foundProperty = this.sources.FirstOrDefault<ModelProperty>((modelProperty) => modelProperty.Name.Equals(propertyName) && modelProperty.Parent == parent);
-            if (foundProperty != null)
-            {
-                this.sources.Remove(foundProperty);
-            }
-            else
-            {
-                this.helper.RemoveExtraPropertyBackPointer(parent, propertyName);
-            }
-        }
-
-        internal void EditCore(ModelItem key, ModelItem value)
-        {
-            this.EditCore(key, value, true);
-        }
-
-        private void EditCore(ModelItem key, ModelItem value, bool updateInstance)
-        {
-            try
-            {
-                ModelItem oldValue = this.modelItems[key];
-                this.EditInProgress = true;
-                Fx.Assert(this.instance != null, "instance should not be null");
-
-                bool wasValueInKeysOrValuesCollection = this.IsInKeysOrValuesCollection(value);
-
-                if (updateInstance)
-                {
-                    this.instance[(key == null) ? null : key.GetCurrentValue()] = null != value ? value.GetCurrentValue() : null;
-                    //this also makes sure ItemsCollectionModelItemCollection is not null 
-                    if (ItemsCollectionObject != null)
-                    {
-                        try
-                        {
-                            ItemsCollectionObject.ShouldUpdateDictionary = false;
-
-                            foreach (ModelItem item in ItemsCollectionModelItemCollection)
-                            {
-                                ModelItem keyInCollection = item.Properties["Key"].Value;
-                                bool found = (key == keyInCollection);
-
-                                if (!found && key != null && keyInCollection != null)
-                                {
-                                    object keyValue = key.GetCurrentValue();
-
-                                    // ValueType do not share ModelItem, a ModelItem is always created for a ValueType
-                                    // ModelTreeManager always create a ModelItem even for the same string
-                                    // So, we compare object instance instead of ModelItem for above cases.
-                                    if (keyValue is ValueType || keyValue is string)
-                                    {
-                                        found = keyValue.Equals(keyInCollection.GetCurrentValue());
-                                    }
-                                }
-
-                                if (found)
-                                {
-                                    ModelPropertyImpl valueImpl = item.Properties["Value"] as ModelPropertyImpl;
-                                    if (valueImpl != null)
-                                    {
-                                        valueImpl.SetValueCore(value);
-                                    }
-                                }
-                            }
-                        }
-                        finally
-                        {
-                            ItemsCollectionObject.ShouldUpdateDictionary = true;
-                        }
-                    }
-                }
-
-                this.modelItems[key] = null;
-                if (oldValue != null && !this.IsInKeysOrValuesCollection(oldValue))
-                {
-                    this.modelTreeManager.OnItemEdgeRemoved(this, oldValue);
-                }
-
-                this.modelItems[key] = value;
-                if (value != null && !wasValueInKeysOrValuesCollection)
-                {
-                    this.modelTreeManager.OnItemEdgeAdded(this, value);
-                }
-
-                if (null != this.CollectionChanged)
-                {
-                    this.CollectionChanged(this,
-                        new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace,
-                        new KeyValuePair<ModelItem, ModelItem>(key, value),
-                        new KeyValuePair<ModelItem, ModelItem>(key, oldValue)));
-                }
-            }
-            finally
-            {
-                this.EditInProgress = false;
-            }
-        }
-
-        internal void AddCore(ModelItem key, ModelItem value)
-        {
-            this.AddCore(key, value, true);
-        }
-
-        private void AddCore(ModelItem key, ModelItem value, bool updateInstance)
-        {
-            try
-            {
-                this.EditInProgress = true;
-                Fx.Assert(this.instance != null, "instance should not be null");
-                
-                bool wasKeyInKeysOrValuesCollection = key != null && this.IsInKeysOrValuesCollection(key);
-                bool wasValueInKeysOrValuesCollection = value != null && this.IsInKeysOrValuesCollection(value);
-
-                if (updateInstance)
-                {
-                    //no need to [....] if the ItemsCollection is not DictionaryItemsCollection wrapped by ModelItemCollectionImpl
-                    ModelItemCollectionImpl itemsCollectionImpl = this.ItemsCollectionModelItemCollection as ModelItemCollectionImpl;
-                    if (ItemsCollectionObject != null && itemsCollectionImpl != null)
-                    {
-                        try
-                        {
-                            ItemsCollectionObject.ShouldUpdateDictionary = false;
-                            object mutableKVPair = Activator.CreateInstance(this.ItemsCollectionKVPType, new object[] { key == null ? null : key.GetCurrentValue(), value != null ? value.GetCurrentValue() : null });
-                            ModelItem mutableKVPairItem = this.modelTreeManager.WrapAsModelItem(mutableKVPair);
-
-                            itemsCollectionImpl.AddCore(mutableKVPairItem);
-                        }
-                        finally
-                        {
-                            ItemsCollectionObject.ShouldUpdateDictionary = true;
-                        }
-                    }
-                    this.instance.Add(key == null ? null : key.GetCurrentValue(), null != value ? value.GetCurrentValue() : null);
-                }
-
-                this.modelItems.Add(key, value);
-
-                if (key != null && !wasKeyInKeysOrValuesCollection)
-                {
-                    this.modelTreeManager.OnItemEdgeAdded(this, key);
-                }
-
-                if (value != null && !wasValueInKeysOrValuesCollection && value != key)
-                {
-                    this.modelTreeManager.OnItemEdgeAdded(this, value);
-                }
-
-                if (null != this.CollectionChanged)
-                {
-                    this.CollectionChanged(this,
-                        new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add,
-                        new KeyValuePair<ModelItem, ModelItem>(key, value)));
-                }
-            }
-            finally
-            {
-                this.EditInProgress = false;
-            }
-        }
-
-        internal void ClearCore()
-        {
-            this.ClearCore(true);
-        }
-
-        private void ClearCore(bool updateInstance)
-        {
-            try
-            {
-                this.EditInProgress = true;
-                Fx.Assert(this.instance != null, "instance should not be null");
-                IList removed = this.modelItems.ToList<KeyValuePair<ModelItem, ModelItem>>();
-                if (updateInstance)
-                {
-                    //no need to [....] if the ItemsCollection is not DictionaryItemsCollection wrapped by ModelItemCollectionImpl
-                    ModelItemCollectionImpl itemsCollectionImpl = this.ItemsCollectionModelItemCollection as ModelItemCollectionImpl;
-                    if (ItemsCollectionObject != null && itemsCollectionImpl != null)
-                    {
-                        try
-                        {
-                            ItemsCollectionObject.ShouldUpdateDictionary = false;
-                            itemsCollectionImpl.ClearCore();
-                        }
-                        finally
-                        {
-                            ItemsCollectionObject.ShouldUpdateDictionary = true;
-                        }
-                    }
-                    this.instance.Clear();
-                }
-                List<ModelItem> removedItems = new List<ModelItem>(this.modelItems.Keys.Concat(this.modelItems.Values).Distinct());
-                this.modelItems.Clear();
-
-                foreach (ModelItem item in removedItems.Distinct())
-                {
-                    if (item != null)
-                    {
-                        this.modelTreeManager.OnItemEdgeRemoved(this, item);
-                    }
-                }
-
-                if (null != this.CollectionChanged)
-                {
-                    this.CollectionChanged(this,
-                        new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, removed));
-                }
-            }
-            finally
-            {
-                this.EditInProgress = false;
-            }
-        }
-
-        internal void RemoveCore(ModelItem key)
-        {
-            this.RemoveCore(key, true);
-        }
-
-        private bool IsInKeysOrValuesCollection(ModelItem modelItem)
-        {
-            foreach (ModelItem item in this.modelItems.Keys)
-            {
-                if (item == modelItem)
-                {
-                    return true;
-                }
-            }
-
-            foreach (ModelItem item in this.modelItems.Values)
-            {
-                if (item == modelItem)
-                {
-                    return true;
-                }
-            }
-
-            return false;
-        }
-
-        private void RemoveCore(ModelItem key, bool updateInstance)
-        {
-            try
-            {
-                this.EditInProgress = true;
-                Fx.Assert(this.instance != null, "instance should not be null");
-                ModelItem value = this.modelItems[key];
-                this.modelItems.Remove(key);
-
-                if (key != null && !this.IsInKeysOrValuesCollection(key))
-                {
-                    this.modelTreeManager.OnItemEdgeRemoved(this, key);
-                }
-
-                if (value != null && !this.IsInKeysOrValuesCollection(value) && value != key)
-                {
-                    this.modelTreeManager.OnItemEdgeRemoved(this, value);
-                }
-
-                if (updateInstance)
-                {
-                    ModelItemCollectionImpl itemsCollectionImpl = ItemsCollectionModelItemCollection as ModelItemCollectionImpl;
-                    if (ItemsCollectionObject != null && itemsCollectionImpl != null)
-                    {
-                        try
-                        {
-                            ItemsCollectionObject.ShouldUpdateDictionary = false;
-
-                            ModelItem itemToBeRemoved = null;
-                            foreach (ModelItem item in itemsCollectionImpl)
-                            {
-                                ModelItem keyInCollection = item.Properties["Key"].Value;
-
-                                if (key == keyInCollection)
-                                {
-                                    itemToBeRemoved = item;
-                                    break;
-                                }
-
-                                if (key != null && keyInCollection != null)
-                                {
-                                    object keyValue = key.GetCurrentValue();
-
-                                    // ValueType do not share ModelItem, a ModelItem is always created for a ValueType
-                                    // ModelTreeManager always create a ModelItem even for the same string
-                                    // So, we compare object instance instead of ModelItem for above cases.
-                                    if (keyValue is ValueType || keyValue is string)
-                                    {
-                                        if (keyValue.Equals(keyInCollection.GetCurrentValue()))
-                                        {
-                                            itemToBeRemoved = item;
-                                            break;
-                                        }
-                                    }
-                                }
-                            }
-
-                            if (itemToBeRemoved != null)
-                            {
-                                itemsCollectionImpl.RemoveCore(itemToBeRemoved);
-                            }
-                        }
-                        finally
-                        {
-                            ItemsCollectionObject.ShouldUpdateDictionary = true;
-                        }
-                    }
-                    this.instance.Remove(key == null ? null : key.GetCurrentValue());
-                }
-                if (null != this.CollectionChanged)
-                {
-                    this.CollectionChanged(this,
-                        new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, new KeyValuePair<ModelItem, ModelItem>(key, value)));
-                }
-            }
-            finally
-            {
-                this.EditInProgress = false;
-            }
-        }
-
-        void UpdateInstance()
-        {
-            IEnumerator dictionaryEnumerator = this.instance.GetEnumerator();
-            while (dictionaryEnumerator.MoveNext())
-            {
-                object current = dictionaryEnumerator.Current;
-
-                object keyObject = instance.GetKeyFromCurrent(current);
-                ModelItem key = (keyObject == null) ? null : this.WrapObject(keyObject);
-                ModelItem value = this.WrapObject(instance.GetValueFromCurrent(current));
-
-                bool wasKeyInKeysOrValuesCollection = key != null && this.IsInKeysOrValuesCollection(key);
-                bool wasValueInKeysOrValuesCollection = value != null && this.IsInKeysOrValuesCollection(value);
-
-                this.modelItems.Add(key, value);
-
-                if (key != null && !wasKeyInKeysOrValuesCollection)
-                {
-                    this.modelTreeManager.OnItemEdgeAdded(this, key);
-                }
-
-                if (value != null && !wasValueInKeysOrValuesCollection && value != key)
-                {
-                    this.modelTreeManager.OnItemEdgeAdded(this, value);
-                }
-            }
-        }
-
-        ModelItem WrapObject(object value)
-        {
-            return this.ModelTreeManager.WrapAsModelItem(value);
-        }
-
-        // return true if the key already exist, false otherwise.
-        private bool KeyAsModelItem(object value, bool createNew, out ModelItem keyModelItem)
-        {
-            keyModelItem = value as ModelItem;
-            if (keyModelItem != null)
-            {
-                return true;
-            }
-
-            bool found = false;
-            keyModelItem = this.modelItems.Keys.SingleOrDefault<ModelItem>(p =>
-            {
-                if ((p == null && value == null) || (p != null && object.Equals(p.GetCurrentValue(), value)))
-                {
-                    found = true;
-                    return true;
-                }
-                return false;
-            });
-
-            if (createNew && keyModelItem == null)
-            {
-                keyModelItem = WrapObject(value);
-            }
-
-            return found;
-        }
-
-        sealed class DictionaryWrapper
-        {
-            object instance;
-            bool isDictionary = false;
-            PropertyInfo isReadOnlyProperty;
-            PropertyInfo countProperty;
-            PropertyInfo indexingProperty;
-            MethodInfo addMethod;
-            MethodInfo removeMethod;
-            MethodInfo clearMethod;
-            MethodInfo getEnumeratorMethod;
-            PropertyInfo keyProperty;
-            PropertyInfo valueProperty;
-
-            public DictionaryWrapper(object instance)
-            {
-                this.instance = instance;
-                if (instance is IDictionary)
-                {
-                    this.isDictionary = true;
-                    Type keyValuePairType = typeof(KeyValuePair<object, object>);
-                }
-                else
-                {
-                    Type instanceType = instance.GetType();
-                    instanceType.FindInterfaces(this.GetDictionaryInterface, null);
-                }
-            }
-
-            public object Value
-            {
-                get { return this.instance; }
-            }
-
-            public bool IsReadOnly
-            {
-                get
-                {
-                    return (this.isDictionary ? ((IDictionary)instance).IsReadOnly : (bool)this.isReadOnlyProperty.GetValue(this.instance, null));
-                }
-            }
-
-            public int Count
-            {
-                get
-                {
-                    return (this.isDictionary ? ((IDictionary)instance).Count : (int)this.countProperty.GetValue(this.instance, null));
-                }
-            }
-
-            [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is intended for use through reflection")]
-            public object this[object key]
-            {
-                get
-                {
-                    if (this.isDictionary)
-                    {
-                        return ((IDictionary)instance)[key];
-                    }
-                    else
-                    {
-                        return this.indexingProperty.GetValue(this.instance, new object[] { key });
-                    }
-                }
-                set
-                {
-                    if (this.isDictionary)
-                    {
-                        ((IDictionary)instance)[key] = value;
-                    }
-                    else
-                    {
-                        this.indexingProperty.SetValue(this.instance, value, new object[] { key });
-                    }
-                }
-            }
-
-            public object GetKeyFromCurrent(object keyValuePair)
-            {
-                if (isDictionary)
-                {
-                    return ((DictionaryEntry)keyValuePair).Key;
-                }
-                else
-                {
-                    return this.keyProperty.GetValue(keyValuePair, null);
-                }
-            }
-
-            public object GetValueFromCurrent(object keyValuePair)
-            {
-                if (isDictionary)
-                {
-                    return ((DictionaryEntry)keyValuePair).Value;
-                }
-                else
-                {
-                    return this.valueProperty.GetValue(keyValuePair, null);
-                }
-            }
-
-
-            bool GetDictionaryInterface(Type type, object dummy)
-            {
-                if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(IDictionary<,>))
-                {
-                    this.addMethod = type.GetMethod("Add");
-                    this.removeMethod = type.GetMethod("Remove");
-                    this.indexingProperty = type.GetProperty("Item");
-                    return true;
-                }
-                if (type.IsGenericType &&
-                    type.GetGenericArguments()[0].IsGenericType &&
-                    type.GetGenericArguments()[0].GetGenericTypeDefinition() == typeof(KeyValuePair<,>) &&
-                    type.GetGenericTypeDefinition() == typeof(IEnumerable<>))
-                {
-                    Type keyValuePairType = type.GetGenericArguments()[0];
-                    this.keyProperty = keyValuePairType.GetProperty("Key");
-                    this.valueProperty = keyValuePairType.GetProperty("Value");
-                    this.getEnumeratorMethod = type.GetMethod("GetEnumerator");
-                    return true;
-                }
-                if (type.IsGenericType &&
-                    type.GetGenericArguments()[0].IsGenericType &&
-                    type.GetGenericArguments()[0].GetGenericTypeDefinition() == typeof(KeyValuePair<,>) &&
-                    type.GetGenericTypeDefinition() == typeof(ICollection<>))
-                {
-                    this.isReadOnlyProperty = type.GetProperty("IsReadOnly");
-                    this.countProperty = type.GetProperty("Count");
-                    this.clearMethod = type.GetMethod("Clear");
-                }
-                return false;
-            }
-
-
-            public void Add(object key, object value)
-            {
-                if (this.isDictionary)
-                {
-                    ((IDictionary)instance).Add(key, value);
-                }
-                else
-                {
-                    this.addMethod.Invoke(this.instance, new object[] { key, value });
-                }
-            }
-
-            public void Clear()
-            {
-                if (this.isDictionary)
-                {
-                    ((IDictionary)instance).Clear();
-                }
-                else
-                {
-                    this.clearMethod.Invoke(this.instance, null);
-                }
-            }
-
-            public IEnumerator GetEnumerator()
-            {
-                if (this.isDictionary)
-                {
-                    return ((IDictionary)instance).GetEnumerator();
-                }
-                else
-                {
-                    return (IEnumerator)this.getEnumeratorMethod.Invoke(this.instance, null);
-                }
-            }
-
-            public void Remove(object key)
-            {
-                if (this.isDictionary)
-                {
-                    ((IDictionary)instance).Remove(key);
-                }
-                else
-                {
-                    this.removeMethod.Invoke(this.instance, new object[] { key });
-                }
-            }
-
-
-        }
-
-        AttributeCollection ICustomTypeDescriptor.GetAttributes()
-        {
-            return this.Attributes;
-        }
-
-        string ICustomTypeDescriptor.GetClassName()
-        {
-            return TypeDescriptor.GetClassName(this);
-        }
-
-        string ICustomTypeDescriptor.GetComponentName()
-        {
-            return TypeDescriptor.GetComponentName(this);
-        }
-
-        TypeConverter ICustomTypeDescriptor.GetConverter()
-        {
-            return ModelUtilities.GetConverter(this);
-        }
-
-        EventDescriptor ICustomTypeDescriptor.GetDefaultEvent()
-        {
-            // we dont support events;
-            return null;
-        }
-
-        PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty()
-        {
-            return ModelUtilities.GetDefaultProperty(this);
-        }
-
-        object ICustomTypeDescriptor.GetEditor(Type editorBaseType)
-        {
-            // we dont support editors
-            return null;
-        }
-
-        EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes)
-        {
-            // we dont support events;
-            return null;
-        }
-
-        EventDescriptorCollection ICustomTypeDescriptor.GetEvents()
-        {
-            // we dont support events;
-            return null;
-        }
-
-        PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
-        {
-            return ModelUtilities.WrapProperties(this);
-        }
-
-        PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties()
-        {
-            // get model properties
-            List<PropertyDescriptor> properties = new List<PropertyDescriptor>();
-
-
-            foreach (PropertyDescriptor modelPropertyDescriptor in ModelUtilities.WrapProperties(this))
-            {
-                properties.Add(modelPropertyDescriptor);
-            }
-
-            // try to see if there are pseudo builtin properties for this type.
-            AttachedPropertiesService AttachedPropertiesService = this.modelTreeManager.Context.Services.GetService<AttachedPropertiesService>();
-            if (AttachedPropertiesService != null)
-            {
-                foreach (AttachedProperty AttachedProperty in AttachedPropertiesService.GetAttachedProperties(this.itemType))
-                {
-                    properties.Add(new AttachedPropertyDescriptor(AttachedProperty, this));
-                }
-            }
-            return new PropertyDescriptorCollection(properties.ToArray(), true);
-        }
-
-        object ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor pd)
-        {
-            return this;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemExtensions.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemExtensions.cs
deleted file mode 100644 (file)
index 8b51da5..0000000
+++ /dev/null
@@ -1,1028 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Model
-{
-    using System;
-    using System.Activities.Debugger;
-    using System.Activities.Presentation.Annotations;
-    using System.Activities.Presentation.Services;
-    using System.Activities.Presentation.View;
-    using System.Collections.Generic;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Linq;
-    using System.Runtime;
-    using System.Text;
-    using System.Windows;
-    using System.Windows.Input;
-    using System.Windows.Threading;
-
-    public static class ModelItemExtensions
-    {
-        const int MaxExpandLevel = 50;
-        const string rootPath = "Root";
-
-        public static EditingContext GetEditingContext(this ModelItem modelItem)
-        {
-            EditingContext result = null;
-            IModelTreeItem modelTreeItem = modelItem as IModelTreeItem;
-            if (null != modelTreeItem && null != modelTreeItem.ModelTreeManager)
-            {
-                result = modelTreeItem.ModelTreeManager.Context;
-            }
-            return result;
-        }
-
-        internal static ModelItem FindParentModelItem(this ModelItem item, Type parentType)
-        {
-            if (null == item)
-            {
-                throw FxTrace.Exception.ArgumentNull("item");
-            }
-            if (null == parentType)
-            {
-                throw FxTrace.Exception.ArgumentNull("parentType");
-            }
-
-            ModelItem result = null;
-            item = item.Parent;
-            while (item != null && !parentType.IsAssignableFrom(item.ItemType))
-            {
-                item = item.Parent;
-            }
-            if (null != item && parentType.IsAssignableFrom(item.ItemType))
-            {
-                result = item;
-            }
-            return result;
-        }
-
-        internal static bool SwitchKeys(this ModelItemDictionary dictionary, ModelItem oldKey, ModelItem newKey)
-        {
-            if (null == dictionary)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("dictionary"));
-            }
-            if (null == oldKey)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("oldKey"));
-            }
-            if (null == newKey)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("newKey"));
-            }
-            if (!dictionary.ContainsKey(oldKey))
-            {
-                throw FxTrace.Exception.AsError(new KeyNotFoundException(null == oldKey.GetCurrentValue() ? "oldKey" : oldKey.GetCurrentValue().ToString()));
-            }
-            bool result = false;
-            if (!dictionary.ContainsKey(newKey))
-            {
-                ModelItem value = dictionary[oldKey];
-                dictionary.Remove(oldKey);
-                dictionary[newKey] = value;
-                result = true;
-            }
-            return result;
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters",
-           Justification = "This is a TryGet pattern that requires out parameters")]
-        internal static bool SwitchKeys(this ModelItemDictionary dictionary, object oldKey, object newKey, out ModelItem newKeyItem)
-        {
-            if (null == dictionary)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("dictionary"));
-            }
-            if (null == oldKey)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("oldKey"));
-            }
-            if (null == newKey)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("newKey"));
-            }
-            if (!dictionary.ContainsKey(oldKey))
-            {
-                throw FxTrace.Exception.AsError(new KeyNotFoundException(oldKey.ToString()));
-            }
-            bool result = false;
-            newKeyItem = null;
-            if (typeof(ModelItem).IsAssignableFrom(oldKey.GetType()) && typeof(ModelItem).IsAssignableFrom(newKey.GetType()))
-            {
-                result = SwitchKeys(dictionary, (ModelItem)oldKey, (ModelItem)newKey);
-                newKeyItem = (ModelItem)newKey;
-            }
-            else
-            {
-                if (typeof(ModelItem).IsAssignableFrom(oldKey.GetType()))
-                {
-                    oldKey = ((ModelItem)oldKey).GetCurrentValue();
-                    if (null == oldKey)
-                    {
-                        throw FxTrace.Exception.AsError(new InvalidOperationException("((ModelItem)oldKey).GetCurrentValue()"));
-                    }
-                }
-                if (typeof(ModelItem).IsAssignableFrom(newKey.GetType()))
-                {
-                    newKey = ((ModelItem)newKey).GetCurrentValue();
-                    if (null == newKey)
-                    {
-                        throw FxTrace.Exception.AsError(new InvalidOperationException("((ModelItem)newKey).GetCurrentValue()"));
-                    }
-                }
-            }
-            if (!dictionary.ContainsKey(newKey))
-            {
-                ModelItem value = dictionary[oldKey];
-                dictionary.Remove(oldKey);
-                dictionary[newKey] = value;
-                newKeyItem = dictionary.Keys.First<ModelItem>(p => object.Equals(p.GetCurrentValue(), newKey));
-                result = true;
-            }
-            return result;
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters",
-           Justification = "This is a TryGet pattern that requires out parameters")]
-        internal static bool TryGetPropertyValue(this ModelItem item, out ModelItemCollection value, params string[] path)
-        {
-            ModelItem temp;
-            value = null;
-            bool result = TryGetPropertyValue(item, out temp, path);
-            if (null != item)
-            {
-                value = (ModelItemCollection)temp;
-            }
-            return result;
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters",
-           Justification = "This is a TryGet pattern that requires out parameters")]
-        internal static bool TryGetPropertyValue(this ModelItem item, out ModelItemDictionary value, params string[] path)
-        {
-            ModelItem temp;
-            value = null;
-            bool result = TryGetPropertyValue(item, out temp, path);
-            if (null != item)
-            {
-                value = (ModelItemDictionary)temp;
-            }
-            return result;
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters",
-           Justification = "This is a TryGet pattern that requires out parameters")]
-        internal static bool TryGetPropertyValue(this ModelItem item, out ModelItem value, params string[] path)
-        {
-            if (null == item)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("item"));
-            }
-            if (null == path)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("path"));
-            }
-            if (path.Length < 1)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException(SR.ModelItemPathArrayShouldNotBeEmpty));
-            }
-            value = item;
-            bool result = true;
-            for (int i = 0; i < path.Length && true == result && null != value; ++i)
-            {
-                ModelProperty property = value.Properties[path[i]];
-                if (null != property)
-                {
-                    value = property.Value;
-                    if (null == value)
-                    {
-                        result = false;
-                    }
-                }
-                else
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, SR.PropertyDoesntExistFormatString, path[i])));
-                }
-            }
-            return result;
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters",
-           Justification = "This is a TryGet pattern that requires out parameters")]
-        internal static bool TrySetPropertyValue(this ModelItem item, object value, out ModelItem wrappedValue, params string[] path)
-        {
-            if (null == item)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("item"));
-            }
-            if (null == path)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("path"));
-            }
-            if (path.Length < 1)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException(SR.ModelItemPathArrayShouldNotBeEmpty));
-            }
-            wrappedValue = null;
-            bool result = true;
-            for (int i = 0; i < path.Length && true == result; ++i)
-            {
-                ModelProperty property = item.Properties[path[i]];
-                if (null != property)
-                {
-                    if (i == path.Length - 1)
-                    {
-                        if (null != value)
-                        {
-                            wrappedValue = property.SetValue(value);
-                        }
-                        else
-                        {
-                            property.ClearValue();
-                        }
-                    }
-                    else
-                    {
-                        item = property.Value;
-                        if (null == item)
-                        {
-                            result = false;
-                        }
-                    }
-                }
-                else
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, SR.PropertyDoesntExistFormatString, path[i])));
-                }
-            }
-            return result;
-        }
-
-        internal static bool HasAnnotation(this ModelItem modelItem)
-        {
-            Fx.Assert(modelItem != null, "modelItem should not be null.");
-
-            ModelProperty property = modelItem.Properties.Find(Annotation.AnnotationTextPropertyName);
-
-            Fx.Assert(property != null, "Annotation property should not be null");
-
-            if (property.ComputedValue == null)
-            {
-                return false;
-            }
-
-            return true;
-        }
-
-        public static string GetModelPath(this ModelItem modelItem)
-        {
-            if (modelItem == null)
-            {
-                return null;
-            }
-            StringBuilder sb = new StringBuilder();
-            bool isValid = true;
-            HashSet<ModelItem> visited = new HashSet<ModelItem>();
-            // walk up the parent chain and create a modelpath from reverse
-            // eg. Root.Foo.Bar.Collectionproperty[3].----
-
-            // if modelItem doesn't have parent and it's not root, return string.Empty;
-            if (modelItem.Parent == null && modelItem.Root != modelItem)
-            {
-                return null;
-            }
-
-            while (modelItem != null)
-            {
-                // paths causing us to get into loops are invalid.
-                if (visited.Contains(modelItem))
-                {
-                    isValid = false;
-                    break;
-                }
-                // remember the visited.
-                visited.Add(modelItem);
-                // if parent is collection store just the index
-                if (modelItem.Parent is ModelItemCollection)
-                {
-                    sb.Insert(0, "[" + ((ModelItemCollection)modelItem.Parent).IndexOf(modelItem).ToString(CultureInfo.InvariantCulture) + "]");
-                }
-                // if parent is a modelproperty store the property name
-                else if (modelItem.Source != null)
-                {
-                    sb.Insert(0, "." + modelItem.Source.Name);
-                }
-                //Our model path doesnt work with dictionaries, so in dictionary case follow the mutablekeyvaluepair 
-                if (modelItem.Parent is ModelItemDictionary)
-                {
-                    if (modelItem.Source != null)
-                    {
-                        modelItem = modelItem.Source.Parent;
-                    }
-                    else
-                    {
-                        isValid = false;
-                        break;
-                    }
-                } // when parent is not a dictionary follow the parent up towards the root.
-                else
-                {
-                    modelItem = modelItem.Parent;
-                }
-            }
-            string s = null;
-            if (isValid)
-            {
-                sb.Insert(0, rootPath);
-                s = sb.ToString();
-            }
-            return s;
-        }
-
-        public static ModelItem GetModelItemFromPath(string path, ModelItem root)
-        {
-            if (null == root)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("root"));
-            }
-            if (null == path)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("path"));
-            }
-            ModelItem foundModelItem = null;
-            path = path.Trim();
-            string[] segments = path.Split('.');
-            // process each path. path should atleast be 'Root' and should always  begin with 'Root'
-            if (segments.Length > 0 && segments[0] == rootPath)
-            {
-                foundModelItem = root;
-                for (int segmentIndex = 1; segmentIndex < segments.Length; segmentIndex++)
-                {
-                    string segment = segments[segmentIndex];
-                    if (!string.IsNullOrEmpty(segment))
-                    {
-                        ModelItem next = GetModelItemFromSegment(foundModelItem, segment);
-                        if (next != null)
-                        {
-                            foundModelItem = next;
-                        }
-                        else
-                        {
-                            foundModelItem = null;
-                            break;
-                        }
-                    }
-                    else
-                    {
-                        foundModelItem = null;
-                        break;
-                    }
-                }
-            }
-            return foundModelItem;
-        }
-
-        private static ModelItem GetModelItemFromSegment(ModelItem currentModelItem, string segment)
-        {
-            ModelItem modelItemFromSegment = null;
-            int indexOfSquareBrackets = segment.IndexOf('[');
-            // e.g Sequence.Activities[0] segment = "Activities[0]"
-            if (indexOfSquareBrackets > 0)
-            {
-                string collectionProperty = segment.Substring(0, indexOfSquareBrackets);
-                // find the value of the collection property
-                ModelItemCollection segmentCollection = GetModelItemFromSegment(currentModelItem, collectionProperty) as ModelItemCollection;
-                if (segmentCollection != null)
-                {
-                    try
-                    {
-                        // parse the [index] to find the index
-                        string indexString = segment.Substring(indexOfSquareBrackets + 1);
-                        indexString = indexString.Substring(0, indexString.Length - 1);
-                        int index = Int32.Parse(indexString, CultureInfo.InvariantCulture);
-                        if (index >= 0 && index < segmentCollection.Count)
-                        {
-                            // now index into the collection
-                            modelItemFromSegment = segmentCollection[index];
-                        }
-                    }
-                    // dont crash ever.
-                    catch (FormatException)
-                    {
-                    }
-                    catch (OverflowException)
-                    {
-                    }
-                }
-            }
-            // e.g SomeFoo.Then segment = "Then"
-            else
-            {
-                ModelProperty property = currentModelItem.Properties[segment];
-                if (property != null)
-                {
-                    modelItemFromSegment = property.Value;
-                }
-            }
-            return modelItemFromSegment;
-        }
-
-        internal static IEnumerable<ModelItem> GetParentEnumerator(this ModelItem item)
-        {
-            return ModelItemExtensions.GetParentEnumerator(item, null);
-        }
-
-        internal static IEnumerable<ModelItem> GetParentEnumerator(this ModelItem item, Func<ModelItem, bool> continueEnumerationPredicate)
-        {
-            if (null == item)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("item"));
-            }
-            while (null != item.Parent)
-            {
-                if (null != continueEnumerationPredicate && !continueEnumerationPredicate(item.Parent))
-                {
-                    break;
-                }
-                yield return item.Parent;
-                item = item.Parent;
-            }
-            yield break;
-        }
-
-        internal static string GetUniqueName(this ModelItemCollection collection, string nameDefaultPrefix, Func<ModelItem, string> nameGetter)
-        {
-            return collection.GetUniqueName<ModelItem>(nameDefaultPrefix, nameGetter);
-        }
-
-        internal static string GetUniqueName(this ModelItemDictionary dictionary, string nameDefaultPrefix, Func<ModelItem, string> nameGetter)
-        {
-            if (dictionary != null)
-            {
-                return dictionary.Keys.GetUniqueName(nameDefaultPrefix, nameGetter);
-            }
-            else
-            {
-                throw FxTrace.Exception.ArgumentNull("dictionary");
-            }
-        }
-
-        internal static string GetUniqueName<T>(this IEnumerable<T> collection, string nameDefaultPrefix, Func<T, string> nameGetter)
-        {
-            if (null == collection)
-            {
-                throw FxTrace.Exception.ArgumentNull("collection");
-            }
-            if (null == nameDefaultPrefix)
-            {
-                throw FxTrace.Exception.ArgumentNull("nameDefaultPrefix");
-            }
-            if (nameDefaultPrefix.Length == 0)
-            {
-                throw FxTrace.Exception.Argument("nameDefaultPrefix", "length == 0");
-            }
-            if (null == nameGetter)
-            {
-                throw FxTrace.Exception.ArgumentNull("nameGetter");
-            }
-
-            var maxId = (int?)collection
-                .Where(p =>
-                {
-                    var value = nameGetter(p);
-                    if (null != value)
-                    {
-                        return (0 == string.Compare(value, 0, nameDefaultPrefix, 0, nameDefaultPrefix.Length, CultureInfo.CurrentCulture, CompareOptions.None));
-                    }
-                    return false;
-                })
-                .Select(p =>
-                {
-                    int result = 0;
-                    return (int.TryParse(nameGetter(p).Substring(nameDefaultPrefix.Length), out result))
-                        ? result : 0;
-                })
-                .OrderByDescending(p => p)
-                .FirstOrDefault();
-
-            int id = maxId.HasValue ? maxId.Value + 1 : 1;
-
-            return string.Format(CultureInfo.CurrentCulture, "{0}{1}", nameDefaultPrefix, id);
-        }
-
-        internal static bool IsAssignableFrom<T>(this ModelItem item) where T : class
-        {
-            if (null == item)
-            {
-                throw FxTrace.Exception.ArgumentNull("item");
-            }
-
-            return typeof(T).IsAssignableFrom(item.ItemType);
-        }
-
-        internal static Activity GetRootActivity(this ModelItem item)
-        {
-            Object root = item.GetCurrentValue();
-            if (root is IDebuggableWorkflowTree)
-            {
-                return ((IDebuggableWorkflowTree)root).GetWorkflowRoot();
-            }
-            else
-            {
-                return root as Activity;
-            }
-        }
-
-        public static bool IsParentOf(this ModelItem item, ModelItem child)
-        {
-            if (null == item)
-            {
-                throw FxTrace.Exception.ArgumentNull("item");
-            }
-            if (null == child)
-            {
-                throw FxTrace.Exception.ArgumentNull("child");
-            }
-
-            bool isParent = false;
-            child.GetParentEnumerator(p => { isParent = ModelItem.Equals(p, item); return !isParent; }).LastOrDefault();
-            return isParent;
-        }
-
-        public static void Focus(this ModelItem item)
-        {
-            Focus(item, MaxExpandLevel);
-        }
-
-        internal static void Highlight(this ModelItem item)
-        {
-            ModelItemFocusHelper.Focus(item, MaxExpandLevel, false, Rect.Empty);
-        }
-
-        internal static void Highlight(this ModelItem item, Rect rectToBringIntoView)
-        {
-            ModelItemFocusHelper.Focus(item, MaxExpandLevel, false, rectToBringIntoView);
-        }
-
-        public static void Focus(this ModelItem item, int level)
-        {
-            if (null == item)
-            {
-                throw FxTrace.Exception.ArgumentNull("item");
-            }
-            if (level < 1)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentOutOfRangeException("level"));
-            }
-            ModelItemFocusHelper.Focus(item, level);
-        }
-
-        internal static ModelItem FindParent(this ModelItem item, Predicate<ModelItem> predicate)
-        {
-            ModelItem parent = item.Parent;
-
-            while (parent != null && !predicate(parent))
-            {
-                parent = parent.Parent;
-            }
-
-            return parent;
-        }
-
-        private sealed class ModelItemFocusHelper
-        {
-            static ModelItemFocusHelper focusTicket = null;
-
-            ModelItem itemToFocus;
-            int currentLevel;
-            bool shouldAbort = false;
-
-            EditingContext context;
-            VirtualizedContainerService containerService;
-            WorkflowViewService viewService;
-            DesignerView designerView;
-            ModelItem[] itemsToExpand;
-            bool shouldGetKeyboardFocus;
-            Rect rectToBringIntoView;
-
-            EditingContext Context
-            {
-                get
-                {
-                    if (null == this.context)
-                    {
-                        this.context = this.itemToFocus.GetEditingContext();
-                    }
-                    return this.context;
-                }
-            }
-            VirtualizedContainerService ContainerService
-            {
-                get
-                {
-                    if (null == this.containerService)
-                    {
-                        this.containerService = this.Context.Services.GetService<VirtualizedContainerService>();
-                    }
-                    return this.containerService;
-                }
-            }
-            WorkflowViewService ViewService
-            {
-                get
-                {
-                    if (null == this.viewService)
-                    {
-                        this.viewService = (WorkflowViewService)this.Context.Services.GetService<ViewService>();
-                    }
-                    return this.viewService;
-                }
-            }
-            DesignerView DesignerView
-            {
-                get
-                {
-                    if (null == this.designerView)
-                    {
-                        this.designerView = this.Context.Services.GetService<DesignerView>();
-                    }
-                    return this.designerView;
-                }
-            }
-
-            Action<VirtualizedContainerService.VirtualizingContainer> onContainerPopulatingDelegate;
-            Action<ModelItem> onElementFocusingDelegate;
-            Action<Visibility> onSetDesignerContentVisibilityDelegate;
-            Action onForceElementFocusDelegate;
-
-
-            private ModelItemFocusHelper(ModelItem itemToFocus, int maxExpandLevel, bool shouldGetKeyboardFocus, Rect rectToBringIntoView)
-            {
-                this.itemToFocus = itemToFocus;
-                this.currentLevel = maxExpandLevel;
-                this.onContainerPopulatingDelegate = this.OnPopulateContainer;
-                this.onElementFocusingDelegate = this.OnFocusElement;
-                this.onSetDesignerContentVisibilityDelegate = this.ChangeDesignerViewVisibility;
-                this.onForceElementFocusDelegate = this.OnForceFocusElement;
-                this.shouldGetKeyboardFocus = shouldGetKeyboardFocus;
-                this.rectToBringIntoView = rectToBringIntoView;
-            }
-
-            // Checks if a model item is rooted at a specific model item
-            static bool IsRootedAt(ModelItem item, ModelItem root)
-            {
-                Fx.Assert(item != null, "item must not be null");
-                Fx.Assert(root != null, "root must not be null");
-                ModelItem currentItem = item;
-                while (currentItem.Parent != null)
-                {
-                    currentItem = currentItem.Parent;
-                }
-                return currentItem == root;
-            }
-
-            public static void Focus(ModelItem itemToFocus, int maxExpandLevel)
-            {
-                Focus(itemToFocus, maxExpandLevel, true);
-            }
-
-            internal static void Focus(ModelItem itemToFocus, int maxExpandLevel, bool shouldGetKeyboardFocus)
-            {
-                Focus(itemToFocus, maxExpandLevel, shouldGetKeyboardFocus, Rect.Empty);
-            }
-
-            internal static void Focus(ModelItem itemToFocus, int maxExpandLevel, bool shouldGetKeyboardFocus, Rect rectToBringIntoView)
-            {
-                // Check if this model item exist in the model tree
-                IModelTreeItem modelTreeItem = itemToFocus as IModelTreeItem;
-                if (modelTreeItem != null)
-                {
-                    // If this model item doesn't exist in the tree, don't do anything,
-                    //  chances are it's an activity that has been deleted.
-                    if (!IsRootedAt(itemToFocus, modelTreeItem.ModelTreeManager.Root) && !(itemToFocus is FakeModelItemImpl))
-                    {
-                        return;
-                    }
-                }
-
-                //if there is another focus operation in progress, mark it so it would abort itself on next OnContextIdle processing - 
-                //we don't want to multiple elements racing for keyboard focus
-                if (null != focusTicket)
-                {
-                    focusTicket.shouldAbort = true;
-                }
-                //create new focus ticket
-                focusTicket = new ModelItemFocusHelper(itemToFocus, maxExpandLevel, shouldGetKeyboardFocus, rectToBringIntoView);
-                //and start its processing as soon as application gets idle
-                Dispatcher.CurrentDispatcher.BeginInvoke(new Action<ModelItemFocusHelper>((p) => { p.Focus(); }), DispatcherPriority.ContextIdle, focusTicket);
-            }
-
-            // Entry point method for setting focus.
-            // it is executed exactly once, on application idle event
-            // there are 3 basic paths:
-            // a) optimistic - element we are looking for, is visible - i bring it into view and set keyboard focus to it
-            // b) unlikely - element doesn't have any visual parents - i make it a root designer, wait for it to load and set keyboard focus to it
-            // c) pesimistic/complex - element isn't in the view, moreover, it is located in a tree branch which is not (or is partialy) visible
-            void Focus()
-            {
-                //can i continue?
-                if (shouldAbort)
-                {
-                    return;
-                }
-
-                //hide the designer view until focus is set
-                this.onSetDesignerContentVisibilityDelegate(Visibility.Hidden);
-                //delegate visibility restore for designer view after focus update is complete
-                Dispatcher.CurrentDispatcher.BeginInvoke(this.onSetDesignerContentVisibilityDelegate, DispatcherPriority.ApplicationIdle, Visibility.Visible);
-
-                //set selection to the item to focus, so all apropriate designers get a chance to update themselfs before we start expanding - this may 
-                //result in visual tree change
-                Selection.SelectOnly(this.Context, this.itemToFocus);
-
-                //easy path - if the current designer is available and visible - bring it to view and focus
-                if (null != this.itemToFocus.View && ((UIElement)this.itemToFocus.View).IsVisible)
-                {
-                    this.onElementFocusingDelegate(this.itemToFocus);
-                    return;
-                }
-
-                //get items up to the tree root, which can be visualized (have associated designer)
-                //include only up to "level" items (avoid expanding whole tree)                
-                bool shouldContinue = true;
-                int visualItemsCount = 0;
-                var visualItems = this.itemToFocus
-                    .GetParentEnumerator(p => shouldContinue)
-                    .Where(p =>
-                    {
-                        //filter only items with designer attribute 
-                        bool result = false;
-                        var designerType = this.ViewService.GetDesignerType(p.ItemType);
-                        if (null != designerType)
-                        {
-                            result = true;
-                            visualItemsCount++;
-                            //if designer has Options attribute, check if it always collapsed children - if so, this will be the topmost parent
-                            //(displaying anything above, will never display its children)
-                            var options = WorkflowViewService.GetAttribute<ActivityDesignerOptionsAttribute>(designerType);
-                            if (null != options && options.AlwaysCollapseChildren && visualItemsCount > 2)
-                            {
-                                shouldContinue = false;
-                            }
-                        }
-                        return result;
-                    })
-                    .Take(this.currentLevel)
-                    .ToArray();
-
-
-
-                //nothing to expand, rather unlikely, but handle it anyway
-                if (visualItems.Length == 0)
-                {
-                    //reset ticket, to prevent any further calls from executing
-                    ModelItemFocusHelper.focusTicket = null;
-                    //force item to be root designer (this is last resort, it is executed only if focusTicket is null)
-                    this.onForceElementFocusDelegate();
-                    return;
-                }
-
-                //get the first parent of an item, which is visible 
-                var firstVisibleItem = visualItems.FirstOrDefault(p => null != p.View && ((UIElement)p.View).IsVisible);
-
-                bool enqueueFirstExpand = false;
-
-                //is there anything visible in the path between item and its parents?
-                if (null != firstVisibleItem)
-                {
-                    //yes - limit the amount of items to expand to only designers which are not visible yet 
-                    //(include the first visible designer, so algorithm can have a start point with something visible)
-                    this.itemsToExpand = visualItems.TakeWhile(p => firstVisibleItem != p).Concat(new ModelItem[] { firstVisibleItem }).ToArray();
-                }
-                else
-                {
-                    //no, nothing is visible yet
-                    this.itemsToExpand = visualItems;
-                    enqueueFirstExpand = true;
-                    //make the top most parent as root designer
-                    this.DesignerView.MakeRootDesigner(this.itemsToExpand[this.itemsToExpand.Length - 1], false);
-                }
-                //delegate Expand call - if nothing is visible yet - onIdle - give new designer time to fully render, if someting is visible - execute immediatelly
-                Dispatcher.CurrentDispatcher.BeginInvoke(new Action(() => { this.Expand(null); }), enqueueFirstExpand ? DispatcherPriority.ContextIdle : DispatcherPriority.Send);
-            }
-
-            //Expand method is executed repeatadly until maximum expand level is reached. it iterates through the model item tree 
-            //(from child up to MaximumExpandLevel parents) and tries to find first visible designer and populate it with content
-            //If one elemnt is visited twice (denoted by currentItem argument) it means that expansion failed - (i.e. element is collapsed),
-            //so i try to set that element as root designer and restart algoritm with that designer beeing new root
-            void Expand(ModelItem currentItem)
-            {
-                //can i continue?
-                if (this.shouldAbort)
-                {
-                    return;
-                }
-
-                //stop condition - prevents infinite loop (the method is delegated into dispatcher, so it would never cause stack overflow
-                if (0 > this.currentLevel)
-                {
-                    ModelItemFocusHelper.focusTicket = null;
-                    return;
-                }
-
-                //browse direct parents, and Populate the fist one which is visible
-                for (int index = 0; null != this.itemsToExpand && index < this.itemsToExpand.Length; ++index)
-                {
-                    //is given parent visible? (it would return container for given model item)
-                    var container = this.ContainerService.QueryContainerForItem(this.itemsToExpand[index]);
-
-                    if (null != container)
-                    {
-                        //check if container we are trying to expand is not the same as the one in previous iteration 
-                        //if it isn't --> populate its content
-                        if (!ModelItem.Equals(currentItem, this.itemsToExpand[index]))
-                        {
-                            this.Populate(container);
-                            return;
-                        }
-                        //if it is --> it means it is collapsed and further expand doesn't make sense. 
-                        else if (null != currentItem)
-                        {
-                            int j = 0;
-                            //get index of item which we've tried to expand recently
-                            for (; j < this.itemsToExpand.Length; ++j)
-                            {
-                                if (ModelItem.Equals(this.itemsToExpand[j], currentItem))
-                                {
-                                    break;
-                                }
-                            }
-                            //starting at that point, see if given item can be a breadcrumb root
-                            for (int skipLevel = 0; j >= 0; --j)
-                            {
-                                currentItem = this.itemsToExpand[j];
-                                //if it can - make it a new breadcrumb root and restart
-                                if (this.viewService.ShouldAppearOnBreadCrumb(currentItem, true))
-                                {
-                                    //make that designer a new root (don't set selection)
-                                    this.DesignerView.MakeRootDesigner(currentItem, false);
-                                    //and try to set focus with less maximum expand level, assuming that current designer is now expanded
-                                    ModelItemFocusHelper.Focus(this.itemToFocus, this.currentLevel - skipLevel, this.shouldGetKeyboardFocus);
-                                    return;
-                                }
-                                ++skipLevel;
-                            }
-                            //nothing in parent list can be made a breadcrumb, try set item which is supposed to get focus as a root 
-                            if (this.viewService.ShouldAppearOnBreadCrumb(this.itemToFocus, true))
-                            {
-                                this.DesignerView.MakeRootDesigner(this.itemToFocus, false);
-                                ModelItemFocusHelper.Focus(this.itemToFocus, 1, this.shouldGetKeyboardFocus);
-                                return;
-                            }
-                            //the item we want to set focus to, also cannot be displayed as root;
-                            //at this point - simply set selection to the current item, check if visibility has changed due to selection change
-                            this.Context.Items.SetValue(new Selection(currentItem));
-                            Dispatcher.CurrentDispatcher.BeginInvoke(this.onElementFocusingDelegate, DispatcherPriority.ContextIdle, currentItem);
-                            //the final check - if item is still not visible, force it to be 
-                            Dispatcher.CurrentDispatcher.BeginInvoke(this.onForceElementFocusDelegate, DispatcherPriority.ContextIdle);
-                            return;
-                        }
-                    }
-                }
-                ModelItemFocusHelper.focusTicket = null;
-                //if we end up here and itemsToExpand is not null - something is wrong...
-                //it is possible that algorithm stops here and itemsToExpand is null - this would be scenario when user tries to set focus to model item which cannot be
-                //visualized and doesn't have any visual parent - i.e. Service or ActivityBuilder (they have a child property Body which can be visualized, but themselves - are not)
-                if (null != this.itemsToExpand)
-                {
-                    var displayProperty = this.itemToFocus.Properties["DisplayName"];
-                    var displayName = displayProperty == null ? "(unknown)" : displayProperty.ComputedValue.ToString();
-                    Fx.Assert("Expand is in invalid state - we should never end up here. Item to focus: " + displayName + " (" + this.itemToFocus.ItemType.Name + ")");
-                }
-            }
-
-            //Populate method is executed by Expand method. It is supposed to bring container element into view, 
-            //find the elemennt we are looking for (or at least container which contains it). After bringing contaner into view, it delegates calls to 
-            //OnPopulateContainer (if we have virutal container) and then to OnFocusElement delegate
-            void Populate(FrameworkElement container)
-            {
-                //ensure container is in the view
-                container.BringIntoView();
-                //is it virtualized container?
-                var virtualContainer = container as VirtualizedContainerService.VirtualizingContainer;
-                var viewElement = container as WorkflowViewElement;
-                var modelItem = (null != virtualContainer ? virtualContainer.ModelItem : (viewElement != null ? viewElement.ModelItem : null));
-                var dispatchParameter = new object[] { modelItem };
-                DispatcherPriority priority = DispatcherPriority.Send;
-
-                if (null != virtualContainer)
-                {
-                    priority = DispatcherPriority.ContextIdle;
-                    //yes - ensure its content is populated
-                    virtualContainer.Populate();
-                    //wait until container content renders (delegate calls to application idle)
-                    Dispatcher.CurrentDispatcher.BeginInvoke(this.onContainerPopulatingDelegate, priority, virtualContainer);
-                }
-                //if we have a virtual contianer - we may need to drill further or simply display an element, 
-                //otherwise - just try to focus on element (it should be visible, so execute callback immediately)
-                Dispatcher.CurrentDispatcher.BeginInvoke(this.onElementFocusingDelegate, priority, dispatchParameter);
-            }
-
-            void OnPopulateContainer(VirtualizedContainerService.VirtualizingContainer virtualContainer)
-            {
-                if (this.shouldAbort)
-                {
-                    return;
-                }
-                //if this is virutal container, it might contain multiple other virtual containers - i need to find the one
-                //which either is a container for item i want to focus, or one which is parent designer for the item i'm looking for
-                //look for the container which contains or is a parent of container i look for
-                var target = virtualContainer
-                    .ChildContainers
-                    .FirstOrDefault(p => ModelItem.Equals(this.itemToFocus, p.ModelItem) || p.ModelItem.IsParentOf(this.itemToFocus));
-
-                //if one is found - populate it and bring it into view
-                if (null != target)
-                {
-                    target.Populate();
-                    target.BringIntoView();
-                }
-            }
-
-            void OnFocusElement(ModelItem currentItem)
-            {
-                if (this.shouldAbort)
-                {
-                    return;
-                }
-
-                //after virtual container is loaded and populated, check if the item i'm looking for is visible
-                if (null != this.itemToFocus.View && ((FrameworkElement)this.itemToFocus.View).IsVisible)
-                {
-                    //yes! - it is visible, bring it into view and set focus
-                    if (rectToBringIntoView != Rect.Empty)
-                    {
-                        ((FrameworkElement)this.itemToFocus.View).BringIntoView(rectToBringIntoView);
-                    }
-                    else
-                    {
-                        ((FrameworkElement)this.itemToFocus.View).BringIntoView();
-                    }
-                    if (this.shouldGetKeyboardFocus)
-                    {
-                        Keyboard.Focus(this.itemToFocus.View as IInputElement);
-                    }
-                    ModelItemFocusHelper.focusTicket = null;
-                }
-                else if (null != currentItem)
-                {
-                    //no, it still isn't visible - try to expand next level
-                    --this.currentLevel;
-                    this.Expand(currentItem);
-                }
-                else
-                {
-                    ModelItemFocusHelper.focusTicket = null;
-                    var displayProperty = this.itemToFocus.Properties["DisplayName"];
-                    var displayName = displayProperty == null ? "(unknown)" : displayProperty.ComputedValue.ToString();
-                    Fx.Assert("OnFocusElement is in invalid state - we should never get here. Item to focus: " + displayName + " (" + this.itemToFocus.ItemType.Name + ")");
-                }
-            }
-
-            void OnForceFocusElement()
-            {
-                if (this.shouldAbort)
-                {
-                    return;
-                }
-                //if we did exploit all possibilites but model item is still not visible and focused - force the lowest parent that can be made root as the root designer
-                if (null == ModelItemFocusHelper.focusTicket && (null == this.itemToFocus.View || !((UIElement)this.itemToFocus.View).IsVisible))
-                {
-                    ModelItem item = this.itemToFocus;
-                    while (item != null && !this.ViewService.ShouldAppearOnBreadCrumb(item, true))
-                    {
-                        item = item.Parent;
-                    }
-                    if (item != null)
-                    {
-                        this.DesignerView.MakeRootDesigner(item, false, false);
-                        Dispatcher.CurrentDispatcher.BeginInvoke(this.onElementFocusingDelegate, DispatcherPriority.ContextIdle, item);
-                    }
-                }
-            }
-
-            void ChangeDesignerViewVisibility(Visibility state)
-            {
-                if (!this.shouldAbort)
-                {
-                    //i can't set visibility to hidden, so in order to avoid flickering, i simply set opacity to very low value - 
-                    //visual tree is still visible, but user won't notice it.
-                    //this.DesignerView.ScrollableContent.Opacity = (state == Visibility.Visible ? 1.0 : 0.01);
-                    Mouse.OverrideCursor = (state == Visibility.Visible ? null : Cursors.Wait);
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemHelper.cs
deleted file mode 100644 (file)
index 3d87925..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System.Runtime;
-
-    internal static class ModelItemHelper
-    {
-        internal static ModelEditingScope ModelItemBeginEdit(ModelTreeManager modelTreeManager, string description, bool shouldApplyChangesImmediately)
-        {
-            if (shouldApplyChangesImmediately && modelTreeManager.Context.Services.GetService<UndoEngine>().IsBookmarkInPlace)
-            {
-                throw FxTrace.Exception.AsError(new InvalidOperationException(SR.InvalidNestedModelItemBeginEditExceptionMessage));
-            }
-
-            EditingScope editingScope = modelTreeManager.CreateEditingScope(description, shouldApplyChangesImmediately);
-
-            if (shouldApplyChangesImmediately && editingScope == null)
-            {
-                throw FxTrace.Exception.AsError(new InvalidOperationException(SR.InvalidNestedModelItemBeginEditExceptionMessage));
-            }
-
-            return editingScope;
-        }
-
-        internal static bool CanCreateImmediateEditingScope(ModelItem modelItem)
-        {
-            Fx.Assert(modelItem is IModelTreeItem, "modelItem must implement IModelTreeItem");
-
-            return ((IModelTreeItem)modelItem).ModelTreeManager.CanCreateImmediateEditingScope();
-        }
-
-        internal static void TryCreateImmediateEditingScopeAndExecute(EditingContext context, string editingScopeDescription, Action<EditingScope> modelEditingWork)
-        {
-            Fx.Assert(context != null, "context should not be null.");
-            Fx.Assert(modelEditingWork != null, "modelEditingWork should not be null.");
-
-            ModelTreeManager manager = context.Services.GetRequiredService<ModelTreeManager>();
-
-            if (manager.CanCreateImmediateEditingScope())
-            {
-                using (EditingScope editingScope = manager.CreateEditingScope(editingScopeDescription, true))
-                {
-                    modelEditingWork(editingScope);
-                }
-            }
-            else
-            {
-                modelEditingWork(null);
-            }
-        }
-
-        internal static EditingScope TryCreateImmediateEditingScope(ModelTreeManager manager, string editingScopeDescription)
-        {
-            if (manager.CanCreateImmediateEditingScope())
-            {
-                return manager.CreateEditingScope(editingScopeDescription, true);
-            }
-
-            return null;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemImpl.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemImpl.cs
deleted file mode 100644 (file)
index 8f782b9..0000000
+++ /dev/null
@@ -1,560 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System.Activities.Presentation.Services;
-    using System.Activities.Presentation.View;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Dynamic;
-    using System.Linq;
-    using System.Reflection;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Markup;
-
-
-
-    // This class provides the View facing ModelItem implementation, this works with the ModelTreeManager
-    // and keeps the xaml up to date by intercepting every change to the model properties.
-
-    class ModelItemImpl : ModelItem, IModelTreeItem, ICustomTypeDescriptor, IDynamicMetaObjectProvider
-    {
-        ModelProperty contentProperty;
-        object instance;
-        Type itemType;
-        Dictionary<string, ModelItem> modelPropertyStore;
-        ModelTreeManager modelTreeManager;
-        ModelProperty nameProperty;
-        internal ObservableCollection<ModelItem> parents;
-        ReadOnlyObservableCollection<ModelItem> internalParents;
-        ModelPropertyCollectionImpl properties;
-        ObservableCollection<ModelProperty> sources;
-        ModelTreeItemHelper helper;
-        ReadOnlyObservableCollection<ModelProperty> internalSources;
-        List<ModelItem> subTreeNodesThatNeedBackLinkPatching;
-        DependencyObject view;
-        ModelItem manuallySetParent;
-
-
-        public ModelItemImpl(ModelTreeManager modelTreeManager, Type itemType, object instance, ModelItem parent)
-        {
-            this.itemType = itemType;
-            this.instance = instance;
-            this.modelTreeManager = modelTreeManager;
-            this.parents = new ObservableCollection<ModelItem>();
-            this.internalParents = new ReadOnlyObservableCollection<ModelItem>(parents);
-            this.sources = new ObservableCollection<ModelProperty>();
-            this.helper = new ModelTreeItemHelper();
-            this.internalSources = new ReadOnlyObservableCollection<ModelProperty>(sources);
-            if (parent != null)
-            {
-                this.manuallySetParent = parent;
-            }
-            this.modelPropertyStore = new Dictionary<string, ModelItem>();
-            this.subTreeNodesThatNeedBackLinkPatching = new List<ModelItem>();
-        }
-
-
-
-        public override event PropertyChangedEventHandler PropertyChanged;
-
-        public override global::System.ComponentModel.AttributeCollection Attributes
-        {
-            get
-            {
-                return TypeDescriptor.GetAttributes(itemType);
-            }
-        }
-
-        public override ModelProperty Content
-        {
-            get
-            {
-
-                if (this.contentProperty == null)
-                {
-                    Fx.Assert(this.instance != null, "instance should not be null");
-
-                    ContentPropertyAttribute contentAttribute = TypeDescriptor.GetAttributes(this.instance)[typeof(ContentPropertyAttribute)] as ContentPropertyAttribute;
-                    if (contentAttribute != null && !String.IsNullOrEmpty(contentAttribute.Name))
-                    {
-                        this.contentProperty = this.Properties.Find(contentAttribute.Name);
-                    }
-                }
-                return contentProperty;
-            }
-        }
-
-        public override Type ItemType
-        {
-            get
-            {
-                return this.itemType;
-            }
-        }
-
-        public ModelItem ModelItem
-        {
-            get
-            {
-                return this;
-            }
-        }
-
-        public override string Name
-        {
-            get
-            {
-                string name = null;
-                if ((this.NameProperty != null) && (this.NameProperty.Value != null))
-                {
-                    name = (string)this.NameProperty.Value.GetCurrentValue();
-                }
-                return name;
-            }
-            set
-            {
-                if (this.NameProperty != null)
-                {
-                    this.NameProperty.SetValue(value);
-                }
-            }
-        }
-
-        public override ModelItem Parent
-        {
-            get
-            {
-                return (this.Parents.Count() > 0) ? this.Parents.First() : null;
-            }
-
-        }
-
-        public override ModelPropertyCollection Properties
-        {
-            get
-            {
-                if (this.properties == null)
-                {
-                    properties = new ModelPropertyCollectionImpl(this);
-                }
-                return properties;
-            }
-        }
-
-        public override ModelItem Root
-        {
-            get
-            {
-                return this.modelTreeManager.Root;
-            }
-        }
-
-
-        // This holds a reference to the modelproperty that is currently holding this ModelItem.
-        public override ModelProperty Source
-        {
-            get
-            {
-                return (this.sources.Count > 0) ? this.sources.First() : null;
-            }
-        }
-
-        public override DependencyObject View
-        {
-            get
-            {
-                return this.view;
-            }
-        }
-
-        public override IEnumerable<ModelItem> Parents
-        {
-            get
-            {
-                if (this.manuallySetParent != null)
-                {
-                    List<ModelItem> list = new List<ModelItem>();
-                    list.Add(this.manuallySetParent);
-                    return list.Concat(this.parents).Concat(
-                        from source in this.sources
-                        select source.Parent);
-                }
-
-                return this.parents.Concat(
-                    from source in this.sources
-                    select source.Parent);
-            }
-        }
-
-        internal ReadOnlyObservableCollection<ModelItem> InternalParents
-        {
-            get
-            {
-                return internalParents;
-            }
-        }
-
-        public override IEnumerable<ModelProperty> Sources
-        {
-            get
-            {
-                return this.sources;
-            }
-        }
-
-        internal ReadOnlyObservableCollection<ModelProperty> InternalSources
-        {
-            get
-            {
-                return internalSources;
-            }
-        }
-
-        protected ModelProperty NameProperty
-        {
-            get
-            {
-                if (this.nameProperty == null)
-                {
-                    Fx.Assert(this.instance != null, "instance should not be null");
-
-                    RuntimeNamePropertyAttribute runtimeNamePropertyAttribute = TypeDescriptor.GetAttributes(this.instance)[typeof(RuntimeNamePropertyAttribute)] as RuntimeNamePropertyAttribute;
-                    if (runtimeNamePropertyAttribute != null && !String.IsNullOrEmpty(runtimeNamePropertyAttribute.Name))
-                    {
-                        this.nameProperty = this.Properties.Find(runtimeNamePropertyAttribute.Name);
-                    }
-                }
-                return nameProperty;
-            }
-        }
-
-
-        Dictionary<string, ModelItem> IModelTreeItem.ModelPropertyStore
-        {
-            get
-            {
-                return modelPropertyStore;
-            }
-        }
-
-        ModelTreeManager IModelTreeItem.ModelTreeManager
-        {
-            get
-            {
-                return modelTreeManager;
-            }
-        }
-
-        void IModelTreeItem.SetCurrentView(DependencyObject view)
-        {
-            this.view = view;
-        }
-
-        public override ModelEditingScope BeginEdit(string description, bool shouldApplyChangesImmediately)
-        {
-            return ModelItemHelper.ModelItemBeginEdit(this.modelTreeManager, description, shouldApplyChangesImmediately);
-        }
-
-        public override ModelEditingScope BeginEdit(bool shouldApplyChangesImmediately)
-        {
-            return this.BeginEdit(null, shouldApplyChangesImmediately);
-        }
-
-        public override ModelEditingScope BeginEdit(string description)
-        {
-            return this.BeginEdit(description, false);
-        }
-
-        public override ModelEditingScope BeginEdit()
-        {
-            return this.BeginEdit(null);
-        }
-
-        public override object GetCurrentValue()
-        {
-            return this.instance;
-        }
-
-        void IModelTreeItem.OnPropertyChanged(string propertyName)
-        {
-            this.OnPropertyChanged(propertyName);
-        }
-
-
-        void IModelTreeItem.SetParent(ModelItem dataModelItem)
-        {
-            if (this.manuallySetParent == dataModelItem)
-            {
-                this.manuallySetParent = null;
-            }
-
-            if (dataModelItem != null && !this.parents.Contains(dataModelItem))
-            {
-                this.parents.Add(dataModelItem);
-            }
-        }
-
-        IEnumerable<ModelItem> IModelTreeItem.ItemBackPointers
-        {
-            get { return this.parents; }
-        }
-
-        List<BackPointer> IModelTreeItem.ExtraPropertyBackPointers
-        {
-            get { return this.helper.ExtraPropertyBackPointers; }
-        }
-
-        void IModelTreeItem.SetSource(ModelProperty property)
-        {
-            if (!this.sources.Contains(property))
-            {
-                // also check if the same parent.property is in the list as a different instance of oldModelProperty
-                ModelProperty foundProperty = sources.FirstOrDefault<ModelProperty>((modelProperty) =>
-                    modelProperty.Name.Equals(property.Name) && property.Parent == modelProperty.Parent);
-                if (foundProperty == null)
-                {
-                    this.sources.Add(property);
-                }
-            }
-        }
-
-        #region ICustomTypeDescriptor Members
-
-        AttributeCollection ICustomTypeDescriptor.GetAttributes()
-        {
-            return this.Attributes;
-        }
-
-        string ICustomTypeDescriptor.GetClassName()
-        {
-            return TypeDescriptor.GetClassName(this);
-        }
-
-        string ICustomTypeDescriptor.GetComponentName()
-        {
-            return TypeDescriptor.GetComponentName(this);
-        }
-
-        TypeConverter ICustomTypeDescriptor.GetConverter()
-        {
-            return ModelUtilities.GetConverter(this);
-        }
-
-        EventDescriptor ICustomTypeDescriptor.GetDefaultEvent()
-        {
-            // we dont support events;
-            return null;
-        }
-
-        PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty()
-        {
-            return ModelUtilities.GetDefaultProperty(this);
-        }
-
-        object ICustomTypeDescriptor.GetEditor(Type editorBaseType)
-        {
-            // we dont support editors
-            return null;
-        }
-
-        EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes)
-        {
-            // we dont support events;
-            return null;
-        }
-
-        EventDescriptorCollection ICustomTypeDescriptor.GetEvents()
-        {
-            // we dont support events;
-            return null;
-        }
-
-        PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
-        {
-            return ModelUtilities.WrapProperties(this);
-        }
-
-        PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties()
-        {
-            // get model properties
-            List<PropertyDescriptor> properties = new List<PropertyDescriptor>();
-
-
-            foreach (PropertyDescriptor modelPropertyDescriptor in ModelUtilities.WrapProperties(this))
-            {
-                properties.Add(modelPropertyDescriptor);
-            }
-
-            // try to see if there are pseudo builtin properties for this type.
-            AttachedPropertiesService AttachedPropertiesService = this.modelTreeManager.Context.Services.GetService<AttachedPropertiesService>();
-            if (AttachedPropertiesService != null)
-            {
-                var nonBrowsableAttachedProperties = from attachedProperty in AttachedPropertiesService.GetAttachedProperties(this.itemType)
-                                                     where (!attachedProperty.IsBrowsable && !attachedProperty.IsVisibleToModelItem)
-                                                     select attachedProperty;
-
-                foreach (AttachedProperty AttachedProperty in nonBrowsableAttachedProperties)
-                {
-                    properties.Add(new AttachedPropertyDescriptor(AttachedProperty, this));
-                }
-            }
-            return new PropertyDescriptorCollection(properties.ToArray(), true);
-        }
-
-        object ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor pd)
-        {
-            return this;
-        }
-
-        #endregion
-
-
-        void IModelTreeItem.RemoveParent(ModelItem oldParent)
-        {
-            if (this.manuallySetParent == oldParent)
-            {
-                this.manuallySetParent = null;
-            }
-
-            if (this.parents.Contains(oldParent))
-            {
-                this.parents.Remove(oldParent);
-            }
-        }
-
-        void IModelTreeItem.RemoveSource(ModelProperty oldModelProperty)
-        {
-            if (this.sources.Contains(oldModelProperty))
-            {
-                this.sources.Remove(oldModelProperty);
-            }
-            else
-            {
-                ((IModelTreeItem)this).RemoveSource(oldModelProperty.Parent, oldModelProperty.Name);
-            }
-        }
-
-        void IModelTreeItem.RemoveSource(ModelItem parent, string propertyName)
-        {
-            // also check if the same parent.property is in the list as a different instance of oldModelProperty
-            ModelProperty foundProperty = this.sources.FirstOrDefault<ModelProperty>((modelProperty) => modelProperty.Name.Equals(propertyName) && modelProperty.Parent == parent);
-            if (foundProperty != null)
-            {
-                this.sources.Remove(foundProperty);
-            }
-            else
-            {
-                this.helper.RemoveExtraPropertyBackPointer(parent, propertyName);
-            }
-        }
-
-        protected virtual void OnPropertyChanged(string propertyName)
-        {
-            if (PropertyChanged != null)
-            {
-                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-            }
-        }
-
-        DynamicMetaObject IDynamicMetaObjectProvider.GetMetaObject(System.Linq.Expressions.Expression parameter)
-        {
-            return new ModelItemMetaObject(parameter, this);
-        }
-
-        public object SetPropertyValue(string propertyName, object val)
-        {
-            ModelProperty modelProperty = this.Properties.Find(propertyName);
-            if (modelProperty != null)
-            {
-                modelProperty.SetValue(val);
-            }
-            else
-            {
-                PropertyDescriptor descriptor = TypeDescriptor.GetProperties(this)[propertyName];
-                if (descriptor != null)
-                {
-                    descriptor.SetValue(this, val);
-                }
-            }
-            return GetPropertyValue(propertyName);
-        }
-
-        public object GetPropertyValue(string propertyName)
-        {
-            ModelProperty modelProperty = this.Properties.Find(propertyName);
-            object value = null;
-            if (modelProperty != null)
-            {
-                ModelItem valueModelitem = modelProperty.Value;
-                if (valueModelitem == null)
-                {
-                    value = null;
-                }
-                else
-                {
-                    Type itemType = valueModelitem.ItemType;
-                    if (itemType.IsPrimitive || itemType.IsEnum || itemType.Equals(typeof(String)))
-                    {
-                        value = valueModelitem.GetCurrentValue();
-                    }
-                    else
-                    {
-                        value = valueModelitem;
-                    }
-                }
-
-            }
-            else
-            {
-                PropertyDescriptor descriptor = TypeDescriptor.GetProperties(this)[propertyName];
-                if (descriptor != null)
-                {
-                    value = descriptor.GetValue(this);
-                }
-            }
-            return value;
-        }
-
-        class ModelItemMetaObject : System.Dynamic.DynamicMetaObject
-        {
-            MethodInfo getPropertyValueMethodInfo = typeof(ModelItemImpl).GetMethod("GetPropertyValue");
-            MethodInfo setPropertyValueMethodInfo = typeof(ModelItemImpl).GetMethod("SetPropertyValue");
-
-            public ModelItemMetaObject(System.Linq.Expressions.Expression parameter, ModelItemImpl target)
-                : base(parameter, BindingRestrictions.Empty, target)
-            {
-            }
-
-            public override DynamicMetaObject BindGetMember(GetMemberBinder binder)
-            {
-                System.Linq.Expressions.Expression s = System.Linq.Expressions.Expression.Convert(this.Expression, typeof(ModelItemImpl));
-                System.Linq.Expressions.Expression value = System.Linq.Expressions.Expression.Call(s, getPropertyValueMethodInfo, System.Linq.Expressions.Expression.Constant(binder.Name));
-                return new DynamicMetaObject(value, BindingRestrictions.GetTypeRestriction(this.Expression, this.LimitType));
-            }
-
-            public override DynamicMetaObject BindSetMember(SetMemberBinder binder, DynamicMetaObject value)
-            {
-                System.Linq.Expressions.Expression s = System.Linq.Expressions.Expression.Convert(this.Expression, typeof(ModelItemImpl));
-                System.Linq.Expressions.Expression objectValue = System.Linq.Expressions.Expression.Convert(value.Expression, typeof(object));
-                System.Linq.Expressions.Expression valueExp = System.Linq.Expressions.Expression.Call(s, setPropertyValueMethodInfo, System.Linq.Expressions.Expression.Constant(binder.Name), objectValue);
-                return new DynamicMetaObject(valueExp, BindingRestrictions.GetTypeRestriction(this.Expression, this.LimitType));
-            }
-        }
-
-
-
-    }
-
-
-
-
-
-
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemsAddedEventArgs.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemsAddedEventArgs.cs
deleted file mode 100644 (file)
index 2294563..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Runtime;
-
-    internal class ModelItemsAddedEventArgs : EventArgs
-    {
-        public ModelItemsAddedEventArgs(IEnumerable<ModelItem> modelItemsAdded)
-        {
-            Fx.Assert(modelItemsAdded != null, "modelItemsAdded should not be null");
-            this.ModelItemsAdded = modelItemsAdded;
-        }
-
-        public IEnumerable<ModelItem> ModelItemsAdded { get; private set; }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemsRemovedEventArgs.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelItemsRemovedEventArgs.cs
deleted file mode 100644 (file)
index 88037ec..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System.Collections.Generic;
-    using System.Runtime;
-
-    internal class ModelItemsRemovedEventArgs : EventArgs
-    {
-        public ModelItemsRemovedEventArgs(IEnumerable<ModelItem> modelItemsRemoved)
-        {
-            Fx.Assert(modelItemsRemoved != null, "modelItemsRemoved should not be null");
-            this.ModelItemsRemoved = modelItemsRemoved;
-        }
-
-        public IEnumerable<ModelItem> ModelItemsRemoved { get; private set; }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelPropertyCollectionImpl.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelPropertyCollectionImpl.cs
deleted file mode 100644 (file)
index e480210..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System.Collections.Generic;
-    using System.Activities.Presentation.View;
-    using System.ComponentModel;
-    using System.IO;
-    using System.Linq;
-
-
-    // This provides a container for model properties of a modelItem.
-    // This uses the TypeDescriptor.GetProperties() instead of using reflection
-    // to get the properties of a model item. So any model instance implementing ICustomTypeProvider 
-    // is automatically taken care of.
-
-    class ModelPropertyCollectionImpl : ModelPropertyCollection
-    {
-        ModelItem parent;
-        bool createFakeModelProperties;
-
-        public ModelPropertyCollectionImpl(ModelItem parent)
-        {
-            this.parent = parent;
-            createFakeModelProperties = this.parent is FakeModelItemImpl;
-        }
-
-        public override IEnumerator<ModelProperty> GetEnumerator()
-        {
-            foreach (PropertyDescriptor propertyDescriptor in GetPropertyDescriptors())
-            {
-                yield return CreateProperty(parent, propertyDescriptor);
-            }
-        }
-
-        protected override ModelProperty Find(System.Windows.DependencyProperty value, bool throwOnError)
-        {
-            // We dont support dependency properties.
-            if (throwOnError)
-            {
-                throw FxTrace.Exception.AsError(new NotSupportedException());
-            }
-            else
-            {
-                return null;
-            }
-        }
-
-        protected override ModelProperty Find(string name, bool throwOnError)
-        {
-            PropertyDescriptor propertyDescriptor = GetPropertyDescriptors()[name];
-            if (propertyDescriptor != null)
-            {
-                return CreateProperty(parent, propertyDescriptor);
-            }
-            return null;
-        }
-
-        ModelProperty CreateProperty(ModelItem parent, PropertyDescriptor propertyDescriptor)
-        {
-            bool isAttached = propertyDescriptor is AttachedPropertyDescriptor;
-            return this.createFakeModelProperties ?
-                (ModelProperty)(new FakeModelPropertyImpl((FakeModelItemImpl)parent, propertyDescriptor)) :
-                (ModelProperty)(new ModelPropertyImpl(parent, propertyDescriptor, isAttached));
-        }
-
-        PropertyDescriptorCollection GetPropertyDescriptors()
-        {
-            PropertyDescriptorCollection propertyDescriptors = PropertyDescriptorCollection.Empty;
-
-            try
-            {
-                object instance = parent.GetCurrentValue();
-                if (instance != null)
-                {
-                    if (!(instance is ICustomTypeDescriptor))
-                    {
-                        Type instanceType = instance.GetType();
-                        if (instanceType.IsValueType)
-                        {
-                            propertyDescriptors = TypeDescriptor.GetProvider(instanceType).GetTypeDescriptor(instanceType).GetProperties();
-                        }
-                        else
-                        {
-                            propertyDescriptors = TypeDescriptor.GetProvider(instance).GetTypeDescriptor(instance).GetProperties();
-                        }
-                    }
-                    else
-                    {
-                        propertyDescriptors = TypeDescriptor.GetProperties(instance);
-                    }
-
-                }
-
-                // Add browsable attached properties 
-                AttachedPropertiesService AttachedPropertiesService = this.parent.GetEditingContext().Services.GetService<AttachedPropertiesService>();
-                if (AttachedPropertiesService != null)
-                {
-
-                    var browsableAttachedProperties = from attachedProperty in AttachedPropertiesService.GetAttachedProperties(this.parent.ItemType)
-                                                      where (attachedProperty.IsBrowsable || attachedProperty.IsVisibleToModelItem)
-                                                      select new AttachedPropertyDescriptor(attachedProperty, this.parent);
-
-                    List<PropertyDescriptor> mergedProperties = new List<PropertyDescriptor>();
-                    foreach (PropertyDescriptor propertyDescriptor in propertyDescriptors)
-                    {
-                        mergedProperties.Add(propertyDescriptor);
-                    }
-                    propertyDescriptors = new PropertyDescriptorCollection(mergedProperties.Concat(browsableAttachedProperties).ToArray(), true);
-
-                }
-            }
-            catch (FileNotFoundException e)
-            {
-                EditingContext context = parent.GetEditingContext();
-                if (context.Items.GetValue<ErrorItem>() == null)
-                {
-                    context.Items.SetValue(new ErrorItem { Message = e.Message, Details = e.ToString() });
-                }
-            }
-
-            return propertyDescriptors;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelPropertyDescriptor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelPropertyDescriptor.cs
deleted file mode 100644 (file)
index e87505c..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System;
-    using System.ComponentModel;
-
-    // This is a property descriptor that wraps ModelProperty objects.
-    // It is used when someone uses TypeDescriptor to ask for type information
-    // on an editing model item.
-    internal class ModelPropertyDescriptor : PropertyDescriptor
-    {
-        ModelProperty itemProperty;
-        TypeConverter converter;
-
-        internal ModelPropertyDescriptor(ModelProperty itemProperty)
-            : base(itemProperty.Name, null)
-        {
-            this.itemProperty = itemProperty;
-        }
-
-        public override AttributeCollection Attributes
-        {
-            get { return this.itemProperty.Attributes; }
-        }
-
-        // Returns the type converter for this property.  Our property
-        // descriptor wrapper is "complete" in that it always returns
-        // editing model item objects.  Because of that, we must wrap
-        // all type converters.
-        public override TypeConverter Converter
-        {
-            get
-            {
-                if (this.converter == null)
-                {
-                    TypeConverter baseConverter = base.Converter;
-                    IModelTreeItem propertyParent = this.itemProperty.Parent as IModelTreeItem;
-                    this.converter = new ModelTypeConverter(propertyParent.ModelTreeManager, baseConverter);
-                }
-
-                return converter;
-            }
-        }
-
-
-        public override bool IsBrowsable
-        {
-            get { return this.itemProperty.IsBrowsable; }
-        }
-
-        // Returns the type of object that defined this property.
-        public override Type ComponentType
-        {
-            get { return this.itemProperty.Parent.ItemType; }
-        }
-
-        public override bool IsReadOnly
-        {
-            get { return this.itemProperty.IsReadOnly; }
-        }
-
-        // Returns the data type of the property.  
-        public override Type PropertyType
-        {
-
-            get
-            {
-                return this.itemProperty.PropertyType;
-            }
-
-        }
-
-        public override PropertyDescriptorCollection GetChildProperties(object instance, Attribute[] filter)
-        {
-            return base.GetChildProperties(instance, filter);
-        }
-
-        public override bool CanResetValue(object component)
-        {
-            return this.itemProperty.IsSet;
-        }
-
-        public override object GetEditor(Type editorBaseType)
-        {
-            // The new PropertyEntry PropertyValue editor model does not use this
-            return null;
-        }
-
-        // Returns the current value of this property.
-        // When the object is not primitive, enum, or string we always return the ModelItem wrapping it.
-        // this enables nested binding in wpf still go through modelItems tree so taht we can intercept
-        // the property sets e.g "{Binding Path=RootModel.ComplexProperty.Blah"}, since we return a ModelItem
-        // for ComplexProperty we can still intercept sets made from Wpf controls to Blah even if ComplexProperty
-        // type does not implement INotifyPropertyChanged.
-        public override object GetValue(object component)
-        {
-            ModelItem value = this.itemProperty.Value;
-            if (value == null)
-            {
-                return null;
-            }
-            Type itemType = value.ItemType;
-            if (itemType.IsPrimitive || itemType.IsEnum || itemType.Equals(typeof(String)))
-            {
-                return value.GetCurrentValue();
-            }
-            return value;
-        }
-
-        public override void ResetValue(object component)
-        {
-            this.itemProperty.ClearValue();
-        }
-
-        // Sets the property value to the given value.  For
-        // convenience, the value passed can either be an
-        // item or a raw value.  In the latter case we will
-        // wrap the value into an item for you. 
-        public override void SetValue(object component, object value)
-        {
-            this.itemProperty.SetValue(value);
-        }
-
-        // Returns true if the value should be serialized to code.
-        public override bool ShouldSerializeValue(object component)
-        {
-            // If the local value is set, see if the property supports
-            // a ShouldSerialize on its property descriptor.  If it doesn't,
-            // then we let the IsSet dictate the 'setness'.
-
-            if (this.itemProperty.IsSet)
-            {
-                ModelPropertyImpl modelProp = this.itemProperty as ModelPropertyImpl;
-                if (modelProp != null)
-                {
-                    return modelProp.PropertyDescriptor.ShouldSerializeValue(this.itemProperty.Parent.GetCurrentValue());
-                }
-                return true;
-            }
-
-            return false;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelPropertyImpl.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelPropertyImpl.cs
deleted file mode 100644 (file)
index d3237f8..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Windows.Documents;
-
-    // This class provides the implementation for a model property.
-    // this intercepts sets /gets to the property and works with modeltreemanager
-    // to keep the xaml in [....].
-
-    class ModelPropertyImpl : ModelProperty
-    {
-        object defaultValue;
-        ModelItem parent;
-        PropertyDescriptor propertyDescriptor;
-        bool isAttached = false;
-
-        public ModelPropertyImpl(ModelItem parent, PropertyDescriptor propertyDescriptor, bool isAttached)
-        {
-            this.parent = parent;
-            this.propertyDescriptor = propertyDescriptor;
-
-            // using this a marker to indicate this hasnt been computed yet.
-            this.defaultValue = this;
-            this.isAttached = isAttached;
-        }
-
-        public override Type AttachedOwnerType
-        {
-            get
-            {
-                return this.parent.GetType();
-            }
-        }
-
-        public override AttributeCollection Attributes
-        {
-            get
-            {
-                return this.propertyDescriptor.Attributes;
-            }
-        }
-
-        public override ModelItemCollection Collection
-        {
-            get
-            {
-                return this.Value as ModelItemCollection;
-            }
-        }
-
-        public override object ComputedValue
-        {
-            get
-            {
-                object computedValue = null;
-                if (this.Value != null)
-                {
-                    computedValue = Value.GetCurrentValue();
-                }
-                return computedValue;
-            }
-            set
-            {
-                SetValue(value);
-            }
-        }
-
-        public override System.ComponentModel.TypeConverter Converter
-        {
-            get
-            {
-                return new ModelTypeConverter(((IModelTreeItem)this.Parent).ModelTreeManager, propertyDescriptor.Converter);
-            }
-        }
-
-        public override object DefaultValue
-        {
-            get
-            {
-                if (Object.ReferenceEquals(this.defaultValue, this))
-                {
-                    DefaultValueAttribute defaultValueAttribute = this.propertyDescriptor.Attributes[typeof(DefaultValueAttribute)] as DefaultValueAttribute;
-                    this.defaultValue = (defaultValueAttribute == null) ? null : defaultValueAttribute.Value;
-                }
-                return this.defaultValue;
-            }
-        }
-
-        public override ModelItemDictionary Dictionary
-        {
-            get
-            {
-                return Value as ModelItemDictionary;
-            }
-        }
-
-        public override bool IsAttached
-        {
-            get
-            {
-                return this.isAttached;
-            }
-        }
-
-        public override bool IsBrowsable
-        {
-            get
-            {
-                return propertyDescriptor.IsBrowsable;
-            }
-        }
-
-        public override bool IsCollection
-        {
-            get { return this.Value is ModelItemCollection; }
-        }
-
-        public override bool IsDictionary
-        {
-            get { return this.Value is ModelItemDictionary; }
-        }
-
-        public override bool IsReadOnly
-        {
-            get
-            {
-                return propertyDescriptor.IsReadOnly;
-            }
-        }
-
-        public override bool IsSet
-        {
-            get
-            {
-                return this.Value != null;
-            }
-        }
-
-        public override string Name
-        {
-            get
-            {
-                return propertyDescriptor.Name;
-            }
-        }
-
-        public override ModelItem Parent
-        {
-            get
-            {
-                return parent;
-            }
-        }
-
-        public override Type PropertyType
-        {
-            get
-            {
-                return propertyDescriptor.PropertyType;
-            }
-        }
-
-        public override ModelItem Value
-        {
-            get
-            {
-                return ((IModelTreeItem)parent).ModelTreeManager.GetValue(this);
-            }
-        }
-
-        internal PropertyDescriptor PropertyDescriptor
-        {
-            get
-            {
-                return propertyDescriptor;
-            }
-        }
-
-        public override void ClearValue()
-        {
-            if (!this.IsReadOnly)
-            {
-                ((IModelTreeItem)parent).ModelTreeManager.ClearValue(this);
-            }
-        }
-
-        public override ModelItem SetValue(object value)
-        {
-            return ((IModelTreeItem)parent).ModelTreeManager.SetValue(this, value);
-        }
-
-        internal override string Reference
-        {
-            get
-            {
-                return PropertyReferenceUtilities.GetPropertyReference(parent.GetCurrentValue(), this.Name);
-            }
-        }
-
-        internal override void ClearReference()
-        {
-            this.SetReference(null);
-        }
-
-        internal override void SetReference(string sourceProperty)
-        {
-            PropertyReferenceChange change = new PropertyReferenceChange()
-            {
-                Owner = this.Parent,
-                TargetProperty = this.Name,
-                OldSourceProperty = this.Reference,
-                NewSourceProperty = sourceProperty
-            };
-
-            ((IModelTreeItem)parent).ModelTreeManager.AddToCurrentEditingScope(change);
-        }
-
-        internal object SetValueCore(ModelItem newValueModelItem)
-        {
-            object newValueInstance = (newValueModelItem == null) ? null : newValueModelItem.GetCurrentValue();
-            ModelItem oldValueModelItem = this.Value;
-            IModelTreeItem parent = (IModelTreeItem)this.Parent;
-
-            // update object instance
-            this.PropertyDescriptor.SetValue(this.Parent.GetCurrentValue(), newValueInstance);
-
-            if (oldValueModelItem != null && !this.isAttached)
-            {
-                parent.ModelPropertyStore.Remove(this.Name);
-                parent.ModelTreeManager.OnPropertyEdgeRemoved(this.Name, this.Parent, oldValueModelItem);
-            }
-
-            if (newValueModelItem != null && !this.isAttached)
-            {
-                parent.ModelPropertyStore.Add(this.Name, newValueModelItem);
-                parent.ModelTreeManager.OnPropertyEdgeAdded(this.Name, this.Parent, newValueModelItem);
-            }
-
-            // notify observers
-            ((IModelTreeItem)this.Parent).OnPropertyChanged(this.Name);
-            return newValueInstance;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelSearchService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelSearchService.cs
deleted file mode 100644 (file)
index 3fc5a5e..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Services
-{
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Xaml;
-
-    /// <summary>
-    /// The ModelSearchService class is responsible for generate a TextImage and navigate to
-    /// the corresponding ModelItem in the workflow designer.
-    /// </summary>
-    public abstract class ModelSearchService
-    {
-        /// <summary>
-        /// Constructs a new ModelSearchService.
-        /// </summary>
-        protected ModelSearchService()
-        {
-        }
-
-        /// <summary>
-        /// Generate a searchable text image based on the model item tree.
-        /// </summary>
-        /// <returns></returns>
-        public abstract TextImage GenerateTextImage();
-
-        /// <summary>
-        /// Navigate to a modelItem based on the line number in the text image.
-        /// </summary>
-        /// <param name="location">the line number in text image.</param>
-        /// <returns>Is the Navivating succeed.</returns>
-        public abstract bool NavigateTo(int location);
-
-        /// <summary>
-        /// Navigate to a modelItem based on the source location in the xaml file.
-        /// </summary>
-        /// <param name="srcLocation">the source location in the xaml file.</param>
-        /// <returns>Is the Navivating succeed.</returns>
-        public abstract bool NavigateTo(int startLine, int startColumn, int endLine, int endColumn);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelSearchServiceImpl.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelSearchServiceImpl.cs
deleted file mode 100644 (file)
index 0a478bd..0000000
+++ /dev/null
@@ -1,778 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System;
-    using System.Activities.Debugger;
-    using System.Activities.Expressions;
-    using System.Activities.Presentation.Annotations;
-    using System.Activities.Presentation.Converters;
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation.Services;
-    using System.Activities.Presentation.View;
-    using System.Activities.Presentation.Xaml;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Globalization;
-    using System.Linq;
-    using System.Reflection;
-    using System.Runtime;
-    using System.ServiceModel.Activities;
-    using System.Windows;
-    using System.Windows.Documents;
-    using System.Windows.Input;
-    using System.Windows.Threading;
-    using Microsoft.Activities.Presentation;
-
-    // The main class for search. This class will walkthrough the model item tree to build a TextImage.
-    // And it will access ObjectToSourceLocationMapping with a specific SourceLocation to get a ModelItem
-    // and highlight.
-    class ModelSearchServiceImpl : ModelSearchService
-    {
-        const int StartIndexUnchangeMark = -1;
-        const string DisplayNamePropertyName = "DisplayName";
-        EditingContext editingContext;
-        ModelService modelService;
-        WorkflowDesigner designer;
-        List<SearchableEntry> entries = new List<SearchableEntry>();
-        Dictionary<int, SearchableEntry> textImageIndexEntryMapping = new Dictionary<int, SearchableEntry>();
-        TextImage textImage;
-        HashSet<Object> alreadyVisitedObjects = new HashSet<Object>();
-        HashSet<object> objectsOnDesinger = new HashSet<object>();
-        int index;
-        ModelItem lastNavigatedItem;
-        bool isModelTreeChanged;
-        ModelItem itemToFocus;
-        AdornerLayer adornerLayer;
-        SearchToolTipAdorner toolTipAdorner;
-        WorkflowViewElement lastWorkflowViewElement;
-
-        public ModelSearchServiceImpl(WorkflowDesigner designer)
-        {
-            if (designer == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("designer"));
-            }
-            this.designer = designer;
-            this.editingContext = this.designer.Context;
-
-            this.editingContext.Services.Subscribe<ModelService>(new SubscribeServiceCallback<ModelService>(this.OnModelServiceAvailable));
-            this.editingContext.Services.Subscribe<DesignerView>(new SubscribeServiceCallback<DesignerView>(this.OnDesignerViewAvailable));
-            this.editingContext.Services.Subscribe<ModelTreeManager>(new SubscribeServiceCallback<ModelTreeManager>(this.OnModelTreeManagerAvailable));
-            this.editingContext.Items.Subscribe<Selection>(this.OnSelectionChanged);
-
-            // At the first time, we should generate the TextImage.
-            this.isModelTreeChanged = true;
-        }
-
-        void OnEditingScopeCompleted(object sender, EditingScopeEventArgs e)
-        {
-            this.isModelTreeChanged = true;
-        }
-
-        void OnSelectionChanged(Selection selection)
-        {
-            if (selection.PrimarySelection != this.lastNavigatedItem)
-            {
-                this.isModelTreeChanged = true;
-            }
-        }
-
-        // Listen to the mouse down in designer and close tooltip.
-        void OnDesignerSurfaceMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
-        {
-            RemoveToolTipAdorner();
-        }
-
-        bool ShouldIgnore(ModelProperty property)
-        {
-            // Since we have searched each variable. We can strip out "Variables" property here.
-            // It's valid to hardcode "Variables" property. That's the way how variable designer get variables.
-            // We should strip out 'DisplayName', since it is searched at the beginning.
-            // We strip out 'Id', since it's a property from the Activity Base class, but never used in design time. 
-            return string.Equals(property.Name, "Variables", StringComparison.Ordinal)
-                        || string.Equals(property.Name, DisplayNamePropertyName, StringComparison.Ordinal)
-                        || string.Equals(property.Name, "Id", StringComparison.Ordinal);
-        }
-
-        public override TextImage GenerateTextImage()
-        {
-            RemoveToolTipAdorner();
-
-            // If the modelitem tree was not changed since last time we generated the text image,
-            // return the original TextImage and set the StartIndex to StartIndexUnchangeMark
-            // means VS should use their own index.
-            if (!this.isModelTreeChanged)
-            {
-                textImage.StartLineIndex = StartIndexUnchangeMark;
-                return textImage;
-            }
-            this.entries.Clear();
-            this.textImageIndexEntryMapping.Clear();
-            this.index = 0;
-            IEnumerable<ModelItem> itemsToSearch = this.GetItemsOnDesigner(preOrder: true, excludeRoot: true, excludeErrorActivity: true, excludeExpression: true, includeOtherObjects: false);
-            foreach (ModelItem item in itemsToSearch)
-            {
-                this.objectsOnDesinger.Add(item.GetCurrentValue());
-            }
-
-            Selection selection = this.editingContext.Items.GetValue<Selection>();
-            int startIndex = StartIndexUnchangeMark;
-
-            // If and only if root is selected, start search from the beginning.
-            if (selection.SelectionCount == 1 && selection.PrimarySelection == modelService.Root)
-            {
-                startIndex = 0;
-            }
-
-            AddEntriesForArguments(selection, ref startIndex);
-            foreach (ModelItem modelItem in itemsToSearch)
-            {
-                // Do this check to make sure we start from the topmost selected item.
-                if (startIndex == StartIndexUnchangeMark)
-                {
-                    if (selection.SelectedObjects.Contains(modelItem) && modelItem != this.lastNavigatedItem)
-                    {
-                        // set the search start index to the next location of the current focus.
-                        startIndex = index;
-                    }
-                }
-
-                // Add the DisplayName property first.
-                ModelProperty displayNameProperty = modelItem.Properties[DisplayNamePropertyName];
-                if (displayNameProperty != null)
-                {
-                    AddEntriesForProperty(displayNameProperty, modelItem, null);
-                }
-                foreach (ModelProperty modelProperty in modelItem.Properties)
-                {
-                    if (!ShouldIgnore(modelProperty))
-                    {
-                        AddEntriesForProperty(modelProperty, modelItem, null);
-                    }
-                }
-                AddEntriesForVariables(modelItem);
-            }
-
-            AddBrowsableProperties(this.modelService.Root);
-
-            List<string> searchableTexts = new List<string>();
-            int textImageIndex = 0;
-            foreach (SearchableEntry entry in entries)
-            {
-                string text = entry.Text;
-                if (text == null)
-                {
-                    text = string.Empty;
-                }
-
-                foreach (string line in text.Split(new string[] { Environment.NewLine, "\n", "\r" }, StringSplitOptions.RemoveEmptyEntries))
-                {
-                    this.textImageIndexEntryMapping.Add(textImageIndex, entry);
-                    searchableTexts.Add(line);
-                    textImageIndex++;
-                }
-            }
-
-            textImage = new TextImage()
-            {
-                StartLineIndex = startIndex,
-                Lines = searchableTexts
-            };
-
-            this.isModelTreeChanged = false;
-            return textImage;
-        }
-
-        private void OnModelServiceAvailable(ModelService modelService)
-        {
-            this.modelService = modelService;
-        }
-
-        private void OnDesignerViewAvailable(DesignerView designerView)
-        {
-            designerView.AddHandler(UIElement.MouseLeftButtonDownEvent, new MouseButtonEventHandler(this.OnDesignerSurfaceMouseLeftButtonDown), true);
-        }
-
-        private void OnModelTreeManagerAvailable(ModelTreeManager modelTreeManager)
-        {
-            modelTreeManager.EditingScopeCompleted += new EventHandler<EditingScopeEventArgs>(OnEditingScopeCompleted);
-        }
-
-        private void RemoveToolTipAdorner()
-        {
-            if (this.toolTipAdorner != null)
-            {
-                // remove the adorner on the previous hit item.
-                this.adornerLayer.Remove(this.toolTipAdorner);
-                this.toolTipAdorner = null;
-                this.lastWorkflowViewElement.CustomItemStatus = null;
-            }
-        }
-
-        internal IEnumerable<ModelItem> GetItemsOnDesigner(bool preOrder, bool excludeRoot, bool excludeErrorActivity, bool excludeExpression, bool includeOtherObjects)
-        {
-            WorkflowViewService viewService = this.WorkflowViewService;
-            IList<ModelItem> items =
-                ModelTreeManager.DepthFirstSearch(modelService.Root,
-                delegate(Type type)
-                {
-                    // Only find items on the designer surface.
-                    return includeOtherObjects || (typeof(WorkflowViewElement).IsAssignableFrom(viewService.GetDesignerType(type)));
-                },
-                delegate(ModelItem modelItem)
-                {
-                    return !(excludeExpression && modelItem != null && typeof(ITextExpression).IsAssignableFrom(modelItem.ItemType));
-                },
-                preOrder);
-
-            // ModelItemKeyValuePair is associated with CaseDesigner. 
-            // So ModelItemKeyValuePair will be returned even if they are not really Cases.
-            // Those ModelItemKeyValuePairs need to be excluded.
-            IEnumerable<ModelItem> itemsToSearch = null;
-            if (!excludeErrorActivity)
-            {
-                itemsToSearch = items.Where<ModelItem>(item => !ModelUtilities.IsModelItemKeyValuePair(item.ItemType)
-                            || ModelUtilities.IsSwitchCase(item));
-            }
-            else
-            {
-                itemsToSearch = items.Where<ModelItem>(item =>
-                    (!ModelUtilities.IsModelItemKeyValuePair(item.ItemType) || ModelUtilities.IsSwitchCase(item))
-                    && !IsErrorActivity(item));
-            }
-            if (excludeRoot)
-            {
-                itemsToSearch = itemsToSearch.Except<ModelItem>(new ModelItem[] { modelService.Root });
-            }
-            return itemsToSearch;
-        }
-
-        static private bool IsErrorActivity(ModelItem item)
-        {
-            Type type = item.ItemType;
-            if (type.IsGenericType)
-            {
-                return (typeof(ErrorActivity<>) == type.GetGenericTypeDefinition());
-            }
-
-            return (type == typeof(ErrorActivity));
-        }
-
-        internal static string ExpressionToString(object expression)
-        {
-            ITextExpression expr = expression as ITextExpression;
-            return (expr != null) ? expr.ExpressionText : expression.ToString();
-        }
-
-        SearchableEntry CreateSearchableEntry(SearchableEntryOption entryType,
-            ModelItem item, ModelProperty property, string text, string propertyPath)
-        {
-            return new SearchableEntry()
-            {
-                LineNumber = index++,
-                SearchableEntryType = entryType,
-                ModelItem = item,
-                ModelProperty = property,
-                Text = text,
-                PropertyPath = propertyPath
-            };
-        }
-
-        void AddEntriesForVariables(ModelItem modelItem)
-        {
-            ModelItemCollection variables = VariableHelper.GetVariableCollection(modelItem);
-            if (variables != null)
-            {
-                foreach (ModelItem variable in variables)
-                {
-                    entries.Add(CreateSearchableEntry(SearchableEntryOption.Variable, variable, null,
-                        TypeNameHelper.GetDisplayName(variable.Properties[DesignTimeVariable.VariableTypeProperty].ComputedValue as Type, false), null));
-
-                    entries.Add(CreateSearchableEntry(SearchableEntryOption.Variable, variable, null,
-                        variable.Properties[DesignTimeVariable.VariableNameProperty].ComputedValue.ToString(), null));
-
-                    object propertyValue = variable.Properties[DesignTimeVariable.VariableDefaultProperty].ComputedValue;
-
-                    if (propertyValue != null)
-                    {
-                        entries.Add(CreateSearchableEntry(SearchableEntryOption.Variable, variable, null,
-                            ExpressionToString(propertyValue), null));
-                    }
-
-                    if (this.editingContext.Services.GetService<DesignerConfigurationService>().AnnotationEnabled)
-                    {
-                        string annotationText = (string)variable.Properties[Annotation.AnnotationTextPropertyName].ComputedValue;
-                        if (!string.IsNullOrEmpty(annotationText))
-                        {
-                            entries.Add(CreateSearchableEntry(SearchableEntryOption.Variable, variable, null, annotationText, null));
-                        }
-                    }
-                }
-            }
-        }
-
-        private void AddEntriesForPropertyReference(string valueText, ModelItem modelItem,
-            ModelProperty property, SearchableEntryOption entryType, string propertyPath)
-        {
-            entries.Add(CreateSearchableEntry(entryType, modelItem, property, valueText, propertyPath));
-        }
-
-        private void AddEntriesForPropertyValue(object value, ModelItem modelItem,
-            ModelProperty property, SearchableEntryOption entryType, string propertyPath)
-        {
-            // be ready for recursively visit all sub properties.
-            alreadyVisitedObjects.Clear();
-            IList<string> texts = GetSearchableStrings(value);
-            if (texts != null)
-            {
-                foreach (string valueText in texts)
-                {
-                    entries.Add(CreateSearchableEntry(entryType, modelItem, property, valueText, propertyPath));
-                }
-            }
-        }
-
-        void AddBrowsableProperties(ModelItem modelItem)
-        {
-            foreach (ModelProperty property in modelItem.Properties)
-            {
-                if (property.IsBrowsable)
-                {
-                    this.AddEntriesForProperty(property, modelItem, null);
-                }
-            }
-        }
-
-
-        void AddEntriesForArguments(Selection selection, ref int startIndex)
-        {
-            ModelProperty argumentsProperty = this.modelService.Root.Properties["Properties"];
-            if (argumentsProperty == null)
-            {
-                return;
-            }
-            ModelItemCollection arguments = argumentsProperty.Collection;
-            if (arguments != null)
-            {
-                ModelItem selectedArgument = this.GetTopmostSelectedArgument(selection, arguments);
-                foreach (ModelItem argument in arguments)
-                {
-                    // Do this check to make sure we start from the topmost selected item.
-                    if (startIndex == StartIndexUnchangeMark && argument == selectedArgument && argument != lastNavigatedItem)
-                    {
-                        startIndex = index;
-                    }
-                    entries.Add(CreateSearchableEntry(SearchableEntryOption.Argument, argument, null,
-                        TypeNameHelper.GetDisplayName(argument.Properties["Type"].ComputedValue as Type, false), null));
-
-                    entries.Add(CreateSearchableEntry(SearchableEntryOption.Argument, argument, null,
-                        argument.Properties[DesignTimeArgument.ArgumentNameProperty].ComputedValue.ToString(), null));
-
-                    IList<string> argumentValues = GetSearchableStrings(argument.Properties[DesignTimeArgument.ArgumentDefaultValueProperty].ComputedValue);
-                    if (argumentValues.Count == 1)
-                    {
-                        AddEntriesForPropertyValue(argumentValues[0],
-                            argument, null, SearchableEntryOption.Argument, null);
-                    }
-
-                    if (this.editingContext.Services.GetService<DesignerConfigurationService>().AnnotationEnabled)
-                    {
-                        string annotationText = (string)argument.Properties[Annotation.AnnotationTextPropertyName].ComputedValue;
-                        if (!string.IsNullOrEmpty(annotationText))
-                        {
-                            entries.Add(CreateSearchableEntry(SearchableEntryOption.Argument, argument, null, annotationText, null));
-                        }
-                    }
-                }
-            }
-        }
-
-        private ModelItem GetTopmostSelectedArgument(Selection selection, ModelItemCollection arguments)
-        {
-            foreach (ModelItem argument in arguments)
-            {
-                foreach (ModelItem candidateArgument in selection.SelectedObjects)
-                {
-                    if (candidateArgument.ItemType == typeof(DesignTimeArgument))
-                    {
-                        // since for arguments, the selection is not the modelitem, it is the fakemodelitem, we cannot do a
-                        // simple reference comparing to find the selected argument.
-                        DesignTimeArgument designTimeArgument = candidateArgument.GetCurrentValue() as DesignTimeArgument;
-                        if (designTimeArgument.ReflectedObject == argument)
-                        {
-                            return argument;
-                        }
-                    }
-                }
-            }
-            return null;
-        }
-
-        IList<string> GetSearchableStrings(object computedValue)
-        {
-            List<string> results = new List<string>();
-            if (computedValue == null || this.objectsOnDesinger.Contains(computedValue))
-            {
-                return results;
-            }
-
-            Type type = computedValue.GetType();
-            if (type.IsPrimitive || computedValue is string || type.IsEnum || computedValue is Uri)
-            {
-                return new List<string>() { computedValue.ToString() };
-            }
-
-            SearchableStringConverterAttribute attribute =
-                ExtensibilityAccessor.GetAttribute<SearchableStringConverterAttribute>(type);
-
-            if (attribute == null)
-            {
-                // try its generic type.
-                if (type.IsGenericType)
-                {
-                    Type generictype = type.GetGenericTypeDefinition();
-                    attribute = ExtensibilityAccessor.GetAttribute<SearchableStringConverterAttribute>(generictype);
-                }
-            }
-
-            if (attribute != null)
-            {
-                Type converterType = Type.GetType(attribute.ConverterTypeName);
-                if (converterType.IsGenericTypeDefinition)
-                {
-                    converterType = converterType.MakeGenericType(computedValue.GetType().GetGenericArguments());
-                }
-                SearchableStringConverter converter = Activator.CreateInstance(converterType) as SearchableStringConverter;
-                return converter.Convert(computedValue);
-            }
-
-            // don't have an direct converter? and is a collection, then let's try convert each member.
-            if (computedValue is IEnumerable)
-            {
-                foreach (object value in computedValue as IEnumerable)
-                {
-                    results.AddRange(GetSearchableStrings(value));
-                }
-                return results;
-            }
-
-            // Already tried all the options, let's do a recursive search.
-            alreadyVisitedObjects.Add(computedValue);
-            PropertyInfo[] properties = type.GetProperties();
-            foreach (PropertyInfo property in properties)
-            {
-                object propertyValue = property.GetValue(computedValue, null);
-                if (!alreadyVisitedObjects.Contains(propertyValue))
-                {
-                    results.AddRange(GetSearchableStrings(propertyValue));
-                }
-            }
-            return results;
-        }
-
-        void AddEntriesForProperty(ModelProperty property, ModelItem modelItem, string propertyPath)
-        {
-            if (!string.IsNullOrEmpty(propertyPath))
-            {
-                propertyPath += ",";
-                propertyPath += property.Name;
-            }
-            else
-            {
-                propertyPath = property.Name;
-            }
-
-            entries.Add(CreateSearchableEntry(
-                SearchableEntryOption.Property, modelItem, property, TypeNameHelper.GetDisplayName(property.PropertyType, false), propertyPath));
-
-            entries.Add(CreateSearchableEntry(
-                SearchableEntryOption.Property, modelItem, property, property.Name, propertyPath));
-
-            if (property.ComputedValue != null)
-            {
-                PropertyValueEditor propertyValueEditor = null;
-                try
-                {
-                    propertyValueEditor = ExtensibilityAccessor.GetSubPropertyEditor(property);
-                }
-                catch (TargetInvocationException exception)
-                {
-                    // To workaround 181412.If the current property's property type is a generic type and the activity 
-                    // is also a generic type Calling to ExtensibilityAccessor.GetSubPropertyEditor will get this exception. 
-                    if (exception.InnerException is ArgumentException)
-                    {
-                        propertyValueEditor = null;
-                    }
-                }
-                if (propertyValueEditor != null)
-                {
-                    IList<ModelProperty> properties = ExtensibilityAccessor.GetSubProperties(property);
-                    foreach (ModelProperty propertyItem in properties)
-                    {
-                        AddEntriesForProperty(propertyItem, modelItem, propertyPath);
-                    }
-                }
-                else
-                {
-                    // We don't search the value of an expandable property.
-                    AddEntriesForPropertyValue(property.ComputedValue, modelItem, property, SearchableEntryOption.Property, propertyPath);
-                }
-            }
-            else if (property.Reference != null)
-            {
-                AddEntriesForPropertyReference(property.Reference, modelItem, property, SearchableEntryOption.Property, propertyPath);
-            }
-        }
-
-        public ModelItem FindModelItem(int startLine, int startColumn, int endLine, int endColumn)
-        {
-            SourceLocation sourceLocation = new SourceLocation(/* fileName = */ null, startLine, startColumn, endLine, endColumn);
-            return designer.ObjectToSourceLocationMapping.FindModelItem(sourceLocation);
-        }
-
-        public ModelItem FindModelItemOfViewState(int startLine, int startColumn, int endLine, int endColumn)
-        {
-            SourceLocation sourceLocation = new SourceLocation(/* fileName = */ null, startLine, startColumn, endLine, endColumn);
-            return designer.ObjectToSourceLocationMapping.FindModelItemOfViewState(sourceLocation);
-        }
-
-        public SourceLocation FindSourceLocation(ModelItem modelItem)
-        {
-            return designer.ObjectToSourceLocationMapping.FindSourceLocation(modelItem);
-        }
-
-        public IEnumerable<object> GetObjectsWithSourceLocation()
-        {
-            return designer.ObjectToSourceLocationMapping.GetObjectsWithSourceLocation();
-        }
-
-        private ModelItem FindModelItemForNavigate(int startLine, int startColumn, int endLine, int endColumn)
-        {
-            // If we search ModelItem first, we will not have a chance to search ViewState because
-            // we will always get an ModelItem, at least the out-most Activity.
-            ModelItem modelItem = this.FindModelItemOfViewState(startLine, startColumn, endLine, endColumn);
-            if (modelItem != null)
-            {
-                return modelItem;
-            }
-
-            return this.FindModelItem(startLine, startColumn, endLine, endColumn);
-        }
-
-        public override bool NavigateTo(int startLine, int startColumn, int endLine, int endColumn)
-        {
-            ModelItem itemToFocus = this.FindModelItemForNavigate(startLine, startColumn, endLine, endColumn);
-
-            return this.NavigateTo(itemToFocus);
-        }
-
-        // Navigate to a ModelItem with the specified location in TextImage. This is for Find Next.
-        public override bool NavigateTo(int location)
-        {
-            if (location < 0 || location >= this.textImageIndexEntryMapping.Count)
-            {
-                return false;
-            }
-
-            SearchableEntry entry = this.textImageIndexEntryMapping[location];
-            return NavigateTo(entry);
-        }
-
-        public bool NavigateTo(ModelItem itemToFocus)
-        {
-            if (itemToFocus == null)
-            {
-                return false;
-            }
-
-            SearchableEntry entry = CreateSearchableEntryForArgumentOrVariable(itemToFocus);
-            if (entry != null)
-            {
-                return this.NavigateTo(entry);
-            }
-
-            itemToFocus = this.FindModelItemToFocus(itemToFocus);
-
-            itemToFocus.Focus();
-
-            return true;
-        }
-
-        private static SearchableEntry CreateSearchableEntryNoRecursive(ModelItem modelItem)
-        {
-            if (typeof(DynamicActivityProperty).IsAssignableFrom(modelItem.ItemType))
-            {
-                return new SearchableEntry
-                {
-                    SearchableEntryType = SearchableEntryOption.Argument,
-                    ModelItem = modelItem
-                };
-            }
-            else if (typeof(Variable).IsAssignableFrom(modelItem.ItemType))
-            {
-                return new SearchableEntry
-                {
-                    SearchableEntryType = SearchableEntryOption.Variable,
-                    ModelItem = modelItem
-                };
-            }
-
-            return null;
-        }
-
-        private static SearchableEntry CreateSearchableEntryForArgumentOrVariable(ModelItem itemToFocus)
-        {
-            SearchableEntry entry = null;
-            ModelUtilities.ReverseTraverse(itemToFocus, (ModelItem modelItem) =>
-            {
-                entry = CreateSearchableEntryNoRecursive(modelItem);
-                return (entry == null);
-            });
-            return entry;
-        }
-
-        private bool NavigateTo(SearchableEntry entry)
-        {
-            if (entry.SearchableEntryType == SearchableEntryOption.Variable)
-            {
-                itemToFocus = entry.ModelItem.Parent.Parent;
-                HighlightModelItem(itemToFocus);
-                this.lastNavigatedItem = itemToFocus;
-                var designerView = this.editingContext.Services.GetService<DesignerView>();
-                // Open the variable designer.
-                designerView.CheckButtonVariables();
-                designerView.variables1.SelectVariable(entry.ModelItem);
-            }
-            else if (entry.SearchableEntryType == SearchableEntryOption.Argument)
-            {
-                itemToFocus = this.modelService.Root;
-                HighlightModelItem(itemToFocus);
-                var designerView = this.editingContext.Services.GetService<DesignerView>();
-                // Open the argument designer.
-                designerView.CheckButtonArguments();
-                designerView.arguments1.SelectArgument(entry.ModelItem);
-                this.lastNavigatedItem = entry.ModelItem;
-            }
-            else
-            {
-                itemToFocus = entry.ModelItem;
-                HighlightModelItem(itemToFocus);
-                this.lastNavigatedItem = itemToFocus;
-                ICommandService commandService = this.editingContext.Services.GetService<ICommandService>();
-                if (commandService != null)
-                {
-                    commandService.ExecuteCommand(CommandValues.ShowProperties, null);
-                }
-
-                PropertyInspector propertiesGrid = this.designer.PropertyInspectorView as PropertyInspector;
-                propertiesGrid.SelectPropertyByPath(entry.PropertyPath);
-                if (ShouldShowSearchToolTip(itemToFocus))
-                {
-                    Dispatcher.CurrentDispatcher.BeginInvoke(new Action(() =>
-                    {
-                        WorkflowViewElement viewElement = itemToFocus.View as WorkflowViewElement;
-                        if (viewElement != null)
-                        {
-                            this.adornerLayer = AdornerLayer.GetAdornerLayer(viewElement as WorkflowViewElement);
-                            if (this.adornerLayer != null)
-                            {
-                                DesignerView designerView = this.editingContext.Services.GetService<DesignerView>();
-                                string toolTipText = string.Format(CultureInfo.CurrentUICulture, SR.SearchHintText, entry.ModelProperty.Name);
-                                this.toolTipAdorner = new SearchToolTipAdorner(viewElement, designerView, toolTipText);
-
-                                viewElement.CustomItemStatus = "SearchToolTip=" + toolTipText;
-                                this.lastWorkflowViewElement = viewElement;
-
-                                this.adornerLayer.Add(this.toolTipAdorner);
-                            }
-                        }
-                    }), DispatcherPriority.ApplicationIdle);
-                }
-            }
-
-            return true;
-        }
-
-        private bool ShouldShowSearchToolTip(ModelItem item)
-        {
-            return !typeof(WorkflowService).IsAssignableFrom(item.ItemType)
-                && !typeof(ActivityBuilder).IsAssignableFrom(item.ItemType);
-        }
-
-        private void HighlightModelItem(ModelItem itemToFocus)
-        {
-            DesignerView designerView = this.editingContext.Services.GetService<DesignerView>();
-            double width = 0.0, height = 0.0;
-            Rect rectToBringIntoView;
-            FrameworkElement fe = (FrameworkElement)itemToFocus.View;
-            if (fe != null)
-            {
-                width = Math.Min(fe.RenderSize.Width, designerView.ScrollViewer.ViewportWidth);
-                height = Math.Min(fe.RenderSize.Height, designerView.ScrollViewer.ViewportHeight);
-                rectToBringIntoView = new Rect(0, 0, width, height);
-            }
-            else
-            {
-                rectToBringIntoView = Rect.Empty;
-            }
-            itemToFocus.Highlight(rectToBringIntoView);
-        }
-
-        private ModelItem FindModelItemToFocus(ModelItem itemToFocus)
-        {
-            WorkflowViewService viewService = this.WorkflowViewService;
-            if (viewService == null || itemToFocus == null)
-            {
-                return itemToFocus;
-            }
-
-            ModelUtilities.ReverseTraverse(itemToFocus, (ModelItem modelItem) =>
-            {
-                if (modelItem == null)
-                {
-                    // continue;
-                    return true;
-                }
-
-                // if the item has Designer, we assume it can get focus.
-                if (CanFocusOnModelItem(modelItem, viewService))
-                {
-                    itemToFocus = modelItem;
-                    // break;
-                    return false;
-                }
-
-                // continue
-                return true;
-            });
-
-            return itemToFocus;
-        }
-
-        private WorkflowViewService WorkflowViewService
-        {
-            get
-            {
-                return (WorkflowViewService)this.editingContext.Services.GetService<ViewService>();
-            }
-        }
-
-        private static bool CanFocusOnModelItem(ModelItem itemToFocus, WorkflowViewService viewService)
-        {
-            Fx.Assert(itemToFocus != null && viewService != null, "null argument");
-
-            if (typeof(ITextExpression).IsAssignableFrom(itemToFocus.ItemType))
-            {
-                return false;
-            }
-
-            Type designerType = viewService.GetDesignerType(itemToFocus.ItemType);
-            return typeof(WorkflowViewElement).IsAssignableFrom(designerType);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelService.cs
deleted file mode 100644 (file)
index 4dd6a63..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-//------------------------------------------------------------------------------
-// <copyright file="ModelService.cs" company="Microsoft">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//------------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Services {
-
-    using System;
-    using System.Collections.Generic;
-    using System.Activities.Presentation.Model;
-
-    /// <summary>
-    /// The ModelService class is the main entry point the designer 
-    /// uses to obtain the model.  The service actually has a split 
-    /// between public and protected methods you must implement.  
-    /// The public methods are (obviously) callable by anyone.  
-    /// The protected methods are invoked by the model.
-    /// </summary>
-    public abstract class ModelService {
-
-        /// <summary>
-        /// Constructs a new ModelService.
-        /// </summary>
-        protected ModelService() {
-        }
-
-        /// <summary>
-        /// The root of the object hierarchy.  For purely linear stores 
-        /// this will be the first object in the store.  For stores that 
-        /// represent a tree of objects this returns the topmost node of 
-        /// the tree.
-        /// </summary>
-        public abstract ModelItem Root { get; }
-
-        /// <summary>
-        /// This event is raised when something in the model has changed.  
-        /// The event args in the event can be used to find what has changed.
-        /// </summary>
-        public abstract event EventHandler<ModelChangedEventArgs> ModelChanged;
-
-        /// <summary>
-        /// Creates a ModelItem for a given type.  This method is called by 
-        /// ModelFactory when the user wishes to create a new item.
-        /// </summary>
-        /// <param name="itemType">
-        /// The type of item to create.
-        /// </param>
-        /// <param name="options">
-        /// Creation options.  You can specify if you would like to initialize 
-        /// default values for an item.
-        /// </param>
-        /// <param name="arguments">
-        /// An array of arguments to the constructor of the item.
-        /// </param>
-        /// <returns>The newly created model item.</returns>
-        /// <exception cref="ArgumentNullException">if itemType is null</exception>
-        protected abstract ModelItem CreateItem(Type itemType, CreateOptions options, params object[] arguments);
-
-        /// <summary>
-        /// Takes an existing instance and creates a model item that is a deep clone
-        /// of the instance.
-        /// </summary>
-        /// <param name="item">
-        /// The item to wrap.
-        /// </param>
-        /// <returns>A newly created model item that is a clone of the existing item.</returns>
-        /// <exception cref="ArgumentNullException">if item is null</exception>
-        protected abstract ModelItem CreateItem(object item);
-
-        /// <summary>
-        /// Create a new model item that represents a the value of a static member of a the given class.
-        /// For example, to add a reference to Brushes.Red to the model call this methods with 
-        /// typeof(Brushes) and the string "Red". This will be serialized into XAML as 
-        /// {x:Static Brushes.Red}.
-        /// </summary>
-        /// <param name="type">
-        /// The type that contains the static member being referenced.
-        /// </param>
-        /// <param name="memberName">
-        /// The name of the static member being referenced.
-        /// </param>
-        protected abstract ModelItem CreateStaticMemberItem(Type type, string memberName);
-
-        /// <summary>
-        /// Finds matching model items given a starting point to look.  All 
-        /// walks are recursive.
-        /// </summary>
-        /// <param name="startingItem">
-        /// The model item to start the search.  Items above this item 
-        /// will be ignored.  This item, and any item below it in the 
-        /// hierarchy, will be included in the search.  If this value is 
-        /// null, the root is used.
-        /// </param>
-        /// <param name="type">
-        /// The type of the object to find.  This will enumerate all items 
-        /// within the given parent scope that are of the requested type.
-        /// </param>
-        /// <returns>
-        /// An enumeration of model items matching the query.
-        /// </returns>
-        /// <exception cref="ArgumentNullException">if type is null</exception>
-        public abstract IEnumerable<ModelItem> Find(ModelItem startingItem, Type type);
-
-        /// <summary>
-        /// Finds matching model items given a starting point to look.  All 
-        /// walks are recursive.
-        /// </summary>
-        /// <param name="startingItem">
-        /// The model item to start the search.  Items above this item 
-        /// will be ignored.  This item, and any item below it in the 
-        /// hierarchy, will be included in the search.  If this value is 
-        /// null, the root is used.
-        /// </param>
-        /// <param name="match">
-        /// A predicate that allows more complex type matching to be used.  
-        /// For example, the predicate could return true for both 
-        /// FrameworkElement and FrameworkContentElement.
-        /// </param>
-        /// <returns>
-        /// An enumeration of model items matching the query.
-        /// </returns>
-        /// <exception cref="ArgumentNullException">if match is null</exception>
-        public abstract IEnumerable<ModelItem> Find(ModelItem startingItem, Predicate<Type> match);
-
-        /// <summary>
-        /// Locates the model item in the given scope with the given name.  Returns null if 
-        /// the model item could not be located.
-        /// </summary>
-        /// <param name="scope">
-        /// An optional scope to provide.  If not provided, the root element will
-        /// be used as a scope.  If provided, the nearest INameScope in the hierarchy
-        /// will be used to locate the item.
-        /// </param>
-        /// <param name="name">
-        /// The name to locate.
-        /// </param>
-        /// <returns>
-        /// A model item whose name matches that provided, or null if no match was
-        /// found.
-        /// </returns>
-        /// <exception cref="ArgumentNullException">If name is null.</exception>
-        public ModelItem FromName(ModelItem scope, string name) {
-            return FromName(scope, name, StringComparison.Ordinal);
-        }
-
-        /// <summary>
-        /// Locates the model item in the given scope with the given name.  Returns null if 
-        /// the model item could not be located.
-        /// </summary>
-        /// <param name="scope">
-        /// An optional scope to provide.  If not provided, the root element will
-        /// be used as a scope.  If provided, the nearest INameScope in the hierarchy
-        /// will be used to locate the item.
-        /// </param>
-        /// <param name="name">
-        /// The name to locate.
-        /// </param>
-        /// <param name="comparison">
-        /// Determines how the name should be compared.  The default is to compare against
-        /// ordinal.
-        /// </param>
-        /// <returns>
-        /// A model item whose name matches that provided, or null if no match was
-        /// found.
-        /// </returns>
-        /// <exception cref="ArgumentNullException">If name is null.</exception>
-        public abstract ModelItem FromName(ModelItem scope, string name, StringComparison comparison);
-
-        /// <summary>
-        /// Creates a ModelItem for a given type.  This method is called by 
-        /// ModelFactory when the user wishes to create a new item.
-        /// </summary>
-        internal ModelItem InvokeCreateItem(Type itemType, CreateOptions options, params object[] arguments) {
-            return CreateItem(itemType, options, arguments);
-        }
-
-        /// <summary>
-        /// Creates a member item that refers to a static member of the given type.
-        /// </summary>
-        internal ModelItem InvokeCreateStaticMemberItem(Type type, string memberName) {
-            return CreateStaticMemberItem(type, memberName);
-        }
-
-        /// <summary>
-        /// Takes an existing instance and wraps it in a ModelItem.  The set 
-        /// properties on the instance are promoted to the model item.
-        /// </summary>
-        internal ModelItem InvokeCreateItem(object item) {
-            return CreateItem(item);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelServiceImpl.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelServiceImpl.cs
deleted file mode 100644 (file)
index 311c217..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.Activities.Presentation.Services;
-    using System.Runtime;
-
-    // This is the implementaion of the ModelService, this is published by the ModelTreeManager
-    // on the editingContext. This is just a facade to the modelTreemanager methods.
-
-    class ModelServiceImpl : ModelService
-    {
-        ModelTreeManager modelTreeManager;
-
-        public ModelServiceImpl(ModelTreeManager modelTreeManager)
-        {
-            if (modelTreeManager == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("modelTreeManager"));
-            }
-            this.modelTreeManager = modelTreeManager;
-        }
-
-        public override event EventHandler<ModelChangedEventArgs> ModelChanged;
-
-        public override ModelItem Root
-        {
-            get
-            {
-                return modelTreeManager.Root;
-            }
-        }
-
-        public override IEnumerable<ModelItem> Find(ModelItem startingItem, Predicate<Type> match)
-        {
-            return ModelTreeManager.Find(startingItem, delegate(ModelItem m) { return match(m.ItemType); }, false);
-        }
-
-        public override IEnumerable<ModelItem> Find(ModelItem startingItem, Type type)
-        {
-            if (startingItem == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("startingItem"));
-            }
-
-            if (type == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("type"));
-            }
-            Fx.Assert(!type.IsValueType, "hmm why would some one search for modelitems for value types?");
-            return ModelTreeManager.Find(startingItem, delegate(ModelItem modelItem)
-            {
-                return type.IsAssignableFrom(modelItem.ItemType);
-            }, false);
-        }
-
-        public override ModelItem FromName(ModelItem scope, string name, StringComparison comparison)
-        {
-            // The workflow component model does not implement a unique named activity object right now
-            // so we cannot support this feature.
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-
-        internal void OnModelItemAdded(ModelItem modelItem, ModelChangeInfo changeInfo)
-        {
-            Fx.Assert(modelItem != null, "modelItem should not be null");
-            if (ModelChanged != null)
-            {
-                Fx.Assert(modelItem != null, "trying to add empty model item");
-                List<ModelItem> modelItemsAdded = new List<ModelItem>(1);
-                modelItemsAdded.Add(modelItem);
-                ModelChanged.Invoke(this, new ModelChangedEventArgsImpl(modelItemsAdded, null, null, changeInfo));
-                modelTreeManager.SyncModelAndText();
-            }
-        }
-
-        internal void OnModelItemRemoved(ModelItem modelItem, ModelChangeInfo changInfo)
-        {
-            Fx.Assert(modelItem != null, "modelItem should not be null");
-            if (ModelChanged != null)
-            {
-                List<ModelItem> modelItemsRemoved = new List<ModelItem>(1);
-                modelItemsRemoved.Add(modelItem);
-                ModelChanged.Invoke(this, new ModelChangedEventArgsImpl(null, modelItemsRemoved, null, changInfo));
-                modelTreeManager.SyncModelAndText();
-            }
-        }
-
-        internal void EmitModelChangeInfo(ModelChangeInfo changInfo)
-        {
-            Fx.Assert(changInfo != null, "changInfo should not be null");
-
-            if (ModelChanged != null)
-            {
-                ModelChanged.Invoke(this, new ModelChangedEventArgsImpl(null, null, null, changInfo));
-                modelTreeManager.SyncModelAndText();
-            }
-        }
-
-        internal void OnModelItemsRemoved(IEnumerable<ModelItem> modelItems)
-        {
-            Fx.Assert(modelItems != null, "modelItem should not be null");
-            if (ModelChanged != null)
-            {
-                List<ModelItem> modelItemsRemoved = new List<ModelItem>();
-                modelItemsRemoved.AddRange(modelItems);
-                ModelChanged.Invoke(this, new ModelChangedEventArgsImpl(null, modelItemsRemoved, null));
-                modelTreeManager.SyncModelAndText();
-            }
-        }
-
-        internal void OnModelPropertyChanged(ModelProperty property, ModelChangeInfo changeInfo)
-        {
-            Fx.Assert(property != null, "property cannot be null");
-            Fx.Assert(changeInfo != null, "changeInfo cannot be null");
-
-            if (ModelChanged != null)
-            {
-                List<ModelProperty> propertiesChanged = new List<ModelProperty>(1);
-                propertiesChanged.Add(property);
-                ModelChanged.Invoke(this, new ModelChangedEventArgsImpl(null, null, propertiesChanged, changeInfo));
-                modelTreeManager.SyncModelAndText();
-            }
-        }
-
-        protected override ModelItem CreateItem(object instance)
-        {
-            return modelTreeManager.CreateModelItem(null, instance);
-        }
-
-        protected override ModelItem CreateItem(Type itemType, CreateOptions options, params object[] arguments)
-        {
-            Object instance = Activator.CreateInstance(itemType, arguments);
-            return modelTreeManager.CreateModelItem(null, instance);
-        }
-
-        protected override ModelItem CreateStaticMemberItem(Type type, string memberName)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-
-        internal ModelItem WrapAsModelItem(object instance)
-        {
-            return CreateItem(instance);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelTreeItemHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelTreeItemHelper.cs
deleted file mode 100644 (file)
index 999cd10..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Runtime;
-
-    // this class is to share common code among classes that implements IModelTreeItem, currently ModelItemImpl, ModelItemCollectionImpl and ModelItemDictionaryImpl
-    internal class ModelTreeItemHelper
-    {
-        private List<BackPointer> extraPropertyBackPointers;
-
-        public ModelTreeItemHelper()
-        {
-            this.extraPropertyBackPointers = new List<BackPointer>();
-        }
-
-        public List<BackPointer> ExtraPropertyBackPointers
-        {
-            get { return this.extraPropertyBackPointers; }
-        }
-
-        public void RemoveExtraPropertyBackPointer(ModelItem parent, string propertyName)
-        {
-            Fx.Assert(parent != null, "parent should not be null");
-            Fx.Assert(!string.IsNullOrEmpty(propertyName), "propertyName should not be null or empty");
-
-            BackPointer backPointer = this.extraPropertyBackPointers.FirstOrDefault<BackPointer>((bp) => bp.DestinationVertex == parent && propertyName == bp.PropertyName);
-            if (backPointer != null)
-            {
-                this.extraPropertyBackPointers.Remove(backPointer);
-            }
-            else
-            {
-                Fx.Assert("BackPointer not found");
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelTreeManager.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelTreeManager.cs
deleted file mode 100644 (file)
index 7944901..0000000
+++ /dev/null
@@ -1,1349 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System.Activities.Expressions;
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Activities.Presentation.Services;
-    using System.Activities.Presentation.Validation;
-    using System.Activities.Presentation.View;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Linq;
-    using System.Runtime;
-    using System.Text;
-    using Microsoft.Activities.Presentation.Xaml;
-
-    // This class manages the model tree, provides the root model item and the modelservice
-    // This also provides syncing the model tree with the xaml text
-    // The model service is publishes on the editing context passed to the constructor.
-
-    [Fx.Tag.XamlVisible(false)]
-    public class ModelTreeManager
-    {
-        internal ModelServiceImpl modelService;
-        EditingContext context;
-        // The value of this dictionary is a WeakReference to ModelItem.
-        // This need to be a WeakReference because if the ModelItem has a strong reference, it 
-        // will have a strong reference to the underlying object instance as well.
-        WeakKeyDictionary<object, WeakReference> objectMap;
-        ModelItem rootItem;
-        ImmediateEditingScope immediateEditingScope;
-        Stack<ModelEditingScope> editingScopes;
-        int redoUndoInProgressCount = 0;
-        FeatureManager featureManager;
-        ModelGraphManager graphManager;
-
-        public ModelTreeManager(EditingContext context)
-        {
-            if (context == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("context"));
-            }
-            this.context = context;
-            // We want to check reference equality for keys in ObjectMap. 
-            // If the user overrides Equals method for their class we still want to use referential equality.
-            objectMap = new WeakKeyDictionary<object, WeakReference>(ObjectReferenceEqualityComparer<object>.Default);
-            editingScopes = new Stack<ModelEditingScope>();
-            this.graphManager = new ModelGraphManager(this);
-        }
-
-        public event EventHandler<EditingScopeEventArgs> EditingScopeCompleted;
-
-        // Private event only for EditingScope.
-        private event EventHandler<ModelItemsRemovedEventArgs> ModelItemsRemoved;
-
-        private event EventHandler<ModelItemsAddedEventArgs> ModelItemsAdded;
-
-        public ModelItem Root
-        {
-            get
-            {
-                return this.rootItem;
-            }
-        }
-
-        internal EditingContext Context
-        {
-            get
-            {
-                return this.context;
-            }
-        }
-
-        FeatureManager FeatureManager
-        {
-            get
-            {
-                if (this.featureManager == null)
-                {
-                    this.featureManager = this.context.Services.GetService<FeatureManager>();
-                }
-                return this.featureManager;
-            }
-        }
-
-        internal bool RedoUndoInProgress
-        {
-            get
-            {
-                return this.redoUndoInProgressCount > 0;
-            }
-        }
-
-        internal void StartTracking()
-        {
-            redoUndoInProgressCount--;
-        }
-
-        internal void StopTracking()
-        {
-            redoUndoInProgressCount++;
-        }
-
-        public ModelItem CreateModelItem(ModelItem parent, object instance)
-        {
-            if (instance == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("instance"));
-            }
-            ModelItem retval;
-
-            Type instanceType = instance.GetType();
-            object[] result = new object[2] { false, false };
-
-            Type[] interfaces = instanceType.FindInterfaces(ModelTreeManager.CheckInterface, result);
-
-            bool isList = (bool)result[0];
-            bool isDictionary = (bool)result[1];
-
-            if (isDictionary)
-            {
-                foreach (Type type in interfaces)
-                {
-                    if (type.GetGenericTypeDefinition() == typeof(IDictionary<,>))
-                    {
-                        // To expose one more property, a collection of MutableKeyValuePairs, to the model tree.
-                        TypeDescriptor.AddProvider(new DictionaryTypeDescriptionProvider(instanceType), instance);
-                        break;
-                    }
-                }
-
-                ModelItemDictionary modelItem = new ModelItemDictionaryImpl(this, instance.GetType(), instance, parent);
-                retval = modelItem;
-            }
-            else if (isList)
-            {
-                ModelItemCollectionImpl modelItem = new ModelItemCollectionImpl(this, instance.GetType(), instance, parent);
-                retval = modelItem;
-            }
-            else
-            {
-                retval = new ModelItemImpl(this, instance.GetType(), instance, parent);
-            }
-            if (!((instance is ValueType) || (instance is string)))
-            {
-                //
-                // ValueType do not have a concept of shared reference, they are always copied.
-                // strings are immutatable, therefore the risk of making all shared string references to different
-                // string ModelItems is low.
-                // 
-                // To special case string is because underlying OM are sharing string objects for DisplayName across
-                // Different activity object instances. These shared references is causing memory leak because of bugs.
-                // 
-                // We will need to fix these issues in Beta2.
-                //
-                objectMap[instance] = new WeakReference(retval);
-            }
-
-            if (this.FeatureManager != null)
-            {
-                this.FeatureManager.InitializeFeature(instance.GetType());
-            }
-            return retval;
-        }
-
-        static bool CheckInterface(Type type, object result)
-        {
-            object[] values = (object[])result;
-            if (typeof(IList).IsAssignableFrom(type))
-            {
-                values[0] = true;
-                return true;
-            }
-            if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(IList<>))
-            {
-                values[0] = true;
-                return true;
-            }
-            if (typeof(IDictionary).IsAssignableFrom(type))
-            {
-                values[1] = true;
-                return true;
-            }
-            if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(IDictionary<,>))
-            {
-                values[1] = true;
-                return true;
-            }
-            return false;
-        }
-
-        public void Load(object rootInstance)
-        {
-            if (rootInstance == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("rootInstance"));
-            }
-            objectMap.Clear();
-
-            ModelItem oldRoot = this.rootItem;
-            this.rootItem = WrapAsModelItem(rootInstance);
-            this.graphManager.OnRootChanged(oldRoot, this.rootItem);
-            if (this.modelService == null)
-            {
-                this.modelService = new ModelServiceImpl(this);
-                this.context.Services.Publish<ModelService>(modelService);
-            }
-        }
-
-        // This methods clears the value of a property , if the property is
-        // a reference type then its set to null, if its a value type the 
-        // property value is reset to the default. this also clears the sub ModelItem corresponding
-        // to the old value from the parent ModelItem's modelPropertyStore.
-        internal void ClearValue(ModelPropertyImpl modelProperty)
-        {
-            Fx.Assert(modelProperty != null, "modelProperty should not be null");
-            Fx.Assert(modelProperty.Parent is IModelTreeItem, "modelProperty.Parent should be an IModelTreeItem");
-            ModelItem newValueModelItem = null;
-            newValueModelItem = WrapAsModelItem(modelProperty.DefaultValue);
-            PropertyChange propertyChange = new PropertyChange()
-                {
-                    Owner = modelProperty.Parent,
-                    PropertyName = modelProperty.Name,
-                    OldValue = modelProperty.Value,
-                    NewValue = newValueModelItem,
-                    ModelTreeManager = this
-                };
-            AddToCurrentEditingScope(propertyChange);
-        }
-
-        internal void CollectionAdd(ModelItemCollectionImpl dataModelItemCollection, ModelItem item)
-        {
-            CollectionInsert(dataModelItemCollection, -1, item);
-        }
-
-        internal void CollectionInsert(ModelItemCollectionImpl dataModelItemCollection, int index, ModelItem item)
-        {
-            Fx.Assert(dataModelItemCollection != null, "collection should not be null");
-            CollectionChange change = new CollectionChange()
-                {
-                    Collection = dataModelItemCollection,
-                    Item = item,
-                    Index = index,
-                    ModelTreeManager = this,
-                    Operation = CollectionChange.OperationType.Insert
-                };
-            AddToCurrentEditingScope(change);
-        }
-
-        internal void CollectionClear(ModelItemCollectionImpl modelItemCollectionImpl)
-        {
-            Fx.Assert(modelItemCollectionImpl != null, "collection should not be null");
-            Fx.Assert(this.modelService != null, "modelService should not be null");
-            List<ModelItem> removedItems = new List<ModelItem>();
-            removedItems.AddRange(modelItemCollectionImpl);
-            using (ModelEditingScope editingScope = CreateEditingScope(SR.CollectionClearEditingScopeDescription))
-            {
-                foreach (ModelItem modelItem in removedItems)
-                {
-                    this.CollectionRemove(modelItemCollectionImpl, modelItem);
-                }
-                editingScope.Complete();
-            }
-            this.modelService.OnModelItemsRemoved(removedItems);
-        }
-
-        internal void NotifyCollectionInsert(ModelItem item, ModelChangeInfo changeInfo)
-        {
-            this.modelService.OnModelItemAdded(item, changeInfo);
-        }
-
-        internal void CollectionRemove(ModelItemCollectionImpl dataModelItemCollection, ModelItem item)
-        {
-            CollectionRemove(dataModelItemCollection, item, -1);
-        }
-
-        internal void CollectionRemoveAt(ModelItemCollectionImpl dataModelItemCollection, int index)
-        {
-            ModelItem item = dataModelItemCollection[index];
-            CollectionRemove(dataModelItemCollection, item, index);
-        }
-
-        private void CollectionRemove(ModelItemCollectionImpl dataModelItemCollection, ModelItem item, int index)
-        {
-            Fx.Assert(dataModelItemCollection != null, "collection should not be null");
-            CollectionChange change = new CollectionChange()
-                {
-                    Collection = dataModelItemCollection,
-                    Item = item,
-                    Index = index,
-                    ModelTreeManager = this,
-                    Operation = CollectionChange.OperationType.Delete
-                };
-            AddToCurrentEditingScope(change);
-        }
-
-        internal void NotifyCollectionRemove(ModelItem item, ModelChangeInfo changeInfo)
-        {
-            this.modelService.OnModelItemRemoved(item, changeInfo);
-        }
-
-        internal void DictionaryClear(ModelItemDictionaryImpl modelDictionary)
-        {
-            Fx.Assert(modelDictionary != null, "dictionary should not be null");
-            Fx.Assert(this.modelService != null, "modelService should not be null");
-            ModelItem[] keys = modelDictionary.Keys.ToArray<ModelItem>();
-
-            using (ModelEditingScope editingScope = CreateEditingScope(SR.DictionaryClearEditingScopeDescription))
-            {
-                foreach (ModelItem key in keys)
-                {
-                    this.DictionaryRemove(modelDictionary, key);
-                }
-                editingScope.Complete();
-            }
-        }
-
-        internal void DictionaryEdit(ModelItemDictionaryImpl dataModelItemDictionary, ModelItem key, ModelItem newValue, ModelItem oldValue)
-        {
-            Fx.Assert(dataModelItemDictionary != null, "dictionary should not be null");
-            Fx.Assert(this.modelService != null, "modelService should not be null");
-            DictionaryEditChange change = new DictionaryEditChange()
-                {
-                    Dictionary = dataModelItemDictionary,
-                    Key = key,
-                    NewValue = newValue,
-                    OldValue = oldValue,
-                    ModelTreeManager = this
-                };
-            AddToCurrentEditingScope(change);
-        }
-
-        internal void DictionaryAdd(ModelItemDictionaryImpl dataModelItemDictionary, ModelItem key, ModelItem value)
-        {
-            Fx.Assert(dataModelItemDictionary != null, "dictionary should not be null");
-            Fx.Assert(this.modelService != null, "modelService should not be null");
-            DictionaryChange change = new DictionaryChange()
-                {
-                    Dictionary = dataModelItemDictionary,
-                    Key = key,
-                    Value = value,
-                    Operation = DictionaryChange.OperationType.Insert,
-                    ModelTreeManager = this
-                };
-            AddToCurrentEditingScope(change);
-        }
-
-        internal void OnPropertyEdgeAdded(string propertyName, ModelItem from, ModelItem to)
-        {
-            this.graphManager.OnPropertyEdgeAdded(propertyName, from, to);
-        }
-
-        internal void OnItemEdgeAdded(ModelItem from, ModelItem to)
-        {
-            this.graphManager.OnItemEdgeAdded(from, to);
-        }
-
-        internal void OnPropertyEdgeRemoved(string propertyName, ModelItem from, ModelItem to)
-        {
-            this.graphManager.OnPropertyEdgeRemoved(propertyName, from, to);
-        }
-
-        internal void OnItemEdgeRemoved(ModelItem from, ModelItem to)
-        {
-            this.graphManager.OnItemEdgeRemoved(from, to);
-        }
-
-        internal void DictionaryRemove(ModelItemDictionaryImpl dataModelItemDictionary, ModelItem key)
-        {
-            Fx.Assert(dataModelItemDictionary != null, "dictionary should not be null");
-            Fx.Assert(this.modelService != null, "modelService should not be null");
-            ModelItem value = dataModelItemDictionary[key];
-            DictionaryChange change = new DictionaryChange()
-                {
-                    Dictionary = dataModelItemDictionary,
-                    Key = key,
-                    Value = value,
-                    Operation = DictionaryChange.OperationType.Delete,
-                    ModelTreeManager = this
-                };
-            AddToCurrentEditingScope(change);
-
-        }
-
-        internal static IEnumerable<ModelItem> Find(ModelItem startingItem, Predicate<ModelItem> matcher, bool skipCollapsedAndUnrootable)
-        {
-            Fx.Assert(startingItem != null, "starting item should not be null");
-            Fx.Assert(matcher != null, "matching predicate should not be null");
-            WorkflowViewService viewService = startingItem.GetEditingContext().Services.GetService<ViewService>() as WorkflowViewService;
-            if (skipCollapsedAndUnrootable)
-            {
-                Fx.Assert(viewService != null, "ViewService must be available in order to skip exploring ModelItems whose views are collapsed.");
-            }
-
-            Predicate<ModelItem> shouldSearchThroughProperties = (currentModelItem) => (!skipCollapsedAndUnrootable)
-                || (!typeof(WorkflowViewElement).IsAssignableFrom(viewService.GetDesignerType(currentModelItem.ItemType)))
-                || (ViewUtilities.IsViewExpanded(currentModelItem, startingItem.GetEditingContext()) && viewService.ShouldAppearOnBreadCrumb(currentModelItem, true));
-
-            List<ModelItem> foundItems = new List<ModelItem>();
-            Queue<ModelItem> modelItems = new Queue<ModelItem>();
-            modelItems.Enqueue(startingItem);
-            HashSet<ModelItem> alreadyVisited = new HashSet<ModelItem>();
-            while (modelItems.Count > 0)
-            {
-                ModelItem currentModelItem = modelItems.Dequeue();
-                if (currentModelItem == null)
-                {
-                    continue;
-                }
-
-                if (matcher(currentModelItem))
-                {
-                    foundItems.Add(currentModelItem);
-                }
-
-                List<ModelItem> neighbors = GetNeighbors(currentModelItem, shouldSearchThroughProperties);
-
-                foreach (ModelItem neighbor in neighbors)
-                {
-                    if (!alreadyVisited.Contains(neighbor))
-                    {
-                        alreadyVisited.Add(neighbor);
-                        modelItems.Enqueue(neighbor);
-                    }
-                }
-            }
-
-            return foundItems;
-        }
-
-        private static List<ModelItem> GetNeighbors(ModelItem currentModelItem, Predicate<ModelItem> extraShouldSearchThroughProperties)
-        {
-            List<ModelItem> neighbors = new List<ModelItem>();
-
-            // do not search through Type and its derivatives
-            if (typeof(Type).IsAssignableFrom(currentModelItem.ItemType))
-            {
-                return neighbors;
-            }
-
-            ModelItemCollection collection = currentModelItem as ModelItemCollection;
-            if (collection != null)
-            {
-                foreach (ModelItem modelItem in collection)
-                {
-                    if (modelItem != null)
-                    {
-                        neighbors.Add(modelItem);
-                    }
-                }
-            }
-            else
-            {
-                ModelItemDictionary dictionary = currentModelItem as ModelItemDictionary;
-                if (dictionary != null)
-                {
-                    foreach (KeyValuePair<ModelItem, ModelItem> kvp in dictionary)
-                    {
-                        ModelItem miKey = kvp.Key;
-                        if (miKey != null)
-                        {
-                            neighbors.Add(miKey);
-                        }
-
-                        ModelItem miValue = kvp.Value;
-                        if (miValue != null)
-                        {
-                            neighbors.Add(miValue);
-                        }
-                    }
-                }
-            }
-
-            if (extraShouldSearchThroughProperties(currentModelItem))
-            {
-                ModelPropertyCollection modelProperties = currentModelItem.Properties;
-                foreach (ModelProperty property in modelProperties)
-                {
-                    if (currentModelItem is ModelItemDictionary && string.Equals(property.Name, "ItemsCollection"))
-                    {
-                        // Don't search the item collection since we already search the items above.
-                        continue;
-                    }
-
-                    // we don't want to even try to get the value for a value type property
-                    // because that will create a new ModelItem every time.
-
-                    // System.Type has properties that throw when we try to get value
-                    // we don't want to expand system.type further during a search.
-                    if (typeof(Type).IsAssignableFrom(property.PropertyType) || property.PropertyType.IsValueType)
-                    {
-                        continue;
-                    }
-
-                    else
-                    {
-                        if (property.Value != null)
-                        {
-                            neighbors.Add(property.Value);
-                        }
-                    }
-                }
-            }
-
-            return neighbors;
-        }
-
-        internal static ModelItem FindFirst(ModelItem startingItem, Predicate<ModelItem> matcher)
-        {
-            return FindFirst(startingItem, matcher, (m) => true);
-        }
-
-        internal static ModelItem FindFirst(ModelItem startingItem, Predicate<ModelItem> matcher, Predicate<ModelItem> extraShouldSearchThroughProperties)
-        {
-            Fx.Assert(startingItem != null, "starting item should not be null");
-            Fx.Assert(matcher != null, "matching predicate should not be null");
-            Fx.Assert(extraShouldSearchThroughProperties != null, "extraShouldSearchThroughProperties should not be null");
-            ModelItem foundItem = null;
-            Queue<ModelItem> modelItems = new Queue<ModelItem>();
-            modelItems.Enqueue(startingItem);
-            HashSet<ModelItem> alreadyVisited = new HashSet<ModelItem>();
-            while (modelItems.Count > 0)
-            {
-                ModelItem currentModelItem = modelItems.Dequeue();
-                if (currentModelItem == null)
-                {
-                    continue;
-                }
-
-                if (matcher(currentModelItem))
-                {
-                    foundItem = currentModelItem;
-                    break;
-                }
-
-                List<ModelItem> neighbors = GetNeighbors(currentModelItem, extraShouldSearchThroughProperties);
-
-                foreach (ModelItem neighbor in neighbors)
-                {
-                    if (!alreadyVisited.Contains(neighbor))
-                    {
-                        alreadyVisited.Add(neighbor);
-                        modelItems.Enqueue(neighbor);
-                    }
-                }
-            }
-            return foundItem;
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
-          Justification = "If the property getter threw here we dont want to crash, we just dont want to wrap that property value")]
-        [SuppressMessage("Reliability", "Reliability108:IsFatalRule",
-            Justification = "If the property getter threw here we dont want to crash, we just dont want to wrap that property value")]
-        internal ModelItem GetValue(ModelPropertyImpl dataModelProperty)
-        {
-            Fx.Assert(dataModelProperty != null, "modelproperty should not be null");
-            Fx.Assert(dataModelProperty.Parent is IModelTreeItem, "modelproperty.Parent should be an IModelTreeItem");
-            IModelTreeItem parent = (IModelTreeItem)dataModelProperty.Parent;
-            ModelItem value;
-
-            // always reevaluate attached properties. the cache in attached properties case is only to remember the old value.
-            if (!dataModelProperty.IsAttached && parent.ModelPropertyStore.ContainsKey(dataModelProperty.Name))
-            {
-                value = parent.ModelPropertyStore[dataModelProperty.Name];
-            }
-            // Create a ModelItem on demand for the value of the property.
-            else
-            {
-                try
-                {
-                    value = WrapAsModelItem(dataModelProperty.PropertyDescriptor.GetValue(parent.ModelItem.GetCurrentValue()));
-                }
-                catch (System.Exception)
-                {
-                    // GetValue throws an exception if Value is not available
-                    value = null;
-                }
-                if (value != null)
-                {
-                    if (!dataModelProperty.IsAttached)
-                    {
-                        parent.ModelPropertyStore.Add(dataModelProperty.Name, value);
-                        this.graphManager.OnPropertyEdgeAdded(dataModelProperty.Name, (ModelItem)parent, value);
-                    }
-                }
-            }
-            return value;
-        }
-
-        internal ModelItem SetValue(ModelPropertyImpl modelProperty, object value)
-        {
-            Fx.Assert(modelProperty != null, "modelProperty should not be null");
-            ModelItem newValueModelItem = null;
-
-            RefreshPropertiesAttribute refreshPropertiesAttribute = ExtensibilityAccessor.GetAttribute<RefreshPropertiesAttribute>(modelProperty.Attributes);
-            if (refreshPropertiesAttribute != null && refreshPropertiesAttribute.RefreshProperties == RefreshProperties.All)
-            {
-                Dictionary<string, ModelItem> modelPropertyStore = ((IModelTreeItem)modelProperty.Parent).ModelPropertyStore;
-                Dictionary<string, ModelItem> removedModelItems = new Dictionary<string, ModelItem>(modelPropertyStore);
-                modelPropertyStore.Clear();
-
-                foreach (KeyValuePair<string, ModelItem> kvp in removedModelItems)
-                {
-                    if (kvp.Value != null)
-                    {
-                        this.OnPropertyEdgeRemoved(kvp.Key, modelProperty.Parent, kvp.Value);
-                    }
-                }
-            }
-
-            if (value is ModelItem)
-            {
-                newValueModelItem = (ModelItem)value;
-            }
-            else
-            {
-                newValueModelItem = WrapAsModelItem(value);
-            }
-            // dont do deferred updates for attached properties
-            if (modelProperty.IsAttached)
-            {
-                modelProperty.SetValueCore(newValueModelItem);
-            }
-            else
-            {
-                PropertyChange propertyChange = new PropertyChange()
-                {
-                    Owner = modelProperty.Parent,
-                    PropertyName = modelProperty.Name,
-                    OldValue = modelProperty.Value,
-                    NewValue = newValueModelItem,
-                    ModelTreeManager = this
-                };
-                AddToCurrentEditingScope(propertyChange);
-            }
-
-
-            return newValueModelItem;
-        }
-
-        internal void AddToCurrentEditingScope(Change change)
-        {
-            EditingScope editingScope;
-            if (editingScopes.Count > 0)
-            {
-                editingScope = (EditingScope)editingScopes.Peek();
-                // Automatic generated change during apply changes of Redo/Undo should be ignored.
-                if (!RedoUndoInProgress)
-                {
-                    editingScope.Changes.Add(change);
-                }
-            }
-            else
-            {
-                //edit operation without editingscope create an editing scope and complete it immediately.
-                editingScope = CreateEditingScope(change.Description);
-                editingScope.Changes.Add(change);
-                try
-                {
-                    editingScope.Complete();
-                }
-                catch
-                {
-                    editingScope.Revert();
-                    throw;
-                }
-
-            }
-        }
-
-        internal bool CanCreateImmediateEditingScope()
-        {
-            return this.editingScopes.Count == 0 && !this.Context.Services.GetService<UndoEngine>().IsBookmarkInPlace;
-        }
-
-        internal EditingScope CreateEditingScope(string description, bool shouldApplyChangesImmediately)
-        {
-            EditingScope editingScope = null;
-            EditingScope outerScope = editingScopes.Count > 0 ? (EditingScope)editingScopes.Peek() : null;
-            if (shouldApplyChangesImmediately)
-            {
-                // shouldApplyChangesImmediately won't have any effect if outer scope exists
-                if (outerScope != null)
-                {
-                    return null;
-                }
-                this.immediateEditingScope = context.Services.GetRequiredService<UndoEngine>().CreateImmediateEditingScope(description, this);
-                editingScope = this.immediateEditingScope;
-                // ImmediateEditingScope should not be pushed onto the editingScopes,
-                //  otherwise it will become delay applied instead of immediate applied.
-            }
-            else
-            {
-                editingScope = new EditingScope(this, outerScope);
-                editingScopes.Push(editingScope);
-            }
-            editingScope.Description = description;
-            return editingScope;
-        }
-
-        internal EditingScope CreateEditingScope(string description)
-        {
-            return this.CreateEditingScope(description, false);
-        }
-
-        internal void NotifyPropertyChange(ModelPropertyImpl dataModelProperty, ModelChangeInfo changeInfo)
-        {
-            modelService.OnModelPropertyChanged(dataModelProperty, changeInfo);
-        }
-
-        internal void SyncModelAndText()
-        {
-            // Place holder for xaml generation ModelTreeManager now is instance only.
-        }
-
-        internal ModelItem WrapAsModelItem(object instance)
-        {
-            ModelItem modelItem = GetModelItem(instance);
-
-            if (null != instance && null == modelItem)
-            {
-                modelItem = CreateModelItem(null, instance);
-            }
-            return modelItem;
-        }
-
-        internal ModelItem GetModelItem(object instance)
-        {
-            return this.GetModelItem(instance, false);
-        }
-
-        public ModelItem GetModelItem(object instance, bool shouldExpandModelTree)
-        {
-            if (instance == null)
-            {
-                return null;
-            }
-
-            ModelItem modelItem = null;
-            WeakReference mappedModelItem = null;
-            objectMap.TryGetValue(instance, out mappedModelItem);
-            if (mappedModelItem != null)
-            {
-                modelItem = (ModelItem)mappedModelItem.Target;
-            }
-
-            if (modelItem == null && shouldExpandModelTree)
-            {
-                if (instance is ValueType || instance is string)
-                {
-                    return null;
-                }
-
-                modelItem = FindFirst(this.Root, (m) => { return m.GetCurrentValue() == instance; });
-            }
-
-            return modelItem;
-        }
-
-        internal void RegisterModelTreeChangeEvents(EditingScope editingScope)
-        {
-            this.ModelItemsAdded += editingScope.EditingScope_ModelItemsAdded;
-            this.ModelItemsRemoved += editingScope.EditingScope_ModelItemsRemoved;
-        }
-
-        internal void UnregisterModelTreeChangeEvents(EditingScope editingScope)
-        {
-            this.ModelItemsAdded -= editingScope.EditingScope_ModelItemsAdded;
-            this.ModelItemsRemoved -= editingScope.EditingScope_ModelItemsRemoved;
-        }
-
-        // The method should be called when an EditingScope completed. But if the EditingScope has an outer EditingScope,
-        // Changes are not applied, so itemsAdded and itemsRemoved won't update until the outer EditingScope.Complete()
-        internal void OnEditingScopeCompleted(EditingScope modelEditingScopeImpl)
-        {
-            if (editingScopes.Contains(modelEditingScopeImpl))
-            {
-                editingScopes.Pop();
-            }
-
-            if (editingScopes.Count == 0 && this.immediateEditingScope != null)
-            {
-                // if immediateEditingScope is in place and last nested normal editing scope completes,
-                // we copy the information from the nested normal editing scope to the immediateEditingScope
-                // and put the Changes into undo engine, so that when immediateEditingScope completes the undo unit
-                // generated by nested editing scope will be collected as one undo unit
-                if (this.immediateEditingScope != modelEditingScopeImpl)
-                {
-                    UndoEngine undoEngine = this.Context.Services.GetService<UndoEngine>();
-
-                    this.immediateEditingScope.Changes.AddRange(modelEditingScopeImpl.Changes);
-                    this.immediateEditingScope.HasModelChanges = this.immediateEditingScope.HasModelChanges || modelEditingScopeImpl.HasModelChanges;
-                    this.immediateEditingScope.HasEffectiveChanges = this.immediateEditingScope.HasEffectiveChanges || modelEditingScopeImpl.HasEffectiveChanges;
-                    this.immediateEditingScope.HandleModelItemsAdded(modelEditingScopeImpl.ItemsAdded);
-                    this.immediateEditingScope.HandleModelItemsRemoved(modelEditingScopeImpl.ItemsRemoved);
-
-                    if (modelEditingScopeImpl.HasEffectiveChanges)
-                    {
-                        if (!this.RedoUndoInProgress && !modelEditingScopeImpl.SuppressUndo && undoEngine != null)
-                        {
-                            undoEngine.AddUndoUnit(new EditingScopeUndoUnit(this.Context, this, modelEditingScopeImpl));
-                        }
-                    }
-                }
-            }
-
-            if (editingScopes.Count == 0 && !(modelEditingScopeImpl is ImmediateEditingScope) && modelEditingScopeImpl.HasModelChanges)
-            {
-                if (!modelEditingScopeImpl.SuppressValidationOnComplete)
-                {
-                    ValidationService validationService = this.Context.Services.GetService<ValidationService>();
-                    if (validationService != null)
-                    {
-                        validationService.ValidateWorkflow(ValidationReason.ModelChange);
-                    }
-                }
-            }
-
-            if (this.immediateEditingScope == modelEditingScopeImpl)
-            {
-                this.immediateEditingScope = null;
-            }
-
-            // if the outer most scope completed notify listeners
-            if (this.EditingScopeCompleted != null && editingScopes.Count == 0 && this.immediateEditingScope == null)
-            {
-                this.EditingScopeCompleted(this, new EditingScopeEventArgs() { EditingScope = modelEditingScopeImpl });
-            }
-
-            Fx.Assert(editingScopes.Count == 0 || (modelEditingScopeImpl.ItemsAdded.Count == 0 && modelEditingScopeImpl.ItemsRemoved.Count == 0), "Inner editing scope shouldn't have changes applied.");
-#if DEBUG
-            this.graphManager.VerifyBackPointers();
-#endif
-        }
-
-        internal bool CanEditingScopeComplete(EditingScope modelEditingScopeImpl)
-        {
-            ReadOnlyState readOnlyState = this.Context.Items.GetValue<ReadOnlyState>();
-            return (modelEditingScopeImpl == editingScopes.Peek()) && (readOnlyState == null || !readOnlyState.IsReadOnly);
-        }
-
-        internal void OnEditingScopeReverted(EditingScope modelEditingScopeImpl)
-        {
-            if (editingScopes.Contains(modelEditingScopeImpl))
-            {
-                editingScopes.Pop();
-            }
-
-            if (this.immediateEditingScope == modelEditingScopeImpl)
-            {
-                this.immediateEditingScope = null;
-            }
-        }
-
-        internal static IList<ModelItem> DepthFirstSearch(ModelItem currentItem, Predicate<Type> filter, Predicate<ModelItem> shouldTraverseSubTree, bool preOrder)
-        {
-            IList<ModelItem> foundItems = new List<ModelItem>();
-            HashSet<ModelItem> alreadyVisitedItems = new HashSet<ModelItem>();
-            RecursiveDepthFirstSearch(currentItem, filter, shouldTraverseSubTree, foundItems, alreadyVisitedItems, preOrder);
-            return foundItems;
-        }
-
-        private static void RecursiveDepthFirstSearch(ModelItem currentItem, Predicate<Type> filter, Predicate<ModelItem> shouldTraverseSubTree, IList<ModelItem> foundItems, HashSet<ModelItem> alreadyVisitedItems, bool preOrder)
-        {
-            if (currentItem == null)
-            {
-                return;
-            }
-
-            if (typeof(Type).IsAssignableFrom(currentItem.ItemType))
-            {
-                return;
-            }
-
-            if (currentItem.ItemType.IsGenericType && currentItem.ItemType.GetGenericTypeDefinition() == typeof(Action<>))
-            {
-                return;
-            }
-
-            if (!shouldTraverseSubTree(currentItem))
-            {
-                return;
-            }
-
-            if (preOrder)
-            {
-                if (filter(currentItem.ItemType))
-                {
-                    foundItems.Add(currentItem);
-                }
-            }
-
-            alreadyVisitedItems.Add(currentItem);
-
-            List<ModelItem> neighbors = GetNeighbors(currentItem, (m) => true);
-            foreach (ModelItem neighbor in neighbors)
-            {
-                if (!alreadyVisitedItems.Contains(neighbor))
-                {
-                    RecursiveDepthFirstSearch(neighbor, filter, shouldTraverseSubTree, foundItems, alreadyVisitedItems, preOrder);
-                }
-            }
-
-            if (!preOrder)
-            {
-                if (filter(currentItem.ItemType))
-                {
-                    foundItems.Add(currentItem);
-                }
-            }
-        }
-
-        private void OnModelItemsAdded(IEnumerable<ModelItem> addedModelItems)
-        {
-            Fx.Assert(addedModelItems != null, "addedModelItems should not be null.");
-            EventHandler<ModelItemsAddedEventArgs> tempModelItemsAdded = this.ModelItemsAdded;
-            if (tempModelItemsAdded != null)
-            {
-                tempModelItemsAdded(this, new ModelItemsAddedEventArgs(addedModelItems));
-            }
-        }
-
-        private void OnModelItemsRemoved(IEnumerable<ModelItem> removedModelItems)
-        {
-            Fx.Assert(removedModelItems != null, "removedModelItems should not be null.");
-            EventHandler<ModelItemsRemovedEventArgs> tempModelItemsRemoved = this.ModelItemsRemoved;
-            if (tempModelItemsRemoved != null)
-            {
-                tempModelItemsRemoved(this, new ModelItemsRemovedEventArgs(removedModelItems));
-            }
-        }
-
-        internal class ModelGraphManager : GraphManager<ModelItem, Edge, BackPointer>
-        {
-            private ModelTreeManager modelTreeManager;
-
-            public ModelGraphManager(ModelTreeManager modelTreeManager)
-            {
-                Fx.Assert(modelTreeManager != null, "modelTreeManager should not be null");
-
-                this.modelTreeManager = modelTreeManager;
-            }
-
-            public void OnPropertyEdgeAdded(string propertyName, ModelItem from, ModelItem to)
-            {
-                base.OnEdgeAdded(new Edge(propertyName, from, to));
-            }
-
-            public void OnItemEdgeAdded(ModelItem from, ModelItem to)
-            {
-                base.OnEdgeAdded(new Edge(from, to));
-            }
-
-            public void OnPropertyEdgeRemoved(string propertyName, ModelItem from, ModelItem to)
-            {
-                base.OnEdgeRemoved(new Edge(propertyName, from, to));
-            }
-
-            public void OnItemEdgeRemoved(ModelItem from, ModelItem to)
-            {
-                base.OnEdgeRemoved(new Edge(from, to));
-            }
-
-            public new void OnRootChanged(ModelItem oldRoot, ModelItem newRoot)
-            {
-                base.OnRootChanged(oldRoot, newRoot);
-            }
-
-            protected override ModelItem Root
-            {
-                get { return this.modelTreeManager.Root; }
-            }
-
-            protected override IEnumerable<ModelItem> GetVertices()
-            {
-                foreach (WeakReference weakReference in this.modelTreeManager.objectMap.Values)
-                {
-                    ModelItem modelItem = weakReference.Target as ModelItem;
-                    if (modelItem != null)
-                    {
-                        yield return modelItem;
-                    }
-                }
-            }
-
-            // This method will not expand any ModelItem
-            protected override IEnumerable<Edge> GetOutEdges(ModelItem vertex)
-            {
-                Fx.Assert(vertex != null, "vertex should not be null");
-
-                List<Edge> edges = new List<Edge>();
-
-                foreach (KeyValuePair<string, ModelItem> kvp in ((IModelTreeItem)vertex).ModelPropertyStore)
-                {
-                    if (kvp.Value != null)
-                    {
-                        edges.Add(new Edge(kvp.Key, vertex, kvp.Value));
-                    }
-                }
-
-                ModelItemCollection collection = vertex as ModelItemCollection;
-                if (collection != null)
-                {
-                    foreach (ModelItem modelItem in collection.Distinct())
-                    {
-                        if (modelItem != null)
-                        {
-                            edges.Add(new Edge(vertex, modelItem));
-                        }
-                    }
-                }
-
-                ModelItemDictionaryImpl dictionary = vertex as ModelItemDictionaryImpl;
-                if (dictionary != null)
-                {
-                    List<ModelItem> items = new List<ModelItem>(dictionary.Keys);
-                    items.AddRange(dictionary.Values);
-                    items.Add(dictionary.updateKeySavedValue);
-                    foreach (ModelItem modelItem in items.Distinct())
-                    {
-                        if (modelItem != null)
-                        {
-                            edges.Add(new Edge(vertex, modelItem));
-                        }
-                    }
-                }
-
-                return edges;
-            }
-
-            protected override IEnumerable<BackPointer> GetBackPointers(ModelItem vertex)
-            {
-                List<BackPointer> backPointers = new List<BackPointer>();
-
-                foreach (ModelItem parent in ((IModelTreeItem)vertex).ItemBackPointers)
-                {
-                    backPointers.Add(new BackPointer(vertex, parent));
-                }
-
-                foreach (ModelProperty property in vertex.Sources)
-                {
-                    backPointers.Add(new BackPointer(property.Name, vertex, property.Parent));
-                }
-
-                foreach (BackPointer backPointer in ((IModelTreeItem)vertex).ExtraPropertyBackPointers)
-                {
-                    backPointers.Add(backPointer);
-                }
-
-                return backPointers;
-            }
-
-            protected override ModelItem GetDestinationVertexFromEdge(Edge edge)
-            {
-                return edge.DestinationVertex;
-            }
-
-            protected override ModelItem GetSourceVertexFromEdge(Edge edge)
-            {
-                return edge.SourceVertex;
-            }
-
-            protected override ModelItem GetDestinationVertexFromBackPointer(BackPointer backPointer)
-            {
-                return backPointer.DestinationVertex;
-            }
-
-            protected override void RemoveAssociatedBackPointer(Edge edge)
-            {
-                if (edge.LinkType == LinkType.Property)
-                {
-                    ModelProperty modelProperty = edge.SourceVertex.Properties[edge.PropertyName];
-                    if (modelProperty != null)
-                    {
-                        ((IModelTreeItem)edge.DestinationVertex).RemoveSource(modelProperty);
-                    }
-                    else
-                    {
-                        // in case of custom type descriptor, it may return a list of ModelProperties different from IModelTreeItem.ModelPropertyStore
-                        // manually manipulate IModelTreeItem.Sources to remove back pointer
-                        ((IModelTreeItem)edge.DestinationVertex).RemoveSource(edge.SourceVertex, edge.PropertyName);
-                    }
-                }
-                else
-                {
-                    Fx.Assert(edge.LinkType == LinkType.Item, "unknown LinkType");
-                    ((IModelTreeItem)edge.DestinationVertex).RemoveParent(edge.SourceVertex);
-                }
-            }
-
-            protected override void AddAssociatedBackPointer(Edge edge)
-            {
-                if (edge.LinkType == LinkType.Property)
-                {
-                    ModelProperty modelProperty = edge.SourceVertex.Properties[edge.PropertyName];
-                    if (modelProperty != null)
-                    {
-                        ((IModelTreeItem)edge.DestinationVertex).SetSource(modelProperty);
-                    }
-                    else
-                    {
-                        ((IModelTreeItem)edge.DestinationVertex).ExtraPropertyBackPointers.Add(new BackPointer(edge.PropertyName, edge.DestinationVertex, edge.SourceVertex));
-                    }
-                }
-                else
-                {
-                    Fx.Assert(edge.LinkType == LinkType.Item, "unknown LinkType");
-                    ((IModelTreeItem)edge.DestinationVertex).SetParent(edge.SourceVertex);
-                }
-            }
-
-            protected override bool HasBackPointer(Edge edge)
-            {
-                ModelItem from = edge.SourceVertex;
-
-                if (edge.LinkType == LinkType.Property)
-                {
-                    foreach (ModelProperty p in edge.DestinationVertex.Sources)
-                    {
-                        if (p.Parent == from && p.Name == edge.PropertyName)
-                        {
-                            return true;
-                        }
-                    }
-
-                    foreach (BackPointer bp in ((IModelTreeItem)edge.DestinationVertex).ExtraPropertyBackPointers)
-                    {
-                        if (bp.DestinationVertex == from && bp.PropertyName == edge.PropertyName)
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
-                }
-                else
-                {
-                    Fx.Assert(edge.LinkType == LinkType.Item, "unknown LinkType");
-                    return ((IModelTreeItem)edge.DestinationVertex).ItemBackPointers.Contains(from);
-                }
-            }
-
-            protected override bool HasAssociatedEdge(BackPointer backPointer)
-            {
-                if (backPointer.LinkType == LinkType.Property)
-                {
-                    return ((IModelTreeItem)backPointer.DestinationVertex).ModelPropertyStore[backPointer.PropertyName] == backPointer.SourceVertex;
-                }
-                else
-                {
-                    Fx.Assert(backPointer.LinkType == LinkType.Item, "unknown LinkType");
-
-                    ModelItemCollection collection = backPointer.DestinationVertex as ModelItemCollection;
-                    if (collection != null)
-                    {
-                        return collection.Contains(backPointer.SourceVertex);
-                    }
-
-                    ModelItemDictionary dictionary = (ModelItemDictionary)backPointer.DestinationVertex;
-                    return dictionary.Keys.Concat(dictionary.Values).Contains(backPointer.SourceVertex);
-                }
-            }
-
-            protected override void OnVerticesBecameReachable(IEnumerable<ModelItem> reachableVertices)
-            {
-                Fx.Assert(reachableVertices != null, "reachableVertices should not be null");
-                this.modelTreeManager.OnModelItemsAdded(reachableVertices);
-            }
-
-            protected override void OnVerticesBecameUnreachable(IEnumerable<ModelItem> unreachableVertices)
-            {
-                Fx.Assert(unreachableVertices != null, "unreachableVertices should not be null");
-                this.modelTreeManager.OnModelItemsRemoved(unreachableVertices);
-            }
-        }
-
-        class DictionaryTypeDescriptionProvider : TypeDescriptionProvider
-        {
-            Type type;
-            public DictionaryTypeDescriptionProvider(Type type)
-                : base(TypeDescriptor.GetProvider(type))
-            {
-                this.type = type;
-            }
-
-            public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
-            {
-                ICustomTypeDescriptor defaultDescriptor = base.GetTypeDescriptor(objectType, instance);
-                return new DictionaryTypeDescriptor(defaultDescriptor, this.type);
-            }
-        }
-
-        class DictionaryTypeDescriptor : CustomTypeDescriptor
-        {
-            Type type;
-
-            public DictionaryTypeDescriptor(ICustomTypeDescriptor parent, Type type)
-                : base(parent)
-            {
-                this.type = type;
-            }
-
-            // Expose one more property, a collection of MutableKeyValuePairs,  described by ItemsCollectionPropertyDescriptor
-            public override PropertyDescriptorCollection GetProperties()
-            {
-                return new PropertyDescriptorCollection(base.GetProperties().Cast<PropertyDescriptor>()
-                    .Union(new PropertyDescriptor[] { new ItemsCollectionPropertyDescriptor(type) }).ToArray());
-            }
-
-            // Expose one more property, a collection of MutableKeyValuePairs,  described by ItemsCollectionPropertyDescriptor
-            public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
-            {
-                return new PropertyDescriptorCollection(base.GetProperties(attributes).Cast<PropertyDescriptor>()
-                    .Union(new PropertyDescriptor[] { new ItemsCollectionPropertyDescriptor(type) }).ToArray());
-            }
-        }
-
-        class ItemsCollectionPropertyDescriptor : PropertyDescriptor
-        {
-            Type dictionaryType;
-            Type[] genericArguments;
-            Type kvpairType;
-            Type itemType;
-            Type propertyType;
-
-            internal ItemsCollectionPropertyDescriptor(Type type)
-                : base("ItemsCollection", null)
-            {
-                this.dictionaryType = type;
-            }
-
-            Type[] GenericArguments
-            {
-                get
-                {
-                    if (this.genericArguments == null)
-                    {
-                        object[] result = new object[2] { false, false };
-                        Type[] interfaces = this.ComponentType.FindInterfaces(ModelTreeManager.CheckInterface, result);
-                        foreach (Type type in interfaces)
-                        {
-                            if (type.GetGenericTypeDefinition() == typeof(IDictionary<,>))
-                            {
-                                this.genericArguments = type.GetGenericArguments();
-                                Fx.Assert(this.genericArguments.Length == 2, "this.genericArguments.Length should be = 2");
-                                return this.genericArguments;
-                            }
-                        }
-                        Debug.Fail("Cannot find generic arguments for IDictionary<,>.");
-                    }
-                    return this.genericArguments;
-                }
-            }
-
-            [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is intended for use through reflection")]
-            Type KVPairType
-            {
-                get
-                {
-                    if (this.kvpairType == null)
-                    {
-                        this.kvpairType = typeof(KeyValuePair<,>).MakeGenericType(this.GenericArguments);
-                    }
-                    return this.kvpairType;
-                }
-            }
-
-            [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is intended for use through reflection")]
-            Type ItemType
-            {
-                get
-                {
-                    if (this.itemType == null)
-                    {
-                        this.itemType = typeof(ModelItemKeyValuePair<,>).MakeGenericType(this.GenericArguments);
-                    }
-                    return this.itemType;
-                }
-            }
-
-            public override Type ComponentType
-            {
-                get { return this.dictionaryType; }
-            }
-
-            public override bool IsReadOnly
-            {
-                get
-                {
-                    return true;
-                }
-            }
-
-            public override Type PropertyType
-            {
-                get
-                {
-                    if (this.propertyType == null)
-                    {
-                        this.propertyType = typeof(DictionaryItemsCollection<,>).MakeGenericType(this.GenericArguments);
-                    }
-                    return this.propertyType;
-                }
-            }
-
-            public override bool IsBrowsable
-            {
-                get
-                {
-                    return false;
-                }
-            }
-
-            public override bool CanResetValue(object component)
-            {
-                return false;
-            }
-
-            public override object GetValue(object component)
-            {
-                return Activator.CreateInstance(this.PropertyType, new object[] { component });
-            }
-
-            public override void ResetValue(object component)
-            {
-                Debug.Fail("ResetValue is not implemented.");
-                throw FxTrace.Exception.AsError(new NotImplementedException());
-            }
-
-            public override void SetValue(object component, object value)
-            {
-                Debug.Fail("SetValue is not implemented.");
-                throw FxTrace.Exception.AsError(new NotImplementedException());
-            }
-
-            public override bool ShouldSerializeValue(object component)
-            {
-                return false;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelTypeConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelTypeConverter.cs
deleted file mode 100644 (file)
index c62ee2c..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Globalization;
-    using System.Diagnostics.CodeAnalysis;
-
-    // This is a type converter that wraps another type converter.  In the
-    // editing model, we expose all properties as ModelItem objects, so we need
-    // to unwrap them before handing them to a type converter.  This type
-    // converter provides that unwrapping seamlessly.
-
-    [SuppressMessage("XAML", "XAML1004", Justification = "This is internal, and is always available through TypeConverter.GetConverter, not used in xaml")]
-    class ModelTypeConverter : TypeConverter
-    {
-
-        ModelTreeManager modelTreeManager;
-        TypeConverter converter;
-
-        internal ModelTypeConverter(ModelTreeManager modelTreeManager, TypeConverter converter)
-        {
-            this.modelTreeManager = modelTreeManager;
-            this.converter = converter;
-        }
-
-        // Wraps the given type descriptor context with the set of this.modelTreeManagers
-        // available in the editing context.
-        ITypeDescriptorContext WrapContext(ITypeDescriptorContext context)
-        {
-            return new ModelTypeDescriptorContextWrapper(context, this.modelTreeManager);
-        }
-
-        // Returns true if the converter can convert from the given source type.
-        public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
-        {
-            if (sourceType == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("sourceType"));
-            }
-            return this.converter.CanConvertFrom(WrapContext(context), sourceType);
-        }
-
-        // Returns true if the converter can convert to the given target type.
-        public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
-        {
-            if (destinationType == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("destinationType"));
-            }
-            return this.converter.CanConvertTo(WrapContext(context), destinationType);
-        }
-
-        // Performs the actual conversion from one type to antother.  If the value provided
-        // is a ModelItem, it will be unwrapped first.  The return value is a ModelItem.
-        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
-        {
-            ModelItem item = value as ModelItem;
-            if (item != null)
-            {
-                value = item.GetCurrentValue();
-            }
-            object convertedValue = this.converter.ConvertFrom(WrapContext(context), culture, value);
-
-            if (convertedValue != null)
-            {
-                convertedValue = this.modelTreeManager.CreateModelItem(null, convertedValue);
-            }
-
-            return convertedValue;
-        }
-
-        // Performs the actual conversion to another type.  If the value provided is an item, it will
-        // be uwrapped first.  The return value is the raw data type.
-        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
-        {
-            ModelItem item = value as ModelItem;
-            if (item != null)
-            {
-                value = item.GetCurrentValue();
-            }
-            if (value != null)
-            {
-                return this.converter.ConvertTo(WrapContext(context), culture, value, destinationType);
-            }
-            return null;
-        }
-
-        // Creates an instance of an object using a dictionary of property values.  The
-        // return value is a wrapped model item.
-        public override object CreateInstance(ITypeDescriptorContext context, IDictionary propertyValues)
-        {
-            object value = this.converter.CreateInstance(WrapContext(context), propertyValues);
-            if (value != null)
-            {
-                value = this.modelTreeManager.CreateModelItem(null, value);
-            }
-            return value;
-        }
-
-        // Returns true if the CreateInstance method can be used to create new instances of
-        // objects.
-        public override bool GetCreateInstanceSupported(ITypeDescriptorContext context)
-        {
-            return this.converter.GetCreateInstanceSupported(WrapContext(context));
-        }
-
-        // Returns child properties for a type converter.  This will wrap all properties returned.
-        public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
-        {
-
-            if (value == null)
-            {
-                throw FxTrace.Exception.AsError( new ArgumentNullException("value"));
-            }
-
-            ModelItem item = value as ModelItem;
-            if (item != null)
-            {
-                value = item.GetCurrentValue();
-            }
-
-            PropertyDescriptorCollection props = this.converter.GetProperties(WrapContext(context), value, attributes);
-            if (props != null && props.Count > 0)
-            {
-
-                if (item == null)
-                {
-                    // We will need the item for this object.
-                    item = this.modelTreeManager.CreateModelItem(null, value);
-                }
-
-                // Search our item for each property and wrap it.  If
-                // a property is not offered by the model, ommit it.
-
-                List<PropertyDescriptor> newProps = new List<PropertyDescriptor>(props.Count);
-                foreach (PropertyDescriptor p in props)
-                {
-                    ModelProperty modelProp = item.Properties.Find(p.Name);
-                    if (modelProp != null)
-                    {
-                        newProps.Add(new ModelPropertyDescriptor(modelProp));
-                    }
-                }
-
-                props = new PropertyDescriptorCollection(newProps.ToArray(), true);
-            }
-
-            return props;
-        }
-
-        // Returns true if GetProperties will return child properties for the
-        // object.
-        public override bool GetPropertiesSupported(ITypeDescriptorContext context)
-        {
-            return this.converter.GetPropertiesSupported(WrapContext(context));
-        }
-
-        // Returns a set of standard values this type converter offers.
-        public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
-        {
-            StandardValuesCollection values = this.converter.GetStandardValues(WrapContext(context));
-
-            // Some type converters return null here, which isn't supposed to 
-            // be allowed. Fix them
-
-            object[] wrappedValues;
-
-            if (values == null)
-            {
-                wrappedValues = new object[0];
-            }
-            else
-            {
-                wrappedValues = new object[values.Count];
-                int idx = 0;
-                foreach (object value in values)
-                {
-                    object wrappedValue;
-                    if (value != null)
-                    {
-                        wrappedValue = this.modelTreeManager.CreateModelItem(null, value);
-                    }
-                    else
-                    {
-                        wrappedValue = value;
-                    }
-
-                    wrappedValues[idx++] = wrappedValue;
-                }
-            }
-
-            return new StandardValuesCollection(wrappedValues);
-        }
-
-        // Returns true if the set of standard values cannot be customized.
-        public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
-        {
-            return this.converter.GetStandardValuesExclusive(WrapContext(context));
-        }
-
-        // Returns true if this type converter offers a set of standard values.
-        public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
-        {
-            return this.converter.GetStandardValuesSupported(WrapContext(context));
-        }
-
-        // Returns true if the given value is a valid value for this type converter.
-        public override bool IsValid(ITypeDescriptorContext context, object value)
-        {
-            ModelItem item = value as ModelItem;
-            if (item != null)
-            {
-                value = item.GetCurrentValue();
-            }
-            return this.converter.IsValid(WrapContext(context), value);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelTypeDescriptorContextWrapper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelTypeDescriptorContextWrapper.cs
deleted file mode 100644 (file)
index 5559831..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-
-    using System;
-    using System.ComponentModel;
-    using System.Diagnostics;
-
-    //
-    // We need to provide a type descriptor context that can get to
-    // services in the editing context.  This wrapper does that by
-    // first checking the original set of services and then routing
-    // to the given service provider (which is usually an editing context's
-    // service manager).
-    //
-    internal class ModelTypeDescriptorContextWrapper : ITypeDescriptorContext
-    {
-
-        ITypeDescriptorContext context;
-        ModelTreeManager modelTreeManager;
-
-        internal ModelTypeDescriptorContextWrapper(ITypeDescriptorContext context, ModelTreeManager modelTreeManager)
-        {
-
-            this.context = context;
-            this.modelTreeManager = modelTreeManager;
-        }
-
-
-        public IContainer Container
-        {
-            get { return this.context == null ? null : this.context.Container; }
-        }
-
-        public object Instance
-        {
-            get
-            {
-                object instance = null;
-
-                if (this.context != null)
-                {
-                    instance = this.context.Instance;
-                    ModelItem item = instance as ModelItem;
-                    if (item != null)
-                    {
-                        instance = item.GetCurrentValue();
-                    }
-                }
-
-                return instance;
-            }
-        }
-
-        public PropertyDescriptor PropertyDescriptor
-        {
-            get
-            {
-                PropertyDescriptor desc = null;
-
-                if (this.context != null)
-                {
-                    desc = this.context.PropertyDescriptor;
-                    if (desc != null)
-                    {
-                        ModelItem item = this.context.Instance as ModelItem;
-                        if (item != null)
-                        {
-                            desc = new WrappedPropertyDescriptor(desc, item);
-                        }
-                    }
-                }
-
-                return desc;
-            }
-        }
-
-
-        public void OnComponentChanged()
-        {
-            if (this.context != null)
-            {
-                this.context.OnComponentChanged();
-            }
-        }
-
-        public bool OnComponentChanging()
-        {
-            return this.context == null ? false : this.context.OnComponentChanging();
-        }
-
-        public object GetService(Type serviceType)
-        {
-            object service = null;
-
-            if (this.context != null)
-            {
-                service = this.context.GetService(serviceType);
-            }
-
-            if (service == null)
-            {
-                service = this.modelTreeManager.Context.Services.GetService(serviceType);
-            }
-
-
-            return service;
-        }
-
-
-        // This property descriptor dynamically converts calls to
-        // the original property descriptor, converting values on
-        // the fly.
-        class WrappedPropertyDescriptor : PropertyDescriptor
-        {
-            private PropertyDescriptor _parent;
-            private ModelItem _item;
-
-            internal WrappedPropertyDescriptor(PropertyDescriptor parent, ModelItem item)
-                : base(parent)
-            {
-                _parent = parent;
-                _item = item;
-            }
-            public override Type ComponentType
-            { get { return _parent.ComponentType; } }
-            public override bool IsReadOnly
-            { get { return _parent.IsReadOnly; } }
-            public override Type PropertyType
-            { get { return _parent.PropertyType; } }
-
-            public override bool CanResetValue(object component)
-            {
-                return _parent.CanResetValue(_item);
-            }
-            public override object GetValue(object component)
-            {
-                return _parent.GetValue(_item);
-            }
-            public override void ResetValue(object component)
-            {
-                _parent.ResetValue(_item);
-            }
-            public override void SetValue(object component, object value)
-            {
-                _parent.SetValue(_item, value);
-            }
-            public override bool ShouldSerializeValue(object component)
-            {
-                return _parent.ShouldSerializeValue(_item);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelUtilities.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/ModelUtilities.cs
deleted file mode 100644 (file)
index 30dc655..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Runtime;
-
-    // This class provides useful shared utility functions that are
-    // needed by our ModelItemImpl class implementations.
-    internal static class ModelUtilities
-    {
-        internal static bool IsSwitchCase(ModelItem modelItem)
-        {
-            if (IsModelItemKeyValuePair(modelItem.ItemType))
-            {
-                if (modelItem.Parent != null && //modelItem.Parent - ItemsCollection
-                    modelItem.Parent.Parent != null && //modelItem.Parent.Parent - Cases
-                    modelItem.Parent.Parent.Parent != null && //modelItem.Parent.Parent.Parent - Switch
-                    modelItem.Parent.Parent.Parent.ItemType.IsGenericType &&
-                    modelItem.Parent.Parent.Parent.ItemType.GetGenericTypeDefinition() == typeof(System.Activities.Statements.Switch<>))
-                {
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        internal static bool IsModelItemKeyValuePair(Type type)
-        {
-            Fx.Assert(type != null, "Parameter type is null!");
-            return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(ModelItemKeyValuePair<,>);
-        }
-
-        // Returns a wrapped type converter for the given item.
-        internal static TypeConverter GetConverter(IModelTreeItem item)
-        {
-            return GetConverter(item.ModelTreeManager, item.ModelItem);
-        }
-
-        // Returns a wrapped converter for the given item.
-        internal static TypeConverter GetConverter(ModelTreeManager modelTreeManager, ModelItem item)
-        {
-            return new ModelTypeConverter(modelTreeManager, XamlUtilities.GetConverter(item.ItemType));
-        }
-
-        // Returns the default property on the item, or null if the item has
-        internal static PropertyDescriptor GetDefaultProperty(ModelItem item)
-        {
-            DefaultPropertyAttribute propAttr = TypeDescriptor.GetAttributes(item.ItemType)[typeof(DefaultPropertyAttribute)] as DefaultPropertyAttribute;
-            if (propAttr != null && !string.IsNullOrEmpty(propAttr.Name))
-            {
-                ModelProperty prop = item.Properties.Find(propAttr.Name);
-                if (prop != null)
-                {
-                    return new ModelPropertyDescriptor(prop);
-                }
-            }
-            return null;
-        }
-
-        // Wraps an item's properties in PropertyDescriptors and returns a
-        // collection of them.
-        internal static PropertyDescriptorCollection WrapProperties(ModelItem item)
-        {
-            List<PropertyDescriptor> descriptors = new List<PropertyDescriptor>();
-            foreach (ModelProperty prop in item.Properties)
-            {
-                descriptors.Add(new ModelPropertyDescriptor(prop));
-            }
-            return new PropertyDescriptorCollection(descriptors.ToArray(), true);
-        }
-
-
-        internal static ModelItem ReverseFindFirst(ModelItem start, Predicate<ModelItem> matcher)
-        {
-            Fx.Assert(start != null, "start should not be null");
-            Fx.Assert(matcher != null, "matcher should not be null");
-
-            ModelItem result = null;
-            ModelUtilities.ReverseTraverse(start, (ModelItem current) =>
-            {
-                if (matcher(current))
-                {
-                    result = current;
-                    return false;
-                }
-
-                return true;
-            });
-            return result;
-        }
-
-        // Traverse model graph via ModelItem's parent. Stop traversing if shouldContinue returns false
-        internal static void ReverseTraverse(ModelItem start, Predicate<ModelItem> shouldContinue)
-        {
-            Fx.Assert(start != null, "start should not be null");
-            Fx.Assert(shouldContinue != null, "shouldContinue should not be null");
-
-            HashSet<ModelItem> visited = new HashSet<ModelItem>();
-            ModelItem current = start;
-
-            while (current != null)
-            {
-                if (!shouldContinue(current))
-                {
-                    return;
-                }
-
-                visited.Add(current);
-                current = current.Parent;
-                if (visited.Contains(current))
-                {
-                    return;
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/MorphHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/MorphHelper.cs
deleted file mode 100644 (file)
index 0ba114d..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Linq;
-    using System.Activities.Presentation;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-
-    public delegate object PropertyValueMorphHelper(ModelItem originalValue, ModelProperty newModelProperty);
-
-    public static class MorphHelper
-    {
-        [SuppressMessage(FxCop.Category.Naming, FxCop.Rule.IdentifiersShouldBeSpelledCorrectly,
-                           Justification = "Morph is the right word here")]
-
-        static Dictionary<Type, PropertyValueMorphHelper> morphExtensions = new Dictionary<Type, PropertyValueMorphHelper>();
-
-        [SuppressMessage(FxCop.Category.Naming, FxCop.Rule.IdentifiersShouldBeSpelledCorrectly,
-                            Justification = "Morph is the right word here")]
-        public static void AddPropertyValueMorphHelper(Type propertyType, PropertyValueMorphHelper extension)
-        {
-            if (propertyType == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("propertyType"));
-            }
-            if (extension == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("extension"));
-            }
-            morphExtensions[propertyType] = extension;
-        }
-
-        [SuppressMessage(FxCop.Category.Naming, FxCop.Rule.IdentifiersShouldBeSpelledCorrectly,
-                            Justification = "Morph is the right word here")]
-        public static PropertyValueMorphHelper GetPropertyValueMorphHelper(Type propertyType)
-        {
-            if (propertyType == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("propertyType"));
-            }
-            PropertyValueMorphHelper extension = null;
-            morphExtensions.TryGetValue(propertyType, out extension);
-            if (extension == null && propertyType.IsGenericType)
-            {
-                morphExtensions.TryGetValue(propertyType.GetGenericTypeDefinition(), out extension);
-            }
-            return extension;
-        }
-
-        [SuppressMessage(FxCop.Category.Naming, FxCop.Rule.IdentifiersShouldBeSpelledCorrectly,
-                            Justification = "Morph is the right word here")]
-        // This updates back links
-        public static void MorphObject(ModelItem oldModelItem, ModelItem newModelitem)
-        {
-            if (oldModelItem == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("oldModelItem"));
-            }
-            if (newModelitem == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("newModelitem"));
-            }
-
-            var collectionParents = from parent in oldModelItem.Parents
-                                    where parent is ModelItemCollection
-                                    select (ModelItemCollection)parent;
-            foreach (ModelItemCollection collectionParent in collectionParents.ToList())
-            {
-                int index = collectionParent.IndexOf(oldModelItem);
-                collectionParent.Remove(oldModelItem);
-                collectionParent.Insert(index, newModelitem);
-            }
-            foreach (ModelProperty modelProperty in oldModelItem.Sources.ToList())
-            {
-                modelProperty.SetValue(newModelitem);
-            }
-
-
-        }
-
-        [SuppressMessage(FxCop.Category.Naming, FxCop.Rule.IdentifiersShouldBeSpelledCorrectly,
-                            Justification = "Morph is the right word here")]
-        // this updates forward links
-        public static void MorphProperties(ModelItem oldModelItem, ModelItem newModelitem)
-        {
-            if (oldModelItem == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("oldModelItem"));
-            }
-            if (newModelitem == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("newModelitem"));
-            }
-
-            foreach (ModelProperty modelProperty in oldModelItem.Properties)
-            {
-                ModelProperty propertyInNewModelItem = newModelitem.Properties[modelProperty.Name];
-                if (propertyInNewModelItem != null)
-                {
-                    Console.WriteLine(propertyInNewModelItem.Name);
-                    if (CanCopyProperty(modelProperty, propertyInNewModelItem))
-                    {
-                        if (propertyInNewModelItem.PropertyType.Equals(modelProperty.PropertyType))
-                        {
-                            propertyInNewModelItem.SetValue(modelProperty.Value);
-                            modelProperty.SetValue(null);
-                        }
-                        else // See if there is morph helper for this type.
-                        {
-                            PropertyValueMorphHelper extension = GetPropertyValueMorphHelper(modelProperty.PropertyType);
-                            if (extension != null)
-                            {
-                                propertyInNewModelItem.SetValue(extension(modelProperty.Value, propertyInNewModelItem));
-                                modelProperty.SetValue(null);
-                            }
-                        }
-
-                    }
-                }
-
-            }
-        }
-
-        static bool CanCopyProperty(ModelProperty modelProperty, ModelProperty propertyInNewModelItem)
-        {
-            bool canCopyProperty = false;
-            DesignerSerializationVisibilityAttribute designerSerializationVisibility = ExtensibilityAccessor.GetAttribute<DesignerSerializationVisibilityAttribute>(modelProperty.Attributes);
-            if (modelProperty.Value == null)
-            {
-                canCopyProperty = false;
-            }
-            else if (designerSerializationVisibility != null && designerSerializationVisibility.Visibility != DesignerSerializationVisibility.Visible)
-            {
-                canCopyProperty = false;
-            }
-            else if (propertyInNewModelItem != null && !propertyInNewModelItem.IsAttached && !propertyInNewModelItem.IsReadOnly)
-            {
-                canCopyProperty = true;
-            }
-            return canCopyProperty;
-        }
-
-    }
-}
-
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/PropertyChange.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/PropertyChange.cs
deleted file mode 100644 (file)
index 3a35f65..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-    using System.Globalization;
-    using System.Runtime;
-    using System.Activities.Presentation.Services;
-
-    class PropertyChange : ModelChange
-    {
-        public ModelItem Owner { get; set; }
-
-        public string PropertyName { get; set; }
-
-        public ModelItem OldValue { get; set; }
-
-        public ModelItem NewValue { get; set; }
-
-        public ModelTreeManager ModelTreeManager { get; set; }
-
-        public override string Description
-        {
-            get 
-            {
-                return string.Format(CultureInfo.InvariantCulture, "{0} - {1}", SR.PropertyChangeEditingScopeDescription, this.PropertyName); 
-            }
-        }
-
-        public override bool Apply()
-        {
-            Fx.Assert(this.ModelTreeManager != null, "Modeltreemanager cannot be null");
-            Fx.Assert(this.Owner != null, "Owner modelitem cannot be null");
-            Fx.Assert(!String.IsNullOrEmpty(this.PropertyName), " property name cannot be null or emptry");
-            ModelPropertyImpl dataModelProperty = (ModelPropertyImpl)this.Owner.Properties[this.PropertyName];
-            ModelItem oldValue = dataModelProperty.Value;
-            if ((oldValue == null && this.NewValue == null) ||
-                (oldValue != null && this.NewValue != null && oldValue.GetCurrentValue().Equals(this.NewValue.GetCurrentValue())))
-            {
-                return false;
-            }
-            dataModelProperty.SetValueCore(this.NewValue);
-            ModelChangeInfo changeInfo = ModelChangeInfoImpl.CreatePropertyChanged(this.Owner, this.PropertyName, this.OldValue, this.NewValue);
-            this.ModelTreeManager.NotifyPropertyChange(dataModelProperty, changeInfo);
-            return true;
-        }
-
-        public override Change GetInverse()
-        {
-            return new PropertyChange()
-                {
-                    ModelTreeManager = this.ModelTreeManager,
-                    Owner = this.Owner,
-                    OldValue = this.NewValue,
-                    NewValue = this.OldValue,
-                    PropertyName = this.PropertyName
-                };
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/PropertyReferenceChange.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/PropertyReferenceChange.cs
deleted file mode 100644 (file)
index 80e0979..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System.Globalization;
-
-    internal class PropertyReferenceChange : ModelChange
-    {
-        public ModelItem Owner { get; set; }
-
-        public string TargetProperty { get; set; }
-
-        public string OldSourceProperty { get; set; }
-
-        public string NewSourceProperty { get; set; }
-
-        public override string Description
-        {
-            get
-            {
-                return string.Format(CultureInfo.InvariantCulture, "{0} - {1}", SR.PropertyReferenceChangeEditingScopeDescription, this.TargetProperty);
-            }
-        }
-
-        public override bool Apply()
-        {
-            PropertyReferenceUtilities.SetPropertyReference(this.Owner.GetCurrentValue(), this.TargetProperty, this.NewSourceProperty);
-            this.Owner.OnPropertyReferenceChanged(this.TargetProperty);
-
-            return true;
-        }
-
-        public override Change GetInverse()
-        {
-            return new PropertyReferenceChange()
-            {
-                Owner = this.Owner,
-                TargetProperty = this.TargetProperty,
-                OldSourceProperty = this.NewSourceProperty,
-                NewSourceProperty = this.OldSourceProperty
-            };
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/PropertyReferenceChangedEventArgs.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/PropertyReferenceChangedEventArgs.cs
deleted file mode 100644 (file)
index f5c25dd..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    internal delegate void PropertyReferenceChangedEventHandler(object sender, PropertyReferenceChangedEventArgs e);
-
-    internal class PropertyReferenceChangedEventArgs : EventArgs
-    {
-        public PropertyReferenceChangedEventArgs(string targetProperty)
-        {
-            this.TargetProperty = targetProperty;
-        }
-
-        public string TargetProperty
-        {
-            get;
-            private set;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/SearchableEntry.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/SearchableEntry.cs
deleted file mode 100644 (file)
index e230394..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-
-    class SearchableEntry
-    {
-        internal int LineNumber { get; set; }
-        internal SearchableEntryOption SearchableEntryType { get; set; }
-        internal ModelItem ModelItem { get; set; }
-        internal ModelProperty ModelProperty { get; set; }
-        internal string Text { get; set; }
-        internal string PropertyPath { get; set; }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/SearchableEntryOption.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/SearchableEntryOption.cs
deleted file mode 100644 (file)
index 9e5636e..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-
-    enum SearchableEntryOption
-    {
-        Variable,
-        Argument,
-        Property
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/TextImage.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/TextImage.cs
deleted file mode 100644 (file)
index f275cb6..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation.Model
-{
-    using System.Collections.Generic;
-
-    /// <summary>
-    /// This class is to hold the searchable strings extracted from the modeltree. All strings 
-    /// are well ordered. And StartIndex point to the cursor in the content. It depends on the
-    /// current selection in the model item tree.Search implementor can start their search from
-    /// the StartIndex.
-    /// </summary>
-    [Serializable]
-    public sealed class TextImage
-    {
-        public int StartLineIndex { get; set; }
-        public IList<string> Lines { get; internal set; }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/WeakKeyDictionary.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/WeakKeyDictionary.cs
deleted file mode 100644 (file)
index bdaffdd..0000000
+++ /dev/null
@@ -1,424 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Model
-{
-
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Text;
-    using System.Threading;
-    using System.Runtime.InteropServices;
-
-    internal class WeakKeyDictionary<K, V> : IDictionary<K, V> 
-    {
-        private Dictionary<WeakKey, V> _internalDictionary;
-        private object _sync = new object();
-        private bool _finalized;
-
-        internal WeakKeyDictionary() 
-        {
-            _internalDictionary = new Dictionary<WeakKey, V>(new WeakComparer());
-        }
-
-        public WeakKeyDictionary(IEqualityComparer<K> comparer)  
-        {
-            _internalDictionary = new Dictionary<WeakKey, V>(new WeakComparer(comparer));
-        }
-
-        // FXCop: this is not empty; we need to mark this so we know if a key
-        // still has an active dictionary at its finalization.
-        [SuppressMessage("Microsoft.Performance", "CA1821:RemoveEmptyFinalizers")]
-        ~WeakKeyDictionary() 
-        {
-            _finalized = true;
-        }
-
-        public ICollection<K> Keys 
-        {
-            get 
-            {
-                List<K> list = new List<K>();
-                lock (_sync) 
-                {
-                    foreach (WeakKey key in _internalDictionary.Keys) 
-                    {
-                        object k = key.Target;
-                        if (k != null)
-                        {
-                            list.Add((K)k);
-                        }
-                    }
-                }
-                return list;
-            }
-        }
-
-        public ICollection<V> Values 
-        {
-            get {
-                lock (_sync) {
-                    // make a copy of the values, so the during GC, the returned collection does not change.
-                    return new List<V>(_internalDictionary.Values);
-                }
-            }
-        }
-
-        public int Count 
-        {
-            get 
-            {
-                // Ensure a fairly accurate count.
-                ScavangeLostKeys();
-                lock (_sync) 
-                {
-                    return _internalDictionary.Count;
-                }
-            }
-        }
-
-        public bool IsReadOnly 
-        {
-            get {
-                return false;
-            }
-        }
-
-        [SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", Justification = "LostKeyFinder's purpose is to get garbage collected as soon as posible")]
-        public V this[K key] 
-        {
-            get {
-                lock (_sync) {
-                    return _internalDictionary[new WeakKey(key)];
-                }
-            }
-            set 
-            {
-                WeakKey k = new WeakKey(key);
-                lock (_sync) 
-                {
-                    _internalDictionary[k] = value;
-                }
-                // This looks a bit weird but the purpose of the lost key finder is to execute
-                // code in some future garbage collection phase so we immediately create some garbage.
-                new LostKeyFinder(this, k);
-            }
-        }
-
-        public bool TryGetValue(K key, out V value) 
-        {
-            WeakKey k = new WeakKey(key);
-            lock (_sync) 
-            {
-                return _internalDictionary.TryGetValue(k, out value);
-            }
-        }
-
-        [SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", Justification = "LostKeyFinder's purpose is to get garbage collected as soon as posible")]
-        public void Add(K key, V value) 
-        {
-            WeakKey k = new WeakKey(key);
-            lock (_sync) 
-            {
-                _internalDictionary.Add(k, value);
-            }
-            // This looks a bit weird but the purpose of the lost key finder is to execute
-            // code in some future garbage collection phase so we immediately create some garbage.
-            new LostKeyFinder(this, k);
-
-        }
-
-        public bool ContainsKey(K key) 
-        {
-            return _internalDictionary.ContainsKey(new WeakKey(key));
-        }
-
-        public bool Remove(K key) 
-        {
-            lock (_sync) 
-            {
-                return _internalDictionary.Remove(new WeakKey(key));
-            }
-        }
-
-        public void Add(KeyValuePair<K, V> item) 
-        {
-            Add(item.Key, item.Value);
-        }
-
-        public void Clear() 
-        {
-            lock (_sync) 
-            {
-                _internalDictionary.Clear();
-            }
-        }
-
-        public bool Contains(KeyValuePair<K, V> item) 
-        {
-            V value;
-            bool result;
-            lock (_sync) 
-            {
-                result = _internalDictionary.TryGetValue(new WeakKey(item.Key), out value);
-            }
-            if (result)
-            {
-                return value.Equals(item.Value);
-            }
-            else
-            {
-                return false;
-            }
-        }
-
-        public void CopyTo(KeyValuePair<K, V>[] array, int arrayIndex) 
-        {
-            lock (_sync) 
-            {
-                foreach (KeyValuePair<WeakKey, V> item in _internalDictionary) 
-                {
-                    KeyValuePair<K, V> kv = new KeyValuePair<K, V>((K)item.Key.Target, item.Value);
-                    array[arrayIndex] = kv;
-                    arrayIndex++;
-                }
-            }
-        }
-
-        public bool Remove(KeyValuePair<K, V> item) 
-        {
-            WeakKey key = new WeakKey(item.Key);
-            lock (_sync) 
-            {
-                return _internalDictionary.Remove(key);
-            }
-        }
-
-
-
-
-
-        public IEnumerator<KeyValuePair<K, V>> GetEnumerator() 
-        {
-            List<WeakKey> lostKeys = null;
-            lock (_sync) 
-            {
-                foreach (KeyValuePair<WeakKey, V> item in _internalDictionary) 
-                {
-                    object k = item.Key.Target;
-                    if (k != null)
-                    {
-                        yield return new KeyValuePair<K, V>((K)k, item.Value);
-                    }
-                    else 
-                    {
-                        if (lostKeys == null)
-                        {
-                            lostKeys = new List<WeakKey>();
-                        }
-                        lostKeys.Add(item.Key);
-                    }
-                }
-            }
-            // Recover any lost keys.
-            if (lostKeys != null)
-            {
-                lock (_sync) 
-                {
-                    foreach (WeakKey key in lostKeys)
-                    {
-                        _internalDictionary.Remove(key);
-                    }
-                }
-            }
-        }
-
-
-
-
-        IEnumerator IEnumerable.GetEnumerator() 
-        {
-            return GetEnumerator();
-        }
-
-
-
-        private void ScavangeLostKeys() 
-        {
-            List<WeakKey> lostKeys = null;
-            lock (_sync) 
-            {
-                foreach (WeakKey key in _internalDictionary.Keys)
-                {
-                    if (!key.IsAlive) 
-                    {
-                        if (lostKeys == null)
-                        {
-                            lostKeys = new List<WeakKey>();
-                        }
-                        lostKeys.Add(key);
-                    }
-                }
-            }
-            if (lostKeys != null)
-            {
-                lock (_sync) 
-                {
-                    foreach (WeakKey key in lostKeys)
-                    {
-                        _internalDictionary.Remove(key);
-                    }
-                }
-            }
-        }
-
-        private class WeakKey : WeakReference 
-        {
-            private int _hashCode;
-            // private GCHandle _gcHandle;
-
-            public WeakKey(K key)
-                : base(key, true) 
-            {
-                _hashCode = key.GetHashCode();
-                // Keep the key alive until it is explicitly collected
-                // _gcHandle = GCHandle.Alloc(this);
-            }
-
-            internal void Release() 
-            {
-                // _gcHandle.Free();
-            }
-
-            public override int GetHashCode() 
-            {
-                return _hashCode;
-            }
-
-            public override bool Equals(object obj) 
-            {
-                if (obj == null)
-                {
-                    return false;
-                }
-                if (obj.GetHashCode() != _hashCode)
-                {
-                    return false;
-                }
-                if (obj != this && (!IsAlive || !obj.Equals(Target)))
-                {
-                    return false;
-                }
-                return true;
-            }
-        }
-
-        private class WeakComparer : IEqualityComparer<WeakKey> 
-        {
-
-            private IEqualityComparer<K> _comparer;
-            public WeakComparer() 
-            {
-            }
-
-            public WeakComparer(IEqualityComparer<K> comparer) 
-            {
-                _comparer = comparer;
-            }
-
-            public bool Equals(WeakKey x, WeakKey y) 
-            {
-                if (x.GetHashCode() != y.GetHashCode())
-                {
-                    return false;
-                }
-                if (object.ReferenceEquals(x, y))
-                {
-                    return true;
-                }
-                object ref1 = x.Target;
-                if (ref1 == null)
-                {
-                    return false;
-                }
-                object ref2 = y.Target;
-                if (ref2 == null)
-                {
-                    return false;
-                }
-
-                if (_comparer != null) 
-                {
-                    return _comparer.Equals((K)ref1, (K)ref2);
-                }
-                else 
-                {
-                    return ref1.Equals(ref2);
-                }
-            }
-
-            public int GetHashCode(WeakKey obj) 
-            {
-                return obj.GetHashCode();
-            }
-        }
-
-        private class LostKeyFinder 
-        {
-            WeakKeyDictionary<K, V> _dictionary;
-            WeakKey _key;
-
-            public LostKeyFinder(WeakKeyDictionary<K, V> dictionary, WeakKey key) 
-            {
-                _dictionary = dictionary;
-                _key = key;
-            }
-
-            ~LostKeyFinder() 
-            {
-                if (_dictionary._finalized || _key == null) 
-                {
-                    if (_key != null) 
-                    {
-                        _key.Release();
-                        _key = null;
-                    }
-                    return;
-                }
-                // if (!_key.IsAlive) {
-                if (_key.Target == null) 
-                {
-                    bool locked = false;
-                    try
-                    {
-                        locked = Monitor.TryEnter(_dictionary._sync);
-                        _dictionary._internalDictionary.Remove(_key);
-                    }
-                    finally
-                    {
-                        if (locked)
-                        {
-                            Monitor.Exit(_dictionary._sync);
-                        }
-                    }
-
-                    if (locked)
-                    {
-                        _key.Release();
-                        _key = null;
-                    }
-                    else
-                    {
-                        GC.ReRegisterForFinalize(this);
-                    }
-                }
-                else if (_dictionary._internalDictionary.ContainsKey(_key))
-                {
-                    GC.ReRegisterForFinalize(this);
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/WeakKeyDictionary.cs.back b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/WeakKeyDictionary.cs.back
deleted file mode 100644 (file)
index 2eeb1bc..0000000
+++ /dev/null
@@ -1,424 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Model
-{
-
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Text;
-    using System.Threading;
-    using System.Runtime.InteropServices;
-
-    internal class WeakKeyDictionary<K, V> : IDictionary<K, V> 
-    {
-        private Dictionary<WeakKey, V> _internalDictionary;
-        private object _[....] = new object();
-        private bool _finalized;
-
-        internal WeakKeyDictionary() 
-        {
-            _internalDictionary = new Dictionary<WeakKey, V>(new WeakComparer());
-        }
-
-        public WeakKeyDictionary(IEqualityComparer<K> comparer)  
-        {
-            _internalDictionary = new Dictionary<WeakKey, V>(new WeakComparer(comparer));
-        }
-
-        // FXCop: this is not empty; we need to mark this so we know if a key
-        // still has an active dictionary at its finalization.
-        [SuppressMessage("Microsoft.Performance", "CA1821:RemoveEmptyFinalizers")]
-        ~WeakKeyDictionary() 
-        {
-            _finalized = true;
-        }
-
-        public ICollection<K> Keys 
-        {
-            get 
-            {
-                List<K> list = new List<K>();
-                lock (_[....]) 
-                {
-                    foreach (WeakKey key in _internalDictionary.Keys) 
-                    {
-                        object k = key.Target;
-                        if (k != null)
-                        {
-                            list.Add((K)k);
-                        }
-                    }
-                }
-                return list;
-            }
-        }
-
-        public ICollection<V> Values 
-        {
-            get {
-                lock (_[....]) {
-                    // make a copy of the values, so the during GC, the returned collection does not change.
-                    return new List<V>(_internalDictionary.Values);
-                }
-            }
-        }
-
-        public int Count 
-        {
-            get 
-            {
-                // Ensure a fairly accurate count.
-                ScavangeLostKeys();
-                lock (_[....]) 
-                {
-                    return _internalDictionary.Count;
-                }
-            }
-        }
-
-        public bool IsReadOnly 
-        {
-            get {
-                return false;
-            }
-        }
-
-        [SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", Justification = "LostKeyFinder's purpose is to get garbage collected as soon as posible")]
-        public V this[K key] 
-        {
-            get {
-                lock (_[....]) {
-                    return _internalDictionary[new WeakKey(key)];
-                }
-            }
-            set 
-            {
-                WeakKey k = new WeakKey(key);
-                lock (_[....]) 
-                {
-                    _internalDictionary[k] = value;
-                }
-                // This looks a bit weird but the purpose of the lost key finder is to execute
-                // code in some future garbage collection phase so we immediately create some garbage.
-                new LostKeyFinder(this, k);
-            }
-        }
-
-        public bool TryGetValue(K key, out V value) 
-        {
-            WeakKey k = new WeakKey(key);
-            lock (_[....]) 
-            {
-                return _internalDictionary.TryGetValue(k, out value);
-            }
-        }
-
-        [SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", Justification = "LostKeyFinder's purpose is to get garbage collected as soon as posible")]
-        public void Add(K key, V value) 
-        {
-            WeakKey k = new WeakKey(key);
-            lock (_[....]) 
-            {
-                _internalDictionary.Add(k, value);
-            }
-            // This looks a bit weird but the purpose of the lost key finder is to execute
-            // code in some future garbage collection phase so we immediately create some garbage.
-            new LostKeyFinder(this, k);
-
-        }
-
-        public bool ContainsKey(K key) 
-        {
-            return _internalDictionary.ContainsKey(new WeakKey(key));
-        }
-
-        public bool Remove(K key) 
-        {
-            lock (_[....]) 
-            {
-                return _internalDictionary.Remove(new WeakKey(key));
-            }
-        }
-
-        public void Add(KeyValuePair<K, V> item) 
-        {
-            Add(item.Key, item.Value);
-        }
-
-        public void Clear() 
-        {
-            lock (_[....]) 
-            {
-                _internalDictionary.Clear();
-            }
-        }
-
-        public bool Contains(KeyValuePair<K, V> item) 
-        {
-            V value;
-            bool result;
-            lock (_[....]) 
-            {
-                result = _internalDictionary.TryGetValue(new WeakKey(item.Key), out value);
-            }
-            if (result)
-            {
-                return value.Equals(item.Value);
-            }
-            else
-            {
-                return false;
-            }
-        }
-
-        public void CopyTo(KeyValuePair<K, V>[] array, int arrayIndex) 
-        {
-            lock (_[....]) 
-            {
-                foreach (KeyValuePair<WeakKey, V> item in _internalDictionary) 
-                {
-                    KeyValuePair<K, V> kv = new KeyValuePair<K, V>((K)item.Key.Target, item.Value);
-                    array[arrayIndex] = kv;
-                    arrayIndex++;
-                }
-            }
-        }
-
-        public bool Remove(KeyValuePair<K, V> item) 
-        {
-            WeakKey key = new WeakKey(item.Key);
-            lock (_[....]) 
-            {
-                return _internalDictionary.Remove(key);
-            }
-        }
-
-
-
-
-
-        public IEnumerator<KeyValuePair<K, V>> GetEnumerator() 
-        {
-            List<WeakKey> lostKeys = null;
-            lock (_[....]) 
-            {
-                foreach (KeyValuePair<WeakKey, V> item in _internalDictionary) 
-                {
-                    object k = item.Key.Target;
-                    if (k != null)
-                    {
-                        yield return new KeyValuePair<K, V>((K)k, item.Value);
-                    }
-                    else 
-                    {
-                        if (lostKeys == null)
-                        {
-                            lostKeys = new List<WeakKey>();
-                        }
-                        lostKeys.Add(item.Key);
-                    }
-                }
-            }
-            // Recover any lost keys.
-            if (lostKeys != null)
-            {
-                lock (_[....]) 
-                {
-                    foreach (WeakKey key in lostKeys)
-                    {
-                        _internalDictionary.Remove(key);
-                    }
-                }
-            }
-        }
-
-
-
-
-        IEnumerator IEnumerable.GetEnumerator() 
-        {
-            return GetEnumerator();
-        }
-
-
-
-        private void ScavangeLostKeys() 
-        {
-            List<WeakKey> lostKeys = null;
-            lock (_[....]) 
-            {
-                foreach (WeakKey key in _internalDictionary.Keys)
-                {
-                    if (!key.IsAlive) 
-                    {
-                        if (lostKeys == null)
-                        {
-                            lostKeys = new List<WeakKey>();
-                        }
-                        lostKeys.Add(key);
-                    }
-                }
-            }
-            if (lostKeys != null)
-            {
-                lock (_[....]) 
-                {
-                    foreach (WeakKey key in lostKeys)
-                    {
-                        _internalDictionary.Remove(key);
-                    }
-                }
-            }
-        }
-
-        private class WeakKey : WeakReference 
-        {
-            private int _hashCode;
-            // private GCHandle _gcHandle;
-
-            public WeakKey(K key)
-                : base(key, true) 
-            {
-                _hashCode = key.GetHashCode();
-                // Keep the key alive until it is explicitly collected
-                // _gcHandle = GCHandle.Alloc(this);
-            }
-
-            internal void Release() 
-            {
-                // _gcHandle.Free();
-            }
-
-            public override int GetHashCode() 
-            {
-                return _hashCode;
-            }
-
-            public override bool Equals(object obj) 
-            {
-                if (obj == null)
-                {
-                    return false;
-                }
-                if (obj.GetHashCode() != _hashCode)
-                {
-                    return false;
-                }
-                if (obj != this && (!IsAlive || !obj.Equals(Target)))
-                {
-                    return false;
-                }
-                return true;
-            }
-        }
-
-        private class WeakComparer : IEqualityComparer<WeakKey> 
-        {
-
-            private IEqualityComparer<K> _comparer;
-            public WeakComparer() 
-            {
-            }
-
-            public WeakComparer(IEqualityComparer<K> comparer) 
-            {
-                _comparer = comparer;
-            }
-
-            public bool Equals(WeakKey x, WeakKey y) 
-            {
-                if (x.GetHashCode() != y.GetHashCode())
-                {
-                    return false;
-                }
-                if (object.ReferenceEquals(x, y))
-                {
-                    return true;
-                }
-                object ref1 = x.Target;
-                if (ref1 == null)
-                {
-                    return false;
-                }
-                object ref2 = y.Target;
-                if (ref2 == null)
-                {
-                    return false;
-                }
-
-                if (_comparer != null) 
-                {
-                    return _comparer.Equals((K)ref1, (K)ref2);
-                }
-                else 
-                {
-                    return ref1.Equals(ref2);
-                }
-            }
-
-            public int GetHashCode(WeakKey obj) 
-            {
-                return obj.GetHashCode();
-            }
-        }
-
-        private class LostKeyFinder 
-        {
-            WeakKeyDictionary<K, V> _dictionary;
-            WeakKey _key;
-
-            public LostKeyFinder(WeakKeyDictionary<K, V> dictionary, WeakKey key) 
-            {
-                _dictionary = dictionary;
-                _key = key;
-            }
-
-            ~LostKeyFinder() 
-            {
-                if (_dictionary._finalized || _key == null) 
-                {
-                    if (_key != null) 
-                    {
-                        _key.Release();
-                        _key = null;
-                    }
-                    return;
-                }
-                // if (!_key.IsAlive) {
-                if (_key.Target == null) 
-                {
-                    bool locked = false;
-                    try
-                    {
-                        locked = Monitor.TryEnter(_dictionary._[....]);
-                        _dictionary._internalDictionary.Remove(_key);
-                    }
-                    finally
-                    {
-                        if (locked)
-                        {
-                            Monitor.Exit(_dictionary._[....]);
-                        }
-                    }
-
-                    if (locked)
-                    {
-                        _key.Release();
-                        _key = null;
-                    }
-                    else
-                    {
-                        GC.ReRegisterForFinalize(this);
-                    }
-                }
-                else if (_dictionary._internalDictionary.ContainsKey(_key))
-                {
-                    GC.ReRegisterForFinalize(this);
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/XamlUtilities.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Model/XamlUtilities.cs
deleted file mode 100644 (file)
index 285b990..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-
-namespace System.Activities.Presentation.Model
-{
-
-    using System;
-    using System.Collections;
-    using System.ComponentModel;
-    using System.Reflection;
-
-
-    internal static class XamlUtilities
-    {
-
-        static Hashtable converterCache;
-        static object converterCacheSyncObject = new object();
-
-        public static TypeConverter GetConverter(Type itemType)
-        {
-            TypeConverter converter = TypeDescriptor.GetConverter(itemType);
-
-            if (converter == null || converter.GetType() == typeof(TypeConverter))
-            {
-
-                // We got an invalid converter.  WPF will do this if the converter
-                // is internal, but we use internal converters all over the place
-                // at design time.  Detect this and build the converter ourselves.
-
-                if (converterCache != null)
-                {
-                    converter = (TypeConverter)converterCache[itemType];
-                    if (converter != null)
-                    {
-                        return converter;
-                    }
-                }
-
-                AttributeCollection attrs = TypeDescriptor.GetAttributes(itemType);
-                TypeConverterAttribute tca = attrs[typeof(TypeConverterAttribute)] as TypeConverterAttribute;
-                if (tca != null && tca.ConverterTypeName != null)
-                {
-                    Type type = Type.GetType(tca.ConverterTypeName);
-                    if (type != null && !type.IsPublic && typeof(TypeConverter).IsAssignableFrom(type))
-                    {
-                        ConstructorInfo ctor = type.GetConstructor(new Type[] { typeof(Type) });
-                        if (ctor != null)
-                        {
-                            converter = (TypeConverter)ctor.Invoke(new object[] { itemType });
-                        }
-                        else
-                        {
-                            converter = (TypeConverter)Activator.CreateInstance(type);
-                        }
-
-                        lock (converterCacheSyncObject)
-                        {
-                            if (converterCache == null)
-                            {
-                                converterCache = new Hashtable();
-
-                                // Listen to type changes and clear the cache.
-                                // This allows new metadata tables to be installed
-
-                                TypeDescriptor.Refreshed += delegate(RefreshEventArgs args)
-                                {
-                                    converterCache.Remove(args.TypeChanged);
-                                };
-                            }
-
-                            converterCache[itemType] = converter;
-                        }
-                    }
-                }
-            }
-
-            return converter;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ModelItemKeyValuePair.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ModelItemKeyValuePair.cs
deleted file mode 100644 (file)
index a87e610..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Collections.ObjectModel;
-    using System.Collections.Generic;
-    using System.Runtime;
-
-    class ModelItemKeyValuePair<TKey, TValue>
-    {
-        internal DictionaryItemsCollection<TKey, TValue> collection;
-
-        TKey key;
-
-        TValue value;
-
-        public ModelItemKeyValuePair()
-        {
-        }
-
-        public ModelItemKeyValuePair(TKey key, TValue value)
-        {
-            this.key = key;
-            this.value = value;
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public TKey Key
-        {
-            get
-            {
-                return this.key;
-            }
-            set
-            {
-                if (this.collection != null)
-                {
-                    this.collection.PreUpdateKey(this.key, value);
-                }
-                this.key = value;
-                if (this.collection != null)
-                {
-                    this.collection.PostUpdateKey();
-                }
-            }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public TValue Value
-        {
-            get
-            {
-                return this.value;
-            }
-            set
-            {
-                if (this.collection != null)
-                {
-                    this.collection.UpdateValue(this.key, value);
-                }
-                this.value = value;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NamespaceHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NamespaceHelper.cs
deleted file mode 100644 (file)
index 7d644f7..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Expressions;
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.View;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Reflection;
-    using Microsoft.VisualBasic.Activities;
-
-    internal static class NamespaceHelper
-    {
-        private static readonly List<string> BlackListedAssemblies = new List<string>
-        {
-            typeof(ViewStateService).Assembly.GetName().FullName,
-            typeof(ViewStateService).Assembly.GetName().Name,
-        };
-
-        internal static IList<string> GetTextExpressionNamespaces(object root, out IList<AssemblyReference> references)
-        {
-            if (NamespaceHelper.ShouldUsePropertiesForImplementation(root))
-            {
-                references = TextExpression.GetReferencesForImplementation(root);
-                return TextExpression.GetNamespacesForImplementation(root);
-            }
-            else
-            {
-                references = TextExpression.GetReferences(root);
-                return TextExpression.GetNamespaces(root);
-            }
-        }
-
-        internal static void SetTextExpressionNamespaces(object root, IList<string> namespaces, IList<AssemblyReference> references)
-        {
-            if (NamespaceHelper.ShouldUsePropertiesForImplementation(root))
-            {
-                TextExpression.SetNamespacesForImplementation(root, namespaces);
-                TextExpression.SetReferencesForImplementation(root, references);
-            }
-            else
-            {
-                TextExpression.SetNamespaces(root, namespaces);
-                TextExpression.SetReferences(root, references);
-            }
-        }
-
-        internal static void SetVisualBasicSettings(object root, VisualBasicSettings settings)
-        {
-            if (NamespaceHelper.ShouldUsePropertiesForImplementation(root))
-            {
-                VisualBasic.SetSettingsForImplementation(root, settings);                
-            }
-            else
-            {
-                VisualBasic.SetSettings(root, settings);
-            }
-        }
-
-        internal static void ConvertToTextExpressionImports(VisualBasicSettings settings, out IList<string> importedNamespace, out IList<AssemblyReference> references)
-        {
-            importedNamespace = new Collection<string>();
-            List<string> assemblyNames = new List<string>();
-            foreach (VisualBasicImportReference visualbasicImport in settings.ImportReferences)
-            {
-                if (!BlackListedAssemblies.Contains(visualbasicImport.Assembly))
-                {
-                    if (importedNamespace.IndexOf(visualbasicImport.Import) == -1)
-                    {
-                        importedNamespace.Add(visualbasicImport.Import);
-                    }
-
-                    string displayName = visualbasicImport.Assembly.Split(',')[0];
-                    if (assemblyNames.IndexOf(displayName) == -1)
-                    {
-                        assemblyNames.Add(displayName);
-                    }
-                }
-            }
-
-            references = new Collection<AssemblyReference>();
-            foreach (string assemblyName in assemblyNames)
-            {
-                AssemblyReference reference = new AssemblyReference
-                {
-                    AssemblyName = new AssemblyName(assemblyName)
-                };
-
-                references.Add(reference);
-            }
-        }
-
-        internal static void ConvertToVBSettings(IList<string> importedNamespaces, IList<AssemblyReference> references, EditingContext context, out VisualBasicSettings settings)
-        {
-            Dictionary<string, List<string>> visualBasicImports = new Dictionary<string, List<string>>();
-            foreach (string importedNamespace in importedNamespaces)
-            {
-                visualBasicImports.Add(importedNamespace, new List<string>());
-            }
-
-            Collection<Assembly> assemblies = new Collection<Assembly>();
-            IMultiTargetingSupportService multiTargetingService = context.Services.GetService<IMultiTargetingSupportService>();
-            foreach (AssemblyReference reference in references)
-            {
-                Assembly assembly;
-                if (multiTargetingService == null)
-                {
-                    reference.LoadAssembly();
-                    assembly = reference.Assembly;
-                }
-                else
-                {
-                    assembly = AssemblyContextControlItem.GetAssembly(reference.AssemblyName, multiTargetingService);
-                }
-
-                if (assembly != null)
-                {
-                    assemblies.Add(assembly);
-                }
-            }
-
-            AssemblyContextControlItem assemblyContextItem = context.Items.GetValue<AssemblyContextControlItem>();
-            AssemblyName localAssembly = null;
-            if (assemblyContextItem != null)
-            {
-                localAssembly = assemblyContextItem.LocalAssemblyName;
-            }
-
-            if (localAssembly != null)
-            {
-                Assembly assembly = AssemblyContextControlItem.GetAssembly(localAssembly, multiTargetingService);
-                if (assembly != null)
-                {
-                    assemblies.Add(assembly);
-                }
-            }
-
-            foreach (Assembly assembly in assemblies)
-            {
-                foreach (Type type in assembly.GetTypes())
-                {
-                    string ns = type.Namespace;
-                    if ((ns != null) && visualBasicImports.ContainsKey(ns))
-                    {
-                        string assemblyName = assembly.GetName().Name;
-                        visualBasicImports[ns].Add(assemblyName);
-                    }
-                }
-            }
-
-            settings = new VisualBasicSettings();
-            foreach (KeyValuePair<string, List<string>> entries in visualBasicImports)
-            {
-                string importedNamespace = entries.Key;
-                foreach (string assemblyName in entries.Value)
-                {
-                    settings.ImportReferences.Add(new VisualBasicImportReference
-                    {
-                        Import = importedNamespace,
-                        Assembly = assemblyName
-                    });
-                }
-            }
-        }
-
-        private static bool ShouldUsePropertiesForImplementation(object root)
-        {
-            if ((root is ActivityBuilder) || (root is DynamicActivity))
-            {
-                return true;
-            }
-            else
-            {
-                return false;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NamespaceHelper.cs.back b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NamespaceHelper.cs.back
deleted file mode 100644 (file)
index d46f267..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Expressions;
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.View;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Reflection;
-    using Microsoft.VisualBasic.Activities;
-
-    internal static class NamespaceHelper
-    {
-        private static readonly List<string> ----edAssemblies = new List<string>
-        {
-            typeof(ViewStateService).Assembly.GetName().FullName,
-            typeof(ViewStateService).Assembly.GetName().Name,
-        };
-
-        internal static IList<string> GetTextExpressionNamespaces(object root, out IList<AssemblyReference> references)
-        {
-            if (NamespaceHelper.ShouldUsePropertiesForImplementation(root))
-            {
-                references = TextExpression.GetReferencesForImplementation(root);
-                return TextExpression.GetNamespacesForImplementation(root);
-            }
-            else
-            {
-                references = TextExpression.GetReferences(root);
-                return TextExpression.GetNamespaces(root);
-            }
-        }
-
-        internal static void SetTextExpressionNamespaces(object root, IList<string> namespaces, IList<AssemblyReference> references)
-        {
-            if (NamespaceHelper.ShouldUsePropertiesForImplementation(root))
-            {
-                TextExpression.SetNamespacesForImplementation(root, namespaces);
-                TextExpression.SetReferencesForImplementation(root, references);
-            }
-            else
-            {
-                TextExpression.SetNamespaces(root, namespaces);
-                TextExpression.SetReferences(root, references);
-            }
-        }
-
-        internal static void SetVisualBasicSettings(object root, VisualBasicSettings settings)
-        {
-            if (NamespaceHelper.ShouldUsePropertiesForImplementation(root))
-            {
-                VisualBasic.SetSettingsForImplementation(root, settings);                
-            }
-            else
-            {
-                VisualBasic.SetSettings(root, settings);
-            }
-        }
-
-        internal static void ConvertToTextExpressionImports(VisualBasicSettings settings, out IList<string> importedNamespace, out IList<AssemblyReference> references)
-        {
-            importedNamespace = new Collection<string>();
-            List<string> assemblyNames = new List<string>();
-            foreach (VisualBasicImportReference visualbasicImport in settings.ImportReferences)
-            {
-                if (!----edAssemblies.Contains(visualbasicImport.Assembly))
-                {
-                    if (importedNamespace.IndexOf(visualbasicImport.Import) == -1)
-                    {
-                        importedNamespace.Add(visualbasicImport.Import);
-                    }
-
-                    string displayName = visualbasicImport.Assembly.Split(',')[0];
-                    if (assemblyNames.IndexOf(displayName) == -1)
-                    {
-                        assemblyNames.Add(displayName);
-                    }
-                }
-            }
-
-            references = new Collection<AssemblyReference>();
-            foreach (string assemblyName in assemblyNames)
-            {
-                AssemblyReference reference = new AssemblyReference
-                {
-                    AssemblyName = new AssemblyName(assemblyName)
-                };
-
-                references.Add(reference);
-            }
-        }
-
-        internal static void ConvertToVBSettings(IList<string> importedNamespaces, IList<AssemblyReference> references, EditingContext context, out VisualBasicSettings settings)
-        {
-            Dictionary<string, List<string>> visualBasicImports = new Dictionary<string, List<string>>();
-            foreach (string importedNamespace in importedNamespaces)
-            {
-                visualBasicImports.Add(importedNamespace, new List<string>());
-            }
-
-            Collection<Assembly> assemblies = new Collection<Assembly>();
-            IMultiTargetingSupportService multiTargetingService = context.Services.GetService<IMultiTargetingSupportService>();
-            foreach (AssemblyReference reference in references)
-            {
-                Assembly assembly;
-                if (multiTargetingService == null)
-                {
-                    reference.LoadAssembly();
-                    assembly = reference.Assembly;
-                }
-                else
-                {
-                    assembly = AssemblyContextControlItem.GetAssembly(reference.AssemblyName, multiTargetingService);
-                }
-
-                if (assembly != null)
-                {
-                    assemblies.Add(assembly);
-                }
-            }
-
-            AssemblyContextControlItem assemblyContextItem = context.Items.GetValue<AssemblyContextControlItem>();
-            AssemblyName localAssembly = null;
-            if (assemblyContextItem != null)
-            {
-                localAssembly = assemblyContextItem.LocalAssemblyName;
-            }
-
-            if (localAssembly != null)
-            {
-                Assembly assembly = AssemblyContextControlItem.GetAssembly(localAssembly, multiTargetingService);
-                if (assembly != null)
-                {
-                    assemblies.Add(assembly);
-                }
-            }
-
-            foreach (Assembly assembly in assemblies)
-            {
-                foreach (Type type in assembly.GetTypes())
-                {
-                    string ns = type.Namespace;
-                    if ((ns != null) && visualBasicImports.ContainsKey(ns))
-                    {
-                        string assemblyName = assembly.GetName().Name;
-                        visualBasicImports[ns].Add(assemblyName);
-                    }
-                }
-            }
-
-            settings = new VisualBasicSettings();
-            foreach (KeyValuePair<string, List<string>> entries in visualBasicImports)
-            {
-                string importedNamespace = entries.Key;
-                foreach (string assemblyName in entries.Value)
-                {
-                    settings.ImportReferences.Add(new VisualBasicImportReference
-                    {
-                        Import = importedNamespace,
-                        Assembly = assemblyName
-                    });
-                }
-            }
-        }
-
-        private static bool ShouldUsePropertiesForImplementation(object root)
-        {
-            if ((root is ActivityBuilder) || (root is DynamicActivity))
-            {
-                return true;
-            }
-            else
-            {
-                return false;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NamespaceListProperty.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NamespaceListProperty.cs
deleted file mode 100644 (file)
index 279e6e9..0000000
+++ /dev/null
@@ -1,594 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Runtime;
-    using System.ComponentModel;
-    using Microsoft.VisualBasic.Activities;
-    using System.Activities.Presentation.View;
-    using System.Activities.Expressions;
-    using System.Reflection;
-    using System.Collections.ObjectModel;    
-
-    class NamespaceListPropertyDescriptor : PropertyDescriptor
-    {
-        public const string ImportCollectionPropertyName = "Imports";
-        public const string AvailableNamespacesPropertyName = "AvailableNamespaces";
-        public const string NamespacePropertyName = "Namespace";        
-        
-        object instance;
-
-        public NamespaceListPropertyDescriptor(object instance)
-            : base(ImportCollectionPropertyName, null)
-        {
-            this.instance = instance;
-        }
-
-        public override Type ComponentType
-        {
-            get { return this.instance.GetType(); }
-        }
-
-        public override bool IsReadOnly
-        {
-            get
-            {
-                return true;
-            }
-        }
-
-        public override Type PropertyType
-        {
-            get
-            {
-                return typeof(NamespaceList);
-            }
-        }
-
-        public override bool IsBrowsable
-        {
-            get
-            {
-                return false;
-            }
-        }
-
-        public override bool CanResetValue(object component)
-        {
-            return false;
-        }
-
-        public override object GetValue(object component)
-        {
-            VisualBasicSettings settings = VisualBasic.GetSettings(component);
-            IList<AssemblyReference> references;
-            IList<string> namespaces = NamespaceHelper.GetTextExpressionNamespaces(component, out references);
-            if ((namespaces != null) && ((namespaces.Count > 0) || ((namespaces.Count == 0) && (settings == null))))
-            {                                
-                return new TextExpressionNamespaceList(namespaces, references);
-            }
-            else 
-            {
-                Fx.Assert(settings != null, "Either VB settings or new TextExpression attached properties should be set");
-                return new VisualBasicNamespaceList(settings.ImportReferences);
-            }            
-        }
-
-        public override void ResetValue(object component)
-        {
-            IList<AssemblyReference> references;
-            IList<string> importedNamespaces = NamespaceHelper.GetTextExpressionNamespaces(component, out references);
-            if (importedNamespaces != null)
-            {
-                NamespaceHelper.SetTextExpressionNamespaces(component, null, null);
-            }
-            else
-            {
-                NamespaceHelper.SetVisualBasicSettings(component, null);
-            }
-        }
-
-        public override void SetValue(object component, object value)
-        {
-            NamespaceList namespaceList = value as NamespaceList;
-            if (namespaceList != null)
-            {
-                if (namespaceList is VisualBasicNamespaceList)
-                {
-                    VisualBasicNamespaceList visualBasicNamespaces = namespaceList as VisualBasicNamespaceList;
-                    VisualBasicSettings settings = new VisualBasicSettings();
-                    settings.ImportReferences.UnionWith(visualBasicNamespaces.VisualBasicImports);
-                    NamespaceHelper.SetVisualBasicSettings(component, settings);
-                }
-                else 
-                {
-                    Fx.Assert(namespaceList is TextExpressionNamespaceList, "The namespace list must be either of VisualBaiscSettings or TextExpression attached properties.");
-                    TextExpressionNamespaceList textExpressionNamespace = namespaceList as TextExpressionNamespaceList;
-                    NamespaceHelper.SetTextExpressionNamespaces(
-                        component, 
-                        textExpressionNamespace.TextExpressionNamespaces, 
-                        textExpressionNamespace.TextExpressionReferences);
-                }
-            }
-            else
-            {
-                this.ResetValue(component);
-            }
-        }
-
-        public override bool ShouldSerializeValue(object component)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-
-        protected override void FillAttributes(IList attributeList)
-        {
-            attributeList.Add(new BrowsableAttribute(false));
-            base.FillAttributes(attributeList);
-        }
-    }
-
-    class NamespaceData
-    {
-        public string Namespace
-        {
-            get;
-            set;
-        }
-
-        //Used by screen reader
-        public override string ToString()
-        {
-            return this.Namespace;
-        }
-    }
-
-    abstract class NamespaceList : IList
-    {
-        //list of uniqueNamespaces, the element is a tuple of the namespace and a arbitary data for consumer to use
-        List<NamespaceData> uniqueNamespaces;
-        Dictionary<string, List<string>> availableNamespaces;
-
-        protected List<NamespaceData> UniqueNamespaces
-        {
-            get
-            {
-                if (this.uniqueNamespaces == null)
-                {
-                    this.uniqueNamespaces = new List<NamespaceData>();
-                }
-                return this.uniqueNamespaces;
-            }
-        }
-
-        public Dictionary<string, List<string>> AvailableNamespaces
-        {
-            get
-            {
-                if (availableNamespaces == null)
-                {
-                    availableNamespaces = new Dictionary<string, List<string>>();
-                }
-
-                return availableNamespaces;
-            }
-        }
-
-        internal int Lookup(string ns)
-        {
-            for (int i = 0; i < this.UniqueNamespaces.Count; i++)
-            {
-                if (this.UniqueNamespaces[i].Namespace == ns)
-                {
-                    return i;
-                }
-            }
-
-            return -1;
-        }
-
-        public int Add(object value)
-        {
-            NamespaceData ns = value as NamespaceData;
-
-            if (ns == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException(SR.NamespaceListArgumentMustBeNamespaceData, "value"));
-            }
-
-            if (Lookup(ns.Namespace) == -1)
-            {
-                this.AddCore(ns);
-                return ((IList)this.UniqueNamespaces).Add(ns);
-            }
-            else
-            {
-                return -1;
-            }
-        }
-
-        public void Clear()
-        {
-            this.ClearCore();
-            this.UniqueNamespaces.Clear();
-        }
-
-        public bool Contains(object value)
-        {
-            return ((IList)this.UniqueNamespaces).Contains(value);
-        }
-
-        public int IndexOf(object value)
-        {
-            return ((IList)this.UniqueNamespaces).IndexOf(value);
-        }
-
-        public void Insert(int index, object value)
-        {
-            NamespaceData ns = value as NamespaceData;
-            if (ns == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException(SR.NamespaceListArgumentMustBeNamespaceData, "value"));
-            }
-
-            if (Lookup(ns.Namespace) == -1)
-            {
-                this.UniqueNamespaces.Insert(index, ns);
-                this.InsertCore(index, ns);                
-            }
-            else
-            {
-                throw FxTrace.Exception.AsError(new InvalidOperationException());
-            }
-        }
-
-        public bool IsFixedSize
-        {
-            get { return false; }
-        }
-
-        public bool IsReadOnly
-        {
-            get { return false; }
-        }
-
-        public void Remove(object value)
-        {
-            NamespaceData ns = value as NamespaceData;
-            if (ns == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException(SR.NamespaceListArgumentMustBeNamespaceData, "value"));
-            }
-
-            int index = this.Lookup(ns.Namespace);
-            if (index != -1)
-            {
-                RemoveAt(index);
-            }
-        }
-
-        public void RemoveAt(int index)
-        {
-            NamespaceData ns = this.UniqueNamespaces[index];
-
-            RemoveNamespaceFromSet(ns.Namespace);
-
-            this.UniqueNamespaces.RemoveAt(index);
-        }
-
-        public object this[int index]
-        {
-            get
-            {
-                return this.UniqueNamespaces[index];
-            }
-            set
-            {
-                NamespaceData ns = value as NamespaceData;
-                if (ns == null)
-                {
-                    throw FxTrace.Exception.AsError(new ArgumentException(SR.NamespaceListArgumentMustBeNamespaceData, "value"));
-                }
-
-                if (Lookup(ns.Namespace) == -1)
-                {
-                    this.SetValueAt(index, ns);
-                    this.UniqueNamespaces[index] = ns;
-                }
-                else
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.NamespaceListNoDuplicate));
-                }
-            }
-        }
-
-        public void CopyTo(Array array, int index)
-        {
-            ((IList)this.UniqueNamespaces).CopyTo(array, index);
-        }
-
-        public int Count
-        {
-            get { return this.UniqueNamespaces.Count; }
-        }
-
-        public bool IsSynchronized
-        {
-            get { return false; }
-        }
-
-        public object SyncRoot
-        {
-            get { return null; }
-        }
-
-        public IEnumerator GetEnumerator()
-        {
-            return this.UniqueNamespaces.GetEnumerator();
-        }
-
-        public void UpdateAssemblyInfo(string importedNamespace)
-        {
-            this.UpdateAssemblyInfoCore(importedNamespace);
-        }
-
-        protected abstract void AddCore(NamespaceData ns);
-        protected abstract void ClearCore();
-        protected abstract void InsertCore(int index, NamespaceData ns);
-        protected abstract void RemoveNamespaceFromSet(string ns);
-        protected abstract void SetValueAt(int index, NamespaceData ns);
-        protected abstract void UpdateAssemblyInfoCore(string importedNamespace);
-    }
-
-    class VisualBasicNamespaceList : NamespaceList
-    {
-        //Since XAML generated by designer will almost always have some designer type in it, designer namespaces will appear in XAML.
-        //And because Runtime design could not destinguish namespaces coming from XAML serialization between namespaces added by users,
-        //designer namespaces will show up in import designer. This is bad user experience because most WF project won't reference designer
-        //assembly. We could safely assume that customers won't use designer namespaces and type in their WF expressions, so we simply
-        //---- designer namespaces out of the namespace list
-        static readonly string[] BlackListedAssemblies = new string[] 
-        {
-            typeof(ViewStateService).Assembly.GetName().FullName,
-            typeof(ViewStateService).Assembly.GetName().Name,
-        };
-
-        static readonly Collection<string> FrameworkAssemblies = new Collection<string>
-        {
-            typeof(Activity).Assembly.GetName().FullName,
-            typeof(Activity).Assembly.GetName().Name,            
-        };
-
-        static readonly Collection<string> BlackListsedNamespaces = new Collection<string>
-        {
-            "System.Activities.Composition",
-            "System.Activities.Debugger.Symbol"
-        };
-
-        public VisualBasicNamespaceList(ISet<VisualBasicImportReference> importReferences)
-        {
-            this.VisualBasicImports = importReferences;
-
-            foreach (string blackListedAssembly in BlackListedAssemblies)
-            {
-                RemoveAssemblyFromSet(blackListedAssembly);
-            }
-            foreach (VisualBasicImportReference import in importReferences)
-            {
-                if (!(BlackListsedNamespaces.Contains(import.Import) && FrameworkAssemblies.Contains(import.Assembly)))
-                {
-                    if (Lookup(import.Import) == -1)
-                    {
-                        this.UniqueNamespaces.Add(new NamespaceData { Namespace = import.Import });
-                    }
-                }
-            }
-        }
-
-        internal ISet<VisualBasicImportReference> VisualBasicImports
-        {
-            get;
-            private set;
-        }
-
-        IEnumerable<VisualBasicImportReference> GetVisualBasicImportReferences(string importNamespace)
-        {
-            List<VisualBasicImportReference> imports = new List<VisualBasicImportReference>();
-            List<string> assemblies;
-            //in rehost cases or when some assembiles are not referenced, we may not find that namespace
-            if (!this.AvailableNamespaces.TryGetValue(importNamespace, out assemblies))
-            {
-                return imports;
-            }
-
-            foreach (string assembly in assemblies)
-            {
-                imports.Add(new VisualBasicImportReference
-                {
-                    Import = importNamespace,
-                    Assembly = assembly
-                });
-            }
-            return imports;
-        }
-
-        protected override void UpdateAssemblyInfoCore(string importedNamespace)
-        {
-            if (this.VisualBasicImports != null)
-            {
-                if (this.Lookup(importedNamespace) != -1)
-                {
-                    this.VisualBasicImports.UnionWith(GetVisualBasicImportReferences(importedNamespace));
-                }
-                else
-                {
-                    Fx.Assert("UpdateAssemblyInfor should only be called for existed namespace");
-                }
-            }
-        }
-
-        protected override void RemoveNamespaceFromSet(string ns)
-        {
-            List<VisualBasicImportReference> toRemoves = new List<VisualBasicImportReference>();
-            foreach (VisualBasicImportReference import in this.VisualBasicImports)
-            {
-                if (import.Import == ns)
-                {
-                    toRemoves.Add(import);
-                }
-            }
-
-            foreach (VisualBasicImportReference toRemove in toRemoves)
-            {
-                this.VisualBasicImports.Remove(toRemove);
-            }
-        }
-
-        private void RemoveAssemblyFromSet(string assembly)
-        {
-            List<VisualBasicImportReference> toRemoves = new List<VisualBasicImportReference>();
-            foreach (VisualBasicImportReference import in this.VisualBasicImports)
-            {
-                if (import.Assembly == assembly)
-                {
-                    toRemoves.Add(import);
-                }
-            }
-
-            foreach (VisualBasicImportReference toRemove in toRemoves)
-            {
-                this.VisualBasicImports.Remove(toRemove);
-            }
-        }
-
-        protected override void AddCore(NamespaceData ns)
-        {
-            this.VisualBasicImports.UnionWith(GetVisualBasicImportReferences(ns.Namespace));
-        }
-
-        protected override void ClearCore()
-        {
-            this.VisualBasicImports.Clear();
-        }
-
-        protected override void InsertCore(int index, NamespaceData ns)
-        {
-            this.VisualBasicImports.UnionWith(GetVisualBasicImportReferences(ns.Namespace));
-        }
-
-        protected override void SetValueAt(int index, NamespaceData ns)
-        {
-            RemoveNamespaceFromSet(this.UniqueNamespaces[index].Namespace);
-            this.VisualBasicImports.UnionWith(GetVisualBasicImportReferences(ns.Namespace));
-        }
-    }
-
-    class TextExpressionNamespaceList : NamespaceList
-    {
-        public TextExpressionNamespaceList(IList<string> importedNamespaces, IList<AssemblyReference> references)
-        {
-            this.TextExpressionNamespaces = importedNamespaces;
-            this.TextExpressionReferences = references;
-            foreach (string importedNamespace in importedNamespaces)
-            {
-                if (Lookup(importedNamespace) == -1)
-                {
-                    this.UniqueNamespaces.Add(new NamespaceData { Namespace = importedNamespace });
-                }
-            }
-        }
-
-        internal IList<string> TextExpressionNamespaces
-        {
-            get;
-            private set;
-        }
-
-        internal IList<AssemblyReference> TextExpressionReferences
-        {
-            get;
-            private set;
-        }
-
-
-        protected override void RemoveNamespaceFromSet(string ns)
-        {
-            this.TextExpressionNamespaces.Remove(ns);
-        }
-
-        internal void RemoveAssemblyFromSet(string assembly)
-        {
-            AssemblyReference toRemove = null;
-            foreach (AssemblyReference reference in this.TextExpressionReferences)
-            {
-                if (reference.AssemblyName.Name == assembly)
-                {
-                    toRemove = reference;
-                    break;
-                }
-            }
-            if (toRemove != null)
-            {
-                this.TextExpressionReferences.Remove(toRemove);
-            }
-        }
-
-        private void AddAssemblyToSet(string assembly)
-        {
-            bool isExisted = false;
-            foreach (AssemblyReference reference in this.TextExpressionReferences)
-            {
-                if (reference.AssemblyName.Name == assembly)
-                {
-                    isExisted = true;
-                }
-            }
-
-            if (!isExisted)
-            {
-                this.TextExpressionReferences.Add(new AssemblyReference { AssemblyName = new AssemblyName(assembly) });
-            }
-        }
-
-        protected override void AddCore(NamespaceData ns)
-        {
-            this.InsertCore(this.TextExpressionNamespaces.Count, ns);
-        }
-
-        protected override void ClearCore()
-        {
-            this.TextExpressionNamespaces.Clear();
-        }
-
-        protected override void InsertCore(int index, NamespaceData ns)
-        {
-            this.TextExpressionNamespaces.Insert(index, ns.Namespace);
-
-            if (this.AvailableNamespaces.ContainsKey(ns.Namespace))
-            {                
-                foreach (string assembly in this.AvailableNamespaces[ns.Namespace])
-                {
-                    this.AddAssemblyToSet(assembly);
-                }
-            }
-        }
-
-        protected override void SetValueAt(int index, NamespaceData ns)
-        {
-            this.TextExpressionNamespaces[index] = ns.Namespace;
-        }
-
-        protected override void UpdateAssemblyInfoCore(string importedNamespace)
-        {            
-            foreach (string assembly in this.AvailableNamespaces[importedNamespace])
-            {
-                this.AddAssemblyToSet(assembly);
-            }
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NamespaceListProperty.cs.back b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NamespaceListProperty.cs.back
deleted file mode 100644 (file)
index ce6960e..0000000
+++ /dev/null
@@ -1,594 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Runtime;
-    using System.ComponentModel;
-    using Microsoft.VisualBasic.Activities;
-    using System.Activities.Presentation.View;
-    using System.Activities.Expressions;
-    using System.Reflection;
-    using System.Collections.ObjectModel;    
-
-    class NamespaceListPropertyDescriptor : PropertyDescriptor
-    {
-        public const string ImportCollectionPropertyName = "Imports";
-        public const string AvailableNamespacesPropertyName = "AvailableNamespaces";
-        public const string NamespacePropertyName = "Namespace";        
-        
-        object instance;
-
-        public NamespaceListPropertyDescriptor(object instance)
-            : base(ImportCollectionPropertyName, null)
-        {
-            this.instance = instance;
-        }
-
-        public override Type ComponentType
-        {
-            get { return this.instance.GetType(); }
-        }
-
-        public override bool IsReadOnly
-        {
-            get
-            {
-                return true;
-            }
-        }
-
-        public override Type PropertyType
-        {
-            get
-            {
-                return typeof(NamespaceList);
-            }
-        }
-
-        public override bool IsBrowsable
-        {
-            get
-            {
-                return false;
-            }
-        }
-
-        public override bool CanResetValue(object component)
-        {
-            return false;
-        }
-
-        public override object GetValue(object component)
-        {
-            VisualBasicSettings settings = VisualBasic.GetSettings(component);
-            IList<AssemblyReference> references;
-            IList<string> namespaces = NamespaceHelper.GetTextExpressionNamespaces(component, out references);
-            if ((namespaces != null) && ((namespaces.Count > 0) || ((namespaces.Count == 0) && (settings == null))))
-            {                                
-                return new TextExpressionNamespaceList(namespaces, references);
-            }
-            else 
-            {
-                Fx.Assert(settings != null, "Either VB settings or new TextExpression attached properties should be set");
-                return new VisualBasicNamespaceList(settings.ImportReferences);
-            }            
-        }
-
-        public override void ResetValue(object component)
-        {
-            IList<AssemblyReference> references;
-            IList<string> importedNamespaces = NamespaceHelper.GetTextExpressionNamespaces(component, out references);
-            if (importedNamespaces != null)
-            {
-                NamespaceHelper.SetTextExpressionNamespaces(component, null, null);
-            }
-            else
-            {
-                NamespaceHelper.SetVisualBasicSettings(component, null);
-            }
-        }
-
-        public override void SetValue(object component, object value)
-        {
-            NamespaceList namespaceList = value as NamespaceList;
-            if (namespaceList != null)
-            {
-                if (namespaceList is VisualBasicNamespaceList)
-                {
-                    VisualBasicNamespaceList visualBasicNamespaces = namespaceList as VisualBasicNamespaceList;
-                    VisualBasicSettings settings = new VisualBasicSettings();
-                    settings.ImportReferences.UnionWith(visualBasicNamespaces.VisualBasicImports);
-                    NamespaceHelper.SetVisualBasicSettings(component, settings);
-                }
-                else 
-                {
-                    Fx.Assert(namespaceList is TextExpressionNamespaceList, "The namespace list must be either of VisualBaiscSettings or TextExpression attached properties.");
-                    TextExpressionNamespaceList textExpressionNamespace = namespaceList as TextExpressionNamespaceList;
-                    NamespaceHelper.SetTextExpressionNamespaces(
-                        component, 
-                        textExpressionNamespace.TextExpressionNamespaces, 
-                        textExpressionNamespace.TextExpressionReferences);
-                }
-            }
-            else
-            {
-                this.ResetValue(component);
-            }
-        }
-
-        public override bool ShouldSerializeValue(object component)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-
-        protected override void FillAttributes(IList attributeList)
-        {
-            attributeList.Add(new BrowsableAttribute(false));
-            base.FillAttributes(attributeList);
-        }
-    }
-
-    class NamespaceData
-    {
-        public string Namespace
-        {
-            get;
-            set;
-        }
-
-        //Used by screen reader
-        public override string ToString()
-        {
-            return this.Namespace;
-        }
-    }
-
-    abstract class NamespaceList : IList
-    {
-        //list of uniqueNamespaces, the element is a tuple of the namespace and a arbitary data for consumer to use
-        List<NamespaceData> uniqueNamespaces;
-        Dictionary<string, List<string>> availableNamespaces;
-
-        protected List<NamespaceData> UniqueNamespaces
-        {
-            get
-            {
-                if (this.uniqueNamespaces == null)
-                {
-                    this.uniqueNamespaces = new List<NamespaceData>();
-                }
-                return this.uniqueNamespaces;
-            }
-        }
-
-        public Dictionary<string, List<string>> AvailableNamespaces
-        {
-            get
-            {
-                if (availableNamespaces == null)
-                {
-                    availableNamespaces = new Dictionary<string, List<string>>();
-                }
-
-                return availableNamespaces;
-            }
-        }
-
-        internal int Lookup(string ns)
-        {
-            for (int i = 0; i < this.UniqueNamespaces.Count; i++)
-            {
-                if (this.UniqueNamespaces[i].Namespace == ns)
-                {
-                    return i;
-                }
-            }
-
-            return -1;
-        }
-
-        public int Add(object value)
-        {
-            NamespaceData ns = value as NamespaceData;
-
-            if (ns == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException(SR.NamespaceListArgumentMustBeNamespaceData, "value"));
-            }
-
-            if (Lookup(ns.Namespace) == -1)
-            {
-                this.AddCore(ns);
-                return ((IList)this.UniqueNamespaces).Add(ns);
-            }
-            else
-            {
-                return -1;
-            }
-        }
-
-        public void Clear()
-        {
-            this.ClearCore();
-            this.UniqueNamespaces.Clear();
-        }
-
-        public bool Contains(object value)
-        {
-            return ((IList)this.UniqueNamespaces).Contains(value);
-        }
-
-        public int IndexOf(object value)
-        {
-            return ((IList)this.UniqueNamespaces).IndexOf(value);
-        }
-
-        public void Insert(int index, object value)
-        {
-            NamespaceData ns = value as NamespaceData;
-            if (ns == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException(SR.NamespaceListArgumentMustBeNamespaceData, "value"));
-            }
-
-            if (Lookup(ns.Namespace) == -1)
-            {
-                this.UniqueNamespaces.Insert(index, ns);
-                this.InsertCore(index, ns);                
-            }
-            else
-            {
-                throw FxTrace.Exception.AsError(new InvalidOperationException());
-            }
-        }
-
-        public bool IsFixedSize
-        {
-            get { return false; }
-        }
-
-        public bool IsReadOnly
-        {
-            get { return false; }
-        }
-
-        public void Remove(object value)
-        {
-            NamespaceData ns = value as NamespaceData;
-            if (ns == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException(SR.NamespaceListArgumentMustBeNamespaceData, "value"));
-            }
-
-            int index = this.Lookup(ns.Namespace);
-            if (index != -1)
-            {
-                RemoveAt(index);
-            }
-        }
-
-        public void RemoveAt(int index)
-        {
-            NamespaceData ns = this.UniqueNamespaces[index];
-
-            RemoveNamespaceFromSet(ns.Namespace);
-
-            this.UniqueNamespaces.RemoveAt(index);
-        }
-
-        public object this[int index]
-        {
-            get
-            {
-                return this.UniqueNamespaces[index];
-            }
-            set
-            {
-                NamespaceData ns = value as NamespaceData;
-                if (ns == null)
-                {
-                    throw FxTrace.Exception.AsError(new ArgumentException(SR.NamespaceListArgumentMustBeNamespaceData, "value"));
-                }
-
-                if (Lookup(ns.Namespace) == -1)
-                {
-                    this.SetValueAt(index, ns);
-                    this.UniqueNamespaces[index] = ns;
-                }
-                else
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.NamespaceListNoDuplicate));
-                }
-            }
-        }
-
-        public void CopyTo(Array array, int index)
-        {
-            ((IList)this.UniqueNamespaces).CopyTo(array, index);
-        }
-
-        public int Count
-        {
-            get { return this.UniqueNamespaces.Count; }
-        }
-
-        public bool IsSynchronized
-        {
-            get { return false; }
-        }
-
-        public object SyncRoot
-        {
-            get { return null; }
-        }
-
-        public IEnumerator GetEnumerator()
-        {
-            return this.UniqueNamespaces.GetEnumerator();
-        }
-
-        public void UpdateAssemblyInfo(string importedNamespace)
-        {
-            this.UpdateAssemblyInfoCore(importedNamespace);
-        }
-
-        protected abstract void AddCore(NamespaceData ns);
-        protected abstract void ClearCore();
-        protected abstract void InsertCore(int index, NamespaceData ns);
-        protected abstract void RemoveNamespaceFromSet(string ns);
-        protected abstract void SetValueAt(int index, NamespaceData ns);
-        protected abstract void UpdateAssemblyInfoCore(string importedNamespace);
-    }
-
-    class VisualBasicNamespaceList : NamespaceList
-    {
-        //Since XAML generated by designer will almost always have some designer type in it, designer namespaces will appear in XAML.
-        //And because Runtime design could not destinguish namespaces coming from XAML serialization between namespaces added by users,
-        //designer namespaces will show up in import designer. This is bad user experience because most WF project won't reference designer
-        //assembly. We could safely assume that customers won't use designer namespaces and type in their WF expressions, so we simply
-        //---- designer namespaces out of the namespace list
-        static readonly string[] ----edAssemblies = new string[] 
-        {
-            typeof(ViewStateService).Assembly.GetName().FullName,
-            typeof(ViewStateService).Assembly.GetName().Name,
-        };
-
-        static readonly Collection<string> FrameworkAssemblies = new Collection<string>
-        {
-            typeof(Activity).Assembly.GetName().FullName,
-            typeof(Activity).Assembly.GetName().Name,            
-        };
-
-        static readonly Collection<string> ----sedNamespaces = new Collection<string>
-        {
-            "System.Activities.Composition",
-            "System.Activities.Debugger.Symbol"
-        };
-
-        public VisualBasicNamespaceList(ISet<VisualBasicImportReference> importReferences)
-        {
-            this.VisualBasicImports = importReferences;
-
-            foreach (string ----edAssembly in ----edAssemblies)
-            {
-                RemoveAssemblyFromSet(----edAssembly);
-            }
-            foreach (VisualBasicImportReference import in importReferences)
-            {
-                if (!(----sedNamespaces.Contains(import.Import) && FrameworkAssemblies.Contains(import.Assembly)))
-                {
-                    if (Lookup(import.Import) == -1)
-                    {
-                        this.UniqueNamespaces.Add(new NamespaceData { Namespace = import.Import });
-                    }
-                }
-            }
-        }
-
-        internal ISet<VisualBasicImportReference> VisualBasicImports
-        {
-            get;
-            private set;
-        }
-
-        IEnumerable<VisualBasicImportReference> GetVisualBasicImportReferences(string importNamespace)
-        {
-            List<VisualBasicImportReference> imports = new List<VisualBasicImportReference>();
-            List<string> assemblies;
-            //in rehost cases or when some assembiles are not referenced, we may not find that namespace
-            if (!this.AvailableNamespaces.TryGetValue(importNamespace, out assemblies))
-            {
-                return imports;
-            }
-
-            foreach (string assembly in assemblies)
-            {
-                imports.Add(new VisualBasicImportReference
-                {
-                    Import = importNamespace,
-                    Assembly = assembly
-                });
-            }
-            return imports;
-        }
-
-        protected override void UpdateAssemblyInfoCore(string importedNamespace)
-        {
-            if (this.VisualBasicImports != null)
-            {
-                if (this.Lookup(importedNamespace) != -1)
-                {
-                    this.VisualBasicImports.UnionWith(GetVisualBasicImportReferences(importedNamespace));
-                }
-                else
-                {
-                    Fx.Assert("UpdateAssemblyInfor should only be called for existed namespace");
-                }
-            }
-        }
-
-        protected override void RemoveNamespaceFromSet(string ns)
-        {
-            List<VisualBasicImportReference> toRemoves = new List<VisualBasicImportReference>();
-            foreach (VisualBasicImportReference import in this.VisualBasicImports)
-            {
-                if (import.Import == ns)
-                {
-                    toRemoves.Add(import);
-                }
-            }
-
-            foreach (VisualBasicImportReference toRemove in toRemoves)
-            {
-                this.VisualBasicImports.Remove(toRemove);
-            }
-        }
-
-        private void RemoveAssemblyFromSet(string assembly)
-        {
-            List<VisualBasicImportReference> toRemoves = new List<VisualBasicImportReference>();
-            foreach (VisualBasicImportReference import in this.VisualBasicImports)
-            {
-                if (import.Assembly == assembly)
-                {
-                    toRemoves.Add(import);
-                }
-            }
-
-            foreach (VisualBasicImportReference toRemove in toRemoves)
-            {
-                this.VisualBasicImports.Remove(toRemove);
-            }
-        }
-
-        protected override void AddCore(NamespaceData ns)
-        {
-            this.VisualBasicImports.UnionWith(GetVisualBasicImportReferences(ns.Namespace));
-        }
-
-        protected override void ClearCore()
-        {
-            this.VisualBasicImports.Clear();
-        }
-
-        protected override void InsertCore(int index, NamespaceData ns)
-        {
-            this.VisualBasicImports.UnionWith(GetVisualBasicImportReferences(ns.Namespace));
-        }
-
-        protected override void SetValueAt(int index, NamespaceData ns)
-        {
-            RemoveNamespaceFromSet(this.UniqueNamespaces[index].Namespace);
-            this.VisualBasicImports.UnionWith(GetVisualBasicImportReferences(ns.Namespace));
-        }
-    }
-
-    class TextExpressionNamespaceList : NamespaceList
-    {
-        public TextExpressionNamespaceList(IList<string> importedNamespaces, IList<AssemblyReference> references)
-        {
-            this.TextExpressionNamespaces = importedNamespaces;
-            this.TextExpressionReferences = references;
-            foreach (string importedNamespace in importedNamespaces)
-            {
-                if (Lookup(importedNamespace) == -1)
-                {
-                    this.UniqueNamespaces.Add(new NamespaceData { Namespace = importedNamespace });
-                }
-            }
-        }
-
-        internal IList<string> TextExpressionNamespaces
-        {
-            get;
-            private set;
-        }
-
-        internal IList<AssemblyReference> TextExpressionReferences
-        {
-            get;
-            private set;
-        }
-
-
-        protected override void RemoveNamespaceFromSet(string ns)
-        {
-            this.TextExpressionNamespaces.Remove(ns);
-        }
-
-        internal void RemoveAssemblyFromSet(string assembly)
-        {
-            AssemblyReference toRemove = null;
-            foreach (AssemblyReference reference in this.TextExpressionReferences)
-            {
-                if (reference.AssemblyName.Name == assembly)
-                {
-                    toRemove = reference;
-                    break;
-                }
-            }
-            if (toRemove != null)
-            {
-                this.TextExpressionReferences.Remove(toRemove);
-            }
-        }
-
-        private void AddAssemblyToSet(string assembly)
-        {
-            bool isExisted = false;
-            foreach (AssemblyReference reference in this.TextExpressionReferences)
-            {
-                if (reference.AssemblyName.Name == assembly)
-                {
-                    isExisted = true;
-                }
-            }
-
-            if (!isExisted)
-            {
-                this.TextExpressionReferences.Add(new AssemblyReference { AssemblyName = new AssemblyName(assembly) });
-            }
-        }
-
-        protected override void AddCore(NamespaceData ns)
-        {
-            this.InsertCore(this.TextExpressionNamespaces.Count, ns);
-        }
-
-        protected override void ClearCore()
-        {
-            this.TextExpressionNamespaces.Clear();
-        }
-
-        protected override void InsertCore(int index, NamespaceData ns)
-        {
-            this.TextExpressionNamespaces.Insert(index, ns.Namespace);
-
-            if (this.AvailableNamespaces.ContainsKey(ns.Namespace))
-            {                
-                foreach (string assembly in this.AvailableNamespaces[ns.Namespace])
-                {
-                    this.AddAssemblyToSet(assembly);
-                }
-            }
-        }
-
-        protected override void SetValueAt(int index, NamespaceData ns)
-        {
-            this.TextExpressionNamespaces[index] = ns.Namespace;
-        }
-
-        protected override void UpdateAssemblyInfoCore(string importedNamespace)
-        {            
-            foreach (string assembly in this.AvailableNamespaces[importedNamespace])
-            {
-                this.AddAssemblyToSet(assembly);
-            }
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NamespaceSettingsHandler.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NamespaceSettingsHandler.cs
deleted file mode 100644 (file)
index 641ed49..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Debugger;
-    using System.Activities.Expressions;
-    using System.Activities.Presentation.Model;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.ComponentModel;
-    using System.Linq;
-    using System.Runtime;
-    using System.Runtime.Versioning;
-    using System.ServiceModel.Activities;
-    using Microsoft.Activities.Presentation;
-    using Microsoft.VisualBasic.Activities;
-
-    //the class does several things:
-    //1. make sure a special property "Imports" (implemented using VisualBasicSettings attached properties) is added to the root object before it's loaded into ModelTree
-    //2. make sure the "root workflow" of the root object always have the same VisualBasicSettings
-    static class NamespaceSettingsHandler
-    {
-        static Type WorkflowServiceType = typeof(WorkflowService);
-
-        static public void PreviewLoadRoot(object sender, WorkflowDesigner.PreviewLoadEventArgs args)
-        {
-            object root = args.Instance;
-
-            DesignerConfigurationService configService = args.Context.Services.GetService<DesignerConfigurationService>();
-
-            if (configService != null && configService.NamespaceConversionEnabled)
-            {
-                ConvertNamespaces(root, args.Context);
-            }
-
-            if (root.GetType() == WorkflowServiceType)
-            {
-                args.Context.Services.Subscribe<ModelTreeManager>(manager => manager.Root.PropertyChanged += new PropertyChangedEventHandler(OnRootPropertyChanged));
-            }
-
-            TypeDescriptor.AddProvider(new RootModelTypeDescriptionProvider(root), root);
-        }
-
-        private static void ConvertNamespaces(object root, EditingContext context)
-        {
-            VisualBasicSettings settings = VisualBasic.GetSettings(root);
-            IList<AssemblyReference> references;
-            IList<string> importedNamespaces = NamespaceHelper.GetTextExpressionNamespaces(root, out references);
-            FrameworkName targetFramework = WorkflowDesigner.GetTargetFramework(context);
-            if (targetFramework.IsLessThan45())
-            {
-                if (settings == null)
-                {
-                    if ((importedNamespaces != null) && (importedNamespaces.Count > 0))
-                    {
-                        NamespaceHelper.ConvertToVBSettings(
-                            importedNamespaces,
-                            references,
-                            context,
-                            out settings);
-                    }
-                    else
-                    {
-                        settings = new VisualBasicSettings();
-                    }
-
-                    NamespaceHelper.SetVisualBasicSettings(root, settings);
-                    NamespaceHelper.SetTextExpressionNamespaces(root, null, null);
-                }
-
-                IDebuggableWorkflowTree debuggableWorkflowTree = root as IDebuggableWorkflowTree;
-                if (debuggableWorkflowTree != null)
-                {
-                    Activity rootActivity = debuggableWorkflowTree.GetWorkflowRoot();
-                    if (rootActivity != null)
-                    {
-                        NamespaceHelper.SetVisualBasicSettings(rootActivity, settings);
-                        NamespaceHelper.SetTextExpressionNamespaces(rootActivity, null, null);
-                    }                 
-                }
-            }
-            else
-            {
-                if ((importedNamespaces == null) || (importedNamespaces.Count == 0))
-                {
-                    if (settings != null)
-                    {
-                        NamespaceHelper.ConvertToTextExpressionImports(settings, out importedNamespaces, out references);
-                        NamespaceHelper.SetTextExpressionNamespaces(root, importedNamespaces, references);
-                        NamespaceHelper.SetVisualBasicSettings(root, null);
-                    }
-                    else
-                    {
-                        NamespaceHelper.SetTextExpressionNamespaces(root, new Collection<string>(), new Collection<AssemblyReference>());
-                    }
-                }
-            }
-        }
-
-        static void OnRootPropertyChanged(object sender, PropertyChangedEventArgs e)
-        {
-            ModelItem rootModel = sender as ModelItem;
-            Fx.Assert(rootModel != null, "sender item could not be null");
-            ModelProperty changedProperty = rootModel.Properties[e.PropertyName];
-            if (changedProperty == null)
-            {
-                return;
-            }
-
-            object changedPropertyValue = changedProperty.ComputedValue;
-            if (changedPropertyValue == null)
-            {
-                return;
-            }
-
-            Fx.Assert(rootModel.GetCurrentValue().GetType() == WorkflowServiceType, "This handler should only be attached when the root is WorkflowService");
-            IDebuggableWorkflowTree root = rootModel.GetCurrentValue() as IDebuggableWorkflowTree;            
-            Activity rootActivity = root.GetWorkflowRoot();
-            if (rootActivity == changedPropertyValue)
-            {
-                if (WorkflowDesigner.GetTargetFramework(rootModel.GetEditingContext()).IsLessThan45())
-                {
-                    VisualBasicSettings settings = VisualBasic.GetSettings(root);
-                    NamespaceHelper.SetVisualBasicSettings(changedPropertyValue, settings);
-                }
-                else
-                {
-                    IList<AssemblyReference> referencedAssemblies;
-                    IList<string> namespaces = NamespaceHelper.GetTextExpressionNamespaces(root, out referencedAssemblies);
-                    NamespaceHelper.SetTextExpressionNamespaces(rootActivity, namespaces, referencedAssemblies);
-                }
-            }
-        }
-    }
-
-    class RootModelTypeDescriptionProvider : TypeDescriptionProvider
-    {
-        public RootModelTypeDescriptionProvider(object instance)
-            : base(TypeDescriptor.GetProvider(instance))
-        {
-        }
-
-        public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
-        {
-            ICustomTypeDescriptor defaultDescriptor = base.GetTypeDescriptor(objectType, instance);
-            return new RootModelTypeDescriptor(defaultDescriptor, instance);
-        }
-    }
-
-    class RootModelTypeDescriptor : CustomTypeDescriptor
-    {
-        object root;
-        NamespaceListPropertyDescriptor importDescriptor;
-
-        public RootModelTypeDescriptor(ICustomTypeDescriptor parent, object root)
-            : base(parent)
-        {
-            this.root = root;
-        }
-
-        PropertyDescriptor ImportDescriptor
-        {
-            get
-            {
-                if (this.importDescriptor == null)
-                {
-                    this.importDescriptor = new NamespaceListPropertyDescriptor(this.root);
-                }
-
-                return this.importDescriptor;
-            }
-        }
-
-        public override PropertyDescriptorCollection GetProperties()
-        {
-            return GetProperties(null);
-        }
-
-        public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
-        {
-            return new PropertyDescriptorCollection(base.GetProperties(attributes).Cast<PropertyDescriptor>()
-                .Union(new PropertyDescriptor[] { this.ImportDescriptor }).ToArray());
-        }
-    }        
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NonTextualExpressionMorphHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NonTextualExpressionMorphHelper.cs
deleted file mode 100644 (file)
index 2070171..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Activities.Presentation.Expressions;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Services;
-    using System.Activities.Presentation.View;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Runtime;
-    using System.Text;
-    using Microsoft.VisualBasic.Activities;
-
-    //This serves as expression morph helper for following non-textual expressions:
-    //1) Literal<T>
-    //2) VariableValue<T>/VariableReference<T>
-    //The helper will morph these expressions to what specified at root object by ExpressionActivityEditor attached property
-    class NonTextualExpressionMorphHelper : ExpressionMorphHelper
-    {
-        public override bool TryMorphExpression(ActivityWithResult expression, bool isLocationExpression, Type newType, 
-            EditingContext context, out ActivityWithResult newExpression)
-        {
-            Fx.Assert(expression != null, "Original expression shouldn't be null in morph helper");
-            Fx.Assert(context != null, "EditingContext shouldn't be null in morph helper");
-            newExpression = null;
-            if (expression.ResultType == newType && 
-                (ExpressionHelper.IsGenericLocationExpressionType(expression) == isLocationExpression))
-            {
-                newExpression = expression;
-                return true;
-            }
-
-            if (context != null)
-            {
-                string expressionEditor = ExpressionHelper.GetRootEditorSetting(context.Services.GetService<ModelTreeManager>(), WorkflowDesigner.GetTargetFramework(context));
-                ParserContext parserContext = new ParserContext();
-                string expressionText = ExpressionHelper.GetExpressionString(expression, parserContext);
-                if (!string.IsNullOrEmpty(expressionEditor))
-                {
-                    return ExpressionTextBox.TryConvertFromString(expressionEditor, expressionText, isLocationExpression, newType, out newExpression);
-                }
-            }
-
-            return false;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NotConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NotConverter.cs
deleted file mode 100644 (file)
index c93b3bf..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Windows.Data;
-    using System.Globalization;
-
-    internal sealed class NotConverter : IValueConverter
-    {
-        static IValueConverter baseConverter =
-            new System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data.NotConverter();
-
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            return NotConverter.baseConverter.Convert(value, targetType, parameter, culture);
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            return NotConverter.baseConverter.ConvertBack(value, targetType, parameter, culture);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NullToBooleanConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/NullToBooleanConverter.cs
deleted file mode 100644 (file)
index eb73c15..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Globalization;
-    using System.Windows.Data;
-
-    //Null To Boolean Converter
-    internal sealed class NullToBooleanConverter : IValueConverter
-    {
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            return value != null;
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-    }
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ObjectReferenceService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ObjectReferenceService.cs
deleted file mode 100644 (file)
index b4d7168..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Debugger;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Services;
-    using System.Activities.Presentation.Validation;
-    using System.Activities.Presentation.Xaml;
-    using System.Collections.Generic;
-    using System.Runtime;
-
-    /// <summary>
-    /// This interface is used by visual studio integration to acquire a AppDomain serialization friendly reference to an object.
-    /// </summary>
-    public sealed class ObjectReferenceService
-    {
-        private Dictionary<Guid, object> objectReferenceIds;
-        private Dictionary<Guid, int> objectReferenceCount;
-        private HashSet<Guid> subscribedForSourceLocationChanges;
-        private EditingContext context;
-        private ModelSearchServiceImpl modelSearchService;
-        private ModelTreeManager modelTreeManager;
-
-        /// <summary>
-        /// This interface is used by visual studio integration to acquire a AppDomain serialization friendly reference to an object.
-        /// </summary>
-        /// <param name="context">The EditingContext of the current WorkflowDesigner.</param>
-        public ObjectReferenceService(EditingContext context)
-        {
-            if (context == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("context"));
-            }
-
-            this.context = context;
-            this.context.Services.Subscribe<ModelSearchService>(new SubscribeServiceCallback<ModelSearchService>(this.OnModelSearchServiceAvailable));
-            this.context.Services.Subscribe<ModelTreeManager>(new SubscribeServiceCallback<ModelTreeManager>(this.OnModelTreeManagerAvailable));
-        }
-
-        /// <summary>
-        /// Fire an event when the SourceLocation of an ObjectReference might be updated because of a Save operation.
-        /// </summary>
-        public event EventHandler<SourceLocationUpdatedEventArgs> SourceLocationUpdated;
-
-        private Dictionary<Guid, object> ObjectReferenceIds
-        {
-            get
-            {
-                if (this.objectReferenceIds == null)
-                {
-                    this.objectReferenceIds = new Dictionary<Guid, object>();
-                }
-
-                return this.objectReferenceIds;
-            }
-        }
-
-        private Dictionary<Guid, int> ObjectReferenceCount
-        {
-            get
-            {
-                if (this.objectReferenceCount == null)
-                {
-                    this.objectReferenceCount = new Dictionary<Guid, int>();
-                }
-
-                return this.objectReferenceCount;
-            }
-        }
-
-        private HashSet<Guid> SubscribedForSourceLocationChanges
-        {
-            get
-            {
-                if (this.subscribedForSourceLocationChanges == null)
-                {
-                    this.subscribedForSourceLocationChanges = new HashSet<Guid>();
-                }
-
-                return this.subscribedForSourceLocationChanges;
-            }
-        }
-
-        /// <summary>
-        /// Acquire a reference by the SourceLocation of the object.
-        /// Notice this method will automatically register the object to listen to SourceLocationUpdated, if available.
-        /// </summary>
-        /// <param name="startLine">The start line of the object.</param>
-        /// <param name="startColumn">The start column of the object.</param>
-        /// <param name="endLine">The end line of the object.</param>
-        /// <param name="endColumn">The end column of the object.</param>
-        /// <returns>The object reference.</returns>
-        public Guid AcquireObjectReference(int startLine, int startColumn, int endLine, int endColumn)
-        {
-            if (this.modelSearchService != null)
-            {
-                ModelItem modelItem = this.modelSearchService.FindModelItem(startLine, startColumn, endLine, endColumn);
-                if (modelItem != null)
-                {
-                    object searchObject = modelItem.GetCurrentValue();
-                    Guid result = this.AcquireObjectReference(searchObject);
-                    this.SubscribedForSourceLocationChanges.Add(result);
-                    return result;
-                }
-            }
-
-            return Guid.Empty;
-        }
-
-        /// <summary>
-        /// Acquire a reference of an object by its actual reference.
-        /// </summary>
-        /// <param name="obj">The object which we need to acquire a reference for.</param>
-        /// <returns>The object reference.</returns>
-        public Guid AcquireObjectReference(object obj)
-        {
-            if (obj == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("obj"));
-            }
-
-            bool found = false;
-            Guid objectReferenceId = Guid.NewGuid();
-            foreach (KeyValuePair<Guid, object> kvp in this.ObjectReferenceIds)
-            {
-                if (object.ReferenceEquals(kvp.Value, obj))
-                {
-                    objectReferenceId = kvp.Key;
-                    found = true;
-                    break;
-                }
-            }
-
-            if (!found)
-            {
-                this.ObjectReferenceIds.Add(objectReferenceId, obj);
-            }
-
-            this.IncreaseReferenceCount(objectReferenceId);
-            return objectReferenceId;
-        }
-
-        /// <summary>
-        /// Release the activity reference - this allow the designer infrastructure to release the actual reference to the activity - thus avoiding memory leak.
-        /// </summary>
-        /// <param name="objectReferenceId">The activity reference.</param>
-        public void ReleaseObjectReference(Guid objectReferenceId)
-        {
-            if (this.DecreaseReferenceCount(objectReferenceId))
-            {
-                this.ObjectReferenceIds.Remove(objectReferenceId);
-                if (this.SubscribedForSourceLocationChanges.Contains(objectReferenceId))
-                {
-                    this.SubscribedForSourceLocationChanges.Remove(objectReferenceId);
-                }
-            }
-        }
-
-        /// <summary>
-        /// Obtain the actual reference to the object by its ObjectReference - this method should be called within the designer AppDomain only.
-        /// </summary>
-        /// <param name="objectReferenceId">The activity reference.</param>
-        /// <param name="obj">The de-referenced activity, if the reference is available, or null otherwise.</param>
-        /// <returns>True if the activity reference can be successfully de-referenced.</returns>
-        public bool TryGetObject(Guid objectReferenceId, out object obj)
-        {
-            return this.ObjectReferenceIds.TryGetValue(objectReferenceId, out obj);
-        }
-
-        internal void OnSaveCompleted()
-        {
-            if (this.SourceLocationUpdated != null)
-            {
-                if (this.modelSearchService != null)
-                {
-                    foreach (Guid subscribedObjectReference in this.SubscribedForSourceLocationChanges)
-                    {
-                        object subscribedObject = this.ObjectReferenceIds[subscribedObjectReference];
-                        SourceLocation updatedSourceLocation = this.modelSearchService.FindSourceLocation(this.modelTreeManager.GetModelItem(subscribedObject));
-                        if (updatedSourceLocation != null)
-                        {
-                            this.SourceLocationUpdated(null, new SourceLocationUpdatedEventArgs(subscribedObjectReference, updatedSourceLocation));
-                        }
-                    }
-                }
-            }
-        }
-
-        private void OnModelSearchServiceAvailable(ModelSearchService modelSearchService)
-        {
-            if (modelSearchService != null)
-            {
-                this.modelSearchService = modelSearchService as ModelSearchServiceImpl;
-            }
-        }
-
-        private void OnModelTreeManagerAvailable(ModelTreeManager modelTreeManager)
-        {
-            if (modelTreeManager != null)
-            {
-                this.modelTreeManager = modelTreeManager as ModelTreeManager;
-            }
-        }
-
-        private void IncreaseReferenceCount(Guid objectReferenceId)
-        {
-            int referenceCount;
-            if (!this.ObjectReferenceCount.TryGetValue(objectReferenceId, out referenceCount))
-            {
-                referenceCount = 0;
-            }
-
-            referenceCount++;
-            this.ObjectReferenceCount[objectReferenceId] = referenceCount;
-        }
-
-        private bool DecreaseReferenceCount(Guid objectReferenceId)
-        {
-            Fx.Assert(this.ObjectReferenceCount.ContainsKey(objectReferenceId), "DecreaseReferenceCount should not be called when there is no reference.");
-            if (this.ObjectReferenceCount.ContainsKey(objectReferenceId))
-            {
-                int referenceCount = this.ObjectReferenceCount[objectReferenceId] - 1;
-                if (referenceCount == 0)
-                {
-                    this.ObjectReferenceCount.Remove(objectReferenceId);
-                    return true;
-                }
-                else
-                {
-                    this.ObjectReferenceCount[objectReferenceId] = referenceCount;
-                    return false;
-                }
-            }
-
-            return true;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/PropertyEditing/VersionPropertyValueEditor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/PropertyEditing/VersionPropertyValueEditor.cs
deleted file mode 100644 (file)
index 63ea20a..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.PropertyEditing
-{
-    using System.Activities.Presentation.View;
-    using System.Windows;
-
-    internal sealed class VersionPropertyValueEditor : PropertyValueEditor
-    {
-        public VersionPropertyValueEditor()
-        {
-            this.InlineEditorTemplate = EditorResources.GetResources()["VersionPropertyValueEditorTemplate"] as DataTemplate;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/PropertyReferenceUtilities.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/PropertyReferenceUtilities.cs
deleted file mode 100644 (file)
index 621694e..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Collections.Generic;
-    using System.Runtime;
-
-    internal static class PropertyReferenceUtilities
-    {
-        public static string GetPropertyReference(object instance, string targetProperty)
-        {
-            Fx.Assert(instance != null, "instance should not be null.");
-            Fx.Assert(!string.IsNullOrEmpty(targetProperty), "targetProperty should not be null or empty.");
-
-            IList<ActivityPropertyReference> references = ActivityBuilder.GetPropertyReferences(instance);
-
-            Fx.Assert(references != null, "references should not be null");
-
-            foreach (ActivityPropertyReference reference in references)
-            {
-                if (StringComparer.Ordinal.Equals(reference.TargetProperty, targetProperty))
-                {
-                    return reference.SourceProperty;
-                }
-            }
-            
-            return null;
-        }
-
-        public static void SetPropertyReference(object instance, string targetProperty, string sourceProperty)
-        {
-            Fx.Assert(instance != null, "instance should not be null.");
-            Fx.Assert(!string.IsNullOrEmpty(targetProperty), "targetProperty should not be null or empty.");
-
-            ActivityPropertyReference entry = null;
-            IList<ActivityPropertyReference> references = ActivityBuilder.GetPropertyReferences(instance);
-
-            Fx.Assert(references != null, "references should not be null");
-
-            foreach (ActivityPropertyReference reference in references)
-            {
-                if (StringComparer.Ordinal.Equals(reference.TargetProperty, targetProperty))
-                {
-                    entry = reference;
-                    break;
-                }
-            }
-
-            if (string.IsNullOrEmpty(sourceProperty))
-            {
-                if (entry != null)
-                {
-                    references.Remove(entry);
-                }
-            }
-            else
-            {
-                if (entry != null)
-                {
-                    entry.SourceProperty = sourceProperty;
-                }
-                else
-                {
-                    entry = new ActivityPropertyReference();
-                    entry.TargetProperty = targetProperty;
-                    entry.SourceProperty = sourceProperty;
-                    references.Add(entry);
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ReadOnlyState.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ReadOnlyState.cs
deleted file mode 100644 (file)
index f78a4aa..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Hosting
-{
-    using System.Activities.Presentation.View;
-
-    public sealed class ReadOnlyState : ContextItem
-    {
-        public bool IsReadOnly { get; set; }
-
-        public override Type ItemType
-        {
-            get
-            {
-                return typeof(ReadOnlyState);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/RetriableClipboard.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/RetriableClipboard.cs
deleted file mode 100644 (file)
index 3cf9a4d..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Threading;
-    using System.Windows;
-    using System.Windows.Media.Imaging;
-    using System.Runtime.InteropServices;
-    using System.Runtime;
-    using System.Diagnostics;
-
-    // The clipboard may be accessed by other processes. 
-    // RetriableClipboard retries several times before giving up.
-    static class RetriableClipboard
-    {
-        const int retryCount = 10;
-        const int sleepTime = 50;
-
-        internal static IDataObject GetDataObject()
-        {
-            for (int i = 0; i < retryCount; i++)
-            {
-                try
-                {
-                    return Clipboard.GetDataObject();
-                }
-                catch (Exception err)
-                {
-                    Trace.WriteLine(err.ToString());
-                    if (Fx.IsFatal(err))
-                    {
-                        throw;
-                    }
-                    Thread.Sleep(sleepTime);
-                }
-            }
-            return null;
-        }
-
-        internal static void SetDataObject(object data, bool copy)
-        {
-            for (int i = 0; i < retryCount; i++)
-            {
-                try
-                {
-                    Clipboard.SetDataObject(data, copy);
-                    return;
-                }
-                catch (Exception err)
-                {
-                    Trace.WriteLine(err.ToString());
-                    if (Fx.IsFatal(err))
-                    {
-                        throw;
-                    }
-                    Thread.Sleep(sleepTime);
-                }
-            }
-        }
-
-        internal static void SetImage(BitmapSource image)
-        {
-            for (int i = 0; i < retryCount; i++)
-            {
-                try
-                {
-                    Clipboard.SetImage(image);
-                    return;
-                }
-                catch (Exception err)
-                {
-                    Trace.WriteLine(err.ToString());
-                    if (Fx.IsFatal(err))
-                    {
-                        throw;
-                    }
-                    Thread.Sleep(sleepTime);
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/SQM/ActivityUsageCounter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/SQM/ActivityUsageCounter.cs
deleted file mode 100644 (file)
index 63aa7b6..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Sqm
-{
-    using System.Collections.Generic;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-
-    enum ActivityTypeId
-    {
-        // Unknown represents all custom activities
-        Unknown = 0,
-        // Out of box activities for .NET 4.0
-        DoWhile = 1,
-        ForEach = 2,
-        If = 3,
-        Parallel = 4,
-        ParallelForEach = 5,
-        Pick = 6,
-        PickBranch = 7,
-        Sequence = 8,
-        Switch = 9,
-        While = 10,
-        Flowchart = 11,
-        FlowDecision = 12,
-        FlowSwitch = 13,
-        CorrelationScope = 14,
-        InitializeCorrelation = 15,
-        Receive = 16,
-        ReceiveAndSendReply = 17,
-        Send = 18,
-        SendAndReceiveReply = 19,
-        TransactedReceiveScope = 20,
-        Persist = 21,
-        TerminateWorkflow = 22,
-        Assign = 23,
-        Delay = 24,
-        InvokeMethod = 25,
-        WriteLine = 26,
-        CancellationScope = 27,
-        CompensableActivity = 28,
-        Compensate = 29,
-        Confirm = 30,
-        TransactionScope = 31,
-        AddToCollection = 32,
-        ClearCollection = 33,
-        ExistsInCollection = 34,
-        RemoveFromCollection = 35,
-        Throw = 36,
-        TryCatch = 37,
-        Rethrow = 38,
-        Interop = 39,
-
-        // To be added: Out of box activities introduced in .NET 4.5
-        StateMachine = 40,
-        State = 41,
-        FinalState = 42,
-        NoPersistScope = 44,
-        InvokeDelegate = 49,
-    };
-
-    static class ActivityUsageCounter
-    {
-        static Dictionary<string, ActivityTypeId> mapping = new Dictionary<string, ActivityTypeId>();
-
-        [SuppressMessage(FxCop.Category.Performance, FxCop.Rule.InitializeReferenceTypeStaticFieldsInline, Justification = "Dictionary items Cannot be initialized inline.")]
-        static ActivityUsageCounter()
-        {
-            // For non-generic activity, use FullName as the key.
-            // For generic activity, use Name only since the combination of FullName is open ended.
-            mapping["System.Activities.Statements.DoWhile"] = ActivityTypeId.DoWhile;
-            mapping["ForEachWithBodyFactory`1"] = ActivityTypeId.ForEach;
-            mapping["System.Activities.Statements.If"] = ActivityTypeId.If;
-            mapping["System.Activities.Statements.Parallel"] = ActivityTypeId.Parallel;
-            mapping["ParallelForEachWithBodyFactory`1"] = ActivityTypeId.ParallelForEach;
-            mapping["System.Activities.Core.Presentation.Factories.PickWithTwoBranchesFactory"] = ActivityTypeId.Pick;
-            mapping["System.Activities.Statements.PickBranch"] = ActivityTypeId.PickBranch;
-            mapping["System.Activities.Statements.Sequence"] = ActivityTypeId.Sequence;
-            mapping["Switch`1"] = ActivityTypeId.Switch;
-            mapping["System.Activities.Statements.While"] = ActivityTypeId.While;
-            mapping["System.Activities.Statements.Flowchart"] = ActivityTypeId.Flowchart;
-            mapping["System.Activities.Statements.FlowDecision"] = ActivityTypeId.FlowDecision;
-            mapping["FlowSwitch`1"] = ActivityTypeId.FlowSwitch;
-            mapping["System.ServiceModel.Activities.CorrelationScope"] = ActivityTypeId.CorrelationScope;
-            mapping["System.ServiceModel.Activities.InitializeCorrelation"] = ActivityTypeId.InitializeCorrelation;
-            mapping["System.ServiceModel.Activities.Receive"] = ActivityTypeId.Receive;
-            mapping["System.ServiceModel.Activities.Presentation.Factories.ReceiveAndSendReplyFactory"] = ActivityTypeId.ReceiveAndSendReply;
-            mapping["System.ServiceModel.Activities.Send"] = ActivityTypeId.Send;
-            mapping["System.ServiceModel.Activities.Presentation.Factories.SendAndReceiveReplyFactory"] = ActivityTypeId.SendAndReceiveReply;
-            mapping["System.ServiceModel.Activities.TransactedReceiveScope"] = ActivityTypeId.TransactedReceiveScope;
-            mapping["System.Activities.Statements.Persist"] = ActivityTypeId.Persist;
-            mapping["System.Activities.Statements.TerminateWorkflow"] = ActivityTypeId.TerminateWorkflow;
-            mapping["System.Activities.Statements.Assign"] = ActivityTypeId.Assign;
-            mapping["System.Activities.Statements.Delay"] = ActivityTypeId.Delay;
-            mapping["System.Activities.Statements.InvokeMethod"] = ActivityTypeId.InvokeMethod;
-            mapping["System.Activities.Statements.WriteLine"] = ActivityTypeId.WriteLine;
-            mapping["System.Activities.Statements.CancellationScope"] = ActivityTypeId.CancellationScope;
-            mapping["System.Activities.Statements.CompensableActivity"] = ActivityTypeId.CompensableActivity;
-            mapping["System.Activities.Statements.Compensate"] = ActivityTypeId.Compensate;
-            mapping["System.Activities.Statements.Confirm"] = ActivityTypeId.Confirm;
-            mapping["System.Activities.Statements.TransactionScope"] = ActivityTypeId.TransactionScope;
-            mapping["AddToCollection`1"] = ActivityTypeId.AddToCollection;
-            mapping["ClearCollection`1"] = ActivityTypeId.ClearCollection;
-            mapping["ExistsInCollection`1"] = ActivityTypeId.ExistsInCollection;
-            mapping["RemoveFromCollection`1"] = ActivityTypeId.RemoveFromCollection;
-            mapping["System.Activities.Statements.Rethrow"] = ActivityTypeId.Rethrow;
-            mapping["System.Activities.Statements.Throw"] = ActivityTypeId.Throw;
-            mapping["System.Activities.Statements.TryCatch"] = ActivityTypeId.TryCatch;
-            mapping["System.Activities.Statements.Interop"] = ActivityTypeId.Interop;
-            mapping["System.Activities.Core.Presentation.Factories.StateMachineWithInitialStateFactory"] = ActivityTypeId.StateMachine;
-            mapping["System.Activities.Statements.State"] = ActivityTypeId.State;
-            mapping["System.Activities.Core.Presentation.FinalState"] = ActivityTypeId.FinalState;
-            mapping["System.Activities.Statements.NoPersistScope"] = ActivityTypeId.NoPersistScope;
-            mapping["System.Activities.Statements.InvokeDelegate"] = ActivityTypeId.InvokeDelegate;
-        }
-
-        static internal ActivityTypeId MapTypeToId(Type activityType)
-        {
-            ActivityTypeId typeId = ActivityTypeId.Unknown;
-            if (activityType != null)
-            {
-                string typeName = activityType.IsGenericType ? activityType.Name : activityType.FullName;
-                if (mapping.ContainsKey(typeName))
-                {
-                    typeId = mapping[typeName];
-                }
-            }
-            return typeId;
-        }
-
-        static internal void ReportUsage(IVSSqmService sqmService, Type activityType)
-        {
-            if (sqmService != null)
-            {
-                uint[] data = new uint[1];
-                data[0] = (uint)MapTypeToId(activityType);
-                sqmService.AddArrayToStream((int)DataPointIds.ActivityUsageCount, data, data.Length);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/SQM/DataPointIds.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/SQM/DataPointIds.cs
deleted file mode 100644 (file)
index 37aefec..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Sqm
-{
-    enum DataPointIds
-    {
-        // DO NOT CHANGE THE VALUES BELOW
-        // These values are the official IDs assigned
-        ActivityUsageCount = 748,
-        FeatureUsageCount = 749,
-        // IMPORTANT: If new values are added, please also update VSSqmService.IsWorkflowDesignerDataPoint
-        //  in the file below, otherwise the data being sent will be filtered out.
-        //  Microsoft.Visualstudio.Activities.Addin\Microsoft\VisualStudio\Activities\AddIn\VSSqmService.cs
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/SQM/FeatureUsageCounter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/SQM/FeatureUsageCounter.cs
deleted file mode 100644 (file)
index 473ddb9..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Sqm
-{
-    internal enum WorkflowDesignerFeatureId
-    {
-        None = 0,
-        ResetZoom = 1,
-        FitToScreen = 2,
-        Minimap = 3,        // The number of times minimap is opened
-        Breadcrumb = 4,
-        ExpandAll = 5,
-        CollapseAll = 6,
-        Restore = 7,
-        OpenChild = 8,      // Context menu only
-        ViewParent = 9,     // Context menu only
-        CopyAsImage = 10,   // Context menu + shortcut key
-        SaveAsImage = 11,   // Context menu + shortcut key
-    }
-
-    static class FeatureUsageCounter
-    {
-        internal static void ReportUsage(IVSSqmService sqmService, WorkflowDesignerFeatureId featureId)
-        {
-            if (sqmService != null)
-            {
-                uint[] data = new uint[1];
-                data[0] = (uint)featureId;
-                sqmService.AddArrayToStream((int)DataPointIds.FeatureUsageCount, data, data.Length);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/SQM/IVSSqmService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/SQM/IVSSqmService.cs
deleted file mode 100644 (file)
index 09ad721..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-// Compiler Error CS3001
-// Argument type 'uint' is not CLS-compliant
-#pragma warning disable 3001
-
-namespace System.Activities.Presentation.Sqm
-{
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-
-    [SuppressMessage(FxCop.Category.Naming, FxCop.Rule.IdentifiersShouldBeSpelledCorrectly, Justification = "False positive for SQM")]
-    public interface IVSSqmService
-    {
-        // Session: A session starts when VS launches and ends when VS is closed.
-
-        // Simple data point: Only one value will be saved per session. The value
-        //  that is set last for the same data point will win.
-
-        // Stream: Multiple values can be saved per session.
-
-        // Set an UINT value for a simple data point
-        [SuppressMessage(FxCop.Category.Naming, FxCop.Rule.IdentifiersShouldBeSpelledCorrectly, Justification = "In order to keep consistent with the same method in IVSSqm")]
-        void SetDatapoint(int dataPointId, uint value);
-        // Add a UINT value to a stream
-        void AddItemToStream(int dataPointId, uint value);
-        // Add an UINT array to stream, essentially creating a record
-        void AddArrayToStream(int dataPointId, uint[] data, int count);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ShowExpandedMultiValueConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ShowExpandedMultiValueConverter.cs
deleted file mode 100644 (file)
index 32b215b..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Windows.Data;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using System.Windows;
-    using System.Activities.Presentation.View;
-    using System.Runtime;
-
-    [SuppressMessage(FxCop.Category.Naming, FxCop.Rule.IdentifiersShouldBeSpelledCorrectly,
-        Justification = "Following the naming of IMultiValueConverter")]
-    internal sealed class ShowExpandedMultiValueConverter : IMultiValueConverter
-    {
-
-        //Calculates whether ShowExpanded for a given WorklfowViewElement should be true or false.
-        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-        {
-            ModelItem modelItem = (ModelItem)values[0];
-            bool isRootDesigner = (bool)values[1];
-            bool shouldExpandAll = (bool)values[2];
-            bool shouldCollapseAll = (bool)values[3];
-            bool expandState = (bool)values[4];
-            bool pinState = (bool)values[5];
-            WorkflowViewElement viewElement = (WorkflowViewElement)values[6];
-
-            //Pinstate should be false in following cases (Designer should be unpinned in following cases):
-            //1. ExpandAll is not enabled.
-            //2. ExpandAll is enabled and ExpandState is true.
-            //Similarly for Collapse All.
-            if ((!shouldExpandAll || expandState)
-                && (!shouldCollapseAll || !expandState))
-            {
-                viewElement.PinState = false;
-            }
-            if (viewElement.IsAncestorOfRootDesigner)
-            {
-                return true;
-            }
-            return ViewUtilities.ShouldShowExpanded(isRootDesigner, viewElement.DoesParentAlwaysExpandChild(),
-                viewElement.DoesParentAlwaysCollapseChildren(), expandState, shouldExpandAll, shouldCollapseAll, viewElement.PinState);
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/SourceLocationUpdatedEventArgs.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/SourceLocationUpdatedEventArgs.cs
deleted file mode 100644 (file)
index ae9fb13..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Debugger;
-
-    /// <summary>
-    /// Provides data for the SourceLocationUpdated event.
-    /// </summary>
-    public class SourceLocationUpdatedEventArgs : EventArgs
-    {
-        /// <summary>
-        /// Initializes a new instance of the SourceLocationUpdatedEventArgs class.
-        /// </summary>
-        /// <param name="objectReference">The Guid of the ObjectReference that changed.</param>
-        /// <param name="updatedSourceLocation">The updated SourceLocation.</param>
-        public SourceLocationUpdatedEventArgs(Guid objectReference, SourceLocation updatedSourceLocation)
-        {
-            this.ObjectReference = objectReference;
-            this.UpdatedSourceLocation = updatedSourceLocation;
-        }
-
-        /// <summary>
-        /// Gets the Guid of the ObjectReference that changed.
-        /// </summary>
-        public Guid ObjectReference
-        {
-            get; 
-            private set; 
-        }
-
-        /// <summary>
-        /// Gets the updated source location.
-        /// </summary>
-        public SourceLocation UpdatedSourceLocation
-        {
-            get;
-            private set;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/TargetFrameworkPropertyFilter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/TargetFrameworkPropertyFilter.cs
deleted file mode 100644 (file)
index c6be597..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Metadata;
-    using System.Activities.Statements;
-    using System.ComponentModel;
-    using System.ServiceModel.Activities;
-
-    internal static class TargetFrameworkPropertyFilter
-    {
-        // Ideally we need to filter out ALL new properties introduced in 4.5, for performance
-        // reasons, we do not take this approach. Instead, we build a cache for the new properties
-        // we want to filter out. Currently the cache is not a full cache, it only contains new properties
-        // that affect activities.
-        // Ideally, the cache would only contain TypeName and we load type using TypeName.
-        // The current implementation of the cache directly references the type defined in S.A.dll and
-        // S.SM.A.dll, this is also to save performance cost of resolving the type by type name.
-        public static void FilterOut45Properties()
-        {
-            AttributeTableBuilder builder = new AttributeTableBuilder();
-
-            // System.Activities.dll
-            builder.AddCustomAttributes(typeof(ActivityBuilder), "ImplementationVersion", BrowsableAttribute.No);
-            builder.AddCustomAttributes(typeof(ActivityBuilder<>), "ImplementationVersion", BrowsableAttribute.No);
-            builder.AddCustomAttributes(typeof(DynamicActivity), "ImplementationVersion", BrowsableAttribute.No);
-            builder.AddCustomAttributes(typeof(DynamicActivity<>), "ImplementationVersion", BrowsableAttribute.No);
-            builder.AddCustomAttributes(typeof(Flowchart), "ValidateUnconnectedNodes", BrowsableAttribute.No);
-            builder.AddCustomAttributes(typeof(FlowDecision), "DisplayName", BrowsableAttribute.No);
-            builder.AddCustomAttributes(typeof(FlowSwitch<>), "DisplayName", BrowsableAttribute.No);
-
-            // System.ServiceModel.Activities.dll
-            builder.AddCustomAttributes(typeof(WorkflowService), "DefinitionIdentity", BrowsableAttribute.No);
-            builder.AddCustomAttributes(typeof(WorkflowService), "ImplementedContracts", BrowsableAttribute.No);
-            builder.AddCustomAttributes(typeof(Send), "SecurityTokenHandle", BrowsableAttribute.No);
-
-            MetadataStore.AddAttributeTable(builder.CreateTable());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/TaskDispatcher.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/TaskDispatcher.cs
deleted file mode 100644 (file)
index 09609cd..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Threading;
-    using System.Windows.Threading;
-
-    internal class TaskDispatcher
-    {
-        // We need to keep a reference to the WPF Dispatcher so that we can dispatch work to the UI Thread.
-        private Dispatcher dispatcher;
-
-        // This constructor must be executed on the UI thread.
-        internal TaskDispatcher()
-        {
-            this.dispatcher = Dispatcher.CurrentDispatcher;
-        }
-
-        internal virtual void DispatchWorkOnUIThread(DispatcherPriority priority, Delegate method)
-        {
-            this.dispatcher.BeginInvoke(priority, method);
-        }
-
-        internal virtual void DispatchWorkOnBackgroundThread(WaitCallback work, object state)
-        {
-            ThreadPool.QueueUserWorkItem(work, state);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/TextFormattingConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/TextFormattingConverter.cs
deleted file mode 100644 (file)
index a21db0a..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Activities.Presentation.Model;
-
-    //Formats text strings
-    internal sealed class TextFormattingConverter : IValueConverter
-    {
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            if (parameter is string)
-            {
-                return string.Format(culture, parameter as string, value);
-            }
-            else
-            {
-                return value.ToString();
-            }
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ActivityTemplateFactory.Generic.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ActivityTemplateFactory.Generic.cs
deleted file mode 100644 (file)
index 07d7f0c..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation.Toolbox
-{
-    using System.Activities.Presentation;
-    using System.Activities.XamlIntegration;
-    using System.ComponentModel;
-    using System.Reflection;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Markup;
-    using System.Xaml;
-
-    /// <summary>
-    /// ActivityTemplateFactory&lt;T&gt; is the XAML representation for an IActivityTemplateFactory&lt;T&gt;
-    /// </summary>
-    /// <typeparam name="T">The type this factory created.</typeparam>
-    [ContentProperty("Implementation")]
-    public abstract class ActivityTemplateFactory<T> : IActivityTemplateFactory<T> where T : class
-    {
-        /// <summary>
-        /// Gets or sets the a factory method that create an activity as the implementation.
-        /// </summary>
-        [XamlDeferLoad(typeof(FuncDeferringLoader), typeof(ActivityTemplateFactory))]
-        [DefaultValue(null)]
-        [Browsable(false)]
-        [Ambient]
-        protected virtual Func<T> Implementation
-        {
-            get;
-            set;
-        }
-
-        /// <summary>
-        /// Create an activity by calling Implementation.
-        /// </summary>
-        /// <param name="target">A reference the target- not used.</param>
-        /// <param name="dataObject">A reference to the data object - not used.</param>
-        /// <returns>The activity created by the implementation method or null if implementation is not set.</returns>
-        public T Create(DependencyObject target, IDataObject dataObject)
-        {
-            if (this.Implementation != null)
-            {
-                return this.Implementation();
-            }
-            else
-            {
-                return default(T);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ActivityTemplateFactory.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ActivityTemplateFactory.cs
deleted file mode 100644 (file)
index aa2751e..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation.Toolbox
-{
-    using System.Activities.Presentation;
-    using System.Activities.XamlIntegration;
-    using System.ComponentModel;
-    using System.Reflection;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Markup;
-    using System.Xaml;
-
-    /// <summary>
-    /// ActivityTemplateFactory is the XAML representation for an IActivityTemplateFactory. This class is for XAML serialization purpose only and is not expected to be used by developers.
-    /// </summary>
-    [ContentProperty("Implementation")]
-    public abstract class ActivityTemplateFactory : IActivityTemplateFactory
-    {
-        /// <summary>
-        /// Gets or sets the a factory method that create an activity as the implementation.
-        /// </summary>
-        [XamlDeferLoad(typeof(FuncDeferringLoader), typeof(ActivityTemplateFactory))]
-        [DefaultValue(null)]
-        [Browsable(false)]
-        [Ambient]
-        protected virtual Func<Activity> Implementation
-        {
-            get;
-            set;
-        }
-
-        /// <summary>
-        /// Create an activity by calling Implementation.
-        /// </summary>
-        /// <param name="target">A reference to the user interface - not used.</param>
-        /// <returns>The activity created by the implementation method or null if implementation is not set.</returns>
-        public Activity Create(DependencyObject target)
-        {
-            if (this.Implementation != null)
-            {
-                return this.Implementation();
-            }
-            else
-            {
-                return null;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ActivityTemplateFactoryBuilder.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ActivityTemplateFactoryBuilder.cs
deleted file mode 100644 (file)
index 24c1607..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation.Toolbox
-{
-    using System.Activities.Presentation.View;
-    using System.ComponentModel;
-    using System.Reflection;
-    using System.Runtime;
-    using System.Windows.Markup;
-    using System.Xaml;
-
-    /// <summary>
-    /// ActivityTemplateFactoryBuilder represents an ActivityTemplateFactory class. This class is for XAML serialization purpose only and is not expected to be used by developers.
-    /// </summary>
-    [ContentProperty("Implementation")]
-    [Designer(typeof(ActivityTypeDesigner))]
-    public sealed class ActivityTemplateFactoryBuilder
-    {
-        /// <summary>
-        /// Gets or sets the name of an ActivityTemplateFactoryBuilder
-        /// </summary>
-        public string Name
-        {
-            get;
-            set;
-        }
-
-        /// <summary>
-        /// Gets or sets the TargetType of an ActivityTemplateFactoryBuilder
-        /// </summary>
-        [DependsOn("Name")]
-        [DefaultValue(null)]
-        public Type TargetType
-        {
-            get;
-            set;
-        }
-
-        /// <summary>
-        /// Gets or sets the implementation of an ActivityTemplateFactoryBuilder
-        /// </summary>
-        [DependsOn("TargetType")]
-        [Browsable(false)]
-        public object Implementation { get; set; }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ActivityTemplateFactoryExtension.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ActivityTemplateFactoryExtension.cs
deleted file mode 100644 (file)
index bb922d8..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    static class ActivityTemplateFactoryExtension
-    {
-        public static bool IsActivityTemplateFactory(this Type type)
-        {
-            return type.GetInterface(typeof(IActivityTemplateFactory).FullName) != null || 
-                   type.GetInterface(typeof(IActivityTemplateFactory<>).FullName) != null;
-        }
-
-        public static bool TryGetActivityTemplateFactory(this Type type, out Type argumentType)
-        {
-            if (type.GetInterface(typeof(IActivityTemplateFactory).FullName) != null)
-            {
-                // Hard coding here, because we don't want to create instance before dropped. Suggestion is to use IActivityTemplateFactory<> instead.
-                argumentType = typeof(Activity);
-                return true;
-            }
-
-            Type activityFactoryInterfaceType = type.GetInterface(typeof(IActivityTemplateFactory<>).FullName);
-            if (activityFactoryInterfaceType != null)
-            {
-                argumentType = activityFactoryInterfaceType.GetGenericArguments()[0];
-                return true;
-            }
-
-            argumentType = null;
-            return false;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/IActivityTemplateFactory.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/IActivityTemplateFactory.cs
deleted file mode 100644 (file)
index dca449e..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Windows;
-
-    public interface IActivityTemplateFactory
-    {
-        Activity Create(DependencyObject target);
-    }
-
-    public interface IActivityTemplateFactory<T> where T : class
-    {
-        T Create(DependencyObject target, IDataObject dataObject);
-    }
-}
\ No newline at end of file
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolCreatedEventArgs.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolCreatedEventArgs.cs
deleted file mode 100644 (file)
index 482543c..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.Toolbox
-{
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-    using System.Windows;
-
-    // This class represents event arguments for tool created event
-
-    [Fx.Tag.XamlVisible(false)]
-    public sealed class ToolCreatedEventArgs : RoutedEventArgs
-    {
-        IComponent[] components;
-
-        internal ToolCreatedEventArgs(RoutedEvent eventName, object sender, IComponent[] components)
-            : base(eventName, sender)
-        {
-            this.components = components;
-        }
-
-
-        [SuppressMessage(FxCop.Category.Performance, "CA1819:PropertiesShouldNotReturnArrays",
-            Justification = "Array type property does not clone the array in the getter. It references the same array instance.")]
-        public IComponent[] Components
-        {
-            get { return this.components; }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolCreatedEventHandler.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolCreatedEventHandler.cs
deleted file mode 100644 (file)
index d8c0ab5..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.Toolbox
-{
-    // This is delegate's method signature for Tool created event
-
-    public delegate void ToolCreatedEventHandler(object sender, ToolCreatedEventArgs e);
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolboxCategory.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolboxCategory.cs
deleted file mode 100644 (file)
index 19ff007..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.Toolbox
-{
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Collections.Specialized;
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-
-    [SuppressMessage(FxCop.Category.Design, "CA1039:ListsAreStronglyTyped",
-        Justification = "The nongeneric IList implementation is required for XAML support. It is implmented explicitly.")]
-    [SuppressMessage(FxCop.Category.Naming, "CA1710:IdentifiersShouldHaveCorrectSuffix",
-        Justification = "The collection implemenation is required for XAML support.")]
-    public sealed class ToolboxCategory : INotifyPropertyChanged, IList
-    {
-        string categoryName;
-        ObservableCollection<ToolboxItemWrapper> tools = new ObservableCollection<ToolboxItemWrapper>();
-
-        public ToolboxCategory()
-            : this(string.Empty)
-        {
-        }
-
-        public ToolboxCategory(string name)
-        {
-            this.categoryName = name;
-            this.tools.CollectionChanged += this.OnToolCollectionChanged;
-        }
-
-        public string CategoryName
-        {
-            get { return this.categoryName; }
-            set
-            {
-                this.categoryName = value;
-                this.OnPropertyChanged("CategoryName");
-            }
-        }
-
-        public ToolboxItemWrapper this[int index]
-        {
-            get { return this.tools[index]; }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public ICollection<ToolboxItemWrapper> Tools
-        {
-            get { return this.tools; }
-        }
-
-        public void Add(ToolboxItemWrapper tool)
-        {
-            if (null == tool)
-            {
-                throw FxTrace.Exception.ArgumentNull("tool");
-            }
-            this.tools.Add(tool);
-        }
-
-        public bool Remove(ToolboxItemWrapper tool)
-        {
-            if (null == tool)
-            {
-                throw FxTrace.Exception.ArgumentNull("tool");
-            }
-            return this.tools.Remove(tool);
-        }
-
-        internal void HandleToolCollectionNotification(NotifyCollectionChangedEventHandler listener, bool register)
-        {
-            if (null == listener)
-            {
-                throw FxTrace.Exception.ArgumentNull("listener");
-            }
-            if (register)
-            {
-                this.tools.CollectionChanged += listener;
-            }
-            else
-            {
-                this.tools.CollectionChanged -= listener;
-            }
-        }
-
-        void OnToolCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
-        {
-            switch (e.Action)
-            {
-                case NotifyCollectionChangedAction.Add:
-                    foreach (var tool in e.NewItems)
-                    {
-                        if (null == tool)
-                        {
-                            throw FxTrace.Exception.ArgumentNull("tool");
-                        }
-                    }
-                    break;
-            }
-            this.OnPropertyChanged("Tools");
-        }
-
-        void OnPropertyChanged(string propertyName)
-        {
-            if (null != this.PropertyChanged)
-            {
-                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-            }
-        }
-
-        public event PropertyChangedEventHandler PropertyChanged;
-
-        #region IList Members
-
-        int IList.Add(object value)
-        {
-            this.Add((ToolboxItemWrapper)value);
-            return this.tools.IndexOf((ToolboxItemWrapper)value);
-        }
-
-        void IList.Clear()
-        {
-            this.tools.Clear();
-        }
-
-        bool IList.Contains(object value)
-        {
-            if (null == value)
-            {
-                throw FxTrace.Exception.ArgumentNull("value");
-            }
-            return this.tools.Contains((ToolboxItemWrapper)value);
-        }
-
-        int IList.IndexOf(object value)
-        {
-            if (null == value)
-            {
-                throw FxTrace.Exception.ArgumentNull("value");
-            }
-            return this.tools.IndexOf((ToolboxItemWrapper)value);
-        }
-
-        void IList.Insert(int index, object value)
-        {
-            if (null == value)
-            {
-                throw FxTrace.Exception.ArgumentNull("value");
-            }
-            this.tools.Insert(index, (ToolboxItemWrapper)value);
-        }
-
-        bool IList.IsFixedSize
-        {
-            get { return ((IList)this.tools).IsFixedSize; }
-        }
-
-        bool IList.IsReadOnly
-        {
-            get { return ((IList)this.tools).IsReadOnly; }
-        }
-
-        void IList.Remove(object value)
-        {
-            this.Remove((ToolboxItemWrapper)value);
-        }
-
-        void IList.RemoveAt(int index)
-        {
-            this.tools.RemoveAt(index);
-        }
-
-        object IList.this[int index]
-        {
-            get
-            {
-                return this.tools[index];
-            }
-            set
-            {
-                if (null == value)
-                {
-                    throw FxTrace.Exception.ArgumentNull("value");
-                }
-                this.tools[index] = (ToolboxItemWrapper)value;
-            }
-        }
-
-        #endregion
-
-        #region ICollection Members
-
-        void ICollection.CopyTo(Array array, int index)
-        {
-            if (null == array)
-            {
-                throw FxTrace.Exception.ArgumentNull("array");
-            }
-            ((ICollection)this.tools).CopyTo(array, index);
-        }
-
-        int ICollection.Count
-        {
-            get { return this.tools.Count; }
-        }
-
-        bool ICollection.IsSynchronized
-        {
-            get { return ((ICollection)this.tools).IsSynchronized; }
-        }
-
-        object ICollection.SyncRoot
-        {
-            get { return ((ICollection)this.tools).SyncRoot; }
-        }
-
-        #endregion
-
-        #region IEnumerable Members
-
-        IEnumerator IEnumerable.GetEnumerator()
-        {
-            return this.tools.GetEnumerator();
-        }
-
-        #endregion
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolboxCategoryItems.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolboxCategoryItems.cs
deleted file mode 100644 (file)
index fdc0ed4..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.Toolbox
-{
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Collections.Specialized;
-    using System.Runtime;
-    using System.Diagnostics.CodeAnalysis;
-
-    //This class is responsible for storing information about tools
-    //associated with given category item. The public interface is ICollection, the IList implementation is required for XAML support.
-    [SuppressMessage(FxCop.Category.Design, "CA1039:ListsAreStronglyTyped",
-        Justification = "The nongeneric IList implementation is required for XAML support. It is implmented explicitly.")]
-    [SuppressMessage(FxCop.Category.Naming, "CA1710:IdentifiersShouldHaveCorrectSuffix",
-        Justification = "The collection suffix 'Items' suits better.")]
-    public sealed class ToolboxCategoryItems : ICollection<ToolboxCategory>, IList
-    {
-        ObservableCollection<ToolboxCategory> categories;
-
-        public ToolboxCategoryItems() : this(null)
-        {
-        }
-
-        internal ToolboxCategoryItems(NotifyCollectionChangedEventHandler listener)
-        {
-            this.categories = new ObservableCollection<ToolboxCategory>();
-            if (null != listener)
-            {
-                this.categories.CollectionChanged += listener;
-            }
-        }
-
-        public ToolboxCategory this[int index]
-        {
-            get
-            {
-                return this.categories[index];
-            }
-        }
-
-        #region ICollection<ToolboxCategory> Members
-        
-        public void Add(ToolboxCategory item)
-        {
-            if (null == item)
-            {
-                throw FxTrace.Exception.ArgumentNull("item");
-            }
-            this.categories.Add(item);
-        }
-
-        public void Clear()
-        {
-            this.categories.Clear();
-        }
-
-        public bool Contains(ToolboxCategory item)
-        {
-            if (null == item)
-            {
-                throw FxTrace.Exception.ArgumentNull("item");
-            }
-            return this.categories.Contains(item);
-        }
-
-        public void CopyTo(ToolboxCategory[] array, int arrayIndex)
-        {
-            if (null == array)
-            {
-                throw FxTrace.Exception.ArgumentNull("array");
-            }
-            this.categories.CopyTo(array, arrayIndex);
-        }
-
-        public int Count
-        {
-            get { return this.categories.Count; }
-        }
-
-        public bool IsReadOnly
-        {
-            get { return ((ICollection<ToolboxCategory>)this.categories).IsReadOnly; }
-        }
-
-        public bool Remove(ToolboxCategory item)
-        {
-            if (null == item)
-            {
-                throw FxTrace.Exception.ArgumentNull("item");
-            }
-            return this.categories.Remove(item);
-        }
-
-        #endregion
-
-        #region IEnumerable<ToolboxCategory> Members
-
-        public IEnumerator<ToolboxCategory> GetEnumerator()
-        {
-            return this.categories.GetEnumerator();
-        }
-
-        #endregion
-
-        #region IEnumerable Members
-
-        IEnumerator IEnumerable.GetEnumerator()
-        {
-            return this.categories.GetEnumerator();
-        }
-
-        #endregion
-
-        #region IList Members
-
-        int IList.Add(object value)
-        {
-            this.Add((ToolboxCategory)value);
-            return this.categories.IndexOf((ToolboxCategory)value);
-        }
-
-        void IList.Clear()
-        {
-            this.Clear();
-        }
-
-        bool IList.Contains(object value)
-        {
-            return this.Contains((ToolboxCategory)value);
-        }
-
-        int IList.IndexOf(object value)
-        {
-            return this.categories.IndexOf((ToolboxCategory)value);
-        }
-
-        void IList.Insert(int index, object value)
-        {
-            if (null == value)
-            {
-                throw FxTrace.Exception.ArgumentNull("value");
-            }
-            this.categories.Insert(index, (ToolboxCategory)value);
-        }
-
-        bool IList.IsFixedSize
-        {
-            get { return ((IList)this.categories).IsFixedSize; }
-        }
-
-        bool IList.IsReadOnly
-        {
-            get { return ((IList)this.categories).IsReadOnly; }
-        }
-
-        void IList.Remove(object value)
-        {
-            this.Remove((ToolboxCategory)value);
-        }
-
-        void IList.RemoveAt(int index)
-        {
-            this.categories.RemoveAt(index);
-        }
-
-        object IList.this[int index]
-        {
-            get
-            {
-                return (this)[index];
-            }
-            set
-            {
-                if (null == value)
-                {
-                    throw FxTrace.Exception.ArgumentNull("value");
-                }
-                this.categories[index] = (ToolboxCategory)value;
-            }
-        }
-
-        #endregion
-
-        #region ICollection Members
-
-        void ICollection.CopyTo(Array array, int index)
-        {
-            if (null == array)
-            {
-                throw FxTrace.Exception.ArgumentNull("array");
-            }
-            ((ICollection)this.categories).CopyTo(array, index);
-        }
-
-        int ICollection.Count
-        {
-            get { return this.Count; }
-        }
-
-        bool ICollection.IsSynchronized
-        {
-            get { return ((ICollection)this.categories).IsSynchronized; }
-        }
-
-        object ICollection.SyncRoot
-        {
-            get { return ((ICollection)this.categories).SyncRoot; }
-        }
-
-        #endregion
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolboxControl.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolboxControl.cs
deleted file mode 100644 (file)
index a5117d2..0000000
+++ /dev/null
@@ -1,407 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-
-namespace System.Activities.Presentation.Toolbox
-{
-    using System;
-    using System.Activities.Presentation.View;
-    using System.Collections.Generic;
-    using System.Collections.Specialized;
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Drawing.Design;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Input;
-    using System.Windows.Markup;
-
-    // This class is responsible for rendering cate----ezed tools collection
-    // It also provides methods for notifing user about tool selection/creation events
-
-    [TemplatePart(Name = "PART_SearchBox"), TemplatePart(Name = "PART_Tools")]
-    [ContentProperty("Categories")]
-    sealed public partial class ToolboxControl : Control
-    {
-        public static readonly DependencyProperty ToolboxFileProperty =
-                DependencyProperty.Register("ToolboxFile",
-                typeof(string),
-                typeof(ToolboxControl),
-                new PropertyMetadata(
-                string.Empty,
-                new PropertyChangedCallback(OnToolboxFileChanged)));
-
-        static readonly DependencyPropertyKey SelectedToolPropertyKey =
-                DependencyProperty.RegisterReadOnly("SelectedTool",
-                typeof(ToolboxItem),
-                typeof(ToolboxControl),
-                new PropertyMetadata(
-                null,
-                new PropertyChangedCallback(OnToolSelected)));
-
-        public static readonly DependencyProperty SelectedToolProperty = SelectedToolPropertyKey.DependencyProperty;
-
-        public static readonly DependencyProperty ToolItemStyleProperty =
-                DependencyProperty.Register("ToolItemStyle",
-                typeof(Style),
-                typeof(ToolboxControl),
-                new UIPropertyMetadata(null));
-
-        public static readonly DependencyProperty CategoryItemStyleProperty =
-                DependencyProperty.Register("CategoryItemStyle",
-                typeof(Style),
-                typeof(ToolboxControl),
-                new UIPropertyMetadata(null));
-
-        public static readonly DependencyProperty ToolTemplateProperty =
-                DependencyProperty.Register("ToolTemplate",
-                typeof(DataTemplate),
-                typeof(ToolboxControl),
-                new UIPropertyMetadata(null));
-
-        public static readonly DependencyProperty CategoryTemplateProperty =
-                DependencyProperty.Register("CategoryTemplate",
-                typeof(DataTemplate),
-                typeof(ToolboxControl),
-                new UIPropertyMetadata(null));
-
-        public static readonly RoutedEvent ToolCreatedEvent =
-                EventManager.RegisterRoutedEvent("ToolCreated",
-                RoutingStrategy.Bubble,
-                typeof(ToolCreatedEventHandler),
-                typeof(ToolboxControl));
-
-        public static readonly RoutedEvent ToolSelectedEvent =
-                EventManager.RegisterRoutedEvent("ToolSelected",
-                RoutingStrategy.Bubble,
-                typeof(RoutedEventHandler),
-                typeof(ToolboxControl));
-
-
-        internal TextBox searchBox;
-        TreeView toolsTreeView;
-        ToolboxCategoryItems categories;
-
-        [SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")]
-        static ToolboxControl()
-        {
-            DefaultStyleKeyProperty.OverrideMetadata(typeof(ToolboxControl), new FrameworkPropertyMetadata(typeof(ToolboxControl)));
-        }
-
-        public ToolboxControl()
-        {
-            var callback = new NotifyCollectionChangedEventHandler(this.OnCategoryCollectionChanged);
-            this.categories = new ToolboxCategoryItems(callback);
-        }
-
-        public event ToolCreatedEventHandler ToolCreated
-        {
-            add
-            {
-                AddHandler(ToolCreatedEvent, value);
-            }
-            remove
-            {
-                RemoveHandler(ToolCreatedEvent, value);
-            }
-        }
-
-        public event RoutedEventHandler ToolSelected
-        {
-            add
-            {
-                AddHandler(ToolSelectedEvent, value);
-            }
-            remove
-            {
-                RemoveHandler(ToolSelectedEvent, value);
-            }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
-        [SuppressMessage(FxCop.Category.Usage, "CA2227:CollectionPropertiesShouldBeReadOnly",
-            Justification = "The setter implemenation is required for XAML support. The setter doesn't replace the collection instance, but copies its content to internal collection")]
-        public ToolboxCategoryItems Categories
-        {
-            get { return this.categories; }
-            set 
-            {
-                this.categories.Clear();
-                if (null != value)
-                {
-                    foreach (var category in value)
-                    {
-                        this.categories.Add(category);
-                    }
-                }
-            }
-        }
-
-        public string ToolboxFile
-        {
-            get { return (string)GetValue(ToolboxFileProperty); }
-            set { SetValue(ToolboxFileProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public ToolboxItem SelectedTool
-        {
-            get { return (ToolboxItem)GetValue(SelectedToolProperty); }
-            private set { SetValue(SelectedToolPropertyKey, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public Style ToolItemStyle
-        {
-            get { return (Style)GetValue(ToolItemStyleProperty); }
-            set { SetValue(ToolItemStyleProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public Style CategoryItemStyle
-        {
-            get { return (Style)GetValue(CategoryItemStyleProperty); }
-            set { SetValue(CategoryItemStyleProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public DataTemplate ToolTemplate
-        {
-            get { return (DataTemplate)GetValue(ToolTemplateProperty); }
-            set { SetValue(ToolTemplateProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public DataTemplate CategoryTemplate
-        {
-            get { return (DataTemplate)GetValue(CategoryTemplateProperty); }
-            set { SetValue(CategoryTemplateProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public WorkflowDesigner AssociatedDesigner
-        {
-            get;
-            set;
-        }
-
-        static void OnToolboxFileChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
-        {
-            ToolboxControl toolboxControl = sender as ToolboxControl;
-            string fileName = args.NewValue as string;
-            if (null == toolboxControl || null == fileName)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException(null == toolboxControl ? "toolboxControl" : "fileName"));
-            }
-
-            try
-            {
-                ToolboxItemLoader loader = ToolboxItemLoader.GetInstance();
-                loader.LoadToolboxItems(fileName, toolboxControl.categories, false);
-            }
-            catch
-            {
-                if (!DesignerProperties.GetIsInDesignMode(toolboxControl))
-                {
-                    throw;
-                }
-            }
-        }
-
-        static void OnToolSelected(DependencyObject sender, DependencyPropertyChangedEventArgs args)
-        {
-            ToolboxControl toolboxControl = sender as ToolboxControl;
-            if (null == toolboxControl)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("sender"));
-            }
-            if (null != toolboxControl.SelectedTool)
-            {
-                toolboxControl.RaiseEvent(new RoutedEventArgs(ToolSelectedEvent, toolboxControl));
-            }
-        }
-
-        public override void OnApplyTemplate()
-        {
-            base.OnApplyTemplate();
-            //template is applied, look for required controls within it
-            this.searchBox = this.Template.FindName("PART_SearchBox", this) as TextBox;
-            this.toolsTreeView = this.Template.FindName("PART_Tools", this) as TreeView;
-            //if tools tree view exists - assign style and container selectors (there are different styles
-            //for Cateogries and Tools
-            if (null != this.toolsTreeView)
-            {
-                this.toolsTreeView.ItemsSource = this.Categories;
-                this.toolsTreeView.ItemContainerStyleSelector = new TreeViewContainerStyleSelector(this);
-                this.toolsTreeView.ItemTemplateSelector = new TreeViewTemplateSelector(this);
-                this.toolsTreeView.SelectedItemChanged += (s, e) =>
-                    {
-                        var toolWrapper = e.NewValue as ToolboxItemWrapper;
-                        this.SelectedTool = toolWrapper != null ? toolWrapper.ToolboxItem : null;
-                    };
-            }
-        }
-
-        protected override void OnPreviewKeyDown(KeyEventArgs e)
-        {
-            switch (e.Key)
-            {
-                case Key.Up:
-                case Key.Down:
-                    if (null != this.searchBox && 
-                        e.OriginalSource == this.searchBox && 
-                        null != this.toolsTreeView)
-                    {
-                        this.toolsTreeView.Focus();
-                    }
-                    break;
-
-                case Key.Enter:
-                    ToolboxItemCreated();
-                    e.Handled = true;
-                    break;
-
-                default:
-                    if (null != this.searchBox && e.Source != this.searchBox)
-                    {
-                        if (((e.Key >= Key.A && e.Key <= Key.Z) || (e.Key >= Key.D0 && e.Key <= Key.D9)) &&
-                            (e.KeyboardDevice.Modifiers == ModifierKeys.None || e.KeyboardDevice.Modifiers == ModifierKeys.Shift))
-                        {
-                            this.searchBox.Focus();
-                        }
-                    }
-                    break;
-            }
-            base.OnPreviewKeyDown(e);
-        }
-
-        void OnCategoryCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
-        {
-            switch (e.Action)
-            {
-                case NotifyCollectionChangedAction.Add:
-                    foreach (ToolboxCategory category in e.NewItems)
-                    {
-                        if (null == category)
-                        {
-                            throw FxTrace.Exception.ArgumentNull("category");
-                        }
-
-                        var listener = new NotifyCollectionChangedEventHandler(OnToolsCollectionChange);
-                        category.HandleToolCollectionNotification(listener, true);
-
-                        var items = new List<ToolboxItemWrapper>();
-                        foreach (ToolboxItemWrapper toolWrapper in category.Tools)
-                        {
-                            items.Add(toolWrapper);
-                        }
-                        OnToolsCollectionChange(category,
-                            new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, items, 0));
-                    }
-                    break;
-
-                default:
-                    break;
-            }
-            if (null != this.toolsTreeView)
-            {
-                this.toolsTreeView.ItemsSource = null;
-                this.toolsTreeView.ItemsSource = this.categories;
-            }
-        }
-
-
-        void OnToolsCollectionChange(object sender, NotifyCollectionChangedEventArgs args)
-        {
-            switch (args.Action)
-            {
-                case NotifyCollectionChangedAction.Add:
-                    foreach (ToolboxItemWrapper tool in args.NewItems)
-                    {
-                        if (null == tool)
-                        {
-                            throw FxTrace.Exception.ArgumentNull("tool");
-                        }
-                        tool.PropertyChanged += new PropertyChangedEventHandler(OnToolPropertyChanged);
-                        OnToolPropertyChanged(tool, null);
-                    }
-                    break;
-
-                default:
-                    break;
-            }
-        }
-
-        void OnToolPropertyChanged(object sender, PropertyChangedEventArgs e)
-        {
-            try
-            {
-                ToolboxItemWrapper tool = (ToolboxItemWrapper)sender;
-                tool.ResolveToolboxItem();
-            }
-            catch
-            {
-                if (!DesignerProperties.GetIsInDesignMode(this))
-                {
-                    throw;
-                }
-            }
-        }
-
-        internal void OnToolMouseMove(object sender, MouseEventArgs args)
-        {
-            ToolboxItem tool;
-            ToolboxItemWrapper toolWrapper;
-            if (args.LeftButton == MouseButtonState.Pressed && TryGetSelectedToolboxItem(out tool, out toolWrapper))
-            {
-                IDataObject dataObject = toolWrapper.DataObject ?? new DataObject();
-                dataObject.SetData(DragDropHelper.WorkflowItemTypeNameFormat, toolWrapper.Type.AssemblyQualifiedName);
-                DragDrop.DoDragDrop(this, dataObject, DragDropEffects.Link | DragDropEffects.Copy);
-            }
-        }
-
-        internal void OnTreeViewDoubleClick(object sender, MouseEventArgs args)
-        {
-            ToolboxItemCreated();
-        }
-
-        void ToolboxItemCreated()
-        {
-            ToolboxItem tool;
-            ToolboxItemWrapper toolWrapper;
-            if (TryGetSelectedToolboxItem(out tool, out toolWrapper))
-            {
-                if (null != this.AssociatedDesigner && null != this.AssociatedDesigner.Context)
-                {
-                    DesignerView target = this.AssociatedDesigner.Context.Services.GetService<DesignerView>();
-                    IDataObject dataObject = toolWrapper.DataObject ?? new DataObject();
-                    dataObject.SetData(DragDropHelper.WorkflowItemTypeNameFormat, toolWrapper.Type.AssemblyQualifiedName);
-                    ((RoutedCommand)DesignerView.CreateWorkflowElementCommand).Execute(dataObject, target);
-                }
-                ToolCreatedEventArgs args = new ToolCreatedEventArgs(ToolCreatedEvent, this, tool.CreateComponents());
-                RaiseEvent(args);
-            }
-        }
-
-        bool TryGetSelectedToolboxItem(out ToolboxItem toolboxItem, out ToolboxItemWrapper toolboxItemWrapper)
-        {
-            toolboxItem = null;
-            toolboxItemWrapper = null;
-            if (null != this.toolsTreeView && null != this.toolsTreeView.SelectedItem)
-            {
-                ToolboxItemWrapper tool = this.toolsTreeView.SelectedItem as ToolboxItemWrapper;
-                if (null != tool && null != tool.ToolboxItem)
-                {
-                    toolboxItem = tool.ToolboxItem;
-                    toolboxItemWrapper = tool;
-
-                }
-            }
-            return (null != toolboxItem);
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolboxItemImageConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolboxItemImageConverter.cs
deleted file mode 100644 (file)
index d51c34b..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.Toolbox
-{
-    using System;
-    using System.Drawing;
-    using System.Globalization;
-    using System.Windows;
-    using System.Windows.Data;
-    using System.Windows.Interop;
-    using System.Windows.Media;
-    using System.Windows.Media.Imaging;
-    using Microsoft.Tools.Common;
-
-    //This class is responsible for converting 'old' bitmap style, contained 
-    //in ToolboxItem objects to WPF compatible ImageSource object
-
-    [ValueConversion(typeof(Bitmap), typeof(ImageSource))]
-    sealed class ToolboxItemImageConverter : IValueConverter
-    {
-        object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            Bitmap source = value as Bitmap;
-            if (targetType == typeof(ImageSource) && null != source)
-            {
-                IntPtr hBitmap = source.GetHbitmap();
-                try
-                {
-                    BitmapSizeOptions sizeOptions = BitmapSizeOptions.FromEmptyOptions();
-                    return Imaging.CreateBitmapSourceFromHBitmap(hBitmap, IntPtr.Zero, Int32Rect.Empty, sizeOptions);
-                }
-                finally
-                {
-                    Win32Interop.DeleteObject(hBitmap);
-                }
-            }
-            return null;
-        }
-
-        object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolboxItemLoader.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolboxItemLoader.cs
deleted file mode 100644 (file)
index ed3db45..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.Toolbox
-{
-    using System;
-    using System.Collections.Generic;
-    using System.IO;
-    using System.Globalization;
-
-    // This is helper class which tries to load and create tool items from flat text file.
-    // The content of a file must contain following, colon separated values
-    // 1.) fully qualified class name, which is flagged with ToolboxItemAttribute 
-    // 2.) name of the assembly (with extension) where the tool class is located
-    // 3.) an optional bitmap file (in case when activity is not marked with toolboxitem attribute)
-    // 4.) an optional display name 
-    //
-    // Positions 3 & 4 can be in mixed order. the loader checks for known graphic extension 
-    //
-    // The category information is defined by string content placed within square brackets [ ].
-    // All items under category definition fall into that category unless new category is defined.
-    // If no category is defined, default one is created
-    //
-    // All lines starting with ';' or '#' char are treaded as comments and skipped
-
-    sealed class ToolboxItemLoader
-    {
-        static readonly string FormatExceptionText =
-            "Tool has to be defined either as 'name, assembly', or 'name, assembly, bitmap'";
-        static readonly string DefaultCategory = "default";
-
-        private ToolboxItemLoader()
-        {
-        }
-
-        public static ToolboxItemLoader GetInstance()
-        {
-            return new ToolboxItemLoader();
-        }
-
-        public void LoadToolboxItems(string fileName, ToolboxCategoryItems container, bool resetContainer)
-        {
-            if (string.IsNullOrEmpty(fileName))
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("fileName"));
-            }
-
-            if (null == container)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("container"));
-            }
-
-            if (resetContainer)
-            {
-                container.Clear();
-            }
-
-            using (StreamReader reader = File.OpenText(fileName))
-            {
-                string entry = null;
-                ToolboxCategory category = null;
-                while (null != (entry = reader.ReadLine()))
-                {
-                    entry = entry.Trim();
-                    if (entry.Length > 1 && (entry[0] != ';' && entry[0] != '#'))
-                    {
-                        if (entry.StartsWith("[", StringComparison.CurrentCulture) && entry.EndsWith("]", StringComparison.CurrentCulture))
-                        {
-                            string categoryName = entry.Substring(1, entry.Length - 2);
-                            category = GetCategoryItem(container, categoryName);
-                        }
-                        else
-                        {
-                            if (null == category)
-                            {
-                                category = GetCategoryItem(container, DefaultCategory);
-                            }
-                            string[] toolDefinition = entry.Split(';');
-
-                            string toolName = null;
-                            string assembly = null;
-                            string displayName = null;
-                            string bitmap = null;
-
-                            if (GetToolAssemblyAndName(toolDefinition, ref toolName, ref assembly))
-                            {
-                                GetBitmap(toolDefinition, ref bitmap);
-                                GetDisplayName(toolDefinition, ref displayName);
-                                category.Add(new ToolboxItemWrapper(toolName, assembly, bitmap, displayName));
-                            }
-                            else
-                            {
-                                throw FxTrace.Exception.AsError(new ArgumentOutOfRangeException(FormatExceptionText));
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        bool GetToolAssemblyAndName(string[] toolDefinition, ref string toolName, ref string assembly)
-        {
-            if (toolDefinition.Length >= 2)
-            {
-                toolName = toolDefinition[0].Trim();
-                assembly = toolDefinition[1].Trim();
-                return true;
-            }
-            return false;
-        }
-
-        bool GetBitmap(string[] toolDefinition, ref string bitmap)
-        {
-            for (int i = 2; i < toolDefinition.Length; ++i)
-            {
-                string current = toolDefinition[i].Trim();
-                if (current.EndsWith(".bmp", StringComparison.OrdinalIgnoreCase) ||
-                    current.EndsWith(".jpg", StringComparison.OrdinalIgnoreCase) ||
-                    current.EndsWith(".gif", StringComparison.OrdinalIgnoreCase) ||
-                    current.EndsWith(".png", StringComparison.OrdinalIgnoreCase) ||
-                    current.EndsWith(".tiff", StringComparison.OrdinalIgnoreCase) ||
-                    current.EndsWith(".jpeg", StringComparison.OrdinalIgnoreCase) ||
-                    current.EndsWith(".exig", StringComparison.OrdinalIgnoreCase))
-                {
-                    bitmap = current;
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        bool GetDisplayName(string[] toolDefinition, ref string displayName)
-        {
-            for (int i = 2; i < toolDefinition.Length; ++i)
-            {
-                string current = toolDefinition[i].Trim();
-                if (!current.EndsWith(".bmp", StringComparison.OrdinalIgnoreCase) &&
-                    !current.EndsWith(".jpg", StringComparison.OrdinalIgnoreCase) &&
-                    !current.EndsWith(".gif", StringComparison.OrdinalIgnoreCase) &&
-                    !current.EndsWith(".png", StringComparison.OrdinalIgnoreCase) &&
-                    !current.EndsWith(".tiff", StringComparison.OrdinalIgnoreCase) &&
-                    !current.EndsWith(".jpeg", StringComparison.OrdinalIgnoreCase) &&
-                    !current.EndsWith(".exig", StringComparison.OrdinalIgnoreCase))
-                {
-                    displayName = current;
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        ToolboxCategory GetCategoryItem(ToolboxCategoryItems container, string categoryName)
-        {
-            foreach (ToolboxCategory category in container)
-            {
-                if (0 == string.Compare(category.CategoryName, categoryName, true, CultureInfo.CurrentUICulture))
-                {
-                    return category;
-                }
-            }
-            ToolboxCategory newCategory = new ToolboxCategory(categoryName);
-            container.Add(newCategory);
-            return newCategory;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolboxItemWrapper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/ToolboxItemWrapper.cs
deleted file mode 100644 (file)
index ea15e24..0000000
+++ /dev/null
@@ -1,423 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.Toolbox
-{
-    using System;
-    using System.Activities.Presentation.Utility;
-    using System.Activities.Presentation.View;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Drawing;
-    using System.Drawing.Design;
-    using System.Globalization;
-    using System.IO;
-    using System.Reflection;
-    using System.Runtime.InteropServices;
-    using System.Windows;
-    using System.Windows.Media;
-    using System.Windows.Media.Imaging;
-
-    // This class is a wrapper for ToolboxItem objects. It adds support
-    // for cate----zation of toolbox items. ResolveToolboxItem method
-    // establishes link between actual ToolboxItem instance and Tool representation
-    // in the toolbox (via qualified assembly and type name properties)
-
-    public sealed class ToolboxItemWrapper : INotifyPropertyChanged
-    {
-        string toolName;
-        string assemblyName;
-        string bitmapName;
-        string customDisplayName;
-        string defaultDisplayName;
-        Bitmap defaultBitmap;
-        ToolboxItem toolboxItem;
-        Type toolType;
-        IDataObject dataObject;
-        //LogPixelsXIndex and LogPixelsYIndex are the parameters you pass to GetDeviceCaps to get the current monitor resolution, they are constant.
-        private const int LogPixelsXIndex = 88;
-        private const int LogPixelsYIndex = 90;
-        private const int defaultDpi = 96;
-
-        public ToolboxItemWrapper()
-            : this(string.Empty, string.Empty, string.Empty, string.Empty)
-        {
-        }
-
-        public ToolboxItemWrapper(Type toolType)
-            : this(toolType, string.Empty)
-        {
-        }
-
-        public ToolboxItemWrapper(Type toolType, string displayName)
-            : this(toolType, string.Empty, displayName)
-        {
-        }
-
-        public ToolboxItemWrapper(Type toolType, string bitmapName, string displayName)
-            : this(toolType.FullName, toolType.Assembly.FullName, bitmapName, displayName)
-        {
-        }
-
-        public ToolboxItemWrapper(string toolName, string assemblyName, string bitmapName, string displayName)
-            : this(toolName, assemblyName, bitmapName, displayName, null)
-        {
-        }
-
-        internal ToolboxItemWrapper(string toolName, string assemblyName, string bitmapName, string displayName, IDataObject dataObject)
-        {
-            this.ToolName = toolName;
-            this.AssemblyName = assemblyName;
-            this.BitmapName = bitmapName;
-            this.DisplayName = displayName;
-            this.defaultDisplayName = string.Empty;
-            this.dataObject = dataObject;
-        }
-        public event PropertyChangedEventHandler PropertyChanged;
-
-        internal ToolboxItem ToolboxItem
-        {
-            get { return this.toolboxItem; }
-            private set
-            {
-                if (this.toolboxItem != value)
-                {
-                    this.toolboxItem = value;
-                    RaisePropertyChanged("IsValid");
-                    RaisePropertyChanged("ToolboxItem");
-                }
-            }
-        }
-
-        public bool IsValid
-        {
-            get
-            {
-                return (null != this.toolboxItem);
-            }
-        }
-
-        public string ToolName
-        {
-            get { return this.toolName; }
-            set
-            {
-                if (null != this.toolboxItem)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.ToolboxItemFrozenDescription));
-                }
-                bool isChanged = !string.Equals(value, this.toolName);
-                if (isChanged)
-                {
-                    this.toolName = value;
-                    RaisePropertyChanged("ToolName");
-                    this.ToolboxItem = null;
-                }
-            }
-        }
-
-        public string AssemblyName
-        {
-            get { return this.assemblyName; }
-            set
-            {
-                if (null != this.toolboxItem)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.ToolboxItemFrozenDescription));
-                }
-                bool isChanged = !string.Equals(value, this.assemblyName);
-                if (isChanged)
-                {
-                    this.assemblyName = value;
-                    RaisePropertyChanged("AssemblyName");
-                    this.ToolboxItem = null;
-                }
-            }
-        }
-
-        public string BitmapName
-        {
-            get { return this.bitmapName; }
-            set
-            {
-                bool isChanged = !string.Equals(value, this.bitmapName);
-                if (isChanged)
-                {
-                    this.bitmapName = value;
-                    RaisePropertyChanged("BitmapName");
-                    LoadBitmap();
-                }
-            }
-        }
-
-        internal IDataObject DataObject
-        {
-            get
-            {
-                return this.dataObject;
-            }
-
-            set
-            {
-                this.dataObject = value;
-            }
-        }
-
-        public Bitmap Bitmap
-        {
-            get { return this.ToolboxItem.Bitmap; }
-        }
-
-        public string DisplayName
-        {
-            get
-            {
-                return this.ToolboxItem != null ? this.ToolboxItem.DisplayName : this.customDisplayName;
-            }
-            set
-            {
-                bool isChanged = !string.Equals(value, this.customDisplayName);
-                if (isChanged)
-                {
-                    this.customDisplayName = value;
-                    ChangeToolboxDisplayName();
-                    RaisePropertyChanged("DisplayName");
-                }
-            }
-        }
-
-        [SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods", Justification = "By design.")]
-        public Type Type
-        {
-            get { return this.toolType; }
-            private set
-            {
-                bool isChanged = !Type.Equals(this.toolType, value);
-                if (isChanged)
-                {
-                    this.toolType = value;
-                    RaisePropertyChanged("Type");
-                }
-            }
-        }
-
-        internal bool ResolveToolboxItem()
-        {
-            if (null != this.ToolboxItem)
-            {
-                return true;
-            }
-            try
-            {
-                if (null == this.AssemblyName || null == this.ToolName)
-                {
-                    throw FxTrace.Exception.AsError(new ArgumentNullException(null == AssemblyName ? "AssemblyName" : "ToolName"));
-                }
-
-                Assembly toolAssembly = Assembly.Load(this.AssemblyName);
-                Type discoveredToolType = toolAssembly.GetType(this.ToolName, true, true);
-                ValidateTool(discoveredToolType);
-                ToolboxItemAttribute[] toolboxItemAttributes
-                    = discoveredToolType.GetCustomAttributes(typeof(ToolboxItemAttribute), true) as ToolboxItemAttribute[];
-                ToolboxItem instance = null;
-                if (0 != toolboxItemAttributes.Length)
-                {
-                    instance =
-                        Activator.CreateInstance(toolboxItemAttributes[0].ToolboxItemType) as ToolboxItem;
-                }
-                else
-                {
-                    instance = new ToolboxItem(discoveredToolType);
-                }
-                this.ToolboxItem = instance;
-                this.defaultDisplayName = instance.DisplayName;
-                this.defaultBitmap = instance.Bitmap;
-                LoadBitmap();
-                ChangeToolboxDisplayName();
-                this.Type = discoveredToolType;
-                return true;
-            }
-            catch
-            {
-                this.ToolboxItem = null;
-                this.Type = null;
-                throw;
-            }
-        }
-
-        internal static Bitmap CreateBitmapFromDrawingBrush(DrawingBrush resource)
-        {
-            if (resource == null)
-            {
-                return null;
-            }
-
-            const int defaultPixelWidth = 16;
-            const int defaultPixelHeight = 16;
-            double dpiX = GetSystemDpi(LogPixelsXIndex);
-            double dpiY = GetSystemDpi(LogPixelsYIndex);
-            int pixelWidth = (int)(defaultPixelWidth * dpiX / defaultDpi);
-            int pixelHeight = (int)(defaultPixelHeight * dpiY / defaultDpi);
-            var renderTargetBitmap = new RenderTargetBitmap(pixelWidth, pixelHeight, dpiX, dpiY, PixelFormats.Pbgra32);
-            var drawingVisual = new DrawingVisual();
-            using (var context = drawingVisual.RenderOpen())
-            {
-                context.DrawRectangle(((DrawingBrush)resource), null, new Rect(0, 0, defaultPixelWidth, defaultPixelHeight));
-            }
-
-            renderTargetBitmap.Render(drawingVisual);
-            MemoryStream bitmapStream = new MemoryStream();
-            BitmapEncoder bitmapEncode = new PngBitmapEncoder
-            {
-                Interlace = PngInterlaceOption.Off,
-            };
-            bitmapEncode.Frames.Add(BitmapFrame.Create(renderTargetBitmap));
-            bitmapEncode.Save(bitmapStream);
-            //Reposition the MemoryStream pointer to the start of the stream after the save
-            bitmapStream.Position = 0;
-            Bitmap bitmap = new Bitmap(bitmapStream);
-            return bitmap;
-        }
-
-        internal static Bitmap GetBitmapFromResource(string resourceString)
-        {
-            DrawingBrush drawingBrush = IconHelper.GetBrushFromResource(resourceString);
-            return CreateBitmapFromDrawingBrush(drawingBrush);
-        }
-
-        void LoadBitmap()
-        {
-            try
-            {
-                if (this.toolboxItem != null)
-                {
-                    if (!string.IsNullOrEmpty(this.BitmapName))
-                    {
-                        this.toolboxItem.Bitmap = new Bitmap(this.BitmapName);
-                    }
-                    else
-                    {
-                        Bitmap bitmap = GetBitmapFromResource(this.toolboxItem.TypeName);
-                        if (bitmap != null)
-                        {
-                            this.toolboxItem.Bitmap = bitmap;
-                        }
-                        else
-                        {
-                            if (WorkflowDesignerIcons.IsDefaultCutomActivitySetByUser)
-                            {
-                                this.toolboxItem.Bitmap = CreateBitmapFromDrawingBrush(WorkflowDesignerIcons.Activities.DefaultCustomActivity);
-                            }
-                            else if (WorkflowDesignerIcons.Activities.ToolboxDefaultCustomActivity != null)
-                            {
-                                this.toolboxItem.Bitmap = CreateBitmapFromDrawingBrush(WorkflowDesignerIcons.Activities.ToolboxDefaultCustomActivity);
-                            }
-                            else
-                            {
-                                this.toolboxItem.Bitmap = this.defaultBitmap;
-                            }
-                        }
-                    }
-                }
-            }
-            catch (ArgumentException)
-            {
-                this.toolboxItem.Bitmap = this.defaultBitmap;
-            }
-
-            RaisePropertyChanged("ToolboxItem");
-            RaisePropertyChanged("Bitmap");
-        }
-
-        void ChangeToolboxDisplayName()
-        {
-            if (null != this.toolboxItem)
-            {
-                if (!string.IsNullOrEmpty(this.customDisplayName))
-                {
-                    this.toolboxItem.DisplayName = this.customDisplayName;
-                }
-                else
-                {
-                    this.toolboxItem.DisplayName = this.defaultDisplayName;
-                }
-                RaisePropertyChanged("ToolboxItem");
-            }
-        }
-
-        void RaisePropertyChanged(string propertyName)
-        {
-            if (null != PropertyChanged)
-            {
-                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-            }
-        }
-
-        void ValidateTool(Type toolType)
-        {
-            bool isInvalid = toolType.IsAbstract;
-            isInvalid |= toolType.IsInterface;
-            isInvalid |= !toolType.IsVisible;
-            ConstructorInfo ctor = toolType.GetConstructor(Type.EmptyTypes);
-            isInvalid |= (null == ctor);
-            if (isInvalid)
-            {
-                string reason = string.Empty;
-                if (toolType.IsAbstract)
-                {
-                    reason = "IsAbstract == true ";
-                }
-                if (toolType.IsInterface)
-                {
-                    reason += "IsInterface == true ";
-                }
-                if (!toolType.IsVisible)
-                {
-                    reason += "IsVisible == false ";
-                }
-                if (null == ctor)
-                {
-                    reason += SR.NoDefaultCtorError;
-                }
-
-                string error = string.Format(CultureInfo.CurrentCulture, SR.NotSupportedToolboxTypeFormatString, toolType.Name, reason);
-                throw FxTrace.Exception.AsError(new NotSupportedException(error));
-            }
-        }
-
-        public override string ToString()
-        {
-            return this.ToolName;
-        }
-
-        [DllImport("User32.dll", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
-        private static extern IntPtr GetDC(IntPtr hWnd);
-
-        [DllImport("User32.dll", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
-        private static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC);
-
-        [DllImport("Gdi32.dll", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
-        private static extern int GetDeviceCaps(IntPtr hdc, int nIndex);
-
-        internal static int GetSystemDpi(int index)
-        {
-            IntPtr dc = GetDC(IntPtr.Zero);
-            //if dc is null, just return the common Dpi value
-            if (dc == null)
-            {
-                return defaultDpi;
-            }
-
-            try
-            {
-                return GetDeviceCaps(dc, index);
-            }
-            finally
-            {
-                ReleaseDC(IntPtr.Zero, dc);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/TreeViewContainerStyleSelector.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/TreeViewContainerStyleSelector.cs
deleted file mode 100644 (file)
index e93d6b5..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.Toolbox
-{
-    using System.Windows;
-    using System.Windows.Automation;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Windows.Input;
-    using System.Runtime;
-    using System.Globalization;
-
-    // This class is used to provide tree view item container template for Category
-    // and Tool objects
-
-    sealed class TreeViewContainerStyleSelector : StyleSelector
-    {
-        ToolboxControl owner;
-        Style styleForToolboxItem;
-        Style styleForCategoryItem;
-
-        public TreeViewContainerStyleSelector(ToolboxControl owner)
-        {
-            this.owner = owner;
-        }
-
-        //default style for ToolboxItemWrapper - this one is required to enable context search in tree view control
-        Style GetStyleForToolboxItem(Style baseStyle)
-        {
-            if (null == this.styleForToolboxItem)
-            {
-                this.styleForToolboxItem = 
-                    (null == baseStyle ? new Style(typeof(TreeViewItem)) : new Style(typeof(TreeViewItem), baseStyle));
-
-                //visibility information - i need to bind TreeViewItem to it
-                if (null != this.owner.searchBox)
-                {
-                    MultiBinding visibilityBinding = new MultiBinding() { Converter = new ToolItemVisibilityConverter() };
-                    Binding searchTextBinding = new Binding();
-                    searchTextBinding.Source = this.owner.searchBox;
-                    searchTextBinding.Path = new PropertyPath(TextBox.TextProperty);
-                    searchTextBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
-                    searchTextBinding.Mode = BindingMode.OneWay;
-
-                    Binding toolItemBinding = new Binding();
-                    toolItemBinding.RelativeSource = RelativeSource.Self;
-                    toolItemBinding.Path = new PropertyPath(TreeViewItem.HeaderProperty);
-                    toolItemBinding.Mode = BindingMode.OneWay;
-
-                    visibilityBinding.Bindings.Add(searchTextBinding);
-                    visibilityBinding.Bindings.Add(toolItemBinding);
-
-                    Setter visibilitySetter = new Setter();
-                    visibilitySetter.Property = TreeViewItem.VisibilityProperty;
-                    visibilitySetter.Value = visibilityBinding;
-
-                    //adding visibility setter to the style
-                    this.styleForToolboxItem.Setters.Add(visibilitySetter);
-                }
-
-                //take care of the AutomationId
-                Binding automationIdBinding = new Binding();
-                automationIdBinding.RelativeSource = RelativeSource.Self;
-                automationIdBinding.Path = new PropertyPath("Header.ToolName");
-                automationIdBinding.Mode = BindingMode.OneWay;
-
-                Setter automationIdSetter = new Setter();
-                automationIdSetter.Property = AutomationProperties.AutomationIdProperty;
-                automationIdSetter.Value = automationIdBinding;
-                this.styleForToolboxItem.Setters.Add(automationIdSetter);
-
-                //to enable smooth keyboard operation, hidden items have to be disabled in order not to receive
-                //keyboard events - Trigger does the job
-                Setter enableSetter = new Setter(TreeViewItem.IsEnabledProperty, false);
-
-                Trigger enableTrigger = new Trigger();
-                enableTrigger.Property = TreeViewItem.VisibilityProperty;
-                enableTrigger.Value = Visibility.Collapsed;
-                enableTrigger.Setters.Add(enableSetter);
-
-                //to enable drag&drop support add event setter for 
-                EventSetter mouseMoveSetter = new EventSetter();
-                mouseMoveSetter.Event = TreeViewItem.MouseMoveEvent;
-                mouseMoveSetter.Handler = new MouseEventHandler(this.owner.OnToolMouseMove);
-                this.styleForToolboxItem.Setters.Add(mouseMoveSetter);
-
-                EventSetter mouseDoubleClickSetter = new EventSetter();
-                mouseDoubleClickSetter.Event = TreeViewItem.MouseDoubleClickEvent;
-                mouseDoubleClickSetter.Handler = new MouseButtonEventHandler(this.owner.OnTreeViewDoubleClick);
-                this.styleForToolboxItem.Setters.Add(mouseDoubleClickSetter);
-
-                //adding trigger to the style
-                this.styleForToolboxItem.Triggers.Add(enableTrigger);
-            }
-            return this.styleForToolboxItem;
-        }
-
-        //default style for CategoryItem 
-        Style GetStyleForCategoryItem(Style baseStyle)
-        {
-            if (null == this.styleForCategoryItem)
-            {
-                this.styleForCategoryItem =
-                    (null == baseStyle ? new Style(typeof(TreeViewItem)) : new Style(typeof(TreeViewItem), baseStyle));
-
-                //take care of the AutomationId
-                Binding automationIdBinding = new Binding();
-                automationIdBinding.RelativeSource = RelativeSource.Self;
-                automationIdBinding.Path = new PropertyPath("Header.CategoryName");
-                automationIdBinding.Mode = BindingMode.OneWay;
-
-                Setter automationIdSetter = new Setter();
-                automationIdSetter.Property = AutomationProperties.AutomationIdProperty;
-                automationIdSetter.Value = automationIdBinding;
-                this.styleForCategoryItem.Setters.Add(automationIdSetter);
-            }
-            return this.styleForCategoryItem;
-        }
-
-        public override Style SelectStyle(object item, DependencyObject container)
-        {
-            //try get default style
-            Style result = base.SelectStyle(item, container);
-            if (item is ToolboxItemWrapper)
-            {
-                result = GetStyleForToolboxItem(this.owner.ToolItemStyle);
-            }
-            if (item is ToolboxCategory && null != this.owner.CategoryItemStyle)
-            {
-                result = GetStyleForCategoryItem( this.owner.CategoryItemStyle );
-            }
-            return result;
-        }
-
-        //helper converter - used to show/hide tool items based on the search criteria
-        sealed class ToolItemVisibilityConverter : IMultiValueConverter
-        {
-            public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-            {
-                //get the search text string
-                var text = values[0] as string;
-                //get current tool
-                var tool = values[1] as ToolboxItemWrapper;
-                var result = Visibility.Collapsed;
-                //if tool is set and is valid
-                if (null != tool && tool.IsValid)
-                {
-                    //if search text is empty - show item
-                    if (string.IsNullOrEmpty(text))
-                    {
-                        result = Visibility.Visible;
-                    }
-                    else
-                    {
-                        if (string.IsNullOrEmpty(tool.DisplayName) || tool.DisplayName.IndexOf(text, StringComparison.OrdinalIgnoreCase) < 0)
-                        {
-                            result = Visibility.Collapsed;
-                        }
-                        else
-                        {
-                            result = Visibility.Visible;
-                        }
-                        
-                    }
-                }
-                return result;
-            }
-
-            public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
-            {
-                throw FxTrace.Exception.AsError(new NotSupportedException());
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/TreeViewTemplateSelector.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/TreeViewTemplateSelector.cs
deleted file mode 100644 (file)
index c1354cc..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.Toolbox
-{
-    using System.Windows;
-    using System.Windows.Controls;
-
-    // This class is resposible for selecting proper template for Category and Tool objects 
-    // (those entities have different values beeing displayed)
-
-    sealed class TreeViewTemplateSelector : DataTemplateSelector
-    {
-        ToolboxControl owner;
-
-        public TreeViewTemplateSelector(ToolboxControl owner)
-        {
-            this.owner = owner;
-        }
-
-        public override DataTemplate SelectTemplate(object item, DependencyObject container)
-        {
-            DataTemplate result = base.SelectTemplate(item, container);
-
-            if (item is ToolboxItemWrapper && null != this.owner.ToolTemplate)
-            {
-                result = this.owner.ToolTemplate;
-            }
-            if (item is ToolboxCategory && null != this.owner.CategoryTemplate)
-            {
-                result = this.owner.CategoryTemplate;
-            }
-
-            return result;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/TypeNameConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/TypeNameConverter.cs
deleted file mode 100644 (file)
index fa43f8f..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Model;
-    using System.Globalization;
-    using System.Windows.Data;
-    using Microsoft.Activities.Presentation;
-
-    internal sealed class TypeNameConverter : IValueConverter
-    {
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            Type type = value as Type;
-
-            if (type == null)
-            {
-                ModelItem modelItem = value as ModelItem;
-                if (modelItem != null)
-                {
-                    type = modelItem.GetCurrentValue() as Type;
-                }
-            }
-
-            bool fullName = bool.Parse(parameter.ToString());
-
-            return TypeNameHelper.GetDisplayName(type, fullName);
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotImplementedException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/TypeResolvingOptionsAttribute.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/TypeResolvingOptionsAttribute.cs
deleted file mode 100644 (file)
index 40e1d5a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Text;
-    using System.Activities.Presentation.View;
-    using System.Runtime;
-    using System.Diagnostics.CodeAnalysis;
-
-    [Fx.Tag.XamlVisible(false)]
-    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
-    [SuppressMessage(FxCop.Category.Design, FxCop.Rule.DefineAccessorsForAttributeArguments,
-        Justification = "TypeResolvingOptions property can be set.")]
-    public sealed class TypeResolvingOptionsAttribute : Attribute
-    {
-        public TypeResolvingOptions TypeResolvingOptions
-        {
-            get;
-            set;
-        }
-
-        public TypeResolvingOptionsAttribute()
-        {
-        }
-
-        public TypeResolvingOptionsAttribute(TypeResolvingOptions options)
-        {
-            this.TypeResolvingOptions = options;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/TypeUtilities.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/TypeUtilities.cs
deleted file mode 100644 (file)
index a4d49af..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Reflection;
-    using System.Runtime;
-
-    internal static class TypeUtilities
-    {
-        // returns true if the generic parameter can be subsituted by the candidate.
-        // Sometime if the generic parameter is too complex, this method will return a false positive, but it's fine.
-        public static bool CanSubstituteGenericParameter(Type genericParameter, Type candidate)
-        {
-            Fx.Assert(genericParameter != null, "genericParameter should not be null");
-            Fx.Assert(genericParameter.IsGenericParameter == true, "genericParameter should be a valid generic parameter");
-
-            if (ContainsAnyFlag(genericParameter.GenericParameterAttributes, GenericParameterAttributes.SpecialConstraintMask))
-            {
-                if (ContainsAnyFlag(genericParameter.GenericParameterAttributes, GenericParameterAttributes.ReferenceTypeConstraint))
-                {
-                    if (!candidate.IsClass && !candidate.IsInterface)
-                    {
-                        return false;
-                    }
-                }
-
-                if (ContainsAnyFlag(genericParameter.GenericParameterAttributes, GenericParameterAttributes.DefaultConstructorConstraint))
-                {
-                    if (!TypeUtilities.CanCreateInstanceUsingDefaultConstructor(candidate))
-                    {
-                        return false;
-                    }
-                }
-
-                if (ContainsAnyFlag(genericParameter.GenericParameterAttributes, GenericParameterAttributes.NotNullableValueTypeConstraint))
-                {
-                    if (!candidate.IsValueType)
-                    {
-                        return false;
-                    }
-
-                    if (candidate.IsGenericType && candidate.GetGenericTypeDefinition() != typeof(Nullable<>))
-                    {
-                        return false;
-                    }
-                }
-            }
-
-            foreach (Type constraint in genericParameter.GetGenericParameterConstraints())
-            {
-                if (constraint.ContainsGenericParameters)
-                {
-                    // return true for all types because we don't have a good way to find out if the candidate is good or not.
-                    // The caller will try to create closed generic type which will tell if the candidate is really good or not.
-                    continue;
-                }
-
-                if (!constraint.IsAssignableFrom(candidate))
-                {
-                    return false;
-                }
-            }
-
-            return true;
-        }
-
-        public static bool CanCreateInstanceUsingDefaultConstructor(Type type)
-        {
-            Fx.Assert(type != null, "type could not be null");
-
-            return type.IsValueType || (!type.IsAbstract && type.GetConstructor(Type.EmptyTypes) != null);
-        }
-
-        public static bool IsTypeCompatible(Type childObjectType, Type parentObjectType)
-        {
-            if (!parentObjectType.IsGenericTypeDefinition)
-            {
-                return parentObjectType.IsAssignableFrom(childObjectType);
-            }
-            else if (parentObjectType.IsInterface)
-            {
-                Type[] interfaceTypes = childObjectType.GetInterfaces();
-                foreach (Type interfaceType in interfaceTypes)
-                {
-                    if (interfaceType.IsGenericType)
-                    {
-                        if (interfaceType.GetGenericTypeDefinition() == parentObjectType)
-                        {
-                            return true;
-                        }
-                    }
-                }
-
-                return false;
-            }
-            else
-            {
-                Type current = childObjectType;
-                while (current != null)
-                {
-                    if (current.IsGenericType)
-                    {
-                        if (current.GetGenericTypeDefinition() == parentObjectType)
-                        {
-                            return true;
-                        }
-                    }
-
-                    current = current.BaseType;
-                }
-
-                return false;
-            }
-        }
-
-        private static bool ContainsAnyFlag(GenericParameterAttributes attributes, GenericParameterAttributes flags)
-        {
-            return (attributes & flags) != GenericParameterAttributes.None;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/UndoEngine.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/UndoEngine.cs
deleted file mode 100644 (file)
index f26c838..0000000
+++ /dev/null
@@ -1,343 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Activities.Presentation.Model;
-    using System.Collections.Generic;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Linq;
-    using System.Runtime;
-
-    [Fx.Tag.XamlVisible(false)]
-    public class UndoEngine : IUndoEngineOperations
-    {
-        const int capacity = 100;
-        List<UndoUnit> undoBuffer;
-        List<UndoUnit> redoBuffer;
-        EditingContext context;
-        Bookmark bookmark;
-        //interface which contains actual implementation of AddUndoUnit, Undo and Redo operations
-        IUndoEngineOperations undoEngineImpl = null;
-
-        public event EventHandler<UndoUnitEventArgs> UndoUnitAdded;
-        public event EventHandler<UndoUnitEventArgs> UndoCompleted;
-        public event EventHandler<UndoUnitEventArgs> RedoCompleted;
-        public event EventHandler<UndoUnitEventArgs> UndoUnitCancelled;
-        public event EventHandler UndoUnitDiscarded;
-        public event EventHandler UndoRedoBufferChanged;
-
-        public UndoEngine(EditingContext context)
-        {
-            this.context = context;
-            undoBuffer = new List<UndoUnit>(capacity);
-            redoBuffer = new List<UndoUnit>(capacity);
-            this.undoEngineImpl = this;
-        }
-
-        internal bool IsBookmarkInPlace { get { return this.bookmark != null; } }
-
-        // CreateImmediateEditingScope - creates a new ImmediateEditingScope which gatters all edits in its  
-        // undo unit list. all changes in ImmediateEditingScope appear as a one change and can be 
-        // undoned or redoned as a one set.
-        internal ImmediateEditingScope CreateImmediateEditingScope(string bookmarkName, ModelTreeManager modelTreeManager)
-        {
-            Fx.Assert(modelTreeManager != null, "modelTreeManager should not be null.");
-
-            //only one bookmark is supported
-            Fx.Assert(this.bookmark == null, "Nested bookmarks are not supported.");
-
-            //create bookmark undo unit, and give it a description
-            BookmarkUndoUnit unit = new BookmarkUndoUnit(this.context, modelTreeManager)
-            {
-                Description = bookmarkName ?? string.Empty,
-            };
-            //create bookmark, and pass bookmark undo unit to it.
-            this.bookmark = new Bookmark(this, unit);
-            //switch implementation of AddUndoUnit, Undo, Redo to be delegated through bookmark
-            this.undoEngineImpl = bookmark;
-            return new ImmediateEditingScope(modelTreeManager, this.bookmark);
-        }
-
-        public IEnumerable<string> GetUndoActions()
-        {
-            return this.undoBuffer.Select(p => p.Description);
-        }
-
-        public IEnumerable<string> GetRedoActions()
-        {
-            return this.redoBuffer.Select(p => p.Description);
-        }
-
-        public void AddUndoUnit(UndoUnit unit)
-        {
-            if (unit == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("unit");
-            }
-            this.undoEngineImpl.AddUndoUnitCore(unit);
-        }
-
-        public bool Undo()
-        {
-            this.IsUndoRedoInProgress = true;
-            bool succeeded = this.undoEngineImpl.UndoCore();
-            this.IsUndoRedoInProgress = false;
-            if (succeeded)
-            {
-                this.NotifyUndoRedoBufferChanged();
-            }
-            return succeeded;
-        }
-
-        public bool Redo()
-        {
-            this.IsUndoRedoInProgress = true;
-            bool succeeded = this.undoEngineImpl.RedoCore();
-            this.IsUndoRedoInProgress = false;
-            if (succeeded)
-            {
-                this.NotifyUndoRedoBufferChanged();
-            }
-            return succeeded;
-        }
-
-        public bool IsUndoRedoInProgress
-        {
-            get;
-            private set;
-        }
-
-        void IUndoEngineOperations.AddUndoUnitCore(UndoUnit unit)
-        {
-            undoBuffer.Add(unit);
-            this.NotifyUndoUnitAdded(unit);
-
-            if (undoBuffer.Count > capacity)
-            {
-                undoBuffer.RemoveAt(0);
-                NotifyUndoUnitDiscarded();
-            }
-
-            redoBuffer.Clear();
-            this.NotifyUndoRedoBufferChanged();
-        }
-
-        bool IUndoEngineOperations.UndoCore()
-        {
-            bool succeeded = false;
-            if (undoBuffer.Count > 0)
-            {
-                UndoUnit unitToUndo = undoBuffer.Last();
-                undoBuffer.RemoveAt(undoBuffer.Count - 1);
-                unitToUndo.Undo();
-                redoBuffer.Add(unitToUndo);
-                NotifyUndoExecuted(unitToUndo);
-                succeeded = true;
-            }
-            return succeeded;
-        }
-
-        bool IUndoEngineOperations.RedoCore()
-        {
-            bool succeeded = false;
-            if (redoBuffer.Count > 0)
-            {
-                UndoUnit unitToRedo = redoBuffer.Last();
-                redoBuffer.RemoveAt(redoBuffer.Count - 1);
-                unitToRedo.Redo();
-                undoBuffer.Add(unitToRedo);
-                NotifyRedoExecuted(unitToRedo);
-                succeeded = true;
-            }
-            return succeeded;
-        }
-
-        private void NotifyUndoUnitAdded(UndoUnit unit)
-        {
-            if (this.UndoUnitAdded != null)
-            {
-                this.UndoUnitAdded(this, new UndoUnitEventArgs() { UndoUnit = unit });
-            }
-        }
-
-        private void NotifyUndoExecuted(UndoUnit unit)
-        {
-            if (this.UndoCompleted != null)
-            {
-                this.UndoCompleted(this, new UndoUnitEventArgs() { UndoUnit = unit });
-            }
-        }
-
-        private void NotifyRedoExecuted(UndoUnit unit)
-        {
-            if (this.RedoCompleted != null)
-            {
-                this.RedoCompleted(this, new UndoUnitEventArgs() { UndoUnit = unit });
-            }
-        }
-
-        private void NotifyUndoUnitCancelled(UndoUnit unit)
-        {
-            if (this.UndoUnitCancelled != null)
-            {
-                this.UndoUnitCancelled(this, new UndoUnitEventArgs() { UndoUnit = unit });
-            }
-        }
-
-        private void NotifyUndoUnitDiscarded()
-        {
-            if (this.UndoUnitDiscarded != null)
-            {
-                this.UndoUnitDiscarded(this, null);
-            }
-        }
-
-        private void NotifyUndoRedoBufferChanged()
-        {
-            if (null != this.UndoRedoBufferChanged)
-            {
-                this.UndoRedoBufferChanged(this, EventArgs.Empty);
-            }
-        }
-
-        //Bookmark implementation - implements core UndoEngine operations + IDisposable - 
-        //default bookmark behavior is to Rollback changes, unless committed explicitly. 
-        //usage of IDisposable enables usage of pattern:
-        // using (Bookmark b = new Bookmark())....
-        internal sealed class Bookmark : IDisposable, IUndoEngineOperations
-        {
-            BookmarkUndoUnit containerUndoUnit;
-            UndoEngine undoEngine;
-            bool isCommitted = false;
-            bool isRolledBack = false;
-            bool isDisposed = false;
-
-            internal Bookmark(UndoEngine undoEngine, BookmarkUndoUnit undoUnit)
-            {
-                this.undoEngine = undoEngine;
-                this.containerUndoUnit = undoUnit;
-            }
-        
-            public void CommitBookmark()
-            {
-                //cannot commit more than once...
-                if (this.isDisposed)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(string.Format(CultureInfo.CurrentUICulture, SR.UndoEngine_OperationNotAllowed, "CommitBookmark")));
-                }
-
-                this.isCommitted = true;
-                //restore original undo engine implementation
-                this.undoEngine.undoEngineImpl = this.undoEngine;
-                //get rid of the bookmark
-                this.undoEngine.bookmark = null;
-                //check if bookmark has any changes
-                if (this.containerUndoUnit.DoList.Count != 0 || this.containerUndoUnit.RedoList.Count != 0)
-                {
-                    //add all changes in bookmark into a undo list as a one element
-                    this.undoEngine.AddUndoUnit(this.containerUndoUnit);
-                }
-                //dispose bookmark
-                this.Dispose();
-            }
-
-            public void RollbackBookmark()
-            {
-                //cannot rollback more than once
-                if (this.isDisposed)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(string.Format(CultureInfo.CurrentUICulture, SR.UndoEngine_OperationNotAllowed, "RollbackBookmark")));
-                }
-                this.isRolledBack = true;
-                //get through the list of all accumulated changes and reverse each of them
-                foreach (UndoUnit unit in this.containerUndoUnit.DoList.Reverse<UndoUnit>())
-                {
-                    unit.Undo();
-                }
-                //clear the lists
-                this.containerUndoUnit.DoList.Clear();
-                this.containerUndoUnit.RedoList.Clear();
-
-                //restore original undo engine implementation
-                this.undoEngine.undoEngineImpl = this.undoEngine;
-                //get rid of the bookmark
-                this.undoEngine.bookmark = null;
-                this.undoEngine.NotifyUndoUnitCancelled(this.containerUndoUnit);
-                //dispose bookmark
-                this.Dispose();
-            }
-
-            public void Dispose()
-            {
-                if (!this.isDisposed)
-                {
-                    GC.SuppressFinalize(this);
-                    DisposeInternal();
-                }
-            }
-
-            void DisposeInternal()
-            {
-                if (!this.isDisposed)
-                {
-                    //if not committed or rolled back - rollback by default  
-                    if (!this.isCommitted && !this.isRolledBack)
-                    {
-                        this.RollbackBookmark();
-                    }
-                    this.isDisposed = true;
-                }
-            }
-
-            void IUndoEngineOperations.AddUndoUnitCore(UndoUnit unit)
-            {
-                //add element to Undo list
-                this.containerUndoUnit.DoList.Add(unit);
-                //clear redo list
-                this.containerUndoUnit.RedoList.Clear();
-            }
-
-            bool IUndoEngineOperations.UndoCore()
-            {
-                //if there is anything to undo
-                bool succeeded = false;
-                if (this.containerUndoUnit.DoList.Count > 0)
-                {
-                    //get the last element done
-                    UndoUnit unitToUndo = this.containerUndoUnit.DoList.Last();
-                    //remove it
-                    this.containerUndoUnit.DoList.RemoveAt(this.containerUndoUnit.DoList.Count - 1);
-                    //undo it
-                    unitToUndo.Undo();
-                    //and insert to the head of redo list
-                    this.containerUndoUnit.RedoList.Insert(0, unitToUndo);
-                    succeeded = true;
-                }
-                return succeeded;
-            }
-
-            bool IUndoEngineOperations.RedoCore()
-            {
-                //if there is anything to redo
-                bool succeeded = false;
-                if (this.containerUndoUnit.RedoList.Count > 0)
-                {
-                    //get first element to redo
-                    UndoUnit unitToRedo = this.containerUndoUnit.RedoList.First();
-                    //remove it
-                    this.containerUndoUnit.RedoList.RemoveAt(0);
-                    //redo it
-                    unitToRedo.Redo();
-                    //add it to the end of undo list
-                    this.containerUndoUnit.DoList.Add(unitToRedo);
-                    succeeded = true;
-                }
-                return succeeded;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/UndoUnit.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/UndoUnit.cs
deleted file mode 100644 (file)
index ebdb782..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-    using System.Activities.Presentation.View;
-    using System.Activities.Presentation.Model;
-
-    public abstract class UndoUnit
-    {
-        EditingContext context;
-        ModelItem designerRoot;
-
-        public string Description { get; set; }
-        public abstract void Redo();
-        public abstract void Undo();
-
-        protected UndoUnit(EditingContext context)
-        {
-            if (context == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("context"));
-            }
-            this.context = context;
-        }
-        protected void SaveGlobalState()
-        {
-            DesignerView designerView = context.Services.GetService<DesignerView>();
-            if (designerView != null && designerView.RootDesigner != null)
-            {
-                designerRoot = ((WorkflowViewElement)designerView.RootDesigner).ModelItem;
-            }
-        }
-
-        protected void ApplyGlobalState()
-        {
-            DesignerView designerView = context.Services.GetService<DesignerView>();
-            if (designerView != null && designerView.RootDesigner != null)
-            {
-                ModelItem currentDesignerRoot = ((WorkflowViewElement)designerView.RootDesigner).ModelItem;
-                if (currentDesignerRoot != designerRoot)
-                {
-                    designerView.MakeRootDesigner(designerRoot);
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/UndoUnitEventArgs.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/UndoUnitEventArgs.cs
deleted file mode 100644 (file)
index 7e17575..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-    using System.Runtime;
-
-    [Fx.Tag.XamlVisible(false)]
-    public class UndoUnitEventArgs : EventArgs
-    {
-        public UndoUnit UndoUnit { get; set; }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/UpdatableGenericsFeature.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/UpdatableGenericsFeature.cs
deleted file mode 100644 (file)
index fc7b10c..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Activities.Presentation.Model;
-
-    class UpdatableGenericArgumentsFeature : Feature
-    {
-        public override void Initialize(EditingContext context, Type modelType)
-        {
-            GenericArgumentUpdater genericArgumentUpdater = context.Services.GetService<GenericArgumentUpdater>();
-            if (genericArgumentUpdater == null)
-            {
-                genericArgumentUpdater = new GenericArgumentUpdater(context);
-                context.Services.Publish<GenericArgumentUpdater>(genericArgumentUpdater);
-            }
-            genericArgumentUpdater.AddSupportForUpdatingTypeArgument(modelType);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Utility/IconHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Utility/IconHelper.cs
deleted file mode 100644 (file)
index 2ddf7a9..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Utility
-{
-    using System;
-    using System.Activities.Presentation.View;
-    using System.Collections.Generic;
-    using System.Windows.Media;
-
-    internal static class IconHelper
-    {
-        private static Dictionary<string, string> iconNameMapping;
-
-        internal static Dictionary<string, string> IconNameMapping
-        {
-            get
-            {
-                if (iconNameMapping == null)
-                {
-                    iconNameMapping = new Dictionary<string, string>()
-                    {
-                        { "System.Activities.Statements.AddToCollection`1", "AddToCollectionIcon" },
-                        { "System.Activities.Statements.Assign", "AssignIcon" },
-                        { "System.Activities.Statements.CancellationScope", "CancellationScopeIcon" },
-                        { "System.Activities.Statements.ClearCollection`1", "ClearCollectionIcon" },
-                        { "System.Activities.Statements.CompensableActivity", "CompensableActivityIcon" },
-                        { "System.Activities.Statements.Compensate", "CompensateIcon" },
-                        { "System.Activities.Statements.Confirm", "ConfirmIcon" },
-                        { "System.Activities.Statements.Delay", "DelayIcon" },
-                        { "System.Activities.Statements.DoWhile", "DoWhileIcon" },
-                        { "System.Activities.Statements.ExistsInCollection`1", "ExistsInCollectionIcon" },
-                        { "System.Activities.Statements.Flowchart", "FlowchartIcon" },
-                        { "System.Activities.Statements.FlowDecision", "FlowDecisionIcon" },
-                        { "System.Activities.Statements.FlowSwitch`1", "FlowSwitchIcon" },
-                        { "System.Activities.Statements.If", "IfIcon" },
-                        { "System.Activities.Statements.Interop", "InteropIcon" },
-                        { "System.Activities.Statements.InvokeDelegate", "InvokeDelegateIcon" },
-                        { "System.Activities.Statements.InvokeMethod", "InvokeMethodIcon" },
-                        { "System.Activities.Statements.NoPersistScope", "NoPersistScopeIcon" },
-                        { "System.Activities.Statements.Parallel", "ParallelIcon" },
-                        { "System.Activities.Statements.Persist", "PersistIcon" },
-                        { "System.Activities.Statements.Pick", "PickIcon" },
-                        { "System.Activities.Statements.PickBranch", "PickBranchIcon" },
-                        { "System.Activities.Statements.RemoveFromCollection`1", "RemoveFromCollectionIcon" },
-                        { "System.Activities.Statements.Rethrow", "RethrowIcon" },
-                        { "System.Activities.Statements.Sequence", "SequenceIcon" },
-                        { "System.Activities.Statements.State", "StateIcon" },
-                        { "System.Activities.Statements.StateMachine", "StateMachineIcon" },
-                        { "System.Activities.Statements.Switch`1", "SwitchIcon" },
-                        { "System.Activities.Statements.TerminateWorkflow", "TerminateWorkflowIcon" },
-                        { "System.Activities.Statements.Throw", "ThrowIcon" },
-                        { "System.Activities.Statements.TransactionScope", "TransactionScopeIcon" },
-                        { "System.Activities.Statements.TryCatch", "TryCatchIcon" },
-                        { "System.Activities.Statements.While", "WhileIcon" },
-                        { "System.Activities.Statements.WriteLine", "WriteLineIcon" },
-                        { "System.Activities.Core.Presentation.FinalState", "FinalStateIcon" },
-                        { "System.Activities.Core.Presentation.Factories.StateMachineWithInitialStateFactory", "StateMachineIcon" },
-                        { "System.Activities.Core.Presentation.Factories.ForEachWithBodyFactory`1", "ForEachIcon" },
-                        { "System.Activities.Core.Presentation.Factories.ParallelForEachWithBodyFactory`1", "ParallelForEachIcon" },
-                        { "System.Activities.Core.Presentation.Factories.PickWithTwoBranchesFactory", "PickIcon" },
-                        { "System.ServiceModel.Activities.CorrelationScope", "CorrelationScopeIcon" },
-                        { "System.ServiceModel.Activities.InitializeCorrelation", "InitializeCorrelationIcon" },
-                        { "System.ServiceModel.Activities.Receive", "ReceiveIcon" },
-                        { "System.ServiceModel.Activities.ReceiveReply", "ReceiveReplyIcon" },
-                        { "System.ServiceModel.Activities.Send", "SendIcon" },
-                        { "System.ServiceModel.Activities.SendReply", "SendReplyIcon" },
-                        { "System.ServiceModel.Activities.TransactedReceiveScope", "TransactedReceiveScopeIcon" },
-                        { "System.ServiceModel.Activities.Presentation.Factories.ReceiveAndSendReplyFactory", "ReceiveAndSendReplyIcon" },
-                        { "System.ServiceModel.Activities.Presentation.Factories.SendAndReceiveReplyFactory", "SendAndReceiveReplyIcon" },
-                    };
-                }
-
-                return iconNameMapping;
-            }
-        }
-
-        internal static string GetIconResourceKey(string activityFullName)
-        {
-            if (!string.IsNullOrWhiteSpace(activityFullName) && IconNameMapping.ContainsKey(activityFullName))
-            {
-                return IconNameMapping[activityFullName];
-            }
-
-            return null;
-        }
-
-        internal static DrawingBrush GetBrushFromResource(string activityFullName)
-        {
-            string resourceKey = GetIconResourceKey(activityFullName);
-            if (resourceKey == null)
-            {
-                return null;
-            }
-
-            var resourceDictionary = EditorResources.GetIcons();
-            if (resourceDictionary != null && resourceDictionary.Contains(resourceKey))
-            {
-                DrawingBrush drawingBrush = resourceDictionary[resourceKey] as DrawingBrush;
-                return drawingBrush;
-            }
-
-            return null;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/BackgroundValidationSynchronizer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/BackgroundValidationSynchronizer.cs
deleted file mode 100644 (file)
index 78b88d7..0000000
+++ /dev/null
@@ -1,373 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation.Validation
-{
-    using System.Activities.Validation;
-    using System.Runtime;
-    using System.Threading;
-    using System.Windows.Threading;
-
-    internal class BackgroundValidationSynchronizer<TValidationResult> : ValidationSynchronizer
-    {
-        internal readonly SynchronizerState Idle;
-        internal readonly SynchronizerState Validating;
-        internal readonly SynchronizerState CancellingForNextValidation;
-        internal readonly SynchronizerState CancellingForDeactivation;
-        internal readonly SynchronizerState ValidationDeactivated;
-
-        private readonly object thisLock = new object();
-
-        private Func<ValidationReason, CancellationToken, TValidationResult> validationWork;
-        private Action<TValidationResult> updateWork;
-
-        private CancellationTokenSource cancellationTokenSource;
-        private TaskDispatcher dispatcher;
-
-        private SynchronizerState currentState;
-        private ValidationReason lastValidationReason;
-
-        private int deactivationReferenceCount;
-
-        internal BackgroundValidationSynchronizer(TaskDispatcher dispatcher, Func<ValidationReason, CancellationToken, TValidationResult> validationWork, Action<TValidationResult> updateWork)
-        {
-            Fx.Assert(validationWork != null, "validationWork should not be null and is ensured by caller.");
-            Fx.Assert(updateWork != null, "updateWork should not be null and is ensured by caller.");
-
-            this.Idle = new IdleState(this);
-            this.Validating = new ValidatingState(this);
-            this.CancellingForNextValidation = new CancellingForNextValidationState(this);
-            this.CancellingForDeactivation = new CancellingForDeactivationState(this);
-            this.ValidationDeactivated = new ValidationDeactivatedState(this);
-            this.dispatcher = dispatcher;
-            this.validationWork = validationWork;
-            this.updateWork = updateWork;
-            this.currentState = this.Idle;
-        }
-
-        internal SynchronizerState CurrentState
-        {
-            get
-            {
-                return this.currentState;
-            }
-
-            private set
-            {
-                this.currentState = value;
-                this.OnCurrentStateChanged();
-            }
-        }
-
-        internal override void Validate(ValidationReason validationReason)
-        {
-            lock (this.thisLock)
-            {
-                this.CurrentState = this.CurrentState.Validate(validationReason);
-            }
-        }
-
-        internal override void DeactivateValidation()
-        {
-            lock (this.thisLock)
-            {
-                Fx.Assert(this.deactivationReferenceCount >= 0, "It should never happen -- deactivationReferenceCount < 0.");
-                if (this.deactivationReferenceCount == 0)
-                {
-                    this.CurrentState = this.CurrentState.DeactivateValidation();
-                    if (this.CurrentState != this.ValidationDeactivated)
-                    {
-                        Monitor.Wait(this.thisLock);
-                    }
-                }
-
-                this.deactivationReferenceCount++;
-            }
-        }
-
-        internal override void ActivateValidation()
-        {
-            lock (this.thisLock)
-            {
-                this.deactivationReferenceCount--;
-                Fx.Assert(this.deactivationReferenceCount >= 0, "It should never happen -- deactivationReferenceCount < 0.");
-                if (this.deactivationReferenceCount == 0)
-                {
-                    this.CurrentState = this.CurrentState.ActivateValidation();
-                }
-            }
-        }
-
-        // for unit test only
-        protected virtual void OnCurrentStateChanged()
-        {
-        }
-
-        private void ValidationCompleted(TValidationResult result)
-        {
-            lock (this.thisLock)
-            {
-                this.CurrentState = this.CurrentState.ValidationCompleted(result);
-            }
-        }
-
-        private void ValidationCancelled()
-        {
-            lock (this.thisLock)
-            {
-                this.CurrentState = this.CurrentState.ValidationCancelled();
-            }
-        }
-
-        private void CancellableValidate(object state)
-        {
-            Fx.Assert(state is ValidationReason, "unusedState should always be a ValidationReason.");
-            ValidationReason reason = (ValidationReason)state;
-            try
-            {
-                Fx.Assert(this.cancellationTokenSource != null, "this.cancellationTokenSource should be constructed");
-                TValidationResult result = this.validationWork(reason, this.cancellationTokenSource.Token);
-                this.ValidationCompleted(result);
-            }
-            catch (OperationCanceledException)
-            {
-                this.ValidationCancelled();
-            }
-        }
-
-        private void Cancel()
-        {
-            Fx.Assert(this.cancellationTokenSource != null, "Cancel should be called only when the work is active, and by the time the cancellationTokenSource should not be null.");
-            Fx.Assert(this.cancellationTokenSource.IsCancellationRequested == false, "We should only request for cancel once.");
-            this.cancellationTokenSource.Cancel();
-        }
-
-        private void ValidationWork(ValidationReason reason)
-        {
-            this.cancellationTokenSource = new CancellationTokenSource();
-            this.dispatcher.DispatchWorkOnBackgroundThread(Fx.ThunkCallback(new WaitCallback(this.CancellableValidate)), reason);
-        }
-
-        private void UpdateUI(TValidationResult result)
-        {
-            this.dispatcher.DispatchWorkOnUIThread(DispatcherPriority.ApplicationIdle, new Action(() => { this.updateWork(result); }));
-        }
-
-        internal abstract class SynchronizerState
-        {
-            public SynchronizerState(BackgroundValidationSynchronizer<TValidationResult> parent)
-            {
-                Fx.Assert(parent != null, "parent should not be null.");
-
-                this.Parent = parent;
-            }
-
-            protected BackgroundValidationSynchronizer<TValidationResult> Parent { get; private set; }
-
-            public abstract SynchronizerState Validate(ValidationReason reason);
-
-            public abstract SynchronizerState ValidationCompleted(TValidationResult result);
-            
-            public abstract SynchronizerState ValidationCancelled();
-
-            public abstract SynchronizerState DeactivateValidation();
-
-            public abstract SynchronizerState ActivateValidation();
-        }
-
-        private class IdleState : SynchronizerState
-        {
-            public IdleState(BackgroundValidationSynchronizer<TValidationResult> parent)
-                : base(parent)
-            {
-            }
-
-            public override SynchronizerState Validate(ValidationReason reason)
-            {
-                this.Parent.ValidationWork(reason);
-                return this.Parent.Validating;
-            }
-
-            public override SynchronizerState ValidationCompleted(TValidationResult result)
-            {
-                Fx.Assert(false, "This should never happen - we are idle, so there is no work to complete.");
-                return this;
-            }
-
-            public override SynchronizerState ValidationCancelled()
-            {
-                Fx.Assert(false, "This should never happen - we are idle, so there is no work to be cancelled.");
-                return this;
-            }
-
-            public override SynchronizerState DeactivateValidation()
-            {
-                return this.Parent.ValidationDeactivated;
-            }
-
-            public override SynchronizerState ActivateValidation()
-            {
-                Fx.Assert(false, "This should never happen - validation hasn't been deactivated, so there is no possibility for activate validation.");
-                return this;
-            }
-        }
-
-        private class ValidatingState : SynchronizerState
-        {
-            public ValidatingState(BackgroundValidationSynchronizer<TValidationResult> parent)
-                : base(parent)
-            {
-            }
-
-            public override SynchronizerState Validate(ValidationReason reason)
-            {
-                this.Parent.Cancel();
-                this.Parent.lastValidationReason = reason;
-                return this.Parent.CancellingForNextValidation;
-            }
-
-            public override SynchronizerState ValidationCompleted(TValidationResult result)
-            {
-                this.Parent.cancellationTokenSource = null;
-                this.Parent.UpdateUI(result);
-                return this.Parent.Idle;
-            }
-
-            public override SynchronizerState ValidationCancelled()
-            {
-                Fx.Assert(false, "This should never happen - we haven't request for cancel yet, so there is no work to be cancelled.");
-                return this;
-            }
-
-            public override SynchronizerState DeactivateValidation()
-            {
-                this.Parent.Cancel();
-                return this.Parent.CancellingForDeactivation;
-            }
-
-            public override SynchronizerState ActivateValidation()
-            {
-                Fx.Assert(false, "This should never happen - validation hasn't been deactivated, so there is no possibility for activate validation.");
-                return this;
-            }
-        }
-
-        private class CancellingForNextValidationState : SynchronizerState
-        {
-            public CancellingForNextValidationState(BackgroundValidationSynchronizer<TValidationResult> parent)
-                : base(parent)
-            {
-            }
-
-            public override SynchronizerState Validate(ValidationReason reason)
-            {
-                this.Parent.lastValidationReason = reason;
-                return this.Parent.CancellingForNextValidation;
-            }
-
-            public override SynchronizerState ValidationCompleted(TValidationResult result)
-            {
-                this.Parent.cancellationTokenSource = null;
-                this.Parent.UpdateUI(result);
-                this.Parent.ValidationWork(this.Parent.lastValidationReason);
-                return this.Parent.Validating;
-            }
-
-            public override SynchronizerState ValidationCancelled()
-            {
-                this.Parent.cancellationTokenSource = null;
-                this.Parent.ValidationWork(this.Parent.lastValidationReason);
-                return this.Parent.Validating;
-            }
-
-            public override SynchronizerState DeactivateValidation()
-            {
-                return this.Parent.CancellingForDeactivation;
-            }
-
-            public override SynchronizerState ActivateValidation()
-            {
-                Fx.Assert(false, "This should never happen - validation hasn't been deactivated, so there is no possibility for activate validation.");
-                return this;
-            }
-        }
-
-        private class CancellingForDeactivationState : SynchronizerState
-        {
-            public CancellingForDeactivationState(BackgroundValidationSynchronizer<TValidationResult> parent)
-                : base(parent)
-            {
-            }
-
-            public override SynchronizerState Validate(ValidationReason reason)
-            {
-                // Validation need to give way to commit so that we have a responsive UI.
-                return this.Parent.CancellingForDeactivation;
-            }
-
-            public override SynchronizerState ValidationCompleted(TValidationResult result)
-            {
-                this.Parent.cancellationTokenSource = null;
-                this.Parent.UpdateUI(result);
-                Monitor.Pulse(this.Parent.thisLock);
-                return this.Parent.ValidationDeactivated;
-            }
-
-            public override SynchronizerState ValidationCancelled()
-            {
-                this.Parent.cancellationTokenSource = null;
-                Monitor.Pulse(this.Parent.thisLock);
-                return this.Parent.ValidationDeactivated;
-            }
-
-            public override SynchronizerState DeactivateValidation()
-            {
-                return this.Parent.CancellingForDeactivation;
-            }
-
-            public override SynchronizerState ActivateValidation()
-            {
-                Fx.Assert(false, "This should never happen - validation hasn't been deactivated, so there is no possibility for activate validation.");
-                return this;
-            }
-        }
-
-        private class ValidationDeactivatedState : SynchronizerState
-        {
-            public ValidationDeactivatedState(BackgroundValidationSynchronizer<TValidationResult> parent)
-                : base(parent)
-            {
-            }
-
-            public override SynchronizerState Validate(ValidationReason reason)
-            {
-                // no-op - because commit will trigger validation anyway.
-                return this.Parent.ValidationDeactivated;
-            }
-
-            public override SynchronizerState ValidationCompleted(TValidationResult result)
-            {
-                Fx.Assert(false, "This should never happen - we are committing, so there is no validation work in progress, not to mention the possibility for them to be completed.");
-                return this;
-            }
-
-            public override SynchronizerState ValidationCancelled()
-            {
-                Fx.Assert(false, "This should never happen - we are committing, not to mention the possibility for them to be cancelled.");
-                return this;
-            }
-
-            public override SynchronizerState DeactivateValidation()
-            {
-                Fx.Assert(false, "This should never happen - validation has already been deactivated, so we shouldn't DeactivateValidation again.");
-                return this;
-            }
-
-            public override SynchronizerState ActivateValidation()
-            {
-                return this.Parent.Idle;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ForegroundValidationSynchronizer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ForegroundValidationSynchronizer.cs
deleted file mode 100644 (file)
index 1a98ae1..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation.Validation
-{
-    using System.Activities.Validation;
-    using System.Runtime;
-    using System.Threading;
-    using System.Windows.Threading;
-
-    internal sealed class ForegroundValidationSynchronizer<TValidationResult> : ValidationSynchronizer
-    {
-        private TaskDispatcher dispatcher;
-        private Func<ValidationReason, CancellationToken, TValidationResult> validationWork;
-        private Action<TValidationResult> updateWork;
-
-        internal ForegroundValidationSynchronizer(TaskDispatcher dispatcher, Func<ValidationReason, CancellationToken, TValidationResult> validationWork, Action<TValidationResult> updateWork)
-        {
-            Fx.Assert(dispatcher != null, "dispatcher should not be null and is ensured by caller.");
-            Fx.Assert(validationWork != null, "validationWork should not be null and is ensured by caller.");
-            Fx.Assert(updateWork != null, "updateWork should not be null and is ensured by caller.");
-
-            this.dispatcher = dispatcher;
-            this.validationWork = validationWork;
-            this.updateWork = updateWork;
-        }
-
-        internal override void Validate(ValidationReason reason)
-        {
-            this.updateWork(this.validationWork(reason, /* cancellationToken = */ CancellationToken.None));
-        }
-
-        internal override void DeactivateValidation()
-        {
-            // no-op, we do not need to synchronize change since validation is executing on UI thread.
-        }
-
-        internal override void ActivateValidation()
-        {
-            // no-op, we do not need to synchronize change since validation is executing on UI thread.
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/IValidationErrorService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/IValidationErrorService.cs
deleted file mode 100644 (file)
index 244f98b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Validation
-{
-    using System.Collections.Generic;
-
-    public interface IValidationErrorService
-    {
-        void ShowValidationErrors(IList<ValidationErrorInfo> errors);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/IValidationErrorSourceLocator.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/IValidationErrorSourceLocator.cs
deleted file mode 100644 (file)
index 21984df..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation.Validation
-{
-    using System.Activities.Presentation.Model;
-    using System.Collections.Generic;
-
-    // ValidationService is responsible for locating the ModelItem containing the violating activities
-    // Individual activity designers can register their ValidationErrorLocator to refine the source
-    // (e.g.) StateMachine can use this extensibility point to provide error on state level.
-    internal interface IValidationErrorSourceLocator
-    {
-        List<object> FindSourceDetailFromActivity(Activity errorSource, object errorSourceDetail);
-
-        void ReplaceParentChainWithSource(Activity parentActivity, List<object> parentChain);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationErrorInfo.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationErrorInfo.cs
deleted file mode 100644 (file)
index d6a395b..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Validation
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-    using System.Activities.Validation;
-    using System.Runtime;
-
-    [Serializable]
-    [Fx.Tag.XamlVisible(false)]
-    public class ValidationErrorInfo
-    {
-        public ValidationErrorInfo(string message)
-        {
-            // Used to initialize violations that correspond
-            // to exceptions triggered during validation.
-            this.Message = message;
-            this.PropertyName = string.Empty;
-            this.FileName = string.Empty;
-            this.IsWarning = false;
-        }
-
-        public ValidationErrorInfo(ValidationError validationError)
-        {
-            this.Id = validationError.Id;
-            this.Message = validationError.Message;
-            this.PropertyName = validationError.PropertyName;
-            this.FileName = string.Empty;
-            this.IsWarning = validationError.IsWarning;
-        }
-
-        public string Id { get; private set; }
-
-        public Guid SourceReferenceId { get; set; }
-
-        public string Message { get; private set; }
-
-        public string PropertyName { get; private set; }
-
-        public string FileName { get; set; }
-
-        public bool IsWarning { get; private set; }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationReason.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationReason.cs
deleted file mode 100644 (file)
index 81e4593..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation.Validation
-{
-    internal enum ValidationReason
-    {
-        Unknown,
-        Load,
-        Save,
-        ModelChange,
-    }
-}
\ No newline at end of file
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationRoot.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationRoot.cs
deleted file mode 100644 (file)
index 4302466..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation.Validation
-{
-    using System.Activities.Validation;
-    using System.Runtime;
-    using System.ServiceModel.Activities;
-
-    internal sealed class ValidationRoot
-    {
-        private WorkflowService workflowService;
-        private Activity activity;
-
-        public ValidationRoot(WorkflowService workflowService)
-        {
-            Fx.Assert(workflowService != null, "workflowService != null");
-            this.workflowService = workflowService;
-        }
-
-        public ValidationRoot(Activity activity)
-        {
-            Fx.Assert(activity != null, "activity!=null");
-            this.activity = activity;
-        }
-
-        public ValidationResults Validate(ValidationSettings settings)
-        {
-            if (this.workflowService != null)
-            {
-                return this.workflowService.Validate(settings);
-            }
-            else
-            {
-                return ActivityValidationServices.Validate(this.activity, settings);
-            }
-        }
-
-        public Activity Resolve(string id)
-        {
-            Fx.Assert(id != null, "id should not be null.");
-
-            Activity activityRoot = null;
-            if (this.workflowService != null)
-            {
-                activityRoot = this.workflowService.GetWorkflowRoot();
-            }
-            else
-            {
-                activityRoot = this.activity;
-            }
-
-            return ActivityValidationServices.Resolve(activityRoot, id);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationService.cs
deleted file mode 100644 (file)
index d6b64bc..0000000
+++ /dev/null
@@ -1,1034 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation.Validation
-{
-    using System.Activities.Expressions;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Services;
-    using System.Activities.Presentation.View;
-    using System.Activities.Validation;
-    using System.Collections.Generic;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Reflection;
-    using System.Runtime;
-    using System.ServiceModel.Activities;
-    using System.Text;
-    using System.Threading;
-    using System.Windows.Threading;
-    using Microsoft.Activities.Presentation.Xaml;
-    using Microsoft.Win32;
-
-    [Fx.Tag.XamlVisible(false)]
-    public class ValidationService
-    {
-        static PropertyInfo parentPropertyInfo;
-
-        Dictionary<Type, IValidationErrorSourceLocator> validationErrorSourceLocators;
-        List<Guid> acquiredObjectReferences;
-
-        EditingContext context;
-        ModelService modelService;
-        ModelSearchServiceImpl modelSearchService;
-        ModelTreeManager modelTreeManager;
-        WorkflowViewService viewService;
-        IValidationErrorService errorService;
-        ObjectReferenceService objectReferenceService;
-        TaskDispatcher validationTaskDispatcher;
-        ValidationSynchronizer validationSynchronizer;
-
-        // Dictionary which maps the object to their error messages and indicators
-        // NOTE: Valid objects do not appear in this dictionary,
-        // only elements which violated a constraint (Errors or Warnings or Child Validation Issues)
-        Dictionary<object, ValidationErrorState> validationErrors;
-
-        // Attached properties for error visuals
-        AttachedProperty<ValidationState> validationStateProperty;
-        AttachedProperty<string> validationMessageProperty;
-
-        internal event EventHandler ValidationCompleted;
-
-        internal class ErrorsMarkedEventArgs : EventArgs
-        {
-            ICollection<ValidationError> errors;
-            ValidationReason reason;
-            ModelTreeManager modelTreeManager;
-            EditingContext context;
-
-            public ErrorsMarkedEventArgs(ICollection<ValidationError> errors,
-                ValidationReason reason,
-                ModelTreeManager modelTreeManager,
-                EditingContext context)
-            {
-                this.errors = errors;
-                this.reason = reason;
-                this.modelTreeManager = modelTreeManager;
-                this.context = context;
-            }
-
-            public ICollection<ValidationError> Errors
-            {
-                get { return this.errors; }
-            }
-
-            public ValidationReason Reason
-            {
-                get { return this.reason; }
-            }
-
-            public ModelTreeManager ModelTreeManager
-            {
-                get { return this.modelTreeManager; }
-            }
-
-            public bool Handled
-            {
-                get;
-                set;
-            }
-
-            public EditingContext Context
-            {
-                get { return this.context; }
-            }
-        }
-
-        internal event EventHandler<ErrorsMarkedEventArgs> ErrorsMarked;
-
-        DynamicActivity dynamicActivityWrapper;
-
-        ValidationSettings settings;
-
-        bool isValidationDisabled = false;
-        const string ValidationRegKeyName = "DisableValidateOnModelItemChanged";
-        const string ValidationRegKeyInitialPath = "Software\\Microsoft\\.NETFramework\\";
-        [ThreadStatic]
-        static StringBuilder errorBuilder;
-
-        private static StringBuilder ErrorBuilder
-        {
-            get
-            {
-                if (errorBuilder == null)
-                {
-                    errorBuilder = new StringBuilder();
-                }
-                return errorBuilder;
-            }
-        }
-
-        public ValidationService(EditingContext context)
-            : this(context, new TaskDispatcher())
-        {
-        }
-
-        internal ValidationService(EditingContext context, TaskDispatcher validationTaskDispatcher)
-        {
-            Fx.Assert(validationTaskDispatcher != null, "validationTaskDispatcher cannot be null.");
-            this.validationTaskDispatcher = validationTaskDispatcher;
-            this.context = context;
-            this.settings = new ValidationSettings { SkipValidatingRootConfiguration = true };
-            this.context.Services.Subscribe<ModelService>(new SubscribeServiceCallback<ModelService>(OnModelServiceAvailable));
-            this.context.Services.Subscribe<ModelSearchService>(new SubscribeServiceCallback<ModelSearchService>(OnModelSearchServiceAvailable));
-            this.context.Services.Subscribe<ObjectReferenceService>(new SubscribeServiceCallback<ObjectReferenceService>(OnObjectReferenceServiceAvailable));
-            this.context.Services.Subscribe<ModelTreeManager>(new SubscribeServiceCallback<ModelTreeManager>(OnModelTreeManagerAvailable));
-            this.context.Services.Subscribe<IValidationErrorService>(new SubscribeServiceCallback<IValidationErrorService>(OnErrorServiceAvailable));
-            this.context.Services.Subscribe<AttachedPropertiesService>(new SubscribeServiceCallback<AttachedPropertiesService>(OnAttachedPropertiesServiceAvailable));
-            AssemblyName currentAssemblyName = Assembly.GetExecutingAssembly().GetName();
-            StringBuilder validationKeyPath = new StringBuilder(90);
-            validationKeyPath.Append(ValidationRegKeyInitialPath);
-            validationKeyPath.AppendFormat("{0}{1}{2}", "v", currentAssemblyName.Version.ToString(), "\\");
-            validationKeyPath.Append(currentAssemblyName.Name);
-
-            RegistryKey validationRegistryKey = Registry.CurrentUser.OpenSubKey(validationKeyPath.ToString());
-            if (validationRegistryKey != null)
-            {
-                object value = validationRegistryKey.GetValue(ValidationRegKeyName);
-
-                this.isValidationDisabled = (value != null && string.Equals("1", value.ToString()));
-
-                validationRegistryKey.Close();
-            }
-        }
-
-        private ValidationSynchronizer ValidationSynchronizer
-        {
-            get
-            {
-                if (this.validationSynchronizer == null)
-                {
-                    if (DesignerConfigurationServiceUtilities.IsBackgroundValidationEnabled(context))
-                    {
-                        this.validationSynchronizer = new BackgroundValidationSynchronizer<Tuple<ValidationReason, ValidationResults, Exception>>(validationTaskDispatcher, this.CoreValidationWork, this.OnValidationWorkCompleted);
-                    }
-                    else
-                    {
-                        this.validationSynchronizer = new ForegroundValidationSynchronizer<Tuple<ValidationReason, ValidationResults, Exception>>(validationTaskDispatcher, this.CoreValidationWork, this.OnValidationWorkCompleted);
-                    }
-                }
-
-                return this.validationSynchronizer;
-            }
-        }
-
-        internal DynamicActivity DynamicActivityWrapper
-        {
-            get
-            {
-                if (null == this.dynamicActivityWrapper)
-                {
-                    this.dynamicActivityWrapper = new DynamicActivity();
-                }
-                return this.dynamicActivityWrapper;
-            }
-        }
-
-        public ValidationSettings Settings
-        {
-            get
-            {
-                return this.settings;
-            }
-        }
-
-        WorkflowViewService ViewService
-        {
-            get
-            {
-                if (null == this.viewService)
-                {
-                    this.viewService = (WorkflowViewService)this.context.Services.GetService<ViewService>();
-                }
-                return this.viewService;
-            }
-        }
-
-        void OnAttachedPropertiesServiceAvailable(AttachedPropertiesService attachedPropertiesService)
-        {
-            this.validationStateProperty = new AttachedProperty<ValidationState>()
-            {
-                Getter = (modelItem) => GetValidationState(modelItem),
-                Name = "ValidationState",
-                OwnerType = typeof(object)
-            };
-
-            attachedPropertiesService.AddProperty(this.validationStateProperty);
-
-            this.validationMessageProperty = new AttachedProperty<string>()
-            {
-                Getter = (modelItem) => GetValidationMessage(modelItem),
-                Name = "ValidationMessage",
-                OwnerType = typeof(object)
-            };
-
-            attachedPropertiesService.AddProperty(this.validationMessageProperty);
-        }
-
-        ValidationState GetValidationState(ModelItem modelItem)
-        {
-            ValidationState validationState = ValidationState.Valid;
-            ValidationErrorState validationError = GetValidationError(modelItem);
-
-            if (validationError != null)
-            {
-                validationState = validationError.ValidationState;
-            }
-            return validationState;
-        }
-
-        string GetValidationMessage(ModelItem modelItem)
-        {
-            string errorMessage = string.Empty;
-            ValidationErrorState validationError = GetValidationError(modelItem);
-
-            if (validationError != null)
-            {
-                if (validationError.ErrorMessages != null)
-                {
-                    ValidationService.ErrorBuilder.Clear();
-                    foreach (string message in validationError.ErrorMessages)
-                    {
-                        ValidationService.ErrorBuilder.AppendLine(message.Trim());
-                    }
-                    errorMessage = ValidationService.ErrorBuilder.ToString().Trim();
-                }
-            }
-            return errorMessage;
-        }
-
-        ValidationErrorState GetValidationError(ModelItem modelItem)
-        {
-            ValidationErrorState validationError = null;
-            this.ValidationErrors.TryGetValue(modelItem.GetCurrentValue(), out validationError);
-            return validationError;
-        }
-
-        void OnModelServiceAvailable(ModelService modelService)
-        {
-            if (modelService != null)
-            {
-                this.modelService = modelService;
-            }
-        }
-
-        void OnModelSearchServiceAvailable(ModelSearchService modelSearchService)
-        {
-            if (modelSearchService != null)
-            {
-                this.modelSearchService = modelSearchService as ModelSearchServiceImpl;
-            }
-        }
-
-        void OnObjectReferenceServiceAvailable(ObjectReferenceService objectReferenceService)
-        {
-            if (objectReferenceService != null)
-            {
-                this.objectReferenceService = objectReferenceService;
-            }
-        }
-
-        void OnModelTreeManagerAvailable(ModelTreeManager modelTreeManager)
-        {
-            if (modelTreeManager != null)
-            {
-                this.modelTreeManager = modelTreeManager;
-            }
-        }
-
-        void OnErrorServiceAvailable(IValidationErrorService errorService)
-        {
-            if (errorService != null)
-            {
-                this.errorService = errorService;
-                if (this.isValidationDisabled)
-                {
-                    this.errorService.ShowValidationErrors(new List<ValidationErrorInfo> { new ValidationErrorInfo(new ValidationError(SR.ValidationDisabledWarning, true)) });
-                }
-            }
-        }
-
-        public void ValidateWorkflow()
-        {
-            ValidateWorkflow(ValidationReason.Unknown);
-        }
-
-        private ValidationRoot GetRootElement()
-        {
-            Activity rootElement = null;
-
-            Fx.Assert(this.modelService != null, "ModelService is null."); // ModelService should not be null
-
-            ModelItem rootItem = this.modelService.Root;
-            object root = rootItem.GetCurrentValue();
-            // special case for WorkflowService - it will be returned directly
-            WorkflowService workflowService = root as WorkflowService;
-            if (workflowService != null)
-            {
-                return new ValidationRoot(workflowService);
-            }
-            //special case for ActivityBuilder - its will be converted to a DynamicActivity before validation.
-            ActivityBuilder activityBuilder = root as ActivityBuilder;
-            if (activityBuilder != null)
-            {
-                ActivityBuilderExtensions.ConvertActivityBuilderToDynamicActivity(activityBuilder, this.DynamicActivityWrapper);
-                rootElement = this.DynamicActivityWrapper;
-            }
-            else
-            {
-                rootElement = rootItem.GetRootActivity();
-            }
-
-            IList<AssemblyReference> references;
-            IList<string> namespaces = NamespaceHelper.GetTextExpressionNamespaces(root, out references);
-            NamespaceHelper.SetTextExpressionNamespaces(rootElement, namespaces, references);
-
-            if (rootElement != null)
-            {
-                return new ValidationRoot(rootElement);
-            }
-            else
-            {
-                return null;
-            }
-        }
-
-        internal void ValidateWorkflow(ValidationReason reason)
-        {
-            if (this.isValidationDisabled)
-            {
-                return;
-            }
-
-            this.validationTaskDispatcher.DispatchWorkOnUIThread(DispatcherPriority.ApplicationIdle, new Action(() =>
-                {
-                    this.ValidationSynchronizer.Validate(reason);
-                }));
-        }
-
-        internal void DeactivateValidation()
-        {
-            this.ValidationSynchronizer.DeactivateValidation();
-        }
-
-        internal void ActivateValidation()
-        {
-            this.ValidationSynchronizer.ActivateValidation();
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.DoNotCatchGeneralExceptionTypes)]
-        internal Tuple<ValidationReason, ValidationResults, Exception> CoreValidationWork(ValidationReason reason, CancellationToken cancellationToken)
-        {
-            this.settings.CancellationToken = cancellationToken;
-            ValidationResults results = null;
-            Exception exception = null;
-            try
-            {
-                ValidationRoot rootElement = this.GetRootElement();
-                if (rootElement != null)
-                {
-                    results = rootElement.Validate(this.Settings);
-                }
-            }
-            catch (Exception e)
-            {
-                if (Fx.IsFatal(e) || e is OperationCanceledException)
-                {
-                    throw;
-                }
-
-                exception = e;
-            }
-
-            return Tuple.Create(reason, results, exception);
-        }
-
-        private void OnValidationWorkCompleted(Tuple<ValidationReason, ValidationResults, Exception> input)
-        {
-            ValidationReason reason = input.Item1;
-            ValidationResults results = input.Item2;
-            Exception exception = input.Item3;
-
-            Fx.Assert(results != null ^ exception != null, "result and exception should not both be null");
-
-            bool needsToMarkValidationErrors = false;
-            ValidationErrorInfo validationErrorInfo = null;
-            if (exception != null)
-            {
-                ModelItem rootModelItem = this.modelService.Root;
-                Activity rootActivity = rootModelItem.GetRootActivity();
-
-                if (rootActivity != null)
-                {
-                    // We don't want any crash propagating from here as it causes VS to crash.
-                    if (!this.ValidationErrors.ContainsKey(rootActivity))
-                    {
-                        ValidationErrorState validationError = new ValidationErrorState(new List<string>(), ValidationState.Error);
-                        this.ValidationErrors.Add(rootActivity, validationError);
-                    }
-                    else
-                    {
-                        this.ValidationErrors[rootActivity].ValidationState = ValidationState.Error;
-                    }
-
-                    this.ValidationErrors[rootActivity].ErrorMessages.Add(exception.ToString());
-
-                    // Notify an update to the attached properties
-                    this.NotifyValidationPropertiesChanged(rootModelItem);
-                }
-
-                validationErrorInfo = new ValidationErrorInfo(exception.ToString());
-                needsToMarkValidationErrors = true;
-            }
-
-            DesignerPerfEventProvider perfProvider = this.context.Services.GetService<DesignerPerfEventProvider>();
-            perfProvider.WorkflowDesignerValidationStart();
-
-            List<ValidationError> validationErrors = null;
-            if (results != null)
-            {
-                validationErrors = new List<ValidationError>(results.Errors);
-                validationErrors.AddRange(results.Warnings);
-                Activity rootActivity = this.modelService.Root.GetRootActivity();
-                needsToMarkValidationErrors = this.MarkErrors(validationErrors, reason, rootActivity);
-            }
-
-            if (this.errorService != null && needsToMarkValidationErrors) // Error service could be null if no implementation has been provided
-            {
-                List<ValidationErrorInfo> errors = new List<ValidationErrorInfo>();
-
-                if (validationErrors != null)
-                {
-                    foreach (ValidationError validationError in validationErrors)
-                    {
-                        Activity currentActivity = validationError.Source;
-                        ValidationErrorInfo error = new ValidationErrorInfo(validationError);
-
-                        // The acquired activity reference will be release in the Main AppDomain when it clear the error list
-                        if (validationError.SourceDetail != null)
-                        {
-                            error.SourceReferenceId = this.objectReferenceService.AcquireObjectReference(validationError.SourceDetail);
-                        }
-                        else if (validationError.Source != null)
-                        {
-                            error.SourceReferenceId = this.objectReferenceService.AcquireObjectReference(validationError.Source);
-                        }
-                        else
-                        {
-                            error.SourceReferenceId = Guid.Empty;
-                        }
-                        errors.Add(error);
-                    }
-                }
-
-                if (validationErrorInfo != null)
-                {
-                    errors.Add(validationErrorInfo);
-                }
-
-                foreach (Guid acquiredObjectReference in this.AcquiredObjectReferences)
-                {
-                    this.objectReferenceService.ReleaseObjectReference(acquiredObjectReference);
-                }
-
-                this.AcquiredObjectReferences.Clear();
-
-                foreach (ValidationErrorInfo error in errors)
-                {
-                    if (error.SourceReferenceId != Guid.Empty)
-                    {
-                        this.AcquiredObjectReferences.Add(error.SourceReferenceId);
-                    }
-                }
-
-                this.errorService.ShowValidationErrors(errors);
-            }
-
-            perfProvider.WorkflowDesignerValidationEnd();
-            this.OnValidationCompleted();
-        }
-
-        protected virtual void OnValidationCompleted()
-        {
-            if (this.ValidationCompleted != null)
-            {
-                this.ValidationCompleted(this, new EventArgs());
-            }
-        }
-        
-        //  Find model item and properly create it if necessary.
-        internal static ModelItem FindModelItem(ModelTreeManager modelTreeManager, object sourceDetail)
-        {
-            if (sourceDetail == null)
-            {
-                return null;
-            }
-
-            Fx.Assert(modelTreeManager != null, "modelTreeManager != null");
-
-            Activity element = sourceDetail as Activity;
-            object errorTarget = sourceDetail;
-
-            // if source detail is not an Activity, we just expand the model tree to search it.
-            if (element == null)
-            {
-                return ModelTreeManager.FindFirst(modelTreeManager.Root, (modelItem) => (modelItem.GetCurrentValue() == errorTarget));
-            }
-            else
-            {
-                return FindActivityModelItem(modelTreeManager, element);
-            }
-        }
-        
-        internal static Activity GetParent(Activity childActivity)
-        {
-            // Obtaining the parent from childActivity using (private) reflection.
-            if (parentPropertyInfo == null)
-            {
-                parentPropertyInfo = typeof(Activity).GetProperty("Parent", BindingFlags.Instance | BindingFlags.GetProperty | BindingFlags.NonPublic);
-            }
-            Fx.Assert(parentPropertyInfo != null, "Activity.Parent is not defined");
-            return parentPropertyInfo.GetValue(childActivity, null) as Activity;
-        }
-
-        // Get the parent chain of this activity.
-        // Can't use GetParentChain activity because it can only be used in a Constraint.
-        internal static List<Activity> GetParentChain(Activity activity)
-        {
-            List<Activity> parentChain = new List<Activity>();
-            while (activity != null)
-            {
-                activity = GetParent(activity);
-                if (activity != null)
-                {
-                    parentChain.Add(activity);
-                }
-            }
-            return parentChain;
-        }
-
-        private List<object> GetParentChainWithSource(Activity activity)
-        {
-            List<object> parentChain = new List<object>();
-            parentChain.Add(activity);
-            while (activity != null)
-            {
-                activity = GetParent(activity);
-                if (activity != null)
-                {
-                    IValidationErrorSourceLocator validationErrorSourceLocator = this.GetValidationErrorSourceLocator(activity.GetType());
-                    if (validationErrorSourceLocator != null)
-                    {
-                        validationErrorSourceLocator.ReplaceParentChainWithSource(activity, parentChain);
-                    }
-                    else
-                    {
-                        parentChain.Add(activity);
-                    }
-                }
-            }
-
-            parentChain.RemoveAt(0);
-            return parentChain;
-        }
-
-        // Mark all the errors including their parent chains
-        private bool MarkErrors(ICollection<ValidationError> errors, ValidationReason reason, Activity rootActivity)
-        {
-            // Clear the previous errors/warnings and update the visuals
-            ClearErrors();
-            Fx.Assert(this.modelTreeManager != null, "ModelTreeManager is null."); // ModelTreeManager should not be null
-
-            if (this.HandleErrorsMarked(errors, reason))
-            {
-                return false;
-            }
-
-            // Iterate through the new violation list and mark errors/warnings
-            foreach (ValidationError error in errors)
-            {
-                if (error.Source != null)
-                {
-                    List<object> errorSourcePath = this.GetValidationErrorSourcePath(error.Source, error.SourceDetail);
-                    MarkError(error, errorSourcePath);
-                }
-                else if (error.SourceDetail != null && error.SourceDetail is Receive)
-                {
-                    // special-case:
-                    // WorkflowService.Validate() may produce ValidationError { isWarning = true, Source = null, SourceDetail = Receive activity }
-
-                    List<object> errorSourcePath = this.GetValidationErrorSourcePath((Activity)error.SourceDetail, null);
-                    MarkError(error, errorSourcePath);
-                }
-                else if (rootActivity != null)
-                {
-                    List<object> errorSourcePath = this.GetValidationErrorSourcePath(rootActivity, error.SourceDetail);
-                    MarkError(error, errorSourcePath);
-                }
-            }
-
-            return true;
-        }
-
-        // Mark a single error including its parent chain
-        private void MarkError(ValidationError validationError, List<object> errorSourcePath)
-        {
-            object errorSource = errorSourcePath[0];
-            this.MarkCulprit(errorSource, validationError);
-
-            // Intentionally skipping the zeroth errorSourcePath because that is the culprit and is marked above.
-            for (int errorSourcePathIndex = 1; errorSourcePathIndex < errorSourcePath.Count; errorSourcePathIndex++)
-            {
-                this.MarkParent(validationError, errorSourcePath[errorSourcePathIndex]);
-            }
-
-            foreach (object parent in this.GetParentChainWithSource(validationError.Source))
-            {
-                this.MarkParent(validationError, parent);
-            }
-        }
-
-        // Mark a single error on the culprit
-        private void MarkCulprit(object errorSource, ValidationError validationError)
-        {
-            ValidationErrorState currentError;
-            if (!this.ValidationErrors.TryGetValue(errorSource, out currentError))
-            {
-                currentError = new ValidationErrorState(new List<string>(), ValidationState.Valid);
-                this.ValidationErrors.Add(errorSource, currentError);
-            }
-            MergeValidationError(currentError, validationError);
-            this.NotifyValidationPropertiesChanged(errorSource);
-        }
-
-        // Mark a single "child has an error" on a parent
-        private void MarkParent(ValidationError validationError, object errorParent)
-        {
-            ValidationState childValidationState = GetValidationState(validationError);
-            ValidationErrorState currentError;
-            if (!this.ValidationErrors.TryGetValue(errorParent, out currentError))
-            {
-                currentError = ChildInvalidError();
-                this.ValidationErrors.Add(errorParent, currentError);
-            }
-
-            if (currentError.ValidationState < childValidationState)
-            {
-                currentError.ValidationState = childValidationState;
-            }
-
-            this.NotifyValidationPropertiesChanged(errorParent);
-        }
-
-        private void NotifyValidationPropertiesChanged(object errorItem)
-        {
-            ModelItem errorModelItem = this.modelTreeManager.GetModelItem(errorItem);
-            if (errorModelItem != null)
-            {
-                this.NotifyValidationPropertiesChanged(errorModelItem);
-            }
-        }
-
-        private void NotifyValidationPropertiesChanged(ModelItem modelItem)
-        {
-            // Notify an update to the attached properties
-            this.validationStateProperty.NotifyPropertyChanged(modelItem);
-            this.validationMessageProperty.NotifyPropertyChanged(modelItem);
-        }
-
-        private bool HandleErrorsMarked(ICollection<ValidationError> errors, ValidationReason reason)
-        {
-            if (this.ErrorsMarked != null)
-            {
-                ErrorsMarkedEventArgs arg = new ErrorsMarkedEventArgs(errors, reason, this.modelTreeManager, this.context);
-                this.ErrorsMarked(this, arg);
-                return arg.Handled;
-            }
-
-            return false;
-        }
-
-        private static ModelItem FindActivityModelItem(ModelTreeManager modelTreeManager, Activity errorTarget)
-        {
-            // Search the lowest Activity
-            ModelItem lowestModelItem = null;
-            List<Activity> parentChain = GetParentChain(errorTarget);
-            Fx.Assert(parentChain != null, "Cannot find parent chain for " + errorTarget.DisplayName);
-
-            foreach (Activity parent in parentChain)
-            {
-                lowestModelItem = modelTreeManager.GetModelItem(parent);
-                if (lowestModelItem != null)
-                {
-                    break;
-                }
-            }
-
-            ModelItem foundItem = null;
-            // Find in nearest parent first.
-            if (lowestModelItem != null)
-            {
-                // The foundItem could be null because lowestModelItem is not errorTarget's parent any more.
-                // This happens if background validation hasn't finished updating errorTarget's parent.
-                foundItem = ModelTreeManager.FindFirst(lowestModelItem, (modelItem) => (modelItem.GetCurrentValue() == errorTarget));
-            }
-
-            // Not found, search from root.
-            if (foundItem == null)
-            {
-                foundItem = FindActivityModelItemFromRoot(modelTreeManager, errorTarget);
-            }
-
-            return foundItem;
-        }
-
-        private static ModelItem FindActivityModelItemFromRoot(ModelTreeManager modelTreeManager, Activity errorTarget)
-        {
-            ModelItem root = modelTreeManager.Root;
-            Fx.Assert(root != null && errorTarget != null, "root != null && errorTarget != null");
-            ModelProperty property = root.Properties["Properties"];
-
-            ModelItem propertiesModelItem = property == null ? null : property.Value;
-            ModelItem foundItem = null;
-            if (propertiesModelItem != null)
-            {
-                // So,search "Properties" first to delay expanding "Implementation" and other properties.
-                foundItem = ModelTreeManager.FindFirst(propertiesModelItem, (modelItem) => (modelItem.GetCurrentValue() == errorTarget));
-            }
-
-            // If activity is not in Properties, expand others except Properties.
-            foundItem = foundItem ?? ModelTreeManager.FindFirst(
-                root, 
-                (modelItem) => (modelItem.GetCurrentValue() == errorTarget),
-                (modelItem) => { return modelItem != propertiesModelItem; });
-
-            return foundItem;
-        }
-
-        private static ValidationState GetValidationState(ValidationError validationError)
-        {
-            return validationError.IsWarning ? ValidationState.Warning : ValidationState.Error;
-        }
-
-        private static ValidationErrorState ChildInvalidError()
-        {
-            return new ValidationErrorState(new List<string> { SR.ChildValidationError }, ValidationState.ChildInvalid);
-        }
-
-        private static void MergeValidationError(ValidationErrorState originalError, ValidationError newError)
-        {
-            if (originalError.ValidationState == ValidationState.ChildInvalid)
-            {
-                // If original error is due to child's issue, clear the error list, 
-                // as we don't care about its child's issues anymore and want to add its own issues.
-                originalError.ErrorMessages.Clear();
-            }
-
-            ValidationState errorState = GetValidationState(newError);
-            if (originalError.ValidationState < errorState)
-            {
-                // Promote to the higher level of violation.
-                originalError.ValidationState = errorState;
-            }
-
-            if (newError.IsWarning)
-            {
-                originalError.ErrorMessages.Add(string.Format(CultureInfo.CurrentUICulture, SR.WarningFormat, newError.Message));
-            }
-            else
-            {
-                originalError.ErrorMessages.Add(newError.Message);
-            }
-        }
-
-        void ClearErrors()
-        {
-            // Copy over the previously marked model items before you clear the dictionaries
-            object[] oldErrorList = new object[this.ValidationErrors.Count];
-            this.ValidationErrors.Keys.CopyTo(oldErrorList, 0);
-
-            this.ValidationErrors.Clear();
-
-            // Iterate through the previously marked model items and notify an update to the attached properties
-            ModelItem modelItem;
-            foreach (object workflowElement in oldErrorList)
-            {
-                modelItem = this.modelTreeManager.GetModelItem(workflowElement);
-                if (modelItem != null)
-                {
-                    NotifyValidationPropertiesChanged(modelItem);
-                }
-            }
-        }
-
-        public void NavigateToError(ValidationErrorInfo validationErrorInfo)
-        {
-            if (validationErrorInfo == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("validationErrorInfo");
-            }
-
-            object sourceDetail = this.GetSourceDetail(validationErrorInfo);
-            this.NavigateToErrorOnDispatcherThread(sourceDetail);
-        }
-
-        private object GetSourceDetail(ValidationErrorInfo validationErrorInfo)
-        {
-            Fx.Assert(validationErrorInfo != null, "validationErrorInfo should not be null and is checked by caller.");
-            Guid sourceReferenceId = validationErrorInfo.SourceReferenceId;
-            object sourceDetail = null;
-
-            if (sourceReferenceId == Guid.Empty)
-            {
-                if (this.modelTreeManager.Root != null)
-                {
-                    sourceDetail = modelTreeManager.Root.GetCurrentValue();
-                }
-            }
-            else
-            {
-                if (!this.objectReferenceService.TryGetObject(sourceReferenceId, out sourceDetail))
-                {
-                    throw FxTrace.Exception.Argument("validationErrorInfo", string.Format(CultureInfo.CurrentUICulture, SR.SourceReferenceIdNotFoundInWorkflow, sourceReferenceId));
-                }
-            }
-            return sourceDetail;
-        }
-
-        private void NavigateToErrorOnDispatcherThread(object sourceDetail)
-        {
-            this.validationTaskDispatcher.DispatchWorkOnUIThread(DispatcherPriority.ApplicationIdle, new Action(
-            () =>
-            {
-                this.NavigateToError(sourceDetail);
-            }));
-        }
-
-        public void NavigateToError(string id)
-        {
-            if (id == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("id");
-            }
-
-            ValidationRoot rootElement = this.GetRootElement();
-            if (rootElement != null)
-            {
-                Activity errorElement = rootElement.Resolve(id);
-                this.NavigateToErrorOnDispatcherThread(errorElement);
-            }
-        }
-
-        void NavigateToError(object sourceDetail)
-        {
-            Fx.Assert(this.modelTreeManager != null, "ModelTreeManager is null.");
-            ModelItem modelItem = this.modelTreeManager.GetModelItem(sourceDetail) ?? FindModelItem(this.modelTreeManager, sourceDetail);
-
-            if (modelItem != null)
-            {
-                if (this.modelSearchService != null)
-                {
-                    this.modelSearchService.NavigateTo(modelItem);
-                }
-                else
-                {
-                    // For any Expression, need to focus to its parent instead.
-                    Activity activity = modelItem.GetCurrentValue() as Activity;
-                    if (activity != null && (activity.IsExpression()))
-                    {
-                        ModelItem parent = modelItem.Parent;
-                        while (parent != null)
-                        {
-                            bool hasDesignerAttribute = this.ViewService.GetDesignerType(parent.ItemType) != null;
-
-                            // ModelItemKeyValuePair type also has DesignerAttribute.
-                            // Since we do not want to put a focus on that type, special-casing it here.
-                            bool isModelItemKeyValuePair = parent.ItemType.IsGenericType &&
-                            parent.ItemType.GetGenericTypeDefinition() == typeof(ModelItemKeyValuePair<,>);
-
-                            if (hasDesignerAttribute && !isModelItemKeyValuePair)
-                            {
-                                break;
-                            }
-
-                            parent = parent.Parent;
-                        }
-
-                        if (parent != null)
-                        {
-                            modelItem = parent;
-                        }
-                    }
-                    modelItem.Focus();
-                }
-            }
-        }
-
-        internal void RegisterValidationErrorSourceLocator(Type activityType, IValidationErrorSourceLocator validationErrorSourceLocator)
-        {
-            if (validationErrorSourceLocator == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("validationErrorSourceLocator");
-            }
-            this.ValidationErrorSourceLocators.Add(activityType, validationErrorSourceLocator);
-        }
-
-        List<object> GetValidationErrorSourcePath(Activity violatingActivity, object sourceDetail)
-        {
-            IValidationErrorSourceLocator validationErrorSourceLocator = GetValidationErrorSourceLocator(violatingActivity.GetType());
-            if (validationErrorSourceLocator == null)
-            {
-                return new List<object> { violatingActivity };
-            }
-            else
-            {
-                return validationErrorSourceLocator.FindSourceDetailFromActivity(violatingActivity, sourceDetail);
-            }
-        }
-
-        IValidationErrorSourceLocator GetValidationErrorSourceLocator(Type typeOfActivityWithValidationError)
-        {
-            IValidationErrorSourceLocator validationErrorSourceLocator;
-            if (this.ValidationErrorSourceLocators.TryGetValue(typeOfActivityWithValidationError, out validationErrorSourceLocator))
-            {
-                Fx.Assert(validationErrorSourceLocator != null, "Ensured by RegisterValidationErrorSourceLocator");
-                return validationErrorSourceLocator;
-            }
-            else if (typeOfActivityWithValidationError.IsGenericType && !typeOfActivityWithValidationError.IsGenericTypeDefinition)
-            {
-                return this.GetValidationErrorSourceLocator(typeOfActivityWithValidationError.GetGenericTypeDefinition());
-            }
-            else
-            {
-                return null;
-            }
-        }
-
-        // Properties
-        Dictionary<object, ValidationErrorState> ValidationErrors
-        {
-            get
-            {
-                if (this.validationErrors == null)
-                {
-                    this.validationErrors = new Dictionary<object, ValidationErrorState>();
-                }
-                return this.validationErrors;
-            }
-        }
-
-        Dictionary<Type, IValidationErrorSourceLocator> ValidationErrorSourceLocators
-        {
-            get
-            {
-                if (this.validationErrorSourceLocators == null)
-                {
-                    this.validationErrorSourceLocators = new Dictionary<Type, IValidationErrorSourceLocator>();
-                }
-                return this.validationErrorSourceLocators;
-            }
-        }
-
-        List<Guid> AcquiredObjectReferences
-        {
-            get
-            {
-                if (this.acquiredObjectReferences == null)
-                {
-                    this.acquiredObjectReferences = new List<Guid>();
-                }
-
-                return this.acquiredObjectReferences;
-            }
-        }
-
-        internal AttachedProperty<ValidationState> ValidationStateProperty
-        {
-            get
-            {
-                return this.validationStateProperty;
-            }
-        }
-
-        internal AttachedProperty<string> ValidationMessageProperty
-        {
-            get
-            {
-                return this.validationMessageProperty;
-            }
-        }
-
-        class ValidationErrorState
-        {
-            internal ValidationErrorState(List<string> errorMessages, ValidationState validationState)
-            {
-                this.ErrorMessages = errorMessages;
-                this.ValidationState = validationState;
-            }
-
-            internal List<string> ErrorMessages { get; set; }
-            internal ValidationState ValidationState { get; set; }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationState.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationState.cs
deleted file mode 100644 (file)
index 62f42b9..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation.Validation
-{
-    /// <summary>
-    /// An enumeration of values that represent states of activity validation.
-    /// </summary>
-    public enum ValidationState
-    {
-        // The numeric values of each of the enum values indicate the severity of the error.
-        // The higher the number is, the more severe the error. See the MarkError method in the
-        // ValidationService class for example of usage.
-
-        /// <summary>
-        /// A value that indicates that an error occurred during the validation of an activity. 
-        /// The numeric values of each of the enumeration values indicate the severity of the error. The value associated with the error state is 3
-        /// </summary>
-        Error = 3,
-
-        /// <summary>
-        /// A value that indicates that a warning occurred during the validation of an activity. 
-        /// The numeric values of each of the enumeration values indicate the severity of the error. The value associated with the warning state is 2.
-        /// </summary>
-        Warning = 2,
-
-        /// <summary>
-        /// A value that represents that validation found a child activity to be invalid. 
-        /// The numeric values of each of the enumeration values indicate the severity of the error. The value associated with the invalid child activity is 1.
-        /// </summary>
-        ChildInvalid = 1,
-
-        /// <summary>
-        /// A value that indicates that an activity is valid. 
-        /// The numeric values of each of the enumeration values indicate the severity of the error. The value associated with the valid state is 0.
-        /// </summary>
-        Valid = 0
-    }
-}
\ No newline at end of file
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationSynchronizer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationSynchronizer.cs
deleted file mode 100644 (file)
index e7f9eec..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation.Validation
-{
-    internal abstract class ValidationSynchronizer
-    {
-        internal abstract void Validate(ValidationReason reason);
-
-        internal abstract void DeactivateValidation();
-
-        internal abstract void ActivateValidation();
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ValidationErrorSourceLocatorFeature.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ValidationErrorSourceLocatorFeature.cs
deleted file mode 100644 (file)
index 9f515ed..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Validation;
-    using System.Collections.Generic;
-    using System.Runtime;
-
-    internal abstract class ValidationErrorSourceLocatorFeature : Feature
-    {
-        protected abstract IValidationErrorSourceLocator ValidationErrorSourceLocator
-        {
-            get;
-        }
-
-        public override void Initialize(EditingContext context, Type modelType)
-        {
-            Fx.Assert(context != null, "Context should not be null.");
-            Fx.Assert(modelType != null, "modelType should not be null.");
-            ValidationService validationService = context.Services.GetRequiredService<ValidationService>();
-            validationService.RegisterValidationErrorSourceLocator(modelType, this.ValidationErrorSourceLocator);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/VariableExpressionConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/VariableExpressionConverter.cs
deleted file mode 100644 (file)
index 015833a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Windows.Data;
-    using System.Activities.Presentation.Model;
-
-    class VariableExpressionConverter : IValueConverter
-    {
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            return value;
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            object convertedValue = null;
-            if (value != null)
-            {
-                if (value is ModelItem)
-                {
-                    convertedValue = ((ModelItem)value).GetCurrentValue();
-                }
-                else
-                {
-                    convertedValue = value;
-                }
-            }
-            return convertedValue;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/VerticalConnector.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/VerticalConnector.xaml.cs
deleted file mode 100644 (file)
index 577cca9..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-//-----------------------------------------------------------------------
-// <copyright file="VerticalConnector.xaml.cs" company="Microsoft Corporation">
-//      Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//-----------------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Statements;
-    using System.Windows;
-    using System.Windows.Media.Animation;
-
-    internal partial class VerticalConnector
-    {
-        public VerticalConnector()
-        {
-            this.InitializeComponent();
-        }
-
-        protected override void OnDragEnter(DragEventArgs e)
-        {
-            this.CheckAnimate(e, "Expand");
-            this.dropTarget.Visibility = Visibility.Visible;
-        }
-
-        protected override void OnDragLeave(DragEventArgs e)
-        {
-            this.CheckAnimate(e, "Collapse");
-            this.dropTarget.Visibility = Visibility.Collapsed;
-        }
-
-        protected override void OnDrop(DragEventArgs e)
-        {
-            this.dropTarget.Visibility = Visibility.Collapsed;
-            base.OnDrop(e);
-        }
-
-        private void CheckAnimate(DragEventArgs e, string storyboardResourceName)
-        {
-            if (!e.Handled)
-            {
-                BeginStoryboard((Storyboard)this.Resources[storyboardResourceName]);
-                return;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ActivityTypeDesigner.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ActivityTypeDesigner.xaml.cs
deleted file mode 100644 (file)
index e66b232..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Services;
-    using System.Activities.Presentation.Toolbox;
-    using System.Activities.Presentation.Xaml;
-    using System.Linq;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Input;
-    using System.Windows.Threading;
-
-    partial class ActivityTypeDesigner : IExpandChild
-    {
-        public ActivityTypeDesigner()
-        {
-            this.InitializeComponent();
-            this.DragHandle = null;
-        }
-
-        protected override void OnModelItemChanged(object newItem)
-        {
-            base.OnModelItemChanged(newItem);
-            if (this.Context.Services.GetService<DisplayNameUpdater>() == null)
-            {
-                this.Context.Services.Publish<DisplayNameUpdater>(new DisplayNameUpdater(this.Context));
-            }
-        }
-
-        protected override void OnContextMenuLoaded(ContextMenu menu)
-        {
-            base.OnContextMenuLoaded(menu);
-            if (null == this.ModelItem.Properties["Implementation"].Value)
-            {
-                var toHide = menu.Items.OfType<MenuItem>().Where(p =>
-                    p.Command == DesignerView.GoToParentCommand ||
-                    p.Command == DesignerView.ExpandCommand);
-
-                foreach (var item in toHide)
-                {
-                    item.Visibility = Visibility.Collapsed;
-                }
-            }
-        }
-
-        void OnAddAnnotationCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            if (EditingContextUtilities.GetSingleSelectedModelItem(this.Context) == this.ModelItem)
-            {
-                e.CanExecute = false;
-                e.Handled = true;
-            }
-        }
-
-        void OnEditAnnotationCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            if (EditingContextUtilities.GetSingleSelectedModelItem(this.Context) == this.ModelItem)
-            {
-                e.CanExecute = false;
-                e.Handled = true;
-            }
-        }
-
-        void OnDeleteAnnotationCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            if (EditingContextUtilities.GetSingleSelectedModelItem(this.Context) == this.ModelItem)
-            {
-                e.CanExecute = false;
-                e.Handled = true;
-            }
-        }
-
-        // the job of this service is to add an attached property on ActivityBuilder called displayName.
-        // this name will be shown in breadcrumb bar.
-        // also whenever the Name property changes
-        // we want to refresh the DisplayName property too ( by calling displayNameProperty.NotifyPropertyChanged())
-        class DisplayNameUpdater
-        {
-            AttachedProperty<string> activityBuilderDisplayNameProperty;
-            AttachedProperty<string> activityTemplateFactoryBuilderDisplayNameProperty;
-
-            public DisplayNameUpdater(EditingContext context)
-            {
-                activityBuilderDisplayNameProperty = new AttachedProperty<string>
-                {
-                    Name = "DisplayName",
-                    OwnerType = typeof(ActivityBuilder),
-                    Getter = (modelItem) => ViewUtilities.GetActivityBuilderDisplayName(modelItem)
-                };
-                activityTemplateFactoryBuilderDisplayNameProperty = new AttachedProperty<string>
-                {
-                    Name = "DisplayName",
-                    OwnerType = typeof(ActivityTemplateFactoryBuilder),
-                    Getter = (modelItem) => ViewUtilities.GetActivityBuilderDisplayName(modelItem)
-                };
-                AttachedPropertiesService attachedPropertiesService = context.Services.GetService<AttachedPropertiesService>();
-                attachedPropertiesService.AddProperty(activityBuilderDisplayNameProperty);
-                attachedPropertiesService.AddProperty(activityTemplateFactoryBuilderDisplayNameProperty);
-                context.Services.GetService<ModelService>().ModelChanged += new EventHandler<ModelChangedEventArgs>(ModelChanged);
-            }
-
-            void ModelChanged(object sender, ModelChangedEventArgs e)
-            {
-                ModelChangeInfo changeInfo = e.ModelChangeInfo;
-
-                if (changeInfo != null && changeInfo.ModelChangeType == ModelChangeType.PropertyChanged)
-                {
-                    Type propertyType = changeInfo.Subject.ItemType;
-                    if (changeInfo.PropertyName == "Name")
-                    {
-                        if (propertyType.Equals(typeof(ActivityBuilder)))
-                        {
-                            activityBuilderDisplayNameProperty.NotifyPropertyChanged(changeInfo.Subject);
-                        }
-                        else if (propertyType.Equals(typeof(ActivityTemplateFactoryBuilder)))
-                        {
-                            activityTemplateFactoryBuilderDisplayNameProperty.NotifyPropertyChanged(changeInfo.Subject);
-                        }
-                    }
-                }
-            }
-        }
-
-
-        public ModelItem ExpandedChild
-        {
-            get
-            {
-                ModelItem modelItemToSelect = null;
-                if (this.ModelItem != null)
-                {
-                    modelItemToSelect = this.ModelItem.Properties["Implementation"].Value;
-                }
-                return modelItemToSelect;
-            }
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ActivityTypeResolver.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ActivityTypeResolver.xaml.cs
deleted file mode 100644 (file)
index a612f5e..0000000
+++ /dev/null
@@ -1,290 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Collections.ObjectModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Controls;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using Microsoft.Activities.Presentation;
-
-    // This class is used to resolve generic type in case when a generic activity is 
-    // dropped on design surface
-    internal partial class ActivityTypeResolver : DialogWindow
-    {
-        public static readonly DependencyProperty GenericTypeMappingProperty =
-            DependencyProperty.Register("GenericTypeMapping",
-            typeof(ObservableCollection<TypeKeyValue>),
-            typeof(ActivityTypeResolver));
-
-        public static readonly DependencyProperty EditedTypeProperty =
-            DependencyProperty.Register("EditedType",
-            typeof(Type),
-            typeof(ActivityTypeResolver),
-            new PropertyMetadata(new PropertyChangedCallback(OnEditedTypeChanged)));
-
-        static readonly DependencyPropertyKey IsTypeResolvedKey =
-            DependencyProperty.RegisterReadOnly("IsTypeResolved",
-            typeof(bool),
-            typeof(ActivityTypeResolver),
-            new PropertyMetadata(false));
-
-        public static readonly DependencyProperty IsTypeResolvedProperty = IsTypeResolvedKey.DependencyProperty;
-
-        public ActivityTypeResolver()
-        {
-            InitializeComponent();
-            this.HelpKeyword = HelpKeywords.ActivityTypeResolver;
-        }
-
-        protected override void OnInitialized(EventArgs e)
-        {
-            base.OnInitialized(e);
-            SetValue(GenericTypeMappingProperty, new ObservableCollection<TypeKeyValue>());
-            this.Title = SR.TypeResolverWindowTitle;
-            this.typeResolver.Focus();
-
-        }
-
-        public Type ConcreteType
-        {
-            get;
-            private set;
-        }
-
-
-
-        public Type EditedType
-        {
-            get { return (Type)GetValue(EditedTypeProperty); }
-            set { SetValue(EditedTypeProperty, value); }
-        }
-
-        public ObservableCollection<TypeKeyValue> GenericTypeMapping
-        {
-            get { return (ObservableCollection<TypeKeyValue>)GetValue(GenericTypeMappingProperty); }
-            set { SetValue(GenericTypeMappingProperty, value); }
-        }
-
-        public bool IsTypeResolved
-        {
-            get { return (bool)GetValue(IsTypeResolvedProperty); }
-            private set { SetValue(IsTypeResolvedKey, value); }
-        }
-
-        public TypeResolvingOptions Options
-        {
-            get;
-            set;
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.DoNotCatchGeneralExceptionTypes,
-            Justification = "Catching all exceptions to avoid VS Crash")]
-        [SuppressMessage("Reliability", "Reliability108", Justification = "Catching all exceptions to avoid VS Crash")]
-        public void NotifyTypeChanged(TypeKeyValue sender)
-        {
-            this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.ApplicationIdle,
-                    new Action(() =>
-                    {
-                        try
-                        {
-                            IsTypeResolved = (null != ResolveType() ? true : false);
-                            ClearError();
-                        }
-                        catch (Exception err)
-                        {
-                            SetError(err.Message);
-                            IsTypeResolved = false;
-                        }
-                    }));
-        }
-
-        private void SetError(string message)
-        {
-            if (this.GenericTypeMapping != null)
-            {
-                foreach (TypeKeyValue tkv in this.GenericTypeMapping)
-                {
-                    tkv.IsValid = false;
-                    tkv.ErrorText = message;
-                }
-            }
-        }
-
-        private void ClearError()
-        {
-            if (this.GenericTypeMapping != null)
-            {
-                foreach (TypeKeyValue tkv in this.GenericTypeMapping)
-                {
-                    tkv.IsValid = true;
-                    tkv.ErrorText = null;
-                }
-            }
-        }
-
-
-        protected override System.Windows.Automation.Peers.AutomationPeer OnCreateAutomationPeer()
-        {
-            return new UIElementAutomationPeer(this);
-        }
-
-        static void OnEditedTypeChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
-        {
-            ActivityTypeResolver resolver = (ActivityTypeResolver)sender;
-            resolver.OnEditTypeAssigned();
-        }
-
-        void OnCancelClick(object sender, RoutedEventArgs e)
-        {
-            DialogResult = false;
-        }
-
-        void OnEditTypeAssigned()
-        {
-            if (null != this.EditedType && this.EditedType.IsGenericTypeDefinition)
-            {
-                this.typeName.Text = TypeNameHelper.GetDisplayName(this.EditedType, false);
-
-                Type[] generics = this.EditedType.GetGenericArguments();
-                foreach (Type type in generics)
-                {
-                    Type temp = type; // reference this temp variable instead of reference type in the anonymous delegate
-                    TypeKeyValue tkv = new TypeKeyValue(type, new Action<TypeKeyValue>(NotifyTypeChanged))
-                                    {
-                                        IsSelected = false,
-                                        Filter = delegate(Type t)
-                                        {
-                                            if (!TypeUtilities.CanSubstituteGenericParameter(temp, t))
-                                            {
-                                                return false;
-                                            }
-                                            
-                                            return this.Options == null
-                                                || this.Options.Filter == null
-                                                || this.Options.Filter(t);
-                                        },
-                                        MostRecentlyUsedTypes = this.Options != null ? this.Options.MostRecentlyUsedTypes : null,
-                                    };
-                    string hintText = null;
-                    if (this.Options != null && this.Options.HintTextMap.TryGetValue(type.Name, out hintText))
-                    {
-                        tkv.HintText = hintText;
-                    }
-
-                    this.GenericTypeMapping.Add(tkv);
-
-                    if (this.Options == null || !this.Options.BrowseTypeDirectly)
-                    {
-                        tkv.BrowseTypeDirectly = false;
-                        //this has to happen after the tkv is added GenericTypeMapping because:
-                        //when TargetType is set, TypeResolver will try to resolve the generic type with this TargetType as type argument,
-                        //and when resolvig the type, TypeResolver needs to know all the mappings                        
-                        if (tkv.MostRecentlyUsedTypes == null)
-                        {
-                            if (tkv.Filter == null || tkv.Filter(typeof(int)))
-                            {
-                                tkv.TargetType = typeof(int);
-                            }
-                        }
-                        else if (tkv.MostRecentlyUsedTypes.Contains(typeof(int)))
-                        {
-                            tkv.TargetType = typeof(int);
-                        }
-                        else if (tkv.MostRecentlyUsedTypes.Count > 0)
-                        {
-                            tkv.TargetType = tkv.MostRecentlyUsedTypes[0];
-                        }
-                    }
-                }
-            }
-        }
-
-        void OnOkClick(object sender, RoutedEventArgs e)
-        {
-            try
-            {
-                Type type = ResolveType();
-                if (null != type)
-                {
-                    this.ConcreteType = type;
-                    DialogResult = true;
-                }
-                else
-                {
-                    MessageBox.Show(SR.TypeResolverError, SR.TypeResolverErrorMessageTitle, MessageBoxButton.OK, MessageBoxImage.Error);
-                }
-            }
-            catch (ArgumentException err)
-            {
-                MessageBox.Show(err.Message, err.GetType().Name, MessageBoxButton.OK, MessageBoxImage.Error);
-            }
-        }
-
-        void TypeKeyDown(object sender, KeyEventArgs e)
-        {
-            if (TypePresenter.IsPreviewKey(e.Key))
-            {
-                ListViewItem typeView = (ListViewItem)sender;
-                //always focus on the type presenter so the presenter could handle keyboard events
-                TypePresenter typePresenter = FindChildElement<TypePresenter>(typeView);
-                if (typePresenter != null)
-                {
-                    typePresenter.Preview();
-                }
-                e.Handled = true;
-            }
-        }
-
-        ChildType FindChildElement<ChildType>(DependencyObject tree) where ChildType : DependencyObject
-        {
-            //recursively traverse the visual tree and find the element of a given type
-            for (int i = 0; i < VisualTreeHelper.GetChildrenCount(tree); i++)
-            {
-                DependencyObject child = VisualTreeHelper.GetChild(tree, i);
-                if (child != null && child is ChildType)
-                {
-                    return child as ChildType;
-                }
-                else
-                {
-                    ChildType childInSubtree = FindChildElement<ChildType>(child);
-                    if (childInSubtree != null)
-                    {
-                        return childInSubtree;
-                    }
-                }
-            }
-
-            return null;
-        }
-
-        Type ResolveType()
-        {
-            Type result = null;
-            bool isValid = true;
-            //get number of generic parameters in edited type
-            Type[] arguments = new Type[this.GenericTypeMapping.Count];
-
-            //for each argument, get resolved type
-            for (int i = 0; i < this.GenericTypeMapping.Count && isValid; ++i)
-            {
-                arguments[i] = this.GenericTypeMapping[i].GetConcreteType();
-                isValid = isValid && (null != arguments[i]);
-            }
-            //if all parameters are resolved, create concrete type
-            if (isValid)
-            {
-                result = this.EditedType.MakeGenericType(arguments);
-            }
-            return result;
-        }
-    }
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/AnnotationDialog.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/AnnotationDialog.xaml.cs
deleted file mode 100644 (file)
index f050ecc..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Activities.Presentation.Annotations;
-    using System.Windows;
-    using System.Windows.Input;
-
-    internal partial class AnnotationDialog : DialogWindow
-    {
-        public AnnotationDialog()
-        {
-            this.InitializeComponent();
-            this.HelpKeyword = typeof(Annotation).FullName;
-        }
-
-        public string AnnotationText
-        {
-            get
-            {
-                return this.annotationTextBox.Text;
-            }
-
-            set
-            {
-                if (value == null)
-                {
-                    this.annotationTextBox.Text = string.Empty;
-                }
-                else
-                {
-                    this.annotationTextBox.Text = value;
-                }
-            }
-        }
-
-        protected override void OnKeyDown(Windows.Input.KeyEventArgs e)
-        {
-            if (e.Key == Key.Escape)
-            {
-                this.DialogResult = false;
-                e.Handled = true;
-            }
-            else
-            {
-                base.OnKeyDown(e);
-            }
-        }
-
-        private void OnOkClick(object sender, RoutedEventArgs args)
-        {
-            this.DialogResult = true;
-        }
-
-        private void OnCancelClick(object sender, RoutedEventArgs args)
-        {
-            this.DialogResult = false;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ArgumentDesigner.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ArgumentDesigner.xaml.cs
deleted file mode 100644 (file)
index 9298aff..0000000
+++ /dev/null
@@ -1,1581 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Activities.Presentation.Annotations;
-    using System.Activities.Presentation.Converters;
-    using System.Activities.Presentation.Expressions;
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Collections.Specialized;
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Linq;
-    using System.Reflection;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Controls.Primitives;
-    using System.Windows.Input;
-    using System.Windows.Threading;
-    using System.Xaml;
-
-    partial class ArgumentDesigner
-    {
-        public static readonly DependencyProperty ContextProperty = DependencyProperty.Register(
-            "Context",
-            typeof(EditingContext),
-            typeof(ArgumentDesigner),
-            new FrameworkPropertyMetadata(null, OnContextChanged));
-
-        public static readonly DependencyProperty ActivitySchemaProperty = DependencyProperty.Register(
-            "ActivitySchema",
-            typeof(ModelItem),
-            typeof(ArgumentDesigner),
-            new FrameworkPropertyMetadata(OnActivitySchemaChanged));
-
-        public static readonly RoutedEvent ArgumentCollectionChangedEvent = EventManager.RegisterRoutedEvent(
-            "ArgumentCollectionChanged",
-            RoutingStrategy.Bubble,
-            typeof(RoutedEventHandler),
-            typeof(ArgumentDesigner));
-
-        static readonly string DefaultArgumentName = "argument";
-        static readonly string Members = "Properties";
-        static readonly string ArgumentNamePropertyName = "Name";
-
-        ObservableCollection<DesignTimeArgument> argumentWrapperCollection = new ObservableCollection<DesignTimeArgument>();
-
-        bool isCollectionLoaded = false;
-        bool isDataGridPopulating = false;
-        ModelItem lastSelection;
-        bool isSelectionChangeInternal = false;
-        ArgumentToExpressionConverter argumentToExpressionConverter;
-        DataGridHelper dgHelper;
-
-        public ArgumentDesigner()
-        {
-            InitializeComponent();
-
-            this.dgHelper = new DataGridHelper(this.argumentsDataGrid, this);
-            this.dgHelper.Context = this.Context;
-            this.dgHelper.AddNewRowContent = (string)this.FindResource("addNewArgumentTitle");
-            this.dgHelper.AddNewRowCommand = DesignerView.CreateArgumentCommand;
-            this.dgHelper.ResolveDynamicTemplateCallback = this.OnResolveDynamicContentTemplate;
-            this.dgHelper.LoadDynamicContentDataCallback = this.OnShowExtendedValueEditor;
-            this.dgHelper.LoadCustomPropertyValueEditorCallback = this.OnLoadExtendedValueEditor;
-
-            this.argumentsDataGrid.SelectionChanged += OnDataGridArgumentSelected;
-            this.argumentsDataGrid.GotFocus += OnDataGridArgumentSelected;
-
-            this.argumentWrapperCollection.CollectionChanged += OnArgumentWrapperCollectionChanged;
-            this.argumentsDataGrid.ItemsSource = this.argumentWrapperCollection;
-
-            this.argumentsDataGrid.LayoutUpdated += OnArgumentDataGridLayoutUpdated;
-        }
-
-        public event RoutedEventHandler ArgumentCollectionChanged
-        {
-            add
-            {
-                AddHandler(ArgumentCollectionChangedEvent, value);
-            }
-            remove
-            {
-                RemoveHandler(ArgumentCollectionChangedEvent, value);
-            }
-        }
-
-
-        public ModelItem ActivitySchema
-        {
-            get { return (ModelItem)GetValue(ActivitySchemaProperty); }
-            set { SetValue(ActivitySchemaProperty, value); }
-        }
-
-        public EditingContext Context
-        {
-            get { return (EditingContext)GetValue(ContextProperty); }
-            set { SetValue(ContextProperty, value); }
-        }
-
-        internal ArgumentToExpressionConverter ArgumentToExpressionConverter
-        {
-            get
-            {
-                if (null == this.argumentToExpressionConverter)
-                {
-                    this.argumentToExpressionConverter = new ArgumentToExpressionConverter();
-                }
-                return this.argumentToExpressionConverter;
-            }
-        }
-
-        public bool CreateNewArgumentWrapper()
-        {
-            bool result = false;
-
-            if (null != this.ActivitySchema)
-            {
-                DynamicActivityProperty property = new DynamicActivityProperty()
-                {
-                    Name = this.GetDefaultName(),
-                    Type = this.GetDefaultType(),
-                };
-                DesignTimeArgument wrapper = null;
-                using (ModelEditingScope scope = this.ActivitySchema.BeginEdit((string)this.FindResource("addNewArgumentDescription")))
-                {
-                    ModelItem argument = this.GetArgumentCollection().Add(property);
-                    wrapper = new DesignTimeArgument(argument, this);
-                    this.argumentWrapperCollection.Add(wrapper);
-                    scope.Complete();
-                    result = true;
-                }
-                this.dgHelper.BeginRowEdit(wrapper);
-            }
-            return result;
-        }
-
-        ModelItemCollection GetArgumentCollection()
-        {
-            if (this.ActivitySchema != null)
-            {
-                Fx.Assert(this.ActivitySchema.Properties[Members] != null, "Members collection not found!");
-                return this.ActivitySchema.Properties[Members].Collection;
-            }
-            return null;
-        }
-
-
-        string GetDefaultName()
-        {
-            ModelItemCollection argumentCollection = this.GetArgumentCollection();
-            return argumentCollection.GetUniqueName(ArgumentDesigner.DefaultArgumentName, (arg) => ((string)arg.Properties["Name"].ComputedValue));
-        }
-
-        Type GetDefaultType()
-        {
-            return typeof(InArgument<string>);
-        }
-
-        void Populate()
-        {
-            if (!this.isCollectionLoaded)
-            {
-                this.argumentsDataGrid.ItemsSource = null;
-                this.argumentWrapperCollection.All(p => { p.Dispose(); return true; });
-                this.argumentWrapperCollection.Clear();
-                ModelItemCollection arguments = this.GetArgumentCollection();
-                if (null != arguments)
-                {
-                    foreach (ModelItem argument in arguments)
-                    {
-                        this.argumentWrapperCollection.Add(new DesignTimeArgument(argument, this));
-                    }
-                }
-                this.argumentsDataGrid.ItemsSource = this.argumentWrapperCollection;
-                this.isCollectionLoaded = true;
-            }
-        }
-
-        void StoreLastSelection()
-        {
-            if (!this.isSelectionChangeInternal)
-            {
-                ModelItem current = this.Context.Items.GetValue<Selection>().PrimarySelection;
-                if (null == current || !typeof(DesignTimeArgument).IsAssignableFrom(current.ItemType))
-                {
-                    this.lastSelection = current;
-                }
-            }
-        }
-
-        void OnArgumentTypeTypePresenterLoaded(object sender, RoutedEventArgs args)
-        {
-            TypePresenter argumentTypeTypePresenter = ((TypePresenter)sender);
-            argumentTypeTypePresenter.Filter = ((DesignTimeArgument)argumentTypeTypePresenter.DataContext).Filter;
-            DataGridHelper.OnEditingControlLoaded(sender, args);
-        }
-
-        void OnArgumentTypeTypePresenterUnloaded(object sender, RoutedEventArgs args)
-        {
-            DataGridHelper.OnEditingControlUnloaded(sender, args);
-        }
-
-        internal void SelectArgument(ModelItem argument)
-        {
-            this.Dispatcher.BeginInvoke(new Action(() =>
-            {
-                foreach (object item in this.argumentsDataGrid.Items)
-                {
-                    if (item is DesignTimeArgument)
-                    {
-                        if (object.ReferenceEquals(((DesignTimeArgument)item).ReflectedObject, argument))
-                        {
-                            this.argumentsDataGrid.SelectedItem = item;
-                            this.argumentsDataGrid.ScrollIntoView(item, null);
-                        }
-                    }
-                }
-            }), DispatcherPriority.ApplicationIdle);
-        }
-
-        void OnDataGridArgumentSelected(object sender, RoutedEventArgs e)
-        {
-            if (null != this.Context && !this.isSelectionChangeInternal)
-            {
-                this.isSelectionChangeInternal = true;
-                DesignTimeArgument argument = this.dgHelper.SelectedItem<DesignTimeArgument>();
-                if (null != argument)
-                {
-                    this.Context.Items.SetValue(new Selection(argument.Content));
-                }
-                else
-                {
-                    // clear arguments in selection
-                    Selection oldSelection = this.Context.Items.GetValue<Selection>();
-                    List<ModelItem> newSelection = new List<ModelItem>();
-                    if (oldSelection != null && oldSelection.SelectionCount > 0)
-                    {
-                        foreach (ModelItem item in oldSelection.SelectedObjects)
-                        {
-                            if (item.ItemType != typeof(DesignTimeArgument))
-                            {
-                                newSelection.Add(item);
-                            }
-                        }
-                    }
-                    this.Context.Items.SetValue(new Selection(newSelection));
-                }
-                this.isSelectionChangeInternal = false;
-            }
-        }
-
-        void OnArgumentDataGridLayoutUpdated(object sender, EventArgs e)
-        {
-            if (this.isDataGridPopulating)
-            {
-                this.isDataGridPopulating = false;
-                Mouse.OverrideCursor = null;
-            }
-        }
-
-        void OnActivitySchemaChanged(ModelItem newSchemaItem)
-        {
-            this.isCollectionLoaded = false;
-
-            if (null != newSchemaItem && null != newSchemaItem.Properties[Members])
-            {
-                //lazy initialization, wait till it is visible
-                if (this.Visibility == Visibility.Visible)
-                {
-                    this.Populate();
-                }
-            }
-        }
-
-        void OnContextChanged()
-        {
-            if (null != this.Context)
-            {
-                this.Context.Items.Subscribe<Selection>(new SubscribeContextCallback<Selection>(OnItemSelected));
-            }
-            this.dgHelper.Context = this.Context;
-        }
-
-        void OnItemSelected(Selection selection)
-        {
-            if (!this.isSelectionChangeInternal)
-            {
-                this.StoreLastSelection();
-
-                bool selectedArgumentIsInSelection = false;
-
-                DesignTimeArgument selectedArgument = this.argumentsDataGrid.SelectedItem as DesignTimeArgument;
-                if (selectedArgument != null)
-                {
-                    foreach (ModelItem item in selection.SelectedObjects)
-                    {
-                        if (object.ReferenceEquals(selectedArgument, item.GetCurrentValue()))
-                        {
-                            selectedArgumentIsInSelection = true;
-                        }
-                    }
-                }
-
-                if (!selectedArgumentIsInSelection)
-                {
-                    this.argumentsDataGrid.SelectedItem = null;
-                }
-            }
-        }
-
-        void OnVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
-        {
-            if (this.Dispatcher.HasShutdownStarted)
-            {
-                return;
-            }
-
-            if ((Boolean)e.NewValue == true)
-            {
-                // Changing cursor as Populate() might take long to run. Cursor will be restored when DataGrid.LayoutUpdated fires.
-                this.isDataGridPopulating = true;
-                Mouse.OverrideCursor = Cursors.Wait;
-
-                this.StoreLastSelection();
-                this.Populate();
-            }
-            else
-            {
-                if (this.argumentsDataGrid.SelectedItem != null)
-                {
-                    // Clear argument selection, if possible, restore last selection.
-                    Selection restoredSelection = null == this.lastSelection ? new Selection() : new Selection(this.lastSelection);
-                    this.isSelectionChangeInternal = true;
-                    this.Context.Items.SetValue(restoredSelection);
-                    this.argumentsDataGrid.SelectedItem = null;
-                    this.isSelectionChangeInternal = false;
-                }
-            }
-        }
-
-        void OnArgumentCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
-        {
-            //we need to track argument collection changes caused by undo/redo stack - 
-            //in such case, we have to add/remove corresponding items from wrapper collection
-            bool isUndoRedoInProgress = this.Context.Services.GetService<UndoEngine>().IsUndoRedoInProgress;
-            if (isUndoRedoInProgress)
-            {
-                switch (e.Action)
-                {
-                    case NotifyCollectionChangedAction.Add:
-                        foreach (ModelItem argument in e.NewItems)
-                        {
-                            var wrapper = this.argumentWrapperCollection
-                                .FirstOrDefault(p => (ModelItem.Equals(p.ReflectedObject, argument)));
-
-                            if (wrapper == null)
-                            {
-                                wrapper = new DesignTimeArgument(argument, this);
-                                this.argumentWrapperCollection.Add(wrapper);
-                            }
-                        }
-                        break;
-
-                    case NotifyCollectionChangedAction.Remove:
-                        foreach (ModelItem argument in e.OldItems)
-                        {
-                            var wrapper = this.argumentWrapperCollection.FirstOrDefault(p => ModelItem.Equals(p.ReflectedObject, argument));
-                            if (null != wrapper)
-                            {
-                                this.argumentWrapperCollection.Remove(wrapper);
-                            }
-                        }
-                        break;
-                }
-            }
-        }
-        void OnArgumentWrapperCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
-        {
-            bool isUndoRedoInProgress = this.Context.Services.GetService<UndoEngine>().IsUndoRedoInProgress;
-            switch (e.Action)
-            {
-                case NotifyCollectionChangedAction.Remove:
-                    foreach (DesignTimeArgument arg in e.OldItems)
-                    {
-                        this.ClearCaseInsensitiveDuplicates(arg.GetArgumentName(), (string)arg.ReflectedObject.Properties["Name"].ComputedValue);
-                        if (!isUndoRedoInProgress)
-                        {
-                            ModelItemCollection collection = (ModelItemCollection)arg.ReflectedObject.Parent;
-                            collection.Remove(arg.ReflectedObject);
-                        }
-                        arg.Dispose();
-                    }
-                    break;
-                case NotifyCollectionChangedAction.Add:
-                    foreach (DesignTimeArgument arg in e.NewItems)
-                    {
-                        this.CheckCaseInsensitiveDuplicates(arg.GetArgumentName(), (string)arg.ReflectedObject.Properties["Name"].ComputedValue);
-                    }
-                    break;
-            }
-        }
-
-        bool OnResolveDynamicContentTemplate(ResolveTemplateParams resolveParams)
-        {
-            var argument = (DesignTimeArgument)resolveParams.Cell.DataContext;
-
-            //get editor associated with variable's value
-            var editorType = argument.GetDynamicPropertyValueEditorType(DesignTimeArgument.ArgumentDefaultValueProperty);
-
-            //if yes there is a custom one - use it
-            if (!typeof(DesignTimeArgument.DefaultValueEditor).IsAssignableFrom(editorType))
-            {
-                //get inline editor template - it will be used for both templates - view and editing; 
-                resolveParams.Template = argument.GetDynamicPropertyValueEditor(DesignTimeArgument.ArgumentDefaultValueProperty).InlineEditorTemplate;
-                resolveParams.IsDefaultTemplate = false;
-            }
-            else
-            {
-                //no custom editor - depending on grid state display either editable or readonly expression template
-                string key = string.Empty;
-                switch (argument.GetArgumentDirection())
-                {
-                    case PropertyKind.Property:
-                        key = resolveParams.Cell.IsEditing ? "argumentPropertyEditableTemplate" : "argumentPropertyReadOnlyTemplate";
-                        break;
-
-                    case PropertyKind.InArgument:
-                        key = resolveParams.Cell.IsEditing ? "argumentExpressionEditableTemplate" : "argumentExpressionReadOnlyTemplate";
-                        break;
-
-                    case PropertyKind.OutArgument:
-                    case PropertyKind.InOutArgument:
-                        key = "argumentOutputValueTemplate";
-                        break;
-                }
-                resolveParams.Template = (DataTemplate)this.FindResource(key);
-                resolveParams.IsDefaultTemplate = true;
-            }
-            return true;
-        }
-
-        DialogPropertyValueEditor OnLoadExtendedValueEditor(DataGridCell cell, object instance)
-        {
-            var argument = (DesignObjectWrapper)cell.DataContext;
-            return argument.GetDynamicPropertyValueEditor(DesignTimeArgument.ArgumentDefaultValueProperty) as DialogPropertyValueEditor;
-        }
-
-        ModelProperty OnShowExtendedValueEditor(DataGridCell cell, object instance)
-        {
-            var argument = (DesignObjectWrapper)cell.DataContext;
-            return argument.Content.Properties[DesignTimeArgument.ArgumentDefaultValueProperty];
-        }
-
-        internal void UpdateTypeDesigner(DesignTimeArgument argument)
-        {
-            this.dgHelper.UpdateDynamicContentColumns(argument);
-        }
-
-        //Check case-insensitive duplicates, which are not allowed in VB expressions 
-        internal void CheckCaseInsensitiveDuplicates(VBIdentifierName identifierName, string newName)
-        {
-            Func<DesignTimeArgument, bool> checkForDuplicates = new Func<DesignTimeArgument, bool>(p => string.Equals((string)p.ReflectedObject.Properties["Name"].ComputedValue, newName, StringComparison.OrdinalIgnoreCase) && !object.Equals(p.GetArgumentName(), identifierName));
-            DesignTimeArgument duplicate = this.argumentWrapperCollection.FirstOrDefault<DesignTimeArgument>(checkForDuplicates);
-            if (duplicate != null)
-            {
-                identifierName.IsValid = false;
-                identifierName.ErrorMessage = string.Format(CultureInfo.CurrentUICulture, SR.DuplicateIdentifier, newName);
-                VBIdentifierName duplicateIdentifier = duplicate.GetArgumentName();
-                if (duplicateIdentifier.IsValid)
-                {
-                    duplicateIdentifier.IsValid = false;
-                    duplicateIdentifier.ErrorMessage = string.Format(CultureInfo.CurrentUICulture, SR.DuplicateIdentifier, duplicateIdentifier.IdentifierName);
-                }
-            };
-        }
-
-        //Check duplicates with old value. When there's only one variable duplicate with the old value, 
-        //the only one variable should be valid now after the change
-        void ClearCaseInsensitiveDuplicates(VBIdentifierName identifier, string oldName)
-        {
-            Func<DesignTimeArgument, bool> checkForOldNameDuplicates = new Func<DesignTimeArgument, bool>(p => string.Equals((string)p.ReflectedObject.Properties["Name"].ComputedValue, oldName, StringComparison.OrdinalIgnoreCase) && !object.Equals(p.GetArgumentName(), identifier));
-            IEnumerable<DesignTimeArgument> oldDuplicates = this.argumentWrapperCollection.Where<DesignTimeArgument>(checkForOldNameDuplicates);
-            if (oldDuplicates.Count<DesignTimeArgument>() == 1)
-            {
-                DesignTimeArgument wrapper = oldDuplicates.First<DesignTimeArgument>();
-                VBIdentifierName oldDuplicate = wrapper.GetArgumentName();
-                oldDuplicate.IsValid = true;
-                oldDuplicate.ErrorMessage = string.Empty;
-            }
-        }
-
-        internal void ValidateArgumentName(VBIdentifierName identifierName, string newName, string oldName)
-        {
-            //Check whether there're any variables' name conflict with the old name which can be cleaned up now
-            this.ClearCaseInsensitiveDuplicates(identifierName, oldName);
-
-            //Check whether there're any duplicates with new name                
-            this.CheckCaseInsensitiveDuplicates(identifierName, newName);
-        }
-
-        static void OnActivitySchemaChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
-        {
-            ModelItem oldItem = e.OldValue as ModelItem;
-            ModelItem newItem = e.NewValue as ModelItem;
-            ArgumentDesigner designer = (ArgumentDesigner)dependencyObject;
-
-            if (null != oldItem && null != oldItem.Properties[Members])
-            {
-                oldItem.Properties[Members].Collection.CollectionChanged -= designer.OnArgumentCollectionChanged;
-            }
-            if (null != newItem && null != newItem.Properties[Members])
-            {
-                newItem.Properties[Members].Collection.CollectionChanged += designer.OnArgumentCollectionChanged;
-            }
-            designer.OnActivitySchemaChanged(newItem);
-        }
-
-        static void OnContextChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
-        {
-            ((ArgumentDesigner)dependencyObject).OnContextChanged();
-        }
-
-        internal void UpdateArgumentName(DesignTimeArgument argumentWrapper, string newName, string oldName)
-        {
-            ModelItemCollection argumentsCollection = this.GetArgumentCollection();
-
-            //Since underlying object is an KeyedCollection, if we only update the property value, it won't update the key
-            //Need to remove the object and add it again to update the key
-            ModelItem argument = argumentWrapper.ReflectedObject;
-            argumentsCollection.Remove(argument);
-            argument.Properties[ArgumentNamePropertyName].SetValue(newName);
-            argumentsCollection.Add(argument);
-            this.ValidateArgumentName(argumentWrapper.GetArgumentName(), newName, oldName);
-
-            //Update default value editor in Argument designer
-            this.UpdateTypeDesigner(argumentWrapper);
-        }
-
-        void OnEditingControlLoaded(object sender, RoutedEventArgs args)
-        {
-            DataGridHelper.OnEditingControlLoaded(sender, args);
-        }
-
-        void OnEditingControlUnloaded(object sender, RoutedEventArgs args)
-        {
-            DataGridHelper.OnEditingControlUnloaded(sender, args);
-        }
-
-        // This is to workaround a bug that updating ModelItem from outside of ArgumentDesigner will not update ArgumentDesigner.
-        internal void NotifyAnnotationTextChanged()
-        {
-            foreach (object item in this.argumentsDataGrid.Items)
-            {
-                DesignTimeArgument designTimeArgument = item as DesignTimeArgument;
-                if (designTimeArgument != null)
-                {
-                    designTimeArgument.NotifyPropertyChanged(DesignTimeArgument.AnnotationTextProperty);
-                }
-            }
-        }
-
-        protected override void OnContextMenuOpening(ContextMenuEventArgs e)
-        {
-            base.OnContextMenuOpening(e);
-
-            DesignerConfigurationService configurationService = this.Context.Services.GetService<DesignerConfigurationService>();
-            Fx.Assert(configurationService != null, "DesignerConfigurationService should not be null");
-            if (configurationService.WorkflowDesignerHostId == WorkflowDesignerHostId.Dev10)
-            {
-                return;
-            }
-
-            e.Handled = true;
-
-            bool openedByKeyboard = e.CursorLeft < 0 && e.CursorTop < 0;
-
-            if (openedByKeyboard)
-            {
-                this.ContextMenu.Placement = PlacementMode.Center;
-            }
-            else
-            {
-                this.ContextMenu.Placement = PlacementMode.MousePoint;
-            }
-            this.ContextMenu.PlacementTarget = this;
-            this.ContextMenu.IsOpen = true;
-        }
-
-        private void OnDeleteCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnDeleteCommandCanExecute(e, this.argumentsDataGrid);
-        }
-
-        private void OnDeleteCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            if (this.argumentsDataGrid != null && this.argumentsDataGrid.SelectedItems != null && this.argumentsDataGrid.SelectedItems.Count > 0)
-            {
-                List<ModelItem> list = new List<ModelItem>();
-                foreach (object item in this.argumentsDataGrid.SelectedItems)
-                {
-                    DesignTimeArgument designTimeArgument = item as DesignTimeArgument;
-                    if (designTimeArgument != null)
-                    {
-                        list.Add(designTimeArgument.ReflectedObject);
-                    }
-                }
-
-                foreach (ModelItem modelItem in list)
-                {
-                    foreach (DesignTimeArgument designTimeArgument in this.argumentWrapperCollection)
-                    {
-                        if (designTimeArgument.ReflectedObject == modelItem)
-                        {
-                            this.argumentWrapperCollection.Remove(designTimeArgument);
-                            break;
-                        }
-                    }
-                }
-            }
-
-            e.Handled = true;
-        }
-
-        private void OnAnnotationSeparatorLoaded(object sender, RoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnAnnotationMenuLoaded(this.Context, (Control)sender, e);
-        }
-
-        private void OnAddAnnotationMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnAnnotationMenuLoaded(this.Context, (Control)sender, e);
-        }
-
-        private void OnAddAnnotationCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnAddAnnotationCommandCanExecute(e, this.Context, this.argumentsDataGrid);
-        }
-
-        private void OnAddAnnotationCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            if (this.argumentsDataGrid != null && this.argumentsDataGrid.SelectedItems != null && this.argumentsDataGrid.SelectedItems.Count == 1)
-            {
-                AnnotationDialog dialog = new AnnotationDialog();
-                dialog.Context = Context;
-                dialog.Title = SR.AddAnnotationTitle;
-
-                WindowHelperService service = this.Context.Services.GetService<WindowHelperService>();
-                if (null != service)
-                {
-                    service.TrySetWindowOwner(this, dialog);
-                }
-                dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen;
-
-                if (dialog.ShowDialog() == true)
-                {
-                    string annotationText = dialog.AnnotationText;
-
-                    DesignTimeArgument variable = (DesignTimeArgument)this.argumentsDataGrid.SelectedItems[0];
-                    variable.Content.Properties[DesignTimeArgument.AnnotationTextProperty].SetValue(annotationText);
-                }
-            }
-
-            e.Handled = true;
-        }
-
-        private void OnEditAnnotationMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnAnnotationMenuLoaded(this.Context, (Control)sender, e);
-        }
-
-        private void OnEditAnnotationCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            // call the same method as delete annotation command
-            ContextMenuUtilities.OnDeleteAnnotationCommandCanExecute(e, this.Context, this.argumentsDataGrid);
-        }
-
-        private void OnEditAnnotationCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            if (this.argumentsDataGrid != null && this.argumentsDataGrid.SelectedItems != null && this.argumentsDataGrid.SelectedItems.Count == 1)
-            {
-                DesignTimeArgument variable = (DesignTimeArgument)this.argumentsDataGrid.SelectedItems[0];
-
-                AnnotationDialog dialog = new AnnotationDialog();
-                dialog.Context = Context;
-                dialog.Title = SR.EditAnnotationTitle;
-                dialog.AnnotationText = variable.Content.Properties[DesignTimeArgument.AnnotationTextProperty].ComputedValue as string;
-
-                WindowHelperService service = this.Context.Services.GetService<WindowHelperService>();
-                if (null != service)
-                {
-                    service.TrySetWindowOwner(this, dialog);
-                }
-                dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen;
-
-                if (dialog.ShowDialog() == true)
-                {
-                    string annotationText = dialog.AnnotationText;
-
-                    variable.Content.Properties[DesignTimeArgument.AnnotationTextProperty].SetValue(annotationText);
-                }
-            }
-        }
-
-        private void OnDeleteAnnotationMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnAnnotationMenuLoaded(this.Context, (Control)sender, e);
-        }
-
-        private void OnDeleteAnnotationCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnDeleteAnnotationCommandCanExecute(e, this.Context, this.argumentsDataGrid);
-        }
-
-        private void OnDeleteAnnotationCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            if (this.argumentsDataGrid != null && this.argumentsDataGrid.SelectedItems != null && this.argumentsDataGrid.SelectedItems.Count == 1)
-            {
-                DesignTimeArgument variable = (DesignTimeArgument)this.argumentsDataGrid.SelectedItems[0];
-                variable.Content.Properties[DesignTimeArgument.AnnotationTextProperty].ClearValue();
-            }
-
-            e.Handled = true;
-        }
-    }
-
-    sealed class DesignTimeArgument : DesignObjectWrapper
-    {
-        internal static readonly string ArgumentNameProperty = "Name";
-        internal static readonly string ArgumentTypeProperty = "ArgumentType";
-        internal static readonly string ArgumentDirectionProperty = "Direction";
-        internal static readonly string ArgumentDefaultValueProperty = "Value";
-        internal static readonly string IsOutputArgument = "IsOutputArgument";
-        internal static readonly string OwnerSchemaProperty = "OwnerActivitySchemaType";
-        internal static readonly string IsRequiredProperty = "IsRequired";
-        internal static readonly string AnnotationTextProperty = "DesignTimeArgumentAnnotationText";
-
-        static readonly string[] Properties =
-            new string[] { ArgumentNameProperty, ArgumentTypeProperty, ArgumentDirectionProperty, ArgumentDefaultValueProperty, IsOutputArgument, OwnerSchemaProperty, IsRequiredProperty };
-
-        static readonly Type inArgumentTypeReference = typeof(InArgument);
-        static readonly Type outArgumentTypeReference = typeof(OutArgument);
-        static readonly Type inOutArgumentTypeReference = typeof(InOutArgument);
-        static readonly Type stringTypeReference = typeof(string);
-        static readonly XamlSchemaContext xamlContext = new XamlSchemaContext();
-        static readonly XamlType xamlType = new XamlType(typeof(string), xamlContext);
-        bool argumentExpressionChanged = false;
-        VBIdentifierName identifierName;
-
-        public DesignTimeArgument()
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException(SR.InvalidConstructorCall));
-        }
-
-        internal DesignTimeArgument(ModelItem argument, ArgumentDesigner editor)
-            : base(argument)
-        {
-            this.Editor = editor;
-            this.ReflectedObject.Properties["Attributes"].Collection.CollectionChanged += new NotifyCollectionChangedEventHandler(OnAttributesChanged);
-            this.identifierName = new VBIdentifierName(true)
-            {
-                IdentifierName = (string)argument.Properties[ArgumentNameProperty].ComputedValue
-            };
-        }
-
-        void OnAttributesChanged(object sender, NotifyCollectionChangedEventArgs e)
-        {
-            this.RaisePropertyChangedEvent(IsRequiredProperty);
-        }
-
-        public override void Dispose()
-        {
-            this.ReflectedObject.Properties["Attributes"].Collection.CollectionChanged -= new NotifyCollectionChangedEventHandler(OnAttributesChanged);
-            base.Dispose();
-        }
-
-        #region Initialize type properties code
-        public static PropertyDescriptorData[] InitializeTypeProperties()
-        {
-            return new PropertyDescriptorData[]
-            {
-                new PropertyDescriptorData()
-                {
-                    PropertyName = ArgumentNameProperty,
-                    PropertyType = typeof(VBIdentifierName),
-                    PropertyAttributes = TypeDescriptor.GetAttributes(typeof(VBIdentifierName)).OfType<Attribute>().ToArray(),
-                    PropertySetter = (instance, newValue) =>
-                        {
-                            ((DesignTimeArgument)instance).SetArgumentName((VBIdentifierName)newValue);
-                        },
-                    PropertyGetter = (instance) => (((DesignTimeArgument)instance).GetArgumentName()),
-                    PropertyValidator  = (instance, value, errors) => (((DesignTimeArgument)instance).ValidateArgumentName(value, errors))
-                },
-                new PropertyDescriptorData()
-                {
-                    PropertyName = ArgumentTypeProperty,
-                    PropertyType = typeof(Type),
-                    PropertyAttributes = TypeDescriptor.GetAttributes(typeof(Type)).OfType<Attribute>().ToArray(),
-                    PropertySetter = (instance, newValue) =>
-                        {
-                            ((DesignTimeArgument)instance).SetArgumentType((Type)newValue);
-                        },
-                    PropertyGetter = (instance) => (((DesignTimeArgument)instance).GetArgumentType()),
-                    PropertyValidator = null
-                },
-                new PropertyDescriptorData()
-                {
-                    PropertyName = ArgumentDirectionProperty,
-                    PropertyType = typeof(PropertyKind),
-                    PropertyAttributes = TypeDescriptor.GetAttributes(typeof(PropertyKind)).OfType<Attribute>().Union( new Attribute[] { new EditorAttribute(typeof(DirectionPropertyEditor), typeof(PropertyValueEditor)) }).ToArray(),
-                    PropertySetter = (instance, newValue) =>
-                        {
-                            ((DesignTimeArgument)instance).SetArgumentDirection((PropertyKind)newValue);
-                        },
-                    PropertyGetter = (instance) => (((DesignTimeArgument)instance).GetArgumentDirection()),
-                    PropertyValidator  = null
-                },
-                new PropertyDescriptorData()
-                {
-                    PropertyName = ArgumentDefaultValueProperty,
-                    PropertyType = typeof(object),
-                    PropertyAttributes = TypeDescriptor.GetAttributes(typeof(Activity)).OfType<Attribute>().Union(new Attribute[] { new EditorAttribute(typeof(DesignObjectWrapperDynamicPropertyEditor), typeof(PropertyValueEditor)), new EditorReuseAttribute(false) }).ToArray(),
-                    PropertySetter = (instance, newValue) =>
-                        {
-                            ((DesignTimeArgument)instance).SetArgumentValue(newValue);
-                        },
-                    PropertyGetter = (instance) => (((DesignTimeArgument)instance).GetArgumentValue()),
-                    PropertyValidator  = (instance, value, errors) => (((DesignTimeArgument)instance).ValidateArgumentValue(value, errors)),
-                },
-                new PropertyDescriptorData()
-                {
-                    PropertyName = IsOutputArgument,
-                    PropertyType = typeof(bool),
-                    PropertyAttributes = new Attribute[] { BrowsableAttribute.No },
-                    PropertyGetter = (instance) => (((DesignTimeArgument)instance).GetIsOutputArgument()), 
-                    PropertyValidator = null,
-                },
-                new PropertyDescriptorData()
-                {
-                    PropertyName = OwnerSchemaProperty,
-                    PropertyType = typeof(ModelItem),
-                    PropertyAttributes = new Attribute[] { BrowsableAttribute.No },
-                    PropertyGetter = (instance) => (((DesignTimeArgument)instance).GetOwnerSchemaProperty()),
-                },
-                new PropertyDescriptorData()
-                {
-                    PropertyName = IsRequiredProperty,
-                    PropertyType = typeof(bool),
-                    PropertyAttributes = TypeDescriptor.GetAttributes(typeof(bool)).OfType<Attribute>().Union(
-                        new Attribute[] 
-                        { 
-                            new EditorAttribute(typeof(IsRequiredPropertyEditor), typeof(PropertyValueEditor)), 
-                            new EditorReuseAttribute(false) 
-                        }
-                    ).ToArray(),
-                    PropertySetter = (instance, newValue) =>
-                    {
-                        ((DesignTimeArgument)instance).SetIsRequired(newValue);
-                    },
-                    PropertyValidator = null,
-                    PropertyGetter = (instance) =>
-                    {
-                        return ((DesignTimeArgument)instance).GetIsRequired();
-                    }
-                },
-                new PropertyDescriptorData()
-                {
-                    PropertyName = AnnotationTextProperty,
-                    PropertyType = typeof(string),
-                    PropertyAttributes = new Attribute[] { BrowsableAttribute.No },
-                    PropertySetter = (instance, newValue) =>
-                        {
-                            ((DesignTimeArgument)instance).SetAnnotationText(newValue);
-                        },
-                    PropertyValidator = null,
-                    PropertyGetter = (instance) =>
-                        {
-                            return ((DesignTimeArgument)instance).GetAnnotationText();
-                        }
-                },
-            };
-        }
-        #endregion
-
-        internal ArgumentDesigner Editor { get; private set; }
-
-        protected override string AutomationId
-        {
-            get
-            {
-                return this.GetArgumentNameString();
-            }
-        }
-
-        internal VBIdentifierName GetArgumentName()
-        {
-            return this.identifierName;
-        }
-
-        string GetArgumentNameString()
-        {
-            return (string)this.ReflectedObject.Properties[ArgumentNameProperty].ComputedValue;
-        }
-
-        // For screen reader to read the DataGrid row.
-        public override string ToString()
-        {
-            string name = this.GetArgumentNameString();
-            if (!string.IsNullOrEmpty(name))
-            {
-                return name;
-            }
-            return "Argument";
-        }
-
-        object GetAnnotationText()
-        {
-            ModelProperty property = this.ReflectedObject.Properties.Find(Annotation.AnnotationTextPropertyName);
-
-            if (property != null)
-            {
-                return property.ComputedValue;
-            }
-            else
-            {
-                return null;
-            }
-        }
-
-        void SetAnnotationText(object annotationText)
-        {
-            ModelProperty property = this.ReflectedObject.Properties.Find(Annotation.AnnotationTextPropertyName);
-
-            if (property != null)
-            {
-                property.SetValue(annotationText);
-            }
-        }
-
-        void SetArgumentName(VBIdentifierName identifierName)
-        {
-            using (ModelEditingScope scope = this.ReflectedObject.BeginEdit((string)this.Editor.FindResource("changeArgumentNameDescription")))
-            {
-                this.identifierName = identifierName;
-                string name = identifierName.IdentifierName;
-                this.Editor.UpdateArgumentName(this, name, (string)this.ReflectedObject.Properties[ArgumentNameProperty].ComputedValue);
-
-                scope.Complete();
-            }
-        }
-
-        internal Type GetArgumentType()
-        {
-            Type result = (Type)this.ReflectedObject.Properties["Type"].ComputedValue;
-            if (this.GetArgumentDirection() != PropertyKind.Property)
-            {
-                result = result.GetGenericArguments()[0];
-            }
-            return result;
-        }
-
-        void SetArgumentType(Type type)
-        {
-            using (ModelEditingScope scope = this.ReflectedObject.BeginEdit((string)this.Editor.FindResource("changeArgumentTypeDescription")))
-            {
-                PropertyKind currentDirection = this.GetArgumentDirection();
-                Type propertyType = GetTypeReference(currentDirection, type);
-                this.ReflectedObject.Properties["Type"].SetValue(propertyType);
-                this.TryUpdateArgumentType(type, currentDirection);
-                ImportDesigner.AddImport(type.Namespace, this.Context);
-                scope.Complete();
-            }
-        }
-
-        internal PropertyKind GetArgumentDirection()
-        {
-            PropertyKind result = PropertyKind.Property;
-            Type argumentType = (Type)this.ReflectedObject.Properties["Type"].ComputedValue;
-            if (inArgumentTypeReference.IsAssignableFrom(argumentType) && argumentType.IsGenericType)
-            {
-                result = PropertyKind.InArgument;
-            }
-            else if (outArgumentTypeReference.IsAssignableFrom(argumentType) && argumentType.IsGenericType)
-            {
-                result = PropertyKind.OutArgument;
-            }
-            else if (inOutArgumentTypeReference.IsAssignableFrom(argumentType) && argumentType.IsGenericType)
-            {
-                result = PropertyKind.InOutArgument;
-            }
-            return result;
-        }
-
-        void SetArgumentDirection(PropertyKind direction)
-        {
-            using (ModelEditingScope scope = this.ReflectedObject.BeginEdit((string)this.Editor.FindResource("changeArgumentDirectionDescription")))
-            {
-                Type currentType = this.GetArgumentType();
-                Type propertyType = GetTypeReference(direction, currentType);
-                this.ReflectedObject.Properties["Type"].SetValue(propertyType);
-                this.TryUpdateArgumentType(currentType, direction);
-                if (direction == PropertyKind.Property)
-                {
-                    this.SetIsRequired(false);
-                }
-                scope.Complete();
-            }
-        }
-
-        Type GetTypeReference(PropertyKind direction, Type type)
-        {
-            Type targetType = null;
-            switch (direction)
-            {
-                case PropertyKind.InArgument:
-                    targetType = typeof(InArgument<>).MakeGenericType(type);
-                    break;
-
-                case PropertyKind.OutArgument:
-                    targetType = typeof(OutArgument<>).MakeGenericType(type);
-                    break;
-
-                case PropertyKind.InOutArgument:
-                    targetType = typeof(InOutArgument<>).MakeGenericType(type);
-                    break;
-
-                case PropertyKind.Property:
-                    targetType = type;
-                    break;
-
-                default:
-                    throw FxTrace.Exception.AsError(new NotSupportedException(direction.ToString()));
-            }
-            return targetType;
-        }
-
-        void SetArgumentValue(object value)
-        {
-            this.argumentExpressionChanged = true;
-            if (PropertyKind.Property == this.GetArgumentDirection())
-            {
-                //handle empty string - reset the value
-                if (this.GetArgumentType() != typeof(string) && value is string && string.IsNullOrEmpty((string)value))
-                {
-                    value = null;
-                }
-                //handle conversion if needed
-                else if (null != value && !this.GetArgumentType().IsAssignableFrom(value.GetType()))
-                {
-                    TypeConverter converter = TypeDescriptor.GetConverter(this.GetArgumentType());
-                    if (converter.CanConvertFrom(value.GetType()))
-                    {
-                        value = converter.ConvertFrom(value);
-                    }
-                    else
-                    {
-                        value = null;
-                    }
-                }
-                //else: leave value as is
-            }
-            else
-            {
-                if (null != value)
-                {
-                    string direction = null;
-                    switch (this.GetArgumentDirection())
-                    {
-                        case PropertyKind.InArgument:
-                            direction = ArgumentDirection.In.ToString();
-                            break;
-
-                        case PropertyKind.OutArgument:
-                            direction = ArgumentDirection.Out.ToString();
-                            break;
-
-                        case PropertyKind.InOutArgument:
-                            direction = ArgumentDirection.InOut.ToString();
-                            break;
-
-                        default:
-                            throw FxTrace.Exception.AsError(new NotSupportedException(string.Format(CultureInfo.CurrentCulture, "{0} argument direction is not supported", this.GetArgumentDirection())));
-                    }
-                    value = this.Editor.ArgumentToExpressionConverter.ConvertBack(value, typeof(Argument), direction, CultureInfo.CurrentCulture);
-                }
-            }
-            this.ReflectedObject.Properties[DesignTimeArgument.ArgumentDefaultValueProperty].SetValue(value);
-        }
-
-        internal object GetArgumentValue()
-        {
-            ModelItem value = this.ReflectedObject.Properties[DesignTimeArgument.ArgumentDefaultValueProperty].Value;
-            object result = null;
-            if (PropertyKind.Property == this.GetArgumentDirection())
-            {
-                if (null != value)
-                {
-                    result = value.GetCurrentValue();
-                }
-            }
-            else
-            {
-                result = this.Editor.ArgumentToExpressionConverter.Convert(value, typeof(object), null, CultureInfo.CurrentCulture);
-                ModelItem expression = result as ModelItem;
-                if (null != expression)
-                {
-                    result = expression.GetCurrentValue();
-                }
-            }
-            return result;
-        }
-
-        bool GetIsOutputArgument()
-        {
-            PropertyKind direction = this.GetArgumentDirection();
-            return (direction == PropertyKind.OutArgument || direction == PropertyKind.InOutArgument);
-        }
-
-        bool IsRequired(IList attributes)
-        {
-            if (attributes == null)
-            {
-                return false;
-            }
-            foreach (ModelItem item in attributes)
-            {
-                if (typeof(RequiredArgumentAttribute).IsAssignableFrom(item.ItemType))
-                {
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        bool GetIsRequired()
-        {
-            ModelItemCollection attributes = this.ReflectedObject.Properties["Attributes"].Collection;
-            return IsRequired(attributes);
-        }
-
-        void AddIsRequiredAttribute()
-        {
-            ModelItemCollection attributes = this.ReflectedObject.Properties["Attributes"].Collection;
-            using (ModelEditingScope scope = this.ReflectedObject.BeginEdit((string)this.Editor.FindResource("changeArgumentIsRequiredDescription")))
-            {
-                attributes.Add(new RequiredArgumentAttribute());
-                scope.Complete();
-            }
-        }
-
-        void RemoveIsRequiredAttribute()
-        {
-            ModelItemCollection attributes = this.ReflectedObject.Properties["Attributes"].Collection;
-            using (ModelEditingScope scope = this.ReflectedObject.BeginEdit((string)this.Editor.FindResource("changeArgumentIsRequiredDescription")))
-            {
-                foreach (ModelItem toRemove in attributes.Where<ModelItem>(p => typeof(RequiredArgumentAttribute).IsAssignableFrom(p.ItemType)))
-                {
-                    attributes.Remove(toRemove);
-                }
-                scope.Complete();
-            }
-        }
-
-        void SetIsRequired(object isRequired)
-        {
-            bool required = isRequired is ModelItem ? (bool)(((ModelItem)isRequired).GetCurrentValue()) : (bool)isRequired;
-
-            if (required && !this.GetIsRequired())
-            {
-                this.AddIsRequiredAttribute();
-            }
-            else if (!required && this.GetIsRequired())
-            {
-                this.RemoveIsRequiredAttribute();
-            }
-        }
-
-        internal bool Filter(Type type)
-        {
-            // We disallow user to pick any Argument<T> type as a property since this is the same as choosing the right direction in the first place.
-            return this.GetArgumentDirection() != PropertyKind.Property || !type.IsGenericType || !typeof(Argument).IsAssignableFrom(type);
-        }
-
-        internal ModelItem GetOwnerSchemaProperty()
-        {
-            return this.ReflectedObject.Parent.Parent;
-        }
-
-        protected override Type OnGetDynamicPropertyValueEditorType(string propertyName)
-        {
-            var type = this.GetArgumentType();
-            var direction = this.GetArgumentDirection();
-
-            //if argument name is not valid XAML member name, default value editing is disabled.
-            //Since it cannot be saved.
-            if (!VBIdentifierName.IsValidXamlName(this.GetArgumentName().IdentifierName))
-            {
-                return typeof(InvalidXamlMemberValueEditor);
-            }
-
-            //in case of arguments which contain handles - display HandleValueEditor
-            if (typeof(Handle).IsAssignableFrom(type))
-            {
-                return typeof(HandleValueEditor);
-            }
-
-
-            //check if there are custom editors on the variable's type
-            Type argumentType = null;
-            switch (direction)
-            {
-                case PropertyKind.InArgument:
-                    argumentType = typeof(InArgument<>).MakeGenericType(type);
-                    break;
-
-                case PropertyKind.InOutArgument:
-                    argumentType = typeof(InOutArgument<>).MakeGenericType(type);
-                    break;
-
-                case PropertyKind.OutArgument:
-                    argumentType = typeof(OutArgument<>).MakeGenericType(type);
-                    break;
-
-                default:
-                    argumentType = type;
-                    break;
-            }
-
-            var referenceType = typeof(PropertyValueEditor);
-            var expressionEditorType = typeof(ExpressionValueEditor);
-
-            //check if there are custom type editors associated with given type - 
-            //first look for type editor defined for In/Out/InOut/Argument<T> (if argument is of proper direction)
-            //then, look for type editor defined for type itself (i.e. T) - 
-            //in search, skip ExpressionValueEditor instance - it will be returned by default for property grid, but for
-            //dataGrid nothing should be used - we use default dg template
-            var customEditorType = TypeDescriptor
-                .GetAttributes(argumentType)
-                .OfType<EditorAttribute>()
-                .Where(p =>
-                    {
-                        Type currentType = Type.GetType(p.EditorTypeName);
-                        return (expressionEditorType != currentType && referenceType.IsAssignableFrom(currentType));
-                    })
-                .Select(p => Type.GetType(p.EditorTypeName))
-                .FirstOrDefault();
-
-            //if yes - check if there is at least one editor assigner and it derives from PropertyValueEditor 
-            if (null != customEditorType)
-            {
-                return customEditorType;
-            }
-
-            TypeConverter converter = TypeDescriptor.GetConverter(type);
-            if (((type != stringTypeReference && (converter == null || !converter.CanConvertFrom(stringTypeReference))) && direction == PropertyKind.Property)
-                || direction == PropertyKind.OutArgument || direction == PropertyKind.InOutArgument)
-            {
-                return typeof(ValueNotSupportedEditor);
-            }
-
-            //otherwise - return default expression value editor
-            return typeof(DefaultValueEditor);
-        }
-
-        internal bool ValidateArgumentName(object value, List<string> errors)
-        {
-            VBIdentifierName identifier = value as VBIdentifierName;
-            string name = identifier.IdentifierName;
-
-            if (string.IsNullOrEmpty(name))
-            {
-                errors.Add(SR.EmptyArgumentName);
-            }
-            else
-            {
-                if (!VBIdentifierName.IsValidXamlName(name))
-                {
-                    errors.Add(string.Format(CultureInfo.CurrentUICulture, SR.InvalidXamlMemberName, name));
-                }
-                else
-                {
-                    ModelItemCollection argumentCollection = (ModelItemCollection)this.ReflectedObject.Parent;
-
-                    bool duplicates =
-                        argumentCollection.Any<ModelItem>(p => string.Equals(p.Properties["Name"].ComputedValue, name) && !ModelItem.Equals(p, this.ReflectedObject));
-
-                    if (duplicates)
-                    {
-                        errors.Add(string.Format(CultureInfo.CurrentUICulture, SR.DuplicateArgumentName, name));
-                    }
-                }
-            }
-            return 0 == errors.Count;
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.DoNotCatchGeneralExceptionTypes,
-            Justification = "Exception content is displayed as error message. Propagating exceptions might lead to VS crash.")]
-        [SuppressMessage("Reliability", "Reliability108",
-            Justification = "Exception content is displayed as error message. Propagating exceptions might lead to VS crash.")]
-        bool ValidateArgumentValue(object value, List<string> errors)
-        {
-            if (PropertyKind.Property == this.GetArgumentDirection())
-            {
-                //the value is a string and is empty - assume user wants to clear the property value
-                if (value is string && string.IsNullOrEmpty((string)value))
-                {
-                    return true;
-                }
-                //validate the value for PropertyType - check if converter usage is required - if value type is the same as argument type - skip conversion
-                if (null != value && !this.GetArgumentType().IsAssignableFrom(value.GetType()))
-                {
-                    try
-                    {
-                        TypeConverter converter = TypeDescriptor.GetConverter(this.GetArgumentType());
-                        converter.ConvertFrom(value);
-                    }
-                    catch (Exception err)
-                    {
-                        errors.Add(err.Message);
-                    }
-                }
-            }
-            return 0 == errors.Count;
-        }
-
-        string GetArgumentValueExpressionText()
-        {
-            string currentExpressionText = null;
-            object currentValue = this.GetArgumentValue();
-            if (null != currentValue)
-            {
-                if (this.GetArgumentDirection() == PropertyKind.Property)
-                {
-                    TypeConverter oldConverter = TypeDescriptor.GetConverter(this.GetArgumentType());
-
-                    if (oldConverter.CanConvertTo(typeof(string)))
-                    {
-                        currentExpressionText = (string)oldConverter.ConvertTo(currentValue, typeof(string));
-                    }
-                }
-                else
-                {
-                    ModelItem expression = null;
-                    if (this.ReflectedObject.TryGetPropertyValue(out expression, ArgumentDefaultValueProperty, "Expression") && null != expression)
-                    {
-                        var activity = expression.GetCurrentValue() as ActivityWithResult;
-                        if (null != activity)
-                        {
-                            currentExpressionText = ExpressionHelper.GetExpressionString(activity);
-                        }
-                    }
-                }
-            }
-            return currentExpressionText;
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.DoNotCatchGeneralExceptionTypes,
-            Justification = "Conversion of value when type changes might fail - argument will get null value by default. Propagating exceptions might lead to VS crash.")]
-        [SuppressMessage("Reliability", "Reliability108",
-            Justification = "Conversion of value when type changes might fail - argument will get null value by default. Propagating exceptions might lead to VS crash.")]
-        void TryUpdateArgumentType(Type newType, PropertyKind newDirection)
-        {
-            if (newDirection == PropertyKind.Property)
-            {
-                string currentExpressionText = this.GetArgumentValueExpressionText();
-                if (null != currentExpressionText)
-                {
-                    TypeConverter converter = TypeDescriptor.GetConverter(newType);
-                    if (converter.CanConvertFrom(typeof(string)))
-                    {
-                        try
-                        {
-                            object value = converter.ConvertFrom(currentExpressionText);
-                            this.ReflectedObject.Properties[ArgumentDefaultValueProperty].SetValue(value);
-                        }
-                        catch (Exception err)
-                        {
-                            System.Diagnostics.Debug.WriteLine(err.ToString());
-                            this.ReflectedObject.Properties[ArgumentDefaultValueProperty].ClearValue();
-                        }
-                    }
-                    else
-                    {
-                        this.ReflectedObject.Properties[ArgumentDefaultValueProperty].ClearValue();
-                    }
-                }
-                else
-                {
-                    this.ReflectedObject.Properties[ArgumentDefaultValueProperty].ClearValue();
-                }
-            }
-            else if (newDirection == PropertyKind.InArgument)
-            {
-                Argument currentArgument = this.ReflectedObject.Properties[ArgumentDefaultValueProperty].ComputedValue as Argument;
-                ActivityWithResult newExpression = null;
-                bool succeeded = false;
-                if (currentArgument != null)
-                {
-                    succeeded = ExpressionHelper.TryMorphExpression(currentArgument.Expression, false, newType, this.Context, out newExpression);
-                }                                 
-                else
-                {
-                    ////If the old direction is property, we'll try to convert the default value object to the expression object specified by global editor setting
-                    string currentExpressionText = this.GetArgumentValueExpressionText();
-                    if (!string.IsNullOrEmpty(currentExpressionText))
-                    {                        
-                        string rootEditorSetting = ExpressionHelper.GetRootEditorSetting(this.ModelTreeManager, WorkflowDesigner.GetTargetFramework(this.Context));
-                        if (!string.IsNullOrEmpty(rootEditorSetting))
-                        {
-                            succeeded = ExpressionTextBox.TryConvertFromString(rootEditorSetting, currentExpressionText, false, newType, out newExpression);
-                        }
-                    }
-                }
-
-                if (succeeded)
-                {
-                    Argument newArgument = Argument.Create(newType, ArgumentDirection.In);
-                    newArgument.Expression = newExpression;
-                    this.ReflectedObject.Properties[ArgumentDefaultValueProperty].SetValue(newArgument);
-                }
-                else
-                {
-                    //currently if the value cannot be morphed, it's cleared.
-                    this.ReflectedObject.Properties[ArgumentDefaultValueProperty].ClearValue();
-                }
-            }
-            else
-            {
-                this.ReflectedObject.Properties[ArgumentDefaultValueProperty].ClearValue();
-            }
-        }
-
-        protected override void OnReflectedObjectPropertyChanged(string propertyName)
-        {
-            if (string.Equals(propertyName, "Type"))
-            {
-                //type has changed - most likely custom value editors collection would be obsolete                
-                this.RaisePropertyChangedEvent(ArgumentTypeProperty);
-                this.RaisePropertyChangedEvent(ArgumentDirectionProperty);
-                this.RaisePropertyChangedEvent(IsOutputArgument);
-                this.RaisePropertyChangedEvent(ArgumentDefaultValueProperty);
-            }
-            else if (propertyName == ArgumentNameProperty)
-            {
-                //Change name may need to update the defaul value editor as well, so clean the cache                
-                string oldValue = this.identifierName.IdentifierName;
-                string newValue = GetArgumentNameString();
-
-                //This is invoked in undo stack
-                if (oldValue != newValue)
-                {
-                    this.identifierName = new VBIdentifierName(true)
-                    {
-                        IdentifierName = newValue
-                    };
-                    Editor.ValidateArgumentName(this.identifierName, newValue, oldValue);
-                }
-            }
-            else if (propertyName == ArgumentDefaultValueProperty)
-            {
-                this.argumentExpressionChanged = true;
-            }
-            else if (propertyName == Annotation.AnnotationTextPropertyName)
-            {
-                RaisePropertyChangedEvent(AnnotationTextProperty);
-            }
-        }
-
-        protected override void OnPropertyChanged(string propertyName)
-        {
-            if (string.Equals(propertyName, ArgumentNameProperty))
-            {
-                this.RaisePropertyChangedEvent(AutomationIdProperty);
-            }
-            else if (string.Equals(propertyName, TimestampProperty))
-            {
-                if ((!this.argumentExpressionChanged) && (this.Editor != null))
-                {
-                    this.CustomValueEditors.Clear();
-                    this.Editor.UpdateTypeDesigner(this);
-                }
-                else
-                {
-                    this.argumentExpressionChanged = false;
-                }
-            }
-            else if (string.Equals(propertyName, ArgumentDirectionProperty) || (string.Equals(propertyName, ArgumentTypeProperty)))
-            {
-                this.RaisePropertyChangedEvent(ArgumentDefaultValueProperty);
-            }
-            base.OnPropertyChanged(propertyName);
-        }
-
-        internal sealed class DirectionPropertyEditor : PropertyValueEditor
-        {
-            public DirectionPropertyEditor()
-            {
-                this.InlineEditorTemplate = EditorResources.GetResources()["DirectionEditor_InlineEditorTemplate"] as DataTemplate;
-            }
-        }
-
-        internal sealed class DefaultValueEditor : ExpressionValueEditor
-        {
-            public DefaultValueEditor()
-            {
-                this.InlineEditorTemplate = EditorResources.GetResources()["inlineExpressionEditorTemplateForDesignTimeArgument"] as DataTemplate;
-            }
-        }
-
-        internal sealed class IsRequiredPropertyEditor : PropertyValueEditor
-        {
-            public IsRequiredPropertyEditor()
-            {
-                this.InlineEditorTemplate = EditorResources.GetResources()["IsRequiredPropertyEditor_InlineEditorTemplate"] as DataTemplate;
-            }
-        }
-
-        internal sealed class ValueNotSupportedEditor : PropertyValueEditor
-        {
-            public ValueNotSupportedEditor()
-            {
-                this.InlineEditorTemplate = EditorResources.GetResources()["inlineExpressionEditorTemplateForDesignTimeArgument_ValueNotSupported"] as DataTemplate;
-            }
-        }
-
-        internal sealed class InvalidXamlMemberValueEditor : PropertyValueEditor
-        {
-            public InvalidXamlMemberValueEditor()
-            {
-                this.InlineEditorTemplate = EditorResources.GetResources()["inlineExpressionEditorTemplateForDesignTimeArgument_InvalidXamlMember"] as DataTemplate;
-            }
-        }
-    }
-
-    sealed class PropertyValueTextBox : TextBox
-    {
-        protected override void OnInitialized(EventArgs e)
-        {
-            base.OnInitialized(e);
-            this.Loaded += (s, args) =>
-                {
-                    //get the binding expression, and hook up exception filter
-                    var expr = this.GetBindingExpression(PropertyValueTextBox.TextProperty);
-                    if (null != expr && null != expr.ParentBinding)
-                    {
-                        expr.ParentBinding.UpdateSourceExceptionFilter = this.OnUpdateBindingException;
-                    }
-                };
-        }
-
-        object OnUpdateBindingException(object sender, Exception err)
-        {
-            //if exception occured, the property value is invalid (conversion to target type failed)
-            if (err is TargetInvocationException && err.InnerException is ValidationException || err is ValidationException)
-            {
-                //show error message
-                ErrorReporting.ShowErrorMessage((err.InnerException ?? err).Message);
-                //and revert textbox to last valid value
-                this.GetBindingExpression(PropertyValueTextBox.TextProperty).UpdateTarget();
-            }
-            return null;
-        }
-    }
-
-    public enum PropertyKind
-    {
-        InArgument,
-        InOutArgument,
-        OutArgument,
-        Property
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/AssemblyContextControlItem.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/AssemblyContextControlItem.cs
deleted file mode 100644 (file)
index 2336995..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.Hosting
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Reflection;
-    using System.Runtime;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Activities.Presentation.Hosting;
-    using System.IO;
-    using System.Linq;
-
-    //This class is required by the TypeBrowser - it allows browsing defined types either in VS scenario or in
-    //rehosted scenario. The types are divided into two categories - types defined in local assembly (i.e. the one 
-    //contained in current project - for that assembly, types are loaded using GetTypes() method), and all other
-    //referenced types - for them, type list is loaded using GetExportedTypes() method.
-    //
-    //if this object is not set in desinger's Items collection or both members are null, the type 
-    //browser will not display "Browse for types" option.
-    [Fx.Tag.XamlVisible(false)]
-    public sealed class AssemblyContextControlItem : ContextItem
-    {
-        public AssemblyName LocalAssemblyName
-        { get; set; }
-
-        [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "This is by design")]
-        public IList<AssemblyName> ReferencedAssemblyNames
-        {
-            get;
-            set;
-        }
-
-        public override Type ItemType
-        {
-            get { return typeof(AssemblyContextControlItem); }
-        }
-
-        public IEnumerable<string> AllAssemblyNamesInContext
-        {
-            get
-            {
-                if ((LocalAssemblyName != null) && LocalAssemblyName.CodeBase != null && (File.Exists(new Uri(LocalAssemblyName.CodeBase).LocalPath)))
-                {
-                    yield return LocalAssemblyName.FullName;
-                }
-                foreach (AssemblyName assemblyName in GetEnvironmentAssemblyNames())
-                {
-                    //avoid returning local name twice
-                    if (LocalAssemblyName == null || !assemblyName.FullName.Equals(LocalAssemblyName.FullName, StringComparison.Ordinal))
-                    {
-                        yield return assemblyName.FullName;
-                    }
-                }
-
-            }
-        }
-
-        public IEnumerable<AssemblyName> GetEnvironmentAssemblyNames()
-        {
-            if (this.ReferencedAssemblyNames != null)
-            {
-                return this.ReferencedAssemblyNames;
-            }
-            else
-            {
-                List<AssemblyName> assemblyNames = new List<AssemblyName>();
-                foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
-                {
-                    if (!assembly.IsDynamic)
-                    {
-                        assemblyNames.Add(assembly.GetName());
-                    }
-                }
-                return assemblyNames;
-            }
-        }
-
-        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", 
-            Justification = "Multi-Targeting makes sense")]
-        public IEnumerable<Assembly> GetEnvironmentAssemblies (IMultiTargetingSupportService multiTargetingService)
-        {
-            if (this.ReferencedAssemblyNames == null)
-            {
-                return AppDomain.CurrentDomain.GetAssemblies().Where<Assembly>(assembly => !assembly.IsDynamic);
-            }
-            else
-            {
-                List<Assembly> assemblies = new List<Assembly>();
-                foreach (AssemblyName assemblyName in this.ReferencedAssemblyNames)
-                {
-                    Assembly assembly = GetAssembly(assemblyName, multiTargetingService);
-                    if (assembly != null)
-                    {
-                        assemblies.Add(assembly);
-                    }
-                }
-                return assemblies;
-            }
-        }
-
-        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly",
-            Justification = "Multi-Targeting makes sense")]
-        public static Assembly GetAssembly(AssemblyName assemblyName, IMultiTargetingSupportService multiTargetingService)
-        {
-            Assembly assembly = null;
-            try
-            {
-                if (multiTargetingService != null)
-                {
-                    assembly = multiTargetingService.GetReflectionAssembly(assemblyName);
-                }
-                else
-                {
-                    assembly = Assembly.Load(assemblyName);
-                }
-            }  
-            catch (FileNotFoundException)
-            {
-                //this exception may occur if current project is not compiled yet
-            }
-            catch (FileLoadException)
-            {
-                //the assembly could not be loaded, ignore the error
-            }
-            catch (BadImageFormatException)
-            {
-                //bad assembly
-            }
-            return assembly;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/AutoScrollHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/AutoScrollHelper.cs
deleted file mode 100644 (file)
index 538dd09..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Windows;
-    using System.Windows.Media;
-    using System.Windows.Controls;
-    using System.Windows.Input;
-
-    internal static class AutoScrollHelper
-    {
-        const int scrollBuffer = 30;
-
-        public static void AutoScroll(MouseEventArgs e, DependencyObject element, double offsetPerScroll)
-        {
-            FrameworkElement logicalView = element as FrameworkElement;
-            while (element != null)
-            {
-                element = VisualTreeHelper.GetParent(element);
-                if (element != null && element is ScrollViewer)
-                {
-                    break;
-                }
-            }
-            ScrollViewer scrollViewer = element as ScrollViewer;
-            if (scrollViewer != null)
-            {                
-                AutoScroll(e.GetPosition(scrollViewer), scrollViewer, logicalView != null ? e.GetPosition(logicalView) : (Point?)null, logicalView,
-                     25, 25, offsetPerScroll);
-            }
-        }
-
-        public static void AutoScroll(DragEventArgs e, ScrollViewer scrollViewer, double offsetPerScroll)
-        {
-            AutoScroll(e.GetPosition(scrollViewer), scrollViewer, offsetPerScroll);
-        }
-
-        public static void AutoScroll(Point position, ScrollViewer scrollViewer, double offsetPerScroll)
-        {
-            AutoScroll(position, scrollViewer, null, null,
-                50, 50, offsetPerScroll);
-        }
-
-        static void AutoScroll(Point positionInScrollViewer, ScrollViewer scrollViewer, Point? positionInLogicalView, FrameworkElement logicalView, double scrollOnDragThresholdX, double scrollOnDragThresholdY, double scrollOnDragOffset)
-        {
-            double scrollViewerWidth = scrollViewer.ActualWidth;
-            double scrollViewerHeight = scrollViewer.ActualHeight;
-            
-            double logicalViewWidth = 0;
-            double logicalViewHeight = 0;
-            if (logicalView != null)
-            {
-                logicalViewWidth = logicalView.ActualWidth;
-                logicalViewHeight = logicalView.ActualHeight;
-            }             
-            
-            double heightToScroll = 0;
-            double widthToScroll = 0;
-
-            if (positionInScrollViewer.X > (scrollViewerWidth - scrollOnDragThresholdX)
-                && (positionInLogicalView == null
-                   || positionInLogicalView.Value.X < (logicalViewWidth - scrollBuffer)))
-            {
-                widthToScroll = scrollOnDragOffset;
-            }
-            else if (positionInScrollViewer.X < scrollOnDragThresholdX
-                && (positionInLogicalView == null
-                   || positionInLogicalView.Value.X > scrollBuffer))
-            {
-                widthToScroll = -scrollOnDragOffset;
-            }
-
-            if (positionInScrollViewer.Y > (scrollViewerHeight - scrollOnDragThresholdY)
-                && (positionInLogicalView == null
-                    || positionInLogicalView.Value.Y < logicalViewHeight - scrollBuffer))
-            {
-                heightToScroll = scrollOnDragOffset;
-            }
-            else if (positionInScrollViewer.Y < scrollOnDragThresholdY
-                && (positionInLogicalView == null
-                   || positionInLogicalView.Value.Y > scrollBuffer))
-            {
-                heightToScroll = -scrollOnDragOffset;
-            }
-
-            if (widthToScroll != 0 || heightToScroll != 0)
-            {
-                scrollViewer.ScrollToVerticalOffset(scrollViewer.VerticalOffset + heightToScroll);
-                scrollViewer.ScrollToHorizontalOffset(scrollViewer.HorizontalOffset + widthToScroll);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/BreadCrumbTextConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/BreadCrumbTextConverter.cs
deleted file mode 100644 (file)
index 9fe685a..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Windows.Data;
-    using System.Activities.Presentation.Model;
-
-    internal class BreadCrumbTextConverter : IMultiValueConverter
-    {
-        const int MaxDisplayNameLength = 20;
-        double pixelsPerChar = 6.5;
-
-        internal double PixelsPerChar
-        {
-            get { return this.pixelsPerChar; }
-            set { this.pixelsPerChar = Math.Max(5.0, value); }
-        }
-
-        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
-        {
-            int actualDisplayNameLength = MaxDisplayNameLength;
-            ModelItem boundModelItem = values[0] as ModelItem;
-
-            // default to root item's typename
-            string breadCrumbText = (null != boundModelItem ? boundModelItem.ItemType.Name : "<null>");
-            // if there is a display name property on root use that as the file name.
-            if (values[1] is ModelItem)
-            {
-                ModelItem displayNameProperty = (ModelItem)values[1];
-                if (typeof(string) == displayNameProperty.ItemType)
-                {
-                    values[1] = displayNameProperty.GetCurrentValue();
-                }
-            }
-            if (values[1] is string)
-            {
-                string displayName = (string)values[1];
-                if (!displayName.Equals(string.Empty))
-                {
-                    breadCrumbText = displayName;
-                }
-            }
-            if (values.Length == 3 && values[2] is double)
-            {
-                double actualControlWidth = (double)values[2];
-                actualDisplayNameLength = (int)Math.Max(MaxDisplayNameLength, actualControlWidth / pixelsPerChar);
-
-            }
-            if (breadCrumbText.Length > actualDisplayNameLength)
-            {
-                breadCrumbText = breadCrumbText.Substring(0, actualDisplayNameLength - 3) + "...";
-            }
-            return breadCrumbText;
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new InvalidOperationException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/CanExpandCollapseAllConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/CanExpandCollapseAllConverter.cs
deleted file mode 100644 (file)
index 52d64ee..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Globalization;
-    using System.Windows.Data;
-    using System.Windows;
-
-    sealed class CanExpandCollapseAllConverter : IValueConverter
-    {
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            if (value == null || value == DependencyProperty.UnsetValue)
-            {
-                return false;
-            }
-
-            ActivityDesignerOptionsAttribute attr = WorkflowViewService.GetAttribute<ActivityDesignerOptionsAttribute>(value.GetType());
-            return attr == null || !attr.AlwaysCollapseChildren;
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/DataGridHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/DataGridHelper.cs
deleted file mode 100644 (file)
index f2db469..0000000
+++ /dev/null
@@ -1,1566 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Linq;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Automation;
-    using System.Windows.Controls;
-    using System.Windows.Controls.Primitives;
-    using System.Windows.Data;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using System.Windows.Threading;
-    using System.ComponentModel;
-    using System.Collections.ObjectModel;
-    using System.Windows.Media.Effects;
-
-    [SuppressMessage(FxCop.Category.Xaml, FxCop.Rule.TypesShouldHavePublicParameterlessConstructors,
-        Justification = "This class is never supposed to be created in xaml directly.")]
-    sealed partial class DataGridHelper
-    {
-        public static readonly string PART_ButtonAdd = "PART_ButtonAdd";
-        static readonly string dynamicContentControlName = "PART_Dynamic";
-
-        //content of the Add new row button
-        public static readonly DependencyProperty AddNewRowContentProperty =
-            DependencyProperty.Register("AddNewRowContent", typeof(object), typeof(DataGridHelper), new UIPropertyMetadata("<Add new row>"));
-
-        //binding to the command, which gets executed when new row button is clicked
-        public static readonly DependencyProperty AddNewRowCommandProperty =
-            DependencyProperty.Register("AddNewRowCommand", typeof(ICommand), typeof(DataGridHelper), new UIPropertyMetadata(null));
-
-        //attached property - used to store reference to data grid helper within data grid instance
-        static readonly DependencyProperty DGHelperProperty =
-            DependencyProperty.RegisterAttached("DGHelper", typeof(DataGridHelper), typeof(DataGrid), new UIPropertyMetadata(null));
-
-        static readonly DependencyProperty ControlBehaviorProperty =
-            DependencyProperty.RegisterAttached("ControlBehavior", typeof(EditingControlBehavior), typeof(DataGridHelper), new UIPropertyMetadata(null));
-
-        static readonly DependencyProperty NewRowLoadedProperty =
-            DependencyProperty.RegisterAttached("NewRowLoaded", typeof(bool), typeof(DataGridHelper), new UIPropertyMetadata(false));
-
-        static readonly DependencyProperty IsCommitInProgressProperty =
-            DependencyProperty.RegisterAttached("IsCommitInProgress", typeof(bool), typeof(DataGridHelper), new UIPropertyMetadata(false));
-
-        public static readonly DependencyProperty ShowValidationErrorAsToolTipProperty =
-            DependencyProperty.Register("ShowValidationErrorAsToolTip", typeof(bool), typeof(DataGridHelper), new UIPropertyMetadata(false));
-
-        public static readonly DependencyProperty IsCustomEditorProperty =
-            DependencyProperty.RegisterAttached("IsCustomEditor", typeof(bool), typeof(DataGridHelper), new UIPropertyMetadata(false));
-
-        public event EventHandler<DataGridCellEditEndingEventArgs> DataGridCellEditEnding;
-
-        static DataTemplate dynamicCellContentTemplate;
-        static Dictionary<Type, Type> EditorBehaviorTypeMapping = new Dictionary<Type, Type>
-        {
-            { typeof(ExpressionTextBox), typeof(ExpressionTextBoxBehavior) },
-            { typeof(TextBox), typeof(TextBoxBehavior) },
-            { typeof(TypePresenter), typeof(TypePresenterBehavior) },
-            { typeof(VBIdentifierDesigner), typeof(VBIdentifierDesignerBehavior) },
-        };
-
-        DataGrid dataGrid;
-        bool isNewRowAdded;
-
-        Func<ResolveTemplateParams, bool> resolveDynamicTemplateCallback;
-        Dictionary<string, DataGridColumn> MemberPathToColumnDict = new Dictionary<string, DataGridColumn>();
-
-        [SuppressMessage(FxCop.Category.Usage, FxCop.Rule.ReviewUnusedParameters, Justification = "Existing code")]
-        public DataGridHelper(DataGrid instance, Control owner)
-        {
-            this.InitializeComponent();
-
-            this.dataGrid = instance;
-            //apply default cell style
-            this.ApplyCellStyle();
-            //apply default row style
-            this.ApplyRowStyle();
-            //apply default datagrid style
-            this.dataGrid.Style = (Style)this.FindResource("defaultDataGridStyle");
-            //handle data grid's loading event
-            this.dataGrid.LoadingRow += OnDataGridRowLoading;
-            //store reference to data grid helper within datagrid
-            DataGridHelper.SetDGHelper(this.dataGrid, this);
-            this.dataGrid.MouseDown += OnDataGridMouseDown;
-            this.dataGrid.Sorting += OnDataGridSorting;
-            this.dataGrid.CellEditEnding += OnDataGridCellEditEnding;
-            this.InitMemberPathToColumnDict();
-        }
-
-        public static bool GetIsCustomEditor(DependencyObject obj)
-        {
-            return (bool)obj.GetValue(IsCustomEditorProperty);
-        }
-
-        public static void SetIsCustomEditor(DependencyObject obj, bool value)
-        {
-            obj.SetValue(IsCustomEditorProperty, value);
-        }
-
-        void OnDataGridCellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
-        {
-            if (this.DataGridCellEditEnding != null)
-            {
-                this.DataGridCellEditEnding(sender, e);
-            }
-
-            if ((!e.Cancel) && (!GetIsCommitInProgress(this.dataGrid)))
-            {
-                SetIsCommitInProgress(this.dataGrid, true);
-                //try to commit edit
-                bool commitSucceeded = false;
-                try
-                {
-                    commitSucceeded = this.dataGrid.CommitEdit(DataGridEditingUnit.Row, true);
-                }
-                catch (InvalidOperationException)
-                {
-                    // Ignore and cancel edit
-                }
-                finally
-                {
-                    //if commit fails - undo change
-                    if (!commitSucceeded)
-                    {
-                        this.dataGrid.CancelEdit();
-                    }
-                }
-                SetIsCommitInProgress(this.dataGrid, false);
-            }
-        }
-
-        void InitMemberPathToColumnDict()
-        {
-            MemberPathToColumnDict.Clear();
-            foreach (DataGridColumn column in this.dataGrid.Columns)
-            {
-                if (column.CanUserSort &&
-                    !string.IsNullOrEmpty(column.SortMemberPath) &&
-                    !MemberPathToColumnDict.ContainsKey(column.SortMemberPath))
-                {
-                    MemberPathToColumnDict.Add(column.SortMemberPath, column);
-                }
-            }
-        }
-
-        void OnDataGridSorting(object sender, DataGridSortingEventArgs e)
-        {
-            bool primaryColumnSorted = false;
-            ListSortDirection direction = (e.Column.SortDirection != ListSortDirection.Ascending) ? ListSortDirection.Ascending : ListSortDirection.Descending;
-            e.Column.SortDirection = null;
-
-            foreach (SortDescription description in this.dataGrid.Items.SortDescriptions.Reverse())
-            {
-                if (MemberPathToColumnDict[description.PropertyName].SortDirection == null)
-                {
-                    this.dataGrid.Items.SortDescriptions.Remove(description);
-                }
-                else if (description.PropertyName == this.dataGrid.Columns[0].SortMemberPath)
-                {
-                    primaryColumnSorted = true;
-                }
-            }
-
-            this.dataGrid.Items.SortDescriptions.Add(new SortDescription(e.Column.SortMemberPath, direction));
-            e.Column.SortDirection = direction;
-            if (e.Column != this.dataGrid.Columns[0] && !primaryColumnSorted)
-            {
-                this.dataGrid.Items.SortDescriptions.Add(new SortDescription(this.dataGrid.Columns[0].SortMemberPath, ListSortDirection.Ascending));
-            }
-            this.dataGrid.Items.Refresh();
-
-            e.Handled = true;
-        }
-
-        //Hook KeyDown event on DataGrid row to workaround DataGrid bug with customized NewItemPlaceHolder        
-        void OnDataGridRowKeyDown(object sender, KeyEventArgs e)
-        {
-            if (e.Handled)
-            {
-                return;
-            }
-            if (e.Key == Key.Enter || e.Key == Key.Escape)
-            {
-                // If currentCell is the cell containing AddNewRowTemplate, its Column will be null since this cell
-                // spread across all columns in the grid. In this case, consume the event with no action.
-                if (dataGrid.CurrentCell.Column != null)
-                {
-                    DataGridCellInfo currentCell = dataGrid.CurrentCell;
-                    ObservableCollection<DataGridColumn> columns = dataGrid.Columns;
-                    ItemCollection items = dataGrid.Items;
-                    int currentColumnIndex = columns.IndexOf(dataGrid.ColumnFromDisplayIndex(currentCell.Column.DisplayIndex));
-                    DataGridCell currentCellContainer = GetCell(dataGrid, items.IndexOf(currentCell.Item), currentColumnIndex);
-                    if ((currentCellContainer != null) && (columns.Count > 0))
-                    {
-                        int numItems = items.Count;
-                        bool shiftModifier = ((e.KeyboardDevice.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift);
-                        int index = Math.Max(0, Math.Min(numItems - 1, items.IndexOf(currentCell.Item) + (shiftModifier ? -1 : 1)));
-                        if (index < numItems)
-                        {
-                            if (items[index] == CollectionView.NewItemPlaceholder)
-                            {
-                                CommitAnyEdit(currentCellContainer);
-                                e.Handled = true;
-                            }
-                        }
-                    }
-                    else
-                    {
-                        e.Handled = true;
-                    }
-                }
-                else
-                {
-                    e.Handled = true;
-                }
-            }
-        }
-
-        void CommitAnyEdit(DataGridCell currentCellContainer)
-        {
-            IEditableCollectionView editableItems = (IEditableCollectionView)(this.dataGrid.Items);
-            DataGridCell cell = currentCellContainer;
-            bool isCurrentCellEditing = false;
-            this.ExplicitCommit = true;
-            if (cell != null)
-            {
-                isCurrentCellEditing = cell.IsEditing;
-            }
-            if (editableItems.IsAddingNew || editableItems.IsEditingItem)
-            {
-                this.dataGrid.CommitEdit(DataGridEditingUnit.Row, true);
-            }
-            else if (isCurrentCellEditing)
-            {
-                this.dataGrid.CommitEdit(DataGridEditingUnit.Cell, true);
-            }
-            this.ExplicitCommit = false;
-        }
-
-        //callback executed whenever user clicks AddNewRow
-        public Func<DataGrid, object, object> NotifyNewRowAddedCallback
-        {
-            get;
-            set;
-        }
-
-        //callback executed whenever users starts editing cell
-        public Action<Control, DataGridCell, bool> NotifyBeginCellEditCallback
-        {
-            get;
-            set;
-        }
-
-        //callback executed whenver cell edit is complete
-        public Action<Control, DataGridCell> NotifyEndCellEditCallback
-        {
-            get;
-            set;
-        }
-
-        public bool ExplicitCommit
-        {
-            get;
-            private set;
-        }
-
-        internal DataGrid DataGrid
-        {
-            get { return this.dataGrid; }
-        }
-
-        internal bool IsEditInProgress
-        {
-            get { return GetIsCommitInProgress(this.dataGrid); }
-        }
-
-        internal EditingContext Context
-        {
-            get;
-            set;
-        }
-
-        //callback executed whenever dynamic content cell is loaded
-        //parameters: 
-        //  - clicked data grid cell,
-        //  - reference to data item in given dg row
-        //  - boolean value indicating whether cell is beeing edited or viewewd
-        //returns:
-        // - data template to be applied
-        public Func<ResolveTemplateParams, bool> ResolveDynamicTemplateCallback
-        {
-            get { return this.resolveDynamicTemplateCallback; }
-            set
-            {
-                this.resolveDynamicTemplateCallback = value;
-                //if user adds dynamic template, we need to hook for EditMode button event - ShowDialogEditor; 
-                //otherwise, clicking on that button wouldn't have any effect, since it is normally handled by property grid
-                bool containsBinding = this.dataGrid.CommandBindings
-                    .Cast<CommandBinding>()
-                    .Any(cb => ICommand.Equals(cb.Command, PropertyValueEditorCommands.ShowDialogEditor));
-
-                if (!containsBinding)
-                {
-                    var cb = new CommandBinding(PropertyValueEditorCommands.ShowDialogEditor, this.OnShowPropertyValueEditor, this.OnCanShowPropertyValueEditor);
-                    this.dataGrid.CommandBindings.Add(cb);
-                }
-            }
-        }
-
-        //callback executed whenever user clicks extended dialog property editor in the data grid - 
-        //client has to specify reference to edited model property, which will be placed in extended editor dialog
-        //parameters:
-        // - clicked data grid cell
-        // - reference to data item in given dg row
-        //returns:
-        // - reference to model property which should be displayed
-        public Func<DataGridCell, object, ModelProperty> LoadDynamicContentDataCallback
-        {
-            get;
-            set;
-        }
-
-        //callback executed whenever user clicks extended dialog property editor in the data grid
-        //parameters:
-        // - clicked data grid cell
-        // - reference to data item in given dg row
-        //returns:
-        // - instance of dialog property value editor
-        public Func<DataGridCell, object, DialogPropertyValueEditor> LoadCustomPropertyValueEditorCallback
-        {
-            get;
-            set;
-        }
-
-        //default row template 
-        ControlTemplate DefaultRowControlTemplate
-        {
-            get;
-            set;
-        }
-
-        ContentPresenter AddNewRowContentPresenter
-        {
-            get;
-            set;
-        }
-
-        //property containing content displayed on the Add new row button
-        public object AddNewRowContent
-        {
-            get { return (object)GetValue(AddNewRowContentProperty); }
-            set { SetValue(AddNewRowContentProperty, value); }
-        }
-
-        //command bound to add new row button
-        public ICommand AddNewRowCommand
-        {
-            get { return (ICommand)GetValue(AddNewRowCommandProperty); }
-            set { SetValue(AddNewRowCommandProperty, value); }
-        }
-
-        public bool ShowValidationErrorAsToolTip
-        {
-            get { return (bool)GetValue(ShowValidationErrorAsToolTipProperty); }
-            set { SetValue(ShowValidationErrorAsToolTipProperty, value); }
-        }
-
-        //helper method - returns selected data grid item casted to the target type
-        public T SelectedItem<T>() where T : class
-        {
-            return this.dataGrid.SelectedItem as T;
-        }
-
-        public T Source<T>() where T : class
-        {
-            return (T)this.dataGrid.ItemsSource;
-        }
-
-        public void BeginRowEdit(object value, DataGridColumn column)
-        {
-            if (null == value)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("value"));
-            }
-            if (null == column)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("column"));
-            }
-            int columnIndex = this.dataGrid.Columns.IndexOf(column);
-            if (columnIndex < 0)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentOutOfRangeException("column"));
-            }
-            ICollectionView items = CollectionViewSource.GetDefaultView(this.dataGrid.ItemsSource);
-            if (null != items)
-            {
-                this.CommitDataGrid();
-                this.dataGrid.SelectedItem = null;
-                //lookup element in the collection
-                if (items.MoveCurrentTo(value))
-                {
-                    //set the SelectedItem to passed value
-                    this.dataGrid.SelectedItem = value;
-                    //get the cell which contains given elemnt
-                    DataGridCell cell = DataGridHelper.GetCell(this.dataGrid, items.CurrentPosition, columnIndex);
-                    //and begin edit
-                    if (null != cell)
-                    {
-                        cell.Focus();
-                        dataGrid.BeginEdit();
-                    }
-                }
-                else
-                {
-                    throw FxTrace.Exception.AsError(new ArgumentOutOfRangeException("value"));
-                }
-            }
-        }
-
-        public void BeginRowEdit(object value)
-        {
-            var column = this.dataGrid.Columns[0];
-            int index = 1;
-            while (null != column && column.Visibility == Visibility.Hidden && this.dataGrid.Columns.Count > index)
-            {
-                column = this.dataGrid.Columns[index];
-                ++index;
-            }
-            this.BeginRowEdit(value, column);
-        }
-
-        void OnDataGridRowLoading(object sender, DataGridRowEventArgs e)
-        {
-            if (this.DefaultRowControlTemplate == null)
-            {
-                this.DefaultRowControlTemplate = e.Row.Template;
-            }
-
-            if (e.Row.Item == CollectionView.NewItemPlaceholder)
-            {
-                e.Row.Style = (Style)this.FindResource("defaultNewRowStyle");
-                e.Row.UpdateLayout();
-            }
-        }
-
-        void OnAddNewRowContentPresenterLoaded(object sender, RoutedEventArgs args)
-        {
-            var presenter = (ContentPresenter)sender;
-            this.AddNewRowContentPresenter = presenter;
-            if (null != this.AddNewRowContent)
-            {
-                if (this.AddNewRowContent is DataTemplate)
-                {
-                    presenter.ContentTemplate = (DataTemplate)this.AddNewRowContent;
-                    presenter.ApplyTemplate();
-                }
-                else
-                {
-                    presenter.ContentTemplate = (DataTemplate)this.FindResource("defaultAddNewRowTemplate");
-                    presenter.ApplyTemplate();
-                    presenter.Content = this.AddNewRowContent.ToString();
-                }
-            }
-        }
-
-        void OnAddNewRowClick(object sender, RoutedEventArgs args)
-        {
-            //user clicked on AddNew row - commit all pending changes
-            this.CommitDataGrid();
-            Button btn = (Button)sender;
-            //if there is callback registered 
-            if (null != this.NotifyNewRowAddedCallback)
-            {
-                //execute it
-                object added = this.NotifyNewRowAddedCallback(this.dataGrid, btn.CommandParameter);
-                //if add was successfull, begin editing new row
-                this.isNewRowAdded = (null != added);
-                if (this.isNewRowAdded)
-                {
-                    this.BeginRowEdit(added);
-                }
-            }
-            //if there is command registered
-            else if (null != this.AddNewRowCommand)
-            {
-                //try to invoke command as routed command, the as the interface command
-                RoutedCommand cmd = this.AddNewRowCommand as RoutedCommand;
-                if (null == cmd)
-                {
-                    if (this.AddNewRowCommand.CanExecute(btn.CommandParameter))
-                    {
-                        this.AddNewRowCommand.Execute(btn.CommandParameter);
-                        this.isNewRowAdded = true;
-                    }
-                }
-                else
-                {
-                    if (cmd.CanExecute(btn.CommandParameter, this.dataGrid))
-                    {
-                        cmd.Execute(btn.CommandParameter, this.dataGrid);
-                        this.isNewRowAdded = true;
-                    }
-                }
-            }
-        }
-
-        void OnAddNewRowGotFocus(object sender, RoutedEventArgs e)
-        {
-            //When tab over the last row, the last column won't get commit by default, which is a bug of DataGrid with
-            //customized new place holder template. Call commit explicitly here to workaround this issue
-            this.CommitDataGrid();
-            this.dataGrid.SelectedItem = null;
-        }
-
-        void CommitDataGrid()
-        {
-            if (!GetIsCommitInProgress(this.dataGrid))
-            {
-                SetIsCommitInProgress(this.dataGrid, true);
-                this.ExplicitCommit = true;                
-                this.dataGrid.CommitEdit(DataGridEditingUnit.Row, true);
-                this.ExplicitCommit = false;
-                SetIsCommitInProgress(this.dataGrid, false);
-            }
-        }
-
-        void NotifyEditingControlLoaded(Control control, DataGridCell cell, bool isNewRowLoaded)
-        {
-            Type controlType = control.GetType();
-            Type editorBehaviorType;
-            if (EditorBehaviorTypeMapping.ContainsKey(controlType))
-            {
-                editorBehaviorType = EditorBehaviorTypeMapping[controlType];
-            }
-            else
-            {
-                editorBehaviorType = typeof(DefaultControlBehavior);
-            }
-
-            EditingControlBehavior behavior = Activator.CreateInstance(editorBehaviorType, this.dataGrid) as EditingControlBehavior;
-            bool isHandled = behavior.HandleControlLoaded(control, cell, isNewRowLoaded);
-            if (isHandled)
-            {
-                SetControlBehavior(control, behavior);
-            }
-
-            if (null != this.NotifyBeginCellEditCallback)
-            {
-                this.NotifyBeginCellEditCallback(control, cell, isNewRowLoaded);
-            }
-        }
-
-        void NotifyEditingControlUnloaded(Control control, DataGridCell cell)
-        {
-            bool isHandled = false;
-
-            EditingControlBehavior behavior = GetControlBehavior(control);
-
-            if (null != behavior)
-            {
-                isHandled = behavior.ControlUnloaded(control, cell);
-            }
-
-            if (null != this.NotifyEndCellEditCallback)
-            {
-                this.NotifyEndCellEditCallback(control, cell);
-            }
-        }
-
-        void OnCanShowPropertyValueEditor(object sender, CanExecuteRoutedEventArgs args)
-        {
-            Fx.Assert(this.LoadCustomPropertyValueEditorCallback != null, "LoadCustomPropertyValueEditorCallback is not set!");
-            Fx.Assert(this.LoadDynamicContentDataCallback != null, "LoadDynamicContentDataCallback is not set!");
-
-            if (null != this.LoadDynamicContentDataCallback && null != this.LoadCustomPropertyValueEditorCallback)
-            {
-                var cell = VisualTreeUtils.FindVisualAncestor<DataGridCell>((DependencyObject)args.OriginalSource);
-                var row = VisualTreeUtils.FindVisualAncestor<DataGridRow>(cell);
-                args.CanExecute = null != this.LoadCustomPropertyValueEditorCallback(cell, row.Item);
-            }
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
-            Justification = "Propagating exceptions might lead to VS crash.")]
-        [SuppressMessage("Reliability", "Reliability108:IsFatalRule",
-            Justification = "Propagating exceptions might lead to VS crash.")]
-        void OnShowPropertyValueEditor(object sender, ExecutedRoutedEventArgs args)
-        {
-            //user clicked on dialog's property editor's button - now we need to show custom designer in dialog mode
-            var cell = VisualTreeUtils.FindVisualAncestor<DataGridCell>((DependencyObject)args.OriginalSource);
-            var row = VisualTreeUtils.FindVisualAncestor<DataGridRow>(cell);
-            //ask client for custom editor, given for currently selected row
-            var editor = this.LoadCustomPropertyValueEditorCallback(cell, row.Item);
-
-            Fx.Assert(editor != null, "Custom property value editor is not set or doesn't derive from DialogPropertyValueEditor!");
-            if (null != editor)
-            {
-                //out of currently selected row, get actual property which is beeing edited
-                var value = this.LoadDynamicContentDataCallback(cell, row.Item);
-
-                Fx.Assert(value != null, "ModelProperty shouldn't be null");
-
-                //create model property entry - it is required by dialog property editor
-                var propertyEntry = new ModelPropertyEntry(value, null);
-                try
-                {
-                    editor.ShowDialog(propertyEntry.PropertyValue, (IInputElement)args.OriginalSource);
-                }
-                catch (Exception err)
-                {
-                    ErrorReporting.ShowErrorMessage(err);
-                }
-            }
-        }
-
-        internal static void OnEditingControlLoaded(object sender, RoutedEventArgs args)
-        {
-            //editing control has been loaded - user starts editing the cell
-            Control ctrl = (Control)sender;
-
-            //get the data grid reference from control
-            DataGrid dg = VisualTreeUtils.FindVisualAncestor<DataGrid>(ctrl);
-            Fx.Assert(null != dg, string.Format(CultureInfo.CurrentCulture, "DataGrid is not in the visual tree of this control: {0}", ctrl));
-            if (null != dg)
-            {
-                //get the target instance of data grid helper
-                DataGridHelper helper = DataGridHelper.GetDGHelper(dg);
-                //store data grid helper in the control
-                DataGridHelper.SetDGHelper(ctrl, helper);
-                if (null != helper)
-                {
-                    //notify user that given control is becoming acive one
-                    DataGridCell cell = VisualTreeUtils.FindVisualAncestor<DataGridCell>(ctrl);
-                    helper.NotifyEditingControlLoaded(ctrl, cell, helper.isNewRowAdded);
-                    helper.isNewRowAdded = false;
-                }
-            }
-        }
-
-        internal static void OnEditingControlUnloaded(object sender, RoutedEventArgs args)
-        {
-            //editing control has been unloaded - user ends editing the cell
-            Control ctrl = (Control)sender;
-
-            //get data grid helper out of it
-            DataGridHelper helper = DataGridHelper.GetDGHelper(ctrl);
-
-            //notify user that edit is complete
-            if (null != helper)
-            {
-                DataGridCell cell = VisualTreeUtils.FindVisualAncestor<DataGridCell>(ctrl);
-                helper.NotifyEditingControlUnloaded(ctrl, cell);
-            }
-        }
-
-        void OnPreviewCellMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
-        {
-            //When Ctrl of Shift is pressed, let DataGrid to handle multi-selection
-            //and DataGrid shouldn't enter editing mode in this case
-            if ((Keyboard.IsKeyDown(Key.RightShift)) || (Keyboard.IsKeyDown(Key.LeftShift)) ||
-                (Keyboard.IsKeyDown(Key.LeftCtrl)) || (Keyboard.IsKeyDown(Key.RightCtrl)))
-            {
-                return;
-            }
-
-            //support for single click edit
-            DataGridCell cell = sender as DataGridCell;
-            //enter this code only if cell is not beeing edited already and is not readonly
-            if (null != cell && !cell.IsEditing && !cell.IsReadOnly && null != this.dataGrid.SelectedItem)
-            {
-                bool shouldFocus = true;
-                //depending on the selection type - either select cell or row
-                if (this.dataGrid.SelectionUnit != DataGridSelectionUnit.FullRow)
-                {
-                    if (!cell.IsSelected)
-                    {
-                        cell.IsSelected = true;
-                    }
-                }
-                else
-                {
-                    DataGridRow row = VisualTreeUtils.FindVisualAncestor<DataGridRow>(cell);
-                    //if row was not selected - first click will select it, second will start editing cell's value
-                    if (null != row && !row.IsSelected)
-                    {
-                        this.dataGrid.SelectedItem = row;
-                        shouldFocus = false;
-                    }
-                }
-
-                //if allowed - begin edit
-                if ((shouldFocus && !cell.IsFocused) && !GetIsCustomEditor(cell))
-                {
-                    //attempt to set focus to the cell, and let DG start editing                    
-                    if (cell.Focus() && !cell.IsEditing)
-                    {
-                        if (dataGrid.SelectionUnit == DataGridSelectionUnit.FullRow)
-                        {
-                            dataGrid.SelectedItems.Clear();
-                            DataGridRow row = VisualTreeUtils.FindVisualAncestor<DataGridRow>(cell);
-                            if (row != null)
-                            {
-                                dataGrid.SelectedItems.Add(dataGrid.ItemContainerGenerator.ItemFromContainer(row));
-                            }
-                        }
-                        else
-                        {
-                            dataGrid.SelectedCells.Clear();
-                            dataGrid.SelectedCells.Add(new DataGridCellInfo(cell));
-                        }
-                        this.dataGrid.BeginEdit();
-                    }
-                }
-            }
-        }
-
-        void OnDataGridMouseDown(object sender, RoutedEventArgs e)
-        {
-            ICollectionView view = CollectionViewSource.GetDefaultView(this.dataGrid.ItemsSource);
-            if (null != this.dataGrid.SelectedItem && this.dataGrid.CurrentCell.IsValid && view.MoveCurrentTo(this.dataGrid.SelectedItem))
-            {
-                int rowIndex = view.CurrentPosition;
-                int columnIndex = this.dataGrid.Columns.IndexOf(this.dataGrid.CurrentCell.Column);
-                var cell = DataGridHelper.GetCell(this.dataGrid, rowIndex, columnIndex);
-                if (null != cell && cell.IsEditing)
-                {
-                    this.CommitDataGrid();
-                    cell.Focus();
-                }
-            }
-            else
-            {
-                this.dataGrid.Focus();
-            }
-        }
-
-
-        void OnDynamicContentColumnLoaded(DataGridCell cell, ContentControl contentContainer)
-        {
-            //user marked at least one column in data grid with DynamicContent - now, we have to query client for
-            //cell template for given row's property
-            if (null != this.ResolveDynamicTemplateCallback)
-            {
-                var resolveParams = new ResolveTemplateParams(cell, contentContainer.Content);
-                if (this.ResolveDynamicTemplateCallback(resolveParams) && null != resolveParams.Template)
-                {
-                    if (!resolveParams.IsDefaultTemplate)
-                    {
-                        var content = this.LoadDynamicContentDataCallback(cell, contentContainer.Content);
-                        var propertyEntry = new ModelPropertyEntry(content, null);
-                        contentContainer.Content = propertyEntry.PropertyValue;
-                        SetIsCustomEditor(cell, true);
-                    }
-                    else
-                    {
-                        contentContainer.Content = cell.DataContext;
-                        SetIsCustomEditor(cell, false);
-                    }
-                    contentContainer.ContentTemplate = resolveParams.Template;
-                }
-            }
-            else
-            {
-                System.Diagnostics.Debug.WriteLine("ResolveDynamicTemplateCallback not registered for column " + cell.Column.Header);
-            }
-        }
-
-        public void UpdateDynamicContentColumns(object entry)
-        {
-            ICollectionView view = CollectionViewSource.GetDefaultView(this.dataGrid.ItemsSource);
-            int rowIndex = -1;
-            //get index of given entry
-            if (view.MoveCurrentTo(entry))
-            {
-                rowIndex = view.CurrentPosition;
-            }
-            if (-1 != rowIndex)
-            {
-                //pickup all dynamic columns in this data grid
-                var dynamicColumnsIndexes = this.dataGrid.Columns
-                    .OfType<DataGridTemplateColumn>()
-                    .Where(p => DataTemplate.Equals(p.CellEditingTemplate, DataGridHelper.DynamicCellContentTemplate) &&
-                                DataTemplate.Equals(p.CellTemplate, DataGridHelper.DynamicCellContentTemplate))
-                    .Select<DataGridColumn, int>(p => this.dataGrid.Columns.IndexOf(p));
-
-                //foreach dynamic column
-                foreach (var columnIndex in dynamicColumnsIndexes)
-                {
-                    //get the cell
-                    var cell = DataGridHelper.GetCell(this.dataGrid, rowIndex, columnIndex);
-
-                    //get the content presenter within it
-                    var dynamicContent = VisualTreeUtils.GetNamedChild<ContentControl>(cell, DataGridHelper.dynamicContentControlName, 5);
-
-                    //reload the template
-                    if (null != dynamicContent)
-                    {
-                        dynamicContent.ContentTemplate = null;
-                        this.OnDynamicContentColumnLoaded(cell, dynamicContent);
-                    }
-                }
-            }
-
-        }
-
-        void ApplyCellStyle()
-        {
-            //create default cell style
-            Style baseStyle = this.dataGrid.CellStyle;
-            //respect any user's base styles
-            Style style = null == baseStyle ? new Style(typeof(DataGridCell)) : new Style(typeof(DataGridCell), baseStyle);
-
-            //event handler for preview mouse down - single click edit
-            style.Setters.Add(new EventSetter(DataGridCell.PreviewMouseLeftButtonDownEvent, new MouseButtonEventHandler(this.OnPreviewCellMouseLeftButtonDown)));
-            //width binding - prevent columns from expanding while typing long texts
-            style.Setters.Add(new Setter(DataGridCell.WidthProperty, new Binding("Column.ActualWidth")
-            {
-                RelativeSource = new RelativeSource(RelativeSourceMode.Self),
-                Mode = BindingMode.OneWay
-            }));
-            //automation id - for cell it is always column name
-            style.Setters.Add(new Setter(AutomationProperties.AutomationIdProperty, new Binding("Column.Header")
-            {
-                RelativeSource = new RelativeSource(RelativeSourceMode.Self),
-                Mode = BindingMode.OneWay
-            }));
-
-            //apply style
-            this.dataGrid.CellStyle = style;
-        }
-
-        void ApplyRowStyle()
-        {
-            //create default row style
-            Style baseStyle = this.dataGrid.RowStyle;
-            //respect any user's base styles
-            Style style = null == baseStyle ? new Style(typeof(DataGridRow)) : new Style(typeof(DataGridRow), baseStyle);
-
-            EventSetter keyDownSetter = new EventSetter
-            {
-                Event = DataGridRow.KeyDownEvent,
-                Handler = new KeyEventHandler(this.OnDataGridRowKeyDown)
-            };
-            style.Setters.Add(keyDownSetter);
-
-            //define a multibinding which displays a tooltip when cell validation fails (failure mean user's data was invalid and was not set in the target property)
-            //first - create a binding and add ErrorToTooltipConverter, pass reference to owning data grid helper
-            var multiBinding = new MultiBinding() { Converter = new ErrorToTooltipConverter(this) };
-            //now define bindings
-            //first - bind to actual object behind the row - only DesignObjectWrapper is supported
-            var objectWrapperBinding = new Binding() { Mode = BindingMode.OneTime };
-            //second - bind to a HasError property change notifications - this will trigger tooltip to appear
-            var hasErrorsBinding = new Binding() { Mode = BindingMode.OneWay, Path = new PropertyPath("HasErrors") };
-            //finally - bind to a row which contains the data - this will be used as tooltip placement target
-            var rowBinding = new Binding() { Mode = BindingMode.OneTime, RelativeSource = new RelativeSource(RelativeSourceMode.Self) };
-            multiBinding.Bindings.Add(objectWrapperBinding);
-            multiBinding.Bindings.Add(hasErrorsBinding);
-            multiBinding.Bindings.Add(rowBinding);
-
-            var errorTooltipTrigger = new DataTrigger()
-            {
-                Binding = multiBinding,
-                Value = true
-            };
-            //define a dummy setter - it will never be executed anyway, but it is required for the binding to work
-            errorTooltipTrigger.Setters.Add(new Setter(DataGridRow.TagProperty, null));
-            //add trigger to the collection
-            style.Triggers.Add(errorTooltipTrigger);
-            //apply style
-            this.dataGrid.RowStyle = style;
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
-            Justification = "Propagating exceptions might lead to VS crash.")]
-        [SuppressMessage("Reliability", "Reliability108:IsFatalRule",
-            Justification = "Propagating exceptions might lead to VS crash.")]
-        static void OnDynamicCellContentLoaded(object sender, RoutedEventArgs e)
-        {
-            var container = (ContentControl)sender;
-            var dataGridCell = VisualTreeUtils.FindVisualAncestor<DataGridCell>(container);
-            var dataGrid = VisualTreeUtils.FindVisualAncestor<DataGrid>(dataGridCell);
-            if (dataGrid != null)
-            {
-                var dataGridHelper = DataGridHelper.GetDGHelper(dataGrid);
-
-                if (GetIsCustomEditor(dataGridCell) && (dataGridCell.IsEditing))
-                {
-                    dataGridHelper.CommitDataGrid();
-                }
-                else
-                {
-                    try
-                    {
-                        dataGridHelper.OnDynamicContentColumnLoaded(dataGridCell, container);
-                    }
-                    catch (Exception err)
-                    {
-                        container.Content = err.ToString();
-                        container.ContentTemplate = (DataTemplate)dataGrid.Resources["dynamicContentErrorTemplate"];
-                        System.Diagnostics.Debug.WriteLine(err.ToString());
-                    }
-                }
-            }
-        }
-
-        public static DataTemplate DynamicCellContentTemplate
-        {
-            get
-            {
-                if (null == dynamicCellContentTemplate)
-                {
-                    DataTemplate template = new DataTemplate();
-
-                    FrameworkElementFactory contentControlFactory = new FrameworkElementFactory(typeof(ContentControl));
-                    contentControlFactory.SetValue(ContentControl.NameProperty, DataGridHelper.dynamicContentControlName);
-                    contentControlFactory.SetBinding(ContentControl.ContentProperty, new Binding());
-                    contentControlFactory.AddHandler(ContentControl.LoadedEvent, new RoutedEventHandler(DataGridHelper.OnDynamicCellContentLoaded));
-
-                    template.VisualTree = new FrameworkElementFactory(typeof(NoContextMenuGrid));
-                    template.VisualTree.AppendChild(contentControlFactory);
-                    template.Seal();
-                    dynamicCellContentTemplate = template;
-                }
-                return dynamicCellContentTemplate;
-            }
-        }
-
-        static DataGridHelper GetDGHelper(DependencyObject obj)
-        {
-            return (DataGridHelper)obj.GetValue(DGHelperProperty);
-        }
-
-        static void SetDGHelper(DependencyObject obj, DataGridHelper value)
-        {
-            obj.SetValue(DGHelperProperty, value);
-        }
-
-        static EditingControlBehavior GetControlBehavior(DependencyObject obj)
-        {
-            return (EditingControlBehavior)obj.GetValue(ControlBehaviorProperty);
-        }
-
-        static void SetControlBehavior(DependencyObject obj, EditingControlBehavior value)
-        {
-            obj.SetValue(ControlBehaviorProperty, value);
-        }
-
-        static bool GetNewRowLoaded(DependencyObject obj)
-        {
-            return (bool)obj.GetValue(NewRowLoadedProperty);
-        }
-
-        static void SetNewRowLoaded(DependencyObject obj, bool value)
-        {
-            obj.SetValue(NewRowLoadedProperty, value);
-        }
-
-        static bool GetIsCommitInProgress(DependencyObject obj)
-        {
-            return (bool)obj.GetValue(IsCommitInProgressProperty);
-        }
-
-        static void SetIsCommitInProgress(DependencyObject obj, bool value)
-        {
-            obj.SetValue(IsCommitInProgressProperty, value);
-        }
-
-        public static DataGridCell GetCell(DataGrid dataGrid, int row, int column)
-        {
-            DataGridRow rowContainer = GetRow(dataGrid, row);
-            if (rowContainer != null)
-            {
-                DataGridCellsPresenter presenter = GetVisualChild<DataGridCellsPresenter>(rowContainer);
-                if (presenter != null)
-                {
-                    // try to get the cell but it may possibly be virtualized
-                    DataGridCell cell = (DataGridCell)presenter.ItemContainerGenerator.ContainerFromIndex(column);
-                    if (cell == null)
-                    {
-                        // now try to bring into view and retreive the cell
-                        dataGrid.ScrollIntoView(rowContainer, dataGrid.Columns[column]);
-
-                        cell = (DataGridCell)presenter.ItemContainerGenerator.ContainerFromIndex(column);
-                    }
-
-                    return cell;
-                }
-            }
-
-            return null;
-        }
-
-        internal static ModelItem GetSingleSelectedObject(DataGrid dataGrid)
-        {
-            if (dataGrid == null || dataGrid.SelectedItems == null || dataGrid.SelectedItems.Count != 1)
-            {
-                return null;
-            }
-
-            if (dataGrid.SelectedItems[0] == CollectionView.NewItemPlaceholder)
-            {
-                return null;
-            }
-
-            DesignObjectWrapper designObjectWrapper = dataGrid.SelectedItems[0] as DesignObjectWrapper;
-            if (designObjectWrapper != null)
-            {
-                return designObjectWrapper.ReflectedObject;
-            }
-
-            return null;
-        }
-
-        /// <summary>
-        /// Gets the DataGridRow based on the given index
-        /// </summary>
-        /// <param name="index">the index of the container to get</param>
-        public static DataGridRow GetRow(DataGrid dataGrid, int index)
-        {
-            DataGridRow row = (DataGridRow)dataGrid.ItemContainerGenerator.ContainerFromIndex(index);
-            if (row == null)
-            {
-                // may be virtualized, bring into view and try again
-                dataGrid.ScrollIntoView(dataGrid.Items[index]);
-                dataGrid.UpdateLayout();
-
-                row = (DataGridRow)dataGrid.ItemContainerGenerator.ContainerFromIndex(index);
-            }
-
-            return row;
-        }
-
-        public static T GetVisualChild<T>(DependencyObject parent) where T : Visual
-        {
-            T child = default(T);
-
-            int numVisuals = VisualTreeHelper.GetChildrenCount(parent);
-            for (int i = 0; i < numVisuals; i++)
-            {
-                Visual v = (Visual)VisualTreeHelper.GetChild(parent, i);
-                child = v as T;
-                if (child == null)
-                {
-                    child = GetVisualChild<T>(v);
-                }
-                if (child != null)
-                {
-                    break;
-                }
-            }
-
-            return child;
-        }
-
-        public static void CommitPendingEdits(DataGrid dataGrid)
-        {
-            if (null == dataGrid)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("dataGrid"));
-            }
-
-            if (!GetIsCommitInProgress(dataGrid))
-            {
-                SetIsCommitInProgress(dataGrid, true);
-
-                //try to commit edit
-                bool commitSucceeded = false;
-                DataGridHelper helper = DataGridHelper.GetDGHelper(dataGrid) as DataGridHelper;
-                bool orginalExplicitCommit = helper.ExplicitCommit;
-                helper.ExplicitCommit = true;
-                try
-                {
-                    commitSucceeded = dataGrid.CommitEdit(DataGridEditingUnit.Row, true);
-                }
-                catch (InvalidOperationException)
-                {
-                    // Ignore and cancel edit
-                }
-                finally
-                {
-                    //if commit fails - undo change
-                    if (!commitSucceeded)
-                    {
-                        dataGrid.CancelEdit();
-                    }
-                    helper.ExplicitCommit = orginalExplicitCommit;
-                }
-
-                SetIsCommitInProgress(dataGrid, false);
-            }
-        }
-
-        public static void OnDeleteSelectedItems(DataGrid dataGrid)
-        {
-            if (dataGrid == null
-                || dataGrid.SelectedItems == null
-                || dataGrid.SelectedItems.Count == 0
-                || dataGrid.ItemsSource == null)
-            {
-                return;
-            }
-
-            if (!(dataGrid.ItemsSource is IList))
-            {
-                // if the item source is not a list
-                // we can't delete items from it.
-                return;
-            }
-
-            Int32 nextSelectedIndex = -1;
-            ICollection<object> toBeDeleted = new HashSet<object>();
-            foreach (object obj in dataGrid.SelectedItems)
-            {
-                toBeDeleted.Add(obj);
-            }
-
-            if (toBeDeleted.Count == 0)
-            {
-                return;
-            }
-
-            if (toBeDeleted.Count == 1)
-            {
-                // if it is single selection,
-                // set selected index to be the current selected index.
-                // Set nextSelectedIndex only in single selection to keep the behavior
-                // consistent with the "delete" button on key board, where if you 
-                // select more than one items and push the "Delete" button on keyboard,
-                // nothing will be selected. 
-                nextSelectedIndex = dataGrid.Items.IndexOf(toBeDeleted.ElementAt(0));
-            }
-
-            IList itemSource = (IList)dataGrid.ItemsSource;
-            foreach (object obj in toBeDeleted)
-            {
-                itemSource.Remove(obj);
-            }
-
-            if (nextSelectedIndex >= 0
-                && nextSelectedIndex < dataGrid.Items.Count - 1)
-            {
-                // The last row, whose index is (dataGrid.Items.Count - 1), is
-                // the "add new item" row.
-                dataGrid.SelectedIndex = nextSelectedIndex;
-            }
-        }
-
-        internal abstract class EditingControlBehavior
-        {
-            protected DesignerView DesignerView
-            {
-                get;
-                private set;
-            }
-
-            protected DataGrid OwnerDataGrid
-            {
-                get;
-                set;
-            }
-
-            public EditingControlBehavior(DataGrid dataGrid)
-            {
-                this.OwnerDataGrid = dataGrid;
-                var helper = DataGridHelper.GetDGHelper(dataGrid);
-                if (null != helper && null != helper.Context)
-                {
-                    this.DesignerView = helper.Context.Services.GetService<DesignerView>();
-                }
-            }
-
-            public abstract bool HandleControlLoaded(Control control, DataGridCell cell, bool newRowLoaded);
-            public abstract bool ControlUnloaded(Control control, DataGridCell cell);
-
-            protected void ToggleDesignerViewAutoCommit(bool shouldIgnore)
-            {
-                if (null != this.DesignerView)
-                {
-                    //enable/disable handling of lost keyboard focus events in designer view - 
-                    //if shouldIgnore is true, designer view should ignore keyboard focus events thus, not forcing DataGrid to 
-                    //commit any changes
-                    this.DesignerView.ShouldIgnoreDataGridAutoCommit = shouldIgnore;
-                }
-            }
-        }
-
-        internal sealed class DefaultControlBehavior : EditingControlBehavior
-        {
-            public DefaultControlBehavior(DataGrid dataGrid)
-                : base(dataGrid)
-            { }
-
-            public override bool HandleControlLoaded(Control control, DataGridCell cell, bool newRowLoaded)
-            {
-                System.Diagnostics.Debug.WriteLine("DefaultControlBehavior.HandleControlLoaded");
-                control.Focus();
-                return true;
-            }
-
-            public override bool ControlUnloaded(Control control, DataGridCell cell)
-            {
-                System.Diagnostics.Debug.WriteLine("DefaultControlBehavior.ControlUnloaded");
-                return true;
-            }
-        }
-
-        internal sealed class TextBoxBehavior : EditingControlBehavior
-        {
-            public TextBoxBehavior(DataGrid dataGrid)
-                : base(dataGrid)
-            { }
-
-            public override bool HandleControlLoaded(Control control, DataGridCell cell, bool newRowLoaded)
-            {
-                System.Diagnostics.Debug.WriteLine("TextBoxBehavior.HandleControlLoaded");
-                bool handled = false;
-                TextBox tb = control as TextBox;
-                if (null != tb)
-                {
-                    if (newRowLoaded)
-                    {
-                        tb.SelectAll();
-                    }
-                    else
-                    {
-                        tb.CaretIndex = tb.Text.Length;
-                    }
-                    tb.Focus();
-                    handled = true;
-                }
-                return handled;
-            }
-
-            public override bool ControlUnloaded(Control control, DataGridCell cell)
-            {
-                System.Diagnostics.Debug.WriteLine("TextBoxBehavior.ControlUnloaded");
-                return true;
-            }
-        }
-
-        internal sealed class VBIdentifierDesignerBehavior : EditingControlBehavior
-        {
-            public VBIdentifierDesignerBehavior(DataGrid dataGrid)
-                : base(dataGrid)
-            { }
-
-            public override bool HandleControlLoaded(Control control, DataGridCell cell, bool newRowLoaded)
-            {
-                System.Diagnostics.Debug.WriteLine("VBIdentifierDesignerBehavior.HandleControlLoaded");
-                bool handled = false;
-                VBIdentifierDesigner identifierDesigner = control as VBIdentifierDesigner;
-                if ((null != identifierDesigner) && (!identifierDesigner.IsReadOnly))
-                {
-                    if (newRowLoaded)
-                    {
-                        DataGridHelper.SetNewRowLoaded(identifierDesigner, true);
-                    }
-                    else
-                    {
-                        DataGridHelper.SetNewRowLoaded(identifierDesigner, false);
-                    }
-
-                    identifierDesigner.TextBoxPropertyChanged += this.OnIdentifierDesignerTextBoxChanged;
-                    identifierDesigner.Focus();
-                    handled = true;
-                }
-                return handled;
-            }
-
-            void OnIdentifierDesignerTextBoxChanged(object sender, PropertyChangedEventArgs e)
-            {
-                Fx.Assert(e.PropertyName == "IdentifierTextBox", "VBIdentifierDesignerBehavior.TextBoxPropertyChanged event should only be raised when IdentifierTextBox property is changed.");
-                VBIdentifierDesigner identifierDesigner = sender as VBIdentifierDesigner;
-                TextBox textBox = identifierDesigner.IdentifierTextBox;
-                if (textBox != null)
-                {
-                    if (DataGridHelper.GetNewRowLoaded(identifierDesigner))
-                    {
-                        textBox.SelectAll();
-                        DataGridHelper.SetNewRowLoaded(identifierDesigner, false);
-                    }
-                    else
-                    {
-                        textBox.CaretIndex = textBox.Text.Length;
-                    }
-                    textBox.Focus();
-                }
-            }
-
-            public override bool ControlUnloaded(Control control, DataGridCell cell)
-            {
-                System.Diagnostics.Debug.WriteLine("VBIdentifierDesignerBehavior.ControlUnloaded");
-                VBIdentifierDesigner identifierDesigner = control as VBIdentifierDesigner;
-                if (identifierDesigner != null)
-                {
-                    identifierDesigner.TextBoxPropertyChanged -= this.OnIdentifierDesignerTextBoxChanged;
-                }
-                return true;
-            }
-        }
-
-        internal sealed class TypePresenterBehavior : EditingControlBehavior
-        {
-            DataGridCell cell;
-            TypePresenter typePresenter;
-            bool isTypeBrowserOpen = false;
-            bool isRegisteredForEvents = false;
-
-            public TypePresenterBehavior(DataGrid dataGrid)
-                : base(dataGrid)
-            {
-                DataGridHelper helper = DataGridHelper.GetDGHelper(dataGrid) as DataGridHelper;
-                helper.DataGridCellEditEnding += OnCellEditEnding;
-            }
-
-            public override bool HandleControlLoaded(Control control, DataGridCell cell, bool newRowLoaded)
-            {
-                System.Diagnostics.Debug.WriteLine("TypePresenterBehavior.HandleControlLoaded");
-                bool handled = false;
-                this.cell = cell;
-                this.typePresenter = control as TypePresenter;
-                if (null != this.typePresenter)
-                {
-                    this.isRegisteredForEvents = true;
-                    this.typePresenter.TypeBrowserOpened += OnTypeBrowserOpened;
-                    this.typePresenter.TypeBrowserClosed += OnTypeBrowserClosed;
-
-                    handled = this.typePresenter.typeComboBox.Focus();
-                }
-                return handled;
-            }
-
-            public override bool ControlUnloaded(Control control, DataGridCell cell)
-            {
-                System.Diagnostics.Debug.WriteLine("TypePresenterBehavior.ControlUnloaded");
-                this.cell = null;
-                if (this.isRegisteredForEvents && null != this.typePresenter)
-                {
-                    this.typePresenter.TypeBrowserOpened -= OnTypeBrowserOpened;
-                    this.typePresenter.TypeBrowserClosed -= OnTypeBrowserClosed;
-                    this.typePresenter = null;
-                    this.isRegisteredForEvents = false;
-                    DataGridHelper helper = DataGridHelper.GetDGHelper(this.OwnerDataGrid) as DataGridHelper;
-                    helper.DataGridCellEditEnding -= this.OnCellEditEnding;
-                }
-                return true;
-            }
-
-            void OnCellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
-            {
-                if (null != this.cell)
-                {
-                    e.Cancel = this.isTypeBrowserOpen;
-                }
-            }
-
-            void OnTypeBrowserOpened(object sender, RoutedEventArgs e)
-            {
-                base.ToggleDesignerViewAutoCommit(true);
-                this.isTypeBrowserOpen = true;
-            }
-
-            void OnTypeBrowserClosed(object sender, RoutedEventArgs e)
-            {
-                base.ToggleDesignerViewAutoCommit(false);
-                this.isTypeBrowserOpen = false;
-            }
-        }
-
-        internal sealed class ExpressionTextBoxBehavior : EditingControlBehavior
-        {
-            bool isExpressionEditInProgress;
-            DataGridCell cell;
-
-            public ExpressionTextBoxBehavior(DataGrid dataGrid)
-                : base(dataGrid)
-            {
-                DataGridHelper helper = DataGridHelper.GetDGHelper(dataGrid) as DataGridHelper;
-                helper.DataGridCellEditEnding += OnCellEditEnding;
-            }
-
-            public override bool HandleControlLoaded(Control control, DataGridCell cell, bool newRowLoaded)
-            {
-                System.Diagnostics.Debug.WriteLine("ExpressionTextBoxBehavior.HandleControlLoaded");
-                bool handled = false;
-                this.cell = cell;
-                ExpressionTextBox etb = control as ExpressionTextBox;
-                if (null != etb)
-                {
-                    etb.Tag = cell;
-                    //register for logical lost focus events 
-                    etb.EditorLostLogicalFocus += OnExpressionEditComplete;
-
-                    if (!etb.IsReadOnly)
-                    {
-                        //start editing expression
-                        etb.BeginEdit();
-                        //mark expression edit is in progress, so all CellEditEnding calls will be ignored by datagrid
-                        this.isExpressionEditInProgress = true;
-                        //disable forced keyboard focus lost events - intelisense window will trigger lost keyboard event, 
-                        //which eventualy will lead to commit edit
-                        base.ToggleDesignerViewAutoCommit(true);
-                    }
-                    handled = true;
-                }
-                return handled;
-            }
-
-            public override bool ControlUnloaded(Control control, DataGridCell cell)
-            {
-                System.Diagnostics.Debug.WriteLine("ExpressionTextBoxBehavior.ControlUnloaded");
-                ExpressionTextBox etb = control as ExpressionTextBox;
-                if (null != etb)
-                {
-                    //control is unloaded - unregister from the event
-                    etb.EditorLostLogicalFocus -= OnExpressionEditComplete;
-                    //if it happens that complete row is beeing unloaded, it is possible that expression edit was still in progress
-                    if (this.isExpressionEditInProgress)
-                    {
-                        //force expression update before unload is complete
-                        this.OnExpressionEditComplete(etb, null);
-                    }
-                }
-                DataGridHelper helper = DataGridHelper.GetDGHelper(this.OwnerDataGrid) as DataGridHelper;
-                helper.DataGridCellEditEnding -= OnCellEditEnding;
-                this.cell = null;
-                return true;
-            }
-
-            void OnExpressionEditComplete(object sender, RoutedEventArgs e)
-            {
-                if (this.isExpressionEditInProgress)
-                {
-                    ExpressionTextBox etb = (ExpressionTextBox)sender;
-                    //commit the expression value
-                    ((RoutedCommand)DesignerView.CommitCommand).Execute(null, etb);
-                    //allow data grid to consume cell editing events
-                    this.isExpressionEditInProgress = false;
-                    this.OwnerDataGrid.CommitEdit();
-                    //restore keyboard focus handling for designer view
-                    base.ToggleDesignerViewAutoCommit(false);
-                }
-            }
-
-            void OnCellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
-            {
-                DataGridHelper helper = DataGridHelper.GetDGHelper(this.OwnerDataGrid) as DataGridHelper;
-                if (this.isExpressionEditInProgress && (helper != null) && !helper.ExplicitCommit)
-                {
-                    e.Cancel = true;
-                }
-                else if (this.isExpressionEditInProgress)
-                {
-                    ExpressionTextBox etb = VisualTreeUtils.GetTemplateChild<ExpressionTextBox>(e.EditingElement);
-                    this.OnExpressionEditComplete(etb, null);
-                }
-            }
-        }
-    }
-
-    sealed class ResolveTemplateParams
-    {
-        internal ResolveTemplateParams(DataGridCell cell, object instance)
-        {
-            this.Cell = cell;
-            this.Instance = instance;
-            this.IsDefaultTemplate = true;
-        }
-
-        public DataGridCell Cell { get; private set; }
-        public object Instance { get; private set; }
-        public bool IsDefaultTemplate { get; set; }
-        public DataTemplate Template { get; set; }
-    }
-
-    sealed class ErrorToTooltipConverter : IMultiValueConverter
-    {
-        DataGridHelper owner;
-        DataTemplate toolTipTemplate;
-
-        public ErrorToTooltipConverter(DataGridHelper owner)
-        {
-            this.owner = owner;
-            this.toolTipTemplate = (DataTemplate)this.owner.FindResource("errorToolTipTemplate");
-        }
-
-        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-        {
-            var entry = values.OfType<DesignObjectWrapper>().FirstOrDefault();
-            var row = values.OfType<DataGridRow>().FirstOrDefault();
-            if (this.owner.IsEditInProgress && null != entry && entry.HasErrors && null != row)
-            {
-                var invalidProperties = new List<string>();
-                if (this.owner.ShowValidationErrorAsToolTip)
-                {
-                    var errorTip = new ToolTip()
-                    {
-                        PlacementTarget = row,
-                        Placement = PlacementMode.Bottom,
-                        ContentTemplate = this.toolTipTemplate,
-                        Content = entry.GetValidationErrors(invalidProperties),
-                        Effect = new DropShadowEffect() { ShadowDepth = 1 },
-                    };
-                    AutomationProperties.SetAutomationId(errorTip, "errorToolTip");
-
-                    row.Dispatcher.BeginInvoke(new Action<ToolTip, DataGridRow>((tip, r) =>
-                    {
-                        tip.IsOpen = true;
-                        var dt = new DispatcherTimer(TimeSpan.FromSeconds(6), DispatcherPriority.ApplicationIdle, (sender, e) => { tip.IsOpen = false; }, r.Dispatcher);
-                    }), DispatcherPriority.ApplicationIdle, errorTip, row);
-                }
-                else
-                {
-                    row.Dispatcher.BeginInvoke(new Action<string>((error) =>
-                        {
-                            //get currently focused element
-                            var currentFocus = (UIElement)Keyboard.FocusedElement;
-                            if (null != currentFocus)
-                            {
-                                //if focus was within datagrid's cell, after loosing focus most likely the editing control would be gone, so try to preserve 
-                                //reference to the cell itself
-                                currentFocus = VisualTreeUtils.FindVisualAncestor<DataGridCell>(currentFocus) ?? currentFocus;
-                            }
-                            //show error message (this will result in KeyboardFocus changed
-                            ErrorReporting.ShowErrorMessage(error);
-                            //restore keyboard focus to stored element, but only if it is somewhere within DesignerView (i don't want to mess with focus in other windows)
-                            if (null != currentFocus && null != VisualTreeUtils.FindVisualAncestor<DesignerView>(currentFocus))
-                            {
-                                Keyboard.Focus(currentFocus);
-                            }
-                        }), DispatcherPriority.ApplicationIdle, entry.GetValidationErrors(invalidProperties));
-                }
-                //clear the validation error messages - once the error is raised and displayed, i don't need it anymore in the collection
-                entry.ClearValidationErrors(invalidProperties);
-            }
-            //in case of property grid edit, the errors would be displayed by model item infrastructure, 
-            //so just delegate the call to clear errors collection
-            if (!this.owner.IsEditInProgress && null != entry && entry.HasErrors)
-            {
-                Dispatcher.CurrentDispatcher.BeginInvoke(new Action<DesignObjectWrapper>((instance) =>
-                    {
-                        instance.ClearValidationErrors();
-                    }), DispatcherPriority.ApplicationIdle, entry);
-            }
-            return Binding.DoNothing;
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/DesignerView.Commands.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/DesignerView.Commands.cs
deleted file mode 100644 (file)
index cca39c9..0000000
+++ /dev/null
@@ -1,1767 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Activities.Debugger;
-    using System.Activities.Presentation.Annotations;
-    using System.Activities.Presentation.Debug;
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Services;
-    using System.Activities.Presentation.Sqm;
-    using System.Activities.Statements;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Linq;
-    using System.Runtime;
-    using System.Runtime.InteropServices;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Controls.Primitives;
-    using System.Windows.Data;
-    using System.Windows.Input;
-    using System.Windows.Media.Imaging;
-    using System.Windows.Threading;
-    using Microsoft.Win32;
-    using System.Windows.Documents;
-
-    public partial class DesignerView
-    {
-        public const string CustomMenuItemsSeparatorCommand = "6F455692-EA19-4ac9-ABEE-57F6DF20A687";
-
-        public static readonly DependencyProperty CommandMenuModeProperty =
-            DependencyProperty.RegisterAttached("CommandMenuMode", typeof(CommandMenuMode), typeof(DesignerView), new UIPropertyMetadata(CommandMenuMode.FullCommandMenu));
-
-        static readonly DependencyProperty MenuItemOriginProperty =
-            DependencyProperty.RegisterAttached("MenuItemOrigin", typeof(FrameworkElement), typeof(DesignerView));
-
-        public static readonly DependencyProperty MenuItemStyleProperty =
-            DependencyProperty.Register("MenuItemStyle", typeof(Style), typeof(DesignerView), new UIPropertyMetadata(null));
-
-        public static readonly DependencyProperty MenuSeparatorStyleProperty =
-            DependencyProperty.Register("MenuSeparatorStyle", typeof(Style), typeof(DesignerView), new UIPropertyMetadata(null));
-
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes,
-            Justification = "The class RoutedCommand just has readonly properties, hence the referencetype instance cannot be modified")]
-        public static readonly ICommand GoToParentCommand = new RoutedCommand("GoToParentCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand ExpandCommand = new RoutedCommand("ExpandCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand ExpandAllCommand = new RoutedCommand("ExpandAllCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand CollapseCommand = new RoutedCommand("CollapseCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand CollapseAllCommand = new RoutedCommand("CollapseAllCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand RestoreCommand = new RoutedCommand("RestoreCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand ExpandInPlaceCommand = new RoutedCommand("ExpandInPlaceCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand InsertBreakpointCommand = new RoutedCommand("InsertBreakpointCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand DeleteBreakpointCommand = new RoutedCommand("DeleteBreakpointParentCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand EnableBreakpointCommand = new RoutedCommand("EnableBreakpointCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand DisableBreakpointCommand = new RoutedCommand("DisableBreakpointCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand SaveAsImageCommand = new RoutedCommand("SaveAsImageCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand CopyAsImageCommand = new RoutedCommand("CopyAsImageCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand ZoomInCommand = new RoutedCommand("ZoomInCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand ZoomOutCommand = new RoutedCommand("ZoomOutCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand ToggleArgumentDesignerCommand = new RoutedCommand("ToggleArgumentDesignerCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand ToggleImportsDesignerCommand = new RoutedCommand("ToggleImportsDesignerCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand ToggleVariableDesignerCommand = new RoutedCommand("ToggleVariableDesignerCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand CreateVariableCommand = new RoutedCommand("CreateVariableCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand ToggleMiniMapCommand = new RoutedCommand("ToggleMinimapCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand CycleThroughDesignerCommand = new RoutedCommand("CycleThroughDesignerCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand CreateWorkflowElementCommand = new RoutedCommand("CreateWorkflowElementCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand CreateArgumentCommand = new RoutedCommand("CreateArgumentCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand CommitCommand = new RoutedCommand("CommitCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand FitToScreenCommand = new RoutedCommand("FitToScreenCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand ResetZoomCommand = new RoutedCommand("ResetZoomCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand MoveFocusCommand = new RoutedCommand("MoveFocusCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand ToggleSelectionCommand = new RoutedCommand("ToggleSelectionCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand CutCommand = new RoutedCommand("CutCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand CopyCommand = new RoutedCommand("CopyCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand PasteCommand = new RoutedCommand("PasteCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand SelectAllCommand = new RoutedCommand("SelectAllCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand UndoCommand = new RoutedCommand("UndoCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand RedoCommand = new RoutedCommand("RedoCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand AddAnnotationCommand = new RoutedCommand("AddAnnotationCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand EditAnnotationCommand = new RoutedCommand("EditAnnotationCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand DeleteAnnotationCommand = new RoutedCommand("DeleteAnnotationCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand ShowAllAnnotationCommand = new RoutedCommand("ShowAllAnnotationCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand HideAllAnnotationCommand = new RoutedCommand("HideAllAnnotationCommand", typeof(DesignerView));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand DeleteAllAnnotationCommand = new RoutedCommand("DeleteAllAnnotationCommand", typeof(DesignerView));
-
-        WorkflowViewElement contextMenuTarget;
-        HashSet<CommandBinding> ignoreCommands = new HashSet<CommandBinding>();
-
-        Func<WorkflowViewElement, bool, Visibility> navigateToParentFunction;
-        Func<WorkflowViewElement, bool, Visibility> navigateToChildFunction;
-        Func<WorkflowViewElement, BreakpointTypes> getBreakpointType;
-        Func<bool> isCommandServiceEnabled;
-        Func<bool> areBreakpointServicesEnabled;
-        Func<int, bool> isCommandSupported;
-
-        bool ContainsChordKeyGestures(InputGestureCollection collection)
-        {
-            if (collection == null)
-            {
-                return false;
-            }
-            else
-            {
-                foreach (KeyGesture gesture in collection)
-                {
-                    if (gesture.GetType() == typeof(DefaultCommandExtensionCallback.ChordKeyGesture))
-                    {
-                        return true;
-                    }
-                }
-                return false;
-            }
-        }
-
-        // Set chordkey gestures owner to this class, so that the chordkey can clear other chord key's mode
-        // after executing.
-        void SetChordKeyGesturesOwner()
-        {
-            foreach (CommandBinding binding in this.CommandBindings)
-            {
-                RoutedCommand cmd = binding.Command as RoutedCommand;
-                foreach (KeyGesture gesture in cmd.InputGestures)
-                {
-                    if (gesture.GetType() == typeof(DefaultCommandExtensionCallback.ChordKeyGesture))
-                    {
-                        ((DefaultCommandExtensionCallback.ChordKeyGesture)gesture).Owner = this;
-                    }
-                }
-            }
-        }
-
-        // Let the chord command in front, so that the chord command (e.g. Ctrl+E,Ctrl+V) will match
-        // before the (e.g. Ctrl+V).
-        void ReorderCommandBindings()
-        {
-            CommandBindingCollection chordCommandBindings = new CommandBindingCollection();
-            CommandBindingCollection basicCommandBindings = new CommandBindingCollection();
-            foreach (CommandBinding binding in this.CommandBindings)
-            {
-                RoutedCommand cmd = binding.Command as RoutedCommand;
-                if (ContainsChordKeyGestures(cmd.InputGestures))
-                {
-                    chordCommandBindings.Add(binding);
-                }
-                else
-                {
-                    basicCommandBindings.Add(binding);
-                }
-            }
-            this.CommandBindings.Clear();
-            this.CommandBindings.AddRange(chordCommandBindings);
-            this.CommandBindings.AddRange(basicCommandBindings);
-        }
-
-        internal void ResetAllChordKeyGesturesMode()
-        {
-            foreach (CommandBinding binding in this.CommandBindings)
-            {
-                RoutedCommand cmd = binding.Command as RoutedCommand;
-                foreach (KeyGesture gesture in cmd.InputGestures)
-                {
-                    if (gesture.GetType() == typeof(DefaultCommandExtensionCallback.ChordKeyGesture))
-                    {
-                        ((DefaultCommandExtensionCallback.ChordKeyGesture)gesture).ResetChordMode();
-                    }
-                }
-            }
-        }
-
-        void InitializeMenuActions()
-        {
-            this.isCommandServiceEnabled = () =>
-                {
-                    return null != this.Context.Services.GetService<ICommandService>();
-                };
-
-            this.areBreakpointServicesEnabled = () =>
-                {
-                    return null != this.Context.Services.GetService<IDesignerDebugView>() && this.isCommandServiceEnabled();
-                };
-
-            this.isCommandSupported = commandId =>
-                {
-                    return this.Context.Services.GetService<ICommandService>().IsCommandSupported(commandId);
-                };
-
-
-            this.navigateToParentFunction = (selection, shouldExecute) =>
-                {
-                    bool result = false;
-                    ModelItem target = null;
-                    if (null != selection && selection.Equals(this.RootDesigner))
-                    {
-                        if (null != selection.ModelItem.Parent)
-                        {
-                            WorkflowViewService viewService = (WorkflowViewService)this.Context.Services.GetService<ViewService>();
-                            target = selection.ModelItem;
-                            do
-                            {
-                                target = target.Parent;
-                                if (target == null)
-                                {
-                                    break;
-                                }
-                            }
-                            while (!viewService.ShouldAppearOnBreadCrumb(target, true));
-                            result = (null != target);
-                        }
-                    }
-                    if (shouldExecute && result)
-                    {
-                        this.MakeRootDesigner(target);
-                    }
-                    return result ? Visibility.Visible : Visibility.Collapsed;
-                };
-
-            this.navigateToChildFunction = (selection, shouldExecute) =>
-                {
-                    bool result = false;
-                    ModelItem target = null;
-                    if (null != selection && !selection.Equals(this.RootDesigner))
-                    {
-                        target = selection.ModelItem;
-                        WorkflowViewService viewService = (WorkflowViewService)this.Context.Services.GetService<ViewService>();
-                        result = viewService.ShouldAppearOnBreadCrumb(target, true);
-                    }
-                    if (shouldExecute && result)
-                    {
-                        this.MakeRootDesigner(target);
-                    }
-                    return result ? Visibility.Visible : Visibility.Collapsed;
-                };
-
-            this.getBreakpointType = selection =>
-                {
-                    IDesignerDebugView debugView = this.Context.Services.GetService<IDesignerDebugView>();
-                    var breakpoints = debugView.GetBreakpointLocations();
-                    BreakpointTypes result = BreakpointTypes.None;
-                    if (null != breakpoints && null != debugView.SelectedLocation)
-                    {
-                        breakpoints.TryGetValue(debugView.SelectedLocation, out result);
-                    }
-                    return result;
-                };
-            this.ContextMenu.ClipToBounds = false;
-
-            //workflow command extension callback invoker
-            Action<WorkflowCommandExtensionItem> updateCommands = (item) =>
-                {
-                    //if there are any commands which were ignored - add them back to bindings collections
-                    foreach (CommandBinding binding in this.ignoreCommands)
-                    {
-                        this.CommandBindings.Add(binding);
-                    }
-                    this.ignoreCommands.Clear();
-
-                    if (null != item.CommandExtensionCallback)
-                    {
-                        foreach (CommandBinding cb in this.CommandBindings)
-                        {
-                            //if callback returns false, it means that user will handle the command, add it to ingore list
-                            CommandInfo ci = new CommandInfo(cb.Command);
-                            item.CommandExtensionCallback.OnWorkflowCommandLoaded(ci);
-                            if (!ci.IsBindingEnabledInDesigner)
-                            {
-                                this.ignoreCommands.Add(cb);
-                            }
-
-                        }
-                        //remove all commands from ignore list from bindings - let the commands bubble up to the client
-                        foreach (CommandBinding cb in this.ignoreCommands)
-                        {
-                            this.CommandBindings.Remove(cb);
-                        }
-
-                        if (null != this.ContextMenu && this.ContextMenu.HasItems)
-                        {
-                            foreach (MenuItem menuItem in this.ContextMenu.Items.OfType<MenuItem>())
-                            {
-                                this.RefreshContextMenu(menuItem);
-                            }
-                        }
-                    }
-                    if (item.CommandExtensionCallback.GetType() == typeof(DefaultCommandExtensionCallback))
-                    {
-                        this.ReorderCommandBindings();
-                        this.SetChordKeyGesturesOwner();
-                    }
-                };
-
-            //subscribe for command extension callback changes;
-            this.context.Items.Subscribe<WorkflowCommandExtensionItem>(new SubscribeContextCallback<WorkflowCommandExtensionItem>(updateCommands));
-            //if entry already exists - invoke update; if entry doesn't exist - do nothing. perhaps it will be added later by the user
-            if (this.context.Items.Contains<WorkflowCommandExtensionItem>())
-            {
-                updateCommands(this.context.Items.GetValue<WorkflowCommandExtensionItem>());
-            }
-        }
-
-        public Style MenuItemStyle
-        {
-            get { return (Style)GetValue(MenuItemStyleProperty); }
-            set { SetValue(MenuItemStyleProperty, value); }
-        }
-
-        public Style MenuSeparatorStyle
-        {
-            get { return (Style)GetValue(MenuSeparatorStyleProperty); }
-            set { SetValue(MenuSeparatorStyleProperty, value); }
-        }
-
-        void RefreshContextMenu(MenuItem menuItem)
-        {
-            if (null != menuItem.Command)
-            {
-                //update MenuItem's Command property - if user did update any keyboard shortcuts, then it would be reflected by that change
-                ICommand cmd = menuItem.Command;
-                menuItem.Command = null;
-                menuItem.Command = cmd;
-            }
-            if (menuItem.HasItems)
-            {
-                foreach (MenuItem subItem in menuItem.Items.OfType<MenuItem>())
-                {
-                    this.RefreshContextMenu(subItem);
-                }
-            }
-        }
-
-        protected override void OnContextMenuOpening(ContextMenuEventArgs e)
-        {
-            bool shouldDisplayMenu = false;
-            DependencyObject target = null;
-            DependencyObject source = e.OriginalSource as DependencyObject;
-            if (source is Adorner)
-            {
-                source = ((Adorner)source).AdornedElement;
-            }
-
-            DependencyObject designerPresenterSource = this.designerPresenter.FindCommonVisualAncestor(source);
-            DependencyObject extensionSurfaceSource = this.wfViewExtensionSurface.FindCommonVisualAncestor(source);
-
-            //check, who is trying to open context menu - i limit context menu to only elements which are visible inside
-            //core of the workflow designer - no breadcrumb or toolbox
-            if (designerPresenterSource == this.designerPresenter || extensionSurfaceSource == this.wfViewExtensionSurface)
-            {
-                Selection currentSelection = this.Context.Items.GetValue<Selection>();
-                if (null != currentSelection && currentSelection.SelectionCount >= 1)
-                {
-                    if (currentSelection.SelectionCount == 1) // single selection
-                    {
-                        //check original source, to see if it prevents displaying context menu
-                        if (!CommandMenuMode.Equals(CommandMenuMode.NoCommandMenu, GetCommandMenuMode((DependencyObject)e.OriginalSource)))
-                        {
-                            if (null != currentSelection.PrimarySelection.View)
-                            {
-                                target = currentSelection.PrimarySelection.View;
-                                shouldDisplayMenu = true;
-                            }
-                        }
-                    }
-                    else // multi-selection
-                    {
-                        // If Multi-selection's context menu was not enabled, don't display menu.
-                        shouldDisplayMenu = Context.Services.GetService<DesignerConfigurationService>().MultipleItemsContextMenuEnabled;
-                    }
-                }
-            }
-            e.Handled = true;
-            base.OnContextMenuOpening(e);
-
-            if (shouldDisplayMenu)
-            {
-                // if the context menu is triggered by a context menu key, open context menu at the center of the designer;
-                // else open the context menu at mouse point
-                this.LoadContextMenu((UIElement)target, (e.CursorLeft < 0 && e.CursorTop < 0));
-            }
-        }
-
-        void LoadContextMenu(UIElement sender, bool openedByKeyboard)
-        {
-            if (this.ContextMenu == null)
-            {
-                return;
-            }
-
-            if (!Selection.MultipleObjectsSelected(this.Context) && sender != null && CommandMenuMode.Equals(CommandMenuMode.NoCommandMenu, GetCommandMenuMode(sender)))
-            {
-                return;
-            }
-
-            //clear context menu state
-            this.UnloadContextMenu(this.ContextMenu);
-
-            this.contextMenuTarget = sender as WorkflowViewElement;
-
-            //because of WPF caching behaviour, i have to create new instance of context menu each time it is shown
-            ContextMenu newMenu = new ContextMenu() { ItemContainerStyleSelector = new ContextMenuItemStyleSelector(this) };
-            newMenu.Loaded += this.OnWorkflowViewContextMenuLoaded;
-            newMenu.Unloaded += this.OnWorkflowViewContextMenuClosed;
-            foreach (var entry in this.ContextMenu.Items.OfType<Control>().Reverse())
-            {
-                this.ContextMenu.Items.Remove(entry);
-                entry.Visibility = Visibility.Visible;
-                newMenu.Items.Insert(0, entry);
-            }
-            this.ContextMenu = newMenu;
-
-            if (!Selection.MultipleObjectsSelected(this.Context))
-            {
-                if (null != this.contextMenuTarget && null != this.contextMenuTarget.ContextMenu)
-                {
-                    var items = this.contextMenuTarget.ContextMenu.Items.OfType<Control>().Reverse();
-                    int insertIndex = this.ContextMenu.Items.Count;
-
-                    foreach (var item in items)
-                    {
-                        this.contextMenuTarget.ContextMenu.Items.Remove(item);
-                        DesignerView.SetMenuItemOrigin(item, this.contextMenuTarget);
-                        this.ContextMenu.Items.Insert(insertIndex, item);
-                    }
-                }
-
-                Fx.Assert(this.contextMenuTarget.IsVisible, string.Format(CultureInfo.InvariantCulture, "ContextMenuTarget {0} is not visible", this.contextMenuTarget.GetType()));
-                this.ContextMenu.Placement = openedByKeyboard ? PlacementMode.Relative : PlacementMode.MousePoint;
-                this.ContextMenu.PlacementTarget = this.contextMenuTarget;
-            }
-            else
-            {
-                this.ContextMenu.Placement = openedByKeyboard ? PlacementMode.Center : PlacementMode.MousePoint;
-                this.ContextMenu.PlacementTarget = this;
-            }
-
-            this.ContextMenu.IsOpen = true;
-        }
-
-        void UnloadContextMenu(ContextMenu contextMenuToUnload)
-        {
-            if (null != contextMenuToUnload && null != this.contextMenuTarget)
-            {
-                // this should happen only for single selection
-                //select all menu items which do not belong to DesignerView
-                var items = contextMenuToUnload.Items.OfType<Control>()
-                    .Where(p => DesignerView.GetMenuItemOrigin(p) != null)
-                    .Reverse();
-
-                foreach (Control item in items)
-                {
-                    //remove item from designer menu's location
-                    contextMenuToUnload.Items.Remove(item);
-
-                    //and add it back to activity designer
-                    DesignerView.GetMenuItemOrigin(item).ContextMenu.Items.Insert(0, item);
-                    DesignerView.SetMenuItemOrigin(item, null);
-                }
-                this.contextMenuTarget = null;
-                contextMenuToUnload.Loaded -= this.OnWorkflowViewContextMenuLoaded;
-                contextMenuToUnload.Unloaded -= this.OnWorkflowViewContextMenuClosed;
-            }
-        }
-
-        void OnWorkflowViewContextMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            this.ContextMenu.MinWidth = 0;
-            this.ContextMenu.MinWidth = this.ContextMenu.DesiredSize.Width;
-
-            Action<WorkflowViewElement, FrameworkElement> contextMenuLoaded =
-                (designer, menuSource) =>
-                {
-                    System.Diagnostics.Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, "{0} DesignerView.OnWorkflowViewContextMenuLoaded()", DateTime.Now.ToLocalTime()));
-                    if (null != menuSource && null != menuSource.ContextMenu)
-                    {
-                        if (null != designer) // for single selection, designer is the current selected item, we set CommandTarget to current selection
-                        {
-                            foreach (var item in menuSource.ContextMenu.Items.OfType<MenuItem>())
-                            {
-                                item.CommandTarget = designer;
-                            }
-                            designer.NotifyContextMenuLoaded(menuSource.ContextMenu);
-                        }
-                        else // for multiple selection, designer is null, we set the CommandTarget to DesignerView
-                        {
-                            foreach (var item in menuSource.ContextMenu.Items.OfType<MenuItem>())
-                            {
-                                item.CommandTarget = this;
-                            }
-                        }
-                    }
-                };
-            //if context menu is loaded, deffer notification untill its all menu items have been loaded
-            this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, contextMenuLoaded, this.contextMenuTarget, this);
-        }
-
-        void OnWorkflowViewContextMenuClosed(object sender, RoutedEventArgs e)
-        {
-            this.UnloadContextMenu((ContextMenu)sender);
-        }
-
-        void OnMenuItemSeparatorLoaded(object sender, RoutedEventArgs e)
-        {
-            //define a delegate which will handle separator load events
-            Action<Separator> action = (separator) =>
-            {
-                if (null != separator && null != separator.Tag && null != this.ContextMenu)
-                {
-                    //check the separator tags - it should contain command names in a tag property
-                    string[] commands = separator.Tag.ToString().Split(';');
-                    //check if this separator has a special tag value - CustomMenuItemsSeparatorCommand
-                    //it means, it has to be displayed only, when there are custom menu items added to the menu
-                    if (commands.Length == 1 && string.Equals(CustomMenuItemsSeparatorCommand, commands[0]))
-                    {
-                        // The CustomMenuItemsSeparator should be visible only if it has visible child.
-                        int index = this.ContextMenu.Items.IndexOf(separator);
-                        bool visible = false;
-                        for (int i = index + 1; i < this.ContextMenu.Items.Count && !visible; i++)
-                        {
-                            object contextMenuItem = this.ContextMenu.Items[i];
-                            if (contextMenuItem is MenuItem)
-                            {
-                                visible = ((MenuItem)contextMenuItem).Visibility == Visibility.Visible;
-                            }
-                            else
-                            {
-                                // For safety sake, someone might put other things into the ContextMenu.Items other than MenuItem.
-                                visible = true;
-                            }
-                        }
-                        separator.Visibility = visible ? Visibility.Visible : Visibility.Collapsed;
-                    }
-                    else if (commands.Length != 0)
-                    {
-                        //set this separator visibility, if associated menu items have either a name or command.name property set to a passed 
-                        //value, and at least one of the menu item is visible
-                        separator.Visibility = this.ContextMenu.Items
-                            .OfType<MenuItem>()
-                            .Where(item => commands.Any(
-                                    cmd => string.Equals(cmd, null != item.Command && item.Command is RoutedCommand ? ((RoutedCommand)item.Command).Name : item.Name)))
-                                    .Any(item => item.Visibility == Visibility.Visible) ? Visibility.Visible : Visibility.Collapsed;
-                    }
-                }
-            };
-            //postpone separator show/hide logic until all menu items are loaded and their visibility is calculated
-            this.Dispatcher.BeginInvoke(DispatcherPriority.DataBind, action, sender);
-        }
-
-        void OnGoToParentMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            MenuItem item = sender as MenuItem;
-            if (null != item)
-            {
-                if (Selection.MultipleObjectsSelected(this.Context))
-                {
-                    item.Visibility = Visibility.Collapsed;
-                    e.Handled = true;
-                    return;
-                }
-                item.Visibility = this.navigateToParentFunction(this.contextMenuTarget, false);
-            }
-            e.Handled = true;
-        }
-
-        void OnGoToParentCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = true;
-            e.Handled = true;
-        }
-
-        void OnGoToParentCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.navigateToParentFunction(this.contextMenuTarget ?? this.FocusedViewElement, true);
-            e.Handled = true;
-            FeatureUsageCounter.ReportUsage(sqmService, WorkflowDesignerFeatureId.ViewParent);
-        }
-
-        void OnCollapseCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            if (this.FocusedViewElement != null)
-            {
-                e.CanExecute = this.FocusedViewElement.ShowExpanded;
-            }
-            e.Handled = true;
-        }
-
-        void OnCollapseCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.FocusedViewElement.ExpandState = false;
-            if (this.ShouldExpandAll)
-            {
-                this.FocusedViewElement.PinState = true;
-            }
-            e.Handled = true;
-        }
-
-        void OnCollapseAllCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = !this.ShouldCollapseAll;
-            e.Handled = true;
-        }
-
-        void OnCollapseAllCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.ShouldCollapseAll = true;
-            e.Handled = true;
-            FeatureUsageCounter.ReportUsage(sqmService, WorkflowDesignerFeatureId.CollapseAll);
-        }
-
-        void OnRestoreCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = this.ShouldExpandAll || this.ShouldCollapseAll;
-            e.Handled = true;
-        }
-
-        void OnRestoreCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.ShouldExpandAll = false;
-            this.ShouldCollapseAll = false;
-            e.Handled = true;
-            FeatureUsageCounter.ReportUsage(sqmService, WorkflowDesignerFeatureId.Restore);
-        }
-
-        void OnExpandAllCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = !this.ShouldExpandAll;
-            e.Handled = true;
-        }
-
-        void OnExpandAllCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.ShouldExpandAll = true;
-            e.Handled = true;
-            FeatureUsageCounter.ReportUsage(sqmService, WorkflowDesignerFeatureId.ExpandAll);
-        }
-
-        void OnCollapseExpandInPlaceMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            MenuItem item = sender as MenuItem;
-            if (null != item)
-            {
-                if (Selection.MultipleObjectsSelected(this.Context))
-                {
-                    item.Visibility = Visibility.Collapsed;
-                    e.Handled = true;
-                    return;
-                }
-                item.Visibility = ExpandButtonVisibilityConverter.GetExpandCollapseButtonVisibility(this.contextMenuTarget);
-            }
-            e.Handled = true;
-        }
-
-        void OnExpandInPlaceCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            if (this.FocusedViewElement != null)
-            {
-                e.CanExecute = !this.FocusedViewElement.ShowExpanded;
-            }
-            e.Handled = true;
-        }
-
-        void OnExpandInPlaceCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.FocusedViewElement.ExpandState = true;
-            if (this.ShouldCollapseAll)
-            {
-                this.FocusedViewElement.PinState = true;
-            }
-            e.Handled = true;
-        }
-
-        void OnExpandMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            MenuItem item = sender as MenuItem;
-            if (null != item)
-            {
-                if (Selection.MultipleObjectsSelected(this.Context))
-                {
-                    item.Visibility = Visibility.Collapsed;
-                    e.Handled = true;
-                    return;
-                }
-                item.Visibility = this.navigateToChildFunction(this.contextMenuTarget, false);
-            }
-            e.Handled = true;
-        }
-
-        void OnExpandCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = true;
-            e.Handled = true;
-        }
-
-        void OnExpandCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.navigateToChildFunction(this.contextMenuTarget ?? this.FocusedViewElement, true);
-            e.Handled = true;
-            FeatureUsageCounter.ReportUsage(sqmService, WorkflowDesignerFeatureId.OpenChild);
-        }
-
-        void OnCopyCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = !this.IsReadOnly && CutCopyPasteHelper.CanCopy(this.Context);
-            e.ContinueRouting = false;
-            e.Handled = true;
-        }
-
-        void OnCopyCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.Context.Services.GetService<DesignerPerfEventProvider>().WorkflowDesignerCopyStart();
-            CutCopyPasteHelper.DoCopy(this.Context);
-            e.Handled = true;
-            this.Context.Services.GetService<DesignerPerfEventProvider>().WorkflowDesignerCopyEnd();
-        }
-
-        void OnPasteCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = !this.IsReadOnly && CutCopyPasteHelper.CanPaste(this.Context);
-            e.ContinueRouting = false;
-            e.Handled = true;
-        }
-
-        void OnPasteCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            context.Services.GetService<DesignerPerfEventProvider>().WorkflowDesignerPasteStart();
-            WorkflowViewElement sourceElement = e.OriginalSource as WorkflowViewElement;
-            if (sourceElement != null)
-            {
-                Point contextMenuTopLeft = this.ContextMenu.TranslatePoint(new Point(0, 0), sourceElement);
-                CutCopyPasteHelper.DoPaste(this.Context, contextMenuTopLeft, sourceElement);
-            }
-            else
-            {
-                CutCopyPasteHelper.DoPaste(this.Context);
-            }
-            e.Handled = true;
-            context.Services.GetService<DesignerPerfEventProvider>().WorkflowDesignerPasteEnd();
-        }
-
-        void OnCutCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            //handle CutCommand only if Cut reffers to WF designer context menu, otherwise - let target element handle it
-            e.CanExecute = !this.IsReadOnly && CutCopyPasteHelper.CanCut(this.Context);
-            e.ContinueRouting = false;
-            e.Handled = true;
-        }
-
-        void OnCutCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            CutCopyPasteHelper.DoCut(this.Context);
-            e.Handled = true;
-        }
-
-        void OnDeleteCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            //query DeleteHelper if delete can occur - i.e. there is no root element selected
-            e.CanExecute = !this.IsReadOnly && DeleteHelper.CanDelete(this.Context);
-            e.ContinueRouting = false;
-            e.Handled = true;
-        }
-
-        void OnDeleteCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            DeleteHelper.Delete(this.Context);
-            e.Handled = true;
-        }
-
-        void OnPropertiesMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            MenuItem item = sender as MenuItem;
-            if (null != item)
-            {
-                item.Visibility = this.isCommandServiceEnabled() && this.isCommandSupported(CommandValues.ShowProperties) ?
-                    Visibility.Visible : Visibility.Collapsed;
-            }
-            e.Handled = true;
-        }
-
-        void OnShowPropertiesCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = true;
-            e.Handled = true;
-        }
-
-        void OnShowPropertiesCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            //execute ShowProperties command
-            ExecuteCommand(CommandValues.ShowProperties);
-            e.Handled = true;
-        }
-
-        void OnBreakpointMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            MenuItem item = sender as MenuItem;
-            if (null != item)
-            {
-                if (Selection.MultipleObjectsSelected(this.Context))
-                {
-                    item.Visibility = Visibility.Collapsed;
-                    e.Handled = true;
-                    return;
-                }
-                item.Visibility =
-                    this.areBreakpointServicesEnabled() && (this.contextMenuTarget is ActivityDesigner) ?
-                    Visibility.Visible : Visibility.Collapsed;
-            }
-            e.Handled = true;
-        }
-
-        void OnInsertBreakpointMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            MenuItem item = sender as MenuItem;
-            if (null != item)
-            {
-                item.Visibility =
-                    this.areBreakpointServicesEnabled() &&
-                    this.isCommandSupported(CommandValues.InsertBreakpoint) &&
-                    this.getBreakpointType(this.FocusedViewElement) == BreakpointTypes.None ?
-                    Visibility.Visible : Visibility.Collapsed;
-            }
-            e.Handled = true;
-        }
-
-        void OnInsertBreakpointCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = this.FocusedViewElement != null && this.FocusedViewElement.ModelItem != null &&
-                AllowBreakpointAttribute.IsBreakpointAllowed(this.FocusedViewElement.ModelItem.ItemType);
-            e.Handled = true;
-        }
-
-        void OnInsertBreakpointCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            ExecuteCommand(CommandValues.InsertBreakpoint);
-            e.Handled = true;
-        }
-
-        void OnDeleteBreakpointMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            MenuItem item = sender as MenuItem;
-            if (null != item)
-            {
-                item.Visibility =
-                    this.areBreakpointServicesEnabled() &&
-                    this.isCommandSupported(CommandValues.DeleteBreakpoint) &&
-                    this.getBreakpointType(this.FocusedViewElement) != BreakpointTypes.None ?
-                    Visibility.Visible : Visibility.Collapsed;
-            }
-            e.Handled = true;
-        }
-
-        void OnDeleteBreakpointCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = this.FocusedViewElement != null && this.FocusedViewElement.ModelItem != null &&
-                AllowBreakpointAttribute.IsBreakpointAllowed(this.FocusedViewElement.ModelItem.ItemType);
-            e.Handled = true;
-        }
-
-        void OnDeleteBreakpointCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            ExecuteCommand(CommandValues.DeleteBreakpoint);
-            e.Handled = true;
-        }
-
-        void OnEnableBreakpointMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            MenuItem item = sender as MenuItem;
-            if (null != item)
-            {
-                Visibility visibility = Visibility.Collapsed;
-                if (this.areBreakpointServicesEnabled() && this.isCommandSupported(CommandValues.EnableBreakpoint))
-                {
-                    BreakpointTypes breakpoint = this.getBreakpointType(this.FocusedViewElement);
-                    visibility = ((breakpoint & BreakpointTypes.Bounded) != 0 && (breakpoint & BreakpointTypes.Enabled) == 0) ?
-                        Visibility.Visible : Visibility.Collapsed;
-                }
-                item.Visibility = visibility;
-            }
-            e.Handled = true;
-        }
-
-        void OnEnableBreakpointCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = true;
-            e.Handled = true;
-        }
-
-        void OnEnableBreakpointCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            ExecuteCommand(CommandValues.EnableBreakpoint);
-            e.Handled = true;
-        }
-
-        void OnDisableBreakpointMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            MenuItem item = sender as MenuItem;
-            if (null != item)
-            {
-                Visibility visibility = Visibility.Collapsed;
-                if (this.areBreakpointServicesEnabled() && this.isCommandSupported(CommandValues.DisableBreakpoint))
-                {
-                    BreakpointTypes breakpoint = this.getBreakpointType(this.FocusedViewElement);
-                    visibility = ((breakpoint & BreakpointTypes.Bounded) != 0 && (breakpoint & BreakpointTypes.Enabled) != 0) ?
-                        Visibility.Visible : Visibility.Collapsed;
-                }
-                item.Visibility = visibility;
-            }
-            e.Handled = true;
-        }
-
-
-        void OnDisableBreakpointCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = true;
-            e.Handled = true;
-        }
-
-        void OnDisableBreakpointCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            ExecuteCommand(CommandValues.DisableBreakpoint);
-            e.Handled = true;
-        }
-
-        void OnUndoCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.Context.Services.GetService<UndoEngine>().Undo();
-            e.Handled = true;
-        }
-
-        void OnUndoCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = true;
-            e.Handled = true;
-        }
-
-        void OnRedoCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.Context.Services.GetService<UndoEngine>().Redo();
-            e.Handled = true;
-        }
-
-        void OnRedoCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = true;
-            e.Handled = true;
-        }
-
-        void OnCommitCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            TextBox textBox = e.OriginalSource as TextBox;
-            if (textBox != null)
-            {
-                BindingExpression textBinding = textBox.GetBindingExpression(TextBox.TextProperty);
-                if (textBinding != null)
-                {
-                    textBinding.UpdateSource();
-                    e.Handled = true;
-                }
-            }
-        }
-
-        void OnCommitCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = true;
-            e.Handled = true;
-        }
-
-        void OnSelectAllCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.SelectAll();
-            e.Handled = true;
-        }
-
-        void OnCopyAsImageMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            MenuItem item = sender as MenuItem;
-            if (null != item)
-            {
-                if (Selection.MultipleObjectsSelected(this.Context))
-                {
-                    item.Visibility = Visibility.Collapsed;
-                }
-                else
-                {
-                    item.Visibility = Visibility.Visible;
-                }
-            }
-            e.Handled = true;
-        }
-
-        void OnCopyAsImageCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = null != this.RootDesigner;
-            e.Handled = true;
-        }
-
-        void OnCopyAsImageCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            VirtualizedContainerService virtualizingContainerService = this.Context.Services.GetService<VirtualizedContainerService>();
-            virtualizingContainerService.BeginPopulateAll((Action)(() =>
-            {
-                BitmapSource screenShot = this.CreateScreenShot();
-                try
-                {
-                    RetriableClipboard.SetImage(screenShot);
-                }
-                catch (COMException err)
-                {
-                    ErrorReporting.ShowErrorMessage(err.Message);
-                }
-                e.Handled = true;
-                FeatureUsageCounter.ReportUsage(sqmService, WorkflowDesignerFeatureId.CopyAsImage);
-            }));
-        }
-
-        void OnSaveAsImageMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            MenuItem item = sender as MenuItem;
-            if (null != item)
-            {
-                if (Selection.MultipleObjectsSelected(this.Context))
-                {
-                    item.Visibility = Visibility.Collapsed;
-                }
-                else
-                {
-                    item.Visibility = Visibility.Visible;
-                }
-            }
-            e.Handled = true;
-        }
-
-        void OnSaveAsImageCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = null != this.RootDesigner;
-            e.Handled = true;
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.DoNotCatchGeneralExceptionTypes,
-            Justification = "Catching all exceptions to avoid VS Crash")]
-        [SuppressMessage("Reliability", "Reliability108", Justification = "Catching all exceptions to avoid VS Crash")]
-        void OnSaveAsImageCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-
-            ModelItem rootItem = ((WorkflowViewElement)this.RootDesigner).ModelItem;
-            PropertyDescriptor displayNameProperty = TypeDescriptor.GetProperties(rootItem)["DisplayName"];
-            // default to root item's typename
-            string name = rootItem.ItemType.Name;
-            // if there is a display name property on root use that as the file name.
-            if (displayNameProperty != null && displayNameProperty.PropertyType.Equals(typeof(string)))
-            {
-                name = (string)displayNameProperty.GetValue(rootItem);
-            }
-            SaveFileDialog dlg = new SaveFileDialog()
-            {
-                Filter = @"JPG|*.jpg|PNG|*.png|GIF|*.gif|XPS|*.xps",
-                FileName = name
-            };
-            bool? showDialogResult = false;
-            try
-            {
-                showDialogResult = dlg.ShowDialog();
-            }
-            catch (ArgumentException)
-            {
-                dlg.FileName = null;
-                showDialogResult = dlg.ShowDialog();
-            }
-            if (true == showDialogResult && !string.IsNullOrEmpty(dlg.FileName))
-            {
-                VirtualizedContainerService virtualizingContainerService = this.Context.Services.GetService<VirtualizedContainerService>();
-                virtualizingContainerService.BeginPopulateAll((Action)(() =>
-                {
-                    try
-                    {
-                        switch (dlg.FilterIndex)
-                        {
-                            case 1:
-                                this.CreateImageFile(dlg.FileName, typeof(JpegBitmapEncoder));
-                                break;
-
-                            case 2:
-                                this.CreateImageFile(dlg.FileName, typeof(PngBitmapEncoder));
-                                break;
-
-                            case 3:
-                                this.CreateImageFile(dlg.FileName, typeof(GifBitmapEncoder));
-                                break;
-
-                            case 4:
-                                this.CreateXPSDocument(dlg.FileName);
-                                break;
-
-                            default:
-                                throw FxTrace.Exception.AsError(new InvalidOperationException("Not supported file type"));
-                        }
-                    }
-                    catch (Exception err)
-                    {
-                        MessageBox.Show(err.Message, err.GetType().Name, MessageBoxButton.OK, MessageBoxImage.Error);
-                    }
-                }));
-            }
-            e.Handled = true;
-            FeatureUsageCounter.ReportUsage(sqmService, WorkflowDesignerFeatureId.SaveAsImage);
-        }
-
-        void OnZoomInCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = this.zoomToTicksConverter.CanZoomIn();
-            e.Handled = true;
-        }
-
-        void OnZoomInCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.zoomToTicksConverter.ZoomIn();
-            e.Handled = true;
-        }
-
-        void OnMoveFocusCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = true;
-            e.Handled = true;
-        }
-        void OnMoveFocusCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            UIElement focusedElement = Keyboard.FocusedElement as UIElement;
-            if (focusedElement != null)
-            {
-                this.IsMultipleSelectionMode = true;
-                focusedElement.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
-                this.IsMultipleSelectionMode = false;
-            }
-            e.Handled = true;
-        }
-
-        void OnToggleSelectionCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = true;
-            e.Handled = true;
-        }
-        void OnToggleSelectionCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            WorkflowViewElement focusedElement = Keyboard.FocusedElement as WorkflowViewElement;
-            if (focusedElement != null && focusedElement.ModelItem != null)
-            {
-                Selection.Toggle(this.Context, focusedElement.ModelItem);
-            }
-            e.Handled = true;
-        }
-
-        void OnZoomOutCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = this.zoomToTicksConverter.CanZoomOut();
-            e.Handled = true;
-        }
-
-        void OnZoomOutCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.zoomToTicksConverter.ZoomOut();
-            e.Handled = true;
-        }
-
-        void OnToggleArgumentDesignerCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute =
-                ((this.shellBarItemVisibility & ShellBarItemVisibility.Arguments) == ShellBarItemVisibility.Arguments) &&
-                null != this.ActivitySchema &&
-                typeof(ActivityBuilder).IsAssignableFrom(this.ActivitySchema.ItemType);
-            e.Handled = true;
-
-        }
-
-        void OnToggleArgumentDesignerCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.buttonArguments1.IsChecked = !this.buttonArguments1.IsChecked;
-            this.FocusShellBarDesigner(this.arguments1);
-            e.Handled = true;
-        }
-
-        void OnToggleVariableDesignerCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = ((this.shellBarItemVisibility & ShellBarItemVisibility.Variables) == ShellBarItemVisibility.Variables);
-            e.Handled = true;
-        }
-
-        void OnToggleVariableDesignerCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.buttonVariables1.IsChecked = !this.buttonVariables1.IsChecked;
-            this.FocusShellBarDesigner(this.variables1);
-            e.Handled = true;
-        }
-
-        void OnToggleImportsDesignerCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            if ((this.shellBarItemVisibility & ShellBarItemVisibility.Imports) == ShellBarItemVisibility.Imports)
-            {
-                e.CanExecute = true;
-            }
-            else
-            {
-                e.CanExecute = false;
-            }
-            e.Handled = true;
-        }
-
-        void OnToggleImportsDesignerCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.buttonImports1.IsChecked = !this.buttonImports1.IsChecked;
-            this.FocusShellBarDesigner(this.imports1);
-            e.Handled = true;
-        }
-
-        void FocusShellBarDesigner(UIElement designer)
-        {
-            // Focus the Argument/Variable/Imports designer when it is turn on.
-            if (designer.IsEnabled)
-            {
-                if (!designer.IsKeyboardFocusWithin)
-                {
-                    Keyboard.Focus(designer);
-                }
-            }
-            // Focus an activity designer when the Argument/Variable/Imports designer is turned off and has keyboard focus within.
-            else if (designer.IsKeyboardFocusWithin)
-            {
-                Keyboard.Focus(this.GetDesignerToFocus());
-            }
-        }
-
-        void OnCreateVariableMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            MenuItem item = sender as MenuItem;
-            if (null != item)
-            {
-                if (Selection.MultipleObjectsSelected(this.Context))
-                {
-                    item.Visibility = Visibility.Collapsed;
-                    return;
-                }
-                item.Visibility = variablesStatusBarItem.Visibility;
-            }
-        }
-
-        void OnCreateVariableCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute =
-                ((this.shellBarItemVisibility & ShellBarItemVisibility.Variables) == ShellBarItemVisibility.Variables) &&
-                !this.IsReadOnly && null != this.variables1.CurrentVariableScope;
-            e.Handled = true;
-        }
-
-        void OnCreateVariableCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.buttonVariables1.IsChecked = true;
-            this.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(() => { this.variables1.CreateNewVariableWrapper(); }));
-            e.Handled = true;
-        }
-
-        void OnCreateArgumentCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute =
-                ((this.shellBarItemVisibility & ShellBarItemVisibility.Arguments) == ShellBarItemVisibility.Arguments) &&
-                !this.IsReadOnly && null != this.arguments1.ActivitySchema;
-            e.Handled = true;
-        }
-
-        void OnCreateArgumentCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.buttonArguments1.IsChecked = true;
-            this.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(() => { this.arguments1.CreateNewArgumentWrapper(); }));
-            e.Handled = true;
-        }
-
-        void OnToggleMiniMapCommandExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.Handled = e.CanExecute = true;
-        }
-
-        void OnToggleMiniMapCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            e.Handled = true;
-            this.miniMap.IsEnabled = !this.miniMap.IsEnabled;
-        }
-
-        void OnCycleThroughDesignerCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = e.Handled = true;
-        }
-
-        UIElement GetDesignerToFocus()
-        {
-            Selection selection = this.Context.Items.GetValue<Selection>();
-            if (selection.SelectionCount != 0 && selection.PrimarySelection.View != null)
-            {
-                return (UIElement)selection.PrimarySelection.View;
-            }
-            else
-            {
-                return this.RootDesigner;
-            }
-        }
-
-        void OnCycleThroughDesignerCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            UIElement toFocus = this.breadCrumbListBox;
-
-            if (this.BreadCrumbBarLayout.IsKeyboardFocusWithin)
-            {
-                toFocus = this.GetDesignerToFocus();
-            }
-            else if (this.scrollViewer.IsKeyboardFocusWithin)
-            {
-                if ((bool)this.buttonVariables1.IsChecked)
-                {
-                    toFocus = this.variables1;
-                }
-                else if ((bool)this.buttonArguments1.IsChecked)
-                {
-                    toFocus = this.arguments1;
-                }
-                else if ((bool)this.buttonImports1.IsChecked)
-                {
-                    toFocus = this.imports1;
-                }
-                else
-                {
-                    toFocus = this.buttonVariables1;
-                }
-            }
-            else if ((bool)this.buttonVariables1.IsChecked && this.variables1.IsKeyboardFocusWithin)
-            {
-                toFocus = this.buttonVariables1;
-            }
-            else if ((bool)this.buttonArguments1.IsChecked && this.arguments1.IsKeyboardFocusWithin)
-            {
-                toFocus = this.buttonVariables1;
-            }
-            else if ((bool)this.buttonImports1.IsChecked && this.imports1.IsKeyboardFocusWithin)
-            {
-                toFocus = this.buttonVariables1;
-            }
-            this.Dispatcher.BeginInvoke(new Action<IInputElement>((target) =>
-                {
-                    System.Diagnostics.Debug.WriteLine(target.GetType().Name + " " + target.GetHashCode());
-                    Keyboard.Focus(target);
-                }), DispatcherPriority.ApplicationIdle, toFocus);
-            e.Handled = true;
-        }
-
-        void OnCreateWorkflowElementCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            string typeName = null;
-            // e.Parameter is IDictionary<string, string> when the designer is hosted
-            // inside Visual Studio. It is IDataObject otherwise.
-            if (e.Parameter is IDictionary<string, string>)
-            {
-                IDictionary<string, string> context = e.Parameter as IDictionary<string, string>;
-                context.TryGetValue("TypeName", out typeName);
-            }
-            else
-            {
-                IDataObject context = e.Parameter as IDataObject;
-                if (context != null)
-                {
-                    typeName = context.GetData(DragDropHelper.WorkflowItemTypeNameFormat) as string;
-                }
-            }
-
-            bool precondition = !this.IsReadOnly && !string.IsNullOrWhiteSpace(typeName);
-
-            if (precondition)
-            {
-                Type activityType = Type.GetType(typeName, false);
-                if (null != activityType)
-                {
-                    Selection selection = this.Context.Items.GetValue<Selection>();
-                    if (selection.SelectionCount == 1 && selection.PrimarySelection.View is WorkflowViewElement)
-                    {
-                        WorkflowViewElement viewElement = (WorkflowViewElement)selection.PrimarySelection.View;
-                        ICompositeView container = viewElement.ActiveCompositeView;
-                        if (null != container)
-                        {
-                            List<object> itemsToPaste = new List<object>(1);
-                            Type factoryType;
-                            if (activityType.TryGetActivityTemplateFactory(out factoryType))
-                            {
-                                itemsToPaste.Add(factoryType);
-                            }
-                            else
-                            {
-                                itemsToPaste.Add(activityType);
-                            }
-
-                            e.CanExecute = container.CanPasteItems(itemsToPaste);
-                        }
-                    }
-                }
-            }
-            e.Handled = true;
-        }
-
-        void OnCreateWorkflowElementCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            Selection selection = this.Context.Items.GetValue<Selection>();
-            Fx.Assert(selection.SelectionCount == 1, "selection.SelectionCount should be 1.");
-            Fx.Assert(selection.PrimarySelection.View is WorkflowViewElement, "selection.PrimarySelection.View should be WorkflowViewElement type.");
-
-            WorkflowViewElement viewElement = (WorkflowViewElement)selection.PrimarySelection.View;
-
-            Type activityType = null;
-            IDataObject dataObject = null;
-
-            // e.Parameter is IDictionary<string, string> when the designer is hosted
-            // inside Visual Studio. It is IDataObject otherwise.
-            if (e.Parameter is IDictionary<string, string>)
-            {
-                IDictionary<string, string> context = e.Parameter as IDictionary<string, string>;
-                activityType = Type.GetType(context["TypeName"]);
-
-                // For the VisualStudio 11 hosted designer case data object corresponding to the toolbox item is passed in
-                // through AppDomain level data by EditorPane.IToolboxUser.ItemPicked method.
-                string dataObjectKey = typeof(System.Runtime.InteropServices.ComTypes.IDataObject).FullName;
-                object data = AppDomain.CurrentDomain.GetData(dataObjectKey);
-                if (data is IntPtr)
-                {
-                    IntPtr dataObjectPointer = (IntPtr)data;
-                    dataObject = new DataObject((System.Runtime.InteropServices.ComTypes.IDataObject)Marshal.GetObjectForIUnknown(dataObjectPointer));
-                    Marshal.Release(dataObjectPointer);
-                    AppDomain.CurrentDomain.SetData(dataObjectKey, null);
-                }
-            }
-            else
-            {
-                dataObject = e.Parameter as IDataObject;
-                activityType = Type.GetType((string)dataObject.GetData(DragDropHelper.WorkflowItemTypeNameFormat));
-            }
-
-            object instance = DragDropHelper.GetDroppedObjectInstance(viewElement, this.Context, activityType, dataObject);
-            if (instance != null)
-            {
-                List<object> itemsToPaste = new List<object>(1);
-                List<object> metaData = new List<object>(1);
-                if (instance is FlowNode)
-                {
-                    List<FlowNode> flowchartMetaData = new List<FlowNode>(1);
-                    flowchartMetaData.Add(instance as FlowNode);
-                    metaData.Add(flowchartMetaData);
-                }
-                else
-                {
-                    itemsToPaste.Add(instance);
-                }
-
-                viewElement.ActiveCompositeView.OnItemsPasted(itemsToPaste, metaData, new Point(), null);
-            }
-            e.Handled = true;
-        }
-
-        void OnFitToScreenCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = (null != this.zoomToTicksConverter);
-        }
-
-        void OnFitToScreenCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.zoomToTicksConverter.FitToScreen();
-            e.Handled = true;
-            FeatureUsageCounter.ReportUsage(sqmService, WorkflowDesignerFeatureId.FitToScreen);
-        }
-
-        void OnResetZoomCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = (null != this.zoomToTicksConverter);
-        }
-
-        void OnResetZoomCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            this.zoomToTicksConverter.ResetZoom();
-            e.Handled = true;
-            FeatureUsageCounter.ReportUsage(sqmService, WorkflowDesignerFeatureId.ResetZoom);
-        }
-
-        void OnZoomPickerUndoRedoCommandPreviewCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = false;
-            e.Handled = true;
-        }
-
-        void OnAnnotationsMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            MenuItem item = sender as MenuItem;
-
-            if (this.context.Services.GetService<DesignerConfigurationService>().AnnotationEnabled == true)
-            {
-                if (!Selection.MultipleObjectsSelected(this.Context))
-                {
-                    item.Visibility = Visibility.Visible;
-                    e.Handled = true;
-                    return;
-                }
-            }
-
-            item.Visibility = Visibility.Collapsed;
-            e.Handled = true;
-        }
-
-        void OnAddAnnotationCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnAddAnnotationCommandCanExecute(e, this.Context);
-        }
-
-        void OnAddAnnotationCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnAddAnnotationCommandExecuted(e, this.Context.Items.GetValue<Selection>().PrimarySelection);
-        }
-
-        void OnEditAnnotationCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            // call the same method as delete annotation command
-            ContextMenuUtilities.OnDeleteAnnotationCommandCanExecute(e, this.Context);
-        }
-
-        void OnEditAnnotationCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnEditAnnotationCommandExecuted(e, this.Context.Items.GetValue<Selection>().PrimarySelection);
-        }
-
-        void OnDeleteAnnotationCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnDeleteAnnotationCommandCanExecute(e, this.Context);
-        }
-
-        void OnDeleteAnnotationCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnDeleteAnnotationCommandExecuted(e, this.Context.Items.GetValue<Selection>().PrimarySelection);
-        }
-
-        void OnShowAllAnnotationCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            if (this.context.Services.GetService<DesignerConfigurationService>().AnnotationEnabled != true)
-            {
-                e.CanExecute = false;
-                return;
-            }
-
-            e.CanExecute = true;
-            e.Handled = true;
-        }
-
-        void OnShowAllAnnotationCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            ModelTreeManager modelTreeManager = this.Context.Services.GetService<ModelTreeManager>();
-            AnnotationAdornerService annotationService = this.Context.Services.GetService<AnnotationAdornerService>();
-            ViewStateService viewStateService = this.Context.Services.GetService<ViewStateService>();
-            foreach (ModelItem item in ModelTreeManager.Find(modelTreeManager.Root, new Predicate<ModelItem>(ModelItemExtensions.HasAnnotation), false))
-            {
-                viewStateService.StoreViewState(item, Annotation.IsAnnotationDockedViewStateName, true);
-            }
-            e.Handled = true;
-        }
-
-        void OnHideAllAnnotationCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            if (this.context.Services.GetService<DesignerConfigurationService>().AnnotationEnabled != true)
-            {
-                e.CanExecute = false;
-                return;
-            }
-
-            e.CanExecute = true;
-            e.Handled = true;
-        }
-
-        void OnHideAllAnnotationCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            ModelTreeManager modelTreeManager = this.Context.Services.GetService<ModelTreeManager>();
-            AnnotationAdornerService annotationService = this.Context.Services.GetService<AnnotationAdornerService>();
-            ViewStateService viewStateService = this.Context.Services.GetService<ViewStateService>();
-            foreach (ModelItem item in ModelTreeManager.Find(modelTreeManager.Root, new Predicate<ModelItem>(ModelItemExtensions.HasAnnotation), false))
-            {
-                viewStateService.StoreViewState(item, Annotation.IsAnnotationDockedViewStateName, false);
-            }
-            e.Handled = true;
-        }
-
-        void OnDeleteAllAnnotationCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnDeleteAllAnnotationCommandCanExecute(e, this.Context);
-        }
-
-        void OnDeleteAllAnnotationCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            ModelTreeManager modelTreeManager = this.Context.Services.GetService<ModelTreeManager>();
-            AnnotationAdornerService annotationService = this.Context.Services.GetService<AnnotationAdornerService>();
-            ViewStateService viewStateService = this.Context.Services.GetService<ViewStateService>();
-
-            MessageBoxResult result = MessageBox.Show(SR.DeleteAllAnnotationMessage, SR.DeleteAnnotationTitle, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No);
-
-            if (result != MessageBoxResult.Yes)
-            {
-                e.Handled = true;
-                return;
-            }
-
-            ModelEditingScope editingScope = null;
-            bool isModified = false;
-            try
-            {
-                foreach (ModelItem item in ModelTreeManager.Find(modelTreeManager.Root, new Predicate<ModelItem>(ModelItemExtensions.HasAnnotation), false))
-                {
-                    isModified = true;
-                    if (editingScope == null)
-                    {
-                        editingScope = item.BeginEdit(SR.DeleteAllAnnotationsDescription);
-                    }
-                    item.Properties[Annotation.AnnotationTextPropertyName].ClearValue();
-                    viewStateService.StoreViewStateWithUndo(item, Annotation.IsAnnotationDockedViewStateName, null);
-                }
-
-                if (isModified)
-                {
-                    modelTreeManager.AddToCurrentEditingScope(new NotifyArgumentVariableAnnotationTextChanged()
-                    {
-                        ArgumentDesigner = this.arguments1,
-                        VariableDesigner = this.variables1,
-                    });
-                }
-            }
-            finally
-            {
-                if (editingScope != null)
-                {
-                    editingScope.Complete();
-                }
-            }
-
-            e.Handled = true;
-        }
-
-        void ExecuteCommand(int command)
-        {
-            IDesignerDebugView debuggerService = this.Context.Services.GetService<IDesignerDebugView>();
-            ICommandService commandService = this.Context.Services.GetService<ICommandService>();
-            if (null != commandService)
-            {
-                //setup parameters
-                var commandParameters = (Dictionary<string, object>)null;
-                if (null != debuggerService &&
-                    (command == CommandValues.InsertBreakpoint ||
-                    command == CommandValues.DeleteBreakpoint ||
-                    command == CommandValues.EnableBreakpoint ||
-                    command == CommandValues.DisableBreakpoint))
-                {
-                    commandParameters = new Dictionary<string, object>();
-                    if (command == CommandValues.InsertBreakpoint)
-                    {
-                        commandParameters.Add(typeof(BreakpointTypes).Name, BreakpointTypes.Bounded);
-                    }
-
-                    commandParameters.Add(typeof(SourceLocation).Name, debuggerService.SelectedLocation);
-                }
-
-                //execute command
-                commandService.ExecuteCommand(command, commandParameters);
-            }
-        }
-
-        static FrameworkElement GetMenuItemOrigin(DependencyObject obj)
-        {
-            return (FrameworkElement)obj.GetValue(MenuItemOriginProperty);
-        }
-
-        static void SetMenuItemOrigin(DependencyObject obj, FrameworkElement value)
-        {
-            obj.SetValue(MenuItemOriginProperty, value);
-        }
-
-        public static CommandMenuMode GetCommandMenuMode(DependencyObject obj)
-        {
-            return (CommandMenuMode)obj.GetValue(CommandMenuModeProperty);
-        }
-
-        public static void SetCommandMenuMode(DependencyObject obj, CommandMenuMode value)
-        {
-            obj.SetValue(CommandMenuModeProperty, value);
-        }
-
-        sealed class ContextMenuItemStyleSelector : StyleSelector
-        {
-            DesignerView owner;
-
-            public ContextMenuItemStyleSelector(DesignerView owner)
-            {
-                this.owner = owner;
-            }
-
-            public override Style SelectStyle(object item, DependencyObject container)
-            {
-                if (item is MenuItem && null != this.owner.MenuItemStyle)
-                {
-                    ((MenuItem)item).ItemContainerStyleSelector = this;
-                    return this.owner.MenuItemStyle;
-                }
-                else if (item is Separator && null != this.owner.MenuSeparatorStyle)
-                {
-                    return this.owner.MenuSeparatorStyle;
-                }
-                return base.SelectStyle(item, container);
-            }
-        }
-    }
-
-    [Fx.Tag.XamlVisible(false)]
-    public sealed class CommandMenuMode
-    {
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes,
-            Justification = "The class being an empty class, the readonly mutable referencetypes cannot be modified")]
-        public static readonly CommandMenuMode NoCommandMenu = new CommandMenuMode();
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly CommandMenuMode FullCommandMenu = new CommandMenuMode();
-
-        private CommandMenuMode()
-        {
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/DesignerView.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/DesignerView.xaml.cs
deleted file mode 100644 (file)
index 26b3565..0000000
+++ /dev/null
@@ -1,1772 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Activities.Presentation.View;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Services;
-    using System.Activities.Presentation.Xaml;
-    using System.Activities.Presentation.Hosting;
-    using System.Collections;
-    using System.Collections.ObjectModel;
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.IO;
-    using System.IO.Packaging;
-    using System.Printing;
-    using System.Reflection;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Controls.Primitives;
-    using System.Windows.Data;
-    using System.Windows.Documents;
-    using System.Windows.Input;
-    using System.Windows.Interop;
-    using System.Windows.Media;
-    using System.Windows.Media.Imaging;
-    using System.Windows.Threading;
-    using System.Windows.Xps;
-    using System.Windows.Xps.Packaging;
-    using System.Linq;
-    using System.Windows.Shapes;
-    using System.Collections.Generic;
-    using System.Activities.Presentation.Validation;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.ServiceModel.Activities;
-    using Microsoft.Tools.Common;
-    using System.Activities.Presentation.Sqm;
-
-    // <summary>
-    // Interaction logic for DesignerView.xaml
-    // </summary>
-    [Fx.Tag.XamlVisible(false)]
-    public partial class DesignerView : UserControl
-    {
-        public static readonly DependencyProperty RootDesignerProperty =
-            DependencyProperty.Register("RootDesigner", typeof(UIElement), typeof(DesignerView), new FrameworkPropertyMetadata(null, new PropertyChangedCallback(DesignerView.OnRootDesignerChanged)));
-
-        public static readonly DependencyProperty IsReadOnlyProperty =
-            DependencyProperty.Register("IsReadOnly", typeof(bool), typeof(DesignerView), new UIPropertyMetadata(OnIsReadOnlyChanged));
-
-        static readonly DependencyPropertyKey ActivitySchemaPropertyKey =
-            DependencyProperty.RegisterReadOnly("ActivitySchema", typeof(ModelItem), typeof(DesignerView), new UIPropertyMetadata(OnActivitySchemaChanged));
-
-        public static readonly DependencyProperty ActivitySchemaProperty = ActivitySchemaPropertyKey.DependencyProperty;
-
-        static readonly DependencyPropertyKey FocusedViewElementPropertyKey =
-            DependencyProperty.RegisterReadOnly("FocusedViewElement", typeof(WorkflowViewElement), typeof(DesignerView), new UIPropertyMetadata(null));
-
-        public static readonly DependencyProperty InPanModeProperty =
-            DependencyProperty.Register("InPanMode", typeof(bool), typeof(DesignerView), new UIPropertyMetadata(OnInPanModeChanged));
-
-        public static readonly DependencyProperty FocusedViewElementProperty = FocusedViewElementPropertyKey.DependencyProperty;
-
-        internal static DependencyProperty ShouldExpandAllProperty = DependencyProperty.Register("ShouldExpandAll", typeof(bool), typeof(DesignerView), new PropertyMetadata(false, new PropertyChangedCallback(OnExpandAllCollapseAllChanged)));
-        internal static DependencyProperty ShouldCollapseAllProperty = DependencyProperty.Register("ShouldCollapseAll", typeof(bool), typeof(DesignerView), new PropertyMetadata(false, new PropertyChangedCallback(OnExpandAllCollapseAllChanged)));
-
-        const double scrollDeltaDivider = 100.0;
-
-        GridLength bottomPaneHeight;
-        EditingContext context;
-        DragDropHelper.ViewElementDragShadow viewElementDragShadow;
-        ZoomToTicksConverter zoomToTicksConverter;
-        ShellBarItemVisibility shellBarItemVisibility = ShellBarItemVisibility.Variables | ShellBarItemVisibility.Arguments | ShellBarItemVisibility.Imports;
-        ShellHeaderItemsVisibility shellHeaderItemsVisibility = ShellHeaderItemsVisibility.Breadcrumb | ShellHeaderItemsVisibility.ExpandAll | ShellHeaderItemsVisibility.CollapseAll;
-        Dictionary<ModelItem, ModelItem> selectionMap = new Dictionary<ModelItem, ModelItem>();
-        private bool isInErrorState = false;
-
-        const string breadCrumbRootKey = "BreadCrumbRoot";
-        const string selectionKey = "Selection";
-        const string zoomFactorKey = "ZoomFactor";
-
-
-        internal WorkflowViewElement lastClickedDesigner;
-        IVSSqmService sqmService;
-        ScrollViewerPanner scrollViewerPanner;
-        RubberBandSelector rubberBandSelector;
-
-        private DesignerViewProxy proxy;
-
-        private DesignerView()
-        {
-        }
-
-        internal DesignerView(EditingContext context)
-        {
-            this.proxy = new DesignerViewProxy(this);
-            this.context = context;
-            InitializeComponent();
-            this.InitializeMenuActions();
-            foreach (UIElement element in this.designerExtensionSurface.Children)
-            {
-                element.IsEnabled = false;
-            }
-
-            this.buttonArguments1.IsChecked = false;
-            UpdateArgumentsButtonVisibility(false);
-
-            this.zoomToTicksConverter = new ZoomToTicksConverter(this, this.zoomSlider, this.zoomPicker);
-            this.zoomSlider.ValueChanged += new RoutedPropertyChangedEventHandler<double>(OnZoomSliderValueChanged);
-            HideBottomPane();
-
-            this.variables1.VariableCollectionChanged += this.OnVariablesCollectionChanged;
-            this.arguments1.ArgumentCollectionChanged += this.OnArgumentsCollectionChanged;
-            Dispatcher.UnhandledException += this.proxy.OnDispatcherUnhandledException;
-            this.ShouldIgnoreDataGridAutoCommit = false;
-            this.sqmService = this.Context.Services.GetService<IVSSqmService>();
-            this.buttonPanMode.Visibility = this.IsPanModeEnabled ? Visibility.Visible : Visibility.Collapsed;
-            this.rubberBandSelector = this.IsRubberBandSelectionEnabled ? new RubberBandSelector(this.context) : null;
-        }
-
-        void OnReadOnlyStateChanged(ReadOnlyState state)
-        {
-            this.IsReadOnly = state.IsReadOnly;
-        }
-
-        void OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
-        {
-            if (!e.Handled)
-            {
-                if (!isInErrorState)
-                {
-                    isInErrorState = true;
-
-                    //try to prun the visual tree and collapse all the workflow view elements that are too deep
-                    //this is due to the limitation of WPF has a visual tree depth limit.
-                    if (e.Exception is InvalidOperationException)
-                    {
-                        ICollection<WorkflowViewElement> deepElements = VisualTreeUtils.PrunVisualTree<WorkflowViewElement>(this.RootDesigner);
-                        foreach (WorkflowViewElement viewElement in deepElements)
-                        {
-                            viewElement.ForceCollapse();
-                        }
-                    }
-                    Exception ex = e.Exception.InnerException ?? e.Exception;
-                    ErrorReporting.ShowErrorMessage(ex);
-                    isInErrorState = false;
-                }
-                e.Handled = true;
-            }
-        }
-
-        public bool IsMultipleSelectionMode
-        {
-            get;
-            private set;
-        }
-
-        void OnDesignerViewLoaded(object sender, RoutedEventArgs e)
-        {
-            ViewStateService viewStateService = this.Context.Services.GetService<ViewStateService>();
-            ModelTreeManager modelTreeManager = this.context.Services.GetService<ModelTreeManager>();
-            //Initialize ShouldExpandAll if it exists in ViewState.
-            object expandAllState = viewStateService.RetrieveViewState(modelTreeManager.Root, DesignerView.ShouldExpandAllProperty.Name);
-            if (expandAllState != null)
-            {
-                this.ShouldExpandAll = (bool)expandAllState;
-            }
-            if (!this.ShouldExpandAll)
-            {
-                object collapseAllState = viewStateService.RetrieveViewState(modelTreeManager.Root, DesignerView.ShouldCollapseAllProperty.Name);
-                if (collapseAllState != null)
-                {
-                    this.ShouldCollapseAll = (bool)collapseAllState;
-                }
-            }
-            // SQM: Open Minimap through designer surface
-            this.buttonMinimap.Checked += new RoutedEventHandler(SqmOpenMinimap);
-            this.expandAllButton.Click += new RoutedEventHandler(SqmExpandAll);
-            this.collapseAllButton.Click += new RoutedEventHandler(SqmCollapseAll);
-
-            if (this.IsPanModeEnabled)
-            {
-                this.scrollViewerPanner = new ScrollViewerPanner(this.ScrollViewer);
-                this.scrollViewerPanner.Hand = (Cursor)this.Resources["ReadyToPanCursor"];
-                this.scrollViewerPanner.DraggingHand = (Cursor)this.Resources["PanningCursor"];
-            }
-        }
-
-        void OnDesignerViewUnloaded(object sender, RoutedEventArgs e)
-        {
-            if (this.scrollViewerPanner != null)
-            {
-                this.scrollViewerPanner.ScrollViewer = null;
-                this.scrollViewerPanner = null;
-            }
-        }
-
-        void SqmCollapseAll(object sender, RoutedEventArgs e)
-        {
-            if (this.collapseAllButton.IsChecked == true)
-            {
-                FeatureUsageCounter.ReportUsage(sqmService, WorkflowDesignerFeatureId.CollapseAll);
-            }
-            else
-            {
-                FeatureUsageCounter.ReportUsage(sqmService, WorkflowDesignerFeatureId.Restore);
-            }
-        }
-
-        void SqmExpandAll(object sender, RoutedEventArgs e)
-        {
-            if (this.expandAllButton.IsChecked == true)
-            {
-                FeatureUsageCounter.ReportUsage(sqmService, WorkflowDesignerFeatureId.ExpandAll);
-            }
-            else
-            {
-                FeatureUsageCounter.ReportUsage(sqmService, WorkflowDesignerFeatureId.Restore);
-            }
-        }
-
-        void SqmOpenMinimap(object sender, RoutedEventArgs e)
-        {
-            FeatureUsageCounter.ReportUsage(sqmService, WorkflowDesignerFeatureId.Minimap);
-        }
-
-        static void OnExpandAllCollapseAllChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
-        {
-            ((DesignerView)o).OnExpandAllCollapseAllChanged(e);
-        }
-
-        void OnExpandAllCollapseAllChanged(DependencyPropertyChangedEventArgs e)
-        {
-            ViewStateService viewStateService = this.Context.Services.GetService<ViewStateService>();
-            ModelTreeManager modelTreeManager = this.context.Services.GetService<ModelTreeManager>();
-            {
-                viewStateService.StoreViewState(modelTreeManager.Root, e.Property.Name, e.NewValue);
-            }
-        }
-
-
-        protected override void OnInitialized(EventArgs e)
-        {
-            this.AddHandler(UIElement.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(this.OnWorkflowElementGotKeyboardFocus), true);
-            this.AddHandler(UIElement.MouseLeftButtonDownEvent, new MouseButtonEventHandler(this.OnDesignerSurfaceMouseLeftButtonDown), true);
-            this.scrollViewer.AddHandler(UIElement.MouseLeftButtonDownEvent, new MouseButtonEventHandler(this.OnScrollViewerMouseLeftButtonDown), true);
-            base.OnInitialized(e);
-            this.Foreground = new SolidColorBrush(SystemColors.ControlTextColor);
-            this.Loaded += this.OnDesignerViewLoaded;
-            this.Unloaded += this.OnDesignerViewUnloaded;
-
-            this.IsKeyboardFocusWithinChanged += this.OnDesignerKeyboardFocusWithinChanged;
-
-            this.MenuItemStyle = (Style)this.FindResource("menuItemStyle");
-            Fx.Assert(this.MenuItemStyle != null, "menuItemStyle resource not found");
-            this.MenuSeparatorStyle = (Style)this.FindResource("separatorStyle");
-            Fx.Assert(this.MenuSeparatorStyle != null, "separatorStyle resource not found");
-
-            ReadOnlyState state = this.Context.Items.GetValue<ReadOnlyState>();
-            this.IsReadOnly = state.IsReadOnly;
-            this.Context.Items.Subscribe<ReadOnlyState>(OnReadOnlyStateChanged);
-        }
-
-        public ModelItem ActivitySchema
-        {
-            get { return (ModelItem)GetValue(ActivitySchemaProperty); }
-            private set { SetValue(ActivitySchemaPropertyKey, value); }
-        }
-
-        public EditingContext Context
-        {
-            get { return this.context; }
-        }
-
-        public UIElement RootDesigner
-        {
-            get { return (UIElement)GetValue(RootDesignerProperty); }
-            set { SetValue(RootDesignerProperty, value); }
-        }
-
-        public bool ShouldExpandAll
-        {
-            get { return (bool)GetValue(ShouldExpandAllProperty); }
-            set { SetValue(ShouldExpandAllProperty, value); }
-        }
-
-        public bool ShouldCollapseAll
-        {
-            get { return (bool)GetValue(ShouldCollapseAllProperty); }
-            set { SetValue(ShouldCollapseAllProperty, value); }
-        }
-
-        public bool IsReadOnly
-        {
-            get { return (bool)GetValue(IsReadOnlyProperty); }
-            set { SetValue(IsReadOnlyProperty, value); }
-        }
-
-        public WorkflowViewElement FocusedViewElement
-        {
-            get { return (WorkflowViewElement)GetValue(FocusedViewElementProperty); }
-            private set { SetValue(FocusedViewElementPropertyKey, value); }
-        }
-
-        public double ZoomFactor
-        {
-            get
-            {
-                return this.zoomToTicksConverter.ZoomFactor;
-            }
-        }
-
-        internal ScrollViewer ScrollViewer
-        {
-            get
-            {
-                return this.scrollViewer;
-            }
-        }
-
-        internal UIElement ScrollableContent
-        {
-            get
-            {
-                return this.scrollableContent;
-            }
-        }
-
-        internal bool SuppressSelectionOnMouseUp
-        {
-            get
-            {
-                if (this.rubberBandSelector == null)
-                {
-                    return false;
-                }
-                return this.rubberBandSelector.IsSelected;
-            }
-        }
-
-        internal bool ShouldIgnoreDataGridAutoCommit
-        {
-            get;
-            set;
-        }
-
-        internal bool ShouldStillAllowRubberBandEvenIfMouseLeftButtonDownIsHandled
-        {
-            get;
-            set;
-        }
-
-        internal bool InPanMode
-        {
-            get { return (bool)GetValue(InPanModeProperty); }
-            set { SetValue(InPanModeProperty, value); }
-        }
-
-        private bool IsPanModeEnabled
-        {
-            get
-            {
-                DesignerConfigurationService configurationService = this.Context.Services.GetService<DesignerConfigurationService>();
-                if (configurationService != null)
-                {
-                    return configurationService.PanModeEnabled;
-                }
-                return true;
-            }
-        }
-
-        private bool IsRubberBandSelectionEnabled
-        {
-            get
-            {
-                DesignerConfigurationService configurationService = this.Context.Services.GetService<DesignerConfigurationService>();
-                if (configurationService != null)
-                {
-                    return configurationService.RubberBandSelectionEnabled;
-                }
-                return true;
-            }
-        }
-
-        public ShellBarItemVisibility WorkflowShellBarItemVisibility
-        {
-            get { return this.shellBarItemVisibility; }
-            set { this.ApplyShellBarItemVisibility(value); }
-        }
-
-        public ShellHeaderItemsVisibility WorkflowShellHeaderItemsVisibility
-        {
-            get { return this.shellHeaderItemsVisibility; }
-            set { this.ApplyShellHeaderItemsVisibility(value); }
-        }
-
-        public void MakeRootDesigner(ModelItem modelItem)
-        {
-            bool checkIfCanBeMadeRoot = true;
-            if (modelItem == modelItem.Root)
-            {
-                checkIfCanBeMadeRoot = false;
-            }
-            MakeRootDesigner(modelItem, /* setAsSelection = */ true, checkIfCanBeMadeRoot);
-        }
-
-        internal void MakeRootDesigner(ModelItem modelItem, bool setAsSelection)
-        {
-            MakeRootDesigner(modelItem, setAsSelection, true);
-        }
-
-        internal void ForceMakeRootDesigner(ModelItem modelItem)
-        {
-            MakeRootDesigner(modelItem, /* setAsSelection = */ true, false);
-        }
-
-        void SelectAll()
-        {
-            WorkflowViewElement root = this.RootDesigner as WorkflowViewElement;
-            ModelItem rootModelItem = null;
-            if (root != null)
-            {
-                rootModelItem = root.ModelItem;
-            }
-            if (rootModelItem != null)
-            {
-                ModelTreeManager modelTreeManager = this.Context.Services.GetService<ModelTreeManager>();
-                IEnumerable<ModelItem> items = ModelTreeManager.Find(rootModelItem, delegate(ModelItem current)
-                {
-                    WorkflowViewService viewService = this.Context.Services.GetService<ViewService>() as WorkflowViewService;
-                    return (typeof(WorkflowViewElement).IsAssignableFrom(viewService.GetDesignerType(current.ItemType)));
-                }, true);
-                IEnumerable<ModelItem> itemsToSelect = items
-                    // ModelItemKeyValuePair is associated with CaseDesigner. 
-                    // So ModelItemKeyValuePair will be returned even if they are not really Cases.
-                    // Those ModelItemKeyValuePairs need to be excluded.
-                    .Where<ModelItem>(item => !ModelUtilities.IsModelItemKeyValuePair(item.ItemType) || ModelUtilities.IsSwitchCase(item))
-                    .Except<ModelItem>(new ModelItem[] { rootModelItem });
-                Selection selection = new Selection(itemsToSelect);
-                this.Context.Items.SetValue(selection);
-            }
-        }
-
-        internal void BeginDragShadowTracking(DragDropHelper.ViewElementDragShadow dragShadow)
-        {
-            // Returns the first adorner layer in the visual tree above a specified Visual.
-            AdornerLayer layer = this.GetAdornerLayerForDragShadow();
-            if (null != layer)
-            {
-                layer.Add(dragShadow);
-                this.viewElementDragShadow = dragShadow;
-                //register for window messages notification
-                this.Context.Services.GetService<WindowHelperService>().RegisterWindowMessageHandler(new WindowMessage(OnMessage));
-            }
-        }
-
-        internal void EndDragShadowTracking(DragDropHelper.ViewElementDragShadow dragShadow)
-        {
-            AdornerLayer layer = this.GetAdornerLayerForDragShadow();
-            if (null != layer)
-            {
-                //unregister from window message notification
-                this.Context.Services.GetService<WindowHelperService>().UnregisterWindowMessageHandler(new WindowMessage(OnMessage));
-                layer.Remove(dragShadow);
-                this.viewElementDragShadow = null;
-            }
-        }
-
-        static void UpdateAncestorFlag(ModelItem oldRoot, ModelItem newRoot)
-        {
-            // Walk up the tree and update the flags from the new root. If we hit the old root in the process, we are done.
-            // Otherwise, continue to update the flags from the old root until we hit the new root.
-            if (oldRoot == newRoot)
-            {
-                return;
-            }
-            bool hitOldRoot = false;
-            if (newRoot != null)
-            {
-                WorkflowViewElement viewElement = newRoot.View as WorkflowViewElement;
-                if (viewElement != null)
-                {
-                    viewElement.IsAncestorOfRootDesigner = false;
-                }
-                ModelItem parent = newRoot.Parent;
-                while (parent != null)
-                {
-                    WorkflowViewElement view = parent.View as WorkflowViewElement;
-                    if (view != null)
-                    {
-                        view.IsAncestorOfRootDesigner = true;
-                    }
-                    if (parent == oldRoot)
-                    {
-                        hitOldRoot = true;
-                    }
-                    parent = parent.Parent;
-                }
-            }
-            if (oldRoot != null && !hitOldRoot)
-            {
-                ModelItem parent = oldRoot.Parent;
-                while (parent != null && parent != newRoot)
-                {
-                    WorkflowViewElement view = parent.View as WorkflowViewElement;
-                    if (view != null)
-                    {
-                        view.IsAncestorOfRootDesigner = false;
-                    }
-                    parent = parent.Parent;
-                }
-            }
-        }
-
-        internal void MakeRootDesigner(ModelItem modelItem, bool setAsSelection, bool checkIfCanBeMadeRoot)
-        {
-            ModelItem currentRootModelItem = (this.RootDesigner != null) ? ((WorkflowViewElement)this.RootDesigner).ModelItem : null;
-            if (modelItem == currentRootModelItem)
-            {
-                return;
-            }
-            if (typeof(ActivityBuilder).IsAssignableFrom(modelItem.ItemType))
-            {
-                this.ActivitySchema = modelItem;
-            }
-
-            WorkflowViewService viewService = this.Context.Services.GetService<ViewService>() as WorkflowViewService;
-
-            //try get designer for given model item
-            Type designerType = viewService.GetDesignerType(modelItem.ItemType);
-            //if one doesn't exist - check its parent tree, perhaps there will be one
-            while (null == designerType && null != modelItem.Parent)
-            {
-                modelItem = modelItem.Parent;
-                designerType = viewService.GetDesignerType(modelItem.ItemType);
-            }
-
-            if (viewService.ShouldAppearOnBreadCrumb(modelItem, checkIfCanBeMadeRoot))
-            {
-                UpdateAncestorFlag(currentRootModelItem, modelItem);
-                Dictionary<ModelItem, ModelItem> newSelectionMap = new Dictionary<ModelItem, ModelItem>();
-                ModelItem newRootModelItem = modelItem;
-                ObservableCollection<object> breadCrumbCollection = new ObservableCollection<object>();
-                object breadCrumbObjectConnector = null;
-                bool isFirstAdded = false;
-                while (modelItem != null)
-                {
-                    bool shouldCheckIfCanBeMadeRoot = true;
-                    if (isFirstAdded)
-                    {
-                        shouldCheckIfCanBeMadeRoot = checkIfCanBeMadeRoot;
-                    }
-                    if (viewService.ShouldAppearOnBreadCrumb(modelItem, shouldCheckIfCanBeMadeRoot))
-                    {
-                        if (isFirstAdded)
-                        {
-                            breadCrumbObjectConnector = new BreadCrumbObjectSeparator();
-                            breadCrumbCollection.Insert(0, breadCrumbObjectConnector);
-                        }
-                        breadCrumbCollection.Insert(0, modelItem);
-                        isFirstAdded = true;
-                        if (selectionMap.ContainsKey(modelItem))
-                        {
-                            newSelectionMap.Add(modelItem, selectionMap[modelItem]);
-                        }
-                    }
-                    modelItem = modelItem.Parent;
-                }
-
-                //Remember the selection for the current root.
-                WorkflowViewElement focusedElement = Keyboard.FocusedElement as WorkflowViewElement;
-                //This condition will be true when we are breadcrumbing into a child element.
-                if (focusedElement != null && object.Equals(focusedElement.ModelItem, newRootModelItem))
-                {
-                    if (currentRootModelItem != null)
-                    {
-                        newSelectionMap[currentRootModelItem] = newRootModelItem;
-                    }
-                }
-                this.selectionMap = newSelectionMap;
-                SetAsRootDesignerView(newRootModelItem, setAsSelection);
-                breadCrumbListBox.ItemsSource = breadCrumbCollection;
-                // Move to the top left so that the display name is visible.
-                this.ScrollViewer.ScrollToTop();
-                this.ScrollViewer.ScrollToLeftEnd();
-            }
-        }
-
-        void OnMessage(int msgId, IntPtr wParam, IntPtr lParam)
-        {
-            //WM_NCHITTEST message is the only message beeing routed when dragging an activity over elements which do not support
-            //drag & drop; in order to provide smooth dragging expirience i have to get coordinates from this message and update
-            //drag shadow with them
-            //consider this message only when we are in drag mode
-            if (null != this.viewElementDragShadow && Win32Interop.WM_NCHITTEST == msgId)
-            {
-                AdornerLayer layer = this.viewElementDragShadow.Parent as AdornerLayer;
-                Fx.Assert(layer != null, "viewElementDragShadow's parent should not be null");
-                //get current mouse screen coordinates out of LPARAM
-                uint pos = (uint)lParam;
-                Point scrPoint = new Point((int)(pos & 0xffff), (int)(pos >> 16));
-                // Transform a point from screen to AdornerLayer, which is the parent of shadow.                
-                Point clientPoint = layer.PointFromScreen(scrPoint);
-                this.viewElementDragShadow.UpdatePosition(clientPoint.X, clientPoint.Y);
-            }
-        }
-
-        void OnWorkflowElementGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
-        {
-            FrameworkElement source = e.NewFocus as FrameworkElement;
-            //walk up visual tree, but not above DesignerView - there won't be any design shapes anyway
-            while (null != source && this != source)
-            {
-                //select first visual, which is of type WorkflowViewElement
-                if (typeof(WorkflowViewElement).IsAssignableFrom(source.GetType()))
-                {
-                    break;
-                }
-                source = VisualTreeHelper.GetParent(source) as FrameworkElement;
-            }
-            //try to cast source element as WorkflowViewElement
-            if (this.FocusedViewElement != source)
-            {
-                this.FocusedViewElement = source as WorkflowViewElement;
-
-                System.Diagnostics.Debug.WriteLine(
-                    string.Format(CultureInfo.InvariantCulture, "{0} ) DesignerView.OnWorkflowElementGotKeyboardFocus(FocusedViewElement {1}, raisedBy {2})",
-                    DateTime.Now.ToLocalTime(), (null == this.FocusedViewElement ? "<null>" : this.FocusedViewElement.GetType().Name), e.OriginalSource));
-            }
-        }
-
-        void OnDesignerKeyboardFocusWithinChanged(object sender, DependencyPropertyChangedEventArgs e)
-        {
-            //if current designer lost keyboard focus - commit pending edits 
-            if (!this.IsKeyboardFocusWithin)
-            {
-                //delegate the call using dispatcher, so all involved components do consume focus event, then i can commit the edit
-                this.Dispatcher.BeginInvoke(new Action(() =>
-                    {
-                        //check if there is an edit in progress inside datagrid, which might have opened other dialog - 
-                        //in such case, the desigerView would loose keyboard focus and could ---- non-modal dialog (ie. intelisense window for ETB)
-                        if (!this.ShouldIgnoreDataGridAutoCommit)
-                        {
-                            if (null != this.variables1)
-                            {
-                                DataGridHelper.CommitPendingEdits(this.variables1.variableDataGrid);
-                            }
-                            if (null != this.arguments1)
-                            {
-                                DataGridHelper.CommitPendingEdits(this.arguments1.argumentsDataGrid);
-                            }
-                        }
-                    }), DispatcherPriority.Input);
-            }
-            else
-            {
-                ErrorReporting.ActiveDesignerView = this;
-            }
-        }
-
-        //Suppress handling arrow keys in ScrollViewer
-        void OnScrollViewerKeyDown(object sender, KeyEventArgs e)
-        {
-            if (!e.Handled)
-            {
-                if ((e.Key == Key.Up) || (e.Key == Key.Down) || (e.Key == Key.Left) || (e.Key == Key.Right))
-                {
-                    e.Handled = true;
-                }
-
-                if (e.Key == Key.Escape)
-                {
-                    if (this.rubberBandSelector != null)
-                    {
-                        this.rubberBandSelector.OnScrollViewerEscapeKeyDown();
-                    }
-                }
-            }
-        }
-
-        protected override void OnKeyDown(KeyEventArgs e)
-        {
-            //look up for unhandled Enter key events
-            if (!e.Handled && Keyboard.Modifiers == ModifierKeys.None && e.OriginalSource is WorkflowViewElement)
-            {
-                switch (e.Key)
-                {
-                    case Key.Enter:
-                        this.navigateToChildFunction((WorkflowViewElement)e.OriginalSource, true);
-                        break;
-
-                    case Key.Back:
-                        this.navigateToParentFunction((WorkflowViewElement)e.OriginalSource, true);
-                        break;
-                }
-            }
-            base.OnKeyDown(e);
-        }
-
-        protected override void OnPreviewMouseWheel(MouseWheelEventArgs e)
-        {
-            if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
-            {
-                this.zoomSlider.Value += e.Delta / scrollDeltaDivider;
-                e.Handled = true;
-            }
-            else
-            {
-                base.OnPreviewMouseWheel(e);
-            }
-        }
-
-        protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
-        {
-            this.ShouldStillAllowRubberBandEvenIfMouseLeftButtonDownIsHandled = false;
-            base.OnPreviewMouseLeftButtonDown(e);
-        }
-
-        protected override void OnPreviewDragOver(DragEventArgs e)
-        {
-            AutoScrollHelper.AutoScroll(e, this.scrollViewer, 10);
-            base.OnPreviewDragOver(e);
-        }
-
-        public void RegisterViewElement(WorkflowViewElement viewElement)
-        {
-            if (this.rubberBandSelector != null)
-            {
-                this.rubberBandSelector.RegisterViewElement(viewElement);
-            }
-        }
-
-        public void UnregisterViewElement(WorkflowViewElement viewElement)
-        {
-            if (this.rubberBandSelector != null)
-            {
-                this.rubberBandSelector.UnregisterViewElement(viewElement);
-            }
-        }
-
-        private void OnScrollViewerMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
-        {
-            if (this.rubberBandSelector != null)
-            {
-                this.rubberBandSelector.OnScrollViewerMouseLeftButtonDown(e);
-            }
-        }
-
-        private void OnScrollViewerMouseMove(object sender, MouseEventArgs e)
-        {
-            if (this.rubberBandSelector != null)
-            {
-                this.rubberBandSelector.OnScrollViewerMouseMove(e);
-            }
-        }
-
-        private void OnScrollViewerMouseLeave(object sender, MouseEventArgs e)
-        {
-            if (this.rubberBandSelector != null)
-            {
-                this.rubberBandSelector.OnScrollViewerMouseLeave();
-            }
-        }
-
-        private void OnScrollViewerPreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
-        {
-            if (this.rubberBandSelector != null)
-            {
-                this.rubberBandSelector.OnScrollViewerPreviewMouseLeftButtonUp(e);
-            }
-        }
-
-        private void OnScrollViewerPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
-        {
-            this.ShouldStillAllowRubberBandEvenIfMouseLeftButtonDownIsHandled = true;
-        }
-
-        private void OnRootDesignerPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
-        {
-            this.ShouldStillAllowRubberBandEvenIfMouseLeftButtonDownIsHandled = false;
-        }
-
-        void OnDesignerSurfaceMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
-        {
-            //user clicked on designer surface, somwhere around actual designer - try to select root designer
-            if (e.OriginalSource == this.scrollViewer || e.OriginalSource == this.scrollableContent || e.OriginalSource == this.scrollViewer.Content)
-            {
-                //get root designer in given breadcrumb scope
-                var root = this.RootDesigner as WorkflowViewElement;
-                if (null != root)
-                {
-                    //if Ctrl is pressed, handle toggling
-                    if (Keyboard.Modifiers == ModifierKeys.Control)
-                    {
-                        Selection.Toggle(this.Context, root.ModelItem);
-                    }
-                    //else, select the root
-                    else
-                    {
-                        Selection.SelectOnly(this.Context, root.ModelItem);
-                    }
-                    //update focused view element - keyboard focus is set to scrollview, but designer infrastructure requires updated
-                    //FocusViewElement to reference root.
-                    this.FocusedViewElement = root;
-                }
-                e.Handled = true;
-            }
-        }
-
-        static void OnActivitySchemaChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
-        {
-            DesignerView control = (DesignerView)dependencyObject;
-            control.OnActivitySchemaChanged();
-        }
-
-        static void OnRootDesignerChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
-        {
-            DesignerView control = (DesignerView)dependencyObject;
-            control.OnRootDesignerChanged(e);
-        }
-
-        static void OnIsReadOnlyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
-        {
-            DesignerView designerView = (DesignerView)dependencyObject;
-            designerView.Context.Items.SetValue(new ReadOnlyState() { IsReadOnly = (bool)e.NewValue });
-        }
-
-        static void OnInPanModeChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
-        {
-            DesignerView designerView = (DesignerView)dependencyObject;
-            if (designerView.scrollViewerPanner != null)
-            {
-                designerView.scrollViewerPanner.InPanMode = designerView.InPanMode;
-            }
-        }
-
-        void HideBottomPane()
-        {
-            bottomPaneHeight = this.designerViewGrid.RowDefinitions[2].Height;
-            this.designerViewGrid.RowDefinitions[2].Height = new GridLength(0);
-            this.splitter.Visibility = Visibility.Collapsed;
-            this.bottomPanel.Visibility = Visibility.Collapsed;
-        }
-
-        void OnActivitySchemaChanged()
-        {
-            if (null != this.ActivitySchema && typeof(ActivityBuilder).IsAssignableFrom(this.ActivitySchema.ItemType))
-            {
-                UpdateArgumentsButtonVisibility(true);
-            }
-            else
-            {
-                UpdateArgumentsButtonVisibility(false);
-            }
-        }
-
-        private void OnBottomPanelClose(object sender, RoutedEventArgs e)
-        {
-            ToggleButton toggleButton = this.bottomPanel.Tag as ToggleButton;
-            Fx.Assert(toggleButton != null, "toggleButton cannot be null");
-            toggleButton.IsChecked = false;
-        }
-
-        void OnBreadCrumbClick(object sender, RoutedEventArgs e)
-        {
-            //this method can be invoked two ways - left mouse click on element or key press
-            ListBoxItem listBoxItem = sender as ListBoxItem;
-            //handle only events for items which are actual model items
-            if (null != listBoxItem && listBoxItem.Content is ModelItem)
-            {
-                //determine which event are we handling
-                KeyEventArgs keyArgs = e as KeyEventArgs;
-                MouseButtonEventArgs mouseArgs = e as MouseButtonEventArgs;
-                //in case of key events - accept only Enter, in case of mouse events - i know it is left mouse button
-                if ((null != keyArgs && keyArgs.Key == Key.Enter && Keyboard.Modifiers == ModifierKeys.None) || null != mouseArgs)
-                {
-                    //make selection new root designer
-                    this.MakeRootDesigner((ModelItem)listBoxItem.Content);
-                    //mark event as handled
-                    e.Handled = true;
-                    // SQM: Breadcrumb
-                    FeatureUsageCounter.ReportUsage(sqmService, WorkflowDesignerFeatureId.Breadcrumb);
-                }
-            }
-        }
-
-        void OnBreadCrumbNavigation(object sender, KeyEventArgs e)
-        {
-            //this method is invoked whenever user presses any key while breadcrumb has focus
-            ItemsControl breadcrumbItems = sender as ItemsControl;
-            //i expect that there is at least one item in the collection, arrow key is pressed and no keyboard modifiers are active
-            if (null != breadcrumbItems && breadcrumbItems.Items.Count > 0 && Keyboard.Modifiers == ModifierKeys.None && (e.Key == Key.Left || e.Key == Key.Right))
-            {
-                //get first entry from collection
-                UIElement first = (UIElement)breadcrumbItems.ItemContainerGenerator.ContainerFromIndex(0);
-                //get last entry from collection
-                UIElement last = (UIElement)breadcrumbItems.ItemContainerGenerator.ContainerFromIndex(breadcrumbItems.Items.Count - 1);
-                //if last is selected, then set focus to the first, so Tab doesn't escape to other control
-                if (e.Key == Key.Right && last.IsKeyboardFocusWithin)
-                {
-                    first.Focus();
-                    e.Handled = true;
-                }
-                else if (e.Key == Key.Left && first.IsKeyboardFocusWithin)
-                {
-                    last.Focus();
-                    e.Handled = true;
-                }
-            }
-        }
-
-        void OnExtensionWindowClosing(object sender, ExtensionWindowClosingRoutedEventArgs e)
-        {
-            e.Cancel = true;
-            e.Handled = true;
-            ((ExtensionWindow)sender).IsEnabled = false;
-        }
-
-        void OnRootDesignerChanged(DependencyPropertyChangedEventArgs e)
-        {
-            WorkflowViewElement previousRoot = (WorkflowViewElement)e.OldValue;
-            WorkflowViewElement currentRoot = (WorkflowViewElement)e.NewValue;
-            if (previousRoot != null)
-            {
-                previousRoot.IsRootDesigner = false;
-            }
-            if (currentRoot != null)
-            {
-                currentRoot.IsRootDesigner = true;
-            }
-        }
-
-        [SuppressMessage(FxCop.Category.Usage, FxCop.Rule.ReviewUnusedParameters,
-            Justification = "The parameters are defined by DependencyPropertyChangedEventHandler delegate")]
-        void OnMinimapVisibilityChanged(object sender, DependencyPropertyChangedEventArgs e)
-        {
-            ExtensionSurface.PlacementMode mode = ExtensionSurface.GetMode(this.miniMap);
-            if (mode == ExtensionSurface.PlacementMode.Relative)
-            {
-                ExtensionSurface.SetMode(this.miniMap, ExtensionSurface.PlacementMode.Absolute);
-            }
-        }
-
-        void OnBottomPanelIsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
-        {
-            if ((bool)e.NewValue == false)
-            {
-                DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject;
-                // Move the keyboard focus on a proper designer when the bottom panel is closed
-                if (focusedElement == null || focusedElement == sender || ((Visual)sender).IsAncestorOf(focusedElement))
-                {
-                    Keyboard.Focus(this.GetDesignerToFocus());
-                }
-            }
-        }
-
-        void OnToggleButtonCheckChanged(object sender, RoutedEventArgs e)
-        {
-            ToggleButton button = sender as ToggleButton;
-            Fx.Assert(button != null, "Button cannot be null");
-            ExtensionWindow window = button.Tag as ExtensionWindow;
-            if (null != window)
-            {
-                window.Visibility = button.IsChecked.Value ? Visibility.Visible : Visibility.Hidden;
-            }
-            else
-            {
-                UIElement uiElement = button.Tag as UIElement;
-                if (null != uiElement)
-                {
-                    if (uiElement.Visibility == Visibility.Collapsed)
-                    {
-                        //remove the previous userControl
-                        if (this.bottomPanel.Tag != null)
-                        {
-                            ToggleButton toggleButton = this.bottomPanel.Tag as ToggleButton;
-                            Fx.Assert(toggleButton != null, "toggleButton should not be null");
-                            if (button != toggleButton)
-                            {
-                                toggleButton.IsChecked = false;
-                            }
-                        }
-                        //add the new userControl
-                        this.bottomPanel.Visibility = Visibility.Visible;
-                        this.bottomPanel.Tag = button;
-                        this.splitter.Visibility = Visibility.Visible;
-                        uiElement.Visibility = Visibility.Visible;
-                        this.designerViewGrid.RowDefinitions[2].Height = bottomPaneHeight;
-                    }
-                    else
-                    {
-                        //remove the current userControl
-                        this.bottomPanel.Tag = null;
-                        HideBottomPane();
-                        uiElement.Visibility = Visibility.Collapsed;
-                    }
-                }
-            }
-        }
-
-        void OnZoomSliderValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
-        {
-            if (this.ZoomFactor == 1)
-            {
-                TextOptions.SetTextFormattingMode(this.scrollableContent, TextFormattingMode.Display);
-            }
-            else
-            {
-                TextOptions.SetTextFormattingMode(this.scrollableContent, TextFormattingMode.Ideal);
-            }
-            this.scrollableContent.LayoutTransform = new ScaleTransform(this.ZoomFactor, this.ZoomFactor);
-        }
-
-        void SetAsRootDesignerView(ModelItem root, bool setAsSelection)
-        {
-            VirtualizedContainerService containerService = this.Context.Services.GetService<VirtualizedContainerService>();
-
-            this.RootDesigner = null;
-            //get the root view (route the call through virtualized container serivce, so Loaded and Unloaded events get hooked up)
-            VirtualizedContainerService.VirtualizingContainer rootContainer = (VirtualizedContainerService.VirtualizingContainer)containerService.GetContainer(root, null);
-            rootContainer.Populate();
-            this.RootDesigner = (WorkflowViewElement)rootContainer.Child;
-
-            if (setAsSelection)
-            {
-                ModelItem selection = root;
-                if (selectionMap.ContainsKey(root))
-                {
-                    ModelItem prevSelection = selectionMap[root];
-                    selection = null;
-                    if (prevSelection != null && ViewUtilities.IsViewVisible(prevSelection, root, context))
-                    {
-                        selection = prevSelection;
-                    }
-                }
-                if (selection != null)
-                {
-                    selection.Focus();
-                }
-                else
-                {
-                    this.Context.Items.SetValue(new Selection());
-                }
-            }
-        }
-
-        private void SplitterDragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e)
-        {
-            bottomPaneHeight = this.designerViewGrid.RowDefinitions[2].Height;
-        }
-
-        void CreateXPSDocument(string fileName)
-        {
-            using (FileStream fs = new FileStream(fileName, FileMode.Create))
-            {
-                Package package = Package.Open(fs, FileMode.Create);
-                XpsDocument document = new XpsDocument(package);
-                XpsDocumentWriter documentWriter = XpsDocument.CreateXpsDocumentWriter(document);
-
-                int imageWidth = (int)this.designerPresenter.DesiredSize.Width;
-                int imageHeight = (int)this.designerPresenter.DesiredSize.Height;
-
-                PrintTicket ticket = new PrintTicket() { PageMediaSize = new PageMediaSize(imageWidth, imageHeight) };
-                if (IsRightToLeft(this.designerPresenter))
-                {
-                    Transform originalTransform = this.designerPresenter.RenderTransform;
-                    try
-                    {
-                        this.designerPresenter.RenderTransform = new ScaleTransform(-1, 1, imageWidth / 2, 0);
-                        documentWriter.Write(this.designerPresenter, ticket);
-                    }
-                    finally
-                    {
-                        this.designerPresenter.RenderTransform = originalTransform;
-                    }
-                }
-                else
-                {
-                    documentWriter.Write(this.designerPresenter, ticket);
-                }
-
-                document.Close();
-                package.Close();
-                fs.Flush();
-            }
-        }
-
-        void CreateImageFile(string fileName, Type encoderType)
-        {
-            using (FileStream fs = new FileStream(fileName, FileMode.Create))
-            {
-                BitmapEncoder encoder = (BitmapEncoder)Activator.CreateInstance(encoderType);
-                encoder.Frames.Add(BitmapFrame.Create(this.CreateScreenShot()));
-                encoder.Save(fs);
-                fs.Close();
-            }
-        }
-
-        // CreateScreenShot should handle the situation when the FlowDirection of Designer's 
-        // parent is RightToLeft
-        // 
-        // The structure:
-        // Root
-        //   |--DesignerView
-        // The DesignerView is what we're trying to capture.
-        // 
-        // If Root.FlowDirection is RightToLeft, the DesignerView's capture is a flipped image.
-        // Say, if DesignerView is diplayed on screen:
-        // -->==>
-        // the captured image would be:
-        // <==<--
-        // It is Root who flips the image before diplaying on screen.
-        // But, in our capture, Root will not do the flipping work for us, so we flip the image
-        // before return.
-        BitmapSource CreateScreenShot()
-        {
-            const double DPI = 96.0;
-
-            Rect bounds = VisualTreeHelper.GetDescendantBounds(this.designerPresenter);
-            int imageWidth = (int)Math.Ceiling(bounds.Right);
-            int imageHeight = (int)Math.Ceiling(bounds.Bottom);
-            Rectangle background = new Rectangle()
-            {
-                // WindowBrush:
-                //  Gets a SolidColorBrush that is the background 
-                //  color in the client area of a window.  
-                Fill = new SolidColorBrush(WorkflowDesignerColors.DesignerViewBackgroundColor),
-                Width = imageWidth,
-                Height = imageHeight,
-            };
-
-            background.Arrange(new Rect(0, 0, imageWidth, imageHeight));
-
-            RenderTargetBitmap renderBitmap = new RenderTargetBitmap(imageWidth, imageHeight, DPI, DPI, PixelFormats.Pbgra32);
-            renderBitmap.Render(background);
-            renderBitmap.Render(this.designerPresenter);
-
-            BitmapSource source = BitmapFrame.Create(renderBitmap);
-
-            if (IsRightToLeft(this.designerPresenter))
-            {
-                return new TransformedBitmap(source, new ScaleTransform(-1, 1, imageWidth / 2, 0));
-            }
-
-            return source;
-        }
-
-        public void OnReferenceUpdated(AssemblyName updatedReference, bool isAdded)
-        {
-            //Queue the work item instead of execute it directly in reference updated handler. Otherwise when in VS, we cannot get the assembly through multi-targeting service.
-            Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(() => this.imports1.OnReferenceUpdated(updatedReference, isAdded)));
-        }
-
-        internal void CheckButtonVariables()
-        {
-            this.buttonVariables1.IsChecked = true;
-        }
-
-        internal void CheckButtonArguments()
-        {
-            this.buttonArguments1.IsChecked = true;
-        }
-
-        void OnVariablesCollectionChanged(object sender, RoutedEventArgs e)
-        {
-            // Suppress showing the variable designer for 4.0 compatibility. See TFS 631027 for details.
-            // CheckButtonVariables();
-        }
-
-        void OnArgumentsCollectionChanged(object sender, RoutedEventArgs e)
-        {
-            CheckButtonArguments();
-        }
-
-        void ApplyShellBarItemVisibility(ShellBarItemVisibility visibility)
-        {
-            // Store user preferences
-            this.shellBarItemVisibility = visibility;
-
-            // Variable, Arguments, Imports
-            UpdateStatusBarItemVisibility(this.variablesStatusBarItem, CheckItemVisibility(visibility, ShellBarItemVisibility.Variables), this.variables1);
-            UpdateArgumentsButtonVisibility(CheckItemVisibility(visibility, ShellBarItemVisibility.Arguments));
-            UpdateStatusBarItemVisibility(this.importsStatusBarItem, CheckItemVisibility(visibility, ShellBarItemVisibility.Imports), this.imports1);
-
-            // PanMode
-            this.panModeStatusBarItem.Visibility = CheckItemVisibility(visibility, ShellBarItemVisibility.PanMode) ? Visibility.Visible : Visibility.Collapsed;
-
-            // Zoom
-            Visibility zoomVisibility = CheckItemVisibility(visibility, ShellBarItemVisibility.Zoom) ? Visibility.Visible : Visibility.Collapsed;
-            this.zoomFitToScreenStatusBar.Visibility = zoomVisibility;
-            this.zoomIconStatusBar.Visibility = zoomVisibility;
-            this.zoomPickerStatusBar.Visibility = zoomVisibility;
-            this.zoomSliderStatusBar.Visibility = zoomVisibility;
-
-            // MiniMap
-            this.minimapStatusBar.Visibility = CheckItemVisibility(visibility, ShellBarItemVisibility.MiniMap) ? Visibility.Visible : Visibility.Collapsed;
-
-            // Hide entire status bar if nothing is visible 
-            this.shellBar.Visibility = (ShellBarItemVisibility.None == visibility) ? Visibility.Collapsed : Visibility.Visible;
-        }
-
-        void ApplyShellHeaderItemsVisibility(ShellHeaderItemsVisibility visibility)
-        {
-            // If all the items on shell header are invisible, the shell header
-            // will be hiden automatically. 
-            // 
-            // Expand All/ Collapse All / Breadcrumb
-            this.breadCrumbListBox.Visibility = CheckItemVisibility(visibility, ShellHeaderItemsVisibility.Breadcrumb) ? Visibility.Visible : Visibility.Collapsed;
-            this.expandAllButton.Visibility = CheckItemVisibility(visibility, ShellHeaderItemsVisibility.ExpandAll) ? Visibility.Visible : Visibility.Collapsed;
-            this.collapseAllButton.Visibility = CheckItemVisibility(visibility, ShellHeaderItemsVisibility.CollapseAll) ? Visibility.Visible : Visibility.Collapsed;
-        }
-
-        private static bool CheckItemVisibility(ShellHeaderItemsVisibility visibility, ShellHeaderItemsVisibility itemToCheck)
-        {
-            return (itemToCheck & visibility) == itemToCheck;
-        }
-
-        private static bool CheckItemVisibility(ShellBarItemVisibility visibility, ShellBarItemVisibility itemToCheck)
-        {
-            return (itemToCheck & visibility) == itemToCheck;
-        }
-
-        private static bool IsRightToLeft(FrameworkElement element)
-        {
-            Fx.Assert(element != null, "element should not be null");
-            return element.FlowDirection == FlowDirection.RightToLeft;
-        }
-
-        private AdornerLayer GetAdornerLayerForDragShadow()
-        {
-            return AdornerLayer.GetAdornerLayer(this.scrollableContent);
-        }
-
-        private void UpdateArgumentsButtonVisibility(bool visible)
-        {
-            UpdateStatusBarItemVisibility(this.argumentsStatusBarItem, visible, this.arguments1);
-        }
-
-        private void UpdateStatusBarItemVisibility(StatusBarItem item, bool visible, UIElement element)
-        {
-            if (item == null || element == null)
-            {
-                return;
-            }
-
-            item.Visibility = visible ? Visibility.Visible : Visibility.Collapsed;
-
-            // Hide the correponding UIElement (VariableDesigner, ArgumentDesigner, etc.) if the button shouldn't be visible
-            if (item.Visibility != Visibility.Visible)
-            {
-                element.IsEnabled = false;
-            }
-            else
-            {
-                element.IsEnabled = true;
-            }
-        }
-
-        public void FlushState()
-        {
-            this.SaveDesignerStates();
-        }
-
-
-        void SaveDesignerStates()
-        {
-            this.SaveBreadCrumbRoot();
-            this.SaveSelection();
-            this.SaveZoomFactor();
-        }
-
-        internal void RestoreDesignerStates()
-        {
-            this.RestoreBreadCrumbRoot();
-            this.RestoreSelection();
-            this.RestoreZoomFactor();
-        }
-
-        void SaveSelection()
-        {
-            IWorkflowDesignerStorageService service = this.Context.Services.GetService<IWorkflowDesignerStorageService>();
-            ModelTreeManager modelTreeManager = this.Context.Services.GetService<ModelTreeManager>();
-            if (service != null && modelTreeManager != null)
-            {
-                Selection selection = this.Context.Items.GetValue<Selection>();
-                var selectionPathList = new List<string>();
-                foreach (ModelItem item in selection.SelectedObjects)
-                {
-                    if (item.Root == modelTreeManager.Root)
-                    {
-                        selectionPathList.Add(item.GetModelPath());
-                    }
-                }
-                if (service.ContainsKey(selectionKey))
-                {
-                    service.SetData(selectionKey, selectionPathList);
-                }
-                else
-                {
-                    service.AddData(selectionKey, selectionPathList);
-                }
-            }
-        }
-
-        void RestoreSelection()
-        {
-            IWorkflowDesignerStorageService service = this.Context.Services.GetService<IWorkflowDesignerStorageService>();
-            ModelTreeManager modelTreeManager = this.Context.Services.GetService<ModelTreeManager>();
-            if (service != null && service.ContainsKey(selectionKey) && modelTreeManager != null && modelTreeManager.Root != null)
-            {
-                var selectionPathList = service.GetData(selectionKey) as List<string>;
-                if (selectionPathList != null)
-                {
-                    var modelItemList = new List<ModelItem>();
-                    foreach (string path in selectionPathList)
-                    {
-                        ModelItem item = ModelItemExtensions.GetModelItemFromPath(path, modelTreeManager.Root);
-                        if (item != null)
-                        {
-                            modelItemList.Add(item);
-                        }
-                    }
-                    Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(() =>
-                    {
-                        this.Context.Items.SetValue(new Selection(modelItemList));
-                    }));
-                }
-            }
-        }
-
-        void SaveBreadCrumbRoot()
-        {
-            IWorkflowDesignerStorageService service = this.Context.Services.GetService<IWorkflowDesignerStorageService>();
-            DesignerView designerView = this.Context.Services.GetService<DesignerView>();
-            if (service != null && designerView != null && designerView.RootDesigner != null)
-            {
-                WorkflowViewElement rootDesigner = designerView.RootDesigner as WorkflowViewElement;
-                if (rootDesigner != null)
-                {
-                    if (service.ContainsKey(breadCrumbRootKey))
-                    {
-                        service.SetData(breadCrumbRootKey, rootDesigner.ModelItem.GetModelPath());
-                    }
-                    else
-                    {
-                        service.AddData(breadCrumbRootKey, rootDesigner.ModelItem.GetModelPath());
-                    }
-                }
-            }
-        }
-
-        void RestoreBreadCrumbRoot()
-        {
-            IWorkflowDesignerStorageService service = this.Context.Services.GetService<IWorkflowDesignerStorageService>();
-            ModelTreeManager modelTreeManager = this.Context.Services.GetService<ModelTreeManager>();
-            DesignerView designerView = this.context.Services.GetService<DesignerView>();
-            if (service != null && service.ContainsKey(breadCrumbRootKey) && modelTreeManager != null && modelTreeManager.Root != null && designerView != null)
-            {
-                string path = service.GetData(breadCrumbRootKey) as string;
-                if (path != null)
-                {
-                    ModelItem item = ModelItemExtensions.GetModelItemFromPath(path, modelTreeManager.Root);
-                    if (item != null)
-                    {
-                        designerView.MakeRootDesigner(item);
-                    }
-                }
-            }
-        }
-
-        void SaveZoomFactor()
-        {
-            IWorkflowDesignerStorageService service = this.Context.Services.GetService<IWorkflowDesignerStorageService>();
-            if (service != null)
-            {
-                if (service.ContainsKey(zoomFactorKey))
-                {
-                    service.SetData(zoomFactorKey, this.zoomSlider.Value);
-                }
-                else
-                {
-                    service.AddData(zoomFactorKey, this.zoomSlider.Value);
-                }
-            }
-        }
-
-        void RestoreZoomFactor()
-        {
-            IWorkflowDesignerStorageService service = this.Context.Services.GetService<IWorkflowDesignerStorageService>();
-            if (service != null && service.ContainsKey(zoomFactorKey))
-            {
-                object data = service.GetData(zoomFactorKey);
-                if (data is double)
-                {
-                    this.zoomSlider.Value = (double)data;
-                }
-            }
-        }
-
-        //this class is used to convert zoom slider ticks to actual zoom percantage
-        //the speced range of supported zoom values is between 25 % - 400% (with 25, 50, 100, 200 and 400 predefined steps)
-        //since increments are non linear, i use y = a(x*x) + c equation, to calculate zoom factor - zoom will be more glanular
-        //for small values, and more coarse for larger ones
-        private sealed class ZoomToTicksConverter : IValueConverter
-        {
-            const double minValue = 25;
-            const double maxValue = 400;
-
-            //predefined a value - calculated on assumption that maximum zoom value is 400% 
-            const double a = 0.15;
-            //predefined c value - calculated on assumption that minimum zoom value is 25%
-            const double c = 25;
-            IValueConverter baseConverter;
-
-            DesignerView view;
-            string zoomFitToScreenLabel;
-            double[] keyboardZoomTicks;
-
-            internal ZoomToTicksConverter(DesignerView designer, Slider zoomSlider, ComboBox zoomPicker)
-            {
-                this.view = designer;
-                this.zoomFitToScreenLabel = (this.view.TryFindResource("zoomFitToScreenLabel") as string) ?? "Fit to screen";
-                //this.baseConverter = new ZoomPercentageConverter();
-                //right now, we want to use our custom ZoomToPercantageConverter due to localization issues with WPF one
-                this.baseConverter = new CustomZoomPercentageConverter();
-
-                //initialize zoom slider
-                zoomSlider.Minimum = 0;
-                zoomSlider.Maximum = 50;
-                zoomSlider.Ticks = new DoubleCollection(new double[] { 0, 10, 20, 30, 40, 50 });
-
-                //set initial value - initially, zoom is set to 100%
-                zoomSlider.Value = (double)this.ConvertBack(
-                    this.baseConverter.Convert(100.0, typeof(string), null, CultureInfo.InvariantCulture), typeof(double), null, CultureInfo.InvariantCulture);
-
-                //insert predefined values to zoomPicker - i use converter to percantage, to ensure text will be formated accordingly to user settings
-                zoomPicker.ItemsSource = new object[]
-                    {
-                        this.baseConverter.Convert(25.0, typeof(string), null, CultureInfo.InvariantCulture),
-                        this.baseConverter.Convert(50.0, typeof(string), null, CultureInfo.InvariantCulture),
-                        this.baseConverter.Convert(100.0, typeof(string), null, CultureInfo.InvariantCulture),
-                        this.baseConverter.Convert(200.0, typeof(string), null, CultureInfo.InvariantCulture),
-                        this.baseConverter.Convert(400.0, typeof(string), null, CultureInfo.InvariantCulture)
-                    };
-
-                //setup bindings
-                zoomPicker.SetBinding(ComboBox.SelectedItemProperty, new Binding()
-                {
-                    Source = zoomSlider,
-                    Path = new PropertyPath(Slider.ValueProperty),
-                    Converter = this
-                });
-
-                zoomPicker.SetBinding(ComboBox.TextProperty, new Binding()
-                {
-                    Source = zoomSlider,
-                    Path = new PropertyPath(Slider.ValueProperty),
-                    Converter = this
-                });
-
-                this.keyboardZoomTicks = new double[]
-                {
-                    (double)this.ConvertBack(
-                        this.baseConverter.Convert(25.0, typeof(string), null, CultureInfo.InvariantCulture), typeof(double), null, CultureInfo.InvariantCulture),
-                    (double)this.ConvertBack(
-                        this.baseConverter.Convert(37.5, typeof(string), null, CultureInfo.InvariantCulture), typeof(double), null, CultureInfo.InvariantCulture),
-                    (double)this.ConvertBack(
-                        this.baseConverter.Convert(50.0, typeof(string), null, CultureInfo.InvariantCulture), typeof(double), null, CultureInfo.InvariantCulture),
-                    (double)this.ConvertBack(
-                        this.baseConverter.Convert(75.0, typeof(string), null, CultureInfo.InvariantCulture), typeof(double), null, CultureInfo.InvariantCulture),
-                    (double)this.ConvertBack(
-                        this.baseConverter.Convert(100.0, typeof(string), null, CultureInfo.InvariantCulture), typeof(double), null, CultureInfo.InvariantCulture),
-                    (double)this.ConvertBack(
-                        this.baseConverter.Convert(150.0, typeof(string), null, CultureInfo.InvariantCulture), typeof(double), null, CultureInfo.InvariantCulture),
-                    (double)this.ConvertBack(
-                        this.baseConverter.Convert(200.0, typeof(string), null, CultureInfo.InvariantCulture), typeof(double), null, CultureInfo.InvariantCulture),
-                    (double)this.ConvertBack(
-                        this.baseConverter.Convert(300.0, typeof(string), null, CultureInfo.InvariantCulture), typeof(double), null, CultureInfo.InvariantCulture),
-                    (double)this.ConvertBack(
-                        this.baseConverter.Convert(400.0, typeof(string), null, CultureInfo.InvariantCulture), typeof(double), null, CultureInfo.InvariantCulture),
-
-                };
-
-                this.view.zoomPicker.LostFocus += (s, e) =>
-                {
-                    string text = this.Convert(this.view.zoomSlider.Value, typeof(string), null, CultureInfo.InvariantCulture) as string;
-                    if (null != text)
-                    {
-                        this.view.zoomPicker.Text = string.Empty;
-                        this.view.zoomPicker.Text = text;
-                    }
-                };
-
-            }
-
-            double CalculateY(double x)
-            {
-                return ((x * x) * a) + c;
-            }
-
-            double CalculateX(double y)
-            {
-                return Math.Sqrt((y - c) / a);
-            }
-
-            internal double ZoomFactor
-            {
-                get
-                {
-                    return this.CalculateY(this.view.zoomSlider.Value) / 100.0;
-                }
-            }
-
-            public bool CanZoomIn()
-            {
-                return this.view.zoomSlider.Value < this.view.zoomSlider.Maximum;
-            }
-
-            public void ZoomIn()
-            {
-                double x = this.view.zoomSlider.Value;
-                for (int i = 0; i < this.keyboardZoomTicks.Length; ++i)
-                {
-                    if (x < this.keyboardZoomTicks[i])
-                    {
-                        this.view.zoomSlider.Value = this.keyboardZoomTicks[i];
-                        break;
-                    }
-                }
-            }
-
-            public void ZoomOut()
-            {
-                double x = this.view.zoomSlider.Value;
-                for (int i = this.keyboardZoomTicks.Length - 1; i >= 0; --i)
-                {
-                    if (x > this.keyboardZoomTicks[i])
-                    {
-                        this.view.zoomSlider.Value = this.keyboardZoomTicks[i];
-                        break;
-                    }
-                }
-            }
-
-            public bool CanZoomOut()
-            {
-                return this.view.zoomSlider.Value > this.view.zoomSlider.Minimum;
-            }
-
-            public void FitToScreen()
-            {
-                double y1 = (this.view.scrollViewer.ViewportWidth / this.view.scrollableContent.ActualWidth) * 100.0;
-                double y2 = (this.view.scrollViewer.ViewportHeight / this.view.scrollableContent.ActualHeight) * 100.0;
-                double y = Math.Min(maxValue, Math.Max(minValue, Math.Min(y1, y2)));
-                this.view.zoomSlider.Value = this.CalculateX(y);
-            }
-
-            public void ResetZoom()
-            {
-                this.view.zoomSlider.Value = this.CalculateX(100.0);
-            }
-
-            [SuppressMessage(FxCop.Category.Design, FxCop.Rule.DoNotCatchGeneralExceptionTypes,
-                Justification = "Catching all exceptions to avoid VS Crash")]
-            [SuppressMessage("Reliability", "Reliability108", Justification = "Catching all exceptions to avoid VS Crash")]
-            public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-            {
-                if (null != value && value is double)
-                {
-                    try
-                    {
-                        return this.baseConverter.Convert(this.CalculateY((double)value), targetType, parameter, culture);
-                    }
-                    catch (Exception e)
-                    {
-                        System.Diagnostics.Debug.WriteLine(e.ToString());
-                    }
-                }
-                return Binding.DoNothing;
-            }
-
-            [SuppressMessage(FxCop.Category.Design, FxCop.Rule.DoNotCatchGeneralExceptionTypes,
-                Justification = "Catching all exceptions to avoid VS Crash")]
-            [SuppressMessage("Reliability", "Reliability108", Justification = "Catching all exceptions to avoid VS Crash")]
-
-            public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-            {
-                if (null != value)
-                {
-                    try
-                    {
-                        double y = 0.0;
-                        if (string.Equals(this.zoomFitToScreenLabel, value))
-                        {
-                            double y1 = (this.view.scrollViewer.ViewportWidth / this.view.scrollableContent.ActualWidth) * 100.0;
-                            double y2 = (this.view.scrollViewer.ViewportHeight / this.view.scrollableContent.ActualHeight) * 100.0;
-                            y = Math.Min(maxValue, Math.Max(minValue, Math.Min(y1, y2)));
-                        }
-                        else
-                        {
-                            y = (double)this.baseConverter.ConvertBack(value, targetType, parameter, culture);
-                        }
-                        return this.CalculateX(y);
-                    }
-                    catch (Exception e)
-                    {
-                        System.Diagnostics.Debug.WriteLine(e.ToString());
-                    }
-                }
-                return Binding.DoNothing;
-            }
-        }
-
-        internal static bool IsMouseInViewport(MouseButtonEventArgs e, ScrollViewer scrollViewer)
-        {
-            Point mousePosition = e.GetPosition(scrollViewer);
-            return mousePosition.X > 0 && mousePosition.X < scrollViewer.ViewportWidth &&
-                mousePosition.Y > 0 && mousePosition.Y < scrollViewer.ViewportHeight;
-        }
-
-        /// <summary>
-        /// CustomZoomPercentageConverter - used temporary instead of WPF provided ZoomToPercantageConverter due to the problems
-        /// in localized builds
-        /// </summary>
-        private sealed class CustomZoomPercentageConverter : IValueConverter
-        {
-            public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-            {
-                object result = DependencyProperty.UnsetValue;
-                if (null != value)
-                {
-                    double valueAsDouble = System.Convert.ToDouble(value, CultureInfo.CurrentCulture);
-                    if (valueAsDouble == Math.Floor(valueAsDouble))
-                    {
-                        // Ignore decimal part if it is an Int value.
-                        result = string.Format(CultureInfo.CurrentCulture, "{0}%", valueAsDouble.ToString("F0", CultureInfo.CurrentCulture));
-                    }
-                    else
-                    {
-                        result = string.Format(CultureInfo.CurrentCulture, "{0}%", valueAsDouble.ToString("F2", CultureInfo.CurrentCulture));
-                    }
-                }
-                return result;
-            }
-
-            public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-            {
-                object result = DependencyProperty.UnsetValue;
-                if (null != value)
-                {
-                    string valueAsString = value.ToString().Replace("%", "").Trim();
-                    result = System.Convert.ToDouble(valueAsString, CultureInfo.CurrentCulture);
-                }
-                return result;
-            }
-        }
-
-        //BreadCrumbObjectSeparator - right now, this class has no functionality - object of this class is used as 
-        //a separator between different breadcrumb elements. however, i can imagine scenario when additional functionality
-        //is added here (i.e. similar to breadcrumb in Vista explorer)
-        sealed class BreadCrumbObjectSeparator
-        {
-            //ItemType property - to avoid binding errors and make this object similar to ModelItem
-            public Type ItemType
-            {
-                get { return typeof(BreadCrumbObjectSeparator); }
-            }
-        }
-
-        private sealed class DesignerViewProxy
-        {
-            private WeakReference reference;
-
-            public DesignerViewProxy(DesignerView designerView)
-            {
-                this.reference = new WeakReference(designerView);
-            }
-
-            public void OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
-            {
-                DesignerView designerView = this.reference.Target as DesignerView;
-                if (designerView != null)
-                {
-                    designerView.OnDispatcherUnhandledException(sender, e);
-                }
-            }
-        }
-    }
-
-
-    internal sealed class ContextMenuIconProvider : IMultiValueConverter
-    {
-        //glyph image cache
-        IDictionary<KeyValuePair<string, bool>, DrawingBrush> glyphCache = new Dictionary<KeyValuePair<string, bool>, DrawingBrush>();
-
-        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-        {
-            //get the menu item i'm reffering to
-            var menuItem = values[0] as MenuItem;
-            //get the icon name as defined in /Resources dictionary
-            var iconName = parameter as string;
-            if (null != menuItem && !string.IsNullOrEmpty(iconName))
-            {
-                DrawingBrush glyph = null;
-                //check if image has been used alreay - if yes - get it from cache.
-                if (!glyphCache.TryGetValue(new KeyValuePair<string, bool>(iconName, menuItem.IsEnabled), out glyph))
-                {
-                    string key = string.Format(CultureInfo.InvariantCulture, "Operation{0}{1}Icon", iconName, menuItem.IsEnabled ? string.Empty : "Disabled");
-                    glyph = WorkflowDesignerIcons.IconResourceDictionary[key] as DrawingBrush;
-                    //add it to the cache
-                    glyphCache[new KeyValuePair<string, bool>(iconName, menuItem.IsEnabled)] = glyph;
-                }
-                //return glyph
-                return new Rectangle() { Width = 16, Height = 16, Fill = glyph };
-            }
-            return Binding.DoNothing;
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-    }
-
-    [SuppressMessage(FxCop.Category.Naming, FxCop.Rule.FlagsEnumsShouldHavePluralNames)]
-    [SuppressMessage(FxCop.Category.Usage, "CA2217", Justification = "This is enum value, we don't have enough enum values to fill 32 discrete values")]
-    [Flags]
-    public enum ShellBarItemVisibility
-    {
-        None = 0x0,
-        Variables = 0x1,
-        Arguments = 0x2,
-        Imports = 0x4,
-        Zoom = 0x8,
-        MiniMap = 0x10,
-        PanMode = 0x20,
-        All = -1
-    }
-
-    [SuppressMessage(FxCop.Category.Naming, FxCop.Rule.FlagsEnumsShouldHavePluralNames)]
-    [SuppressMessage(FxCop.Category.Usage, "CA2217", Justification = "This is enum value, we don't have enough enum values to fill 32 discrete values")]
-    [Flags]
-    public enum ShellHeaderItemsVisibility
-    {
-        None = 0x0,
-        Breadcrumb = 0x1,
-        ExpandAll = 0x2,
-        CollapseAll = 0x4,
-        All = -1
-    }
-
-
-    internal sealed class ExpandAllCollapseAllToggleConverter : IMultiValueConverter
-    {
-        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
-        {
-            //values[0] is the corresponding property - For ExpandAllButton - ShouldExpandAllProperty
-            //values[1] is the opposite property - For ExpandAllButton - ShouldCollapseAllProperty
-            return values[0];
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
-        {
-            //Whenever ExpandAll/CollapseAll toggle button state is changed, the opposite property is always reset.
-            return new object[] { value, false };
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/DesignerWithHeader.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/DesignerWithHeader.cs
deleted file mode 100644 (file)
index eec1b97..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Text;
-    using System.Windows;
-
-    class DesignerWithHeader : WorkflowViewElement
-    {
-
-        public static readonly DependencyProperty HeaderProperty =
-            DependencyProperty.Register("Header", typeof(DataTemplate), typeof(DesignerWithHeader), new UIPropertyMetadata(null));
-        public DataTemplate Header
-        {
-            get { return (DataTemplate)GetValue(HeaderProperty); }
-            set { SetValue(HeaderProperty, value); }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/EditorResources.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/EditorResources.cs
deleted file mode 100644 (file)
index a51f1c6..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Text;
-    using System.Windows;
-    using System.Runtime;
-
-    class EditorResources
-    {
-        private static ResourceDictionary resources;
-        internal static ResourceDictionary GetResources()
-        {
-            if (resources == null)
-            {
-                Uri resourceLocator = new Uri(
-                    string.Concat(
-                    typeof(EditorResources).Assembly.GetName().Name,
-                    @";component/System/Activities/Presentation/View/EditorResources.xaml"),
-                    UriKind.RelativeOrAbsolute);
-                resources = (ResourceDictionary)Application.LoadComponent(resourceLocator);
-            }
-            Fx.Assert(resources != null, "Could not load argument value editor resources.");
-            return resources;
-        }
-        static ResourceDictionary icons;
-        internal static ResourceDictionary GetIcons()
-        {
-            if (null == icons)
-            {
-                icons = WorkflowDesignerIcons.IconResourceDictionary;
-            }
-            Fx.Assert(icons != null, "Could not load icon resources.");
-            return icons;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ErrorView.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ErrorView.xaml.cs
deleted file mode 100644 (file)
index 3a11db1..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Text;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Windows.Documents;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using System.Windows.Media.Imaging;
-    using System.Windows.Navigation;
-    using System.Windows.Shapes;
-
-    // This class will be the error view presented when there are exceptions or errors
-    // in the designer view, or when we are unable to load the designer.
-    sealed partial class ErrorView : UserControl
-    {
-
-        public static readonly DependencyProperty MessageProperty =
-            DependencyProperty.Register("Message", typeof(string), typeof(ErrorView), new UIPropertyMetadata(string.Empty));
-
-        public static readonly DependencyProperty DetailsProperty =
-            DependencyProperty.Register("Details", typeof(string), typeof(ErrorView), new UIPropertyMetadata(string.Empty));
-
-
-        public ErrorView()
-        {
-            InitializeComponent();
-            this.DataContext = this;
-        }
-
-        public string Message
-        {
-            get { return (string)GetValue(MessageProperty); }
-            set { SetValue(MessageProperty, value); }
-        }
-
-        public string Details
-        {
-            get { return (string)GetValue(DetailsProperty); }
-            set { SetValue(DetailsProperty, value); }
-        }
-
-        public EditingContext Context { get; set; }
-
-        private void OnHelpExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            if (this.Context == null)
-            {
-                return;
-            }
-            IIntegratedHelpService help = this.Context.Services.GetService<IIntegratedHelpService>();
-            if (help != null)
-            {
-                help.ShowHelpFromKeyword(HelpKeywords.ErrorView);
-            }
-            else
-            {
-                System.Diagnostics.Process.Start(SR.DefaultHelpUrl);
-            }
-        }
-
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExpressionTextBox.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExpressionTextBox.xaml.cs
deleted file mode 100644 (file)
index e6497e1..0000000
+++ /dev/null
@@ -1,855 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Activities.Expressions;
-    using System.Activities.Presentation.Expressions;
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Services;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Linq;
-    using System.Runtime;
-    using System.Runtime.Versioning;
-    using System.Windows;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Windows.Input;
-    using System.Xaml;
-    using Microsoft.Activities.Presentation;
-    using ExpressionEditor = System.Activities.Presentation.Expressions.ExpressionActivityEditor;
-
-    public sealed partial class ExpressionTextBox : UserControl
-    {
-        #region Legacy public properties
-        public static readonly DependencyProperty HintTextProperty = DependencyProperty.Register("HintText", typeof(string), typeof(ExpressionTextBox));
-
-        public static readonly DependencyProperty ExpressionProperty = DependencyProperty.Register("Expression", typeof(ModelItem), typeof(ExpressionTextBox),
-                new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(OnInnerControlRelatedPropertyChanged)));
-
-        public static readonly DependencyProperty ExpressionTypeProperty = DependencyProperty.Register("ExpressionType", typeof(Type), typeof(ExpressionTextBox),
-                new FrameworkPropertyMetadata(null));
-
-        public static readonly DependencyProperty OwnerActivityProperty = DependencyProperty.Register("OwnerActivity", typeof(ModelItem), typeof(ExpressionTextBox),
-                new FrameworkPropertyMetadata(null, new PropertyChangedCallback(OnInnerControlRelatedPropertyChanged)));
-
-        public static readonly DependencyProperty UseLocationExpressionProperty = DependencyProperty.Register("UseLocationExpression", typeof(bool), typeof(ExpressionTextBox),
-                new FrameworkPropertyMetadata(false, new PropertyChangedCallback(OnInnerControlRelatedPropertyChanged)));
-
-        public static readonly DependencyProperty PathToArgumentProperty = DependencyProperty.Register("PathToArgument", typeof(string), typeof(ExpressionTextBox),
-                new FrameworkPropertyMetadata(null));
-
-        public static readonly DependencyProperty IsSupportedExpressionProperty = DependencyProperty.Register("IsSupportedExpression", typeof(bool), typeof(ExpressionTextBox),
-                new FrameworkPropertyMetadata(true));
-
-        public static readonly DependencyProperty VerticalScrollBarVisibilityProperty = DependencyProperty.Register("VerticalScrollBarVisibility", typeof(ScrollBarVisibility), typeof(ExpressionTextBox),
-                new FrameworkPropertyMetadata(ScrollBarVisibility.Hidden));
-
-        public static readonly DependencyProperty HorizontalScrollBarVisibilityProperty = DependencyProperty.Register("HorizontalScrollBarVisibility", typeof(ScrollBarVisibility), typeof(ExpressionTextBox),
-                new FrameworkPropertyMetadata(ScrollBarVisibility.Hidden));
-
-        public static readonly DependencyProperty MaxLinesProperty = DependencyProperty.Register("MaxLines", typeof(int), typeof(ExpressionTextBox),
-                new FrameworkPropertyMetadata(Int32.MaxValue));
-
-        public static readonly DependencyProperty MinLinesProperty = DependencyProperty.Register("MinLines", typeof(int), typeof(ExpressionTextBox),
-                new FrameworkPropertyMetadata(1));
-
-        public static readonly DependencyProperty ExplicitCommitProperty = DependencyProperty.Register("ExplicitCommit", typeof(bool), typeof(ExpressionTextBox),
-                new FrameworkPropertyMetadata(false));
-
-        public static readonly DependencyProperty DefaultValueProperty = DependencyProperty.Register("DefaultValue", typeof(string), typeof(ExpressionTextBox),
-                new FrameworkPropertyMetadata(null));
-
-        public static readonly DependencyProperty AcceptsReturnProperty = DependencyProperty.Register("AcceptsReturn", typeof(bool), typeof(ExpressionTextBox),
-                new FrameworkPropertyMetadata(true));
-
-        public static readonly DependencyProperty AcceptsTabProperty = DependencyProperty.Register("AcceptsTab", typeof(bool), typeof(ExpressionTextBox),
-                new FrameworkPropertyMetadata(false));
-
-        public static readonly DependencyProperty IsReadOnlyProperty = DependencyProperty.Register("IsReadOnly", typeof(bool), typeof(ExpressionTextBox),
-                new FrameworkPropertyMetadata(false));
-
-        public string HintText
-        {
-            get { return (string)GetValue(HintTextProperty); }
-            set { SetValue(HintTextProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public ModelItem Expression
-        {
-            get { return (ModelItem)GetValue(ExpressionProperty); }
-            set { SetValue(ExpressionProperty, value); }
-        }
-
-        public Type ExpressionType
-        {
-            get { return (Type)GetValue(ExpressionTypeProperty); }
-            set { SetValue(ExpressionTypeProperty, value); }
-        }
-
-        public bool UseLocationExpression
-        {
-            get { return (bool)GetValue(UseLocationExpressionProperty); }
-            set { SetValue(UseLocationExpressionProperty, value); }
-        }
-
-
-        [Fx.Tag.KnownXamlExternal]
-        public ModelItem OwnerActivity
-        {
-            get { return (ModelItem)GetValue(OwnerActivityProperty); }
-            set { SetValue(OwnerActivityProperty, value); }
-        }
-
-        public string PathToArgument
-        {
-            get { return (string)GetValue(PathToArgumentProperty); }
-            set { SetValue(PathToArgumentProperty, value); }
-        }
-
-        public bool IsSupportedExpression
-        {
-            get { return (bool)GetValue(IsSupportedExpressionProperty); }
-            set { SetValue(IsSupportedExpressionProperty, value); }
-        }
-
-        public string DefaultValue
-        {
-            get { return (string)GetValue(DefaultValueProperty); }
-            set { SetValue(DefaultValueProperty, value); }
-        }
-
-        public bool AcceptsReturn
-        {
-            get { return (bool)GetValue(AcceptsReturnProperty); }
-            set { SetValue(AcceptsReturnProperty, value); }
-        }
-
-        public bool AcceptsTab
-        {
-            get { return (bool)GetValue(AcceptsTabProperty); }
-            set { SetValue(AcceptsTabProperty, value); }
-        }
-
-        public bool IsReadOnly
-        {
-            get { return (bool)GetValue(IsReadOnlyProperty); }
-            set { SetValue(IsReadOnlyProperty, value); }
-        }
-
-        public ScrollBarVisibility VerticalScrollBarVisibility
-        {
-            get { return (ScrollBarVisibility)GetValue(VerticalScrollBarVisibilityProperty); }
-            set { SetValue(VerticalScrollBarVisibilityProperty, value); }
-        }
-
-        public ScrollBarVisibility HorizontalScrollBarVisibility
-        {
-            get { return (ScrollBarVisibility)GetValue(HorizontalScrollBarVisibilityProperty); }
-            set { SetValue(HorizontalScrollBarVisibilityProperty, value); }
-        }
-
-        public int MaxLines
-        {
-            get { return (int)GetValue(MaxLinesProperty); }
-            set { SetValue(MaxLinesProperty, value); }
-        }
-
-        public int MinLines
-        {
-            get { return (int)GetValue(MinLinesProperty); }
-            set { SetValue(MinLinesProperty, value); }
-        }
-
-        public bool ExplicitCommit
-        {
-            get { return (bool)GetValue(ExplicitCommitProperty); }
-            set { SetValue(ExplicitCommitProperty, value); }
-        }
-
-        //[....] 
-        public IExpressionEditorService ExpressionEditorService
-        {
-            [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
-            get
-            {
-                return this.ViewModel.GetExpressionService(this.editor);
-            }
-        }
-        #endregion
-
-        #region Legacy routed events
-        public static readonly RoutedEvent EditorLostLogicalFocusEvent =
-            EventManager.RegisterRoutedEvent("EditorLostLogicalFocus", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(ExpressionTextBox));
-
-        public event RoutedEventHandler EditorLostLogicalFocus
-        {
-            add
-            {
-                this.AddHandler(ExpressionTextBox.EditorLostLogicalFocusEvent, value);
-            }
-            remove
-            {
-                this.RemoveHandler(ExpressionTextBox.EditorLostLogicalFocusEvent, value);
-            }
-        }
-        #endregion
-
-        #region Legacy commands
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand CompleteWordCommand = new RoutedCommand("CompleteWordCommand", typeof(ExpressionTextBox));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand GlobalIntellisenseCommand = new RoutedCommand("GlobalIntellisenseCommand", typeof(ExpressionTextBox));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand ParameterInfoCommand = new RoutedCommand("ParameterInfoCommand", typeof(ExpressionTextBox));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand QuickInfoCommand = new RoutedCommand("QuickInfoCommand", typeof(ExpressionTextBox));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand IncreaseFilterLevelCommand = new RoutedCommand("IncreaseFilterLevelCommand", typeof(ExpressionTextBox));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand DecreaseFilterLevelCommand = new RoutedCommand("DecreaseFilterLevelCommand", typeof(ExpressionTextBox));
-        #endregion
-
-        #region Legacy internal properties used by other designer parts
-        internal static readonly DependencyProperty IsIndependentExpressionProperty = DependencyProperty.Register("IsIndependentExpression", typeof(bool), typeof(ExpressionTextBox));
-
-        internal bool IsIndependentExpression
-        {
-            get { return (bool)GetValue(IsIndependentExpressionProperty); }
-            set { SetValue(IsIndependentExpressionProperty, value); }
-        }
-        #endregion
-
-        #region New added public properties
-
-        public static readonly DependencyProperty ExpressionActivityEditorProperty =
-            DependencyProperty.Register("ExpressionActivityEditor", typeof(string), typeof(ExpressionTextBox), new UIPropertyMetadata(new PropertyChangedCallback(OnInnerControlRelatedPropertyChanged)));
-
-        public const string ExpressionActivityEditorOptionName = "ExpressionActivityEditorName";
-
-        public string ExpressionActivityEditor
-        {
-            get { return (string)GetValue(ExpressionActivityEditorProperty); }
-            set { SetValue(ExpressionActivityEditorProperty, value); }
-        }
-
-        #endregion
-
-        #region New added internal properties
-        internal static readonly DependencyProperty InternalHintTextProperty =
-            DependencyProperty.Register("InternalHintText", typeof(string), typeof(ExpressionTextBox));
-
-        internal string InternalHintText
-        {
-            get { return (string)GetValue(InternalHintTextProperty); }
-            set { SetValue(InternalHintTextProperty, value); }
-        }
-        #endregion
-
-        string currentEditorName;
-        ExpressionActivityEditor editor;
-        ExpressionTextBoxViewModel viewModel;
-        bool? isDesignMode;
-        bool isHintTextSetInternally;
-
-        internal static readonly DependencyProperty IsInlinePropertyEditorProperty =
-            DependencyProperty.Register("IsInlinePropertyEditor", typeof(bool), typeof(ExpressionTextBox), new FrameworkPropertyMetadata(false, OnInnerControlRelatedPropertyChanged));
-
-        private static readonly DependencyProperty UnsupportedEditorMessageProperty =
-            DependencyProperty.Register("UnsupportedEditorMessage", typeof(string), typeof(ExpressionTextBox));
-
-        internal bool IsInlinePropertyEditor
-        {
-            get { return (bool)GetValue(IsInlinePropertyEditorProperty); }
-            set { SetValue(IsInlinePropertyEditorProperty, value); }
-        }
-
-        internal ExpressionActivityEditor Editor
-        {
-            get
-            {
-                return this.editor;
-            }
-        }
-
-        internal string CurrentEditorName
-        {
-            get
-            {
-                return this.currentEditorName;
-            }
-        }
-
-        private string UnsupportedEditorMessage
-        {
-            get { return (string)GetValue(UnsupportedEditorMessageProperty); }
-            set { SetValue(UnsupportedEditorMessageProperty, value); }
-        }
-
-        ExpressionTextBoxViewModel ViewModel
-        {
-            get
-            {
-                if (this.viewModel == null)
-                {
-                    this.viewModel = new ExpressionTextBoxViewModel();
-                }
-
-                return this.viewModel;
-            }
-        }
-
-        string HintTextSetbyUser
-        {
-            get;
-            set;
-        }
-
-        EditingContext Context
-        {
-            get
-            {
-                if (this.OwnerActivity != null)
-                {
-                    Fx.Assert(this.OwnerActivity.GetEditingContext() != null, "Any acitvity should be associated with an EditingContext");
-                    return this.OwnerActivity.GetEditingContext();
-                }
-                else
-                {
-                    return null;
-                }
-            }
-        }
-
-        //Indicate whether it's in the context of WPF designer, e.g. when designing activity designer
-        bool IsDesignMode
-        {
-            get
-            {
-                if (!this.isDesignMode.HasValue)
-                {
-                    this.isDesignMode = DesignerProperties.GetIsInDesignMode(this);
-                }
-
-                return this.isDesignMode.Value;
-            }
-        }
-
-        public ExpressionTextBox()
-        {
-            InitializeComponent();
-
-            if (this.IsDesignMode)
-            {
-                this.Content = null;
-                DataTemplate designModeTemplate = this.FindResource("designModelTemplate") as DataTemplate;
-                Fx.Assert(designModeTemplate != null, "There should be a DataTemplate named \"designModelTemplate\"");
-                this.ContentTemplate = designModeTemplate;
-            }
-        }
-
-        void OnExpressionTextBoxLoaded(object sender, RoutedEventArgs e)
-        {
-            this.InitializeChildEditor();
-        }
-
-        protected override void OnInitialized(EventArgs e)
-        {
-            if (!this.IsDesignMode)
-            {
-                this.LoadInnerControl(this.GetExpressionEditorType());
-            }
-            base.OnInitialized(e);
-        }
-
-        void LoadInnerControl(string editorName)
-        {
-            if (editorName != this.currentEditorName)
-            {
-
-                ExpressionActivityEditor newEditor;
-                if (this.ViewModel.TryCreateEditor(editorName, out newEditor))
-                {
-                    if ((this.IsInlinePropertyEditor) && !(newEditor is TextualExpressionEditor))
-                    {
-                        InitializeHintText(null);
-                        this.editor = null;
-                        this.currentEditorName = null;
-                        this.Content = null;
-                        this.ContentTemplate = this.FindResource("disabledInlineEditingTemplate") as DataTemplate;
-                    }
-                    else
-                    {
-                        this.currentEditorName = editorName;
-                        this.editor = newEditor;
-                        this.Content = this.editor;
-                        this.ContentTemplate = null;
-                        if (this.IsLoaded)
-                        {
-                            this.InitializeChildEditor();
-                        }
-                    }
-                }
-                else
-                {
-                    this.UnsupportedEditorMessage = string.Format(CultureInfo.CurrentUICulture, SR.NonRegisteredExpressionEditor, editorName);
-                    InitializeHintText(null);
-                    this.editor = null;
-                    this.currentEditorName = null;
-                    this.Content = null;
-                    this.ContentTemplate = this.FindResource("unsupportedEditorTemplate") as DataTemplate;
-                }
-            }
-        }
-
-        public static void RegisterExpressionActivityEditor(string name, Type expressionActivityEditorType, CreateExpressionFromStringCallback convertFromString)
-        {
-            if (string.IsNullOrWhiteSpace(name))
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException(string.Format(CultureInfo.CurrentUICulture, SR.InvalidExpressionEditorName,
-                    name)));
-            }
-            ExpressionTextBoxViewModel.RegisterExpressionActivityService(name, expressionActivityEditorType, convertFromString);
-        }
-
-        protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
-        {
-            switch (e.Property.Name)
-            {
-                case "ExpressionActivityEditor":
-                    ExpressionEditor.ValidateExpressionActivityEditorName((string)e.NewValue);
-                    break;
-                case "HintText":
-                    if (!this.isHintTextSetInternally)
-                    {
-                        this.HintTextSetbyUser = (string)e.NewValue;
-                    }
-                    break;
-                case "InternalHintText":
-                    this.isHintTextSetInternally = true;
-                    this.HintText = this.InternalHintText;
-                    this.isHintTextSetInternally = false;
-                    break;
-            }
-            base.OnPropertyChanged(e);
-        }
-
-        //Following properties have impact on inner editor type:
-        //1) Expression
-        //2) OwnerActivity
-        //3) ExpressionActivityEditor
-        //4) IsInlinePropertyEditor
-        //5) UseLocationExpression
-        static void OnInnerControlRelatedPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
-        {
-            ExpressionTextBox expressionTextBox = sender as ExpressionTextBox;
-            if (!expressionTextBox.IsDesignMode)
-            {
-                expressionTextBox.LoadInnerControl(expressionTextBox.GetExpressionEditorType());
-            }
-        }
-
-        protected override AutomationPeer OnCreateAutomationPeer()
-        {
-            return new ExpressionTextBoxAutomationPeer(this);
-        }
-
-        private string GetExpressionEditorType()
-        {
-            object root = null;
-            if (this.OwnerActivity != null)
-            {
-                ModelItem rootItem = this.Context.Services.GetService<ModelService>().Root;
-                if (rootItem != null)
-                {
-                    root = rootItem.GetCurrentValue();
-                }
-            }
-
-            return this.ViewModel.GetExpressionEditorType(this.ExpressionActivityEditor, root, WorkflowDesigner.GetTargetFramework(this.Context));
-        }
-
-        void InitializeChildEditor()
-        {
-            this.ViewModel.InitializeEditor(this.editor, this);
-        }
-
-        void OnCommitCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            ExpressionTextBox expressionTextBox = sender as ExpressionTextBox;
-            if (expressionTextBox.editor != null)
-            {
-                e.CanExecute = expressionTextBox.editor.CanCommit();
-                e.Handled = true;
-            }
-        }
-
-        void OnCommitCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            ExpressionTextBox expressionTextBox = sender as ExpressionTextBox;
-            if (expressionTextBox.editor != null)
-            {
-                expressionTextBox.editor.Commit(expressionTextBox.ExplicitCommit);
-                e.Handled = true;
-            }
-        }
-
-        public void BeginEdit()
-        {
-            if (this.editor != null)
-            {
-                this.editor.BeginEdit();
-            }
-        }
-
-        internal void OnCompleteWordCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            if ((this.editor != null) && (this.editor is TextualExpressionEditor))
-            {
-                (this.editor as TextualExpressionEditor).OnCompleteWordCommandCanExecute(e);
-            }
-        }
-
-        internal void OnCompleteWordCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            if ((this.editor != null) && (this.editor is TextualExpressionEditor))
-            {
-                (this.editor as TextualExpressionEditor).OnCompleteWordCommandExecute(e);
-            }
-        }
-
-        internal void OnGlobalIntellisenseCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            if ((this.editor != null) && (this.editor is TextualExpressionEditor))
-            {
-                (this.editor as TextualExpressionEditor).OnGlobalIntellisenseCommandCanExecute(e);
-            }
-        }
-
-        internal void OnGlobalIntellisenseCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            if ((this.editor != null) && (this.editor is TextualExpressionEditor))
-            {
-                (this.editor as TextualExpressionEditor).OnGlobalIntellisenseCommandExecute(e);
-            }
-        }
-
-        internal void OnParameterInfoCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            if ((this.editor != null) && (this.editor is TextualExpressionEditor))
-            {
-                (this.editor as TextualExpressionEditor).OnParameterInfoCommandCanExecute(e);
-            }
-        }
-
-        internal void OnParameterInfoCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            if ((this.editor != null) && (this.editor is TextualExpressionEditor))
-            {
-                (this.editor as TextualExpressionEditor).OnParameterInfoCommandExecute(e);
-            }
-        }
-
-        internal void OnQuickInfoCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            if ((this.editor != null) && (this.editor is TextualExpressionEditor))
-            {
-                (this.editor as TextualExpressionEditor).OnQuickInfoCommandCanExecute(e);
-            }
-        }
-
-        internal void OnQuickInfoCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            if ((this.editor != null) && (this.editor is TextualExpressionEditor))
-            {
-                (this.editor as TextualExpressionEditor).OnQuickInfoCommandExecute(e);
-            }
-        }
-
-        internal void OnIncreaseFilterLevelCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            if ((this.editor != null) && (this.editor is TextualExpressionEditor))
-            {
-                (this.editor as TextualExpressionEditor).OnIncreaseFilterLevelCommandCanExecute(e);
-            }
-        }
-
-        internal void OnIncreaseFilterLevelCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            if ((this.editor != null) && (this.editor is TextualExpressionEditor))
-            {
-                (this.editor as TextualExpressionEditor).OnIncreaseFilterLevelCommandExecute(e);
-            }
-        }
-
-        internal void OnDecreaseFilterLevelCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            if ((this.editor != null) && (this.editor is TextualExpressionEditor))
-            {
-                (this.editor as TextualExpressionEditor).OnDecreaseFilterLevelCommandCanExecute(e);
-            }
-        }
-
-        internal void OnDecreaseFilterLevelCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            if ((this.editor != null) && (this.editor is TextualExpressionEditor))
-            {
-                (this.editor as TextualExpressionEditor).OnDecreaseFilterLevelCommandExecute(e);
-            }
-        }
-
-        internal void InitializeHintText(string defaultEditorHintText)
-        {
-            //If user doesn't specify any custom hint text, we should honor the default hinttext of inner editor
-            //otherwise we should restore the hint text to what set by user when switch inner editor
-            this.isHintTextSetInternally = true;
-
-            if (this.HintTextSetbyUser == null)
-            {
-                this.HintText = defaultEditorHintText;
-            }
-            else
-            {
-                this.HintText = this.HintTextSetbyUser;
-            }
-
-            this.isHintTextSetInternally = false;
-        }
-
-        internal static bool TryConvertFromString(string targetEditor, string expressionText, bool isLocationExpression, Type resultType, out ActivityWithResult expression)
-        {
-            return ExpressionTextBoxViewModel.TryConvertString(targetEditor, expressionText, isLocationExpression, resultType, out expression);
-        }
-    }
-
-    internal class ExpressionTextBoxViewModel
-    {
-        static string ITextExpressionInterfaceName = typeof(ITextExpression).Name;
-
-        static Dictionary<string, Type> ExpressionEditorTypeTable = new Dictionary<string, Type>();
-        static Dictionary<string, CreateExpressionFromStringCallback> ConvertFromStringDelegates = new Dictionary<string, CreateExpressionFromStringCallback>();
-
-        internal static void RegisterExpressionActivityService(string name, Type expressionEditorType, CreateExpressionFromStringCallback convertFromString)
-        {
-            if (!typeof(ExpressionActivityEditor).IsAssignableFrom(expressionEditorType))
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException(string.Format(CultureInfo.CurrentUICulture, SR.InvalidExpressionEditorType,
-                    expressionEditorType.FullName, typeof(ExpressionActivityEditor).FullName)));
-            }
-            if (expressionEditorType.GetConstructor(System.Type.EmptyTypes) == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException(string.Format(CultureInfo.CurrentUICulture, SR.ExpressionActivityEditorRequiresDefaultConstructor,
-                    expressionEditorType.FullName)));
-            }
-            if (!ExpressionEditorTypeTable.Keys.Contains(name))
-            {
-                ExpressionEditorTypeTable.Add(name, expressionEditorType);
-            }
-            else
-            {
-                ExpressionEditorTypeTable[name] = expressionEditorType;
-            }
-
-            if (convertFromString != null)
-            {
-                if (!ConvertFromStringDelegates.Keys.Contains(name))
-                {
-                    ConvertFromStringDelegates.Add(name, convertFromString);
-                }
-                else
-                {
-                    ConvertFromStringDelegates[name] = convertFromString;
-                }
-            }
-        }
-
-        internal bool TryCreateEditor(string expressionEditorName, out ExpressionActivityEditor editorInstance)
-        {
-            editorInstance = null;
-            if (expressionEditorName == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException(expressionEditorName));
-            }
-
-            if (!ExpressionEditorTypeTable.Keys.Contains(expressionEditorName))
-            {
-                return false;
-            }
-            Type expressionEditorType = ExpressionEditorTypeTable[expressionEditorName];
-            editorInstance = Activator.CreateInstance(expressionEditorType) as ExpressionActivityEditor;
-            return true;
-        }
-
-        internal IExpressionEditorService GetExpressionService(ExpressionActivityEditor editor)
-        {
-            TextualExpressionEditor textualEditor = editor as TextualExpressionEditor;
-            if (textualEditor != null)
-            {
-                return textualEditor.ExpressionEditorService;
-            }
-            else
-            {
-                return null;
-            }
-        }
-
-        internal string GetExpressionEditorType(string localSetting, object root, FrameworkName targetFramework)
-        {
-            string expressionEditorType = null;
-            if (targetFramework.Is45OrHigher())
-            {
-                //1) check local setting of ETB
-                if (expressionEditorType == null)
-                {
-                    expressionEditorType = localSetting;
-                }
-                //2) check global setting on root object of the XAML
-                if (expressionEditorType == null && root != null)
-                {
-                    expressionEditorType = ExpressionEditor.GetExpressionActivityEditor(root);
-                }
-
-                //3) for all the other cases, always load VB editor for backward compatibility
-                if (expressionEditorType == null)
-                {
-                    expressionEditorType = VisualBasicEditor.ExpressionLanguageName;
-                }
-            }
-            else
-            {
-                //When the targeting framework is less than 4.5, always load VB editor
-                expressionEditorType = VisualBasicEditor.ExpressionLanguageName;
-            }
-
-            return expressionEditorType;
-        }
-
-        void SetBinding(string path, DependencyProperty property, FrameworkElement target, ExpressionTextBox source,
-            BindingMode mode = BindingMode.OneWay, IEnumerable<ValidationRule> validationRules = null)
-        {
-            Binding binding = new Binding(path);
-            binding.Source = source;
-            binding.Mode = mode;
-            if ((validationRules != null) && (validationRules.Count<ValidationRule>() > 0))
-            {
-                foreach (ValidationRule rule in validationRules)
-                {
-                    binding.ValidationRules.Add(rule);
-                }
-            }
-            target.SetBinding(property, binding);
-        }
-
-        internal void InitializeEditor(ExpressionActivityEditor editor, ExpressionTextBox expressionTextBox)
-        {
-            if (editor != null)
-            {
-                expressionTextBox.InitializeHintText(editor.HintText);
-                expressionTextBox.InternalHintText = expressionTextBox.HintText;
-                SetBinding("InternalHintText", ExpressionActivityEditor.HintTextProperty, editor, expressionTextBox, BindingMode.TwoWay);
-                SetBinding("IsSupportedExpression", ExpressionActivityEditor.IsSupportedExpressionProperty, editor, expressionTextBox, BindingMode.OneWayToSource, null);
-                SetBinding("HorizontalScrollBarVisibility", ExpressionActivityEditor.HorizontalScrollBarVisibilityProperty, editor, expressionTextBox);
-                SetBinding("VerticalScrollBarVisibility", ExpressionActivityEditor.VerticalScrollBarVisibilityProperty, editor, expressionTextBox);
-                SetBinding("AcceptsReturn", ExpressionActivityEditor.AcceptsReturnProperty, editor, expressionTextBox);
-                SetBinding("AcceptsTab", ExpressionActivityEditor.AcceptsTabProperty, editor, expressionTextBox);
-                SetBinding("Expression", ExpressionActivityEditor.ExpressionProperty, editor, expressionTextBox, BindingMode.TwoWay, new Collection<ValidationRule> { new ExpressionValidationRule(expressionTextBox) });
-                SetBinding("ExpressionType", ExpressionActivityEditor.ExpressionTypeProperty, editor, expressionTextBox);
-                SetBinding("OwnerActivity", ExpressionActivityEditor.OwnerActivityProperty, editor, expressionTextBox);
-                SetBinding("UseLocationExpression", ExpressionActivityEditor.UseLocationExpressionProperty, editor, expressionTextBox);
-                SetBinding("PathToArgument", ExpressionActivityEditor.PathToArgumentProperty, editor, expressionTextBox);
-                SetBinding("IsReadOnly", ExpressionActivityEditor.IsReadOnlyProperty, editor, expressionTextBox);
-                SetBinding("ExplicitCommit", ExpressionActivityEditor.ExplicitCommitProperty, editor, expressionTextBox);
-                SetBinding("ClipToBounds", ExpressionActivityEditor.ClipToBoundsProperty, editor, expressionTextBox);
-
-                TextualExpressionEditor textEditor = editor as TextualExpressionEditor;
-                if (textEditor != null)
-                {
-                    SetBinding("MaxLines", TextualExpressionEditor.MaxLinesProperty, textEditor, expressionTextBox);
-                    SetBinding("MinLines", TextualExpressionEditor.MinLinesProperty, textEditor, expressionTextBox);
-                    SetBinding("DefaultValue", TextualExpressionEditor.DefaultValueProperty, textEditor, expressionTextBox);
-                }
-
-                SetBinding("IsIndependentExpression", ExpressionActivityEditor.IsIndependentExpressionProperty, editor, expressionTextBox);
-            }
-        }
-
-        internal static bool TryConvertString(string targetEditor, string expressionText, bool isLocationExpression, Type resultType, out ActivityWithResult expression)
-        {
-            expression = null;
-            if (targetEditor != null)
-            {
-                CreateExpressionFromStringCallback convertFromStringAction;
-                if (ConvertFromStringDelegates.TryGetValue(targetEditor, out convertFromStringAction))
-                {
-                    if (convertFromStringAction != null)
-                    {
-                        expression = convertFromStringAction(expressionText, isLocationExpression, resultType);
-                        return true;
-                    }
-                }
-            }
-            return false;
-        }
-
-    }
-
-    class ExpressionValidationRule : ValidationRule
-    {
-        ExpressionTextBox owner;
-
-        public ExpressionValidationRule(ExpressionTextBox owner)
-        {
-            this.owner = owner;
-        }
-
-        public override ValidationResult Validate(object value, CultureInfo cultureInfo)
-        {
-            string errorMessage = string.Empty;
-            if (owner.Expression != value)
-            {
-                if (value != null)
-                {
-                    ActivityWithResult expression = (value as ModelItem).GetCurrentValue() as ActivityWithResult;
-                    if (expression == null)
-                    {
-                        errorMessage = string.Format(CultureInfo.CurrentUICulture, SR.ExpressionTypeDonnotMatch,
-                            expression.GetType().FullName, typeof(ActivityWithResult).FullName);
-                    }
-                    else if ((owner.UseLocationExpression) && (!ExpressionHelper.IsGenericLocationExpressionType(expression)))
-                    {
-                        errorMessage = string.Format(CultureInfo.CurrentUICulture, SR.ExpressionTypeDonnotMatch,
-                            expression.GetType().FullName, typeof(Activity<Location>).FullName);
-                    }
-                    else if ((!owner.UseLocationExpression && (owner.ExpressionType != null) && (expression.ResultType != owner.ExpressionType)) ||
-                        (owner.UseLocationExpression && (owner.ExpressionType != null) && (expression.ResultType != typeof(Location<>).MakeGenericType(owner.ExpressionType))))
-                    {
-                        errorMessage = string.Format(CultureInfo.CurrentUICulture, SR.ExpressionTypeDonnotMatch,
-                            expression.GetType().FullName, typeof(Activity<>).MakeGenericType(owner.ExpressionType).FullName);
-                    }
-                }
-            }
-            if (!string.IsNullOrEmpty(errorMessage))
-            {
-                //Disable ToolTip on inner editor if it has
-                ToolTipService.SetIsEnabled(owner.Editor, false);
-                owner.ToolTip = errorMessage;
-                return new ValidationResult(false, errorMessage);
-            }
-            else
-            {
-                ToolTipService.SetIsEnabled(owner.Editor, true);
-                owner.ToolTip = null;
-                return new ValidationResult(true, null);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExpressionTextBoxAutomationPeer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExpressionTextBoxAutomationPeer.cs
deleted file mode 100644 (file)
index 3cd6032..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Text;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Automation;
-
-    class ExpressionTextBoxAutomationPeer : UIElementAutomationPeer
-    {
-        public ExpressionTextBoxAutomationPeer(ExpressionTextBox owner)
-            : base(owner)
-        { 
-        }
-
-        protected override string GetItemStatusCore()
-        {
-            ExpressionTextBox expressionTextBox = this.Owner as ExpressionTextBox;
-            if ((expressionTextBox != null) && (expressionTextBox.Editor != null))
-            {
-                return expressionTextBox.Editor.ItemStatus;
-            }
-            else
-            {
-                return base.GetItemStatusCore();
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExpressionValueEditor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExpressionValueEditor.cs
deleted file mode 100644 (file)
index eafcd50..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation.Converters;
-    using System.Globalization;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Runtime;
-
-    class ExpressionValueEditor : DialogPropertyValueEditor
-    {
-        public ExpressionValueEditor()
-        {
-            //default template for inline editor
-            this.InlineEditorTemplate = EditorResources.GetResources()["inlineExpressionEditorTemplate"] as DataTemplate;
-        }
-
-        public override void ShowDialog(PropertyValue propertyValue, IInputElement commandSource)
-        {
-            //get the property entry to model item converter
-            IValueConverter converter = (ModelPropertyEntryToOwnerActivityConverter)EditorResources.GetResources()["ModelPropertyEntryToOwnerActivityConverter"];
-            ModelItem item = (ModelItem)converter.Convert(propertyValue.ParentProperty, typeof(ModelItem), false, null);
-            //we need editing context 
-            EditingContext ctx = ((IModelTreeItem)item).ModelTreeManager.Context;
-            //get the default dialog owner
-            DependencyObject owner = ctx.Services.GetService<DesignerView>();
-
-            //create and show dialog with owner, edited expression and context
-            (new EditorDialog(owner, propertyValue, ctx, this.DialogTemplate, this.DialogTitle)).ShowOkCancel();
-        }
-
-        protected virtual DataTemplate DialogTemplate
-        {
-            get { return (DataTemplate)EditorResources.GetResources()["dialogExpressionEditorTemplate"]; }
-        }
-
-        protected virtual string DialogTitle
-        {
-            get { return (string)EditorResources.GetResources()["dialogExpressionEditorTitle"]; }
-        }
-
-        private sealed class EditorDialog : WorkflowElementDialog
-        {
-            public EditorDialog(DependencyObject owner, PropertyValue propertyValue, EditingContext context, DataTemplate dialogTemplate, string title)
-            {
-                //setup properties
-                this.MinWidth = 350;
-                this.MinHeight = 185;
-                this.WindowResizeMode = ResizeMode.CanResize;
-                this.WindowSizeToContent = SizeToContent.Manual;
-
-                this.Owner = owner;
-                this.Context = context;
-                this.Title = title;
-                ContentPresenter contentPresenter = new ContentPresenter()
-                {
-                    Content = propertyValue,
-                    //get default editor template for content presenter 
-                    ContentTemplate = dialogTemplate
-                };
-
-                this.Content = contentPresenter;
-                this.Loaded += OnWindowLoaded;
-            }
-
-            void OnWindowLoaded(object sender, RoutedEventArgs args)
-            {
-                ContentPresenter presenter = (ContentPresenter)this.Content;
-                PropertyValue propertyValue = (PropertyValue)presenter.Content;
-                Button okButton = (Button)this.FindName("okButton");
-                ExpressionTextBox etb = VisualTreeUtils.GetNamedChild<ExpressionTextBox>(presenter, "PART_expressionTextBox");
-                TextBlock hint = VisualTreeUtils.GetNamedChild<TextBlock>(presenter, "PART_hintText");
-                Fx.Assert(etb != null, "ExpressionTextBox with name 'PART_expressionTextBox' should be in the template!");
-                Fx.Assert(hint != null, "Hint TextBlock with name 'PART_hintText' should be in the template!");
-                //bind button with ETB's commit command
-                okButton.Command = DesignerView.CommitCommand;
-                okButton.CommandTarget = etb;
-                etb.Loaded += new RoutedEventHandler(OnExpressionTextBoxLoaded);
-
-                if (null != etb && null != hint)
-                {
-                    IValueConverter typeToStringConverter = (IValueConverter)EditorResources.GetResources()["TypeParameterConverter"];
-                    string hintFormatString = (string)EditorResources.GetResources()["dialogExpressionEditorHintFormatString"];
-
-                    //convert expression's container type to friendly name (i.e. replace generic '1 with <T>)                
-                    string friendlyTypeName = (string)
-                        typeToStringConverter.Convert(etb.ExpressionType ?? propertyValue.ParentProperty.PropertyType, typeof(string), null, CultureInfo.CurrentCulture);
-
-                    //format editor title to include friendly type name and property name
-                    hint.Text = string.Format(CultureInfo.CurrentCulture, hintFormatString, propertyValue.ParentProperty.PropertyName, friendlyTypeName);
-                }
-            }
-
-            void OnExpressionTextBoxLoaded(object sender, RoutedEventArgs e)
-            {
-                (sender as ExpressionTextBox).BeginEdit();
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExtensionSurface.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExtensionSurface.cs
deleted file mode 100644 (file)
index fb0f25a..0000000
+++ /dev/null
@@ -1,514 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Media;
-    using System.Globalization;
-    using System.Runtime;
-    using System.Diagnostics.CodeAnalysis;
-
-    //This class is responsible for providing functionality to display additional information in context of
-    //the designer view in a popup-like manner. It is basically the canvas control, which is placed on top of 
-    //the other visual elements. It provides functionality to add and remove extension windows, as well as manipulating
-    //their position and size
-    sealed class ExtensionSurface : Panel
-    {
-
-        public static readonly DependencyProperty DesignerProperty = DependencyProperty.Register(
-            "Designer",
-            typeof(DesignerView),
-            typeof(ExtensionSurface),
-            new PropertyMetadata(OnDesignerChanged));
-
-        public static readonly DependencyProperty AutoExpandCanvasProperty = DependencyProperty.Register(
-            "AutoExpandCanvas",
-            typeof(bool),
-            typeof(ExtensionSurface),
-            new UIPropertyMetadata(false));
-
-        public static readonly DependencyProperty PlacementTargetProperty = DependencyProperty.RegisterAttached(
-            "PlacementTarget",
-            typeof(FrameworkElement),
-            typeof(ExtensionSurface),
-            new UIPropertyMetadata(null, OnPlacementTargetChanged));
-
-        public static readonly DependencyProperty AlignmentProperty = DependencyProperty.RegisterAttached(
-            "Alignment",
-            typeof(PositionAlignment),
-            typeof(ExtensionSurface),
-            new UIPropertyMetadata(PositionAlignment.LeftTop));
-
-        public static readonly DependencyProperty ModeProperty = DependencyProperty.RegisterAttached(
-            "Mode",
-            typeof(PlacementMode),
-            typeof(ExtensionSurface),
-            new UIPropertyMetadata(PlacementMode.Absolute, OnPlacementModeChanged));
-
-        public static readonly DependencyProperty PositionProperty = DependencyProperty.RegisterAttached(
-            "Position",
-            typeof(Point),
-            typeof(ExtensionSurface),
-            new UIPropertyMetadata(new Point()));
-
-
-        Func<double, double, double, bool> IsGreater;
-
-        KeyValuePair<FrameworkElement, Point> selectedChild;
-        Size rearangeStartSize = new Size();
-        Rect actualPanelRect = new Rect(0, 0, 0, 0);
-        Point canvasOffset = new Point();
-        int currentZIndex = 1000;
-
-        public ExtensionSurface()
-        {
-            //add global handled for ExtensionWindow's CloseEvent 
-            this.AddHandler(ExtensionWindow.CloseEvent, new RoutedEventHandler(OnExtensionWindowClosed));
-            this.ClipToBounds = true;
-            this.IsGreater = (v1, v2, v3) => (v1 + v2 > v3);
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public DesignerView Designer
-        {
-            get { return (DesignerView)GetValue(DesignerProperty); }
-            set { SetValue(DesignerProperty, value); }
-        }
-
-        public bool AutoExpandCanvas
-        {
-            get { return (bool)GetValue(AutoExpandCanvasProperty); }
-            set { SetValue(AutoExpandCanvasProperty, value); }
-        }
-
-        static void OnPlacementModeChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
-        {
-            ExtensionWindow window = sender as ExtensionWindow;
-            if (null != window && null != window.Surface && window.Visibility == Visibility.Visible)
-            {
-                window.Surface.PlaceWindow(window);
-            }
-        }
-
-        static void OnPlacementTargetChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
-        {
-        }
-
-
-        //hook for designer mouse events - they are required to handle positioning and resizing
-        static void OnDesignerChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
-        {
-            ExtensionSurface ctrl = (ExtensionSurface)sender;
-            DesignerView designer;
-            if (null != args.OldValue)
-            {
-                designer = (DesignerView)args.OldValue;
-            }
-            if (null != args.NewValue)
-            {
-                designer = (DesignerView)args.NewValue;
-            }
-        }
-
-        protected override void OnVisualChildrenChanged(DependencyObject visualAdded, DependencyObject visualRemoved)
-        {
-            ExtensionWindow window = visualRemoved as ExtensionWindow;
-            if (null != window)
-            {
-                window.VisibilityChanged -= OnWindowVisibilityChanged;
-                // window.SizeChanged -= OnWindowSizeChanged;
-                this.rearangeStartSize.Width = 0;
-                this.rearangeStartSize.Height = 0;
-            }
-
-            base.OnVisualChildrenChanged(visualAdded, visualRemoved);
-
-            window = visualAdded as ExtensionWindow;
-            if (null != window)
-            {
-                window.VisibilityChanged += OnWindowVisibilityChanged;
-                // window.SizeChanged += OnWindowSizeChanged;
-                if (!window.IsLoaded)
-                {
-                    window.Loaded += OnChildWindowLoaded;
-                }
-            }
-        }
-
-        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
-        {
-            base.OnRenderSizeChanged(sizeInfo);
-            foreach (FrameworkElement child in this.Children)
-            {
-                ExtensionWindow window = child as ExtensionWindow;
-                if (null != window)
-                {
-                    if (PlacementMode.Relative == GetMode(window) && null != GetPlacementTarget(window))
-                    {
-                        this.PlaceWindow(window);
-                        continue;
-                    }
-                    if (!this.AutoExpandCanvas)
-                    {
-                        this.EnsureWindowIsVisible(window);
-                    }
-                }
-            }
-        }
-
-        void OnChildWindowLoaded(object sender, EventArgs e)
-        {
-            ExtensionWindow window = (ExtensionWindow)sender;
-            this.OnWindowVisibilityChanged(window, null);
-            window.Loaded -= OnChildWindowLoaded;
-        }
-
-        //void OnWindowSizeChanged(object sender, SizeChangedEventArgs e)
-        //{
-        //    ExtensionWindow window = (ExtensionWindow)sender;
-        //   // EnsureWindowIsVisible(window);
-        //}
-
-        void OnWindowVisibilityChanged(object sender, RoutedEventArgs args)
-        {
-            ExtensionWindow window = (ExtensionWindow)sender;
-            if (window.IsVisible)
-            {
-                Func<double, bool> IsInvalid = x => (double.IsInfinity(x) || double.IsNaN(x) || double.Epsilon > x);
-
-                if (IsInvalid(window.ActualWidth) || IsInvalid(window.ActualWidth) || IsInvalid(window.DesiredSize.Width) || IsInvalid(window.DesiredSize.Height))
-                {
-                    window.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
-                }
-                PlaceWindow(window);
-            }
-        }
-
-        void PlaceWindow(ExtensionWindow window)
-        {
-            if (null != window)
-            {
-                FrameworkElement target = ExtensionSurface.GetPlacementTarget(window);
-                PositionAlignment alignment = ExtensionSurface.GetAlignment(window);
-                PlacementMode mode = ExtensionSurface.GetMode(window);
-                Point position = ExtensionSurface.GetPosition(window);
-
-                Point calculatedPosition = new Point();
-                FrameworkElement commonRoot = null;
-                MatrixTransform transform = null;
-
-                switch (mode)
-                {
-                    case PlacementMode.Relative:
-                        if (null != target)
-                        {
-                            commonRoot = target.FindCommonVisualAncestor(this) as FrameworkElement;
-                            if (null == commonRoot)
-                            {
-                                return;
-                            }
-                            transform = (MatrixTransform)target.TransformToAncestor(commonRoot);
-                        }
-                        else
-                        {
-                            if (!DesignerProperties.GetIsInDesignMode(this))
-                            {
-                                Fx.Assert(string.Format(CultureInfo.InvariantCulture, "PlacementTarget must be set in RelativeMode on ExtensionSurface '{0}'", this.Name));
-                            }
-                        }
-                        break;
-
-                    case PlacementMode.Absolute:
-                        calculatedPosition = position;
-                        break;
-
-                    default:
-                        Fx.Assert(string.Format(CultureInfo.CurrentCulture, "ExtensionWindowPlacement.Mode {0} specified in ExtensionWindow '{1}' is not supported for ExtensionSurface", mode, window.Name));
-                        return;
-                }
-
-                if (PlacementMode.Relative == mode)
-                {
-                    if (null != target)
-                    {
-                        double x;
-                        double y;
-                        switch (alignment)
-                        {
-                            case PositionAlignment.LeftTop:
-                                calculatedPosition = transform.Transform(calculatedPosition);
-                                break;
-
-                            case PositionAlignment.LeftBottom:
-                                calculatedPosition = transform.Transform(new Point(0.0, target.ActualHeight));
-                                break;
-
-                            case PositionAlignment.RightTop:
-                                calculatedPosition = transform.Transform(new Point(target.ActualWidth, 0.0));
-                                break;
-
-                            case PositionAlignment.RightBottom:
-                                calculatedPosition = transform.Transform(new Point(target.ActualWidth, target.ActualHeight));
-                                break;
-
-                            case PositionAlignment.Center:
-                                calculatedPosition = transform.Transform(calculatedPosition);
-                                x = ((target.ActualWidth * transform.Matrix.M11) - window.Width) / 2.0;
-                                y = ((target.ActualHeight * transform.Matrix.M22) - window.Height) / 2.0;
-                                calculatedPosition.Offset(x, y);
-                                break;
-
-                            case PositionAlignment.CenterHorizontal:
-                                calculatedPosition = transform.Transform(calculatedPosition);
-                                x = ((target.ActualWidth * transform.Matrix.M11) - window.Width) / 2.0;
-                                calculatedPosition.Offset(x, 0.0);
-                                break;
-
-                            case PositionAlignment.CenterVertical:
-                                calculatedPosition = transform.Transform(calculatedPosition);
-                                y = ((target.ActualHeight * transform.Matrix.M22) - window.Height) / 2.0;
-                                calculatedPosition.Offset(0.0, y);
-                                break;
-
-                            default:
-                                Fx.Assert(string.Format(CultureInfo.CurrentCulture, "ExtensionWindowPlacement.Position = '{0}' is not supported", alignment));
-                                return;
-                        }
-                    }
-                }
-                SetWindowPosition(window, calculatedPosition);
-            }
-        }
-
-        internal void SetWindowPosition(ExtensionWindow window, Point position)
-        {
-            Func<double, double, double, double, double> CalculateInBoundsValue =
-                (pos, size, limit, modifier) =>
-                {
-                    if (this.AutoExpandCanvas)
-                    {
-                        return pos - modifier;
-                    }
-                    else
-                    {
-                        pos = Math.Max(0.0, pos);
-                        return pos + size > limit ? limit - size : pos;
-                    }
-                };
-
-            //in case of AutoExpandCanvas == false:
-            // - do not allow placing window outside surface bounds
-            //in case of AutoExpandCanvas == true:
-            // - include possible negative canvas offset
-            position.X = CalculateInBoundsValue(position.X, window.DesiredSize.Width, this.ActualWidth, this.selectedChild.Value.X);
-            position.Y = CalculateInBoundsValue(position.Y, window.DesiredSize.Height, this.ActualHeight, this.selectedChild.Value.Y);
-
-            //update its position on canvas
-            ExtensionSurface.SetPosition(window, position);
-
-            bool requiresMeasure = false;
-            if (this.AutoExpandCanvas)
-            {
-                requiresMeasure = true;
-                this.canvasOffset.X = 0;
-                this.canvasOffset.Y = 0;
-
-                foreach (UIElement item in this.Children)
-                {
-                    FrameworkElement child = item as FrameworkElement;
-                    if (null != child)
-                    {
-                        Point p = ExtensionSurface.GetPosition(child);
-                        this.canvasOffset.X = Math.Min(this.canvasOffset.X, p.X);
-                        this.canvasOffset.Y = Math.Min(this.canvasOffset.Y, p.Y);
-                    }
-                }
-                this.canvasOffset.X = Math.Abs(this.canvasOffset.X);
-                this.canvasOffset.Y = Math.Abs(this.canvasOffset.Y);
-            }
-            if (requiresMeasure)
-            {
-                this.InvalidateMeasure();
-            }
-            else
-            {
-                this.InvalidateArrange();
-            }
-        }
-
-        void EnsureWindowIsVisible(ExtensionWindow window)
-        {
-            SetWindowPosition(window, ExtensionSurface.GetPosition(window));
-        }
-
-        internal void SetSize(ExtensionWindow window, Size size)
-        {
-            Point pos = ExtensionSurface.GetPosition(window);
-            if (!this.AutoExpandCanvas)
-            {
-                if (IsGreater(pos.X, size.Width, this.ActualWidth))
-                {
-                    size.Width = this.ActualWidth - pos.X;
-                }
-                if (IsGreater(pos.Y, size.Height, this.ActualHeight))
-                {
-                    size.Height = this.ActualHeight - pos.Y;
-                }
-            }
-            System.Diagnostics.Debug.WriteLine("SetSize oldSize (" + window.Width + "," + window.Height + ") newSize (" + size.Width + "," + size.Height + ")");
-            window.Width = size.Width;
-            window.Height = size.Height;
-            if (this.AutoExpandCanvas)
-            {
-                // this.InvalidateMeasure();
-            }
-        }
-
-        protected override Size ArrangeOverride(Size arrangeSize)
-        {
-            foreach (UIElement child in this.Children)
-            {
-                //get (left, top) coorinates
-                Point pos = ExtensionSurface.GetPosition(child);
-                //include eventual negative offset (panel wouldn't display elements with negative coorinates by default)
-                pos.Offset(this.canvasOffset.X, this.canvasOffset.Y);
-                //request child to rearange itself in given rectangle
-                child.Arrange(new Rect(pos, child.DesiredSize));
-            }
-            System.Diagnostics.Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, "ArrangeOverride Size({0},{1})", arrangeSize.Width, arrangeSize.Height));
-            return arrangeSize;
-
-        }
-
-
-        protected override Size MeasureOverride(Size constraint)
-        {
-            Size result;
-
-            if (this.AutoExpandCanvas)
-            {
-                double panelWidth = 0.0;
-                double panelHeight = 0.0;
-
-                //initially assume that whole content fits in rectangle with coordinates (0,0, ActualWidth, ActualHeight)
-                double offsetMinusX = 0.0;
-                double offsetMinusY = 0.0;
-                double offsetPlusX = this.rearangeStartSize.Width;
-                double offsetPlusY = this.rearangeStartSize.Height;
-
-                foreach (UIElement item in this.Children)
-                {
-                    FrameworkElement child = item as FrameworkElement;
-                    if (null != child)
-                    {
-                        child.Measure(constraint);
-
-                        //get child's position
-                        Point pos = ExtensionSurface.GetPosition(child);
-
-                        //calculate the minimum value of panel's (left,top) corner
-                        offsetMinusX = Math.Min(offsetMinusX, pos.X);
-                        offsetMinusY = Math.Min(offsetMinusY, pos.Y);
-
-                        //calculate the maximum value of panel's (right, bottom) corner
-                        offsetPlusX = Math.Max(offsetPlusX, pos.X + child.DesiredSize.Width);
-                        offsetPlusY = Math.Max(offsetPlusY, pos.Y + child.DesiredSize.Height);
-                    }
-                }
-
-                //get required panel's width and height
-                panelWidth = Math.Abs(offsetPlusX - offsetMinusX);
-                panelHeight = Math.Abs(offsetPlusY - offsetMinusY);
-
-                this.actualPanelRect.Location = new Point(offsetMinusX, offsetMinusY);
-                this.actualPanelRect.Size = new Size(panelWidth, panelHeight);
-
-                //return it as result
-                result = new Size(panelWidth, panelHeight);
-            }
-            else
-            {
-                result = base.MeasureOverride(constraint);
-            }
-            System.Diagnostics.Debug.WriteLine("MO constraint:" + constraint.Width + "," + constraint.Height + " new: " + result.Width + "," + result.Height);
-            return result;
-        }
-
-        public void SelectWindow(ExtensionWindow window)
-        {
-            if (null != window && this.Children.Contains(window))
-            {
-                this.selectedChild = new KeyValuePair<FrameworkElement, Point>(window, this.canvasOffset);
-                this.rearangeStartSize.Width = this.ActualWidth;
-                this.rearangeStartSize.Height = this.ActualHeight;
-                Panel.SetZIndex(window, ++this.currentZIndex);
-            }
-        }
-
-        void OnExtensionWindowClosed(object sender, RoutedEventArgs args)
-        {
-            ExtensionWindow window = args.Source as ExtensionWindow;
-
-            if (null != window)
-            {
-                //remove window from children collection
-                this.Children.Remove(window);
-            }
-        }
-
-        public static void SetPlacementTarget(DependencyObject container, FrameworkElement value)
-        {
-            container.SetValue(PlacementTargetProperty, value);
-        }
-
-        public static FrameworkElement GetPlacementTarget(DependencyObject container)
-        {
-            return (FrameworkElement)container.GetValue(PlacementTargetProperty);
-        }
-
-        public static void SetAlignment(DependencyObject container, PositionAlignment value)
-        {
-            container.SetValue(AlignmentProperty, value);
-        }
-
-        public static PositionAlignment GetAlignment(DependencyObject container)
-        {
-            return (PositionAlignment)container.GetValue(AlignmentProperty);
-        }
-
-        public static void SetMode(DependencyObject container, PlacementMode value)
-        {
-            container.SetValue(ModeProperty, value);
-        }
-
-        public static PlacementMode GetMode(DependencyObject container)
-        {
-            return (PlacementMode)container.GetValue(ModeProperty);
-        }
-
-        public static void SetPosition(DependencyObject container, Point value)
-        {
-            container.SetValue(PositionProperty, value);
-        }
-
-        public static Point GetPosition(DependencyObject container)
-        {
-            return (Point)container.GetValue(PositionProperty);
-        }
-        [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Suppress to avoid unnecessary changes.")]
-        public enum PlacementMode
-        {
-            Relative, Absolute
-        }
-        [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Suppress to avoid unnecessary changes.")]
-        public enum PositionAlignment
-        {
-            LeftTop, LeftBottom, RightTop, RightBottom, Center, CenterHorizontal, CenterVertical
-        };
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExtensionWindow.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExtensionWindow.cs
deleted file mode 100644 (file)
index cfdc455..0000000
+++ /dev/null
@@ -1,581 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.View
-{
-    using System.Collections.ObjectModel;
-    using System.Collections.Specialized;
-    using System.ComponentModel;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using System.Runtime;
-    using System.Globalization;
-    using System.Diagnostics.CodeAnalysis;
-
-    delegate void ExtensionWindowCloseEventHandler(object sender, RoutedEventArgs e);
-    delegate void ExtensionWindowClosingEventHandler(object sender, ExtensionWindowClosingRoutedEventArgs e);
-
-    //This class provides PopupWindow like expirience while editing data on designer surface. It 
-    //behaves like ordinary popup, with additional functionality - allows resizing, moving, and 
-    //easier styling. 
-    [TemplatePart(Name = "PART_Content"), 
-     TemplatePart(Name = "PART_ShapeBorder")]
-    class ExtensionWindow : ContentControl
-    {
-
-        public static readonly DependencyProperty DataProperty = DependencyProperty.Register(
-                "Data",
-                typeof(object),
-                typeof(ExtensionWindow),
-                new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsRender, new PropertyChangedCallback(OnDataChanged)));
-
-        public static readonly DependencyProperty TitleProperty = DependencyProperty.Register(
-                "Title",
-                typeof(string),
-                typeof(ExtensionWindow),
-                new UIPropertyMetadata(string.Empty));
-
-        public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
-                "Icon",
-                typeof(DrawingBrush),
-                typeof(ExtensionWindow),
-                new UIPropertyMetadata(null));
-
-        public static readonly DependencyProperty ShowWindowHeaderProperty = DependencyProperty.Register(
-                "ShowWindowHeader",
-                typeof(bool),
-                typeof(ExtensionWindow),
-                new UIPropertyMetadata(true));
-
-        public static readonly DependencyProperty ShowResizeGripProperty = DependencyProperty.Register(
-                "ShowResizeGrip",
-                typeof(bool),
-                typeof(ExtensionWindow),
-                new UIPropertyMetadata(true));
-
-        public static readonly DependencyProperty MenuItemsProperty = DependencyProperty.Register(
-                "MenuItems",
-                typeof(ObservableCollection<MenuItem>),
-                typeof(ExtensionWindow));
-
-        public static readonly DependencyProperty IsResizableProperty = DependencyProperty.Register(
-                "IsResizable",
-                typeof(bool),
-                typeof(ExtensionWindow),
-                new UIPropertyMetadata(false));
-
-
-        public static readonly RoutedEvent ClosingEvent = EventManager.RegisterRoutedEvent("Closing",
-                RoutingStrategy.Bubble,
-                typeof(ExtensionWindowClosingEventHandler),
-                typeof(ExtensionWindow));
-
-        public static readonly RoutedEvent CloseEvent = EventManager.RegisterRoutedEvent("Close",
-                RoutingStrategy.Bubble,
-                typeof(ExtensionWindowCloseEventHandler),
-                typeof(ExtensionWindow));
-
-        public static readonly RoutedEvent VisibilityChangedEvent = EventManager.RegisterRoutedEvent("VisibilityChanged",
-                RoutingStrategy.Bubble,
-                typeof(RoutedEventHandler),
-                typeof(ExtensionWindow));
-
-        static readonly double BorderOffset = 20.0;
-
-        ContentPresenter presenter;
-        ExtensionSurface surface;
-        Border border;
-        ResizeValues resizeOption = ResizeValues.NONE;
-        Point bottomRight;
-
-        [SuppressMessage(FxCop.Category.Performance, FxCop.Rule.InitializeReferenceTypeStaticFieldsInline,
-            Justification = "Overriding metadata for dependency properties in static constructor is the way suggested by WPF")]
-        static ExtensionWindow()
-        {
-            VisibilityProperty.AddOwner(typeof(ExtensionWindow), new PropertyMetadata(OnVisibilityChanged));
-
-            DefaultStyleKeyProperty.OverrideMetadata(
-                typeof(ExtensionWindow),
-                new FrameworkPropertyMetadata(typeof(ExtensionWindow)));
-        }
-
-        [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors", Justification = "This is internal code with no derived class")]
-        public ExtensionWindow()
-        {
-            this.MenuItems = new ObservableCollection<MenuItem>();
-        }
-
-        protected override void OnInitialized(EventArgs e)
-        {
-            base.OnInitialized(e);
-            this.MenuItems.CollectionChanged += new NotifyCollectionChangedEventHandler(OnMenuItemsChanged);
-            this.DataContext = this;
-
-        }
-
-        public event ExtensionWindowClosingEventHandler Closing
-        {
-            add
-            {
-                AddHandler(ClosingEvent, value);
-            }
-            remove
-            {
-                RemoveHandler(ClosingEvent, value);
-            }
-        }
-
-
-        public event ExtensionWindowCloseEventHandler Close
-        {
-            add 
-            { 
-                AddHandler(CloseEvent, value); 
-            }
-            remove 
-            { 
-                RemoveHandler(CloseEvent, value); 
-            }
-        }
-
-        public event RoutedEventHandler VisibilityChanged
-        {
-            add
-            {
-                AddHandler(VisibilityChangedEvent, value);
-            }
-            remove
-            {
-                RemoveHandler(VisibilityChangedEvent, value);
-            }
-        }
-
-
-        public object Data
-        {
-            get { return (object)GetValue(DataProperty); }
-            set { SetValue(DataProperty, value); }
-        }
-
-        public string Title
-        {
-            get { return (string)GetValue(TitleProperty); }
-            set { SetValue(TitleProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public DrawingBrush Icon
-        {
-            get { return (DrawingBrush)GetValue(IconProperty); }
-            set { SetValue(IconProperty, value); }
-        }
-
-        public bool ShowWindowHeader
-        {
-            get { return (bool)GetValue(ShowWindowHeaderProperty); }
-            set { SetValue(ShowWindowHeaderProperty, value); }
-        }
-
-        public bool ShowResizeGrip
-        {
-            get { return (bool)GetValue(ShowResizeGripProperty); }
-            set { SetValue(ShowResizeGripProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public ObservableCollection<MenuItem> MenuItems
-        {
-            get { return (ObservableCollection<MenuItem>)GetValue(MenuItemsProperty); }
-            private set { SetValue(MenuItemsProperty, value); }
-        }
-
-        public ExtensionSurface Surface
-        {
-            get { return this.surface; }
-        }
-
-        public bool IsResizable
-        {
-            get { return (bool)GetValue(IsResizableProperty); }
-            set { SetValue(IsResizableProperty, value); }
-        }
-
-        protected ContentPresenter ContentPresenter
-        {
-            get { return this.presenter; }
-        }
-
-        public Point GetPlacementTargetOffset()
-        {           
-            Point offset = new Point();
-            FrameworkElement target = ExtensionSurface.GetPlacementTarget(this);
-            if (null != target)
-            {
-                FrameworkElement commonRoot = target.FindCommonVisualAncestor(this) as FrameworkElement;
-                MatrixTransform transform = (MatrixTransform)target.TransformToAncestor(commonRoot);
-                Point targetPosition = transform.Transform(new Point());
-                Point windowPosition = ExtensionSurface.GetPosition(this);
-                offset.X = targetPosition.X - windowPosition.X;
-                offset.Y = targetPosition.Y - windowPosition.Y;                
-            }
-            return offset;
-        }
-
-
-        static void OnDataChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
-        {
-            ((ExtensionWindow)sender).OnDataChanged(args.OldValue, args.NewValue);
-        }
-
-        static void OnPositionChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
-        {
-            ((ExtensionWindow)sender).OnPositionChanged((Point)args.NewValue);
-        }
-
-        static void OnVisibilityChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
-        {
-            ((ExtensionWindow)sender).OnVisibilityChanged((Visibility)e.OldValue, (Visibility)e.NewValue);
-        }
-
-        protected override void OnVisualParentChanged(DependencyObject oldParent)
-        {
-            base.OnVisualParentChanged(oldParent);
-            ExtensionWindow dummy;
-            if (!DesignerProperties.GetIsInDesignMode(this) && !TryGetParentExtensionWindow(this, out dummy, out this.surface))
-            {
-                Fx.Assert(string.Format(CultureInfo.InvariantCulture, "ExtensionWindow '{0}' cannot be used outside ExtensionSurface", this.Name));
-            }
-        }
-
-        protected virtual void OnDataChanged(object oldData, object newData)
-        {
-        }
-
-        protected virtual void OnVisibilityChanged(Visibility oldValue, Visibility newValue)
-        {
-            RaiseEvent(new RoutedEventArgs(VisibilityChangedEvent, this));
-        }
-
-        protected virtual void OnPositionChanged(Point position)
-        {
-            if (null != this.surface)
-            {
-                this.surface.SetWindowPosition(this, position);
-            }
-        }
-
-        public bool TryFindElement(string elementName, out object element)
-        {
-            //helper method - it looks for named visual elements in the template provided by the user
-            element = null;
-            if (null != this.presenter)
-            {
-                element = this.presenter.ContentTemplate.FindName(elementName, this.presenter);
-            }
-            return (null != element);
-        }
-
-        public override void OnApplyTemplate()
-        {
-            base.OnApplyTemplate();
-            //lookup for content presenter (should always be there)
-            this.presenter = this.Template.FindName("PART_Content", this) as ContentPresenter;
-            if (!DesignerProperties.GetIsInDesignMode(this) && null != this.presenter && null == this.presenter.Content)
-            {
-                //setup bindings - datacontext and content may possibly change, so i want them beeing set via databinding
-                Binding binding = new Binding();
-                binding.Source = this;
-                this.presenter.SetBinding(ContentPresenter.ContentProperty, binding);
-                binding = new Binding();
-                binding.Source = this;
-                this.presenter.SetBinding(ContentPresenter.DataContextProperty, binding);
-                this.presenter.ApplyTemplate();
-            }
-            this.border = this.Template.FindName("PART_ShapeBorder", this) as Border;
-            if (null != this.border)
-            {
-                this.border.MouseMove += OnBorderMouseMove;
-                this.border.MouseDown += OnBorderMouseDown;
-                this.border.MouseUp += OnBorderMouseUp;
-                this.border.MouseLeave += OnBorderMouseLeave;
-            }
-        }
-
-        static internal void RaiseWindowCloseEvent(ExtensionWindow sender)
-        {
-            ExtensionWindowClosingRoutedEventArgs args = new ExtensionWindowClosingRoutedEventArgs(ClosingEvent, sender);
-            sender.RaiseEvent(args);
-            if (!args.Cancel)
-            {
-                sender.RaiseEvent(new RoutedEventArgs(CloseEvent, sender));
-            }
-        }
-
-        void OnBorderMouseMove(object sender, MouseEventArgs e)
-        {
-            if (!this.border.IsMouseCaptured)
-            {
-                if (this.border.IsMouseDirectlyOver && this.IsResizable && ExtensionSurface.GetMode(this) == ExtensionSurface.PlacementMode.Absolute)
-                {
-                    Point position = e.GetPosition(this.border);
-
-                    if (position.X <= BorderOffset && position.Y <= BorderOffset)
-                    {
-                        this.resizeOption = ResizeValues.TopLeft;
-                        Mouse.OverrideCursor = Cursors.SizeNWSE;
-                    }
-                    else if (position.X >= this.border.ActualWidth - BorderOffset && position.Y <= BorderOffset)
-                    {
-                        this.resizeOption = ResizeValues.TopRight;
-                        Mouse.OverrideCursor = Cursors.SizeNESW;
-                    }
-                    else if (position.X <= BorderOffset && position.Y >= this.border.ActualHeight - BorderOffset)
-                    {
-                        this.resizeOption = ResizeValues.BottomLeft;
-                        Mouse.OverrideCursor = Cursors.SizeNESW;
-                    }
-                    else if (position.X >= this.border.ActualWidth - BorderOffset && position.Y >= this.border.ActualHeight - BorderOffset)
-                    {
-                        this.resizeOption = ResizeValues.BottomRight;
-                        Mouse.OverrideCursor = Cursors.SizeNWSE;
-                    }
-                    else if (position.Y <= (BorderOffset / 2.0))
-                    {
-                        this.resizeOption = ResizeValues.Top;
-                        Mouse.OverrideCursor = Cursors.SizeNS;
-                    }
-                    else if (position.Y >= this.border.ActualHeight - (BorderOffset / 2.0))
-                    {
-                        this.resizeOption = ResizeValues.Bottom;
-                        Mouse.OverrideCursor = Cursors.SizeNS;
-                    }
-                    else if (position.X <= (BorderOffset / 2.0))
-                    {
-                        this.resizeOption = ResizeValues.Left;
-                        Mouse.OverrideCursor = Cursors.SizeWE;
-                    }
-                    else if (position.X >= this.border.ActualWidth - (BorderOffset / 2.0))
-                    {
-                        this.resizeOption = ResizeValues.Right;
-                        Mouse.OverrideCursor = Cursors.SizeWE;
-                    }
-                    else
-                    {
-                        Mouse.OverrideCursor = null;
-                        this.resizeOption = ResizeValues.NONE;
-                    }
-                    Point topLeft = ExtensionSurface.GetPosition(this);
-                    this.bottomRight = new Point(topLeft.X + Width, topLeft.Y + Height);
-                }
-                else if (Mouse.OverrideCursor != null)
-                {
-                    Mouse.OverrideCursor = null;
-                    this.resizeOption = ResizeValues.NONE;
-                }
-            }
-            else if (e.LeftButton == MouseButtonState.Pressed)
-            {
-                this.HandleWindowResize();
-            }
-        }
-
-        void OnBorderMouseDown(object sender, MouseButtonEventArgs e)
-        {
-            if (this.resizeOption != ResizeValues.NONE && sender == this.border)
-            {
-                Mouse.Capture(this.border);
-            }
-        }
-
-        void OnBorderMouseUp(object sender, MouseButtonEventArgs e)
-        {
-            if (this.border.IsMouseCaptured)
-            {
-                Mouse.Capture(null);
-            }
-        }
-
-        void OnBorderMouseLeave(object sender, MouseEventArgs e)
-        {
-            this.resizeOption = ResizeValues.NONE;
-            Mouse.OverrideCursor = null;
-        }
-
-        void HandleWindowResize()
-        {
-            switch (this.resizeOption)
-            {
-                case ResizeValues.Top:
-                    CalculateSize(false, true, false, true);
-                    break;
-
-                case ResizeValues.TopLeft:
-                    CalculateSize(true, true, true, true);
-                    break;
-
-                case ResizeValues.Left:
-                    CalculateSize(true, false, true, false);
-                    break;
-
-                case ResizeValues.BottomLeft:
-                    CalculateSize(true, false, true, true);
-                    break;
-
-                case ResizeValues.TopRight:
-                    CalculateSize(false, true, true, true);
-                    break;
-
-                case ResizeValues.Bottom:
-                    CalculateSize(false, false, false, true);
-                    break;
-
-                case ResizeValues.Right:
-                    CalculateSize(false, false, true, false);
-                    break;
-
-                case ResizeValues.BottomRight:
-                    CalculateSize(false, false, true, true);
-                    break;
-
-                default:
-                    Fx.Assert("not supported resize option " + this.resizeOption);
-                    break;
-            };
-        }
-
-        void CalculateSize(bool changeX, bool changeY, bool changeWidth, bool changeHeight)
-        {
-            Point current = Mouse.GetPosition(this);
-            Point absolutePosition = Mouse.GetPosition(this.surface);
-
-            Point topLeft = ExtensionSurface.GetPosition(this);
-
-            double initialHeight = this.bottomRight.Y - topLeft.Y;
-            double initialWidth = this.bottomRight.X - topLeft.X;
-
-            Size size = new Size(initialWidth, initialHeight);
-
-            if (changeX)
-            {
-                if (bottomRight.X > absolutePosition.X)
-                {
-                    if ((double.IsNaN(MinWidth) || double.IsInfinity(MinWidth) || bottomRight.X - absolutePosition.X >= MinWidth) &&
-                        (double.IsNaN(MaxWidth) || double.IsInfinity(MaxWidth) || bottomRight.X - absolutePosition.X <= MaxWidth))
-                    {
-                        size.Width = this.bottomRight.X - absolutePosition.X;
-                        topLeft.X = absolutePosition.X;
-                    }
-                }
-            }
-            else
-            {
-                if (changeWidth)
-                {
-                    size.Width = Math.Min(Math.Max(MinWidth, current.X), MaxWidth);
-                }
-            }
-            if (changeY)
-            {
-                if (bottomRight.Y > absolutePosition.Y)
-                {
-                    if ((double.IsNaN(MinHeight) || double.IsInfinity(MinHeight) || bottomRight.Y - absolutePosition.Y >= MinHeight) &&
-                        (double.IsNaN(MaxHeight) || double.IsInfinity(MaxHeight) || bottomRight.Y - absolutePosition.Y <= MaxHeight)) 
-                    {
-                        size.Height = this.bottomRight.Y - absolutePosition.Y;
-                        topLeft.Y = absolutePosition.Y;
-                    }
-                }
-            }
-            else
-            {
-                if (changeHeight)
-                {
-                    size.Height = Math.Min(Math.Max(MinHeight, current.Y), MaxHeight);
-                }
-            }
-            if (changeX || changeY)
-            {
-                this.surface.SetWindowPosition(this, topLeft);
-            }
-            this.surface.SetSize(this, size);
-        }
-
-        protected override void OnKeyDown(KeyEventArgs e)
-        {
-            //if ESC - close me
-            if (e.Key == Key.Escape)
-            {
-                RaiseWindowCloseEvent(this);
-            }
-            base.OnKeyDown(e);
-        }
-
-        protected override void OnMouseDown(MouseButtonEventArgs e)
-        {
-            base.OnMouseDown(e);
-            this.SelectWindow();
-        }
-
-
-
-        public void SelectWindow()
-        {
-            this.surface.SelectWindow(this);
-        }
-
-        void OnMenuItemsChanged(object sender, NotifyCollectionChangedEventArgs e)
-        {
-            if (null != e.NewItems)
-            {
-                foreach (MenuItem item in e.NewItems)
-                {
-                    item.DataContext = this;
-                }
-            }
-        }
-
-
-        internal static bool TryGetParentExtensionWindow(FrameworkElement element, out ExtensionWindow window, out ExtensionSurface surface)
-        {
-            window = null;
-            surface = null;
-            if (null != element)
-            {
-                FrameworkElement current = element;
-                window = element.TemplatedParent as ExtensionWindow;
-                while (null == window && null != current)
-                {
-                    window = current as ExtensionWindow;
-                    current = (FrameworkElement)current.Parent;
-                }
-                if (null != window)
-                {
-                    current = window;
-                    surface = window.TemplatedParent as ExtensionSurface;
-                    while (null == surface && null != current)
-                    {
-                        surface = current as ExtensionSurface;
-                        current = (FrameworkElement)current.Parent;
-                    }
-                }
-            }
-            return (null != window && null != surface);
-        }
-
-        enum ResizeValues
-        {
-            NONE,
-            TopLeft,
-            Left,
-            BottomLeft,
-            Bottom,
-            BottomRight,
-            Right,
-            TopRight,
-            Top,
-        };
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExtensionWindowClosingRoutedEventArgs.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExtensionWindowClosingRoutedEventArgs.cs
deleted file mode 100644 (file)
index d52c8c0..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//---------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Windows;
-    using System.Runtime;
-
-    [Fx.Tag.XamlVisible(false)]
-    sealed class ExtensionWindowClosingRoutedEventArgs : RoutedEventArgs
-    {
-        internal ExtensionWindowClosingRoutedEventArgs(RoutedEvent routedEvent, object source)
-            : base(routedEvent, source)
-        {
-        }
-
-        public bool Cancel
-        {
-            get;
-            set;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExtensionWindowHeader.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExtensionWindowHeader.cs
deleted file mode 100644 (file)
index b2d21d7..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.View
-{
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Input;
-    using System.Windows.Media;
-
-    //This class is visual representation of WindowHeader like control, which is used with ExtenstionWindows to allow
-    //moving and closing. Actual moving logic is handled by ExtensionSurface class
-    [TemplatePart(Name = "PART_Header")]
-    [TemplatePart(Name = "PART_CloseButton")]
-    class ExtensionWindowHeader : Control
-    {
-        public static readonly DependencyProperty TitleProperty =
-            DependencyProperty.Register("Title", typeof(string), typeof(ExtensionWindowHeader));
-
-        public static readonly DependencyProperty ButtonCloseIconProperty =
-            DependencyProperty.Register("ButtonCloseIcon", typeof(DrawingBrush), typeof(ExtensionWindowHeader));
-
-        public static readonly DependencyProperty IconProperty =
-            DependencyProperty.Register("Icon", typeof(DrawingBrush), typeof(ExtensionWindowHeader));
-
-        public static readonly DependencyProperty DropDownMenuIconProperty =
-            DependencyProperty.Register("DropDownMenuIcon", typeof(DrawingBrush), typeof(ExtensionWindowHeader));
-
-
-
-        Button closeButton;
-        ExtensionWindow parent;
-        ExtensionSurface surface;
-        Point offset;
-
-
-        [SuppressMessage(FxCop.Category.Performance, FxCop.Rule.InitializeReferenceTypeStaticFieldsInline,
-            Justification = "Overriding metadata for dependency properties in static constructor is the way suggested by WPF")]
-        static ExtensionWindowHeader()
-        {
-            DefaultStyleKeyProperty.OverrideMetadata(
-                typeof(ExtensionWindowHeader),
-                new FrameworkPropertyMetadata(typeof(ExtensionWindowHeader)));
-        }
-
-        public string Title
-        {
-            get { return (string)GetValue(TitleProperty); }
-            set { SetValue(TitleProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public DrawingBrush ButtonCloseIcon
-        {
-            get { return (DrawingBrush)GetValue(ButtonCloseIconProperty); }
-            set { SetValue(ButtonCloseIconProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public DrawingBrush Icon
-        {
-            get { return (DrawingBrush)GetValue(IconProperty); }
-            set { SetValue(IconProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public DrawingBrush DropDownMenuIcon
-        {
-            get { return (DrawingBrush)GetValue(DropDownMenuIconProperty); }
-            set { SetValue(DropDownMenuIconProperty, value); }
-        }
-
-        public override void OnApplyTemplate()
-        {
-            base.OnApplyTemplate();
-            this.closeButton = this.Template.FindName("PART_CloseButton", this) as Button;
-            if (null != this.closeButton)
-            {
-                this.closeButton.Click += new RoutedEventHandler(delegate(object sender, RoutedEventArgs e)
-                {
-                    ExtensionWindow.RaiseWindowCloseEvent(this.parent);
-                }
-                    );
-            }
-        }
-
-        protected override void OnMouseLeftButtonDown(MouseButtonEventArgs args)
-        {
-            base.OnMouseLeftButtonDown(args);
-            if (ExtensionSurface.PlacementMode.Absolute == ExtensionSurface.GetMode(this.parent))
-            {
-                this.offset = Mouse.GetPosition(this);
-                Mouse.OverrideCursor = Cursors.Arrow;
-                CaptureMouse();
-            }
-        }
-
-        protected override void OnMouseMove(MouseEventArgs args)
-        {
-            base.OnMouseMove(args);
-            if (args.LeftButton == MouseButtonState.Pressed && this.IsMouseCaptured)
-            {
-                Point moveTo = Mouse.GetPosition(this.surface);
-                moveTo.Offset(-offset.X, -offset.Y);
-                this.surface.SetWindowPosition(this.parent, moveTo);
-            }
-        }
-
-        protected override void OnMouseLeftButtonUp(MouseButtonEventArgs args)
-        {
-            base.OnMouseLeftButtonUp(args);
-            if (this.IsMouseCaptured)
-            {
-                Mouse.OverrideCursor = null;
-                Mouse.Capture(null);
-            }
-        }
-
-        protected override void OnVisualParentChanged(DependencyObject oldParent)
-        {
-            base.OnVisualParentChanged(oldParent);
-            if (!DesignerProperties.GetIsInDesignMode(this) && 
-                !ExtensionWindow.TryGetParentExtensionWindow(this, out this.parent, out this.surface))
-            {
-                Fx.Assert("ExtensionWindowHeader cannot be used outside ExtensionWindow");                
-            }
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExtensionWindowResizeGrip.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ExtensionWindowResizeGrip.cs
deleted file mode 100644 (file)
index 881d99c..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.View
-{
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Input;
-    using System.Windows.Media;
-
-    //This class is visual representation of ResizeGrip like control, which is used with ExtenstionWindows to allow
-    //resizing. Actual resize logic is handled by ExtensionSurface class
-    [TemplatePart(Name = "PART_ResizeGrip")]
-    class ExtensionWindowResizeGrip : Control
-    {
-        public static readonly DependencyProperty IconProperty =
-            DependencyProperty.Register("Icon", typeof(DrawingBrush), typeof(ExtensionWindowResizeGrip));
-
-        ExtensionWindow parent;
-        ExtensionSurface surface;
-        Point offset;
-
-        [SuppressMessage(FxCop.Category.Performance, FxCop.Rule.InitializeReferenceTypeStaticFieldsInline,
-            Justification = "Overriding metadata for dependency properties in static constructor is the way suggested by WPF")]
-        static ExtensionWindowResizeGrip()
-        {
-            DefaultStyleKeyProperty.OverrideMetadata(
-                typeof(ExtensionWindowResizeGrip),
-                new FrameworkPropertyMetadata(typeof(ExtensionWindowResizeGrip)));            
-        }
-
-        public DrawingBrush Icon
-        {
-            get { return (DrawingBrush)GetValue(IconProperty); }
-            set { SetValue(IconProperty, value); }
-        }
-
-        protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
-        {
-            base.OnMouseLeftButtonDown(e);
-            if (this.parent.IsResizable)
-            {
-                this.Cursor = Cursors.SizeNWSE;
-                this.offset = e.GetPosition(this);
-                CaptureMouse();
-            }
-        }
-
-        protected override void OnMouseMove(MouseEventArgs args)
-        {
-            base.OnMouseMove(args);
-            if (args.LeftButton == MouseButtonState.Pressed && this.IsMouseCaptured)
-            {
-                Point currentPosition = Mouse.GetPosition(this.parent);
-                currentPosition.Offset(this.offset.X, this.offset.Y);
-                Size newSize = new Size();
-                newSize.Width = Math.Min(Math.Max(this.parent.MinWidth, currentPosition.X), this.parent.MaxWidth);
-                newSize.Height = Math.Min(Math.Max(this.parent.MinHeight, currentPosition.Y), this.parent.MaxHeight);
-                System.Diagnostics.Debug.WriteLine("NewSize = (" + newSize.Width + "," + newSize.Height + ")");
-                this.surface.SetSize(this.parent, newSize);
-            }
-        }
-
-        protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
-        {
-            base.OnMouseLeftButtonUp(e);
-            Mouse.OverrideCursor = null;
-            Mouse.Capture(null);
-        }
-
-        protected override void OnVisualParentChanged(DependencyObject oldParent)
-        {
-            base.OnVisualParentChanged(oldParent);
-            if (!DesignerProperties.GetIsInDesignMode(this) && 
-                !ExtensionWindow.TryGetParentExtensionWindow(this, out this.parent, out this.surface))
-            {
-                Fx.Assert("ExtensionWindowHeader cannot be used outside ExtensionWindow");
-            }
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/FilterableData.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/FilterableData.cs
deleted file mode 100644 (file)
index ccdb656..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Windows;
-    using System.Globalization;
-    using System.Runtime;
-
-    class FilterableData : DependencyObject
-    {
-        public static readonly DependencyProperty DataProperty =
-            DependencyProperty.Register("Data", typeof(object), typeof(FilterableData), new UIPropertyMetadata(null));
-
-        public static readonly DependencyProperty IsSelectedProperty =
-            DependencyProperty.Register("IsSelected", typeof(bool), typeof(FilterableData), new UIPropertyMetadata(false));
-
-        public static readonly DependencyProperty VisibilityProperty =
-            DependencyProperty.Register("Visibility", typeof(Visibility), typeof(FilterableData), new UIPropertyMetadata(Visibility.Visible));
-
-        public object Data
-        {
-            get { return (object)GetValue(DataProperty); }
-            set { SetValue(DataProperty, value); }
-        }
-
-        public bool IsSelected
-        {
-            get { return (bool)GetValue(IsSelectedProperty); }
-            set { SetValue(IsSelectedProperty, value); }
-        }
-
-        public Visibility Visibility
-        {
-            get { return (Visibility)GetValue(VisibilityProperty); }
-            set { SetValue(VisibilityProperty, value); }
-        }
-
-        internal object Owner
-        {
-            get;
-            set;
-        }
-
-        public override string ToString()
-        {
-            return null == this.Data ? "<null>" : this.Data.ToString();
-        }
-    }
-
-    class FilterableData<TData> : FilterableData
-    {
-        [Fx.Tag.KnownXamlExternal]
-        public TData TypedData
-        {
-            get { return (TData)base.Data; }
-            set { base.Data = value; }
-        }
-
-        public override string ToString()
-        {
-            return string.Format(CultureInfo.CurrentUICulture, "{0}:({1})", base.ToString(), typeof(TData).Name);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/GenericActivityTypeDesigner.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/GenericActivityTypeDesigner.xaml.cs
deleted file mode 100644 (file)
index 704dbd9..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation.View
-{
-    using System.Activities.Presentation.Model;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Input;
-
-    internal partial class GenericActivityTypeDesigner
-    {
-        private static AttachedProperty<string> displayNameProperty = new AttachedProperty<string>
-            {
-                Name = "DisplayName",
-                OwnerType = typeof(ActivityBuilder<>),
-                Getter = (modelItem) => ViewUtilities.GetActivityBuilderDisplayName(modelItem)
-            };
-
-        public GenericActivityTypeDesigner()
-        {
-            this.InitializeComponent();
-            DesignerView.SetCommandMenuMode(this, CommandMenuMode.NoCommandMenu);
-        }
-
-        protected override void OnContextMenuLoaded(ContextMenu menu)
-        {
-            menu.IsOpen = false;
-        }
-
-        private void RegisterDisplayNameProperty()
-        {
-            AttachedPropertiesService attachedPropertiesService = 
-                this.Context.Services.GetService<AttachedPropertiesService>();
-            if (attachedPropertiesService == null)
-            {
-                return;
-            }
-
-            IEnumerable<AttachedProperty> properties = attachedPropertiesService.GetAttachedProperties(typeof(ActivityBuilder<>));
-            if (properties != null && properties.Contains(displayNameProperty))
-            {
-                return;
-            }
-
-            attachedPropertiesService.AddProperty(displayNameProperty);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/HandleValueEditor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/HandleValueEditor.cs
deleted file mode 100644 (file)
index 848d319..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Windows;
-
-    sealed class HandleValueEditor : PropertyValueEditor
-    {
-        public HandleValueEditor()
-        {
-            this.InlineEditorTemplate = (DataTemplate)EditorResources.GetResources()["handleValueEditor"];
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/IExpressionEditorInstance.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/IExpressionEditorInstance.cs
deleted file mode 100644 (file)
index eb06b00..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows.Controls;
-
-namespace System.Activities.Presentation.View
-{
-    public interface IExpressionEditorInstance
-    {
-        //Properties
-        Control HostControl { get; } // Returns a Control to be used to display in the ExpressionTextBox
-        string Text { get; set; }
-
-        ScrollBarVisibility VerticalScrollBarVisibility { get; set; }
-        ScrollBarVisibility HorizontalScrollBarVisibility { get; set; }
-        int MinLines { get; set; }
-        int MaxLines { get; set; }
-        bool HasAggregateFocus { get; }
-        bool AcceptsReturn { get; set; }
-        bool AcceptsTab { get; set; }
-
-        //Methods
-        void Close(); // For closing and getting rid of the editor items - closes the specific expression editor
-        void Focus(); // For setting focus on the editor
-        void ClearSelection(); // Clear the selection in the editor
-        bool Cut();
-        bool Copy();
-        bool Paste();
-        bool Undo();
-        bool Redo();
-        bool CompleteWord();
-        bool GlobalIntellisense();
-        bool ParameterInfo();
-        bool QuickInfo();
-        bool IncreaseFilterLevel();
-        bool DecreaseFilterLevel();
-
-        bool CanCut();
-        bool CanCopy();
-        bool CanPaste();
-        bool CanUndo();
-        bool CanRedo();
-        bool CanCompleteWord();
-        bool CanGlobalIntellisense();
-        bool CanParameterInfo();
-        bool CanQuickInfo();
-        bool CanIncreaseFilterLevel();
-        bool CanDecreaseFilterLevel();
-
-        string GetCommittedText();
-
-        // Events
-        event EventHandler TextChanged; // An event which is raised when the text in an expression editor is changed
-        event EventHandler LostAggregateFocus; // An event which is raised when the expression editor lost aggregate focus
-        event EventHandler GotAggregateFocus; // An event which is raised when the expression editor got aggregate focus
-        event EventHandler Closing; // An event which is raised when the expression editor is closing
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/IExpressionEditorService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/IExpressionEditorService.cs
deleted file mode 100644 (file)
index c7eafc3..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-    using System.Windows.Controls;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Hosting;
-    using System.Windows;
-
-    public interface IExpressionEditorService
-    {
-        IExpressionEditorInstance CreateExpressionEditor(AssemblyContextControlItem assemblies, ImportedNamespaceContextItem importedNamespaces, List<ModelItem> variables, string text, Type expressionType);
-        IExpressionEditorInstance CreateExpressionEditor(AssemblyContextControlItem assemblies, ImportedNamespaceContextItem importedNamespaces, List<ModelItem> variables, string text, Type expressionType, Size initialSize);
-        IExpressionEditorInstance CreateExpressionEditor(AssemblyContextControlItem assemblies, ImportedNamespaceContextItem importedNamespaces, List<ModelItem> variables, string text);
-        IExpressionEditorInstance CreateExpressionEditor(AssemblyContextControlItem assemblies, ImportedNamespaceContextItem importedNamespaces, List<ModelItem> variables, string text, Size initialSize);
-        void CloseExpressionEditors(); // Closes all editors
-        void UpdateContext(AssemblyContextControlItem assemblies, ImportedNamespaceContextItem importedNamespaces);
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/IVersionEditor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/IVersionEditor.cs
deleted file mode 100644 (file)
index aaa7622..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    internal interface IVersionEditor
-    {
-        void ShowErrorMessage(string message);
-    }
-}
\ No newline at end of file
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ImportDesigner.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ImportDesigner.xaml.cs
deleted file mode 100644 (file)
index 01f29bd..0000000
+++ /dev/null
@@ -1,786 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Activities.Expressions;
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Services;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Collections.Specialized;
-    using System.ComponentModel;
-    using System.Globalization;
-    using System.IO;
-    using System.Linq;
-    using System.Reflection;
-    using System.Runtime;
-    using System.Runtime.Versioning;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Windows.Documents;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using System.Windows.Media.Imaging;
-    using System.Windows.Shapes;
-    using System.Windows.Threading;
-    using Microsoft.Activities.Presentation;
-    using Microsoft.VisualBasic.Activities;
-
-    partial class ImportDesigner
-    {
-        public static readonly DependencyProperty ContextProperty = DependencyProperty.Register(
-            "Context",
-            typeof(EditingContext),
-            typeof(ImportDesigner),
-            new FrameworkPropertyMetadata(null, new PropertyChangedCallback(OnContextChanged)));
-
-        const string ErrorMessagePropertyName = "ErrorMessage";
-        const string IsInvalidPropertyName = "IsInvalid";
-
-        public EditingContext Context
-        {
-            get { return (EditingContext)GetValue(ContextProperty); }
-            set { SetValue(ContextProperty, value); }
-        }
-
-        TextBox textBox;
-        bool isSetInternally;
-        bool causedBySelectionChange;
-        bool isSelectedByMouse;
-        string lastInput;
-        int lastCursePosition;
-        bool firstShowUp;
-        string importsHintText;
-        ModelItem lastSelection;
-        SubscribeContextCallback<Selection> onItemSelectedCallback;
-        bool isSelectionChangedInternally;
-        FrameworkName targetFramework;
-
-        ImportedNamespaceContextItem importedNamespacesItem;
-        ModelItemCollection importsModelItem;
-        IDictionary<string, List<string>> availableNamespaces;
-        IDictionary<string, IDictionary<string, object>> attachedPropertiesForNamespace = new Dictionary<string, IDictionary<string, object>>();
-
-        ImportDesignerProxy proxy;
-
-        public ImportDesigner()
-        {
-            this.proxy = new ImportDesignerProxy(this);
-
-            InitializeComponent();
-            this.firstShowUp = true;
-            this.importsHintText = (string)this.FindResource("importsHintText");
-        }
-
-        SubscribeContextCallback<Selection> OnItemSelectedCallback
-        {
-            get
-            {
-                if (this.onItemSelectedCallback == null)
-                {
-                    this.onItemSelectedCallback = new SubscribeContextCallback<Selection>(this.OnItemSelected);
-                }
-                return this.onItemSelectedCallback;
-            }
-        }
-
-        protected override void OnInitialized(EventArgs e)
-        {
-            base.OnInitialized(e);
-            this.Unloaded += OnImportDesignerUnloaded;
-        }
-
-        void OnImportDesignerUnloaded(object sender, RoutedEventArgs e)
-        {
-            this.importsModelItem.CollectionChanged -= this.OnImportsModelItemCollectionChanged;
-            this.Unloaded -= this.OnImportDesignerUnloaded;
-        }
-
-        void OnInputComboBoxUnloaded(object sender, RoutedEventArgs e)
-        {
-            this.inputComboBox.Loaded -= this.OnInputComboBoxLoaded;
-            this.inputComboBox.SelectionChanged -= OnComboBoxSelectionChanged;
-            this.inputComboBox.Unloaded -= OnInputComboBoxUnloaded;
-
-            Fx.Assert(this.textBox != null, "ComboBox should contains a child of TextBox");
-            textBox.TextChanged -= OnTextChanged;
-            textBox.PreviewKeyUp -= OnPreviewKeyUp;
-            textBox.IsKeyboardFocusedChanged -= OnTextBoxIsKeyboardFocusedChanged;
-            AppDomain.CurrentDomain.AssemblyLoad -= this.proxy.OnAssemblyLoad;
-        }
-
-        void OnInputComboBoxLoaded(object sender, RoutedEventArgs e)
-        {
-            this.textBox = this.inputComboBox.Template.FindName("PART_EditableTextBox", this.inputComboBox) as TextBox;
-            this.textBox.TextChanged += new TextChangedEventHandler(OnTextChanged);
-            this.textBox.PreviewKeyUp += new KeyEventHandler(OnPreviewKeyUp);
-            this.textBox.IsKeyboardFocusedChanged += new DependencyPropertyChangedEventHandler(OnTextBoxIsKeyboardFocusedChanged);
-            this.textBox.IsUndoEnabled = false;
-
-            this.isSetInternally = true;
-            this.textBox.Foreground = SystemColors.GrayTextBrush;
-            this.textBox.FontStyle = FontStyles.Italic;
-            this.textBox.Text = this.importsHintText;
-            this.isSetInternally = false;
-
-            this.inputComboBox.SelectionChanged += new SelectionChangedEventHandler(OnComboBoxSelectionChanged);
-        }
-
-        void OnTextBoxIsKeyboardFocusedChanged(object sender, DependencyPropertyChangedEventArgs e)
-        {
-            TextBox inputTextBox = sender as TextBox;
-            Fx.Assert(inputTextBox != null, "Sender of IsKeyboardFocusedChanged event should be a TextBox");
-
-            if (!this.isSetInternally)
-            {
-                if ((bool)e.NewValue == true)
-                {
-                    this.isSetInternally = true;
-                    inputTextBox.FontStyle = FontStyles.Normal;
-                    inputTextBox.Foreground = SystemColors.ControlTextBrush;
-                    if (inputTextBox.Text == this.importsHintText)
-                    {
-                        inputTextBox.Text = string.Empty;
-                        inputTextBox.CaretIndex = 0;
-                    }
-                    this.isSetInternally = false;
-                }
-                else if (string.IsNullOrEmpty(inputTextBox.Text))
-                {
-                    this.isSetInternally = true;
-                    inputTextBox.Text = this.importsHintText;
-                    inputTextBox.Foreground = SystemColors.GrayTextBrush;
-                    inputTextBox.FontStyle = FontStyles.Italic;
-                    this.isSetInternally = false;
-                }
-            }
-        }
-
-        protected override void OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs e)
-        {
-            IIntegratedHelpService helpService = this.Context.Services.GetService<IIntegratedHelpService>();
-            if (helpService != null)
-            {
-                if ((Boolean)e.NewValue)
-                {
-                    this.isSelectionChangedInternally = true;
-                    this.Context.Items.SetValue(new Selection());
-                    this.isSelectionChangedInternally = false;
-                    helpService.AddContextAttribute(string.Empty, WorkflowViewManager.GetF1HelpTypeKeyword(typeof(ImportDesigner)), System.ComponentModel.Design.HelpKeywordType.F1Keyword);
-                }
-                else
-                {
-                    helpService.RemoveContextAttribute(string.Empty, WorkflowViewManager.GetF1HelpTypeKeyword(typeof(ImportDesigner)));
-                }
-            }
-            base.OnIsKeyboardFocusWithinChanged(e);
-        }
-
-        void OnVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
-        {
-            if (bool.Equals(true, e.NewValue))
-            {
-                StoreLastSelection();
-                this.Context.Items.Subscribe<Selection>(this.OnItemSelectedCallback);
-                if (this.firstShowUp)
-                {
-                    this.firstShowUp = false;
-                    this.inputComboBox.Loaded += this.OnInputComboBoxLoaded;
-                    this.inputComboBox.Unloaded += this.OnInputComboBoxUnloaded;
-
-                    this.inputComboBox.ItemsSource = this.availableNamespaces.Keys;
-                    this.inputComboBox.Items.SortDescriptions.Add(new SortDescription("", ListSortDirection.Ascending));
-                    this.inputComboBox.Items.Filter += this.FilterPredicate;
-                    this.importedNamespacesDataGrid.Items.SortDescriptions.Add(new SortDescription(NamespaceListPropertyDescriptor.NamespacePropertyName, ListSortDirection.Ascending));
-                    this.importedNamespacesDataGrid.ItemsSource = this.importsModelItem;
-                    this.importedNamespacesDataGrid.SelectionChanged += this.OnImportedNamespacesDataGridSelectionChanged;
-                }
-            }
-            else
-            {
-                RestoreLastSelection();
-                this.Context.Items.Unsubscribe<Selection>(this.OnItemSelectedCallback);
-            }
-        }
-
-        void RestoreLastSelection()
-        {
-            if ((this.Context != null) && (this.lastSelection != null))
-            {
-                this.Context.Items.SetValue(new Selection(this.lastSelection));
-            }
-        }
-
-        void StoreLastSelection()
-        {
-            if (this.Context != null)
-            {
-                this.lastSelection = this.Context.Items.GetValue<Selection>().PrimarySelection;
-            }
-        }
-
-        void OnImportedNamespacesDataGridSelectionChanged(object sender, SelectionChangedEventArgs e)
-        {
-            DataGrid importsDataGrid = sender as DataGrid;
-            importsDataGrid.CanUserDeleteRows = true;
-            foreach (object item in importsDataGrid.SelectedItems)
-            {
-                ModelItem import = item as ModelItem;
-                if ((import != null) && !((bool)import.Properties[IsInvalidPropertyName].ComputedValue))
-                {
-                    importsDataGrid.CanUserDeleteRows = false;
-                    break;
-                }
-            }
-        }
-
-        void CommitImportNamespace(string addedNamespace)
-        {
-            ModelItem importItem;
-            if (!TryGetWrapper(addedNamespace, out importItem))
-            {
-                NamespaceData newImport = new NamespaceData { Namespace = addedNamespace };
-                importItem = this.importsModelItem.Add(newImport);
-            }
-            this.importedNamespacesDataGrid.SelectedItem = importItem;
-            this.importedNamespacesDataGrid.ScrollIntoView(importItem);
-            this.textBox.Text = string.Empty;
-        }
-
-        void OnPreviewKeyUp(object sender, KeyEventArgs args)
-        {
-            switch (args.Key)
-            {
-                case Key.Enter:
-                    if (this.inputComboBox.SelectedItem != null)
-                    {
-                        CommitImportNamespace(this.inputComboBox.SelectedItem.ToString());
-                    }
-                    break;
-                case Key.Down:
-                    if (!this.inputComboBox.IsDropDownOpen)
-                    {
-                        this.inputComboBox.IsDropDownOpen = true;
-                    }
-                    break;
-                default: break;
-            }
-        }
-
-        bool TryGetWrapper(string imported, out ModelItem importItem)
-        {
-            importItem = null;
-            foreach (ModelItem item in this.importsModelItem)
-            {
-                NamespaceData importedNamespace = item.GetCurrentValue() as NamespaceData;
-                Fx.Assert(importedNamespace != null, "element of import list model has to be NamespaceData");
-                if (importedNamespace.Namespace == imported)
-                {
-                    importItem = item;
-                    return true;
-                }
-            }
-
-            return false;
-        }
-
-        void OnImportsModelItemCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
-        {
-            if (e.Action == NotifyCollectionChangedAction.Add)
-            {
-                foreach (ModelItem namespaceModel in e.NewItems)
-                {
-                    ValidateNamespaceModelAndUpdateContextItem(namespaceModel);
-                }
-            }
-            else if (e.Action == NotifyCollectionChangedAction.Remove)
-            {
-                foreach (ModelItem namespaceModel in e.OldItems)
-                {
-                    NamespaceData namespaceData = namespaceModel.GetCurrentValue() as NamespaceData;
-                    Fx.Assert(namespaceData != null, "added item has to be NamespaceData");
-
-                    this.importedNamespacesItem.ImportedNamespaces.Remove(namespaceData.Namespace);
-                    this.attachedPropertiesForNamespace.Remove(namespaceData.Namespace);
-                }
-            }
-
-            UpdateExpressionEditors();
-        }
-
-        private void ValidateNamespaceModelAndUpdateContextItem(ModelItem namespaceModel)
-        {
-            NamespaceData namespaceData = namespaceModel.GetCurrentValue() as NamespaceData;
-            Fx.Assert(namespaceData != null, "added item has to be NamespaceData");
-
-            if (!this.availableNamespaces.ContainsKey(namespaceData.Namespace))
-            {
-                namespaceModel.Properties[ErrorMessagePropertyName].SetValue(string.Format(CultureInfo.CurrentCulture, SR.CannotResolveNamespace, namespaceData.Namespace));
-                namespaceModel.Properties[IsInvalidPropertyName].SetValue(true);
-            }
-            else
-            {
-                namespaceModel.Properties[ErrorMessagePropertyName].SetValue(string.Empty);
-                namespaceModel.Properties[IsInvalidPropertyName].SetValue(false);
-                this.importedNamespacesItem.ImportedNamespaces.Add(namespaceData.Namespace);
-            }
-        }
-
-        private void UpdateExpressionEditors()
-        {
-            AssemblyContextControlItem assemblies = this.Context.Items.GetValue<AssemblyContextControlItem>();
-            IExpressionEditorService expressionEditorService = this.Context.Services.GetService<IExpressionEditorService>();
-            if (expressionEditorService != null)
-            {
-                expressionEditorService.UpdateContext(assemblies, this.importedNamespacesItem);
-            }
-        }
-
-        void OnComboBoxSelectionChanged(object sender, SelectionChangedEventArgs args)
-        {
-            if (!this.isSetInternally)
-            {
-                if (this.isSelectedByMouse)
-                {
-                    CommitImportNamespace(this.inputComboBox.SelectedItem.ToString());
-                    this.isSelectedByMouse = false;
-                }
-                else
-                {
-                    this.causedBySelectionChange = true;
-                }
-            }
-        }
-
-        bool FilterPredicate(object value)
-        {
-            // We don't like nulls.
-            if (value == null)
-                return false;
-
-
-            if (string.IsNullOrEmpty(this.lastInput))
-                return true;
-
-            return value.ToString().StartsWith(this.lastInput, StringComparison.OrdinalIgnoreCase);
-        }
-
-        void OnTextChanged(object sender, TextChangedEventArgs args)
-        {
-            if (!this.isSetInternally)
-            {
-                this.lastInput = this.textBox.Text.Trim();
-                this.lastCursePosition = this.textBox.CaretIndex;
-
-                this.isSetInternally = true;
-
-                if (this.causedBySelectionChange)
-                {
-                    this.causedBySelectionChange = false;
-                }
-                else
-                {
-                    Fx.Assert(this.inputComboBox.ItemsSource != null, "combo box's source must already be initialized when textbox is running");
-                    CollectionViewSource.GetDefaultView(this.inputComboBox.ItemsSource).Refresh();
-
-                    if (this.lastInput.Length > 0)
-                    {
-                        this.inputComboBox.IsDropDownOpen = true;
-                        foreach (object item in CollectionViewSource.GetDefaultView(this.inputComboBox.ItemsSource))
-                        {
-                            this.inputComboBox.SelectedItem = null;
-                            this.inputComboBox.SelectedItem = item;
-                            break;
-                        }
-                    }
-                    else
-                    {
-                        this.inputComboBox.IsDropDownOpen = false;
-                        this.inputComboBox.SelectedItem = null;
-                    }
-                }
-
-                this.textBox.Text = this.lastInput;
-                this.textBox.CaretIndex = this.lastCursePosition;
-
-                this.isSetInternally = false;
-            }
-        }
-
-        void OnMouseLeftClickComboBoxItem(object sender, MouseButtonEventArgs e)
-        {
-            ComboBoxItem comboBoxItem = sender as ComboBoxItem;
-            if (comboBoxItem != null)
-            {
-                this.isSetInternally = true;
-                string userInput = this.textBox.Text;
-                this.inputComboBox.SelectedItem = null;
-                this.textBox.Text = userInput;
-                this.isSetInternally = false;
-                this.isSelectedByMouse = true;
-            }
-        }
-
-        static void OnContextChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
-        {
-            ((ImportDesigner)sender).OnContextChanged();
-        }
-
-        void OnContextChanged()
-        {
-            this.targetFramework = WorkflowDesigner.GetTargetFramework(this.Context);
-
-            AttachedPropertiesService attachedPropertyService = this.Context.Services.GetService<AttachedPropertiesService>();
-            Fx.Assert(attachedPropertyService != null, "AttachedPropertiesService shouldn't be null in EditingContext.");
-            attachedPropertyService.AddProperty(CreateAttachedPropertyForNamespace<string>(ErrorMessagePropertyName));
-            attachedPropertyService.AddProperty(CreateAttachedPropertyForNamespace<bool>(IsInvalidPropertyName));
-            //clear any defaults because it's meant to be set by host and not serialized to XAML
-            VisualBasicSettings.Default.ImportReferences.Clear();
-
-            ModelService modelService = this.Context.Services.GetService<ModelService>();
-            Fx.Assert(modelService != null, "ModelService shouldn't be null in EditingContext.");
-            Fx.Assert(modelService.Root != null, "model must have a root");
-            this.importsModelItem = modelService.Root.Properties[NamespaceListPropertyDescriptor.ImportCollectionPropertyName].Collection;
-            Fx.Assert(this.importsModelItem != null, "root must have imports");
-            this.importsModelItem.CollectionChanged += this.OnImportsModelItemCollectionChanged;
-
-            this.importedNamespacesItem = this.Context.Items.GetValue<ImportedNamespaceContextItem>();
-            this.importedNamespacesItem.EnsureInitialized(this.Context);
-
-            if (this.availableNamespaces == null)
-            {
-                //change to available namespace should not be a model change so we access the dictionary directly
-                this.availableNamespaces = this.importsModelItem.Properties[NamespaceListPropertyDescriptor.AvailableNamespacesPropertyName].ComputedValue as Dictionary<string, List<string>>;
-                Fx.Assert(this.availableNamespaces != null, "Available namespace dictionary is not in right format");
-            }
-            RefreshNamespaces();
-        }
-
-        void OnItemSelected(Selection newSelection)
-        {
-            if ((!this.Context.Services.GetService<UndoEngine>().IsUndoRedoInProgress) && (!this.isSelectionChangedInternally))
-            {
-                StoreLastSelection();
-            }
-        }
-
-        AttachedProperty<T> CreateAttachedPropertyForNamespace<T>(string propertyName)
-        {
-            return new AttachedProperty<T>
-            {
-                Getter = (modelItem) =>
-                {
-                    NamespaceData data = modelItem.GetCurrentValue() as NamespaceData;
-                    if (data == null)
-                    {
-                        return default(T);
-                    }
-
-                    IDictionary<string, object> properties;
-                    if (!this.attachedPropertiesForNamespace.TryGetValue(data.Namespace, out properties))
-                    {
-                        return default(T);
-                    }
-
-                    object propertyValue;
-                    if (!properties.TryGetValue(propertyName, out propertyValue))
-                    {
-                        return default(T);
-                    }
-
-                    return (T)propertyValue;
-                },
-
-                Setter = (modelItem, propertyValue) =>
-                {
-                    NamespaceData data = modelItem.GetCurrentValue() as NamespaceData;
-                    if (data == null)
-                    {
-                        return;
-                    }
-
-                    IDictionary<string, object> properties;
-                    if (!this.attachedPropertiesForNamespace.TryGetValue(data.Namespace, out properties))
-                    {
-                        properties = new Dictionary<string, object>();
-                        this.attachedPropertiesForNamespace[data.Namespace] = properties;
-                    }
-
-                    properties[propertyName] = propertyValue;
-                },
-                Name = propertyName,
-                OwnerType = typeof(NamespaceData),
-                IsBrowsable = true,
-            };
-        }
-
-        private void RefreshNamespaces()
-        {
-            GetAvailableNamespaces();
-            ValidateImportedNamespaces();
-        }
-
-        internal void OnReferenceUpdated(AssemblyName updatedReference, bool isAdded)
-        {
-            if (this.availableNamespaces != null)
-            {
-                IMultiTargetingSupportService multiTargetingService = this.Context.Services.GetService<IMultiTargetingSupportService>();
-                Assembly assembly = AssemblyContextControlItem.GetAssembly(updatedReference, multiTargetingService);
-                Fx.Assert(assembly != null, "Assembly shouldn't be null here.");
-                // In normal case, assembly shouldn't be null. In case there's any situation we're overlooked, we should ignore instead of throwing exceptions.
-                if (assembly != null)
-                {
-                    OnReferenceUpdated(assembly, isAdded);
-                }             
-            }
-        }
-
-        private void OnReferenceUpdated(Assembly assembly, bool isAdded)
-        {
-            if (this.availableNamespaces != null)
-            {
-                if (isAdded)
-                {
-                    try
-                    {
-                        UpdateAvailableNamespaces(assembly, null);
-                    }
-                    catch (FileNotFoundException)
-                    {
-                    }
-                }
-                else
-                {
-                    try
-                    {
-                        string name = assembly.GetName().Name;
-                        IEnumerable<string> namespaces = this.GetUniqueNamespacesInAssembly(assembly, null);
-                        foreach (string ns in namespaces)
-                        {
-                            if (!string.IsNullOrEmpty(ns))
-                            {
-                                List<string> assemblyList;
-                                if (this.availableNamespaces.TryGetValue(ns, out assemblyList))
-                                {
-                                    assemblyList.Remove(name);
-                                    if (assemblyList.Count == 0)
-                                    {
-                                        this.availableNamespaces.Remove(ns);
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    catch (FileNotFoundException)
-                    {
-                        //If removed reference assembly is not there anymore, scan new list of referenced assemblies and refresh the list
-                        this.GetAvailableNamespaces();
-                    }
-                }
-                
-                if (this.inputComboBox.ItemsSource != null)
-                {
-                    // This following refresh action may cause ComboBox selection/text changed. Need to restore back to what input by users after refresh is done.
-                    this.isSetInternally = true;
-                    string originalText = this.textBox.Text;
-                    int originalCursePosition = this.textBox.CaretIndex;
-
-                    try
-                    {                          
-                        CollectionViewSource.GetDefaultView(this.inputComboBox.ItemsSource).Refresh();                        
-                    }
-                    catch (TargetInvocationException)
-                    {
-                        // TargetInvocationException may thrown out when assembly is loaded while ComboBox is refreshing and we call Refresh again, see CSDMain:213478
-                        // Catch the exception here and ignore it
-                    }
-                    finally
-                    {
-                        this.textBox.Text = lastInput;
-                        this.textBox.CaretIndex = originalCursePosition;
-                        this.isSetInternally = false;
-                    }
-                }
-
-                ValidateImportedNamespaces();
-            }
-        }
-
-        //When assemblyContextItem is null, it means the assembly cannot be local assembly
-        private void UpdateAvailableNamespaces(Assembly assembly, AssemblyContextControlItem assemblyContextItem)
-        {
-            string assemblyName = assembly.GetName().Name;
-            IEnumerable<string> namespaces = this.GetUniqueNamespacesInAssembly(assembly, assemblyContextItem);
-            foreach (string ns in namespaces)
-            {
-                if (!string.IsNullOrEmpty(ns))
-                {
-                    List<string> assemblyList;
-                    if (!this.availableNamespaces.TryGetValue(ns, out assemblyList))
-                    {
-                        assemblyList = new List<string> { assemblyName };
-                        this.availableNamespaces.Add(ns, assemblyList);
-                    }
-                    else if (!assemblyList.Contains(assemblyName))
-                    {
-                        assemblyList.Add(assemblyName);
-                    }
-                }
-            }
-        }
-
-        //When assemblyContextItem is null, it means the assembly cannot be local assembly
-        IEnumerable<string> GetUniqueNamespacesInAssembly(Assembly assembly, AssemblyContextControlItem assemblyContextItem)
-        {
-            IEnumerable<Type> types = null;
-            //we should only display namespaces for public types except the local assembly
-            if ((assemblyContextItem != null) && (assemblyContextItem.LocalAssemblyName != null) && (assembly.FullName == assemblyContextItem.LocalAssemblyName.FullName))
-            {
-                types = assembly.GetTypes();
-            }
-            else
-            {
-                types = assembly.GetExportedTypes();
-            }
-
-            HashSet<string> namespaces = new HashSet<string>();
-            if (types != null)
-            {
-                foreach (Type type in types)
-                {
-                    string ns = type.Namespace;
-                    if (!namespaces.Contains(ns))
-                    {
-                        namespaces.Add(ns);
-                    }
-                }
-            }
-
-            return namespaces;
-        }
-
-        void GetAvailableNamespaces()
-        {
-            Fx.Assert(this.availableNamespaces != null, "available namespace table should have been set before calling this method");
-            AssemblyContextControlItem assemblyItem = this.Context.Items.GetValue<AssemblyContextControlItem>();
-            if (assemblyItem != null)
-            {
-                IMultiTargetingSupportService multiTargetingService = this.Context.Services.GetService<IMultiTargetingSupportService>();
-
-                ////When ReferencedAssemblyNames is null, it's in rehost scenario. And we need to preload assemblies in 
-                ////TextExpression.ReferencesForImplementation/References if there is any. So that these assemblies will be returned
-                ////by AssemblyContextControlItem.GetEnvironmentAssemblies and user can see namespaces defined in these assemlbies 
-                ////in the dropdown list of Import Designer.
-                if ((assemblyItem.ReferencedAssemblyNames == null) && (this.targetFramework.Is45OrHigher()))
-                {
-                    ModelTreeManager modelTreeManager = this.Context.Services.GetService<ModelTreeManager>();
-                    object root = modelTreeManager.Root.GetCurrentValue();
-                    IList<AssemblyReference> references;
-                    NamespaceHelper.GetTextExpressionNamespaces(root, out references);
-                    foreach (AssemblyReference reference in references)
-                    {
-                        reference.LoadAssembly();
-                    }
-                }
-
-                IEnumerable<Assembly> allAssemblies = assemblyItem.GetEnvironmentAssemblies(multiTargetingService);
-                if (assemblyItem.LocalAssemblyName != null)
-                {
-                    allAssemblies = allAssemblies.Union<Assembly>(new Collection<Assembly> { 
-                        AssemblyContextControlItem.GetAssembly(assemblyItem.LocalAssemblyName, multiTargetingService)
-                    });
-                }
-
-                foreach (Assembly assembly in allAssemblies)
-                {
-                    try
-                    {
-                        if (assembly != null)
-                        {
-                            Fx.Assert(!assembly.IsDynamic, "there should not be any dynamic assemblies in reference list");
-                            this.UpdateAvailableNamespaces(assembly, assemblyItem);
-                        }
-                    }
-                    catch (ReflectionTypeLoadException)
-                    {
-                    }
-                    catch (FileNotFoundException)
-                    {
-                    }
-                }
-
-                if (assemblyItem.LocalAssemblyName == null)
-                {
-                    AppDomain.CurrentDomain.AssemblyLoad += this.proxy.OnAssemblyLoad;
-                }
-            }
-        }
-
-        void OnAssemblyLoad(object sender, AssemblyLoadEventArgs args)
-        {
-            if (!args.LoadedAssembly.IsDynamic)
-            {
-                this.Dispatcher.BeginInvoke(new Action(() => { this.OnReferenceUpdated(args.LoadedAssembly, true); }), DispatcherPriority.Send);
-            }
-        }
-
-        void ValidateImportedNamespaces()
-        {
-            this.importedNamespacesItem.ImportedNamespaces.Clear();
-            foreach (ModelItem namespaceModel in this.importsModelItem)
-            {
-                ValidateNamespaceModelAndUpdateContextItem(namespaceModel);
-            }
-
-            UpdateExpressionEditors();
-        }
-
-        //Helper function used by other components if need to update import context item
-        public static void AddImport(string importedNamespace, EditingContext editingContext)
-        {
-            //For types defined without any namespace, Type.Namespace is null instead of empty. We don't need to add any namespace to Import list in this case
-            if (string.IsNullOrEmpty(importedNamespace))
-            {
-                return;
-            }
-
-            Fx.Assert(editingContext != null, "EditingContext shouldn't be null.");
-            ModelService modelService = editingContext.Services.GetService<ModelService>();
-            Fx.Assert(modelService != null, "EditingContext should contains ModelService.");
-            ModelItemCollection importsCollection = modelService.Root.Properties[NamespaceListPropertyDescriptor.ImportCollectionPropertyName].Collection;
-            NamespaceList namespaceList = importsCollection.GetCurrentValue() as NamespaceList;
-            if (namespaceList.Lookup(importedNamespace) == -1)
-            {
-                importsCollection.Add(new NamespaceData { Namespace = importedNamespace });
-            }
-            else
-            {
-                namespaceList.UpdateAssemblyInfo(importedNamespace);
-            }
-        }
-
-        private sealed class ImportDesignerProxy
-        {
-            private WeakReference reference;
-
-            public ImportDesignerProxy(ImportDesigner importDesigner)
-            {
-                this.reference = new WeakReference(importDesigner);
-            }
-
-            public void OnAssemblyLoad(object sender, AssemblyLoadEventArgs args)
-            {
-                ImportDesigner importDesigner = this.reference.Target as ImportDesigner;
-                if (importDesigner != null)
-                {
-                    importDesigner.OnAssemblyLoad(sender, args);
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ImportedNamespaceContextItem.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ImportedNamespaceContextItem.cs
deleted file mode 100644 (file)
index 3df1368..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Hosting
-{
-    using System;    
-    using System.Runtime;
-    using System.Collections.ObjectModel;
-    using System.Activities.Presentation.Services;
-    using System.Activities.Presentation.Model;
-
-    
-    [Fx.Tag.XamlVisible(false)]
-    public sealed class ImportedNamespaceContextItem : ContextItem
-    {
-        bool initialized = false;
-        Collection<string> importedNamespaces;
-
-        public Collection<string> ImportedNamespaces
-        {
-            get
-            {
-                if (this.importedNamespaces == null)
-                {
-                    initialized = true;
-                    this.importedNamespaces = new Collection<string>();
-                }
-                return this.importedNamespaces;
-            }
-        }
-
-        public override Type ItemType
-        {
-            get { return typeof(ImportedNamespaceContextItem); }
-        }
-
-        public void EnsureInitialized(EditingContext context)
-        {
-            if (!initialized)
-            {
-                ModelService modelService = context.Services.GetService<ModelService>();                
-                Fx.Assert(modelService != null, "ModelService shouldn't be null in EditingContext.");
-                Fx.Assert(modelService.Root != null, "model must have a root");
-                ModelItemCollection importsModelItem = modelService.Root.Properties[NamespaceListPropertyDescriptor.ImportCollectionPropertyName].Collection;
-                Fx.Assert(importsModelItem != null, "root must have imports");                
-                foreach (ModelItem import in importsModelItem)
-                {
-                    this.ImportedNamespaces.Add(import.Properties[NamespaceListPropertyDescriptor.NamespacePropertyName].ComputedValue as string);
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ModelPropertyPathExpanderConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ModelPropertyPathExpanderConverter.cs
deleted file mode 100644 (file)
index 75d40d9..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using System.Activities.Presentation.Model;
-    using System.Globalization;
-    using System.Text;
-    using System.Windows.Data;
-
-    sealed class ModelPropertyPathExpanderConverter : IValueConverter 
-    {
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            string result = null;
-
-            if (value != null)
-            {
-                ModelPropertyEntry modelPropertyEntry = value as ModelPropertyEntry;
-                if (modelPropertyEntry != null)
-                {
-                    StringBuilder propertyPath = new StringBuilder(modelPropertyEntry.PropertyName);
-                    propertyPath.Insert(0, '.');
-
-                    ModelProperty property = modelPropertyEntry.FirstModelProperty;
-                    if (property != null)
-                    {
-                        ModelItem convertedValue = property.Parent;
-                        while (convertedValue != null && !typeof(Activity).IsAssignableFrom(convertedValue.ItemType))
-                        {
-                            if (null != convertedValue.Source)
-                            {
-                                propertyPath.Insert(0, convertedValue.Source.Name);
-                                propertyPath.Insert(0, '.');
-                            }
-                            convertedValue = convertedValue.Parent;
-                        }
-                    }
-                    propertyPath.Remove(0, 1);
-                    result = propertyPath.ToString();
-                }
-            }
-            return result;
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError( new NotSupportedException(SR.NonSupportedModelPropertyPathExpanderConverterConvertBack));
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/NamespaceDisplay.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/NamespaceDisplay.xaml.cs
deleted file mode 100644 (file)
index c5c016e..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-using System.Windows.Automation.Peers;
-
-namespace System.Activities.Presentation.View
-{
-    /// <summary>
-    /// Interaction logic for NamespaceDisplay.xaml
-    /// </summary>
-    partial class NamespaceDisplay : UserControl
-    {
-        public static readonly DependencyProperty NamespaceProperty = DependencyProperty.Register(
-            "Namespace",
-            typeof(string),
-            typeof(NamespaceDisplay));
-
-        public static readonly DependencyProperty IsInvalidProperty = DependencyProperty.Register(
-            "IsInvalid",
-            typeof(bool),
-            typeof(NamespaceDisplay));
-
-        public static readonly DependencyProperty ErrorMessageProperty = DependencyProperty.Register(
-            "ErrorMessage",
-            typeof(string),
-            typeof(NamespaceDisplay));
-
-        public NamespaceDisplay()
-        {
-            InitializeComponent();
-        }
-
-        public string Namespace
-        {
-            get { return (string)GetValue(NamespaceProperty); }
-            set { SetValue(NamespaceProperty, value); }
-        }
-
-        public bool IsInvalid
-        {
-            get { return (bool)GetValue(IsInvalidProperty); }
-            set { SetValue(IsInvalidProperty, value); }
-        }
-
-        public string ErrorMessage
-        {
-            get { return (string)GetValue(ErrorMessageProperty); }
-            set { SetValue(ErrorMessageProperty, value); }
-        }
-
-        protected override AutomationPeer OnCreateAutomationPeer()
-        {
-            return new NamespaceDisplayAutomationPeer(this);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/NamespaceDisplayAutomationPeer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/NamespaceDisplayAutomationPeer.cs
deleted file mode 100644 (file)
index 302aeef..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows.Automation.Peers;
-using System.Windows;
-using System.Runtime.InteropServices;
-using System.Xml.Linq;
-using System.Globalization;
-using System.Runtime;
-
-namespace System.Activities.Presentation.View
-{
-    [Fx.Tag.XamlVisible(false)]
-    class NamespaceDisplayAutomationPeer : UIElementAutomationPeer
-    {
-        public NamespaceDisplayAutomationPeer(NamespaceDisplay owner)
-            : base(owner)
-        {
-        }
-
-        protected override string GetItemStatusCore()
-        {
-            NamespaceDisplay namespaceDisplay = this.Owner as NamespaceDisplay;
-            if (namespaceDisplay != null)
-            {
-                XElement itemStatus = new XElement("NamespaceStatus",
-                    new XAttribute("Status", namespaceDisplay.IsInvalid ? "Invalid" : "Valid"),
-                    new XAttribute("ErrorMessage", namespaceDisplay.ErrorMessage));
-                return itemStatus.ToString();
-            }
-            return base.GetItemStatusCore();
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/NoContextMenuGrid.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/NoContextMenuGrid.cs
deleted file mode 100644 (file)
index 29cda85..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Windows.Controls;
-
-    internal class NoContextMenuGrid : Grid
-    {
-        protected override void OnContextMenuOpening(ContextMenuEventArgs e)
-        {
-            e.Handled = true;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/OutlineView/HidePropertyInOutlineViewAttribute.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/OutlineView/HidePropertyInOutlineViewAttribute.cs
deleted file mode 100644 (file)
index 2369eaa..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View.OutlineView
-{
-    using System;
-
-    /// <summary>
-    /// Hides the property in outline view.
-    /// </summary>
-    [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
-    public sealed class HidePropertyInOutlineViewAttribute : Attribute
-    {
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/OutlineView/ShowInOutlineViewAttribute.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/OutlineView/ShowInOutlineViewAttribute.cs
deleted file mode 100644 (file)
index 9e5dce2..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View.OutlineView
-{
-    using System;
-
-    /// <summary>
-    /// Shows instances of this class in outline view.
-    /// </summary>
-    [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)]
-    public sealed class ShowInOutlineViewAttribute : Attribute
-    {
-        /// <summary>
-        /// Gets or sets this specify property name to be shown in place of the current
-        /// ModelItem
-        /// </summary>    
-        public string PromotedProperty { get; set; }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/OutlineView/ShowPropertyInOutlineViewAsSiblingAttribute.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/OutlineView/ShowPropertyInOutlineViewAsSiblingAttribute.cs
deleted file mode 100644 (file)
index b487fd8..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View.OutlineView
-{
-    using System;
-
-    /// <summary>
-    /// Shows the property value as silbling of current instance in outline view.
-    /// </summary>
-    [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
-    public sealed class ShowPropertyInOutlineViewAsSiblingAttribute : Attribute
-    {
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/OutlineView/ShowPropertyInOutlineViewAttribute.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/OutlineView/ShowPropertyInOutlineViewAttribute.cs
deleted file mode 100644 (file)
index 0328d9e..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View.OutlineView
-{
-    using System;
-
-    /// <summary>
-    /// Shows the property and its value in outline view.
-    /// </summary>
-    [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
-    public sealed class ShowPropertyInOutlineViewAttribute : Attribute
-    {
-        /// <summary>
-        /// Initialize the instance of ShowPropertyInOutlineViewAttribute.
-        /// </summary>
-        public ShowPropertyInOutlineViewAttribute()          
-        {
-            this.CurrentPropertyVisible = true;
-            this.DuplicatedChildNodesVisible = true;
-        }
-
-        /// <summary>
-        /// Gets or sets a value indicating whether the property should be visible in outline view.
-        /// </summary>        
-        public bool CurrentPropertyVisible { get; set; }
-        
-        /// <summary>
-        /// Gets or sets a value indicating whether to skip child nodes that are visible elsewhere in the outline view
-        /// </summary>
-        public bool DuplicatedChildNodesVisible { get; set; }
-
-        /// <summary>
-        /// Gets or sets a value indicating whether to display a perfix of child node.
-        /// </summary>
-        public string ChildNodePrefix { get; set; }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ParserContext.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ParserContext.cs
deleted file mode 100644 (file)
index ea02c63..0000000
+++ /dev/null
@@ -1,295 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using Microsoft.VisualBasic.Activities;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Xaml;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Globalization;
-    using System.Linq;
-    using System.Reflection;
-    using System.Runtime;
-    using System.Windows.Markup;
-    using System.Xaml;
-
-
-
-    class ParserContext : LocationReferenceEnvironment, IValueSerializerContext, IXamlNameResolver, INamespacePrefixLookup, IXamlNamespaceResolver
-    {
-        ModelItem baseModelItem;
-        EditingContext context;
-        IDictionary<string, string> namespaceLookup;
-
-        public ParserContext()
-        {
-        }
-
-        public ParserContext(ModelItem modelItem)
-        {
-            this.Initialize(modelItem);
-        }
-
-        public IContainer Container
-        {
-            get { return null; }
-        }
-
-        public object Instance
-        {
-            get;
-            internal set;
-        }
-
-        public PropertyDescriptor PropertyDescriptor
-        {
-            get;
-            internal set;
-        }
-
-        public override Activity Root
-        {
-            get { return null; }
-        }
-
-        IDictionary<string, string> NamespaceLookup
-        {
-            get
-            {
-                if (this.namespaceLookup == null)
-                {
-                    this.namespaceLookup = new Dictionary<string, string>();
-                }
-                return this.namespaceLookup;
-            }
-        }
-
-        public bool Initialize(ModelItem modelItem)
-        {
-            this.baseModelItem = modelItem;
-            if (null != modelItem)
-            {
-                this.context = modelItem.GetEditingContext();
-            }
-            return (null != this.baseModelItem);
-        }
-
-        public override bool IsVisible(LocationReference reference)
-        {
-            object other = this.Resolve(reference.Name);
-            
-            return object.ReferenceEquals(other, reference);
-        }
-
-        public override bool TryGetLocationReference(string name, out LocationReference result)
-        {
-            result = (LocationReference)this.Resolve(name);
-            return result != null;
-        }
-
-
-        public string GetNamespace(string prefix)
-        {
-            var nameSpace = this.NamespaceLookup
-                .Where(p => string.Equals(p.Value, prefix))
-                .Select(p => p.Key)
-                .FirstOrDefault();
-
-            return nameSpace;
-        }
-        
-        public IEnumerable<NamespaceDeclaration> GetNamespacePrefixes()
-        {
-            List<NamespaceDeclaration> namespacePrefixes = new List<NamespaceDeclaration>();
-            LoadNameSpace(namespacePrefixes);
-            return namespacePrefixes;
-        }
-
-        public override IEnumerable<LocationReference> GetLocationReferences()
-        {
-            List<LocationReference> toReturn = new List<LocationReference>();
-            if (this.baseModelItem != null)
-            {
-                List<ModelItem> declaredVariables = VisualBasicEditor.GetVariablesInScope(this.baseModelItem);
-
-                foreach (ModelItem modelItem in declaredVariables)
-                {
-                    toReturn.Add(modelItem.GetCurrentValue() as LocationReference);
-                }
-            }
-            return toReturn;
-        }
-
-        public object Resolve(string name)
-        {
-            IEnumerable<LocationReference> variables = this.GetLocationReferences();
-            return variables.FirstOrDefault<LocationReference>(p =>
-            {
-                return p != null && p.Name != null && p.Name.Equals(name);
-            });
-        }
-        
-        public object Resolve(string name, out bool isFullyInitialized)
-        {
-            object result = Resolve(name);
-            isFullyInitialized = (result != null);
-            return result;
-        }
-
-        public bool IsFixupTokenAvailable
-        {
-            get
-            {
-                
-                return false;
-            }
-        }
-
-        internal IEnumerable<string> Namespaces
-        {
-            get
-            {
-                var namespacesToReturn = new HashSet<string>();
-                //combine default import namespaces
-                foreach (var import in VisualBasicSettings.Default.ImportReferences)
-                {
-                    namespacesToReturn.Add(import.Import);
-                }
-                //with custom ones, defined in user provided assemblies
-                if (null != this.namespaceLookup)
-                {
-                    foreach (var nameSpace in this.namespaceLookup.Keys)
-                    {
-                        //out of full namespace declaration (i.e. "clr-namespace:<namespace>;assembly=<assembly>"
-                        //get clear namespace name
-                        int startIndex = nameSpace.IndexOf(":", StringComparison.Ordinal);
-                        int endIndex = nameSpace.IndexOf(";", StringComparison.Ordinal);
-                        if (startIndex >= 0 && endIndex >= 0)
-                        {
-                            string clrNamespace = nameSpace.Substring(startIndex + 1, endIndex - startIndex - 1);
-                            namespacesToReturn.Add(clrNamespace);
-                        }
-                    }
-                }
-
-                ImportedNamespaceContextItem importedNamespaces = this.context.Items.GetValue<ImportedNamespaceContextItem>();
-                namespacesToReturn.UnionWith(importedNamespaces.ImportedNamespaces);
-                //return all namespaces
-                return namespacesToReturn;
-            }
-        }
-
-        public object GetFixupToken(IEnumerable<string> names)
-        {
-            return null;
-        }
-
-        public object GetFixupToken(IEnumerable<string> names, bool canAssignDirectly)
-        {
-            return null;
-        }
-
-        public object GetService(Type serviceType)
-        {
-            if (serviceType == typeof(IXamlNameResolver)
-                || serviceType == typeof(INamespacePrefixLookup)
-                || serviceType == typeof(IXamlNamespaceResolver))
-            {
-                return this;
-            }
-            else
-            {
-                return null;
-            }
-        }
-
-        public ValueSerializer GetValueSerializerFor(Type type)
-        {
-            return null;
-        }
-
-        public ValueSerializer GetValueSerializerFor(PropertyDescriptor descriptor)
-        {
-            return null;
-        }
-
-        public string LookupPrefix(string ns)
-        {
-            //get reference to namespace lookup dictionary (create one if necessary)
-            var lookupTable = this.NamespaceLookup;
-            string prefix;
-            //check if given namespace is already registered
-            if (!lookupTable.TryGetValue(ns, out prefix))
-            {
-                //no, create a unique prefix
-                prefix = string.Format(CultureInfo.InvariantCulture, "__{0}", Guid.NewGuid().ToString().Replace("-", "").Substring(0, 5));
-                //and store value in the dictionary
-                lookupTable[ns] = prefix;
-            }
-            //return prefix
-            return prefix;
-        }
-
-        public void OnComponentChanged()
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-
-        public bool OnComponentChanging()
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-
-        void LoadNameSpace(List<NamespaceDeclaration> result)
-        {
-            if (null == this.context)
-            {
-                Fx.Assert("EditingContext is null");
-                return;
-            }
-            AssemblyContextControlItem assemblyContext = this.context.Items.GetValue<AssemblyContextControlItem>();
-            if (null == assemblyContext)
-            {
-                Fx.Assert("AssemblyContextControlItem not defined in EditingContext.Items");
-                return;
-            }
-            if (null != assemblyContext.LocalAssemblyName)
-            {
-                result.Add(GetEntry(assemblyContext.LocalAssemblyName));
-            }
-            if (null != assemblyContext.ReferencedAssemblyNames)
-            {
-                foreach (AssemblyName name in assemblyContext.ReferencedAssemblyNames)
-                {
-                    result.Add(GetEntry(name));
-                }
-            }
-        }
-
-        NamespaceDeclaration GetEntry(AssemblyName name)
-        {
-            string ns =
-                string.Format(CultureInfo.InvariantCulture, "clr-namespace:{0};assembly={1}",
-                Guid.NewGuid().ToString().Replace('-', '_'), name.Name);
-            return new NamespaceDeclaration(ns, Guid.NewGuid().ToString());
-        }     
-        
-        IEnumerable<KeyValuePair<string, object>> IXamlNameResolver.GetAllNamesAndValuesInScope()
-        {
-            return null;
-        }
-        
-        event EventHandler IXamlNameResolver.OnNameScopeInitializationComplete
-        {
-            add { }
-            remove { }
-        }
-
-    }
-
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/PropertyEntryToEditingContextConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/PropertyEntryToEditingContextConverter.cs
deleted file mode 100644 (file)
index a35c309..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-namespace System.Activities.Presentation.View
-{
-    using System.Windows.Data;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Converters;
-
-    class PropertyEntryToEditingContextConverter : IValueConverter
-    {
-        #region IValueConverter Members
-
-        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
-        {
-            PropertyEntry propertyEntry = value as PropertyEntry;
-            if (null == propertyEntry)
-            {
-                PropertyValue propertyValue = value as PropertyValue;
-                if (null != propertyValue)
-                {
-                    propertyEntry = propertyValue.ParentProperty;
-                }
-            }
-            return ModelPropertyEntryToOwnerActivityConverter.Convert(propertyEntry as ModelPropertyEntry, false).GetEditingContext();
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-
-        #endregion
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/PropertyEntryToEditorOptionConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/PropertyEntryToEditorOptionConverter.cs
deleted file mode 100644 (file)
index b293010..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Reflection;
-    using System.Windows.Data;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation.Internal.PropertyEditing.Model;
-    using System.Runtime;
-
-    sealed class PropertyEntryToEditorOptionConverter : IValueConverter
-    {
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            PropertyEntry propertyEntry = value as PropertyEntry;
-            if (null == propertyEntry)
-            {
-                PropertyValue propertyValue = value as PropertyValue;
-                if (null != propertyValue)
-                {
-                    propertyEntry = propertyValue.ParentProperty;
-                }
-            }
-
-            ModelPropertyEntry modelPropertyEntry = propertyEntry as ModelPropertyEntry;
-
-            ModelProperty modelProperty = null;
-            if (modelPropertyEntry != null)
-            {
-                modelProperty = modelPropertyEntry.FirstModelProperty;
-            }
-
-            if (modelProperty == null)
-            {
-                return Binding.DoNothing;
-            }
-
-            string optionName = parameter as string;
-            if (optionName == null)
-            {
-                return Binding.DoNothing;
-            }
-
-            object optionValue;
-            if (EditorOptionAttribute.TryGetOptionValue(modelProperty.Attributes, optionName, out optionValue))
-            {
-                return optionValue;
-            }
-
-            return Binding.DoNothing;
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            // It is simply impossible to convert back.
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/QuadTree.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/QuadTree.cs
deleted file mode 100644 (file)
index 9c06779..0000000
+++ /dev/null
@@ -1,653 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Diagnostics;
-    using System.IO;
-    using System.Windows;
-    using System.Runtime;
-#if DEBUG_DUMP
-    using System.Windows.Controls;
-    using System.Windows.Shapes;
-    using System.Windows.Media;
-    using System.Xml;
-#endif
-
-
-    /// <summary>
-    /// This class efficiently stores and retrieves arbitrarily sized and positioned
-    /// objects in a quad-tree data structure.  This can be used to do efficient hit
-    /// detection or visiblility checks on objects in a virtualized canvas.
-    /// The object does not need to implement any special interface because the Rect Bounds
-    /// of those objects is handled as a separate argument to Insert.
-    /// </summary>
-    class QuadTree<T> where T : class
-    {
-        Rect bounds; // overall bounds we are indexing.
-        Quadrant root;
-        IDictionary<T, Quadrant> table;
-
-
-
-        /// <summary>
-        /// This determines the overall quad-tree indexing strategy, changing this bounds
-        /// is expensive since it has to re-divide the entire thing - like a re-hash operation.
-        /// </summary>
-        public Rect Bounds
-        {
-            get { return this.bounds; }
-            set { this.bounds = value; ReIndex(); }
-        }
-
-        /// <summary>
-        /// Insert a node with given bounds into this QuadTree.
-        /// </summary>
-        /// <param name="node">The node to insert</param>
-        /// <param name="bounds">The bounds of this node</param>
-        public void Insert(T node, Rect bounds)
-        {
-            if (this.bounds.Width == 0 || this.bounds.Height == 0)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException(SR.BoundsMustBeNonZero));
-            }
-            if (bounds.Width == 0 || bounds.Height == 0)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException(SR.BoundsMustBeNonZero));
-            }
-            if (this.root == null)
-            {
-                this.root = new Quadrant(null, this.bounds);
-            }
-
-            Quadrant parent = this.root.Insert(node, bounds);
-
-            if (this.table == null)
-            {
-                this.table = new Dictionary<T, Quadrant>();
-            }
-            this.table[node] = parent;
-
-
-        }
-
-        /// <summary>
-        /// Get a list of the nodes that intersect the given bounds.
-        /// </summary>
-        /// <param name="bounds">The bounds to test</param>
-        /// <returns>List of zero or mode nodes found inside the given bounds</returns>
-        public IEnumerable<T> GetNodesInside(Rect bounds)
-        {
-            foreach (QuadNode n in GetNodes(bounds))
-            {
-                yield return n.Node;
-            }
-        }
-
-        /// <summary>
-        /// Get a list of the nodes that intersect the given bounds.
-        /// </summary>
-        /// <param name="bounds">The bounds to test</param>
-        /// <returns>List of zero or mode nodes found inside the given bounds</returns>
-        public bool HasNodesInside(Rect bounds)
-        {
-            if (this.root == null)
-            {
-                return false;                
-            }
-            return this.root.HasIntersectingNodes(bounds);
-        }
-
-        /// <summary>
-        /// Get list of nodes that intersect the given bounds.
-        /// </summary>
-        /// <param name="bounds">The bounds to test</param>
-        /// <returns>The list of nodes intersecting the given bounds</returns>
-        IEnumerable<QuadNode> GetNodes(Rect bounds)
-        {
-            List<QuadNode> result = new List<QuadNode>();
-            if (this.root != null)
-            {
-                this.root.GetIntersectingNodes(result, bounds);
-            }
-            return result;
-        }
-
-        /// <summary>
-        /// Remove the given node from this QuadTree.
-        /// </summary>
-        /// <param name="node">The node to remove</param>
-        /// <returns>True if the node was found and removed.</returns>
-        public bool Remove(T node)
-        {
-            if (this.table != null)
-            {
-                Quadrant parent = null;
-                if (this.table.TryGetValue(node, out parent))
-                {
-                    parent.RemoveNode(node);
-                    this.table.Remove(node);
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        /// <summary>
-        /// Rebuild all the Quadrants according to the current QuadTree Bounds.
-        /// </summary>
-        void ReIndex()
-        {
-            this.root = null;
-            foreach (QuadNode n in GetNodes(this.bounds))
-            {
-                Insert(n.Node, n.Bounds);
-            }
-        }
-
-        /// <summary>
-        /// Each node stored in the tree has a position, width & height.
-        /// </summary>
-        internal class QuadNode
-        {
-            Rect bounds;
-            QuadNode next; // linked in a circular list.
-            T node; // the actual visual object being stored here.
-
-            /// <summary>
-            /// Construct new QuadNode to wrap the given node with given bounds
-            /// </summary>
-            /// <param name="node">The node</param>
-            /// <param name="bounds">The bounds of that node</param>
-            public QuadNode(T node, Rect bounds)
-            {
-                this.node = node;
-                this.bounds = bounds;
-            }
-
-            /// <summary>
-            /// The node
-            /// </summary>
-            public T Node
-            {
-                get { return this.node; }
-                set { this.node = value; }
-            }
-
-            /// <summary>
-            /// The Rect bounds of the node
-            /// </summary>
-            public Rect Bounds
-            {
-                get { return this.bounds; }
-            }
-
-            /// <summary>
-            /// QuadNodes form a linked list in the Quadrant.
-            /// </summary>
-            public QuadNode Next
-            {
-                get { return this.next; }
-                set { this.next = value; }
-            }
-        }
-
-
-        /// <summary>
-        /// The canvas is split up into four Quadrants and objects are stored in the quadrant that contains them
-        /// and each quadrant is split up into four child Quadrants recurrsively.  Objects that overlap more than
-        /// one quadrant are stored in the this.nodes list for this Quadrant.
-        /// </summary>
-        internal class Quadrant
-        {
-            Quadrant parent;
-            Rect bounds; // quadrant bounds.
-
-            QuadNode nodes; // nodes that overlap the sub quadrant boundaries.
-
-            // The quadrant is subdivided when nodes are inserted that are 
-            // completely contained within those subdivisions.
-            Quadrant topLeft;
-            Quadrant topRight;
-            Quadrant bottomLeft;
-            Quadrant bottomRight;
-
-#if DEBUG_DUMP
-            public void ShowQuadTree(Canvas c)
-            {
-                Rectangle r = new Rectangle();
-                r.Width = this.bounds.Width;
-                r.Height = this.bounds.Height;
-                Canvas.SetLeft(r, this.bounds.Left);
-                Canvas.SetTop(r, this.bounds.Top);
-                r.Stroke = Brushes.DarkRed;
-                r.StrokeThickness = 1;
-                r.StrokeDashArray = new DoubleCollection(new double[] { 2.0, 3.0 });
-                c.Children.Add(r);
-
-                if (this.topLeft != null) this.topLeft.ShowQuadTree(c);
-                if (this.topRight != null) this.topRight.ShowQuadTree(c);
-                if (this.bottomLeft != null) this.bottomLeft.ShowQuadTree(c);
-                if (this.bottomRight != null) this.bottomRight.ShowQuadTree(c);
-            }
-
-            public void Dump(LogWriter w)
-            {
-                w.WriteAttribute("Bounds", this.bounds.ToString());
-                if (this.nodes != null)
-                {
-                    QuadNode n = this.nodes;
-                    do
-                    {
-                        n = n.Next; // first node.
-                        w.Open("node");
-                        w.WriteAttribute("Bounds", n.Bounds.ToString());
-                        w.Close();
-                    } while (n != this.nodes);
-                }
-                DumpQuadrant("TopLeft", this.topLeft, w);
-                DumpQuadrant("TopRight", this.topRight, w);
-                DumpQuadrant("BottomLeft", this.bottomLeft, w);
-                DumpQuadrant("BottomRight", this.bottomRight, w);
-            }
-
-            public void DumpQuadrant(string label, Quadrant q, LogWriter w)
-            {
-                if (q != null)
-                {
-                    w.Open("Quadrant");
-                    w.WriteAttribute("Name", label);
-                    q.Dump(w);
-                    w.Close();
-                }
-            }
-#endif
-
-            /// <summary>
-            /// Construct new Quadrant with a given bounds all nodes stored inside this quadrant
-            /// will fit inside this bounds.  
-            /// </summary>
-            /// <param name="parent">The parent quadrant (if any)</param>
-            /// <param name="bounds">The bounds of this quadrant</param>
-            public Quadrant(Quadrant parent, Rect bounds)
-            {
-                this.parent = parent;
-                Fx.Assert(bounds.Width != 0 && bounds.Height != 0, "Cannot have empty bound");
-                if (bounds.Width == 0 || bounds.Height == 0)
-                {
-                    throw FxTrace.Exception.AsError(new ArgumentException(SR.BoundsMustBeNonZero));
-                }
-                this.bounds = bounds;
-            }
-
-            /// <summary>
-            /// The parent Quadrant or null if this is the root
-            /// </summary>
-            internal Quadrant Parent
-            {
-                get { return this.parent; }
-            }
-
-            /// <summary>
-            /// The bounds of this quadrant
-            /// </summary>
-            internal Rect Bounds
-            {
-                get { return this.bounds; }
-            }
-
-            /// <summary>
-            /// Insert the given node
-            /// </summary>
-            /// <param name="node">The node </param>
-            /// <param name="bounds">The bounds of that node</param>
-            /// <returns></returns>
-            internal Quadrant Insert(T node, Rect bounds)
-            {
-
-                Fx.Assert(bounds.Width != 0 && bounds.Height != 0, "Cannot have empty bound");
-                if (bounds.Width == 0 || bounds.Height == 0)
-                {
-                    throw FxTrace.Exception.AsError(new ArgumentException(SR.BoundsMustBeNonZero));
-                }
-
-                Quadrant toInsert = this;
-                while (true)
-                {
-                    double w = toInsert.bounds.Width / 2;
-                    if (w < 1)
-                    {
-                        w = 1;
-                    }
-                    double h = toInsert.bounds.Height / 2;
-                    if (h < 1)
-                    {
-                        h = 1;
-                    }
-
-                    // assumption that the Rect struct is almost as fast as doing the operations
-                    // manually since Rect is a value type.
-
-                    Rect topLeft = new Rect(toInsert.bounds.Left, toInsert.bounds.Top, w, h);
-                    Rect topRight = new Rect(toInsert.bounds.Left + w, toInsert.bounds.Top, w, h);
-                    Rect bottomLeft = new Rect(toInsert.bounds.Left, toInsert.bounds.Top + h, w, h);
-                    Rect bottomRight = new Rect(toInsert.bounds.Left + w, toInsert.bounds.Top + h, w, h);
-
-                    Quadrant child = null;
-
-                    // See if any child quadrants completely contain this node.
-                    if (topLeft.Contains(bounds))
-                    {
-                        if (toInsert.topLeft == null)
-                        {
-                            toInsert.topLeft = new Quadrant(toInsert, topLeft);
-                        }
-                        child = toInsert.topLeft;
-                    }
-                    else if (topRight.Contains(bounds))
-                    {
-                        if (toInsert.topRight == null)
-                        {
-                            toInsert.topRight = new Quadrant(toInsert, topRight);
-                        }
-                        child = toInsert.topRight;
-                    }
-                    else if (bottomLeft.Contains(bounds))
-                    {
-                        if (toInsert.bottomLeft == null)
-                        {
-                            toInsert.bottomLeft = new Quadrant(toInsert, bottomLeft);
-                        }
-                        child = toInsert.bottomLeft;
-                    }
-                    else if (bottomRight.Contains(bounds))
-                    {
-                        if (toInsert.bottomRight == null)
-                        {
-                            toInsert.bottomRight = new Quadrant(toInsert, bottomRight);
-                        }
-                        child = toInsert.bottomRight;
-                    }
-
-                    if (child != null)
-                    {
-                        toInsert = child;
-                    }
-                    else
-                    {
-                        QuadNode n = new QuadNode(node, bounds);
-                        if (toInsert.nodes == null)
-                        {
-                            n.Next = n;
-                        }
-                        else
-                        {
-                            // link up in circular link list.
-                            QuadNode x = toInsert.nodes;
-                            n.Next = x.Next;
-                            x.Next = n;
-                        }
-                        toInsert.nodes = n;
-                        return toInsert;
-                    }
-                }
-            }
-
-            /// <summary>
-            /// Returns all nodes in this quadrant that intersect the given bounds.
-            /// The nodes are returned in pretty much random order as far as the caller is concerned.
-            /// </summary>
-            /// <param name="nodes">List of nodes found in the given bounds</param>
-            /// <param name="bounds">The bounds that contains the nodes you want returned</param>
-            internal void GetIntersectingNodes(List<QuadNode> nodes, Rect bounds)
-            {
-                if (bounds.IsEmpty) return;
-                double w = this.bounds.Width / 2;
-                double h = this.bounds.Height / 2;
-
-                // assumption that the Rect struct is almost as fast as doing the operations
-                // manually since Rect is a value type.
-
-                Rect topLeft = new Rect(this.bounds.Left, this.bounds.Top, w, h);
-                Rect topRight = new Rect(this.bounds.Left + w, this.bounds.Top, w, h);
-                Rect bottomLeft = new Rect(this.bounds.Left, this.bounds.Top + h, w, h);
-                Rect bottomRight = new Rect(this.bounds.Left + w, this.bounds.Top + h, w, h);
-
-                // See if any child quadrants completely contain this node.
-                if (topLeft.IntersectsWith(bounds) && this.topLeft != null)
-                {
-                    this.topLeft.GetIntersectingNodes(nodes, bounds);
-                }
-
-                if (topRight.IntersectsWith(bounds) && this.topRight != null)
-                {
-                    this.topRight.GetIntersectingNodes(nodes, bounds);
-                }
-
-                if (bottomLeft.IntersectsWith(bounds) && this.bottomLeft != null)
-                {
-                    this.bottomLeft.GetIntersectingNodes(nodes, bounds);
-                }
-
-                if (bottomRight.IntersectsWith(bounds) && this.bottomRight != null)
-                {
-                    this.bottomRight.GetIntersectingNodes(nodes, bounds);
-                }
-
-                GetIntersectingNodes(this.nodes, nodes, bounds);
-            }
-
-            /// <summary>
-            /// Walk the given linked list of QuadNodes and check them against the given bounds.
-            /// Add all nodes that intersect the bounds in to the list.
-            /// </summary>
-            /// <param name="last">The last QuadNode in a circularly linked list</param>
-            /// <param name="nodes">The resulting nodes are added to this list</param>
-            /// <param name="bounds">The bounds to test against each node</param>
-            static void GetIntersectingNodes(QuadNode last, List<QuadNode> nodes, Rect bounds)
-            {
-                if (last != null)
-                {
-                    QuadNode n = last;
-                    do
-                    {
-                        n = n.Next; // first node.
-                        if (n.Bounds.IntersectsWith(bounds))
-                        {
-                            nodes.Add(n);
-                        }
-                    } while (n != last);
-                }
-            }
-
-            /// <summary>
-            /// Return true if there are any nodes in this Quadrant that intersect the given bounds.
-            /// </summary>
-            /// <param name="bounds">The bounds to test</param>
-            /// <returns>boolean</returns>
-            internal bool HasIntersectingNodes(Rect bounds)
-            {
-                if (bounds.IsEmpty) return false;
-                double w = this.bounds.Width / 2;
-                double h = this.bounds.Height / 2;
-
-                // assumption that the Rect struct is almost as fast as doing the operations
-                // manually since Rect is a value type.
-
-                Rect topLeft = new Rect(this.bounds.Left, this.bounds.Top, w, h);
-                Rect topRight = new Rect(this.bounds.Left + w, this.bounds.Top, w, h);
-                Rect bottomLeft = new Rect(this.bounds.Left, this.bounds.Top + h, w, h);
-                Rect bottomRight = new Rect(this.bounds.Left + w, this.bounds.Top + h, w, h);
-
-                bool found = false;
-
-                // See if any child quadrants completely contain this node.
-                if (topLeft.IntersectsWith(bounds) && this.topLeft != null)
-                {
-                    found = this.topLeft.HasIntersectingNodes(bounds);
-                }
-
-                if (!found && topRight.IntersectsWith(bounds) && this.topRight != null)
-                {
-                    found = this.topRight.HasIntersectingNodes(bounds);
-                }
-
-                if (!found && bottomLeft.IntersectsWith(bounds) && this.bottomLeft != null)
-                {
-                    found = this.bottomLeft.HasIntersectingNodes(bounds);
-                }
-
-                if (!found && bottomRight.IntersectsWith(bounds) && this.bottomRight != null)
-                {
-                    found = this.bottomRight.HasIntersectingNodes(bounds);
-                }
-                if (!found)
-                {
-                    found = HasIntersectingNodes(this.nodes, bounds);
-                }
-                return found;
-            }
-
-            /// <summary>
-            /// Walk the given linked list and test each node against the given bounds/
-            /// </summary>
-            /// <param name="last">The last node in the circularly linked list.</param>
-            /// <param name="bounds">Bounds to test</param>
-            /// <returns>Return true if a node in the list intersects the bounds</returns>
-            static bool HasIntersectingNodes(QuadNode last, Rect bounds)
-            {
-                if (last != null)
-                {
-                    QuadNode n = last;
-                    do
-                    {
-                        n = n.Next; // first node.
-                        if (n.Bounds.IntersectsWith(bounds))
-                        {
-                            return true;
-                        }
-                    } while (n != last);
-                }
-                return false;
-            }
-
-            /// <summary>
-            /// Remove the given node from this Quadrant.
-            /// </summary>
-            /// <param name="node">The node to remove</param>
-            /// <returns>Returns true if the node was found and removed.</returns>
-            internal bool RemoveNode(T node)
-            {
-                bool rc = false;
-                if (this.nodes != null)
-                {
-                    QuadNode p = this.nodes;
-                    while (p.Next.Node != node && p.Next != this.nodes)
-                    {
-                        p = p.Next;
-                    }
-                    if (p.Next.Node == node)
-                    {
-                        rc = true;
-                        QuadNode n = p.Next;
-                        if (p == n)
-                        {
-                            // list goes to empty
-                            this.nodes = null;
-                        }
-                        else
-                        {
-                            if (this.nodes == n) this.nodes = p;
-                            p.Next = n.Next;
-                        }
-                    }
-                }
-                return rc;
-            }
-
-        }
-#if DEBUG_DUMP
-        public void ShowQuadTree(Canvas container)
-        {
-            if (this.root != null)
-            {
-                this.root.ShowQuadTree(container);
-            }
-        }
-
-        public void Dump(LogWriter w)
-        {
-            if (this.root != null)
-            {
-                this.root.Dump(w);
-            }
-        }
-#endif
-    }
-
-#if DEBUG_DUMP
-    public class LogWriter : IDisposable
-    {
-        XmlWriter xw;
-        int indent;
-        int maxdepth;
-
-        public LogWriter(TextWriter w)
-        {
-            XmlWriterSettings s = new XmlWriterSettings();
-            s.Indent = true;            
-            this.xw = XmlWriter.Create(w, s);
-        }
-
-        public int MaxDepth
-        {
-            get
-            {
-                return this.maxdepth;
-            }
-        }
-
-        public void Open(string label)
-        {
-            this.xw.WriteStartElement(label);
-            this.indent++;
-            if (this.indent > this.maxdepth) this.maxdepth = this.indent;
-
-        }
-        public void Close()
-        {
-            this.indent--;
-            this.xw.WriteEndElement();
-        }
-        public void WriteAttribute(string name, string value)
-        {
-            this.xw.WriteAttributeString(name, value);
-        }
-
-    #region IDisposable Members
-
-        public void Dispose()
-        {
-            Dispose(true);
-            GC.SuppressFinalize(this);
-        }
-
-        protected virtual void Dispose(bool disposing)
-        {
-            if (disposing && this.xw != null)
-            {
-                using (this.xw)
-                {
-                    this.xw.Flush();
-                }
-                this.xw = null;
-            }
-        }
-
-    #endregion
-    }
-#endif
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/RubberBandSelector.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/RubberBandSelector.cs
deleted file mode 100644 (file)
index 4da4c23..0000000
+++ /dev/null
@@ -1,339 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Activities.Presentation.Model;
-    using System.Collections.Generic;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Documents;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using System.Windows.Shapes;
-
-    internal sealed class RubberBandSelector
-    {
-        private const double RubberBandThickness = 2;
-        private EditingContext context;
-        private Rectangle rubberBand;
-        private List<WorkflowViewElement> views = new List<WorkflowViewElement>();
-
-        public RubberBandSelector(EditingContext context)
-        {
-            this.context = context;
-            this.InitializeRubberBand();
-        }
-
-        public bool IsSelected
-        {
-            get;
-            set;
-        }
-
-        // Relative to the scrollable content
-        private Point StartPoint
-        {
-            get;
-            set;
-        }
-
-        // Relative to the scrollable content
-        private Point EndPoint
-        {
-            get;
-            set;
-        }
-
-        // Relative to the scrollable content
-        private Point MouseDownPointToScreen { get; set; }
-
-        private bool IsSelecting
-        {
-            get
-            {
-                return this.ExtenstionSurface.Children.Contains(this.rubberBand);
-            }
-        }
-
-        private bool IsReadyForSelecting
-        {
-            get;
-            set;
-        }
-
-        private ExtensionSurface ExtenstionSurface
-        {
-            get
-            {
-                return this.Designer.wfViewExtensionSurface;
-            }
-        }
-
-        private DesignerView Designer
-        {
-            get
-            {
-                return this.context.Services.GetService<DesignerView>();
-            }
-        }
-
-        public void RegisterViewElement(WorkflowViewElement view)
-        {
-            if (!this.views.Contains(view))
-            {
-                this.views.Add(view);
-            }
-        }
-
-        public void UnregisterViewElement(WorkflowViewElement view)
-        {
-            if (this.views.Contains(view))
-            {
-                this.views.Remove(view);
-            }
-        }
-
-        public void OnScrollViewerMouseLeftButtonDown(MouseButtonEventArgs e)
-        {
-            this.IsSelected = false;
-
-            // Start rubber band selection if left button down is not handled by UI elements other than WorkflowViewElement.
-            if (!e.Handled || this.Designer.ShouldStillAllowRubberBandEvenIfMouseLeftButtonDownIsHandled)
-            {
-                if (DesignerView.IsMouseInViewport(e, this.Designer.scrollViewer) && !this.IsMouseOnDragHandle(e) && !this.IsMouseOverAdorner(e))
-                {
-                    this.IsReadyForSelecting = true;
-                    this.StartPoint = e.GetPosition(this.Designer.scrollableContent);
-
-                    this.MouseDownPointToScreen = this.Designer.scrollableContent.PointToScreen(this.StartPoint);
-                    this.EndPoint = this.StartPoint;
-                }
-            }
-        }
-
-        public void OnScrollViewerMouseMove(MouseEventArgs e)
-        {
-            if (e.LeftButton == MouseButtonState.Pressed && this.IsReadyForSelecting)
-            {
-                Point position = e.GetPosition(this.Designer.scrollableContent);
-                Point positionToScreen = this.Designer.scrollableContent.PointToScreen(position);
-                if (!this.IsSelecting && (Math.Abs(positionToScreen.X - this.MouseDownPointToScreen.X) > SystemParameters.MinimumHorizontalDragDistance ||
-                    Math.Abs(positionToScreen.Y - this.MouseDownPointToScreen.Y) > SystemParameters.MinimumVerticalDragDistance))
-                {
-                    this.AddRubberBand();
-                    if (!this.Designer.scrollableContent.IsMouseCaptured)
-                    {
-                        this.Designer.scrollableContent.CaptureMouse();
-                    }
-
-                    e.Handled = true;
-                }
-
-                if (this.IsSelecting)
-                {
-                    this.EndPoint = position;
-                    this.UpdateRubberBand();
-                    AutoScrollHelper.AutoScroll(e.GetPosition(this.Designer.scrollViewer), this.Designer.scrollViewer, 0.2);
-                    e.Handled = true;
-                }
-            }
-        }
-
-        public void OnScrollViewerPreviewMouseLeftButtonUp(MouseEventArgs e)
-        {
-            if (this.IsSelecting)
-            {
-                this.EndPoint = e.GetPosition(this.Designer.scrollableContent);
-                this.Select(Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl));
-                this.IsSelected = true;
-            }
-
-            this.StopSelecting();
-        }
-
-        public void OnScrollViewerMouseLeave()
-        {
-            this.StopSelecting();
-        }
-
-        public void OnScrollViewerEscapeKeyDown()
-        {
-            this.StopSelecting();
-        }
-
-        private static Point ClipPoint(Point point)
-        {
-            // Negative vaule means the top left corner of the rubber band is outside of the viewport. 
-            // We need to clip the rubber band since a very negative value will cause some WPF display issues.
-            // But we use -RubberBandThickness instead of 0 to clip so that the border of the rubber band that should be outside of the viewport is still outside.
-            return new Point(point.X < -RubberBandThickness ? -RubberBandThickness : point.X, point.Y < -RubberBandThickness ? -RubberBandThickness : point.Y);
-        }
-
-        private void StopSelecting()
-        {
-            this.IsReadyForSelecting = false;
-            if (this.IsSelecting)
-            {
-                this.RemoveRubberBand();
-                if (this.Designer.scrollableContent.IsMouseCaptured)
-                {
-                    this.Designer.scrollableContent.ReleaseMouseCapture();
-                }
-            }
-        }
-
-        private bool IsMouseOnDragHandle(MouseButtonEventArgs e)
-        {
-            HitTestResult result = VisualTreeHelper.HitTest(this.Designer.scrollableContent, e.GetPosition(this.Designer.scrollableContent));
-            if (result != null)
-            {
-                WorkflowViewElement view = VisualTreeUtils.FindVisualAncestor<WorkflowViewElement>(result.VisualHit);
-                if (view != null && view.DragHandle != null)
-                {
-                    GeneralTransform transform = view.DragHandle.TransformToAncestor(this.Designer);
-                    Fx.Assert(transform != null, "transform should not be null");
-                    Point topLeft = transform.Transform(new Point(0, 0));
-                    Point bottomRight = transform.Transform(new Point(view.DragHandle.ActualWidth, view.DragHandle.ActualHeight));
-                    Rect dragHandleRect = new Rect(topLeft, bottomRight);
-                    if (dragHandleRect.Contains(e.GetPosition(this.Designer)))
-                    {
-                        return true;
-                    }
-                }
-            }
-
-            return false;
-        }
-
-        private bool IsMouseOverAdorner(MouseButtonEventArgs e)
-        {
-            HitTestResult result = VisualTreeHelper.HitTest(this.Designer.scrollViewer, e.GetPosition(this.Designer.scrollViewer));
-            return result != null && VisualTreeUtils.FindVisualAncestor<Adorner>(result.VisualHit) != null;
-        }
-
-        private void AddRubberBand()
-        {
-            if (!this.ExtenstionSurface.Children.Contains(this.rubberBand))
-            {
-                this.ExtenstionSurface.Children.Add(this.rubberBand);
-            }
-            else
-            {
-                Fx.Assert(false, "Old rubber band was not correctly removed.");
-            }
-        }
-
-        private void RemoveRubberBand()
-        {
-            if (this.ExtenstionSurface.Children.Contains(this.rubberBand))
-            {
-                this.ExtenstionSurface.Children.Remove(this.rubberBand);
-            }
-            else
-            {
-                Fx.Assert(false, "Rubber band was not correctly added.");
-            }
-        }
-
-        private void UpdateRubberBand()
-        {
-            if (this.ExtenstionSurface.Children.Contains(this.rubberBand))
-            {
-                // Transform the start and end points to be relative to the extension surface by transforming to the common ancestor (DesignerView) first
-                GeneralTransform transform1 = this.Designer.scrollableContent.TransformToAncestor(this.Designer);
-                GeneralTransform transform2 = this.Designer.TransformToDescendant(this.ExtenstionSurface);
-                Point start = ClipPoint(transform2.Transform(transform1.Transform(this.StartPoint)));
-                Point end = ClipPoint(transform2.Transform(transform1.Transform(this.EndPoint)));
-                Rect rect = new Rect(start, end);
-                this.rubberBand.Width = rect.Width;
-                this.rubberBand.Height = rect.Height;
-                this.rubberBand.InvalidateVisual();
-                ExtensionSurface.SetPosition(this.rubberBand, rect.TopLeft);
-            }
-            else
-            {
-                Fx.Assert(false, "Rubber band was not correctly added.");
-            }
-        }
-
-        private void Select(bool isCtrlKeyDown)
-        {
-            bool isRubberBandEmpty = true;
-            Rect rubberBandRect = new Rect(this.StartPoint, this.EndPoint);
-            List<ModelItem> selectedModelItems = new List<ModelItem>();
-            foreach (WorkflowViewElement view in this.views)
-            {
-                GeneralTransform transform = view.TransformToAncestor(this.Designer.scrollableContent);
-                Point location = transform.Transform(new Point(0, 0));
-                Rect rect = new Rect(location.X, location.Y, view.ActualWidth, view.ActualHeight);
-                if (rubberBandRect.Contains(rect))
-                {
-                    isRubberBandEmpty = false;
-                    if (isCtrlKeyDown)
-                    {
-                        Selection.Toggle(this.context, view.ModelItem);
-                    }
-                    else
-                    {
-                        // Make sure the rubber-band selection has the same order
-                        // and keyboard focus as ctrl+click one by one, which 
-                        // 1) model item is added in reverse order
-                        // 2) last model item, which is the first in selection array,
-                        //    gets focus
-                        selectedModelItems.Insert(0, view.ModelItem);
-                    }
-                }
-            }
-
-            if (selectedModelItems.Count > 0)
-            {
-                Keyboard.Focus(selectedModelItems[0].View as IInputElement);
-                this.context.Items.SetValue(new Selection(selectedModelItems));
-            }
-
-            if (isRubberBandEmpty && !isCtrlKeyDown
-                && this.ShouldClearSelectioinIfNothingSelected())
-            {
-                this.context.Items.SetValue(new Selection());
-            }
-        }
-
-        private bool ShouldClearSelectioinIfNothingSelected()
-        {
-            Selection curSelection = this.context.Items.GetValue<Selection>();
-            if (curSelection == null || curSelection.SelectionCount == 0)
-            {
-                return false;
-            }
-
-            // only one ModelItem is selected and the ModelItem is root designer.
-            // do not clear selection
-            if (curSelection.SelectionCount == 1)
-            {
-                ModelItem item = curSelection.PrimarySelection;
-                WorkflowViewElement view = item == null ? null : (item.View as WorkflowViewElement);
-                if (view != null && view.IsRootDesigner)
-                {
-                    return false;
-                }
-            }
-
-            return true;
-        }
-
-        private void InitializeRubberBand()
-        {
-            this.rubberBand = new Rectangle();
-            this.rubberBand.StrokeThickness = RubberBandThickness;
-            this.rubberBand.Stroke = WorkflowDesignerColors.RubberBandRectangleBrush;
-            this.rubberBand.Fill = WorkflowDesignerColors.RubberBandRectangleBrush.Clone();
-            this.rubberBand.Fill.Opacity = 0.2;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ScrollViewerPanner.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ScrollViewerPanner.cs
deleted file mode 100644 (file)
index a2036ed..0000000
+++ /dev/null
@@ -1,327 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Input;
-    
-    internal class ScrollViewerPanner
-    {
-        private ScrollViewer scrollViewer;
-        private Point panningStartPosition;
-        private PanState currentPanState;
-        private bool inPanMode;
-        private MouseButton draggingMouseButton;        
-
-        public ScrollViewerPanner(ScrollViewer scrollViewer)
-        {
-            Fx.Assert(scrollViewer != null, "ScrollViewer should never be null");
-            this.ScrollViewer = scrollViewer;
-        }
-
-        internal enum PanState
-        {
-            Normal,     // Normal editing mode
-            ReadyToPan,
-            Panning,
-        }
-
-        public ScrollViewer ScrollViewer
-        {
-            get
-            {
-                return this.scrollViewer;
-            }
-
-            set
-            {
-                if (value != this.scrollViewer)
-                {
-                    if (this.scrollViewer != null)
-                    {
-                        this.UnregisterEvents();
-                    }
-
-                    this.scrollViewer = value;
-                    if (this.scrollViewer != null)
-                    {
-                        this.RegisterEvents();
-                    }
-                }
-            }
-        }
-
-        public bool InPanMode
-        {
-            get
-            {
-                return this.inPanMode;
-            }
-
-            set
-            {
-                if (this.inPanMode != value)
-                {
-                    this.inPanMode = value;
-                    if (this.inPanMode)
-                    {
-                        this.CurrentPanState = PanState.ReadyToPan;
-                    }
-                    else
-                    {
-                        this.CurrentPanState = PanState.Normal;
-                    }
-                }
-            }
-        }
-
-        public Cursor Hand { get; set; }
-
-        public Cursor DraggingHand { get; set; }
-
-        internal PanState CurrentPanState
-        {
-            get
-            {
-                return this.currentPanState;
-            }
-
-            set
-            {
-                if (this.currentPanState != value)
-                {
-                    this.currentPanState = value;
-                    switch (this.currentPanState)
-                    {
-                        case PanState.ReadyToPan:
-                            this.scrollViewer.Cursor = this.Hand;
-                            break;
-                        case PanState.Panning:
-                            this.scrollViewer.Cursor = this.DraggingHand;
-                            break;
-                        default:
-                            this.scrollViewer.Cursor = null;
-                            break;
-                    }
-
-                    this.UpdateForceCursorProperty();
-                }
-            }
-        }
-
-        internal bool IsInScrollableArea(Point mousePosition)
-        {
-            return mousePosition.X < this.scrollViewer.ViewportWidth && mousePosition.Y < this.scrollViewer.ViewportHeight;
-        }
-
-        internal void OnScrollViewerMouseDown(object sender, MouseButtonEventArgs e)
-        {
-            switch (this.CurrentPanState)
-            {
-                case PanState.Normal:
-                    if (e.ChangedButton == MouseButton.Middle)
-                    {
-                        this.StartPanningIfNecessary(e);
-                    }
-
-                    break;
-                case PanState.ReadyToPan:
-                    switch (e.ChangedButton)
-                    {
-                        case MouseButton.Left:
-                            this.StartPanningIfNecessary(e);
-                            break;
-                        case MouseButton.Middle:
-                            this.StartPanningIfNecessary(e);
-                            break;
-                        case MouseButton.Right:
-                            e.Handled = true;
-                            break;
-                    }
-
-                    break;
-                case PanState.Panning:
-                    e.Handled = true;
-                    break;
-                default:
-                    break;
-            }
-        }
-
-        internal void OnLostMouseCapture(object sender, MouseEventArgs e)
-        {
-            this.StopPanning();
-        }
-
-        internal void OnScrollViewerMouseMove(object sender, MouseEventArgs e)
-        {
-            switch (this.CurrentPanState)
-            {
-                case PanState.Panning:
-                    Point currentPosition = Mouse.GetPosition(this.scrollViewer);
-                    Vector offset = Point.Subtract(currentPosition, this.panningStartPosition);
-                    this.panningStartPosition = currentPosition;
-                    this.scrollViewer.ScrollToHorizontalOffset(this.scrollViewer.HorizontalOffset - offset.X);
-                    this.scrollViewer.ScrollToVerticalOffset(this.scrollViewer.VerticalOffset - offset.Y);
-                    e.Handled = true;
-                    break;
-                case PanState.ReadyToPan:
-                    this.UpdateForceCursorProperty();
-                    break;
-                default:
-                    break;
-            }
-        }
-
-        internal void OnScrollViewerMouseUp(object sender, MouseButtonEventArgs e)
-        {
-            switch (this.CurrentPanState)
-            {
-                case PanState.ReadyToPan:
-                    this.StopPanningIfNecessary(e);
-
-                    // When the mouse is captured by other windows/views, that
-                    // window/view needs this mouse-up message to release
-                    // the capture.                    
-                    if (!this.IsMouseCapturedByOthers())
-                    {
-                        e.Handled = true;
-                    }
-
-                    break;
-                case PanState.Panning:
-                    this.StopPanningIfNecessary(e);
-                    e.Handled = true;
-                    break;
-                default:
-                    break;
-            }
-        }
-
-        internal void OnScrollViewerKeyDown(object sender, KeyEventArgs e)
-        {
-            switch (this.CurrentPanState)
-            {
-                // Don't change to ReadyToPan mode if the space is a 
-                // repeated input, because repeated-key input may come 
-                // from activity element on the scroll view.
-                case PanState.Normal:
-                    if (e.Key == Key.Space 
-                        && !e.IsRepeat
-                        && this.AllowSwitchToPanning()) 
-                    {
-                        this.CurrentPanState = PanState.ReadyToPan;
-                    }
-
-                    break;
-                default:
-                    break;
-            }
-        }
-
-        internal void OnScrollViewerKeyUp(object sender, KeyEventArgs e)
-        {
-            switch (this.CurrentPanState)
-            {
-                case PanState.ReadyToPan:
-                    if (e.Key == Key.Space && !this.InPanMode)
-                    {
-                        this.CurrentPanState = PanState.Normal;
-                    }
-
-                    break;
-                default:
-                    break;
-            }
-        }
-
-        private void StartPanningIfNecessary(MouseButtonEventArgs e)
-        {
-            if (DesignerView.IsMouseInViewport(e, this.scrollViewer))
-            {
-                this.draggingMouseButton = e.ChangedButton;
-                this.CurrentPanState = PanState.Panning;
-                this.scrollViewer.Focus();
-                this.panningStartPosition = Mouse.GetPosition(this.scrollViewer);
-                Mouse.Capture(this.scrollViewer);
-                e.Handled = true;
-            }
-        }
-
-        private void StopPanningIfNecessary(MouseButtonEventArgs e)
-        {
-            if (e.ChangedButton == this.draggingMouseButton && object.Equals(this.scrollViewer, Mouse.Captured))
-            {
-                // Trigers OnLostMouseCapture
-                this.scrollViewer.ReleaseMouseCapture();
-            }
-        }
-
-        private void StopPanning()
-        {
-            // stop panning
-            if (this.InPanMode
-                || (Keyboard.IsKeyDown(Key.Space) && this.CurrentPanState == PanState.Panning))
-            {
-                this.CurrentPanState = PanState.ReadyToPan;
-            }
-            else
-            {
-                this.CurrentPanState = PanState.Normal;
-            }
-        }
-
-        private void UpdateForceCursorProperty()
-        {
-            Point pt = Mouse.GetPosition(this.ScrollViewer);
-            if (this.IsInScrollableArea(pt))
-            {
-                this.scrollViewer.ForceCursor = true;
-            }
-            else
-            {
-                this.scrollViewer.ForceCursor = false;
-            }
-        }
-
-        // Mouse is sometimes captured by ScrollViewer's children, like
-        // RepeatButton in Scroll Bar.
-        private bool IsMouseCapturedByOthers()
-        {
-            return (Mouse.Captured != null)
-                && !object.Equals(Mouse.Captured, this.ScrollViewer);
-        }
-
-        private bool AllowSwitchToPanning()
-        {
-            return Mouse.LeftButton == MouseButtonState.Released
-                && Mouse.RightButton == MouseButtonState.Released;
-        }
-
-        private void RegisterEvents()
-        {
-            this.scrollViewer.PreviewMouseDown  += new MouseButtonEventHandler(this.OnScrollViewerMouseDown);            
-            this.scrollViewer.PreviewMouseMove  += new MouseEventHandler(this.OnScrollViewerMouseMove);
-            this.scrollViewer.PreviewMouseUp    += new MouseButtonEventHandler(this.OnScrollViewerMouseUp);
-            this.scrollViewer.LostMouseCapture  += new MouseEventHandler(this.OnLostMouseCapture);
-            this.scrollViewer.KeyDown           += new KeyEventHandler(this.OnScrollViewerKeyDown);
-            this.scrollViewer.KeyUp             += new KeyEventHandler(this.OnScrollViewerKeyUp);
-        }
-
-        private void UnregisterEvents()
-        {
-            this.scrollViewer.PreviewMouseDown  -= new MouseButtonEventHandler(this.OnScrollViewerMouseDown);
-            this.scrollViewer.PreviewMouseMove  -= new MouseEventHandler(this.OnScrollViewerMouseMove);
-            this.scrollViewer.PreviewMouseUp    -= new MouseButtonEventHandler(this.OnScrollViewerMouseUp);
-            this.scrollViewer.LostMouseCapture  -= new MouseEventHandler(this.OnLostMouseCapture);
-            this.scrollViewer.KeyDown           -= new KeyEventHandler(this.OnScrollViewerKeyDown);
-            this.scrollViewer.KeyUp             -= new KeyEventHandler(this.OnScrollViewerKeyUp);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/SearchToolTipAdorner.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/SearchToolTipAdorner.cs
deleted file mode 100644 (file)
index a6573d4..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Activities.Presentation;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Documents;
-    using System.Windows.Media;
-    using System.Windows.Media.Effects;
-
-    class SearchToolTipAdorner : Adorner
-    {
-        Border tooltip;
-        double scrollViewerToScreenDistance;
-        public SearchToolTipAdorner(UIElement adornedElement, DesignerView designerView, string text)
-            : base(adornedElement)
-        {
-            this.scrollViewerToScreenDistance = designerView.ScrollViewer.PointToScreen(new Point(0, 0)).Y;;
-            tooltip = new Border
-            {
-                Background = new SolidColorBrush(WorkflowDesignerColors.DesignerViewBackgroundColor),
-                BorderBrush = new SolidColorBrush(WorkflowDesignerColors.WorkflowViewElementBorderColor),
-                BorderThickness = new Thickness(1),
-                CornerRadius = new CornerRadius(4),
-                Margin = new Thickness(10),
-                Child = new TextBlock
-                {
-                    Foreground = new SolidColorBrush(WorkflowDesignerColors.WorkflowViewElementCaptionColor),
-                    Margin = new Thickness(4, 0, 4, 0),
-                    MaxWidth = 300,
-                    Text = text,
-                    TextWrapping = TextWrapping.Wrap,
-                    TextTrimming = TextTrimming.CharacterEllipsis
-                },
-                Effect = new DropShadowEffect
-                {
-                    Color = Colors.Black,
-                    BlurRadius = 4,
-                    Opacity = 0.5
-                },
-            };
-            tooltip.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));
-        }
-
-        protected override void OnRender(DrawingContext drawingContext)
-        {
-            VisualBrush brush = new VisualBrush()
-            {
-                Visual = tooltip
-            };
-
-            double adornerElementToVisibleScrollViewDistance =
-                this.AdornedElement.PointToScreen(new Point(0, 0)).Y - this.scrollViewerToScreenDistance;
-            double Y = adornerElementToVisibleScrollViewDistance < tooltip.DesiredSize.Height ?
-                tooltip.DesiredSize.Height :
-                -tooltip.DesiredSize.Height;
-            Rect tooltipRect = new Rect(new Point(0, Y), tooltip.DesiredSize);
-            
-            Pen renderPen = new Pen();
-            drawingContext.DrawRectangle(brush, renderPen, tooltipRect);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/Selection.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/Selection.cs
deleted file mode 100644 (file)
index 43f2562..0000000
+++ /dev/null
@@ -1,367 +0,0 @@
-namespace System.Activities.Presentation.View {
-
-    using System.Runtime;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.Model;
-
-    using System.Activities.Presentation.Internal.Properties;
-
-    using System;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-
-    /// <summary>
-    /// The Selection class defines a selection of objects.  Selections
-    /// consist of zero or more objects.  The first object in a selection
-    /// is defined as the "primary" selection, which is used when
-    /// one object in a group must be used as a key.
-    /// </summary>
-    [SuppressMessage(FxCop.Category.Naming, "CA1724:TypeNamesShouldNotMatchNamespaces",
-        Justification = "Code imported from Cider; keeping changes to a minimum as it impacts xaml files as well")]
-    public class Selection : ContextItem
-    {
-
-        private ICollection<ModelItem> _selectedObjects;
-
-        /// <summary>
-        /// Creates an empty Selection object.
-        /// </summary>
-        public Selection() {
-            _selectedObjects = new ModelItem[0];
-        }
-
-        /// <summary>
-        /// Creates a collection object comprising the given
-        /// selected objects.  The first object in the enumeration
-        /// is considered the "primary" selection.
-        /// </summary>
-        /// <param name="selectedObjects">An enumeration of objects that should be selected.</param>
-        /// <exception cref="ArgumentNullException">If selectedObjects is null.</exception>
-        public Selection(IEnumerable<ModelItem> selectedObjects) {
-            if (selectedObjects == null) {
-                throw FxTrace.Exception.ArgumentNull("selectedObjects");
-            }
-
-            List<ModelItem> selection = new List<ModelItem>();
-            selection.AddRange(selectedObjects);
-            _selectedObjects = selection;
-        }
-
-        /// <summary>
-        /// Creates a collection object comprising the given
-        /// selected objects.  The first object in the enumeration
-        /// is considered the "primary" selection.
-        /// </summary>
-        /// <param name="selectedObjects">An enumeration of objects that should be selected.</param>
-        /// <param name="match">If provided, only those objects in selectedObjects that match the predicate will be added to the selection.</param>
-        /// <exception cref="ArgumentNullException">If selectedObjects or match is null.</exception>
-        public Selection(IEnumerable<ModelItem> selectedObjects, Predicate<ModelItem> match) {
-            if (selectedObjects == null) throw FxTrace.Exception.ArgumentNull("selectedObjects");
-            if (match == null) throw FxTrace.Exception.ArgumentNull("match");
-
-            List<ModelItem> selection = new List<ModelItem>();
-            foreach (ModelItem o in selectedObjects) {
-                if (match(o)) {
-                    selection.Add(o);
-                }
-            }
-
-            _selectedObjects = selection;
-        }
-
-        /// <summary>
-        /// Creates a collection object comprising the given
-        /// selected objects.  The first object in the enumeration
-        /// is considered the "primary" selection.
-        /// </summary>
-        /// <param name="selectedObjects">An enumeration of objects that should be selected.</param>
-        /// <exception cref="ArgumentNullException">If selectedObjects is null.</exception>
-        public Selection(IEnumerable selectedObjects) {
-            if (selectedObjects == null) throw FxTrace.Exception.ArgumentNull("selectedObjects");
-
-            List<ModelItem> selection = new List<ModelItem>();
-            foreach (object o in selectedObjects) {
-                ModelItem item = o as ModelItem;
-                if (item != null) {
-                    selection.Add(item);
-                }
-            }
-
-            _selectedObjects = selection;
-        }
-
-        /// <summary>
-        /// Creates a collection object comprising the given
-        /// selected objects.  The first object in the enumeration
-        /// is considered the "primary" selection.
-        /// </summary>
-        /// <param name="selectedObjects">An enumeration of objects that should be selected.</param>
-        /// <param name="match">If provided, only those objects in selectedObjects that match the predicate will be added to the selection.</param>
-        /// <exception cref="ArgumentNullException">If selectedObjects is null.</exception>
-        public Selection(IEnumerable selectedObjects, Predicate<ModelItem> match) {
-            if (selectedObjects == null) throw FxTrace.Exception.ArgumentNull("selectedObjects");
-            if (match == null) throw FxTrace.Exception.ArgumentNull("match");
-
-            List<ModelItem> selection = new List<ModelItem>();
-            foreach (object o in selectedObjects) {
-                ModelItem item = o as ModelItem;
-                if (item != null && match(item)) {
-                    selection.Add(item);
-                }
-            }
-
-            _selectedObjects = selection;
-        }
-
-        /// <summary>
-        /// Creates a collection object comprising the given
-        /// objects.  The first object is considered the "primary"
-        /// selection.
-        /// </summary>
-        /// <param name="selectedObjects">A parameter array of objects that should be selected.</param>
-        /// <exception cref="ArgumentNullException">If selectedObjects is null.</exception>
-        public Selection(params ModelItem[] selectedObjects)
-            : this((IEnumerable<ModelItem>)selectedObjects) {
-        }
-
-        /// <summary>
-        /// The primary selection.  Some functions require a "key"
-        /// element.  For example, an "align lefts" command needs
-        /// to know which element's "left" to align to.
-        /// </summary>
-        public ModelItem PrimarySelection {
-            get {
-                foreach (ModelItem obj in _selectedObjects) {
-                    return obj;
-                }
-
-                return null;
-            }
-        }
-
-        /// <summary>
-        /// The enumeration of selected objects.
-        /// </summary>
-        public IEnumerable<ModelItem> SelectedObjects {
-            get {
-                return _selectedObjects;
-            }
-        }
-
-        /// <summary>
-        /// The number of objects that are currently selected into
-        /// this selection.
-        /// </summary>
-        public int SelectionCount {
-            get { return _selectedObjects.Count; }
-        }
-
-        /// <summary>
-        /// Override of ContextItem's ItemType
-        /// property.  The ItemType of Selection is
-        /// always "typeof(Selection)".
-        /// </summary>
-        public sealed override Type ItemType {
-            get {
-                return typeof(Selection);
-            }
-        }
-        
-        
-        /// <summary>
-        /// Selection helper method.  This takes the existing selection in the
-        /// context and selects an item into it.  If the item is already in the
-        /// selection the selection is preserved and the item is promoted
-        /// to the primary selection.
-        /// </summary>
-        /// <param name="context">The editing context to apply this selection change to.</param>
-        /// <param name="itemToSelect">The item to select.</param>
-        /// <returns>A Selection object that contains the new selection.</returns>
-        /// <exception cref="ArgumentNullException">If context or itemToSelect is null.</exception>
-        public static Selection Select(EditingContext context, ModelItem itemToSelect) {
-
-            if (context == null) throw FxTrace.Exception.ArgumentNull("context");
-            if (itemToSelect == null) throw FxTrace.Exception.ArgumentNull("itemToSelect");
-
-            Selection existing = context.Items.GetValue<Selection>();
-
-            // short cut if we're already in the right state.
-            if (existing.PrimarySelection == itemToSelect) {
-                return existing;
-            }
-
-            Selection selection = null;
-
-            foreach (ModelItem obj in existing.SelectedObjects) {
-                if (obj == itemToSelect) {
-                    List<ModelItem> list = new List<ModelItem>(existing.SelectedObjects);
-                    list.Remove(itemToSelect);
-                    list.Insert(0, itemToSelect);
-                    selection = new Selection(list);
-                }
-            }
-
-            if (selection == null) {
-                selection = new Selection(itemToSelect);
-            }
-            
-            context.Items.SetValue(selection);
-            return selection;
-        }
-
-        /// <summary>
-        /// Selection helper method.  This sets itemToSelect into the selection.
-        /// Any existing items are deselected.
-        /// </summary>
-        /// <param name="context">The editing context to apply this selection change to.</param>
-        /// <param name="itemToSelect">The item to select.</param>
-        /// <returns>A Selection object that contains the new selection.</returns>
-        /// <exception cref="ArgumentNullException">If context or itemToSelect is null.</exception>
-        public static Selection SelectOnly(EditingContext context, ModelItem itemToSelect) {
-
-            if (context == null) throw FxTrace.Exception.ArgumentNull("context");
-            if (itemToSelect == null) throw FxTrace.Exception.ArgumentNull("itemToSelect");
-
-            // Check to see if only this object is selected.  If so, bail.
-            Selection existing = context.Items.GetValue<Selection>();
-            if (existing.PrimarySelection == itemToSelect) {
-                IEnumerator<ModelItem> en = existing.SelectedObjects.GetEnumerator();
-                en.MoveNext();
-                if (!en.MoveNext()) {
-                    return existing;
-                }
-            }
-
-            DesignerPerfEventProvider designerPerfEventProvider = context.Services.GetService<DesignerPerfEventProvider>();
-            if (designerPerfEventProvider != null)
-            {
-                designerPerfEventProvider.SelectionChangedStart();
-            }
-
-            Selection selection = new Selection(itemToSelect);
-            context.Items.SetValue(selection);
-            return selection;
-        }
-
-        /// <summary>
-        /// Helper method that subscribes to selection change events.
-        /// </summary>
-        /// <param name="context">The editing context to listen to.</param>
-        /// <param name="handler">The handler to be invoked when the selection changes.</param>
-        public static void Subscribe(EditingContext context, SubscribeContextCallback<Selection> handler) {
-            if (context == null) throw FxTrace.Exception.ArgumentNull("context");
-            if (handler == null) throw FxTrace.Exception.ArgumentNull("handler");
-            context.Items.Subscribe<Selection>(handler);
-        }
-
-        /// <summary>
-        /// Selection helper method.  This takes the existing selection in the
-        /// context and creates a new selection that contains the toggled
-        /// state of the item.  If the item is to be
-        /// added to the selection, it is added as the primary selection.
-        /// </summary>
-        /// <param name="context">The editing context to apply this selection change to.</param>
-        /// <param name="itemToToggle">The item to toggle selection for.</param>
-        /// <returns>A Selection object that contains the new selection.</returns>
-        /// <exception cref="ArgumentNullException">If context or itemToToggle is null.</exception>
-        public static Selection Toggle(EditingContext context, ModelItem itemToToggle) {
-            
-            if (context == null) throw FxTrace.Exception.ArgumentNull("context");
-            if (itemToToggle == null) throw FxTrace.Exception.ArgumentNull("itemToToggle");
-
-            Selection existing = context.Items.GetValue<Selection>();
-
-            // Is the item already in the selection?  If so, remove it.
-            // If not, add it to the beginning.
-
-            List<ModelItem> list = new List<ModelItem>(existing.SelectedObjects);
-            if (list.Contains(itemToToggle)) {
-                list.Remove(itemToToggle);
-            }
-            else {
-                list.Insert(0, itemToToggle);
-            }
-
-            Selection selection = new Selection(list);
-            context.Items.SetValue(selection);
-            return selection;
-        }
-
-        /// <summary>
-        /// Selection helper method.  This takes the existing selection in the
-        /// context and creates a new selection that contains the original
-        /// selection and the itemToAdd.  If itemToAdd is already in the 
-        /// original selection it is promoted to the primary selection.
-        /// </summary>
-        /// <param name="context">The editing context to apply this selection change to.</param>
-        /// <param name="itemToAdd">The item to add to the selection.</param>
-        /// <returns>A Selection object that contains the new selection.</returns>
-        /// <exception cref="ArgumentNullException">If context or itemToAdd is null.</exception>
-        public static Selection Union(EditingContext context, ModelItem itemToAdd) {
-
-            if (context == null) throw FxTrace.Exception.ArgumentNull("context");
-            if (itemToAdd == null) throw FxTrace.Exception.ArgumentNull("itemToAdd");
-
-            Selection existing = context.Items.GetValue<Selection>();
-
-            // short cut if we're already in the right state.
-            if (existing.PrimarySelection == itemToAdd) {
-                return existing;
-            }
-
-            // Is the item already in the selection?  If not, add it.
-            List<ModelItem> list = new List<ModelItem>(existing.SelectedObjects);
-            if (list.Contains(itemToAdd)) {
-                list.Remove(itemToAdd);
-            }
-
-            list.Insert(0, itemToAdd);
-            Selection selection = new Selection(list);
-            context.Items.SetValue(selection);
-            return selection;
-        }
-
-        internal static bool MultipleObjectsSelected(EditingContext context)
-        {
-            Selection selection = context.Items.GetValue<Selection>();
-            if (selection != null && selection.SelectionCount > 1)
-            {
-                return true;
-            }
-            return false;
-        }
-
-        internal static bool IsSelection(ModelItem item)
-        {
-            PropertyDescriptor descriptor = TypeDescriptor.GetProperties(item)["IsSelection"];
-            if (descriptor != null)
-            {
-                return (bool)descriptor.GetValue(item);
-            }
-            return false;
-        }
-
-        internal static bool IsPrimarySelection(ModelItem item)
-        {
-            PropertyDescriptor descriptor = TypeDescriptor.GetProperties(item)["IsPrimarySelection"];
-            if (descriptor != null)
-            {
-                return (bool)descriptor.GetValue(item);
-            }
-            return false;
-        }
-
-        /// <summary>
-        /// Helper method that removes a previously added selection change event.
-        /// </summary>
-        /// <param name="context">The editing context to listen to.</param>
-        /// <param name="handler">The handler to be invoked when the selection changes.</param>
-        public static void Unsubscribe(EditingContext context, SubscribeContextCallback<Selection> handler) {
-            if (context == null) throw FxTrace.Exception.ArgumentNull("context");
-            if (handler == null) throw FxTrace.Exception.ArgumentNull("handler");
-            context.Items.Unsubscribe<Selection>(handler);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/SpacerPlaceholder.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/SpacerPlaceholder.xaml.cs
deleted file mode 100644 (file)
index 5672d7b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System;    
-    using System.Windows;
-    using System.Windows.Controls;
-    
-    internal partial class SpacerPlaceholder : UserControl
-    {
-        public SpacerPlaceholder()
-        {
-            this.InitializeComponent();
-        }
-
-        public bool TargetVisiable
-        {
-            set 
-            {
-                if (value == true)
-                {
-                    this.dropTarget.Visibility = Visibility.Visible;
-                }
-                else
-                {
-                    this.dropTarget.Visibility = Visibility.Collapsed;
-                }
-            }
-        }
-
-        protected override void OnDrop(DragEventArgs e)
-        {
-            this.TargetVisiable = false;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/ChangeNotificationTracker.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/ChangeNotificationTracker.cs
deleted file mode 100644 (file)
index af7aaaa..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View.TreeView
-{
-    using System;
-    using System.Activities.Presentation.Model;
-    using System.Collections.Generic;
-    using System.Collections.Specialized;
-
-    class ChangeNotificationTracker
-    {
-        private bool? delayUpdates = null;
-
-        public ModelProperty ParentProperty { get; set; }
-        public Dictionary<ModelItem, HashSet<string>> TrackedModelItem { get; set; }
-        public List<INotifyCollectionChanged> TrackedCollection { get; set; }
-        public List<TreeViewItemViewModel> ChildViewModels { get; set; }
-
-        public TreeViewItemViewModel Parent { get; private set; }
-
-        // Guard to delay processing events while handling another event
-        private bool? DelayUpdates
-        {
-            get
-            {
-                return this.delayUpdates;
-            }
-
-            set
-            {
-                bool? oldDelayUpdates = this.delayUpdates;
-                this.delayUpdates = value;
-
-                // If necessary, perform delayed updates when initial handling completes
-                if (null == this.delayUpdates && null != oldDelayUpdates && (bool)oldDelayUpdates)
-                {
-                    // We do not preserve args of events that occurred within a handler
-                    // Fortunately EventArgs parameter to UpdateChildren() is presently unused
-                    // Pass null to fast-fail if this parameter is used in the future
-                    this.Parent.UpdateChildren(this, null);
-                }
-            }
-        }
-
-        /// <summary>
-        /// Is the tracked node still existed in the outline tree.
-        /// </summary>
-        private bool IsTrackedNodeAlive
-        {
-            get
-            {
-                return this.Parent.IsAlive;
-            }
-        }
-
-        //prevent creating ChangeNotificationTracker without parent
-        private ChangeNotificationTracker()
-        {
-        }
-
-        public ChangeNotificationTracker(TreeViewItemViewModel parent, ModelProperty parentProperty)
-        {
-            if (parent == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("parent"));
-            }
-            if (parentProperty == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("parentProperty"));
-            }
-            this.Parent = parent;
-            this.ParentProperty = parentProperty;
-            this.TrackedModelItem = new Dictionary<ModelItem, HashSet<string>>();
-            this.TrackedCollection = new List<INotifyCollectionChanged>();
-            this.ChildViewModels = new List<TreeViewItemViewModel>();
-        }
-
-        public void Add(ModelItem modelItem, ModelProperty property)
-        {
-            this.Add(modelItem, property.Name);
-        }
-
-        public void Add(ModelItem modelItem, string propertyName)
-        {
-            HashSet<string> propertyList = null;
-            if (!TrackedModelItem.TryGetValue(modelItem, out propertyList))
-            {
-                modelItem.PropertyChanged += new ComponentModel.PropertyChangedEventHandler(modelItem_PropertyChanged);
-                propertyList = new HashSet<string>();
-                TrackedModelItem.Add(modelItem, propertyList);
-            }
-            propertyList.Add(propertyName);
-        }
-
-        public void AddCollection(INotifyCollectionChanged collection)
-        {
-            this.TrackedCollection.Add(collection);
-            collection.CollectionChanged += new Collections.Specialized.NotifyCollectionChangedEventHandler(collection_CollectionChanged);
-        }
-
-        void collection_CollectionChanged(object sender, Collections.Specialized.NotifyCollectionChangedEventArgs e)
-        {
-            if (!IsTrackedNodeAlive)
-            {
-                return;
-            }
-
-            this.UpdateChildren(e);
-        }
-
-        public void CleanUp()
-        {
-            foreach (ModelItem modelItem in TrackedModelItem.Keys)
-            {
-                modelItem.PropertyChanged -= new ComponentModel.PropertyChangedEventHandler(modelItem_PropertyChanged);
-            }
-            TrackedModelItem.Clear();
-            foreach (INotifyCollectionChanged collection in TrackedCollection)
-            {
-                collection.CollectionChanged -= new Collections.Specialized.NotifyCollectionChangedEventHandler(collection_CollectionChanged);
-            }
-            TrackedCollection.Clear();
-            //remove childViewModels
-            foreach (TreeViewItemViewModel child in ChildViewModels)
-            {
-                this.Parent.InternalChildren.Remove(child);
-                child.CleanUp();
-            }
-            this.ChildViewModels.Clear();
-        }
-
-        void modelItem_PropertyChanged(object sender, ComponentModel.PropertyChangedEventArgs e)
-        {
-            if (!IsTrackedNodeAlive)
-            {
-                return;
-            }
-
-            ModelItem modelItem = sender as ModelItem;
-            if (modelItem != null)
-            {
-                HashSet<string> propertyList = null;
-                if (TrackedModelItem.TryGetValue(modelItem, out propertyList))
-                {
-                    if (propertyList.Contains(e.PropertyName))
-                    {
-                        this.UpdateChildren(e);
-                    }
-                }
-            }
-        }
-
-        void UpdateChildren(EventArgs e)
-        {
-            if (null == this.DelayUpdates)
-            {
-                this.DelayUpdates = false;
-                this.Parent.UpdateChildren(this, e);
-                this.DelayUpdates = null;
-            }
-            else
-            {
-                // Called while handling another event for this tracker
-                this.DelayUpdates = true;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/DesignerTreeAutoExpandHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/DesignerTreeAutoExpandHelper.cs
deleted file mode 100644 (file)
index 3f69abf..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View.TreeView
-{
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.View.OutlineView;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Runtime;
-
-    internal static class DesignerTreeAutoExpandHelper
-    {
-        internal static TreeViewItemViewModel Expand(TreeViewItemModelItemViewModel rootTreeViewItem, ModelItem modelItemToExpandTo)
-        {
-            Fx.Assert(modelItemToExpandTo != null && rootTreeViewItem != null, "rootTreeViewItem and modelItemToExpand should not have null value");
-
-            // ModelItems with HidePropertyInOutlineViewAttribute are invisible in the designerTree.
-            if (ExtensibilityAccessor.GetAttribute<HidePropertyInOutlineViewAttribute>(modelItemToExpandTo) != null)
-            {
-                return null;
-            }
-
-            Stack pathStack = new Stack();
-
-            TreeViewItemViewModel itemToBeSelected = null;
-
-            if (GetExpandingPath(modelItemToExpandTo, pathStack, new HashSet<ModelItem>()))
-            {
-                // If the root of modelItemToExpandTo differs from the root of the designerTree, it means modelItemToExpandTo doesn't belong to the designerTree.
-                if (pathStack.Pop() != rootTreeViewItem.VisualValue)
-                {
-                    return null;
-                }
-
-                object item = null;
-                TreeViewItemViewModel treeViewItem = rootTreeViewItem;
-                TreeViewItemViewModel tempTreeViewItem = rootTreeViewItem;
-
-                // Using the path to the root, expand the corresponding tree node. Ignore the items which is not visible on the designerTree.
-                while (pathStack.Count > 0)
-                {
-                    if (tempTreeViewItem != null)
-                    {
-                        treeViewItem = tempTreeViewItem;
-                        treeViewItem.IsExpanded = true;
-                    }
-
-                    item = pathStack.Pop();
-                    tempTreeViewItem = (from child in treeViewItem.Children
-                                        where (child is TreeViewItemModelItemViewModel && ((TreeViewItemModelItemViewModel)child).VisualValue == item as ModelItem)
-                                        || (child is TreeViewItemModelPropertyViewModel && ((TreeViewItemModelPropertyViewModel)child).VisualValue == item as ModelProperty)
-                                        || (child is TreeViewItemKeyValuePairModelItemViewModel && ((TreeViewItemKeyValuePairModelItemViewModel)child).VisualValue.Value == item as ModelItem)
-                                        select child).FirstOrDefault();
-
-                    // For TreeViewItemKeyValuePairModelItemViewModel, its path to the children is very complicated.
-                    // Take Switch as example: Switch(ModelItem) -> Cases(ModelProperty) -> KeyDictionaryCollection(ModelItem) -> ItemsCollection(ModelProperty) -> ModelItemKeyValuePair<T, Activity>(ModelItem) -> Value(ModelProperty) -> Children
-                    // All the path nodes except Switch and Children are invisible and can be ignored, the child node in the path is used twice to search for TreeViewItemKeyValuePairModelItemViewModel and its children in designerTree.
-                    if (tempTreeViewItem is TreeViewItemKeyValuePairModelItemViewModel)
-                    {
-                        // For further searching
-                        pathStack.Push(item);
-                    }
-
-                    if (pathStack.Count == 0)
-                    {
-                        itemToBeSelected = tempTreeViewItem;
-                    }
-                }
-            }
-
-            return itemToBeSelected;
-        }
-
-        // Get a path from the modelItem to the root.
-        // Path is stored in pathStack as stack datastructure, itemSet is used to avoid loop.
-        private static bool GetExpandingPath(ModelItem modelItem, Stack pathStack, HashSet<ModelItem> itemSet)
-        {            
-            if (modelItem == null || itemSet.Contains(modelItem) || ExtensibilityAccessor.GetAttribute<HidePropertyInOutlineViewAttribute>(modelItem) != null)
-            {
-                return false;
-            }
-
-            itemSet.Add(modelItem);
-            pathStack.Push(modelItem);
-
-            if (modelItem.Parents == null || modelItem.Parents.Count() == 0)
-            {
-                return true;
-            }
-
-            if (modelItem.Sources != null && modelItem.Sources.Count() != 0)
-            {
-                // By design, modelItem's path to the parents is through Sources to their Parent.
-                foreach (ModelProperty property in modelItem.Sources)
-                {
-                    // ModelProperties with HidePropertyInOutlineViewAttribute are also invisible.
-                    if (ExtensibilityAccessor.GetAttribute<HidePropertyInOutlineViewAttribute>(property) == null)
-                    {
-                        // Property is also stored in the path stack because some properties have visible nodes in the designerTree.
-                        pathStack.Push(property);
-                        if (GetExpandingPath(property.Parent, pathStack, itemSet))
-                        {
-                            return true;
-                        }
-                        else
-                        {
-                            pathStack.Pop();
-                        }
-                    }
-                }
-            }
-            else
-            {
-                // If a modelItem is inside an modelItemCollection, its Sources property is null.
-                foreach (ModelItem item in modelItem.Parents)
-                {
-                    if (GetExpandingPath(item, pathStack, itemSet))
-                    {
-                        return true;
-                    }
-                }
-            }
-
-            itemSet.Remove(modelItem);
-            pathStack.Pop();
-            return false;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/DesignerTreeView.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/DesignerTreeView.xaml.cs
deleted file mode 100644 (file)
index c44024f..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View.TreeView
-{
-    using System.Activities.Presentation.Model;
-    using System.Collections.ObjectModel;
-    using System.Windows;
-    using System.Windows.Threading;
-
-    partial class DesignerTreeView : System.Windows.Controls.TreeView
-    {
-        private TreeViewItemModelItemViewModel rootModelItemViewModel;
-        private bool isSelectionSubscribed;
-
-        internal bool IsSelectionChangeHandledByTreeView { get; set; }
-
-        public DesignerTreeView()
-        {
-            InitializeComponent();
-        }
-
-        public EditingContext Context
-        {
-            get;
-            private set;
-        }
-
-        public void SetRootDesigner(ModelItem modelItem)
-        {
-            rootModelItemViewModel = new TreeViewItemModelItemViewModel(null, modelItem);
-            this.ItemsSource = new ObservableCollection<TreeViewItemModelItemViewModel>() { rootModelItemViewModel };
-
-            if (!isSelectionSubscribed)
-            {
-                Selection.Subscribe(Context, ModelItemSelectionChanged);
-                isSelectionSubscribed = true;
-            }
-        }
-
-        public void Initialize(EditingContext context)
-        {
-            this.Context = context;
-        }
-
-        private void ModelItemSelectionChanged(Selection selection)
-        {
-            // AutoExpand only when designerTreeView didn't handle the selection change in modelItem
-            if (this.IsSelectionChangeHandledByTreeView)
-            {
-                this.IsSelectionChangeHandledByTreeView = false;
-            }
-            else
-            {
-                if (selection.PrimarySelection != null)
-                {
-                    TreeViewItemViewModel itemToBeSelected = DesignerTreeAutoExpandHelper.Expand(this.rootModelItemViewModel, selection.PrimarySelection);
-                    // itemToBeSelected == null means needn't AutoExpand.
-                    if (itemToBeSelected != null)
-                    {
-                        this.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(() =>
-                        {
-                            // TreeViewItemViewModel may got removed before Idle.
-                            if (itemToBeSelected.IsAlive && itemToBeSelected.TreeViewItem != null)
-                            {
-                                itemToBeSelected.TreeViewItem.Select();
-                            }
-                            // reset this flag to false, because the operation is done.
-                            // The flag will be used for next operation.
-                            this.IsSelectionChangeHandledByTreeView = false;
-                        }));
-                    }
-                }
-            }
-        }
-
-        public void RestoreDesignerStates()
-        {
-            this.InvalidateMeasure();
-        }
-
-        protected override DependencyObject GetContainerForItemOverride()
-        {
-            return new DesignerTreeViewItem() { ParentTreeView = this };
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/DesignerTreeViewItem.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/DesignerTreeViewItem.cs
deleted file mode 100644 (file)
index 2f31dae..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View.TreeView
-{
-    using System.Activities.Presentation.Model;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Runtime;
-    using System.Text;
-    using System.Windows;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-
-    class DesignerTreeViewItem : TreeViewItem, ITreeViewItemSelectionHandler
-    {
-        private bool shouldUpdateViewModel = true;
-
-        public DesignerTreeView ParentTreeView { get; set; }
-
-        protected override AutomationPeer OnCreateAutomationPeer()
-        {
-            return new DesignerTreeViewItemAutomationPeer(this);
-        }
-
-        protected override void OnItemsChanged(Collections.Specialized.NotifyCollectionChangedEventArgs e)
-        {
-            if (e.Action == Collections.Specialized.NotifyCollectionChangedAction.Remove)
-            {
-                // Don't select itself when its child items got removed. (Default action of base.OnItemsChanged)
-                // The selection should be managed by designer surface.
-                return;
-            }
-
-            base.OnItemsChanged(e);
-        }
-
-        internal Dictionary<string, string> GetAutomationItemStatus()
-        {
-            Dictionary<string, string> itemStatus = new Dictionary<string, string>();
-            TreeViewItemViewModel viewModel = this.Header as TreeViewItemViewModel;
-            if (viewModel != null && viewModel.IsHighlighted)
-            {
-                itemStatus.Add("IsSelection", "True");
-            }
-            else
-            {
-                itemStatus.Add("IsSelection", "False");
-            }
-
-            return itemStatus;
-        }
-
-        protected override Windows.DependencyObject GetContainerForItemOverride()
-        {
-            DesignerTreeViewItem item = new DesignerTreeViewItem() { ParentTreeView = this.ParentTreeView };
-            return item;
-        }
-
-        protected override void OnHeaderChanged(object oldHeader, object newHeader)
-        {
-            base.OnHeaderChanged(oldHeader, newHeader);
-
-            TreeViewItemViewModel source = newHeader as TreeViewItemViewModel;
-            if (source != null)
-            {
-                source.TreeViewItem = this;
-            }
-        }
-
-        protected override void OnSelected(Windows.RoutedEventArgs e)
-        {
-            base.OnSelected(e);
-            ParentTreeView.IsSelectionChangeHandledByTreeView = true;
-            UpdateTreeViewItemViewModel();
-        }
-
-        protected override void OnUnselected(RoutedEventArgs e)
-        {
-            base.OnUnselected(e);
-            if (shouldUpdateViewModel)
-            {
-                TreeViewItemViewModel viewModel = this.Header as TreeViewItemViewModel;
-                if (viewModel != null)
-                {
-                    if (viewModel is TreeViewItemModelPropertyViewModel || viewModel is TreeViewItemKeyValuePairModelItemViewModel)
-                    {
-                        viewModel.IsHighlighted = false;
-                    }
-                    else if (viewModel is TreeViewItemModelItemViewModel)
-                    {
-                        TreeViewItemModelItemViewModel modelItemViewModel = (TreeViewItemModelItemViewModel)viewModel;
-                        if (!modelItemViewModel.HasDesigner)
-                        {
-                            modelItemViewModel.IsHighlighted = false;
-                        }
-                    }
-                }
-            }
-        }
-
-        private void UpdateTreeViewItemViewModel()
-        {
-            if (!shouldUpdateViewModel)
-            {
-                return;
-            }
-
-            if (this.Header is TreeViewItemModelItemViewModel)
-            {
-                TreeViewItemModelItemViewModel modelItemViewModel = (TreeViewItemModelItemViewModel)this.Header;
-                if (modelItemViewModel.HasDesigner)
-                {
-                    HighlightModelItemOnDesigner(modelItemViewModel.VisualValue);
-                }
-                else
-                {
-                    HighlightTreeViewItemAndClearSelectionOnDesigner(modelItemViewModel);
-                }
-            }
-            else if (this.Header is TreeViewItemModelPropertyViewModel)
-            {
-                TreeViewItemModelPropertyViewModel modelPropertyViewModel = (TreeViewItemModelPropertyViewModel)this.Header;
-                HighlightTreeViewItemAndClearSelectionOnDesigner(modelPropertyViewModel);
-            }
-            else if (this.Header is TreeViewItemKeyValuePairModelItemViewModel)
-            {
-                TreeViewItemKeyValuePairModelItemViewModel keyValuePairItem = (TreeViewItemKeyValuePairModelItemViewModel)this.Header;
-                HighlightTreeViewItemAndClearSelectionOnDesigner(keyValuePairItem);
-            }
-            else
-            {
-                Fx.Assert("Invaild logic if Header is not TreeViewItemModelItemViewModel/TreeViewItemModelPropertyViewModel/TreeViewItemDictionaryModelItemViewModel");
-            }
-        }
-
-        private void HighlightModelItemOnDesigner(ModelItem selectedModelItem)
-        {
-            if (selectedModelItem != null)
-            {
-                Selection.SelectOnly(this.ParentTreeView.Context, selectedModelItem);
-                // Set highlight to visual value.  
-                // Don't use "Focus()" since it will steal keyboard focus and disable 
-                // keyboard navigation.
-                selectedModelItem.Highlight();
-            }
-        }
-
-        private void HighlightTreeViewItemAndClearSelectionOnDesigner(TreeViewItemViewModel viewModel)
-        {
-            this.ParentTreeView.Context.Items.SetValue(new Selection());
-            viewModel.IsHighlighted = true;
-        }
-
-        void ITreeViewItemSelectionHandler.Select()
-        {
-            // Invoked from ViewModel, needn't update ViewModel again.
-            shouldUpdateViewModel = false;
-            this.IsSelected = true;
-            shouldUpdateViewModel = true;
-        }
-
-        void ITreeViewItemSelectionHandler.Unselect()
-        {
-            // Invoked from ViewModel, needn't update ViewModel again.
-            shouldUpdateViewModel = false;
-            this.IsSelected = false;
-            shouldUpdateViewModel = true;
-        }
-
-        private class DesignerTreeViewItemAutomationPeer : TreeViewItemAutomationPeer
-        {
-            private DesignerTreeViewItem owner;
-
-            public DesignerTreeViewItemAutomationPeer(DesignerTreeViewItem owner)
-                : base(owner)
-            {
-                Fx.Assert(owner != null, "DesignerTreeViewItemAutomationPeer should not accept a null owner.");
-                this.owner = owner;
-            }
-
-            protected override AutomationControlType GetAutomationControlTypeCore()
-            {
-                return AutomationControlType.TreeItem;
-            }
-
-            protected override string GetItemStatusCore()
-            {
-                Dictionary<string, string> itemStatus = this.owner.GetAutomationItemStatus();
-                StringBuilder builder = new StringBuilder();
-                foreach (KeyValuePair<string, string> item in itemStatus)
-                {
-                    builder.AppendFormat("{0}={1} ", item.Key, item.Value);
-                }
-
-                return builder.ToString();
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/ITreeViewItemSelectionHandler.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/ITreeViewItemSelectionHandler.cs
deleted file mode 100644 (file)
index 444db98..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View.TreeView
-{
-    internal interface ITreeViewItemSelectionHandler
-    {
-        void Select();
-
-        void Unselect();
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/TreeViewItemKeyValuePairModelItemViewModel.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/TreeViewItemKeyValuePairModelItemViewModel.cs
deleted file mode 100644 (file)
index 77a57a9..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View.TreeView
-{
-    using System;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Activities.Presentation.Model;
-    using System.Collections.Generic;
-    using System.Diagnostics.CodeAnalysis;
-
-    internal sealed class TreeViewItemKeyValuePairModelItemViewModel : TreeViewItemViewModel<KeyValuePair<ModelItem, ModelItem>>
-    {
-        public TreeViewItemKeyValuePairModelItemViewModel(TreeViewItemViewModel parent, KeyValuePair<ModelItem, ModelItem> value) : base(parent)
-        {
-            this.Value = value;
-            this.VisualValue = value;
-            this.UpdateState();
-            if (this.HasChildren)
-            {
-                this.InternalChildren.Add(TreeViewItemViewModel.DummyNode);
-            }
-        }
-
-        internal override void LoadChildren()
-        {
-            if (this.PerfEventProvider != null)
-            {
-                this.PerfEventProvider.DesignerTreeViewLoadChildrenStart();
-            }
-
-            base.LoadChildren();
-            if (this.Value.Value != null)
-            {
-                ChangeNotificationTracker tracker = this.Parent.GetTracker(this);
-
-                this.AddChild(TreeViewItemViewModel.CreateViewModel(this, this.Value.Value), tracker.ParentProperty);
-            }
-
-            if (this.PerfEventProvider != null)
-            {
-                this.PerfEventProvider.DesignerTreeViewLoadChildrenEnd();
-            }
-        }
-
-        internal override void UpdateChildren(ChangeNotificationTracker tracker, EventArgs e)
-        {
-            if (this.PerfEventProvider != null)
-            {
-                this.PerfEventProvider.DesignerTreeViewUpdateStart();
-            }
-
-            base.UpdateChildren(tracker, e);
-            tracker.CleanUp();
-            if (this.Value.Value != null)
-            {
-                this.AddChild(TreeViewItemViewModel.CreateViewModel(this, this.Value.Value), tracker.ParentProperty);
-            }
-
-            if (this.PerfEventProvider != null)
-            {
-                this.PerfEventProvider.DesignerTreeViewUpdateEnd();
-            }
-        }
-
-        internal override void UpdateState()
-        {
-            base.UpdateState();
-            if (this.Value.Value != null)
-            {
-                this.State |= TreeViewItemState.HasChildren;
-            }
-        }
-
-        protected override EditingContext GetEditingContext()
-        {
-            if (this.Value.Key != null)
-            {
-                return this.Value.Key.GetEditingContext();
-            }
-            else
-            {
-                return base.GetEditingContext();
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/TreeViewItemModelItemViewModel.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/TreeViewItemModelItemViewModel.cs
deleted file mode 100644 (file)
index 1f5ef2d..0000000
+++ /dev/null
@@ -1,514 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View.TreeView
-{
-    using System;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Services;
-    using System.Activities.Presentation.Utility;
-    using System.Activities.Presentation.View;
-    using System.Activities.Presentation.View.OutlineView;
-    using System.Activities.Statements;
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Media;
-
-    internal sealed class TreeViewItemModelItemViewModel : TreeViewItemViewModel<ModelItem>
-    {
-        private ModelProperty promotedProperty;
-
-        public TreeViewItemModelItemViewModel(TreeViewItemViewModel parent, ModelItem modelItem, bool lazyLoad)
-            : base(parent)
-        {
-            this.Value = modelItem;
-            ShowInOutlineViewAttribute attr = ExtensibilityAccessor.GetAttribute<ShowInOutlineViewAttribute>(modelItem);
-            if (attr != null && !string.IsNullOrEmpty(attr.PromotedProperty))
-            {
-                // Only consider one level of promoted property.
-                this.promotedProperty = modelItem.Properties[attr.PromotedProperty];
-                if (this.promotedProperty != null)
-                {
-                    this.VisualValue = this.promotedProperty.Value;
-                }
-                else
-                {
-                    // is this what we really want?
-                    Fx.Assert(attr.PromotedProperty + " not found on " + modelItem.Name);
-                    this.VisualValue = null;
-                }
-            }
-            else
-            {
-                this.VisualValue = modelItem;
-            }
-
-            IsHighlighted = Selection.IsSelection(this.VisualValue);
-
-            if (lazyLoad)
-            {
-                this.UpdateState();
-                if (this.HasChildren)
-                {
-                    this.InternalChildren.Add(TreeViewItemViewModel.DummyNode);
-                }
-            }
-            else
-            {
-                this.LoadChildren();
-            }
-        }
-
-        public TreeViewItemModelItemViewModel(TreeViewItemViewModel parent, ModelItem modelItem)
-            : this(parent, modelItem, true)
-        {
-        }
-
-        /// <summary>
-        /// Set VisualValue will update Icon and binding to designer.
-        /// </summary>
-        public override ModelItem VisualValue
-        {
-            get
-            {
-                return base.VisualValue;
-            }
-
-            internal set
-            {
-                if (base.VisualValue != value)
-                {
-                    // Remove old event chain
-                    if (base.VisualValue != null)
-                    {
-                        base.VisualValue.PropertyChanged -= this.VisualValue_PropertyChanged;
-                    }
-
-                    base.VisualValue = value;
-
-                    if (ModelItemHasDesigner(base.VisualValue))
-                    {
-                        base.VisualValue.PropertyChanged += this.VisualValue_PropertyChanged;
-                    }
-
-                    this.Icon = this.GetIconByVisualValue();
-                    NotifyPropertyChanged("VisualValue");
-                }
-            }
-        }
-
-        internal bool HasDesigner
-        {
-            get
-            {
-                return ModelItemHasDesigner(this.VisualValue);
-            }
-        }
-
-        internal override void LoadChildren()
-        {
-            if (this.PerfEventProvider != null)
-            {
-                this.PerfEventProvider.DesignerTreeViewLoadChildrenStart();
-            }
-
-            base.LoadChildren();
-            TreeViewItemViewModel.AddModelItem(this, this.Value, null);
-            if (this.PerfEventProvider != null)
-            {
-                this.PerfEventProvider.DesignerTreeViewLoadChildrenEnd();
-            }
-        }
-
-        internal override void UpdateChildren(ChangeNotificationTracker tracker, EventArgs e)
-        {
-            if (this.PerfEventProvider != null)
-            {
-                this.PerfEventProvider.DesignerTreeViewUpdateStart();
-            }
-
-            // Update VisualValue when promotedProperty's got changed.
-            if (this.promotedProperty != null && this.promotedProperty == tracker.ParentProperty)
-            {
-                this.VisualValue = this.promotedProperty.Value;
-            }
-
-            if (this.Children.Count == 1 && this.Children[0] == DummyNode)
-            {
-                // If the node never expanded before, LoadChildren instead of UpdateChildren.
-                // Otherwise, when expanding node, the LoadChildren method won't invoke 
-                // Then other tracking properties cannot be setup correctly.
-                this.InternalChildren.Remove(DummyNode);
-                this.LoadChildren();
-            }
-            else
-            {
-                // If requireUpdateChildren = false, the related TreeViewItemModelPropertyViewModel take care of updating child nodes.
-                bool requireUpdateChildren = true;
-                if (e is PropertyChangedEventArgs && this.IsModelPropertyNodeExisted(tracker.ParentProperty))
-                {
-                    ModelProperty modelProperty = tracker.ParentProperty;
-                    if (modelProperty.Value != null)
-                    {
-                        string changedPropertyName = ((PropertyChangedEventArgs)e).PropertyName;
-                        bool isPromotedPropertyChanged = TreeViewItemViewModel.IsPromotedProperty(modelProperty.Value, changedPropertyName);
-                        if (isPromotedPropertyChanged)
-                        {
-                            if (modelProperty.Value.Properties[changedPropertyName].Value != null)
-                            {
-                                requireUpdateChildren = false;
-                            }
-                        }
-                        else
-                        {
-                            requireUpdateChildren = false;
-                        }
-                    }
-                }
-
-                if (requireUpdateChildren)
-                {
-                    base.UpdateChildren(tracker, e);
-                    tracker.CleanUp();
-                    TreeViewItemViewModel.AddModelProperty(this, this.Value, tracker.ParentProperty, tracker.ParentProperty);
-                }
-            }
-
-            if (this.PerfEventProvider != null)
-            {
-                this.PerfEventProvider.DesignerTreeViewUpdateEnd();
-            }
-        }
-
-        internal override void UpdateState()
-        {
-            base.UpdateState();
-            if (this.Value != null)
-            {
-                this.State |= this.UpdateModelItemState(this.Value);
-            }
-        }
-
-        internal override int FindInsertionIndex(ChangeNotificationTracker tracker)
-        {
-            int insertionIndex = 0;
-            if (tracker != null && (tracker.ChildViewModels == null || tracker.ChildViewModels.Count < 1))
-            {
-                foreach (ModelProperty property in this.Value.Properties)
-                {
-                    if (property != tracker.ParentProperty)
-                    {
-                        // assume this would increament
-                        ChangeNotificationTracker propertyTracker = this.GetTracker(property, false);
-                        if (propertyTracker != null)
-                        {
-                            insertionIndex = base.FindInsertionIndex(propertyTracker);
-                        }
-                    }
-                    else
-                    {
-                        // we've reach the property and hence the last of the previous property
-                        break;
-                    }
-                }
-            }
-            else
-            {
-                insertionIndex = base.FindInsertionIndex(tracker);
-            }
-
-            return insertionIndex;
-        }
-
-        internal override ChangeNotificationTracker GetTracker(ModelProperty modelProperty, bool createNew)
-        {
-            ChangeNotificationTracker tracker = base.GetTracker(modelProperty, createNew);
-            if (createNew)
-            {
-                if (this.VisualValue == modelProperty.Parent)
-                {
-                    // If this TreeViewModelItem use Promopted property and the property belongs to Promoted activity
-                    // add the tracked property by default.
-                    tracker.Add(this.VisualValue, modelProperty);
-                }
-                else
-                {
-                    // If it's an model item, add the tracked property by default
-                    tracker.Add(this.Value, modelProperty);
-                }
-            }
-
-            return tracker;
-        }
-
-        protected override void CleanUpCore()
-        {
-            if (this.VisualValue != null)
-            {
-                this.VisualValue.PropertyChanged -= this.VisualValue_PropertyChanged;
-            }
-
-            this.promotedProperty = null;
-
-            base.CleanUpCore();
-        }
-
-        protected override EditingContext GetEditingContext()
-        {
-            if (this.Value != null)
-            {
-                return this.Value.GetEditingContext();
-            }
-            else
-            {
-                return base.GetEditingContext();
-            }
-        }
-
-        private static bool ModelItemHasDesigner(ModelItem modelItem)
-        {
-            if (modelItem != null)
-            {
-                DesignerAttribute attribute = WorkflowViewService.GetAttribute<DesignerAttribute>(modelItem.ItemType);
-                if (attribute != null && !string.IsNullOrEmpty(attribute.DesignerTypeName))
-                {
-                    return true;
-                }
-            }
-
-            return false;
-        }
-
-        private static DrawingBrush GetIconFromUnInitializedDesigner(ActivityDesigner designer)
-        {
-            DrawingBrush icon = null;
-            if (designer != null)
-            {
-                // force the designer to load
-                designer.BeginInit();
-
-                // An exception will be thrown, if BeginInit is called more than once on 
-                // the same activity designer prior to EndInit being called.  So we call
-                // EndInit to avoid that, note this will cause an Initialized event.
-                designer.EndInit();
-
-                if (designer.Icon == null)
-                {
-                    // the loading of the default icon depends on Activity.Loaded event.
-                    // however the designer might not be loaded unless it is added to the
-                    // designer surface.  So we load the default icon manually here.
-                    icon = designer.GetDefaultIcon();
-                }
-                else
-                {
-                    icon = designer.Icon;
-                }
-            }
-
-            return icon;
-        }
-
-        private void ExpandToNode()
-        {
-            TreeViewItemViewModel viewModel = this.Parent;
-            while (viewModel != null)
-            {
-                viewModel.IsExpanded = true;
-                viewModel = viewModel.Parent;
-            }
-        }
-
-        private DrawingBrush GetIconByVisualValue()
-        {
-            if (this.VisualValue != null)
-            {
-                DrawingBrush icon = null;
-                Type modelItemType = this.VisualValue.ItemType;
-                if (modelItemType.IsGenericType)
-                {
-                    // If Type is generic type, whatever T, it should display same icon, so use generic type instead.
-                    modelItemType = this.VisualValue.ItemType.GetGenericTypeDefinition();
-                }
-
-                // If the user specifies the attribute, then the Designer would be providing the icon,
-                // bypassing the pipeline of retrieving the icons via reflection and attached properties.
-                ActivityDesignerOptionsAttribute attr = ExtensibilityAccessor.GetAttribute<ActivityDesignerOptionsAttribute>(modelItemType);
-                if (attr != null && attr.OutlineViewIconProvider != null)
-                {
-                    icon = attr.OutlineViewIconProvider(this.VisualValue);
-                }
-
-                if (icon == null && !TreeViewItemViewModel.IconCache.TryGetValue(modelItemType, out icon))
-                {
-                    EditingContext context = this.VisualValue.GetEditingContext();
-                    ViewService service = context.Services.GetService<ViewService>();
-                    WorkflowViewService workflowViewService = service as WorkflowViewService;
-                    ActivityDesigner designer = null;
-
-                    // first try to create an detached view element that won't participate in the designer,
-                    // if the view service is WorkflowViewService
-                    if (workflowViewService != null)
-                    {
-                        designer = workflowViewService.CreateDetachedViewElement(this.VisualValue) as ActivityDesigner;
-                        icon = GetIconFromUnInitializedDesigner(designer);
-                    }
-                    else
-                    {
-                        // fall back if the view service is not the default implementation
-                        // We only need to get the icon from the designer, so we don't need to make sure the view is parented.
-                        designer = this.VisualValue.View as ActivityDesigner;
-                        if (designer == null && service != null)
-                        {
-                            designer = service.GetView(this.VisualValue) as ActivityDesigner;
-                        }
-
-                        if (designer != null)
-                        {
-                            if (designer.Icon != null || designer.IsLoaded)
-                            {
-                                icon = designer.Icon;
-                            }
-                            else
-                            {
-                                icon = GetIconFromUnInitializedDesigner(designer);
-                            }
-                        }
-                    }
-
-                    // Cache even a null icon since answers found above won't change within this AppDomain
-                    TreeViewItemViewModel.IconCache.Add(modelItemType, icon);
-                }
-
-                return icon;
-            }
-            else
-            {
-                return null;
-            }
-        }
-
-        private bool IsModelPropertyNodeExisted(ModelProperty property)
-        {
-            bool isModelPropertyNodeExisted = false;
-
-            foreach (TreeViewItemViewModel viewModel in Children)
-            {
-                TreeViewItemModelPropertyViewModel modelPropertyViewModel = viewModel as TreeViewItemModelPropertyViewModel;
-                if (modelPropertyViewModel != null)
-                {
-                    if (modelPropertyViewModel.Value == property)
-                    {
-                        isModelPropertyNodeExisted = true;
-                        break;
-                    }
-                }
-            }
-
-            return isModelPropertyNodeExisted;
-        }
-
-        private TreeViewItemState UpdateModelItemState(ModelItem modelItem)
-        {
-            TreeViewItemState state = TreeViewItemState.Default;
-
-            foreach (ModelProperty property in modelItem.Properties)
-            {
-                if (ExtensibilityAccessor.GetAttribute<HidePropertyInOutlineViewAttribute>(property) != null)
-                {
-                    continue;
-                }
-                else if (ExtensibilityAccessor.GetAttribute<ShowPropertyInOutlineViewAttribute>(property) != null)
-                {
-                    if (property.Value != null)
-                    {
-                        state |= TreeViewItemState.HasChildren;
-                    }
-
-                    // create the property change notification tracker
-                    this.GetTracker(property, true);
-                }
-                else if (ExtensibilityAccessor.GetAttribute<ShowPropertyInOutlineViewAsSiblingAttribute>(property) != null)
-                {
-                    // First of all, ShowPropertyInOutlineViewAsSiblingAttribute property's tracker will be setup at the LoadChildren() time.
-                    // The reason we cannot do it here is because during the constructor, this.Parent is null.
-                    // If all other properties don't flag HasChildren, the current node won't be able to expand.
-                    // So we cannot rely on expand operation to invoke LoadChildren() to setup tracker.
-                    // TreeViewItemViewModel.AddChild(TreeViewItemViewModel, ModelProperty) will by default invoke LoadChildren() if the node HasSibling.
-                    // So even if property's value == null, we should flag it HasSibling, and let LoadChildren invoked by default.
-                    state |= TreeViewItemState.HasSibling;
-                }
-                else if (ExtensibilityAccessor.GetAttribute<ShowInOutlineViewAttribute>(property) != null)
-                {
-                    if (property.Value != null)
-                    {
-                        // Only consider one level of PromotedProperty.
-                        if (property != this.promotedProperty)
-                        {
-                            state |= TreeViewItemState.HasChildren;
-                        }
-                        else
-                        {
-                            // Since the property has been promoted, need to check whether this property has children.
-                            // If this promoted property.Value has children, those children should belong to this node.
-                            state |= this.UpdateModelItemState(property.Value);
-                        }
-                    }
-
-                    this.GetTracker(property, true);
-                }
-                else if (property.IsDictionary && property.PropertyType.IsGenericType)
-                {
-                    // if the values in the dictionary is viewvisible, note this only works with generic dictionary
-                    Type[] arguments = property.PropertyType.GetGenericArguments();
-                    if (ExtensibilityAccessor.GetAttribute<ShowInOutlineViewAttribute>(arguments[1]) != null)
-                    {
-                        if (property.Value != null)
-                        {
-                            state |= TreeViewItemState.HasChildren;
-                        }
-
-                        this.GetTracker(property, true);
-                    }
-                }
-            }
-
-            return state;
-        }
-
-        private void VisualValue_PropertyChanged(object sender, ComponentModel.PropertyChangedEventArgs e)
-        {
-            if (e.PropertyName.Equals("IsSelection"))
-            {
-                this.IsHighlighted = Selection.IsSelection(this.VisualValue);
-                if (this.IsHighlighted)
-                {
-                    this.ExpandToNode();
-                }
-            }
-            else if (e.PropertyName.Equals("IsPrimarySelection"))
-            {
-                if (TreeViewItem == null)
-                {
-                    // TreeViewItem is not initialized at the first time of SelectionChanged by WorkflowViewElement.OnGotFocusEvent.
-                    return;
-                }
-
-                bool isPrimarySelection = Selection.IsPrimarySelection(this.VisualValue);
-                if (isPrimarySelection)
-                {
-                    TreeViewItem.Select();
-                }
-                else
-                {
-                    TreeViewItem.Unselect();
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/TreeViewItemModelPropertyViewModel.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/TreeViewItemModelPropertyViewModel.cs
deleted file mode 100644 (file)
index 6dc889a..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View.TreeView
-{
-    using System;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.View.OutlineView;
-    using System.Runtime;
-
-    internal sealed class TreeViewItemModelPropertyViewModel : TreeViewItemViewModel<ModelProperty>
-    {
-        public TreeViewItemModelPropertyViewModel(TreeViewItemViewModel parent, ModelProperty property)
-            : base(parent)
-        {
-            Fx.Assert(property != null, "property cannot be null");
-            this.Value = property;
-            this.VisualValue = property;
-            if (property != null && property.Parent != null)
-            {
-                this.GetTracker(property);
-            }
-
-            this.UpdateState();
-            if (this.HasChildren)
-            {
-                this.InternalChildren.Add(TreeViewItemViewModel.DummyNode);
-            }
-        }
-
-        internal override ChangeNotificationTracker GetTracker(ModelProperty modelProperty, bool createNew)
-        {
-            ChangeNotificationTracker tracker = base.GetTracker(modelProperty, createNew);
-            if (createNew)
-            {
-                Fx.Assert(this.Value == modelProperty, "The modelProperty should be the same as this.Value.");
-                tracker.Add(modelProperty.Parent, modelProperty);
-                ShowInOutlineViewAttribute viewVisible = ExtensibilityAccessor.GetAttribute<ShowInOutlineViewAttribute>(modelProperty);
-                if (viewVisible != null && !string.IsNullOrWhiteSpace(viewVisible.PromotedProperty))
-                {
-                    ModelProperty promotedProperty = modelProperty.Value.Properties.Find(viewVisible.PromotedProperty);
-                    tracker.Add(promotedProperty.Parent, promotedProperty);
-                }
-            }
-
-            return tracker;
-        }
-
-        internal override void UpdateChildren(ChangeNotificationTracker tracker, EventArgs e)
-        {
-            if (this.PerfEventProvider != null)
-            {
-                this.PerfEventProvider.DesignerTreeViewUpdateStart();
-            }
-
-            // 
-            base.UpdateChildren(tracker, e);
-            tracker.CleanUp();
-            this.InternalChildren.Clear();
-
-            this.LoadChildren();
-
-            if (this.PerfEventProvider != null)
-            {
-                this.PerfEventProvider.DesignerTreeViewUpdateEnd();
-            }
-        }
-
-        internal override void LoadChildren()
-        {
-            if (this.PerfEventProvider != null)
-            {
-                this.PerfEventProvider.DesignerTreeViewLoadChildrenStart();
-            }
-
-            base.LoadChildren();
-
-            if (this.Value.IsCollection)
-            {
-                ModelItemCollection mc = this.Value.Value as ModelItemCollection;
-                TreeViewItemViewModel.AddModelItemCollection(this, mc, this.Value);
-            }
-            else if (this.Value.IsDictionary)
-            {
-                ModelItemDictionary dictionary = this.Value.Dictionary;
-                TreeViewItemViewModel.AddModelItemDictionary(this, dictionary, this.Value);
-            }
-            else if (this.Value.Value != null)
-            {
-                TreeViewItemViewModel.AddChild(this, this.Value.Value, this.Value.Value, this.DuplicatedNodeVisible, string.Empty, this.Value);
-            }
-
-            if (this.PerfEventProvider != null)
-            {
-                this.PerfEventProvider.DesignerTreeViewLoadChildrenEnd();
-            }
-        }
-
-        internal override void UpdateState()
-        {
-            if (this.Value.Value != null || (this.Value.IsCollection && this.Value.Collection.Count > 0) ||
-                (this.Value.IsDictionary && this.Value.Dictionary.Count > 0))
-            {
-                this.State = TreeViewItemState.HasChildren;
-            }
-
-            base.UpdateState();
-        }
-
-        protected override EditingContext GetEditingContext()
-        {
-            if (this.Value != null && this.Value.Parent != null)
-            {
-                return this.Value.Parent.GetEditingContext();
-            }
-            else
-            {
-                return base.GetEditingContext();
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/TreeViewItemViewModel.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/TreeViewItemViewModel.cs
deleted file mode 100644 (file)
index a2191c7..0000000
+++ /dev/null
@@ -1,699 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View.TreeView
-{
-    using System;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.View.OutlineView;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.ComponentModel;
-    using System.Globalization;
-    using System.Linq;
-    using System.Runtime;
-    using System.Windows.Media;
-
-    class TreeViewItemViewModel : INotifyPropertyChanged
-    {
-        string nodePrefixText = string.Empty;
-        bool isExpanded = false;
-        bool isHighlighted = false;
-        DrawingBrush icon = null;
-        HashSet<ModelItem> uniqueChildren = null;
-        internal static TreeViewItemViewModel DummyNode = new TreeViewItemViewModel();
-        // the IconCache is a static singleton based on the assumption that the Icon for a particular type is 
-        // the same within an AppDomain
-        internal static Dictionary<Type, DrawingBrush> IconCache = new Dictionary<Type, DrawingBrush>();
-        DesignerPerfEventProvider provider = null;
-
-        public event PropertyChangedEventHandler PropertyChanged;
-        protected TreeViewItemViewModel()
-        {
-            this.IsAlive = true;
-            InternalChildren = new ObservableCollection<TreeViewItemViewModel>();
-            InternalChildren.CollectionChanged += new Collections.Specialized.NotifyCollectionChangedEventHandler(InternalChildren_CollectionChanged);
-            Children = new ReadOnlyObservableCollection<TreeViewItemViewModel>(InternalChildren);
-            ChildrenValueCache = new HashSet<object>();
-            DuplicatedNodeVisible = true;
-
-            this.Trackers = new Dictionary<ModelProperty, ChangeNotificationTracker>();
-        }
-
-        internal ObservableCollection<TreeViewItemViewModel> InternalChildren { get; private set; }
-
-        public ReadOnlyObservableCollection<TreeViewItemViewModel> Children { get; private set; }
-
-        public string NodePrefixText
-        {
-            get
-            {
-                return nodePrefixText;
-            }
-            set
-            {
-                nodePrefixText = value;
-                this.NotifyPropertyChanged("NodePrefixText");
-            }
-        }
-
-        public DrawingBrush Icon
-        {
-            get { return icon; }
-            set
-            {
-                if (value != this.icon)
-                {
-                    this.icon = value;
-                    this.NotifyPropertyChanged("Icon");
-                }
-            }
-        }
-
-        internal bool IsAlive { get; private set; }
-
-        public bool IsExpanded
-        {
-            get
-            {
-                return isExpanded;
-            }
-            set
-            {
-                if (value != this.isExpanded)
-                {
-                    if (this.PerfEventProvider != null)
-                    {
-                        this.PerfEventProvider.DesignerTreeViewExpandStart();
-                    }
-                    this.isExpanded = value;
-                    if (this.isExpanded && this.Children.Count == 1 && this.Children[0] == DummyNode)
-                    {
-                        this.InternalChildren.Remove(DummyNode);
-                        this.LoadChildren();
-                    }
-                    this.NotifyPropertyChanged("IsExpanded");
-                    if (this.PerfEventProvider != null)
-                    {
-                        this.PerfEventProvider.DesignerTreeViewExpandEnd();
-                    }
-                }
-            }
-        }
-
-        public bool IsHighlighted
-        {
-            get
-            {
-                return this.isHighlighted;
-            }
-            set
-            {
-                if (this.isHighlighted != value)
-                {
-                    this.isHighlighted = value;
-                    this.NotifyPropertyChanged("IsHighlighted");
-                }
-            }
-        }
-
-        internal bool DuplicatedNodeVisible { get; set; }
-
-        internal TreeViewItemState State { get; set; }
-
-        internal bool HasChildren
-        {
-            get
-            {
-                return (this.State & TreeViewItemState.HasChildren) == TreeViewItemState.HasChildren;
-            }
-        }
-
-        internal bool HasSibling
-        {
-            get
-            {
-                return (this.State & TreeViewItemState.HasSibling) == TreeViewItemState.HasSibling;
-            }
-        }
-
-        public TreeViewItemViewModel Parent { get; set; }
-
-        internal ITreeViewItemSelectionHandler TreeViewItem { get; set; }
-
-        protected HashSet<object> ChildrenValueCache { get; set; }
-
-        internal Dictionary<ModelProperty, ChangeNotificationTracker> Trackers { get; private set; }
-
-        protected DesignerPerfEventProvider PerfEventProvider
-        {
-            get
-            {
-                if (provider == null)
-                {
-                    EditingContext context = this.GetEditingContext();
-                    if (context != null)
-                    {
-                        provider = context.Services.GetService<DesignerPerfEventProvider>();
-                    }
-                }
-                return provider;
-            }
-        }
-
-        protected virtual EditingContext GetEditingContext()
-        {
-            return null;
-        }
-
-        internal virtual object GetValue()
-        {
-            return null;
-        }
-
-        internal virtual void LoadChildren()
-        {
-            foreach (ChangeNotificationTracker t in this.Trackers.Values)
-            {
-                t.CleanUp();
-            }
-
-            foreach (TreeViewItemViewModel child in InternalChildren)
-            {
-                child.CleanUp();
-            }
-
-            this.InternalChildren.Clear();
-            this.ChildrenValueCache.Clear();
-        }
-
-        internal virtual void UpdateChildren(ChangeNotificationTracker tracker, EventArgs e)
-        {
-            this.uniqueChildren = null;
-        }
-
-        //if child is null then only add the modelProperty for tracking purpose
-        internal virtual void AddChild(TreeViewItemViewModel child, ModelProperty modelProperty)
-        {
-            //check for duplicate first
-            if (child != null)
-            {
-                object childValue = child.GetValue();
-                if (!ChildrenValueCache.Contains(childValue))
-                {
-                    ChildrenValueCache.Add(childValue);
-                }
-                else
-                {
-                    child.CleanUp();
-                    return;
-                }
-            }
-
-            ChangeNotificationTracker tracker = GetTracker(modelProperty);
-            if (child != null)
-            {
-                // May be adding a node before it's expanded; get rid of the dummy
-                if (this.Children.Count == 1 && this.Children[0] == DummyNode)
-                {
-                    this.InternalChildren.Remove(DummyNode);
-                }
-
-                int insertIndex = this.FindInsertionIndex(tracker);
-                this.InternalChildren.Insert(insertIndex, child);
-                tracker.ChildViewModels.Add(child);
-                if (child.HasSibling)
-                {
-                    //loading children rather than just add the sibling of the children
-                    //if this turn out to be a big performance impact then we'll need to optimise this
-                    child.LoadChildren();
-                }
-            }
-        }
-
-        internal static TreeViewItemViewModel CreateViewModel(TreeViewItemViewModel parent, object value)
-        {
-            TreeViewItemViewModel viewModel = null;
-            if (typeof(ModelItem).IsAssignableFrom(value.GetType()))
-            {
-                viewModel = new TreeViewItemModelItemViewModel(parent, value as ModelItem);
-            }
-            else if (typeof(ModelProperty).IsAssignableFrom(value.GetType()))
-            {
-                viewModel = new TreeViewItemModelPropertyViewModel(parent, value as ModelProperty);
-            }
-            else if (typeof(KeyValuePair<ModelItem, ModelItem>).IsAssignableFrom(value.GetType()))
-            {
-                viewModel = new TreeViewItemKeyValuePairModelItemViewModel(parent, (KeyValuePair<ModelItem, ModelItem>)value);
-            }
-            return viewModel;
-        }
-
-        internal static void AddModelItem(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty)
-        {
-            if (item != null)
-            {
-                bool updateTrackingProperty = trackingProperty == null;
-
-                foreach (ModelProperty property in item.Properties)
-                {
-                    if (updateTrackingProperty)
-                    {
-                        trackingProperty = property;
-                    }
-                    AddModelProperty(parent, item, trackingProperty, property);
-                }
-            }
-        }
-
-        internal static void AddModelItemCollection(TreeViewItemViewModel parent, ModelItemCollection collection, ModelProperty trackingProperty)
-        {
-            parent.GetTracker(trackingProperty).AddCollection(collection);
-
-            bool duplicatedNodeVisible = true;
-            string childNodePrefix = string.Empty;
-            ShowPropertyInOutlineViewAttribute viewChild = ExtensibilityAccessor.GetAttribute<ShowPropertyInOutlineViewAttribute>(trackingProperty);
-            if (viewChild != null)
-            {
-                duplicatedNodeVisible = viewChild.DuplicatedChildNodesVisible;
-                childNodePrefix = viewChild.ChildNodePrefix;
-            }
-
-            foreach (ModelItem item in collection)
-            {
-                AddChild(parent, item, item, duplicatedNodeVisible, childNodePrefix, trackingProperty);
-            }
-        }
-
-        internal static void AddModelItemDictionary(TreeViewItemViewModel parent, ModelItemDictionary dictionary, ModelProperty trackingProperty)
-        {
-            parent.GetTracker(trackingProperty).AddCollection(dictionary);
-
-            bool duplicatedNodeVisible = true;
-            string childNodePrefix = string.Empty;
-            ShowPropertyInOutlineViewAttribute viewChild = ExtensibilityAccessor.GetAttribute<ShowPropertyInOutlineViewAttribute>(trackingProperty);
-            if (viewChild != null)
-            {
-                duplicatedNodeVisible = viewChild.DuplicatedChildNodesVisible;
-                childNodePrefix = viewChild.ChildNodePrefix;
-            }
-
-            foreach (var pair in dictionary)
-            {
-                ModelItem item = null;
-                //AddChild(parent, pair.Value, pair, duplicatedNodeVisible, trackingProperty);
-                AddChild(parent, item, pair, duplicatedNodeVisible, childNodePrefix, trackingProperty);
-            }
-        }
-
-        internal static void AddModelProperty(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty, ModelProperty property)
-        {
-            //in the case of multiple attributes, they go in this order
-            //HidePropertyInOutlineViewAttribute
-            //[item.ShowInOutlineViewAttribute.PromotedProperty = property.Name]. Set VisualValue by property and ignore itself. Usage ActivityDelegate, FlowStep.
-            //ShowPropertyInOutlineViewAttribute
-            //ShowPropertyInOutlineViewAsSiblingAttribute
-            //ShowInOutlineViewAttribute
-            ShowPropertyInOutlineViewAttribute viewChild = ExtensibilityAccessor.GetAttribute<ShowPropertyInOutlineViewAttribute>(property);
-            if (ExtensibilityAccessor.GetAttribute<HidePropertyInOutlineViewAttribute>(property) != null)
-            {
-                //ignore
-                return;
-            }
-            else if (IsPromotedProperty(item, property))
-            {
-                if (property.IsCollection)
-                {
-                    ModelItemCollection mc = property.Value as ModelItemCollection;
-                    AddModelItemCollection(parent, mc, trackingProperty);
-                }
-                else if (property.IsDictionary)
-                {
-                    ModelItemDictionary dictionary = property.Dictionary;
-                    AddModelItemDictionary(parent, dictionary, trackingProperty);
-                }
-                else
-                {
-                    parent.GetTracker(trackingProperty).Add(item, property);
-
-                    //if property.Value is null, then this would not add any node
-                    // Use promoted ModelItem's property to track, so pass null to AddModelItem method.
-                    AddModelItem(parent, property.Value, null);
-                }
-            }
-            else if (viewChild != null)
-            {
-                if (viewChild.CurrentPropertyVisible) //property node visible
-                {
-                    if (property.Value != null)
-                    {
-                        TreeViewItemViewModel childModel = TreeViewItemViewModel.CreateViewModel(parent, property);
-                        childModel.DuplicatedNodeVisible = viewChild.DuplicatedChildNodesVisible;
-                        parent.AddChild(childModel, trackingProperty);
-                    }
-                    else
-                    {
-                        //just add the notification tracker without adding the empty child
-                        parent.GetTracker(trackingProperty, true).Add(item, trackingProperty);
-                    }
-                }
-                else
-                {
-                    if (property.IsCollection)
-                    {
-                        ModelItemCollection mc = property.Value as ModelItemCollection;
-                        AddModelItemCollection(parent, mc, trackingProperty);
-                    }
-                    else if (property.IsDictionary)
-                    {
-                        ModelItemDictionary dictionary = property.Dictionary;
-                        AddModelItemDictionary(parent, dictionary, trackingProperty);
-                    }
-                    else
-                    {
-                        if (property.Value != null)
-                        {
-                            TreeViewItemViewModel childModel = TreeViewItemViewModel.CreateViewModel(parent, property.Value);
-                            childModel.DuplicatedNodeVisible = viewChild.DuplicatedChildNodesVisible;
-                            parent.AddChild(childModel, trackingProperty);
-                        }
-                        else
-                        {
-                            parent.GetTracker(trackingProperty).Add(item, property);
-                        }
-
-                    }
-                }
-            }
-            else if (ExtensibilityAccessor.GetAttribute<ShowPropertyInOutlineViewAsSiblingAttribute>(property) != null)
-            {
-                //add notification to the tracker that is responsible for this node
-                ChangeNotificationTracker tracker = parent.Parent.GetTracker(parent);
-                tracker.Add(item, property);
-                TreeViewItemViewModel siblingNode = null;
-                if (property.Value != null)
-                {
-                    siblingNode = TreeViewItemViewModel.CreateViewModel(parent.Parent, property.Value);
-                }
-                parent.Parent.AddChild(siblingNode, tracker.ParentProperty);
-            }
-            else if (ExtensibilityAccessor.GetAttribute<ShowInOutlineViewAttribute>(property) != null)
-            {
-                if (property.Value != null)
-                {
-                    ShowInOutlineViewAttribute outlineView = ExtensibilityAccessor.GetAttribute<ShowInOutlineViewAttribute>(property);
-                    if (string.IsNullOrWhiteSpace(outlineView.PromotedProperty))
-                    {
-                        parent.AddChild(TreeViewItemViewModel.CreateViewModel(parent, property), trackingProperty);
-                    }
-                    else
-                    {
-                        ModelProperty promotedProperty = property.Value.Properties.Find(outlineView.PromotedProperty);
-                        if (promotedProperty == null)
-                        {
-                            throw FxTrace.Exception.AsError(new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, SR.PromotedPropertyNotFound, outlineView.PromotedProperty, property.Value.Name)));
-                        }
-
-                        // Add promoted ModelItem and property into tracker. So when property got changed, the grandparent of promoted ModelItem will be notified.
-                        ChangeNotificationTracker tracker = parent.GetTracker(trackingProperty, true);
-                        tracker.Add(property.Value, promotedProperty);
-
-                        if (promotedProperty.Value == null)
-                        {
-                            tracker.Add(item, property);
-                        }
-                        else
-                        {
-                            parent.AddChild(TreeViewItemViewModel.CreateViewModel(parent, property), trackingProperty);
-                        }
-                    }
-                }
-                else
-                {
-                    parent.GetTracker(trackingProperty, true).Add(item, property);
-                }
-
-            }
-            //if the values in the dictionary is viewvisible, note this only works with generic dictionary
-            else if (property.IsDictionary && property.PropertyType.IsGenericType)
-            {
-                Type[] arguments = property.PropertyType.GetGenericArguments();
-                if (ExtensibilityAccessor.GetAttribute<ShowInOutlineViewAttribute>(arguments[1]) != null)
-                {
-                    if (property.Value != null)
-                    {
-                        parent.AddChild(TreeViewItemViewModel.CreateViewModel(parent, property), trackingProperty);
-                    }
-                    else
-                    {
-                        parent.GetTracker(trackingProperty, true).Add(item, property);
-                    }
-
-                }
-            }
-        }
-
-        internal static bool IsPromotedProperty(ModelItem modelItem, ModelProperty property)
-        {
-            return IsPromotedProperty(modelItem, property.Name);
-        }
-
-        internal static bool IsPromotedProperty(ModelItem modelItem, string propertyName)
-        {
-            ShowInOutlineViewAttribute attr = ExtensibilityAccessor.GetAttribute<ShowInOutlineViewAttribute>(modelItem);
-            if (attr != null && !string.IsNullOrEmpty(attr.PromotedProperty))
-            {
-                return string.Equals(propertyName, attr.PromotedProperty, StringComparison.Ordinal);
-            }
-            return false;
-        }
-
-        internal static void AddChild(TreeViewItemViewModel parent, ModelItem item, object value, bool duplicatedNodeVisible, string childNodePrefix, ModelProperty trackingProperty)
-        {
-            // If necessary, evaluate uniqueness of given item
-            bool isUnique = false;
-            if (!duplicatedNodeVisible)
-            {
-                // Note: These evaluations expect item to be an immediate child of trackingProperty.Value
-                // Intermediate nodes would for example undermine simple check just below
-                //
-                // Caveat 1: Aim is to greatly reduce, not to eliminate, display of nodes visible elsewhere
-                // Caveat 1a: Nodes reachable from other isolated nodes are included in the collection
-                // Caveat 1b: Nodes that are not isolated may be reachable from isolated nodes and thus
-                // displayed together with the isolated ones; ShowPropertyInOutlineViewAsSiblingAttribute may make this seem normal
-                // (If complete duplicate elimination were the aim, would likely need a "never expand"
-                // display mode for duplicateNodeVisible=false children)
-                // Caveat 2: Use of single uniqueChildren field may cause all children of a second
-                // duplcatedNodeVisible=false property to be ignored if (fortunately only if) neither
-                // property uses ShowPropertyInOutlineViewAttribute(true) -- that attribute's default
-                // Caveat 3-n: Please see caveats described at top of UniqueModelItemHelper
-                if (1 >= item.Parents.Count())
-                {
-                    isUnique = true;
-                }
-                else
-                {
-                    // Avoided a thorough evaluation as long as we can
-                    if (null == parent.uniqueChildren)
-                    {
-                        parent.uniqueChildren = UniqueModelItemHelper.FindUniqueChildren(trackingProperty);
-                    }
-
-                    isUnique = parent.uniqueChildren.Contains(item);
-                }
-            }
-
-            // If displayable now, create the view model node
-            if (duplicatedNodeVisible || isUnique)
-            {
-                TreeViewItemViewModel child = TreeViewItemViewModel.CreateViewModel(parent, value);
-                child.NodePrefixText = childNodePrefix;
-                parent.AddChild(child, trackingProperty);
-            }
-            // Track for potential addition or removal of parents even if not presently visible
-            if (!duplicatedNodeVisible)
-            {
-                ModelItemImpl itemImpl = item as ModelItemImpl;
-                if (null != itemImpl)
-                {
-                    ChangeNotificationTracker tracker = parent.GetTracker(trackingProperty);
-                    tracker.AddCollection(itemImpl.InternalParents);
-                    tracker.AddCollection(itemImpl.InternalSources);
-                }
-            }
-        }
-
-        internal ChangeNotificationTracker GetTracker(ModelProperty modelProperty)
-        {
-            return GetTracker(modelProperty, true);
-        }
-
-        internal virtual ChangeNotificationTracker GetTracker(ModelProperty modelProperty, bool createNew)
-        {
-            ChangeNotificationTracker tracker = null;
-            if (!this.Trackers.TryGetValue(modelProperty, out tracker) && createNew)
-            {
-                tracker = new ChangeNotificationTracker(this, modelProperty);
-                Trackers.Add(modelProperty, tracker);
-            }
-            return tracker;
-        }
-
-        internal ChangeNotificationTracker GetTracker(TreeViewItemViewModel child)
-        {
-            ChangeNotificationTracker trackerForChild = null;
-            foreach (ChangeNotificationTracker tracker in this.Trackers.Values)
-            {
-                if (tracker.ChildViewModels.Contains(child))
-                {
-                    trackerForChild = tracker;
-                    break;
-                }
-            }
-            Fx.Assert(trackerForChild != null, "Tracker should not be null");
-            return trackerForChild;
-        }
-
-        internal virtual int FindInsertionIndex(ChangeNotificationTracker tracker)
-        {
-            int insertIndex = 0;
-            if (tracker != null && tracker.ChildViewModels != null && tracker.ChildViewModels.Count > 0)
-            {
-                //assume the childViewModels are in order
-                insertIndex = this.InternalChildren.IndexOf(tracker.ChildViewModels.Last()) + 1;
-            }
-            return insertIndex;
-        }
-
-        internal ModelProperty GetTrackingModelPropertyForChild(TreeViewItemViewModel child)
-        {
-            ModelProperty property = null;
-            foreach (ChangeNotificationTracker tracker in this.Trackers.Values)
-            {
-                if (tracker.ChildViewModels.Contains(child))
-                {
-                    property = tracker.ParentProperty;
-                    break;
-                }
-            }
-            return property;
-        }
-
-        internal virtual void UpdateState()
-        {
-        }
-
-        void InternalChildren_CollectionChanged(object sender, Collections.Specialized.NotifyCollectionChangedEventArgs e)
-        {
-            if (e.Action == Collections.Specialized.NotifyCollectionChangedAction.Remove)
-            {
-                foreach (TreeViewItemViewModel item in e.OldItems)
-                {
-                    this.ChildrenValueCache.Remove(item.GetValue());
-                }
-            }
-        }
-
-        protected void NotifyPropertyChanged(String propertyName)
-        {
-            if (PropertyChanged != null)
-            {
-                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-            }
-        }
-
-        [Flags]
-        internal enum TreeViewItemState
-        {
-            Default = 0,
-            HasChildren = 1,
-            HasSibling = 2
-        }
-
-        // <summary>
-        // Disposes this editing context.
-        // </summary>
-        public void CleanUp()
-        {
-            if (this.IsAlive)
-            {
-                CleanUpCore();
-                this.IsAlive = false;
-            }
-        }
-
-        protected virtual void CleanUpCore()
-        {
-            foreach (ChangeNotificationTracker t in this.Trackers.Values)
-            {
-                t.CleanUp();
-            }
-
-            foreach (TreeViewItemViewModel child in InternalChildren)
-            {
-                child.CleanUp();
-            }
-
-            this.InternalChildren.CollectionChanged -= InternalChildren_CollectionChanged;
-            this.Trackers = null;
-            this.InternalChildren = null;
-            this.ChildrenValueCache = null;
-            this.Children = null;
-            this.icon = null;
-            this.TreeViewItem = null;
-            this.Parent = null;
-        }
-    }
-
-    internal class TreeViewItemViewModel<T> : TreeViewItemViewModel
-    {
-        private T visualValue;
-        //this is the value the UI tree bind to
-        public virtual T VisualValue
-        {
-            get
-            {
-                return visualValue;
-            }
-            internal set
-            {
-                if (!Equals(visualValue, value))
-                {
-                    visualValue = value;
-                    NotifyPropertyChanged("VisualValue");
-                }
-            }
-        }
-        //this is for the view model processing
-        public T Value { get; protected set; }
-
-        public TreeViewItemViewModel(TreeViewItemViewModel parent)
-        {
-            this.Parent = parent;
-        }
-
-        public override string ToString()
-        {
-            if (Value != null)
-            {
-                return Value.ToString();
-            }
-
-            return base.ToString();
-        }
-
-        internal override object GetValue()
-        {
-            return this.Value;
-        }
-
-        protected override void CleanUpCore()
-        {
-            visualValue = default(T);
-            Value = default(T);
-            base.CleanUpCore();
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/UniqueModelItemHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TreeView/UniqueModelItemHelper.cs
deleted file mode 100644 (file)
index 2240a88..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-//-----------------------------------------------------------------------
-// <copyright file="UniqueModelItemHelper.cs" company="Microsoft Corporation">
-//      Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//-----------------------------------------------------------------------
-
-namespace System.Activities.Presentation.View.TreeView
-{
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.View.OutlineView;
-    using System.Collections.Generic;
-    using System.Linq;
-    
-    internal static class UniqueModelItemHelper
-    {
-        // Return HashSet containing ModelItems found only through given property: Cannot reach property.Parent without
-        // hitting property from these immediate descendents of property.Value
-        // Set may contain some internal duplication -- all nodes, not just the root, of a linked tree will be included
-        //
-        // Caveat 1: Due to problems removing Parents (e.g. Case content sometimes holds references to FlowSwitch after
-        // Case removed), this method is not entirely reliable -- customers may occasionally need to reopen Designer
-        // Caveat 2: Due to lazy loading of Properties (and therefore the back-pointing Parents collection), may
-        // temporarily include non-unique ModelItems in returned set -- cleared as tree or designer views expand
-        //
-        // (Throughout, cannot use ModelItem.GetParentEnumerator because that does not check all Sources and Parents)
-        internal static HashSet<ModelItem> FindUniqueChildren(ModelProperty property)
-        {
-            HashSet<ModelItem> retval = new HashSet<ModelItem>();
-            if (null != property && null != property.Parent && null != property.Value)
-            {
-                ModelItem target = property.Parent;
-                ModelItem expected = property.Value;
-                HashSet<ModelItem> visited = new HashSet<ModelItem>();
-
-                // Check all immediate children of property.Value
-                ModelItemCollection collection = expected as ModelItemCollection;
-                if (null == collection)
-                {
-                    ModelItemDictionary dictionary = expected as ModelItemDictionary;
-                    if (null == dictionary)
-                    {
-                        // ModelItem
-                        // Can't use UniqueRoute because we're starting at expected
-                        // Can't use EnqueueParents because we need to special-case given property
-                        // Instead confirm property.Value is not referenced anywhere else
-                        ModelItemImpl expectedImpl = expected as ModelItemImpl;
-                        if (null != expectedImpl)
-                        {
-                            bool justThisSource = true;
-
-                            // expectedImpl.InternalParents does not include ModelItems that are just Sources
-                            if (0 == expectedImpl.InternalParents.Count)
-                            {
-                                // expectedImpl.InternalSources would be similar but adds a wrapper we don't need here
-                                foreach (ModelProperty source in expected.Sources)
-                                {
-                                    if (null != source.Parent && !visited.Contains(source.Parent))
-                                    {
-                                        visited.Add(source.Parent);
-                                        if (!property.Equals(source) && !expected.Equals(source) &&
-                                            null == ExtensibilityAccessor.GetAttribute<HidePropertyInOutlineViewAttribute>(source))
-                                        {
-                                            // Found a non-ignored property from somewhere else referencing expected
-                                            justThisSource = false;
-                                            break;
-                                        }
-                                    }
-                                }
-                            }
-                            else
-                            {
-                                // Found a Parent that's not a Source.Parent: property.Value is in some collection
-                                justThisSource = false;
-                            }
-
-                            if (justThisSource)
-                            {
-                                retval.Add(expected);
-                            }
-                        }
-                    }
-                    else
-                    {
-                        // ModelItemDictionary
-                        foreach (KeyValuePair<ModelItem, ModelItem> child in dictionary)
-                        {
-                            if (null != child.Key && !visited.Contains(child.Key))
-                            {
-                                visited.Add(child.Key);
-                                if (UniqueModelItemHelper.UniqueRoute(child.Key, target, expected))
-                                {
-                                    retval.Add(child.Key);
-                                }
-                            }
-
-                            if (null != child.Value && !visited.Contains(child.Value))
-                            {
-                                visited.Add(child.Value);
-                                if (UniqueModelItemHelper.UniqueRoute(child.Value, target, expected))
-                                {
-                                    retval.Add(child.Value);
-                                }
-                            }
-                        }
-                    }
-                }
-                else
-                {
-                    // ModelItemCollection
-                    foreach (ModelItem child in collection)
-                    {
-                        if (null != child && !visited.Contains(child))
-                        {
-                            visited.Add(child);
-                            if (UniqueModelItemHelper.UniqueRoute(child, target, expected))
-                            {
-                                retval.Add(child);
-                            }
-                        }
-                    }
-                }
-            }
-
-            return retval;
-        }
-
-        // Enqueue Parents of given ModelItem
-        // Do not enqueue source Properties with a ViewIgnore attribute
-        private static void EnqueueParents(ModelItem item, Queue<ModelItem> queue)
-        {
-            Dictionary<ModelItem, int> nonSources = new Dictionary<ModelItem, int>();
-            if (null != item)
-            {
-                // Initialize nonSources dictionary to hold all Parents
-                foreach (ModelItem parent in item.Parents)
-                {
-                    if (nonSources.ContainsKey(parent))
-                    {
-                        ++nonSources[parent];
-                    }
-                    else
-                    {
-                        nonSources.Add(parent, 1);
-                    }
-                }
-
-                // Enqueue Sources and remove found items from nonSources
-                foreach (ModelProperty source in item.Sources)
-                {
-                    if (null != source.Parent)
-                    {
-                        if (null == ExtensibilityAccessor.GetAttribute<HidePropertyInOutlineViewAttribute>(source))
-                        {
-                            queue.Enqueue(source.Parent);
-                        }
-
-                        if (nonSources.ContainsKey(source.Parent))
-                        {
-                            --nonSources[source.Parent];
-                        }
-                    }
-                }
-
-                // Deal with the collections that contain this ModelItem
-                foreach (KeyValuePair<ModelItem, int> kvp in nonSources.Where((kvp) => 0 < kvp.Value))
-                {
-                    queue.Enqueue(kvp.Key);
-                }
-            }
-        }
-
-        // Determine if targetParent is only reachable from item via expectedParent
-        // Return true if the only routes from item to targetParent include expectedParent; false otherwise
-        // Do not search past source Properties with a ViewIgnore attribute but continue looking for targetParent
-        private static bool UniqueRoute(ModelItem item, ModelItem targetParent, ModelItem expectedParent)
-        {
-            bool retval = true;
-            if (null == item)
-            {
-                retval = false;
-            }
-            else
-            {
-                HashSet<ModelItem> visited = new HashSet<ModelItem>();
-                Queue<ModelItem> todo = new Queue<ModelItem>();
-                todo.Enqueue(item);
-
-                while (0 < todo.Count)
-                {
-                    ModelItem parent = todo.Dequeue();
-                    if (null != parent && !visited.Contains(parent))
-                    {
-                        visited.Add(parent);
-
-                        if (parent.Equals(targetParent))
-                        {
-                            // Failure: Route was not unique, have reached target without passing expectedParent
-                            retval = false;
-                            break;
-                        }
-                        else if (!parent.Equals(expectedParent))
-                        {
-                            UniqueModelItemHelper.EnqueueParents(parent, todo);
-                        }
-                    }
-                }
-            }
-
-            return retval;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypeBrowser.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypeBrowser.xaml.cs
deleted file mode 100644 (file)
index 89a5226..0000000
+++ /dev/null
@@ -1,857 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Collections.ObjectModel;
-    using System.ComponentModel;
-    using System.IO;
-    using System.Linq;
-    using System.Reflection;
-    using System.Windows;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Controls;
-    using System.Windows.Input;
-    using System.Collections.Specialized;
-    using System.Collections.Generic;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Text;
-    using System.ComponentModel.Design;
-    using System.Activities.Presentation.Hosting;
-    using System.Windows.Threading;
-    using Microsoft.Activities.Presentation;
-
-    internal sealed partial class TypeBrowser : DialogWindow
-    {
-        static readonly DependencyProperty SelectedTypeProperty =
-            DependencyProperty.Register("SelectedType",
-            typeof(Type),
-            typeof(TypeBrowser),
-            new UIPropertyMetadata());
-
-        static readonly DependencyProperty HasGenericTypesProperty =
-            DependencyProperty.Register("HasGenericTypes",
-            typeof(bool),
-            typeof(TypeBrowser));
-
-        static readonly DependencyProperty GenericTypeNameProperty =
-            DependencyProperty.Register("GenericTypeName",
-            typeof(String),
-            typeof(TypeBrowser));
-
-        static readonly DependencyProperty GenericTypeMappingProperty =
-            DependencyProperty.Register("GenericTypeMapping",
-            typeof(ObservableCollection<TypeKeyValue>),
-            typeof(TypeBrowser));
-
-        static readonly DependencyProperty ConcreteTypeProperty =
-            DependencyProperty.Register("ConcreteType",
-            typeof(Type),
-            typeof(TypeBrowser));
-
-        static Size size = Size.Empty;
-
-        SearchAction currentSearch = null;
-
-        ObservableCollection<AssemblyNode> localAssemblies;
-        ObservableCollection<AssemblyNode> referenceAssemblies;
-        AssemblyContextControlItem assemblyContext;
-        Func<Type, bool> filter;
-        DesignerPerfEventProvider perfEventProvider;
-
-        public TypeBrowser(AssemblyContextControlItem assemblyContext, EditingContext context, Func<Type, bool> filter)
-        {
-            this.assemblyContext = assemblyContext;
-            this.Context = context;
-            this.filter = filter;
-            SetValue(GenericTypeMappingProperty, new ObservableCollection<TypeKeyValue>());
-            GenericTypeMapping.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(GenericTypeMappingCollectionChanged);
-            InitializeComponent();
-            this.typeEntryTextBox.Focus();
-
-            if (!size.IsEmpty)
-            {
-                this.Height = size.Height;
-                this.Width = size.Width;
-            }
-
-            this.SizeChanged += new SizeChangedEventHandler(TypeBrowser_SizeChanged);
-
-            this.HelpKeyword = HelpKeywords.TypeBrowser;
-            this.perfEventProvider = new DesignerPerfEventProvider();
-        }
-
-        static void TypeBrowser_SizeChanged(object sender, SizeChangedEventArgs e)
-        {
-            TypeBrowser.size = e.NewSize;
-        }
-
-        Type SelectedType
-        {
-            get { return (Type)GetValue(SelectedTypeProperty); }
-            set { SetValue(SelectedTypeProperty, value); }
-        }
-
-        bool HasGenericTypes
-        {
-            get { return (bool)GetValue(HasGenericTypesProperty); }
-            set { SetValue(HasGenericTypesProperty, value); }
-        }
-
-        string GenericTypeName
-        {
-            get { return (string)GetValue(GenericTypeNameProperty); }
-            set { SetValue(GenericTypeNameProperty, value); }
-        }
-
-        ObservableCollection<TypeKeyValue> GenericTypeMapping
-        {
-            get { return (ObservableCollection<TypeKeyValue>)GetValue(GenericTypeMappingProperty); }
-            set { SetValue(GenericTypeMappingProperty, value); }
-        }
-
-        public Type ConcreteType
-        {
-            get { return (Type)GetValue(ConcreteTypeProperty); }
-            private set { SetValue(ConcreteTypeProperty, value); }
-        }
-
-        public ObservableCollection<AssemblyNode> LocalAssemblies
-        {
-            get
-            {
-                if (null == this.localAssemblies)
-                {
-                    this.localAssemblies = new ObservableCollection<AssemblyNode>();
-                    if (null != this.assemblyContext)
-                    {
-                        if (null != this.assemblyContext.LocalAssemblyName)
-                        {
-                            IMultiTargetingSupportService multiTargetingSupportService = this.Context.Services.GetService<IMultiTargetingSupportService>();
-                            Assembly local = AssemblyContextControlItem.GetAssembly(this.assemblyContext.LocalAssemblyName, multiTargetingSupportService);
-                            if (local != null)
-                            {
-                                this.localAssemblies.Add(new AssemblyNode(local, true, this.filter, this.Context));
-                            }
-                        }
-                    }
-
-                    if (this.localAssemblies.Count == 0)
-                    {
-                        this.LocalAssembly.Visibility = Visibility.Collapsed;
-                    }
-                    else
-                    {
-                        this.LocalAssembly.Visibility = Visibility.Visible;
-                    }
-                }
-                return this.localAssemblies;
-            }
-        }
-
-        public ObservableCollection<AssemblyNode> ReferenceAssemblies
-        {
-            get
-            {
-                if (null == this.referenceAssemblies)
-                {
-                    this.referenceAssemblies = new ObservableCollection<AssemblyNode>();
-                    if (null != this.assemblyContext)
-                    {
-                        IMultiTargetingSupportService multiTargetingSupportService = this.Context.Services.GetService<IMultiTargetingSupportService>();
-                        IEnumerable<Assembly> assemblies = this.assemblyContext.GetEnvironmentAssemblies(multiTargetingSupportService);
-                        foreach (Assembly assembly in assemblies.OrderBy<Assembly, string>(p => p.FullName))
-                        {
-                            this.referenceAssemblies.Add(new AssemblyNode(assembly, false, this.filter, this.Context));
-                        }
-                    }
-                }
-                return this.referenceAssemblies;
-            }
-        }
-
-        public bool? ShowDialog(DependencyObject owner)
-        {
-            WindowHelperService.TrySetWindowOwner(owner, this.Context, this);
-            this.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(() => { this.perfEventProvider.TypeBrowserApplicationIdleAfterShowDialog(); }));
-            return base.ShowDialog();
-        }
-
-        protected override void OnKeyDown(KeyEventArgs e)
-        {
-            if (e.Key == Key.Escape)
-            {
-                this.DialogResult = false;
-                e.Handled = true;
-            }
-            else if (e.Key == Key.Enter && null != SelectedType)
-            {
-                OnDialogClose();
-                e.Handled = true;
-            }
-            else
-            {
-                base.OnKeyDown(e);
-            }
-        }
-
-        protected override System.Windows.Automation.Peers.AutomationPeer OnCreateAutomationPeer()
-        {
-            return new UIElementAutomationPeer(this);
-        }
-
-        private void GenericTypeMappingCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
-        {
-            this.HasGenericTypes = GenericTypeMapping.Count > 0 ? true : false;
-            if (this.HasGenericTypes)
-            {
-                string strName = this.SelectedType.FullName;
-                this.GenericTypeName = strName.Substring(0, strName.Length - 2) + " <";
-            }
-            else
-            {
-                this.GenericTypeName = null;
-            }
-        }
-
-        private Type ResolveType(out string errorTitle, out string errorMessage)
-        {
-            errorTitle = null;
-            errorMessage = null;
-            Type result = this.SelectedType;
-
-            try
-            {
-                IMultiTargetingSupportService multiTargetingSupport = this.Context.Services.GetService<IMultiTargetingSupportService>();
-                if (multiTargetingSupport != null)
-                {
-                    result = multiTargetingSupport.GetRuntimeType(result);
-                }
-
-                if (result == null)
-                {
-                    errorTitle = SR.TypeBrowserErrorMessageTitle;
-                    errorMessage = SR.TypeBrowserError;
-                    return null;
-                }
-
-                if (result.IsGenericTypeDefinition)
-                {
-                    bool isValid = true;
-                    //get number of generic parameters in edited type
-                    Type[] arguments = new Type[this.GenericTypeMapping.Count];
-
-                    //for each argument, get resolved type
-                    for (int i = 0; i < this.GenericTypeMapping.Count && isValid; ++i)
-                    {
-                        arguments[i] = this.GenericTypeMapping[i].GetConcreteType();
-                        if (multiTargetingSupport != null && arguments[i] != null)
-                        {
-                            arguments[i] = multiTargetingSupport.GetRuntimeType(arguments[i]);
-                        }
-                        isValid = isValid && (null != arguments[i]);
-                    }
-
-                    //if all parameters are resolved, create concrete type
-                    if (isValid)
-                    {
-                        result = result.MakeGenericType(arguments);
-                    }
-                    else
-                    {
-                        errorTitle = SR.TypeBrowserErrorMessageTitle;
-                        errorMessage = SR.TypeResolverError;
-                        result = null;
-                    }
-                }
-            }
-            catch (ArgumentException err)
-            {
-                errorTitle = err.GetType().Name;
-                errorMessage = err.Message;
-                return null;
-            }
-
-            return result;
-        }
-
-        private void OnOkClick(object sender, RoutedEventArgs args)
-        {
-            OnDialogClose();
-        }
-
-        private void OnCancelClick(object sender, RoutedEventArgs args)
-        {
-            this.DialogResult = false;
-        }
-
-        private void OnTypeDoubleClick(object sender, RoutedEventArgs args)
-        {
-            if (((System.Windows.Input.MouseButtonEventArgs)(args)).ChangedButton == MouseButton.Left)
-            {
-                TypeNode entry = ((TreeViewItem)sender).Header as TypeNode;
-                if (null != entry && entry.Data is Type)
-                {
-                    OnDialogClose();
-                    args.Handled = true;
-                }
-            }
-        }
-
-        private void OnDialogClose()
-        {
-            string errorTitle = null;
-            string errorMessage = null;
-
-            Type type = ResolveType(out errorTitle, out errorMessage);
-            if (null != type)
-            {
-                this.ConcreteType = type;
-                this.DialogResult = true;
-                this.perfEventProvider.TypeBrowserOkPressed();
-            }
-            else
-            {
-                MessageBox.Show(errorMessage, errorTitle, MessageBoxButton.OK, MessageBoxImage.Error);
-            }
-        }
-
-        private void OnTypeBrowserClickStart(object sender, RoutedEventArgs args)
-        {
-            TreeViewItem item = sender as TreeViewItem;
-            NamespaceNode ns = null;
-            if (null != item)
-            {
-                ns = item.Header as NamespaceNode;
-            }
-
-            if (null != ns && null == ns.Tag)
-            {
-                ns.Tag = string.Empty;
-                Mouse.OverrideCursor = Cursors.Wait;
-            }
-        }
-
-        private void OnTypeBrowserClickEnd(object sender, RoutedEventArgs args)
-        {
-            TreeViewItem item = sender as TreeViewItem;
-            if (null != item && item.Header is AssemblyNode && null != Mouse.OverrideCursor)
-            {
-                Mouse.OverrideCursor = null;
-            }
-        }
-
-        private void OnTypeSearchTextChanged(object sender, TextChangedEventArgs e)
-        {
-            string searchText = ((TextBox)sender).Text;
-
-            SearchAction newSearch = new SearchAction(searchText, this.localAssemblies, this.referenceAssemblies);
-            newSearch.Completed += delegate(object s, EventArgs args)
-            {
-                SearchAction senderAction = s as SearchAction;
-                SearchAction currentAction = this.currentSearch;
-                this.currentSearch = null;
-
-                if (senderAction == currentAction)
-                {
-                    TypeNode match = ((SearchActionEventArgs)args).Result as TypeNode;
-
-                    UpdateSelectedItem(match);
-                    if (match != null)
-                    {
-                        match.IsSelected = true;
-                    }
-                }
-            };
-
-            if (this.currentSearch != null)
-            {
-                this.currentSearch.Abort();
-            }
-
-            ClearSelection();
-
-            this.currentSearch = newSearch;
-            this.currentSearch.Run();
-        }
-
-        private void ClearSelection()
-        {
-            TypeNode currentSelection = this.typesTreeView.SelectedItem as TypeNode;
-            if (currentSelection != null)
-            {
-                currentSelection.IsSelected = false;
-            }
-        }
-
-        private void OnSelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
-        {
-            TypeNode entry = ((System.Windows.Controls.TreeView)sender).SelectedItem as TypeNode;
-            if (entry != null && this.SelectedType != entry.Data as Type)
-            {
-                UpdateSelectedItem(entry);
-                if (null != this.SelectedType)
-                {
-                    typeEntryTextBox.TextChanged -= new TextChangedEventHandler(OnTypeSearchTextChanged);
-                    typeEntryTextBox.Text = TypeNameHelper.GetDisplayName(this.SelectedType, true);
-                    typeEntryTextBox.TextChanged += new TextChangedEventHandler(OnTypeSearchTextChanged);
-                }
-            }
-        }
-
-        private void UpdateSelectedItem(TypeNode entry)
-        {
-            GenericTypeMapping.Clear();
-
-            SelectedType = (null != entry ? entry.Data as Type : null);
-
-            if (null != this.SelectedType)
-            {
-                if (this.SelectedType.IsGenericTypeDefinition)
-                {
-                    this.ConcreteType = null;
-                    Type[] generics = this.SelectedType.GetGenericArguments();
-                    foreach (Type t in generics)
-                    {
-                        this.GenericTypeMapping.Add(new TypeKeyValue(t, null));
-                    }
-                }
-                else
-                {
-                    this.ConcreteType = this.SelectedType;
-                }
-            }
-            else
-            {
-                this.ConcreteType = null;
-            }
-        }
-
-        internal class Node : INotifyPropertyChanged
-        {
-            public event PropertyChangedEventHandler PropertyChanged;
-
-            private bool isExpanded;
-            private bool isSelected;
-            private Visibility visibility;
-
-            protected Node()
-            {
-                this.isExpanded = false;
-                this.isSelected = false;
-                this.visibility = Visibility.Visible;
-            }
-
-            protected void Notify(string property)
-            {
-                if (PropertyChanged != null)
-                {
-                    PropertyChanged(this, new PropertyChangedEventArgs(property));
-                }
-            }
-
-            public bool IsExpanded
-            {
-                get
-                {
-                    return this.isExpanded;
-                }
-                set
-                {
-                    if (this.isExpanded != value)
-                    {
-                        this.isExpanded = value;
-                        Notify("IsExpanded");
-                    }
-                }
-            }
-
-            public bool IsSelected
-            {
-                get
-                {
-                    return this.isSelected;
-                }
-                set
-                {
-                    if (this.isSelected != value)
-                    {
-                        this.isSelected = value;
-                        Notify("IsSelected");
-                    }
-                }
-            }
-
-            public Visibility Visibility
-            {
-                get
-                {
-                    return this.visibility;
-                }
-                set
-                {
-                    if (this.visibility != value)
-                    {
-                        this.visibility = value;
-                        Notify("Visibility");
-                    }
-                }
-            }
-
-            public object Tag
-            {
-                get;
-                set;
-            }
-        }
-
-        internal class AssemblyNode : Node
-        {
-            string displayName;
-            Assembly assembly;
-            bool isLocal;
-            Func<Type, bool> filter;
-            EditingContext context;
-
-            public AssemblyNode(Assembly assembly, bool isLocal, Func<Type, bool> filter, EditingContext context)
-            {
-                if (null == assembly)
-                {
-                    throw FxTrace.Exception.AsError(new ArgumentNullException("assembly"));
-                }
-                this.assembly = assembly;
-                this.isLocal = isLocal;
-                this.displayName = GetDisplayName(this.assembly.GetName());
-                this.filter = filter;
-                this.context = context;
-            }
-
-            private static string GetDisplayName(AssemblyName name)
-            {
-                StringBuilder sb = new StringBuilder();
-                if (name != null && name.Name != null)
-                {
-                    sb.Append(name.Name);
-                    if (name.Version != null)
-                    {
-                        sb.Append(" [");
-                        sb.Append(name.Version.Major);
-                        sb.Append(".");
-                        sb.Append(name.Version.Minor);
-                        sb.Append(".");
-                        sb.Append(name.Version.Build);
-                        sb.Append(".");
-                        sb.Append(name.Version.Revision);
-                        sb.Append("]");
-                    }
-                }
-                return sb.ToString();
-            }
-
-            public string DisplayName
-            {
-                get { return this.displayName; }
-            }
-
-            private ObservableCollection<NamespaceNode> namespaces;
-            public ObservableCollection<NamespaceNode> Namespaces
-            {
-                get
-                {
-                    if (namespaces == null)
-                    {
-                        namespaces = new ObservableCollection<NamespaceNode>();
-
-                        try
-                        {
-                            Func<Type, bool> typeFilter = this.filter;
-                            IMultiTargetingSupportService multiTargetingSupport = this.context.Services.GetService<IMultiTargetingSupportService>();
-                            if (multiTargetingSupport != null && typeFilter != null)
-                            {
-                                typeFilter = (type) => this.filter(multiTargetingSupport.GetRuntimeType(type));
-                            }
-
-                            var exportedTypes =
-                                from type in (this.isLocal ? this.assembly.GetTypes() : this.assembly.GetExportedTypes())
-                                where (type.IsPublic && type.IsVisible && (typeFilter == null || typeFilter(type)))
-                                orderby type.Namespace, type.Name
-                                select type;
-
-                            NamespaceNode lastNamespace = null;
-                            foreach (Type type in exportedTypes)
-                            {
-                                if (lastNamespace == null || !StringComparer.OrdinalIgnoreCase.Equals(lastNamespace.DisplayName, type.Namespace))
-                                {
-                                    lastNamespace = new NamespaceNode(type.Namespace);
-                                    namespaces.Add(lastNamespace);
-                                }
-
-                                lastNamespace.Types.Add(new TypeNode(type));
-                            }
-                        }
-                        catch (NotSupportedException)
-                        {
-                            //Dynamic (in memory) assemblies will throw exception when this method is called
-                            //that's the reason i'm swollowing that exception
-                        }
-
-                    }
-                    return namespaces;
-                }
-            }
-
-            public string Data
-            {
-                get { return this.displayName; }
-            }
-
-            public override string ToString()
-            {
-                return this.displayName;
-            }
-        }
-
-        internal class NamespaceNode : Node
-        {
-
-            private string displayName;
-            public string DisplayName
-            {
-                get
-                {
-                    return this.displayName;
-                }
-            }
-
-            private ObservableCollection<TypeNode> types;
-            public ObservableCollection<TypeNode> Types
-            {
-                get
-                {
-                    return this.types;
-                }
-            }
-
-            public string Data
-            {
-                get { return this.displayName; }
-            }
-
-            public NamespaceNode(string name)
-            {
-                this.displayName = name;
-                this.types = new ObservableCollection<TypeNode>();
-            }
-        }
-
-        internal class TypeNode : Node
-        {
-            private Type type;
-
-            private string displayName;
-            public string DisplayName
-            {
-                get
-                {
-                    return this.displayName;
-                }
-            }
-
-            private string fullName;
-            public string FullName
-            {
-                get
-                {
-                    return this.fullName;
-                }
-            }
-
-            public Type Data
-            {
-                get { return this.type; }
-            }
-
-            public TypeNode(Type type)
-            {
-                this.type = type;
-                this.displayName = TypeNameHelper.GetDisplayName(type, false);
-                this.fullName = TypeNameHelper.GetDisplayName(type, true);
-            }
-        }
-
-        private class SearchActionEventArgs : EventArgs
-        {
-            public object Result
-            {
-                get;
-                set;
-            }
-        }
-
-        private class SearchAction
-        {
-            private string searchText;
-            Collection<AssemblyNode>[] range;
-            DispatcherOperation dispatcherOperation;
-
-            public event EventHandler Completed;
-
-            public SearchAction(string searchText, Collection<AssemblyNode> localAssemblies, Collection<AssemblyNode> referenceAssemblies)
-            {
-                this.searchText = searchText;
-                this.range = new Collection<AssemblyNode>[] { localAssemblies, referenceAssemblies };
-            }
-
-
-            public void Run()
-            {
-                this.dispatcherOperation = Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Input, new Func<TypeNode>(this.OnRun));
-                this.dispatcherOperation.Completed += this.OnCompleted;
-            }
-
-            public bool Abort()
-            {
-                if (this.dispatcherOperation != null)
-                {
-                    return this.dispatcherOperation.Abort();
-                }
-                return true;
-            }
-
-            private TypeNode OnRun()
-            {
-                bool noSearch = string.IsNullOrEmpty(searchText);
-                Func<TypeNode, string, bool> matchAlgorithm = SearchAction.MatchShortName;
-
-                TypeNode match = null;
-                TypeNode firstCandidate = null;
-                bool tooManyCandiates = false;
-
-                if (!noSearch && searchText.Contains('.'))
-                {
-                    matchAlgorithm = SearchAction.MatchFullName;
-                }
-
-                foreach (Collection<AssemblyNode> assemblies in this.range)
-                {
-                    foreach (AssemblyNode assembly in assemblies)
-                    {
-                        Visibility assemblyVisibility = Visibility.Collapsed;
-                        bool assemblyIsExpanded = false;
-
-                        if (noSearch)
-                        {
-                            assemblyVisibility = Visibility.Visible;
-                        }
-
-                        foreach (NamespaceNode ns in assembly.Namespaces)
-                        {
-                            Visibility namespaceVisibility = Visibility.Collapsed;
-                            bool namespaceIsExpanded = false;
-
-                            if (noSearch)
-                            {
-                                namespaceVisibility = Visibility.Visible;
-                            }
-
-                            foreach (TypeNode entry in ns.Types)
-                            {
-                                if (noSearch)
-                                {
-                                    entry.Visibility = Visibility.Visible;
-                                }
-                                else if (matchAlgorithm(entry, searchText))
-                                {
-                                    entry.Visibility = Visibility.Visible;
-                                    assemblyVisibility = Visibility.Visible;
-                                    assemblyIsExpanded = true;
-                                    namespaceVisibility = Visibility.Visible;
-                                    namespaceIsExpanded = true;
-
-                                    if (string.Equals(searchText, entry.FullName, StringComparison.OrdinalIgnoreCase))
-                                    {
-                                        match = entry;
-                                    }
-
-                                    if (firstCandidate == null)
-                                    {
-                                        firstCandidate = entry;
-                                    }
-                                    else if (!tooManyCandiates)
-                                    {
-                                        tooManyCandiates = true;
-                                    }
-                                }
-                                else
-                                {
-                                    entry.Visibility = Visibility.Collapsed;
-                                }
-                            }
-
-                            if (searchText.Contains('.') && ns.DisplayName != null && ns.DisplayName.StartsWith(searchText, StringComparison.OrdinalIgnoreCase))
-                            {
-                                namespaceIsExpanded = false;
-                            }
-
-                            if (namespaceIsExpanded)
-                            {
-                                ns.Tag = string.Empty;
-                            }
-
-                            ns.Visibility = namespaceVisibility;
-                            ns.IsExpanded = namespaceIsExpanded;
-                        }
-
-                        assembly.Visibility = assemblyVisibility;
-                        assembly.IsExpanded = assemblyIsExpanded;
-                    }
-                }
-
-                if (match == null && !tooManyCandiates)
-                {
-                    match = firstCandidate;
-                }
-
-                return match;
-            }
-
-            private void OnCompleted(object sender, EventArgs args)
-            {
-                this.dispatcherOperation.Completed -= this.OnCompleted;
-                if (this.Completed != null)
-                {
-                    SearchActionEventArgs arg = new SearchActionEventArgs();
-                    arg.Result = this.dispatcherOperation.Result;
-                    this.Completed(this, arg);
-                }
-            }
-
-            // "abc.def" matches regex ^.*\.abc\.def.* or ^abc\.def.*, but does not match ^.*[^.]abc\.def.*
-            private static bool MatchFullName(TypeNode type, string searchText)
-            {
-                if (searchText.StartsWith(".", StringComparison.OrdinalIgnoreCase))
-                {
-                    return -1 != type.FullName.IndexOf(searchText, StringComparison.OrdinalIgnoreCase);
-                }
-
-                if (type.FullName.StartsWith(searchText, StringComparison.OrdinalIgnoreCase))
-                {
-                    return true;
-                }
-
-                if (-1 != type.FullName.IndexOf("." + searchText, StringComparison.OrdinalIgnoreCase))
-                {
-                    return true;
-                }
-
-                return false;
-            }
-
-            private static bool MatchShortName(TypeNode type, string searchText)
-            {
-                return type.DisplayName.StartsWith(searchText, StringComparison.OrdinalIgnoreCase);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypeKeyValue.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypeKeyValue.cs
deleted file mode 100644 (file)
index 106e4ef..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Collections.ObjectModel;
-    using System.ComponentModel;
-    using System.Windows;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Input;
-
-    //helper class, used to resolve generics. supports cascading generic type arguments (i.e. IList< IList < int > >)
-    internal class TypeKeyValue : INotifyPropertyChanged
-    {
-        string errorText;
-        //generic type
-        Type genericType;
-
-        bool isValid = true;
-        //generic's type generic parameters
-        ObservableCollection<TypeKeyValue> subTypes = new ObservableCollection<TypeKeyValue>();
-        //target type
-        Type targetType;
-        //type resolver reference
-        Action<TypeKeyValue> typeChangedCallBack;
-        //if this type is selected
-        bool isSelected;
-        Func<Type, bool> filter;
-        ObservableCollection<Type> mostRecentlyUsedTypes;
-        string hintText = null;
-        //if type presenter should skip the drop down list
-        bool browseTypeDirectly = true;
-
-        public TypeKeyValue(Type genericType, Action<TypeKeyValue> typeChangedCallBack)
-        {
-            this.GenericType = genericType;
-            this.typeChangedCallBack = typeChangedCallBack;
-        }
-
-        public event PropertyChangedEventHandler PropertyChanged;
-
-        public string ErrorText
-        {
-            get { return this.errorText; }
-            set
-            {
-                this.errorText = value;
-                OnPropertyChanged("ErrorText");
-            }
-        }
-
-        public Type GenericType
-        {
-            get { return this.genericType; }
-            set
-            {
-                this.genericType = value;
-                OnPropertyChanged("GenericType");
-            }
-        }
-
-        public bool IsSelected
-        {
-            get { return this.isSelected; }
-            set
-            {
-                this.isSelected = value;
-                OnPropertyChanged("IsSelected");
-            }
-        }
-
-        public Func<Type, bool> Filter
-        {
-            get { return this.filter; }
-            set
-            {
-                this.filter = value;
-                OnPropertyChanged("Filter");
-            }
-        }
-
-        public ObservableCollection<Type> MostRecentlyUsedTypes
-        {
-            get { return this.mostRecentlyUsedTypes; }
-            set
-            {
-                this.mostRecentlyUsedTypes = value;
-                OnPropertyChanged("MostRecentlyUsedTypes");
-            }
-        }
-
-        public string HintText
-        {
-            get { return this.hintText; }
-            set
-            {
-                this.hintText = value;
-                this.OnPropertyChanged("HintText");
-            }
-        }
-
-        public bool BrowseTypeDirectly
-        {
-            get { return this.browseTypeDirectly; }
-            set
-            {
-                this.browseTypeDirectly = value;
-                OnPropertyChanged("BrowseTypeDirectly");
-            }
-        }
-
-        public bool IsValid
-        {
-            get { return this.isValid; }
-            set
-            {
-                this.isValid = value;
-                OnPropertyChanged("IsValid");
-            }
-        }
-
-
-        public ObservableCollection<TypeKeyValue> SubTypes
-        {
-            get { return this.subTypes; }
-        }
-
-        public Type TargetType
-        {
-            get { return this.targetType; }
-            set
-            {
-                this.targetType = value;
-                //whenever target type changes, check if there are some generic parameters required
-                LoadGenericTypes();
-                OnPropertyChanged("TargetType");
-                if (typeChangedCallBack != null)
-                {
-                    typeChangedCallBack(this);
-                }
-            }
-        }
-
-        public Type GetConcreteType()
-        {
-            Type result = null;
-            if (null != this.targetType)
-            {
-                //do we have generic?
-                if (this.targetType.IsGenericTypeDefinition)
-                {
-                    //resolve all generic arguments
-                    Type[] arguments = new Type[this.subTypes.Count];
-                    bool isValid = true;
-                    for (int i = 0; i < this.subTypes.Count && isValid; ++i)
-                    {
-                        arguments[i] = this.subTypes[i].GetConcreteType();
-                        isValid = (null != arguments[i]);
-                    }
-                    if (isValid)
-                    {
-                        //and create target type
-                        result = this.targetType.MakeGenericType(arguments);
-                    }
-                }
-                else
-                {
-                    result = targetType;
-                }
-            }
-            return result;
-        }
-
-        void LoadGenericTypes()
-        {
-            this.subTypes.Clear();
-            if (null != this.targetType && this.targetType.IsGenericTypeDefinition)
-            {
-                Type[] generics = this.targetType.GetGenericArguments();
-                foreach (Type t in generics)
-                {
-                    TypeKeyValue entry = new TypeKeyValue(t, typeChangedCallBack);
-                    this.subTypes.Add(entry);
-                    typeChangedCallBack(entry);
-                }
-            }
-        }
-
-        void OnPropertyChanged(string propertyName)
-        {
-            if (null != PropertyChanged)
-            {
-                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-            }
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypePresenter.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypePresenter.xaml.cs
deleted file mode 100644 (file)
index a3fcfa0..0000000
+++ /dev/null
@@ -1,912 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Collections.Specialized;
-    using System.ComponentModel;
-    using System.Globalization;
-    using System.Linq;
-    using System.Windows;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Windows.Input;
-    using System.Runtime;
-    using System.Windows.Automation;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows.Threading;
-    using System.Activities.Presentation.Hosting;
-    using Microsoft.Activities.Presentation;
-
-    // This control presents a System.Type as textblock, which is editable on click, or F2.
-    public sealed partial class TypePresenter : ContentControl, INotifyPropertyChanged
-    {
-        public static readonly DependencyProperty ContextProperty =
-            DependencyProperty.Register("Context",
-            typeof(EditingContext),
-            typeof(TypePresenter),
-            new PropertyMetadata(new PropertyChangedCallback(OnContextChanged)));
-
-        public static readonly DependencyProperty AllowNullProperty =
-            DependencyProperty.Register("AllowNull",
-            typeof(bool),
-            typeof(TypePresenter),
-            new PropertyMetadata(false, OnAllowNullChanged));
-
-        public static readonly DependencyProperty BrowseTypeDirectlyProperty =
-            DependencyProperty.Register("BrowseTypeDirectly",
-            typeof(bool),
-            typeof(TypePresenter),
-            new PropertyMetadata(false, OnBrowseTypeDirectlyChanged));
-
-        public static readonly DependencyProperty TypeProperty =
-            DependencyProperty.Register("Type",
-            typeof(Type),
-            typeof(TypePresenter),
-            new PropertyMetadata(null, new PropertyChangedCallback(OnTypeChanged)));
-
-        public static readonly DependencyProperty LabelProperty =
-            DependencyProperty.Register("Label",
-            typeof(string),
-            typeof(TypePresenter),
-            new PropertyMetadata(string.Empty));
-
-        public static readonly DependencyProperty FilterProperty =
-            DependencyProperty.Register("Filter",
-            typeof(Func<Type, bool>),
-            typeof(TypePresenter),
-            new PropertyMetadata(new PropertyChangedCallback(OnFilterChanged)));
-
-        static readonly DependencyPropertyKey TextPropertyKey = DependencyProperty.RegisterReadOnly(
-            "Text",
-            typeof(string),
-            typeof(TypePresenter),
-            new UIPropertyMetadata(null));
-
-        public static readonly DependencyProperty TextProperty = TextPropertyKey.DependencyProperty;
-
-        public static readonly DependencyProperty MostRecentlyUsedTypesProperty =
-            DependencyProperty.Register("MostRecentlyUsedTypes",
-            typeof(ObservableCollection<Type>),
-            typeof(TypePresenter),
-            new PropertyMetadata(TypePresenter.DefaultMostRecentlyUsedTypes, new PropertyChangedCallback(OnMostRecentlyUsedTypesPropertyChanged), new CoerceValueCallback(OnCoerceMostRecentlyUsedTypes)));
-
-        public static readonly DependencyProperty CenterActivityTypeResolverDialogProperty =
-            DependencyProperty.Register("CenterActivityTypeResolverDialog",
-            typeof(bool),
-            typeof(TypePresenter),
-            new PropertyMetadata(true));
-
-        public static readonly DependencyProperty CenterTypeBrowserDialogProperty =
-            DependencyProperty.Register("CenterTypeBrowserDialog",
-            typeof(bool),
-            typeof(TypePresenter),
-            new PropertyMetadata(true));
-
-        public static readonly RoutedEvent TypeBrowserOpenedEvent = EventManager.RegisterRoutedEvent(
-            "TypeBrowserOpened",
-            RoutingStrategy.Bubble,
-            typeof(RoutedEventHandler),
-            typeof(TypePresenter));
-
-        public static readonly RoutedEvent TypeBrowserClosedEvent = EventManager.RegisterRoutedEvent(
-            "TypeBrowserClosed",
-            RoutingStrategy.Bubble,
-            typeof(RoutedEventHandler),
-            typeof(TypePresenter));
-
-        public static readonly RoutedEvent TypeChangedEvent = EventManager.RegisterRoutedEvent(
-            "TypeChanged",
-            RoutingStrategy.Bubble,
-            typeof(RoutedEventHandler),
-            typeof(TypePresenter));
-
-        static List<Type> defaultTypes = null;
-        static ObservableCollection<Type> defaultMostRecentlyUsedTypes;
-
-        internal static List<Type> DefaultTypes
-        {
-            get
-            {
-                if (defaultTypes == null)
-                {
-                    defaultTypes = new List<Type>
-                    {
-                        typeof(Boolean),
-                        typeof(Int32),
-                        typeof(String),
-                        typeof(Object),
-                    };
-                }
-                return defaultTypes;
-            }
-        }
-
-        public static ObservableCollection<Type> DefaultMostRecentlyUsedTypes
-        {
-            get
-            {
-                if (defaultMostRecentlyUsedTypes == null)
-                {
-                    defaultMostRecentlyUsedTypes = new ObservableCollection<Type>(DefaultTypes);
-                }
-                return defaultMostRecentlyUsedTypes;
-            }
-        }
-
-        [SuppressMessage(FxCop.Category.Usage, FxCop.Rule.CollectionPropertiesShouldBeReadOnly,
-            Justification = "Setter is provided to bind data on this property.")]
-        [Fx.Tag.KnownXamlExternal]
-        public ObservableCollection<Type> MostRecentlyUsedTypes
-        {
-            get { return (ObservableCollection<Type>)GetValue(MostRecentlyUsedTypesProperty); }
-            set { SetValue(MostRecentlyUsedTypesProperty, value); }
-        }
-
-        bool isMouseLeftButtonDown = true;
-        Type lastSelection;
-        TypeWrapper nullTypeWrapper = null;
-
-        public TypePresenter()
-        {
-            InitializeComponent();
-
-            OnBrowseTypeDirectlyChanged(this, new DependencyPropertyChangedEventArgs(
-                TypePresenter.BrowseTypeDirectlyProperty, false, this.BrowseTypeDirectly));
-            DisableEdit();
-
-            this.typeComboBox.DropDownClosed += OnTypePresenterDropDownClosed;
-            this.typeComboBox.PreviewLostKeyboardFocus += OnTypePresenterComboBoxPreviewLostKeyboardFocus;
-            this.typeComboBox.LostFocus += OnTypePresenterComboBoxLostFocus;
-            this.typeComboBox.KeyDown += OnTypePresenterKeyDown;
-
-            Binding textToType = new Binding();
-            textToType.Converter = new TypeWrapperConverter(this);
-            textToType.Source = this;
-            textToType.Path = new PropertyPath(TypeProperty);
-            this.typeComboBox.SetBinding(ComboBox.SelectedItemProperty, textToType);
-            this.lastSelection = (Type)TypeProperty.DefaultMetadata.DefaultValue;
-
-            MultiBinding automationNameBinding = new MultiBinding();
-            Binding labelBinding = new Binding("Label");
-            labelBinding.Source = this;
-            automationNameBinding.Bindings.Add(labelBinding);
-            Binding typeBinding = new Binding("Text");
-            typeBinding.Source = this.typeTextBlock;
-            automationNameBinding.Bindings.Add(typeBinding);
-            automationNameBinding.Converter = new AutomationNameConverter();
-            this.SetBinding(AutomationProperties.NameProperty, automationNameBinding);
-
-            this.Loaded += new RoutedEventHandler(TypePresenter_Loaded);
-            this.Unloaded += new RoutedEventHandler(TypePresenter_Unloaded);
-        }
-
-        void OnTypePresenterComboBoxPreviewLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
-        {
-            if (this.typeComboBox.Visibility == Visibility.Visible && this.typeComboBox.IsDropDownOpen)
-            {
-                e.Handled = true;
-            }
-        }
-
-        void OnTypePresenterComboBoxLostFocus(object sender, RoutedEventArgs e)
-        {
-            TypeWrapper tw = (TypeWrapper)this.typeComboBox.SelectedItem;
-            if (tw != null)
-            {
-                if (tw.Type == typeof(ArrayOf<>) || tw.Type == typeof(BrowseForType))
-                {
-                    SetComboBoxToLastSelection();
-                }
-            }
-        }
-
-        void SetComboBoxToLastSelection()
-        {
-            if (this.lastSelection == null)
-            {
-                this.typeComboBox.SelectedIndex = this.typeComboBox.Items.IndexOf(this.NullTypeWrapper);
-            }
-            else
-            {
-                for (int i = 0; i < this.typeComboBox.Items.Count; i++)
-                {
-                    TypeWrapper typeWrapper = (TypeWrapper)this.typeComboBox.Items.GetItemAt(i);
-                    if (typeWrapper.IsTypeDefinition && Type.Equals(this.lastSelection, typeWrapper.Type))
-                    {
-                        this.typeComboBox.SelectedIndex = i;
-                        break;
-                    }
-                }
-            }
-        }
-
-        public void FocusOnVisibleControl()
-        {
-            if (BrowseTypeDirectly)
-            {
-                this.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, (Action)(() =>
-                {
-                    Keyboard.Focus(this.typeTextBlock);
-                }));
-            }
-            else
-            {
-                this.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, (Action)(() =>
-                {
-                    Keyboard.Focus(this.typeComboBox);
-                }));
-            }
-        }
-
-
-        void TypePresenter_Loaded(object sender, RoutedEventArgs e)
-        {
-            //UnRegistering because of 137896: Inside tab control multiple Loaded events happen without an Unloaded event.
-            this.MostRecentlyUsedTypes.CollectionChanged -= OnMostRecentlyUsedTypesChanged;
-            this.MostRecentlyUsedTypes.CollectionChanged += OnMostRecentlyUsedTypesChanged;
-            OnMostRecentlyUsedTypesChanged(this, null);
-        }
-
-        void TypePresenter_Unloaded(object sender, RoutedEventArgs e)
-        {
-            this.MostRecentlyUsedTypes.CollectionChanged -= OnMostRecentlyUsedTypesChanged;
-        }
-
-        public event RoutedEventHandler TypeBrowserOpened
-        {
-            add { this.AddHandler(TypeBrowserOpenedEvent, value); }
-            remove { this.RemoveHandler(TypeBrowserOpenedEvent, value); }
-        }
-
-        public event RoutedEventHandler TypeBrowserClosed
-        {
-            add { this.AddHandler(TypeBrowserClosedEvent, value); }
-            remove { this.RemoveHandler(TypeBrowserClosedEvent, value); }
-        }
-
-        public event RoutedEventHandler TypeChanged
-        {
-            add { this.AddHandler(TypeChangedEvent, value); }
-            remove { this.RemoveHandler(TypeChangedEvent, value); }
-        }
-
-        public event PropertyChangedEventHandler PropertyChanged;
-
-        [Fx.Tag.KnownXamlExternal]
-        public EditingContext Context
-        {
-            get { return (EditingContext)GetValue(ContextProperty); }
-            set { SetValue(ContextProperty, value); }
-        }
-
-        public bool AllowNull
-        {
-            get { return (bool)GetValue(AllowNullProperty); }
-            set { SetValue(AllowNullProperty, value); }
-        }
-
-        public string Label
-        {
-            get { return (string)GetValue(LabelProperty); }
-            set { SetValue(LabelProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public Func<Type, bool> Filter
-        {
-            get { return (Func<Type, bool>)GetValue(FilterProperty); }
-            set { SetValue(FilterProperty, value); }
-        }
-
-        public bool CenterActivityTypeResolverDialog
-        {
-            get { return (bool)GetValue(CenterActivityTypeResolverDialogProperty); }
-            set { SetValue(CenterActivityTypeResolverDialogProperty, value); }
-        }
-
-        public bool CenterTypeBrowserDialog
-        {
-            get { return (bool)GetValue(CenterTypeBrowserDialogProperty); }
-            set { SetValue(CenterTypeBrowserDialogProperty, value); }
-        }
-
-        internal TypeWrapper NullTypeWrapper
-        {
-            get
-            {
-                if (this.nullTypeWrapper == null)
-                {
-                    this.nullTypeWrapper = new TypeWrapper(NullString, "Null", null);
-                }
-                return this.nullTypeWrapper;
-            }
-        }
-
-        public string Text
-        {
-            get { return (string)GetValue(TextProperty); }
-            private set { SetValue(TextPropertyKey, value); }
-        }
-
-
-        public IEnumerable<TypeWrapper> Items
-        {
-            get
-            {
-                if (AllowNull)
-                {
-                    yield return this.NullTypeWrapper;
-                }
-                foreach (Type type in this.MostRecentlyUsedTypes)
-                {
-                    if (type != null)
-                    {
-                        if (this.Filter == null
-                           || this.Filter(type))
-                        {
-                            yield return new TypeWrapper(type);
-                        }
-                    }
-                }
-
-                //display Array of [T] option
-                if (this.Filter == null
-                    || this.Filter(typeof(Array)))
-                {
-                    yield return new TypeWrapper("Array of [T]", "T[]", typeof(ArrayOf<>));
-                }
-                //display "Browse for types" option
-                //if there are referenced and local assembly info in Editing context (inside VS), type browser will show those assemblies,
-                //otherwise (standalone), type browser will just show all loaded assemblies in current appdomain
-                yield return new TypeWrapper(BrowseTypeString, "BrowseForTypes", typeof(BrowseForType));
-            }
-        }
-
-        public bool BrowseTypeDirectly
-        {
-            get { return (bool)GetValue(BrowseTypeDirectlyProperty); }
-            set { SetValue(BrowseTypeDirectlyProperty, value); }
-        }
-
-
-        [SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods", Justification = "By design.")]
-        public Type Type
-        {
-            get { return (Type)GetValue(TypeProperty); }
-            set { SetValue(TypeProperty, value); }
-        }
-
-        public string TypeName
-        {
-            get
-            {
-                string typeName = string.Empty;
-                this.ToolTip = null;
-                if (null != this.Type)
-                {
-                    typeName = ResolveTypeName(this.Type);
-                    this.ToolTip = typeName;
-                }
-                return typeName;
-            }
-        }
-
-        internal static string ResolveTypeName(Type type)
-        {
-            Fx.Assert(type != null, "parameter type is null!");
-            string typeName;
-            if (TypePresenter.DefaultTypes.Contains(type))
-            {
-                typeName = type.Name;
-            }
-            else
-            {
-                typeName = TypeNameHelper.GetDisplayName(type, true);
-            }
-            return typeName;
-        }
-
-        AssemblyContextControlItem AssemblyContext
-        {
-            get
-            {
-                return (null != Context ? Context.Items.GetValue<AssemblyContextControlItem>() : null);
-            }
-        }
-
-        string BrowseTypeString
-        {
-            get { return (string)this.FindResource("BrowseTypeString"); }
-        }
-
-        string NullString
-        {
-            get { return "(null)"; }
-        }
-
-        protected override System.Windows.Automation.Peers.AutomationPeer OnCreateAutomationPeer()
-        {
-            return new UIElementAutomationPeer(this);
-        }
-
-        protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
-        {
-            base.OnMouseLeftButtonDown(e);
-            this.isMouseLeftButtonDown = true;
-            e.Handled = true;
-        }
-
-        protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
-        {
-            base.OnMouseLeftButtonUp(e);
-            if (this.isMouseLeftButtonDown)
-            {
-                if (this.BrowseTypeDirectly)
-                {
-                    HandleBrowseType();
-                }
-                else
-                {
-                    this.EnableEdit();
-                }
-            }
-            this.isMouseLeftButtonDown = false;
-            e.Handled = true;
-        }
-
-        protected override void OnPreviewKeyDown(KeyEventArgs e)
-        {
-            base.OnPreviewKeyDown(e);
-            if (IsPreviewKey(e.Key))
-            {
-                Preview();
-            }
-        }
-
-        internal static bool IsPreviewKey(Key key)
-        {
-            return (key == Key.F2 || key == Key.Space || key == Key.Enter);
-        }
-
-        internal void Preview()
-        {
-            if (this.BrowseTypeDirectly)
-            {
-                HandleBrowseType();
-            }
-            else
-            {
-                this.EnableEdit();
-            }
-        }
-
-        static void OnContextChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
-        {
-            TypePresenter ctrl = (TypePresenter)sender;
-            ctrl.OnItemsChanged();
-        }
-
-        static void OnAllowNullChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
-        {
-            TypePresenter ctrl = (TypePresenter)sender;
-            ctrl.OnItemsChanged();
-        }
-
-        static void OnBrowseTypeDirectlyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
-        {
-            TypePresenter ctrl = (TypePresenter)sender;
-            if (!(bool)args.NewValue)
-            {
-                ctrl.typeComboBox.Visibility = Visibility.Visible;
-                ctrl.typeTextBlock.Visibility = Visibility.Collapsed;
-                ctrl.Focusable = false;
-            }
-            else
-            {
-                ctrl.typeComboBox.Visibility = Visibility.Collapsed;
-                ctrl.typeTextBlock.Visibility = Visibility.Visible;
-                ctrl.Focusable = true;
-            }
-        }
-
-        static void OnTypeChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
-        {
-            TypePresenter ctrl = (TypePresenter)sender;
-            ctrl.lastSelection = (Type)args.NewValue;
-
-            if (null != ctrl.PropertyChanged)
-            {
-                ctrl.PropertyChanged(ctrl, new PropertyChangedEventArgs("TypeName"));
-            }
-
-            if (null == ctrl.lastSelection)
-            {
-                ctrl.typeComboBox.SelectedIndex = ctrl.typeComboBox.Items.IndexOf(ctrl.NullTypeWrapper);
-            }
-
-            ctrl.Text = ctrl.TypeName;
-            ctrl.RaiseEvent(new RoutedEventArgs(TypePresenter.TypeChangedEvent, ctrl));
-        }
-
-        static void OnFilterChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
-        {
-            TypePresenter ctrl = (TypePresenter)sender;
-            if (null != ctrl.PropertyChanged)
-            {
-                ctrl.PropertyChanged(ctrl, new PropertyChangedEventArgs("Items"));
-            }
-        }
-
-        static void OnMostRecentlyUsedTypesPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
-        {
-            TypePresenter ctrl = (TypePresenter)sender;
-            ((ObservableCollection<Type>)args.NewValue).CollectionChanged += ctrl.OnMostRecentlyUsedTypesChanged;
-            ((ObservableCollection<Type>)args.OldValue).CollectionChanged -= ctrl.OnMostRecentlyUsedTypesChanged;
-
-            ctrl.OnItemsChanged();
-        }
-
-        static object OnCoerceMostRecentlyUsedTypes(DependencyObject sender, object value)
-        {
-            if (value != null)
-            {
-                return value;
-            }
-            else
-            {
-                return TypePresenter.DefaultMostRecentlyUsedTypes;
-            }
-        }
-
-        void DisableEdit()
-        {
-            if (BrowseTypeDirectly)
-            {
-                this.typeTextBlock.Visibility = Visibility.Visible;
-                this.typeComboBox.Visibility = Visibility.Collapsed;
-            }
-        }
-
-        void EnableEdit()
-        {
-            if (BrowseTypeDirectly)
-            {
-                this.typeTextBlock.Visibility = Visibility.Collapsed;
-                this.typeComboBox.Visibility = Visibility.Visible;
-            }
-            this.typeComboBox.Focus();
-        }
-
-        // return true if KeyDownEvent should be set to handled
-        bool HandleBrowseType()
-        {
-            bool retval = false;
-            TypeWrapper wrapper = (TypeWrapper)this.typeComboBox.SelectedItem;
-
-            if ((wrapper != null && !wrapper.IsTypeDefinition)
-                || this.BrowseTypeDirectly)
-            {
-                Type result = null;
-                bool? dialogResult = true;
-                bool typeIsArray = true;
-                bool fireEvent = false;
-                //handle choosing an array of T
-                if (wrapper != null && typeof(ArrayOf<>) == wrapper.Type)
-                {
-                    fireEvent = true;
-                    this.RaiseEvent(new RoutedEventArgs(TypePresenter.TypeBrowserOpenedEvent, this));
-                    result = wrapper.Type;
-                }
-                else if (wrapper != null && wrapper.DisplayName == NullString)
-                {
-                    this.Type = null;
-                    return false;
-                }
-                else
-                {
-                    retval = true;
-                    fireEvent = true;
-                    this.RaiseEvent(new RoutedEventArgs(TypePresenter.TypeBrowserOpenedEvent, this));
-                    TypeBrowser browser = new TypeBrowser(AssemblyContext, this.Context, this.Filter);
-                    SetWindowOwner(browser);
-                    if (this.CenterTypeBrowserDialog)
-                    {
-                        browser.WindowStartupLocation = WindowStartupLocation.CenterScreen;
-                    }
-                    dialogResult = browser.ShowDialog();
-                    if (dialogResult.HasValue && dialogResult.Value)
-                    {
-                        result = browser.ConcreteType;
-                    }
-
-                    typeIsArray = false;
-                }
-
-                if (dialogResult.HasValue && dialogResult.Value)
-                {
-                    //user may have chosen generic type (IList)
-                    if (result.IsGenericTypeDefinition)
-                    {
-                        retval = true;
-                        ActivityTypeResolver wnd = new ActivityTypeResolver();
-                        SetWindowOwner(wnd);
-                        wnd.Context = this.Context;
-                        wnd.EditedType = result;
-                        if (this.CenterActivityTypeResolverDialog)
-                        {
-                            wnd.WindowStartupLocation = WindowStartupLocation.CenterScreen;
-                        }
-
-                        result = (true == wnd.ShowDialog() ? wnd.ConcreteType : null);
-                    }
-                    //if we have a type
-                    if (null != result)
-                    {
-                        //if we have a ArrayOf<some type here>, create actual array type
-                        if (typeIsArray)
-                        {
-                            result = result.GetGenericArguments()[0].MakeArrayType();
-                        }
-                        //add it to the cache
-                        if (!MostRecentlyUsedTypes.Any<Type>(p => Type.Equals(p, result)))
-                        {
-                            MostRecentlyUsedTypes.Add(result);
-                        }
-
-                        //and return updated result
-                        this.Type = result;
-                    }
-                    else
-                    {
-                        this.Type = this.lastSelection;
-                    }
-
-                    BindingExpression binding = this.typeComboBox.GetBindingExpression(ComboBox.SelectedItemProperty);
-                    binding.UpdateTarget();
-                }
-                else
-                {
-                    SetComboBoxToLastSelection();
-                }
-                if (fireEvent)
-                {
-                    this.RaiseEvent(new RoutedEventArgs(TypePresenter.TypeBrowserClosedEvent, this));
-                }
-            }
-
-            return retval;
-        }
-
-        void OnMostRecentlyUsedTypesChanged(object sender, NotifyCollectionChangedEventArgs e)
-        {
-            OnItemsChanged();
-        }
-
-        void OnItemsChanged()
-        {
-            if (null != PropertyChanged)
-            {
-                PropertyChanged(this, new PropertyChangedEventArgs("Items"));
-            }
-        }
-
-        void OnTypePresenterDropDownClosed(object sender, EventArgs e)
-        {
-            HandleBrowseType();
-            DisableEdit();
-            if (!this.BrowseTypeDirectly)
-            {
-                this.typeComboBox.Focus();
-            }
-            else
-            {
-                this.Focus();
-            }
-        }
-
-        void OnTypePresenterKeyDown(object sender, KeyEventArgs e)
-        {
-            if (e.Key == Key.Enter)
-            {
-                if (HandleBrowseType())
-                {
-                    e.Handled = true;
-                }
-                DisableEdit();
-
-                FocusOnVisibleControl();
-            }
-        }
-
-        void OnTypePresenterLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
-        {
-            if (!(e.NewFocus == this))
-            {
-                if (!(this.typeComboBox.IsDropDownOpen || this.typeComboBox.IsSelectionBoxHighlighted))
-                {
-                    DisableEdit();
-                }
-            }
-        }
-
-        void SetWindowOwner(Window wnd)
-        {
-            WindowHelperService.TrySetWindowOwner(this, this.Context, wnd);
-        }
-
-        // internal converter class - assign a meaningful AutomationProperties.Name to the type presenter
-        // AutomationProperties.Name = Label + the string displayed on the TypePresenter
-        sealed class AutomationNameConverter : IMultiValueConverter
-        {
-            public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-            {
-                Fx.Assert(values.Length == 2, "There should be exactly 2 values");
-                return (string)values[0] + ": " + (string)values[1];
-            }
-
-            public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
-            {
-                Fx.Assert("Not supported!");
-                return null;
-            }
-        }
-    }
-
-    [Fx.Tag.XamlVisible(false)]
-    public sealed class TypeWrapper
-    {
-        string displayName;
-        bool isTypeDefinition;
-        Type type;
-
-        internal TypeWrapper(Type type)
-        {
-            this.type = type;
-            this.isTypeDefinition = true;
-            this.Tag = DisplayName;
-        }
-
-        internal TypeWrapper(string text, string tag, Type type)
-        {
-            this.displayName = text;
-            this.isTypeDefinition = false;
-            this.Tag = tag;
-            this.type = type;
-        }
-
-        public string DisplayName
-        {
-            get
-            {
-                if (this.isTypeDefinition)
-                {
-                    if (TypePresenter.DefaultTypes.Contains(this.type))
-                    {
-                        return this.type.Name;
-                    }
-
-                    return TypeNameHelper.GetDisplayName(this.Type, true);
-                }
-                return this.displayName;
-            }
-        }
-
-        public bool IsTypeDefinition
-        {
-            get { return this.isTypeDefinition; }
-        }
-
-        public object Tag
-        {
-            get;
-            private set;
-        }
-
-        [SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods", Justification = "By design.")]
-        public Type Type
-        {
-            get { return this.type; }
-        }
-
-        public override string ToString()
-        {
-            return Tag as string;
-        }
-
-        public override bool Equals(object obj)
-        {
-            TypeWrapper that = obj as TypeWrapper;
-            if (that == null)
-            {
-                return false;
-            }
-            if (that.IsTypeDefinition ^ this.IsTypeDefinition)
-            {
-                return false;
-            }
-            if (this.displayName != that.displayName)
-            {
-                return false;
-            }
-            return object.Equals(this.Type, that.Type);
-        }
-
-        public override int GetHashCode()
-        {
-            if (this.Type != null)
-            {
-                return this.Type.GetHashCode();
-            }
-            else
-            {
-                return base.GetHashCode();
-            }
-        }
-    }
-
-    sealed class ArrayOf<T>
-    {
-    }
-
-    sealed class BrowseForType
-    {
-    }
-
-    // internal converter class - keeps link between display friendly string representation of types
-    // and actual underlying system type.
-    sealed class TypeWrapperConverter : IValueConverter
-    {
-        TypePresenter typePresenter;
-
-        //ctor - initialzied with list of loaded types into the presenter
-        internal TypeWrapperConverter(TypePresenter typePresenter)
-        {
-            this.typePresenter = typePresenter;
-        }
-
-        //convert from System.Type to TypeWrapper (display friendly)
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            if (null != value)
-            {
-                //lookup in loaded types if type is already there
-
-                //if no - add it to collection - may be reused later
-                if (null == this.typePresenter.MostRecentlyUsedTypes.SingleOrDefault<Type>(p => Type.Equals(p, (Type)value)))
-                {
-                    this.typePresenter.MostRecentlyUsedTypes.Add((Type)value);
-                }
-
-                return new TypeWrapper((Type)value);
-            }
-            else
-            {
-                return this.typePresenter.NullTypeWrapper;
-            }
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
-        {
-            //convert back - just get the Type property of the wrapper object
-            TypeWrapper typeWrapper = value as TypeWrapper;
-
-            if (typeWrapper == this.typePresenter.NullTypeWrapper)
-            {
-                return null;
-            }
-
-            if (null != typeWrapper && null != typeWrapper.Type && typeof(ArrayOf<>) != typeWrapper.Type && typeof(BrowseForType) != typeWrapper.Type)
-            {
-                return typeWrapper.Type;
-            }
-
-            return Binding.DoNothing;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypePropertyEditor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypePropertyEditor.cs
deleted file mode 100644 (file)
index ea32504..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation.View;
-    using System.Windows;
-
-    sealed class TypePropertyEditor : PropertyValueEditor
-    {
-        public const string AllowNull = "AllowNull";
-        public const string BrowseTypeDirectly = "BrowseTypeDirectly";
-        public const string Filter = "Filter";
-
-        public TypePropertyEditor()
-        {
-            this.InlineEditorTemplate = (DataTemplate)EditorResources.GetResources()["TypeBrowser_InlineEditorTemplate"];
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypeResolvingOptions.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypeResolvingOptions.cs
deleted file mode 100644 (file)
index f693ee2..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation.View
-{
-    using System.Runtime;
-    using System.Collections.ObjectModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Collections.Generic;
-
-    [Fx.Tag.XamlVisible(false)]
-    public class TypeResolvingOptions
-    {
-        private IDictionary<string, string> hintTextMap;
-
-        public TypeResolvingOptions() : this(null)
-        {
-        }
-
-        public TypeResolvingOptions(IEnumerable<Type> defaultTypes)
-        {
-            if (defaultTypes != null)
-            {
-                this.MostRecentlyUsedTypes = new ObservableCollection<Type>();
-                foreach (Type item in defaultTypes)
-                {
-                    if (item == null)
-                    {
-                        throw FxTrace.Exception.AsError(new ArgumentException(SR.TypeResolvingOptionsArgumentExceptionMessage));
-                    }
-                    this.MostRecentlyUsedTypes.Add(item);
-                }
-            }
-        }
-
-        public Func<Type, bool> Filter
-        {
-            get;
-            set;
-        }
-
-        [SuppressMessage(FxCop.Category.Usage, FxCop.Rule.CollectionPropertiesShouldBeReadOnly,
-            Justification = "Setter is provided to data binding on this property.")]
-        internal ObservableCollection<Type> MostRecentlyUsedTypes
-        {
-            get;
-            set;
-        }
-
-        /// <summary>
-        /// A dictionary that maps the name of a generic type argument to a hint text.
-        /// </summary>
-        internal IDictionary<string, string> HintTextMap
-        {
-            get
-            {
-                if (this.hintTextMap == null)
-                {
-                    this.hintTextMap = new Dictionary<string, string>();
-                }
-
-                return this.hintTextMap;
-            }
-        }
-
-        public bool BrowseTypeDirectly
-        {
-            get;
-            set;
-        }
-
-        internal static TypeResolvingOptions Merge(TypeResolvingOptions lhs, TypeResolvingOptions rhs)
-        {
-            if (lhs == null)
-            {
-                return rhs;
-            }
-            else if (rhs == null)
-            {
-                return lhs;
-            }
-
-            TypeResolvingOptions result = new TypeResolvingOptions
-            {
-                Filter = FuncAnd(lhs.Filter, rhs.Filter),
-                MostRecentlyUsedTypes = Intersect(lhs.MostRecentlyUsedTypes, rhs.MostRecentlyUsedTypes),
-                BrowseTypeDirectly = lhs.BrowseTypeDirectly && rhs.BrowseTypeDirectly
-            };
-
-            // Pass in the fields directly to prevent triggering lazy initialization.
-            IDictionary<string, string> mergedHintTextMap = MergeDictionaries<string, string>(lhs.hintTextMap, rhs.hintTextMap);
-            if (mergedHintTextMap != null && mergedHintTextMap.Count > 0)
-            {
-                foreach (KeyValuePair<string, string> kvp in mergedHintTextMap)
-                {
-                    result.HintTextMap.Add(kvp.Key, kvp.Value);
-                }
-            }
-
-            return result;
-        }
-
-        static Func<Type, bool> FuncAnd(Func<Type, bool> lhs, Func<Type, bool> rhs)
-        {
-            if (lhs == null)
-            {
-                return rhs;
-            }
-            else if (rhs == null)
-            {
-                return lhs;
-            }
-
-            return new Func<Type, bool>((e) => lhs(e) && rhs(e));
-        }
-
-        static ObservableCollection<T> Intersect<T>(ObservableCollection<T> lhs, ObservableCollection<T> rhs)
-        {
-            if (lhs == null)
-            {
-                return rhs;
-            }
-            else if (rhs == null)
-            {
-                return lhs;
-            }
-
-            ObservableCollection<T> collection = new ObservableCollection<T>();
-            foreach (T t in lhs)
-            {
-                if (rhs.Contains(t))
-                {
-                    collection.Add(t);
-                }
-            }
-
-            return collection;
-        }
-
-        static IDictionary<TKey, TValue> MergeDictionaries<TKey, TValue>(IDictionary<TKey, TValue> lhs, IDictionary<TKey, TValue> rhs)
-        {
-            if (lhs == null || lhs.Count == 0)
-            {
-                return rhs;
-            }
-
-            if (rhs == null || rhs.Count == 0)
-            {
-                return lhs;
-            }
-
-            Dictionary<TKey, TValue> result = new Dictionary<TKey, TValue>();
-            foreach (KeyValuePair<TKey, TValue> kvp in lhs)
-            {
-                result.Add(kvp.Key, kvp.Value);
-            }
-
-            foreach (KeyValuePair<TKey, TValue> kvp in rhs)
-            {
-                if (!result.ContainsKey(kvp.Key))
-                {
-                    result.Add(kvp.Key, kvp.Value);
-                }
-            }
-
-            return result;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypeToArgumentTypeConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypeToArgumentTypeConverter.cs
deleted file mode 100644 (file)
index 937d322..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Windows.Data;
-    using System.Activities.Presentation.Model;
-    using System.Runtime;
-
-    // This converter converts from InArgument<T>, OutArgument<T>, Activity<T> to T
-    // this does not support convert back.
-    internal sealed class TypeToArgumentTypeConverter : IValueConverter
-    {
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            object convertedValue = null;
-            Type type = value as Type;
-            if (type != null)
-            {
-                if (type.GetGenericArguments().Length > 0)
-                {
-                    convertedValue = type.GetGenericArguments()[0];
-                }
-            }
-            return convertedValue;
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypeToStringValueConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/TypeToStringValueConverter.cs
deleted file mode 100644 (file)
index 47e41c6..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Windows.Data;
-    using System.Runtime;
-
-    class TypeToStringValueConverter : IValueConverter
-    {
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            Fx.Assert(targetType.Equals(typeof(string)), "TypeToStringValueConverter cannot convert a type to type " + targetType.FullName);
-            string target = null;
-            if (value != null)
-            {
-                Fx.Assert(value is Type, string.Format(CultureInfo.InvariantCulture, "TypeToStringValueConverter cannot convert from type {0} to string", value.GetType().FullName));
-                Type editedType = (Type)value;
-                //handle primitive types
-                if (editedType.IsPrimitive || editedType.IsValueType ||
-                    editedType == typeof(string) || editedType == typeof(object))
-                {
-                    target = editedType.Name;
-                }
-                    //and other ones
-                else
-                {
-                    target = editedType.FullName;
-                }
-            }
-            return target;
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            Fx.Assert(targetType.Equals(typeof(Type)), "TypeToStringValueConverter cannot convert string back to type " + targetType.FullName);
-            Type target = null;
-            string stringValue = value as string;
-            if (!string.IsNullOrEmpty(stringValue))
-            {
-                // try to get the type from the type name
-                target = Type.GetType(stringValue, false, true);
-                //handle primitive types
-                if (null == target)
-                {
-                    stringValue = string.Format(CultureInfo.InvariantCulture, "System.{0}", stringValue);
-                    target = Type.GetType(stringValue, false, true);
-                }
-                if (null == target)
-                {
-                    return Binding.DoNothing;
-                }
-            }
-            return target;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VBIdentifierDesigner.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VBIdentifierDesigner.xaml.cs
deleted file mode 100644 (file)
index 4050bee..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Text;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Windows.Documents;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using System.Windows.Media.Imaging;
-    using System.Windows.Navigation;
-    using System.Windows.Shapes;
-    using System.Activities.Presentation.View;
-    using System.ComponentModel;
-    using System.Windows.Automation.Peers;
-    using System.Xml.Linq;
-    using System.Reflection;
-
-    partial class VBIdentifierDesigner : UserControl
-    {
-        public static readonly DependencyProperty IdentifierProperty =
-            DependencyProperty.Register("Identifier", typeof(VBIdentifierName), typeof(VBIdentifierDesigner), new UIPropertyMetadata(OnIdentifierChanged));
-
-        public static readonly DependencyProperty NameStringProperty =
-            DependencyProperty.Register("NameString", typeof(string), typeof(VBIdentifierDesigner), new UIPropertyMetadata(null, null, OnNameChanging));
-
-        public static readonly DependencyProperty IsReadOnlyProperty =
-            DependencyProperty.Register("IsReadOnly", typeof(bool), typeof(VBIdentifierDesigner));
-
-        public event PropertyChangedEventHandler TextBoxPropertyChanged;
-
-        TextBox textBox;
-        bool isInternalChange;
-        bool checkAgainstXaml;
-
-        public VBIdentifierName Identifier
-        {
-            get { return (VBIdentifierName)GetValue(IdentifierProperty); }
-            set { SetValue(IdentifierProperty, value); }
-        }
-
-        public string NameString
-        {
-            get { return (string)GetValue(NameStringProperty); }
-            set { SetValue(NameStringProperty, value); }
-        }
-
-        public bool IsReadOnly
-        {
-            get { return (bool)GetValue(IsReadOnlyProperty); }
-            set { SetValue(IsReadOnlyProperty, value); }
-        }
-
-        internal TextBox IdentifierTextBox
-        {
-            get
-            {
-                return this.textBox;
-            }
-            set
-            {
-                if (value != this.textBox)
-                {
-                    this.textBox = value;
-                    if (this.TextBoxPropertyChanged != null)
-                    {
-                        this.TextBoxPropertyChanged(this, new PropertyChangedEventArgs("IdentifierTextBox"));
-                    }
-                }
-            }
-        }
-
-        public VBIdentifierDesigner()
-        {
-            InitializeComponent();
-            this.Loaded += (s, e) =>
-                {
-                    //when designer gets loaded, get its identifier binding expression with parent control
-                    var binding = this.GetBindingExpression(VBIdentifierDesigner.IdentifierProperty);
-                    if (null != binding && null != binding.ParentBinding)
-                    {
-                        //if one exists - define update source exception filter
-                        binding.ParentBinding.UpdateSourceExceptionFilter = this.OnBindingException;
-                    }
-                };
-        }
-
-
-        void OnTextBoxLoaded(object sender, RoutedEventArgs e)
-        {
-            this.IdentifierTextBox = sender as TextBox;
-            this.IdentifierTextBox.LostKeyboardFocus += this.OnTextBoxLostKeyboardFocus;
-        }
-
-        void OnTextBoxLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
-        {
-            if (this.IdentifierTextBox.IsFocused)
-            {
-                DependencyObject focusScope = FocusManager.GetFocusScope(this.IdentifierTextBox);
-                FocusManager.SetFocusedElement(focusScope, this);
-            }
-        }
-
-        void OnTextBoxUnloaded(object sender, RoutedEventArgs e)
-        {
-            TextBox textBox = sender as TextBox;
-            textBox.LostKeyboardFocus -= this.OnTextBoxLostKeyboardFocus;
-            this.IdentifierTextBox = null;
-        }
-
-        object OnBindingException(object sender, Exception err)
-        {
-            //whenever exception occurs, allow ValidationException to be rethrown - this exception is needed to revert invalid value
-            if (err is TargetInvocationException && err.InnerException is ValidationException || err is ValidationException)
-            {
-                throw FxTrace.Exception.AsError( err.InnerException ?? err );
-            }
-            //simply return null - we don't use error template for this control
-            return null;
-        }
-
-        static object OnNameChanging(DependencyObject sender, object newValue)
-        {
-            var ctrl = (VBIdentifierDesigner)sender;
-            //before allowing new value to be assigned to property, check if it passes validation
-            return ctrl.OnNameChanging(ctrl.NameString, (string)newValue);
-        }
-
-        object OnNameChanging(string oldName, string newName)
-        {
-            string result = newName;
-            if (!this.isInternalChange)
-            {
-                try
-                {
-                    this.isInternalChange = true;
-                    //try to create new Identifier - if this call succeds, set the new value to a property
-                    this.Identifier = new VBIdentifierName(this.checkAgainstXaml) { IdentifierName = newName };
-                }
-                catch (ValidationException)
-                {
-                    //in case of validation exception - do not allow new invalid value to be set
-                    result = oldName;
-                    //if text box is still visible - refresh its Text property to old value
-                    if (null != this.textBox)
-                    {
-                        var binding = this.textBox.GetBindingExpression(TextBox.TextProperty);
-                        binding.UpdateTarget();
-                    }
-                }
-                finally
-                {
-                    this.isInternalChange = false;
-                }
-            }
-            return result;
-        }
-
-        static void OnIdentifierChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
-        {
-            (sender as VBIdentifierDesigner).OnIdentifierChanged();
-        }
-
-        void OnIdentifierChanged()
-        {
-            if (!this.isInternalChange && null != this.Identifier)
-            {
-                this.isInternalChange = true;
-                this.NameString = this.Identifier.IdentifierName;
-                this.isInternalChange = false;
-                this.checkAgainstXaml = this.Identifier.CheckAgainstXaml;
-            }
-        }
-
-        protected override AutomationPeer OnCreateAutomationPeer()
-        {
-            return new VBIdentiferDesignerAutomationPeer(this);
-        }
-    }
-
-    class VBIdentiferDesignerAutomationPeer : UIElementAutomationPeer
-    {
-        public VBIdentiferDesignerAutomationPeer(VBIdentifierDesigner owner)
-            : base(owner)
-        {
-        }
-        
-        protected override string GetItemStatusCore()
-        {
-            VBIdentifierDesigner vbIdentifierDesigner = this.Owner as VBIdentifierDesigner;
-            if (vbIdentifierDesigner != null)
-            {
-                VBIdentifierName vbIdentifier = vbIdentifierDesigner.Identifier;
-                if (vbIdentifier != null)
-                {
-                    XElement itemStatus = new XElement("VBIdentifierStatus",
-                        new XAttribute("Status", vbIdentifier.IsValid ? "Valid" : "Invalid"),
-                        new XAttribute("WarningMessage", vbIdentifier.ErrorMessage));
-                    return itemStatus.ToString();
-                }
-            }
-            return base.GetItemStatusCore();
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VBIdentifierName.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VBIdentifierName.cs
deleted file mode 100644 (file)
index fb36c50..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.CodeDom.Compiler;
-    using System.Globalization;
-    using System.Windows;
-    using System.Xaml;
-    using System.Xml;
-    using Microsoft.CSharp;
-    using Microsoft.VisualBasic;
-
-    /// <summary>
-    /// The class is not only used for VB(Dev10), but also for C# (Dev11).
-    /// </summary>
-    internal class VBIdentifierName : DependencyObject
-    {
-        public static readonly DependencyProperty IdentifierNameProperty =
-            DependencyProperty.Register("IdentifierName", typeof(string), typeof(VBIdentifierName), new UIPropertyMetadata(OnIdentifierNameChanged));
-
-        public static readonly DependencyProperty IsValidProperty =
-            DependencyProperty.Register("IsValid", typeof(bool), typeof(VBIdentifierName));
-
-        public static readonly DependencyProperty ErrorMessageProperty =
-            DependencyProperty.Register("ErrorMessage", typeof(string), typeof(VBIdentifierName));
-
-        static VBCodeProvider vbProvider;
-        static CSharpCodeProvider csProvider;
-        static XamlSchemaContext xamlContext = new XamlSchemaContext();
-        static XamlType xamlType = new XamlType(typeof(string), xamlContext);
-
-        bool checkAgainstXaml;
-
-        VBCodeProvider VBProvider
-        {
-            get
-            {
-                if (vbProvider == null)
-                {
-                    vbProvider = CodeDomProvider.CreateProvider("VisualBasic") as VBCodeProvider;
-                }
-                return vbProvider;
-            }
-        }
-
-        CSharpCodeProvider CSProvider
-        {
-            get
-            {
-                if (csProvider == null)
-                {
-                    csProvider = CodeDomProvider.CreateProvider("C#") as CSharpCodeProvider;
-                }
-
-                return csProvider;
-            }
-        }
-
-        public string ErrorMessage
-        {
-            get { return (string)GetValue(ErrorMessageProperty); }
-            set { SetValue(ErrorMessageProperty, value); }
-        }
-
-        public bool IsValid
-        {
-            get { return (bool)GetValue(IsValidProperty); }
-            set { SetValue(IsValidProperty, value); }
-        }
-
-        public string IdentifierName
-        {
-            get { return (string)GetValue(IdentifierNameProperty); }
-            set { SetValue(IdentifierNameProperty, value); }
-        }
-
-        public bool CheckAgainstXaml
-        {
-            get
-            {
-                return this.checkAgainstXaml;
-            }
-        }
-
-        public VBIdentifierName()
-        {
-            this.checkAgainstXaml = false;
-        }
-
-        public VBIdentifierName(bool checkAgainstXaml)
-        {
-            this.checkAgainstXaml = checkAgainstXaml;
-        }
-
-        static void OnIdentifierNameChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
-        {
-            ((VBIdentifierName)sender).OnIdentifierNameChanged();
-        }
-
-        internal static bool IsValidXamlName(string name)
-        {
-            bool isValid = new XamlMember(name, xamlType, false).IsNameValid;
-
-            if (isValid)
-            {
-                //Work around TFS bug #825815, in some cases, XamlMember.IsNameValid returns true but it's not valid Xml Name.
-                try
-                {
-                    XmlConvert.VerifyName(name);
-                }
-                catch (XmlException)
-                {
-                    isValid = false;
-                }
-            }
-
-            return isValid;
-        }
-
-        void OnIdentifierNameChanged()
-        {
-            string trimedName = this.IdentifierName;
-            if (this.CheckAgainstXaml && !VBIdentifierName.IsValidXamlName(trimedName))
-            {
-                this.IsValid = false;
-                this.ErrorMessage = string.Format(CultureInfo.CurrentUICulture, SR.InvalidXamlMemberName, trimedName);
-            }
-            else if (!this.VBProvider.IsValidIdentifier(trimedName) || !this.CSProvider.IsValidIdentifier(trimedName))
-            {
-                this.IsValid = false;
-                this.ErrorMessage = string.Format(CultureInfo.CurrentUICulture, SR.InvalidIdentifier, trimedName);
-            }
-            else if (trimedName.StartsWith("[", StringComparison.Ordinal) && trimedName.EndsWith("]", StringComparison.Ordinal))
-            {
-                this.IsValid = false;
-                this.ErrorMessage = string.Format(CultureInfo.CurrentUICulture, SR.InvalidIdentifier, trimedName);
-            }
-            else
-            {
-                this.IsValid = true;
-                this.ErrorMessage = string.Empty;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VBIdentifierNameEditor.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VBIdentifierNameEditor.cs
deleted file mode 100644 (file)
index 81a99fc..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Activities.Presentation.View;
-    using System.Windows;
-
-    internal class VBIdentifierNameEditor : PropertyValueEditor
-    {
-        public VBIdentifierNameEditor()
-        {
-            this.InlineEditorTemplate = (DataTemplate)EditorResources.GetResources()["VBIdentifierNameEditorTemplate"];
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VariableDesigner.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VariableDesigner.xaml.cs
deleted file mode 100644 (file)
index 91dc373..0000000
+++ /dev/null
@@ -1,1572 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.Activities.Presentation.Annotations;
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.PropertyEditing;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Collections.Specialized;
-    using System.ComponentModel;
-    using System.Globalization;
-    using System.Linq;
-    using System.Reflection;
-    using System.Runtime;
-    using System.Text;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Controls.Primitives;
-    using System.Windows.Data;
-    using System.Windows.Input;
-    using System.Windows.Threading;
-
-    partial class VariableDesigner
-    {
-        public static readonly DependencyProperty ContextProperty = DependencyProperty.Register(
-            "Context",
-            typeof(EditingContext),
-            typeof(VariableDesigner),
-            new FrameworkPropertyMetadata(null, new PropertyChangedCallback(VariableDesigner.OnContextChanged)));
-
-        static readonly DependencyPropertyKey CurrentVariableScopePropertyKey = DependencyProperty.RegisterReadOnly(
-            "CurrentVariableScope",
-            typeof(ModelItemCollection),
-            typeof(VariableDesigner),
-            new UIPropertyMetadata(null, new PropertyChangedCallback(OnVariableScopeChanged)));
-
-        public static readonly DependencyProperty CurrentVariableScopeProperty = CurrentVariableScopePropertyKey.DependencyProperty;
-
-        public static readonly RoutedEvent VariableCollectionChangedEvent =
-                EventManager.RegisterRoutedEvent("VariableCollectionChanged",
-                RoutingStrategy.Bubble,
-                typeof(RoutedEventHandler),
-                typeof(VariableDesigner));
-
-        const string DefaultVariableName = "variable";
-
-        List<ModelItem> scopesList = new List<ModelItem>();
-        ObservableCollection<DesignTimeVariable> variableWrapperCollection = new ObservableCollection<DesignTimeVariable>();
-        bool isSelectionSourceInternal = false;
-        ModelItem variableToSelect = null;
-        bool continueScopeEdit = false;
-        ModelItem lastSelection;
-
-        DataGridHelper dgHelper;
-
-        public VariableDesigner()
-        {
-            InitializeComponent();
-
-            this.dgHelper = new DataGridHelper(this.variableDataGrid, this);
-            this.dgHelper.Context = this.Context;
-            this.dgHelper.AddNewRowCommand = DesignerView.CreateVariableCommand;
-            this.dgHelper.AddNewRowContent = (string)this.FindResource("addVariableNewRowLabel");
-            this.dgHelper.ResolveDynamicTemplateCallback = this.OnResolveDynamicContentTemplate;
-            this.dgHelper.LoadDynamicContentDataCallback = this.OnShowExtendedValueEditor;
-            this.dgHelper.LoadCustomPropertyValueEditorCallback = this.OnLoadExtendedValueEditor;
-            this.dgHelper.ShowValidationErrorAsToolTip = false;
-
-            this.variableDataGrid.SelectionChanged += OnDataGridRowSelected;
-            this.variableWrapperCollection.CollectionChanged += OnVariableWrapperCollectionChanged;
-            this.variableDataGrid.ItemsSource = this.variableWrapperCollection;
-
-            var converter = (BreadCrumbTextConverter)this.FindResource("scopeToNameConverter");
-            converter.PixelsPerChar = (this.FontSize - 5);
-        }
-
-        public event RoutedEventHandler VariableCollectionChanged
-        {
-            add
-            {
-                AddHandler(VariableCollectionChangedEvent, value);
-            }
-            remove
-            {
-                RemoveHandler(VariableCollectionChangedEvent, value);
-            }
-        }
-
-        public EditingContext Context
-        {
-            get { return (EditingContext)GetValue(ContextProperty); }
-            set { SetValue(ContextProperty, value); }
-        }
-
-        public ModelItemCollection CurrentVariableScope
-        {
-            get { return (ModelItemCollection)GetValue(CurrentVariableScopeProperty); }
-            private set { SetValue(CurrentVariableScopePropertyKey, value); }
-        }
-
-        public List<ModelItem> ScopesList
-        {
-            get { return this.scopesList; }
-        }
-
-        public bool CreateNewVariableWrapper()
-        {
-            bool result = false;
-            ModelItemCollection scope = this.GetDefaultVariableScope();
-            if (null != scope)
-            {
-                DesignTimeVariable wrapperObject = null;
-                Variable variable = Variable.Create(this.GetDefaultName(), this.GetDefaultType(), VariableModifiers.None);
-                using (ModelEditingScope change = scope.BeginEdit((string)this.FindResource("addNewVariableDescription")))
-                {
-                    ModelItem wrappedVariable = scope.Add(variable);
-                    wrapperObject = new DesignTimeVariable(wrappedVariable, this);
-                    this.variableWrapperCollection.Add(wrapperObject);
-                    change.Complete();
-                    result = true;
-                }
-                this.dgHelper.BeginRowEdit(wrapperObject);
-            }
-            return result;
-        }
-
-        internal void ChangeVariableType(DesignTimeVariable oldVariableWrapper, Variable newVariable)
-        {
-            //check who is the sender of the event - data grid or property inspector
-            int index = this.variableDataGrid.Items.IndexOf(this.variableDataGrid.SelectedItem);
-            DataGridCell cell = DataGridHelper.GetCell(this.variableDataGrid, index, 1);
-            bool shouldReselct = cell.IsEditing;
-
-            //get location of the variable
-            ModelItemCollection container = VariableHelper.GetVariableCollection(oldVariableWrapper.ReflectedObject.Parent.Parent);
-            index = container.IndexOf(oldVariableWrapper.ReflectedObject);
-            //remove all value 
-            container.RemoveAt(index);
-            oldVariableWrapper.Dispose();
-            oldVariableWrapper.Initialize(container.Insert(index, newVariable));
-        }
-
-        internal void NotifyVariableScopeChanged(DesignTimeVariable variable)
-        {
-            this.variableToSelect = null != variable ? variable.ReflectedObject : null;
-            int index = this.variableDataGrid.Items.IndexOf(this.variableDataGrid.SelectedItem);
-            DataGridCell cell = DataGridHelper.GetCell(this.variableDataGrid, index, 2);
-            this.continueScopeEdit = cell.IsEditing;
-        }
-
-        //Check case-insensitive duplicates, which are not allowed in VB expressions 
-        internal void CheckCaseInsensitiveDuplicates(VBIdentifierName identifierName, string newName)
-        {
-            Func<DesignTimeVariable, bool> checkForDuplicates = new Func<DesignTimeVariable, bool>(p => string.Equals((string)p.ReflectedObject.Properties["Name"].ComputedValue, newName, StringComparison.OrdinalIgnoreCase) && !object.Equals(p.GetVariableName(), identifierName));
-            DesignTimeVariable duplicate = this.variableWrapperCollection.FirstOrDefault<DesignTimeVariable>(checkForDuplicates);
-            if (duplicate != null)
-            {
-                identifierName.IsValid = false;
-                identifierName.ErrorMessage = string.Format(CultureInfo.CurrentUICulture, SR.DuplicateIdentifier, newName);
-                VBIdentifierName duplicateIdentifier = duplicate.GetVariableName();
-                if (duplicateIdentifier.IsValid)
-                {
-                    duplicateIdentifier.IsValid = false;
-                    duplicateIdentifier.ErrorMessage = string.Format(CultureInfo.CurrentUICulture, SR.DuplicateIdentifier, duplicateIdentifier.IdentifierName);
-                }
-            };
-        }
-
-        //Check duplicates with old value. When there's only one variable duplicate with the old value, 
-        //the only one variable should be valid now after the change
-        void ClearCaseInsensitiveDuplicates(VBIdentifierName identifier, string oldName)
-        {
-            Func<DesignTimeVariable, bool> checkForOldNameDuplicates = new Func<DesignTimeVariable, bool>(p => string.Equals((string)p.ReflectedObject.Properties["Name"].ComputedValue, oldName, StringComparison.OrdinalIgnoreCase) && !object.Equals(p.GetVariableName(), identifier));
-            IEnumerable<DesignTimeVariable> oldDuplicates = this.variableWrapperCollection.Where<DesignTimeVariable>(checkForOldNameDuplicates);
-            if (oldDuplicates.Count<DesignTimeVariable>() == 1)
-            {
-                DesignTimeVariable wrapper = oldDuplicates.First<DesignTimeVariable>();
-                VBIdentifierName oldDuplicate = wrapper.GetVariableName();
-                oldDuplicate.IsValid = true;
-                oldDuplicate.ErrorMessage = string.Empty;
-            }
-        }
-
-        internal void NotifyVariableNameChanged(VBIdentifierName identifierName, string newName, string oldName)
-        {
-            //Check whether there're any variables' name conflict with the old name which can be cleaned up now
-            this.ClearCaseInsensitiveDuplicates(identifierName, oldName);
-
-            //Check whether there're any duplicates with new name    
-            this.CheckCaseInsensitiveDuplicates(identifierName, newName);
-        }
-
-        internal void UpdateTypeDesigner(DesignTimeVariable variable)
-        {
-            this.dgHelper.UpdateDynamicContentColumns(variable);
-        }
-
-        string GetDefaultName()
-        {
-            return this.variableWrapperCollection.GetUniqueName<DesignTimeVariable>(VariableDesigner.DefaultVariableName, wrapper => wrapper.GetVariableName().IdentifierName);
-        }
-
-        Type GetDefaultType()
-        {
-            return typeof(string);
-        }
-
-        ModelItemCollection GetDefaultVariableScope()
-        {
-            //do a lazdy scope refresh
-            //if we have a valid variable scope
-            if (null != this.CurrentVariableScope)
-            {
-                //get the tree manager
-                var treeManager = this.Context.Services.GetService<ModelTreeManager>();
-                if (null != treeManager)
-                {
-                    //get the model tree root 
-                    var root = treeManager.Root;
-                    //get the first scope, which is attached to the model tree (in case of undo/redo operations, even though VariableScope might be
-                    //valid, it actually isn't attached to model tree, so using it as a variable scope doesn't make any sense)
-                    var validScope = this.scopesList.FirstOrDefault(p => ModelItem.Equals(p, root) || root.IsParentOf(p));
-                    //check if valid scope is different that current variable scope. most likely - due to undo/redo operation which removed an activity
-                    if (!ModelItem.Equals(validScope, this.CurrentVariableScope.Parent))
-                    {
-                        //it is different - update the current variable scope (this setter will unhook old event handlers, clean the scopesList collection and hook 
-                        //for new event notifications
-                        this.CurrentVariableScope = validScope.GetVariableCollection();
-                    }
-                }
-            }
-            //return validated variable scope
-            return this.CurrentVariableScope;
-        }
-
-        void Populate(ModelItem workflowElement)
-        {
-            this.scopesList.ForEach(p =>
-            {
-                p.Properties["Variables"].Collection.CollectionChanged -= OnVariableCollectionChanged;
-            });
-
-            this.scopesList.Clear();
-            this.variableDataGrid.ItemsSource = null;
-            this.variableWrapperCollection.All(p => { p.Dispose(); return true; });
-            this.variableWrapperCollection.Clear();
-            var allVariables = VariableHelper.FindDeclaredVariables(workflowElement, this.scopesList);
-            //fill variable wrapper collection only if designer is visible
-            if (workflowElement != null && this.IsVisible)
-            {
-                allVariables.ForEach(variable =>
-                    {
-                        this.variableWrapperCollection.Add(new DesignTimeVariable(variable, this));
-                    });
-            }
-            this.variableDataGrid.ItemsSource = this.variableWrapperCollection;
-
-            this.scopesList.ForEach(p =>
-            {
-                p.Properties["Variables"].Collection.CollectionChanged += OnVariableCollectionChanged;
-            });
-        }
-
-        void StoreLastSelection()
-        {
-            if (!this.isSelectionSourceInternal)
-            {
-                ModelItem current = this.Context.Items.GetValue<Selection>().PrimarySelection;
-                if (null == current || !typeof(DesignTimeVariable).IsAssignableFrom(current.ItemType))
-                {
-                    this.lastSelection = current;
-                }
-            }
-        }
-
-        internal void SelectVariable(ModelItem variable)
-        {
-            this.Dispatcher.BeginInvoke(new Action(() =>
-            {
-                foreach (object item in this.variableDataGrid.Items)
-                {
-                    if (item is DesignTimeVariable)
-                    {
-                        if (object.ReferenceEquals(((DesignTimeVariable)item).ReflectedObject, variable))
-                        {
-                            this.variableDataGrid.SelectedItem = item;
-                            this.variableDataGrid.ScrollIntoView(item, null);
-                        }
-                    }
-                }
-            }), DispatcherPriority.ApplicationIdle);
-
-        }
-
-        void OnDataGridRowSelected(object sender, RoutedEventArgs e)
-        {
-            if (null != this.Context && !this.isSelectionSourceInternal)
-            {
-                this.isSelectionSourceInternal = true;
-                if (null != this.variableDataGrid.SelectedItem && this.variableDataGrid.SelectedItem is DesignTimeVariable)
-                {
-                    DesignTimeVariable variable = (DesignTimeVariable)this.variableDataGrid.SelectedItem;
-                    this.Context.Items.SetValue(new Selection(variable.Content));
-                }
-                else
-                {
-                    // clear variables in selection
-                    Selection oldSelection = this.Context.Items.GetValue<Selection>();
-                    List<ModelItem> newSelection = new List<ModelItem>();
-                    if (oldSelection != null && oldSelection.SelectionCount > 0)
-                    {
-                        foreach (ModelItem item in oldSelection.SelectedObjects)
-                        {
-                            if (item.ItemType != typeof(DesignTimeVariable))
-                            {
-                                newSelection.Add(item);
-                            }
-                        }
-                    }
-                    this.Context.Items.SetValue(new Selection(newSelection));
-                }
-                this.isSelectionSourceInternal = false;
-            }
-        }
-
-        void OnContextChanged()
-        {
-            if (null != this.Context)
-            {
-                this.Context.Items.Subscribe<Selection>(new SubscribeContextCallback<Selection>(OnItemSelected));
-            }
-            this.dgHelper.Context = this.Context;
-        }
-
-        void OnItemSelected(Selection newSelection)
-        {
-            //check if selection update source is internal - it is internal if someone clicks on row in variable designer. in such case, do not update selection
-            if (!this.isSelectionSourceInternal)
-            {
-                //whenever selection changes:
-                //1) check if selection is a result of undo/redo operation - if it is, we might be in the middle of collection changed 
-                //   notification, so i have to postpone variable scope update untill collection update is completed.
-                if (this.Context.Services.GetService<UndoEngine>().IsUndoRedoInProgress)
-                {
-                    //delegate call to update selection after update is completed
-                    this.Dispatcher.BeginInvoke(new Action(() =>
-                    {
-                        //get current selection - i can't use newSelection passed into the method, because undo/redo may alter that value
-                        var current = this.Context.Items.GetValue<Selection>().PrimarySelection;
-                        //do the actual selection update
-                        this.OnItemSelectedCore(current);
-                    }), DispatcherPriority.ApplicationIdle);
-                }
-                else
-                {
-                    //store element selected before variable designer started updating selection - when designer is closed, we try to restore that selection
-                    this.StoreLastSelection();
-                    this.OnItemSelectedCore(newSelection.PrimarySelection);
-                }
-            }
-        }
-
-        void OnItemSelectedCore(ModelItem primarySelection)
-        {
-            //update variable scope - but ignore selection changes made by selecting variables.
-            if (null == primarySelection || !primarySelection.IsAssignableFrom<DesignTimeVariable>())
-            {
-                ModelItem element = VariableHelper.GetVariableScopeElement(primarySelection);
-                ModelItemCollection newVariableScope = VariableHelper.GetVariableCollection(element);
-                if (this.CurrentVariableScope != newVariableScope)
-                {
-                    this.CurrentVariableScope = newVariableScope;
-                }
-                else
-                {
-                    bool selectedVariableIsInSelection = false;
-                    Selection selection = this.Context.Items.GetValue<Selection>();
-
-                    DesignTimeVariable selectedVariable = this.variableDataGrid.SelectedItem as DesignTimeVariable;
-                    if (selectedVariable != null)
-                    {
-                        foreach (ModelItem item in selection.SelectedObjects)
-                        {
-                            if (object.ReferenceEquals(selectedVariable, item.GetCurrentValue()))
-                            {
-                                selectedVariableIsInSelection = true;
-                            }
-                        }
-                    }
-
-                    if (!selectedVariableIsInSelection)
-                    {
-                        this.variableDataGrid.SelectedItem = null;
-                    }
-                }
-            }
-        }
-
-        void OnVariableScopeChanged()
-        {
-            this.Populate(null != this.CurrentVariableScope ? this.CurrentVariableScope.Parent : null);
-        }
-
-        void OnVariableCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
-        {
-            var isUndoRedoInProgress = this.Context.Services.GetService<UndoEngine>().IsUndoRedoInProgress;
-
-            switch (e.Action)
-            {
-                case NotifyCollectionChangedAction.Add:
-                    foreach (ModelItem variable in e.NewItems)
-                    {
-                        DesignTimeVariable wrapper = this.variableWrapperCollection
-                            .FirstOrDefault<DesignTimeVariable>(p => (ModelItem.Equals(p.ReflectedObject, variable)));
-
-                        if (wrapper == null)
-                        {
-                            wrapper = new DesignTimeVariable(variable, this);
-                            this.variableWrapperCollection.Add(wrapper);
-                        }
-                        if (null != this.variableToSelect && this.variableToSelect == variable)
-                        {
-                            this.variableDataGrid.SelectedItem = wrapper;
-                            this.variableToSelect = null;
-
-                            int index = this.variableDataGrid.Items.IndexOf(this.variableDataGrid.SelectedItem);
-                            DataGridRow row = DataGridHelper.GetRow(this.variableDataGrid, index);
-                            if (!row.IsSelected)
-                            {
-                                row.IsSelected = true;
-                            }
-
-                            if (this.continueScopeEdit)
-                            {
-                                DataGridCell cell = DataGridHelper.GetCell(this.variableDataGrid, index, 2);
-                                cell.IsEditing = true;
-                            }
-                        }
-                    }
-                    break;
-
-                case NotifyCollectionChangedAction.Remove:
-                    foreach (ModelItem variable in e.OldItems)
-                    {
-                        DesignTimeVariable wrapper = this.variableWrapperCollection.FirstOrDefault(p => ModelItem.Equals(p.ReflectedObject, variable));
-                        if (null != wrapper)
-                        {
-                            //in case of undo/redo operation - just remove old reference to the wrapper, new one will be added be undo stack anyway
-                            if (!this.ScopesList.Contains((sender as ModelItem).Parent) || isUndoRedoInProgress)
-                            {
-                                this.variableWrapperCollection.Remove(wrapper);
-                            }
-                        }
-                    }
-                    break;
-            }
-            this.RaiseEvent(new RoutedEventArgs(VariableDesigner.VariableCollectionChangedEvent, this));
-        }
-
-        void OnVariableWrapperCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
-        {
-            switch (e.Action)
-            {
-                case NotifyCollectionChangedAction.Remove:
-                    bool isUndoRedoInProgress = this.Context.Services.GetService<UndoEngine>().IsUndoRedoInProgress;
-                    foreach (DesignTimeVariable arg in e.OldItems)
-                    {
-                        if (!isUndoRedoInProgress)
-                        {
-                            this.ClearCaseInsensitiveDuplicates(arg.GetVariableName(), (string)arg.ReflectedObject.Properties["Name"].ComputedValue);
-                            ModelItemCollection collection = (ModelItemCollection)arg.ReflectedObject.Parent;
-                            collection.Remove(arg.ReflectedObject);
-                        }
-                        arg.Dispose();
-                    }
-                    break;
-                case NotifyCollectionChangedAction.Add:
-                    foreach (DesignTimeVariable var in e.NewItems)
-                    {
-                        this.CheckCaseInsensitiveDuplicates(var.GetVariableName(), (string)var.ReflectedObject.Properties["Name"].ComputedValue);
-                    }
-                    break;
-            }
-        }
-
-        void OnVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
-        {
-            if (bool.Equals(true, e.NewValue))
-            {
-                this.StoreLastSelection();
-                this.OnVariableScopeChanged();
-            }
-            else if (this.variableDataGrid.SelectedItem is DesignTimeVariable)
-            {
-                Selection newSelection = null == this.lastSelection ? new Selection() : new Selection(this.lastSelection);
-                this.isSelectionSourceInternal = true;
-                this.Context.Items.SetValue(newSelection);
-                this.variableDataGrid.SelectedItem = null;
-                this.isSelectionSourceInternal = false;
-            }
-        }
-
-        bool OnResolveDynamicContentTemplate(ResolveTemplateParams resolveParams)
-        {
-            var variable = (DesignObjectWrapper)resolveParams.Cell.DataContext;
-
-            //get editor associated with variable's value
-            var editorType = variable.GetDynamicPropertyValueEditorType(DesignTimeVariable.VariableDefaultProperty);
-
-            //if yes there is a custom one - use it
-            if (!typeof(ExpressionValueEditor).IsAssignableFrom(editorType))
-            {
-                //get inline editor template - it will be used for both templates - view and editing; 
-                resolveParams.Template = variable.GetDynamicPropertyValueEditor(DesignTimeVariable.VariableDefaultProperty).InlineEditorTemplate;
-                resolveParams.IsDefaultTemplate = false;
-            }
-            else
-            {
-                //no custom editor - depending on grid state display either editable or readonly expression template
-                string key = resolveParams.Cell.IsEditing ? "variableExpressionEditableTemplate" : "variableExpressionReadonlyTemplate";
-                resolveParams.Template = (DataTemplate)this.FindResource(key);
-                resolveParams.IsDefaultTemplate = true;
-            }
-            return true;
-        }
-
-        DialogPropertyValueEditor OnLoadExtendedValueEditor(DataGridCell cell, object instance)
-        {
-            var variable = (DesignObjectWrapper)cell.DataContext;
-            return variable.GetDynamicPropertyValueEditor(DesignTimeVariable.VariableDefaultProperty) as DialogPropertyValueEditor;
-        }
-
-        ModelProperty OnShowExtendedValueEditor(DataGridCell cell, object instance)
-        {
-            var variable = (DesignObjectWrapper)cell.DataContext;
-            return variable.Content.Properties[DesignTimeVariable.VariableDefaultProperty];
-        }
-
-        static void OnContextChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
-        {
-            ((VariableDesigner)sender).OnContextChanged();
-        }
-
-        static void OnVariableScopeChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
-        {
-            VariableDesigner control = (VariableDesigner)sender;
-            if (!object.Equals(e.OldValue, e.NewValue))
-            {
-                control.OnVariableScopeChanged();
-            }
-        }
-
-        void OnEditingControlLoaded(object sender, RoutedEventArgs args)
-        {
-            DataGridHelper.OnEditingControlLoaded(sender, args);
-        }
-
-        void OnEditingControlUnloaded(object sender, RoutedEventArgs args)
-        {
-            DataGridHelper.OnEditingControlUnloaded(sender, args);
-        }
-
-        // This is to workaround a bug that updating ModelItem from outside of VariableDesigner will not update VariableDesigner.
-        internal void NotifyAnnotationTextChanged()
-        {
-            foreach (object item in this.variableDataGrid.Items)
-            {
-                DesignTimeVariable designTimeVariable = item as DesignTimeVariable;
-                if (designTimeVariable != null)
-                {
-                    designTimeVariable.NotifyPropertyChanged(DesignTimeVariable.AnnotationTextProperty);
-                }
-            }
-        }
-
-        protected override void OnContextMenuOpening(ContextMenuEventArgs e)
-        {
-            base.OnContextMenuOpening(e);
-
-            DesignerConfigurationService configurationService = this.Context.Services.GetService<DesignerConfigurationService>();
-            Fx.Assert(configurationService != null, "DesignerConfigurationService should not be null");
-            if (configurationService.WorkflowDesignerHostId == WorkflowDesignerHostId.Dev10)
-            {
-                return;
-            }
-            
-            e.Handled = true;
-
-            bool openedByKeyboard = e.CursorLeft < 0 && e.CursorTop < 0;
-
-            if (openedByKeyboard)
-            {
-                this.ContextMenu.Placement = PlacementMode.Center;
-            }
-            else
-            {
-                this.ContextMenu.Placement = PlacementMode.MousePoint;
-            }
-            this.ContextMenu.PlacementTarget = this;
-            this.ContextMenu.IsOpen = true;
-        }
-
-        private void OnDeleteCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnDeleteCommandCanExecute(e, this.variableDataGrid);
-        }
-
-        private void OnDeleteCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            if (this.variableDataGrid != null && this.variableDataGrid.SelectedItems != null && this.variableDataGrid.SelectedItems.Count > 0)
-            {
-                List<ModelItem> list = new List<ModelItem>();
-                foreach (object item in this.variableDataGrid.SelectedItems)
-                {
-                    DesignTimeVariable designTimeVariable = item as DesignTimeVariable;
-                    if (designTimeVariable != null)
-                    {
-                        list.Add(designTimeVariable.ReflectedObject);
-                    }
-                }
-
-                foreach (ModelItem modelItem in list)
-                {
-                    foreach (DesignTimeVariable designTimeVariable in this.variableWrapperCollection)
-                    {
-                        if (designTimeVariable.ReflectedObject == modelItem)
-                        {
-                            this.variableWrapperCollection.Remove(designTimeVariable);
-                            break;
-                        }
-                    }
-                }
-            }
-
-            e.Handled = true;
-        }
-
-        private void OnAnnotationSeparatorLoaded(object sender, RoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnAnnotationMenuLoaded(this.Context, (Control)sender, e);
-        }
-
-        private void OnAddAnnotationMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnAnnotationMenuLoaded(this.Context, (Control)sender, e);
-        }
-
-        private void OnAddAnnotationCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnAddAnnotationCommandCanExecute(e, this.Context, this.variableDataGrid);
-        }
-
-        private void OnAddAnnotationCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            if (this.variableDataGrid != null && this.variableDataGrid.SelectedItems != null && this.variableDataGrid.SelectedItems.Count == 1)
-            {
-                AnnotationDialog dialog = new AnnotationDialog();
-                dialog.Context = Context;
-                dialog.Title = SR.AddAnnotationTitle;
-
-                WindowHelperService service = this.Context.Services.GetService<WindowHelperService>();
-                if (null != service)
-                {
-                    service.TrySetWindowOwner(this, dialog);
-                }
-                dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen;
-
-                if (dialog.ShowDialog() == true)
-                {
-                    string annotationText = dialog.AnnotationText;
-
-                    DesignTimeVariable variable = (DesignTimeVariable)this.variableDataGrid.SelectedItems[0];
-                    variable.Content.Properties[DesignTimeVariable.AnnotationTextProperty].SetValue(annotationText);
-                }
-            }
-
-            e.Handled = true;
-        }
-
-        private void OnEditAnnotationMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnAnnotationMenuLoaded(this.Context, (Control)sender, e);
-        }
-
-        private void OnEditAnnotationCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            // call the same method as delete annotation command
-            ContextMenuUtilities.OnDeleteAnnotationCommandCanExecute(e, this.Context, this.variableDataGrid);
-        }
-
-        private void OnEditAnnotationCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            if (this.variableDataGrid != null && this.variableDataGrid.SelectedItems != null && this.variableDataGrid.SelectedItems.Count == 1)
-            {
-                DesignTimeVariable variable = (DesignTimeVariable)this.variableDataGrid.SelectedItems[0];
-
-                AnnotationDialog dialog = new AnnotationDialog();
-                dialog.Context = Context;
-                dialog.Title = SR.EditAnnotationTitle;
-                dialog.AnnotationText = variable.Content.Properties[DesignTimeVariable.AnnotationTextProperty].ComputedValue as string;
-
-                WindowHelperService service = this.Context.Services.GetService<WindowHelperService>();
-                if (null != service)
-                {
-                    service.TrySetWindowOwner(this, dialog);
-                }
-                dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen;
-
-                if (dialog.ShowDialog() == true)
-                {
-                    string annotationText = dialog.AnnotationText;
-
-                    variable.Content.Properties[DesignTimeVariable.AnnotationTextProperty].SetValue(annotationText);
-                }
-            }
-        }
-
-        private void OnDeleteAnnotationMenuLoaded(object sender, RoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnAnnotationMenuLoaded(this.Context, (Control)sender, e);
-        }
-
-        private void OnDeleteAnnotationCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            ContextMenuUtilities.OnDeleteAnnotationCommandCanExecute(e, this.Context, this.variableDataGrid);
-        }
-
-        private void OnDeleteAnnotationCommandExecuted(object sender, ExecutedRoutedEventArgs e)
-        {
-            if (this.variableDataGrid != null && this.variableDataGrid.SelectedItems != null && this.variableDataGrid.SelectedItems.Count == 1)
-            {
-                DesignTimeVariable variable = (DesignTimeVariable)this.variableDataGrid.SelectedItems[0];
-                variable.Content.Properties[DesignTimeVariable.AnnotationTextProperty].ClearValue();
-            }
-
-            e.Handled = true;
-        }
-    }
-
-    internal static class VariableHelper
-    {
-        static Type VariablesCollectionType = typeof(Collection<Variable>);
-        static Type CodeActivityType = typeof(CodeActivity);
-        static Type GenericCodeActivityType = typeof(CodeActivity<>);
-        static Type AsyncCodeActivityType = typeof(AsyncCodeActivity);
-        static Type GenericAsyncCodeActivityType = typeof(AsyncCodeActivity<>);
-
-        internal static ModelItemCollection GetVariableCollection(this ModelItem element)
-        {
-            if (null != element)
-            {
-                Type elementType = element.ItemType;
-                if (!((CodeActivityType.IsAssignableFrom(elementType)) || (GenericAsyncCodeActivityType.IsAssignableFrom(elementType)) ||
-                    (AsyncCodeActivityType.IsAssignableFrom(elementType)) || (GenericAsyncCodeActivityType.IsAssignableFrom(elementType))))
-                {
-                    ModelProperty variablesProperty = element.Properties["Variables"];
-                    if ((variablesProperty != null) && (variablesProperty.PropertyType == VariablesCollectionType))
-                    {
-                        return variablesProperty.Collection;
-                    }
-                }
-            }
-            return null;
-        }
-
-        internal static ModelItem GetVariableScopeElement(this ModelItem element)
-        {
-            while (null != element && null == VariableHelper.GetVariableCollection(element))
-            {
-                element = element.Parent;
-            }
-            return element;
-        }
-
-        internal static List<ModelItem> FindDeclaredVariables(this ModelItem element, IList<ModelItem> scopeList)
-        {
-            var variables = VariableHelper.FindVariablesInScope(element, scopeList);
-            var contained = VariableHelper.GetVariableCollection(element);
-            if (null != contained)
-            {
-                if (null != scopeList)
-                {
-                    scopeList.Insert(0, element);
-                }
-                variables.InsertRange(0, contained.AsEnumerable());
-            }
-            return variables;
-        }
-
-        internal static List<ModelItem> FindDeclaredVariables(this ModelItem element)
-        {
-            return VariableHelper.FindDeclaredVariables(element, null);
-        }
-
-        internal static List<ModelItem> FindActivityDelegateArgumentsInScope(this ModelItem workflowElement)
-        {
-            List<ModelItem> variables = new List<ModelItem>();
-            if (workflowElement != null)
-            {
-                workflowElement = workflowElement.Parent;
-                while (null != workflowElement)
-                {
-                    variables.AddRange(workflowElement.FindActivityDelegateArguments());
-                    workflowElement = workflowElement.Parent;
-                }
-            }
-            return variables;
-        }
-
-        internal static List<ModelItem> FindActivityDelegateArguments(this ModelItem element)
-        {
-            List<ModelItem> delegateArguments = new List<ModelItem>();
-            if (element.GetCurrentValue() is ActivityDelegate)
-            {
-                //browse all properties in given ActivityDelegate
-                delegateArguments.AddRange(element.Properties
-                    //choose only those of base type equal to DelegateArgument
-                    .Where<ModelProperty>(p => (typeof(DelegateArgument).IsAssignableFrom(p.PropertyType) && null != p.Value))
-                    //from those, take actual ModelItem value
-                    .Select<ModelProperty, ModelItem>(p => p.Value));
-            }
-
-            return delegateArguments;
-        }
-
-        internal static List<ModelItem> FindVariablesInScope(this ModelItem element, IList<ModelItem> scopeList)
-        {
-            List<ModelItem> variables = new List<ModelItem>();
-            if (null != scopeList)
-            {
-                scopeList.Clear();
-            }
-            if (null != element)
-            {
-                element = element.Parent;
-                while (element != null)
-                {
-                    ModelItemCollection variablesInElement = VariableHelper.GetVariableCollection(element);
-                    if (null != variablesInElement)
-                    {
-                        if (null != scopeList)
-                        {
-                            scopeList.Add(element);
-                        }
-                        variables.AddRange(variablesInElement.AsEnumerable());
-                    }
-                    element = element.Parent;
-                }
-            }
-            return variables;
-        }
-
-        internal static List<ModelItem> FindUniqueVariablesInScope(ModelItem element)
-        {
-            Dictionary<string, ModelItem> variables = new Dictionary<string, ModelItem>();
-            while (element != null)
-            {
-                ModelItemCollection variablesInElement = VariableHelper.GetVariableCollection(element);
-                if (null != variablesInElement)
-                {
-                    foreach (ModelItem modelVariable in variablesInElement)
-                    {
-                        LocationReference locationReference = modelVariable.GetCurrentValue() as LocationReference;
-                        if (locationReference != null && !string.IsNullOrWhiteSpace(locationReference.Name) && !variables.ContainsKey(locationReference.Name))
-                        {
-                            variables.Add(locationReference.Name, modelVariable);
-                        }
-                    }
-                }
-                element = element.Parent;
-            }
-            return new List<ModelItem>(variables.Values);
-        }
-
-
-        internal static List<ModelItem> FindVariablesInScope(ModelItem element)
-        {
-            return VariableHelper.FindVariablesInScope(element, null);
-        }
-
-        internal static bool ContainsVariable(this ModelItemCollection variableContainer, string variableName)
-        {
-            if (null == variableContainer)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("variableContainer"));
-            }
-            if (!variableContainer.ItemType.IsGenericType ||
-                variableContainer.ItemType.GetGenericArguments().Length != 1 ||
-                !typeof(Variable).IsAssignableFrom(variableContainer.ItemType.GetGenericArguments()[0]))
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException("non variable collection"));
-            }
-
-            return variableContainer.Any(p => string.Equals(p.Properties[DesignTimeVariable.VariableNameProperty].ComputedValue, variableName));
-        }
-
-        internal static string CreateUniqueVariableName(this ModelItemCollection variableContainer, string namePrefix, int countStartValue)
-        {
-            if (null == variableContainer)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("variableContainer"));
-            }
-            if (!variableContainer.ItemType.IsGenericType ||
-                variableContainer.ItemType.GetGenericArguments().Length != 1 ||
-                !typeof(Variable).IsAssignableFrom(variableContainer.ItemType.GetGenericArguments()[0]))
-            {
-                throw FxTrace.Exception.AsError(new ArgumentException("non variable collection"));
-            }
-
-            string name = string.Empty;
-
-            //in order to generate unique variable name, browse all scopes from current to the root - variable name should be unique in whole tree up to 
-            //the root. we don't check unique check below current scope - it would be too expensive to ---- whole tree
-            var variables = VariableHelper.FindVariablesInScope(variableContainer);
-            while (true)
-            {
-                name = string.Format(CultureInfo.CurrentUICulture, "{0}{1}", namePrefix, countStartValue++);
-                if (!variables.Any(p => string.Equals(p.Properties[DesignTimeVariable.VariableNameProperty].ComputedValue, name)))
-                {
-                    break;
-                }
-            }
-
-            return name;
-        }
-
-        internal static ModelItem FindRootVariableScope(ModelItem element)
-        {
-            if (null == element)
-            {
-                throw FxTrace.Exception.ArgumentNull("element");
-            }
-            ModelItem result = element.GetParentEnumerator().Where(p => null != VariableHelper.GetVariableCollection(p)).LastOrDefault();
-            return result;
-        }
-
-        internal static ModelItem FindCommonVariableScope(ModelItem scope1, ModelItem scope2)
-        {
-            if (null == scope1 || null == scope2)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException(null == scope1 ? "scope1" : "scope2"));
-            }
-
-            var scope1List = scope1.GetParentEnumerator().Where(p => null != VariableHelper.GetVariableCollection(p)).ToList();
-            var scope2List = scope2.GetParentEnumerator().Where(p => null != VariableHelper.GetVariableCollection(p)).ToList();
-
-            if (null != VariableHelper.GetVariableCollection(scope1))
-            {
-                scope1List.Insert(0, scope1);
-            }
-            if (null != VariableHelper.GetVariableCollection(scope2))
-            {
-                scope2List.Insert(0, scope2);
-            }
-
-            if (scope1 == scope2)
-            {
-                return scope1List.FirstOrDefault();
-            }
-
-            return scope1List.Intersect(scope2List).FirstOrDefault();
-        }
-    }
-
-    sealed class DesignTimeVariable : DesignObjectWrapper
-    {
-        internal static readonly string VariableNameProperty = "Name";
-        internal static readonly string VariableTypeProperty = "Type";
-        internal static readonly string VariableScopeProperty = "Scope";
-        internal static readonly string VariableDefaultProperty = "Default";
-        internal static readonly string ToolTipProperty = "ToolTip";
-        internal static readonly string VariableScopeLevelProperty = "ScopeLevel";
-        internal static readonly string VariableModifiersProperty = "Modifiers";
-        internal static readonly string AnnotationTextProperty = "DesignTimeVariableAnnotationText";
-        static readonly string[] Properties =
-            new string[] { VariableNameProperty, VariableTypeProperty, VariableScopeProperty, VariableDefaultProperty, 
-                           ToolTipProperty, VariableScopeLevelProperty, VariableModifiersProperty };
-
-        bool variableTypeChanged = false;
-
-        internal VariableDesigner Editor
-        {
-            get;
-            private set;
-        }
-
-        VBIdentifierName identifierName;
-
-        #region Initialize type properties code
-        public static PropertyDescriptorData[] InitializeTypeProperties()
-        {
-            return new PropertyDescriptorData[]
-            {
-                new PropertyDescriptorData()
-                {
-                    PropertyName = VariableNameProperty,
-                    PropertyType = typeof(VBIdentifierName),
-                    PropertyAttributes = TypeDescriptor.GetAttributes(typeof(VBIdentifierName)).OfType<Attribute>().ToArray(),
-                    PropertySetter = (instance, newValue) =>
-                        {
-                            ((DesignTimeVariable)instance).SetVariableName((VBIdentifierName)newValue);
-                        },
-                    PropertyGetter = (instance) => (((DesignTimeVariable)instance).GetVariableName()),
-                    PropertyValidator  = (instance, value, errors) => (((DesignTimeVariable)instance).ValidateVariableName(value, errors))
-                },
-                new PropertyDescriptorData()
-                {
-                    PropertyName = VariableTypeProperty,
-                    PropertyType = typeof(Type),
-                    PropertyAttributes = TypeDescriptor.GetAttributes(typeof(Type)).OfType<Attribute>().ToArray(),
-                    PropertySetter = (instance, newValue) =>
-                        {
-                            ((DesignTimeVariable)instance).SetVariableType((Type)newValue);
-                        },
-                    PropertyGetter = (instance) => (((DesignTimeVariable)instance).GetVariableType()),
-                    PropertyValidator = null
-                },
-                new PropertyDescriptorData()
-                {
-                    PropertyName = VariableScopeProperty,
-                    PropertyType = typeof(ModelItem),
-                    PropertyAttributes = TypeDescriptor.GetAttributes(typeof(ModelItem)).OfType<Attribute>().Union(new Attribute[] { new EditorAttribute(typeof(ScopeValueEditor), typeof(PropertyValueEditor)) }).ToArray(),
-                    PropertySetter = (instance, newValue) =>
-                        {
-                            ((DesignTimeVariable)instance).SetVariableScope(newValue);
-                        },
-                    PropertyGetter = (instance) => (((DesignTimeVariable)instance).GetVariableScope()),
-                    PropertyValidator  = (instance, value, errors) => (((DesignTimeVariable)instance).ValidateVariableScope(value, errors))
-                },
-                new PropertyDescriptorData()
-                {
-                    PropertyName = VariableDefaultProperty,
-                    PropertyType = typeof(Activity),
-                    PropertyAttributes = TypeDescriptor.GetAttributes(typeof(Activity)).OfType<Attribute>().Union(new Attribute[] { new EditorAttribute(typeof(DesignObjectWrapperDynamicPropertyEditor), typeof(DialogPropertyValueEditor)), new EditorReuseAttribute(false) }).ToArray(),
-                    PropertySetter = (instance, newValue) =>
-                        {
-                            ((DesignTimeVariable)instance).SetVariableValue(newValue);
-                        },
-                    PropertyGetter = (instance) => (((DesignTimeVariable)instance).GetVariableValue()),
-                    PropertyValidator  = null,
-                },
-                new PropertyDescriptorData()
-                {
-                    PropertyName = ToolTipProperty,
-                    PropertyType = typeof(string),
-                    PropertyAttributes = new Attribute[] { BrowsableAttribute.No },
-                    PropertySetter = null,
-                    PropertyGetter = (instance) => (((DesignTimeVariable)instance).GetToolTip()),
-                    PropertyValidator = null
-                },
-                new PropertyDescriptorData()
-                {
-                    PropertyName = VariableScopeLevelProperty,
-                    PropertyType = typeof(int),
-                    PropertyAttributes = new Attribute[] { BrowsableAttribute.No },
-                    PropertySetter = null,
-                    PropertyValidator = null,
-                    PropertyGetter = (instance) =>
-                        (
-                            ((DesignTimeVariable)instance).GetScopeLevel()
-                        ),
-                },
-                new PropertyDescriptorData()
-                {
-                    PropertyName = VariableModifiersProperty,
-                    PropertyType = typeof(VariableModifiers), 
-                    PropertyAttributes = TypeDescriptor.GetAttributes(typeof(VariableModifiers)).OfType<Attribute>().ToArray(), 
-                    PropertySetter = (instance, newValue) => 
-                        {
-                            ((DesignTimeVariable)instance).SetVariableModifiers(newValue);
-                        },
-                    PropertyValidator = null,
-                    PropertyGetter = (instance) => 
-                        {
-                            return ((DesignTimeVariable)instance).GetVariableModifiers();
-                        }
-                },
-                new PropertyDescriptorData()
-                {
-                    PropertyName = AnnotationTextProperty,
-                    PropertyType = typeof(string),
-                    PropertyAttributes = new Attribute[] { BrowsableAttribute.No },
-                    PropertySetter = (instance, newValue) =>
-                        {
-                            ((DesignTimeVariable)instance).SetAnnotationText(newValue);
-                        },
-                    PropertyValidator = null,
-                    PropertyGetter = (instance) =>
-                        {
-                            return ((DesignTimeVariable)instance).GetAnnotationText();
-                        }
-                }
-            };
-        }
-        #endregion
-
-        public DesignTimeVariable()
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException(SR.InvalidConstructorCall));
-        }
-
-        internal DesignTimeVariable(ModelItem modelItem, VariableDesigner editor)
-            : base(modelItem)
-        {
-            this.Editor = editor;
-            this.identifierName = new VBIdentifierName
-            {
-                IdentifierName = (string)modelItem.Properties[VariableNameProperty].ComputedValue
-            };
-        }
-
-        protected override string AutomationId
-        {
-            get { return this.GetVariableNameString(); }
-        }
-
-        void SetVariableName(VBIdentifierName identifierName)
-        {
-            using (ModelEditingScope change = this.ReflectedObject.BeginEdit((string)this.Editor.FindResource("changeVariableNameDescription")))
-            {
-                this.identifierName = identifierName;
-                string name = this.identifierName.IdentifierName;
-                this.Editor.NotifyVariableNameChanged(this.identifierName, name, (string)this.ReflectedObject.Properties[VariableNameProperty].ComputedValue);
-                this.ReflectedObject.Properties[VariableNameProperty].SetValue(name);
-
-                change.Complete();
-            }
-        }
-
-        internal VBIdentifierName GetVariableName()
-        {
-            return this.identifierName;
-        }
-
-        string GetVariableNameString()
-        {
-            return (string)this.ReflectedObject.Properties[VariableNameProperty].ComputedValue;
-        }
-
-        protected override void OnReflectedObjectPropertyChanged(string propertyName)
-        {
-            if (propertyName == Annotation.AnnotationTextPropertyName)
-            {
-                RaisePropertyChangedEvent(AnnotationTextProperty);
-            }
-
-            if (propertyName == VariableNameProperty)
-            {
-                string oldValue = this.identifierName.IdentifierName;
-                string newValue = GetVariableNameString();
-
-                //This is invoked in undo stack
-                if (oldValue != newValue)
-                {
-                    this.identifierName = new VBIdentifierName
-                    {
-                        IdentifierName = newValue
-                    };
-                    Editor.NotifyVariableNameChanged(this.identifierName, newValue, oldValue);
-                }
-            }
-        }
-
-        void SetVariableModifiers(object modifiers)
-        {
-            this.ReflectedObject.Properties[VariableModifiersProperty].SetValue(
-                modifiers is ModelItem ? (modifiers as ModelItem).GetCurrentValue() : modifiers);
-        }
-
-        object GetVariableModifiers()
-        {
-            return this.ReflectedObject.Properties[VariableModifiersProperty].ComputedValue;
-        }
-
-        int GetScopeLevel()
-        {
-            int level = 0;
-            ModelItem parent = this.ReflectedObject.Parent;
-            while (null != parent)
-            {
-                ++level;
-                parent = parent.Parent;
-            }
-            return level;
-        }
-
-        // Used by screen reader to read the DataGrid row.
-        public override string ToString()
-        {
-            string name = this.GetVariableNameString();
-            if (!string.IsNullOrEmpty(name))
-            {
-                return name;
-            }
-            return "Variable";
-        }
-
-        void SetVariableType(Type type)
-        {
-            if (!Type.Equals(type, this.GetVariableType()))
-            {
-                using (ModelEditingScope change = this.ReflectedObject.BeginEdit((string)this.Editor.FindResource("changeVariableTypeDescription")))
-                {
-                    this.variableTypeChanged = true;
-                    ModelItemCollection variableContainer = (ModelItemCollection)this.ReflectedObject.Parent;
-                    //proceed only if variable is associated with container
-                    if (null != variableContainer)
-                    {
-                        Variable variable = Variable.Create(this.GetVariableNameString(), type, (VariableModifiers)this.GetVariableModifiers());
-                        string annotationText = this.GetAnnotationText() as string;
-                        if (annotationText != null)
-                        {
-                            Annotation.SetAnnotationText(variable, annotationText);
-                        }
-
-                        //try to preserve expression
-                        ModelItem expressionModelItem = this.ReflectedObject.Properties[VariableDefaultProperty].Value;
-                        if (expressionModelItem != null)
-                        {
-                            ActivityWithResult expression = expressionModelItem.GetCurrentValue() as ActivityWithResult;
-                            //check if there existed expression
-                            if (expression != null)
-                            {
-                                ActivityWithResult morphedExpression = null;
-                                if (ExpressionHelper.TryMorphExpression(expression, false, type, this.Context, out morphedExpression))
-                                {
-                                    variable.Default = morphedExpression;
-                                }
-                                //[....] 
-
-                            }
-                        }
-                        Editor.ChangeVariableType(this, variable);
-                        ImportDesigner.AddImport(type.Namespace, this.Context);
-                        change.Complete();
-                    }
-                }
-            }
-        }
-
-        Type GetVariableType()
-        {
-            return (Type)this.ReflectedObject.Properties[VariableTypeProperty].ComputedValue;
-        }
-
-        void SetVariableScope(object newScope)
-        {
-            using (ModelEditingScope change = this.ReflectedObject.BeginEdit((string)this.Editor.FindResource("changeVariableScopeDescription")))
-            {
-                if (!ModelItem.Equals(newScope, this.GetVariableScope()))
-                {
-                    ModelItemCollection currentScopeContainer = this.ReflectedObject.Parent.Parent.Properties["Variables"].Collection;
-                    currentScopeContainer.Remove(this.ReflectedObject.GetCurrentValue());
-                    ModelItem scope = (newScope as ModelItem) ?? Editor.ScopesList.FirstOrDefault(p => object.Equals(p.GetCurrentValue(), newScope));
-                    ModelItemCollection newScopeContainer = scope.Properties["Variables"].Collection;
-                    newScopeContainer.Add(this.ReflectedObject.GetCurrentValue());
-                    Editor.NotifyVariableScopeChanged(this);
-                }
-                change.Complete();
-            }
-        }
-
-        object GetVariableScope()
-        {
-            return this.ReflectedObject.Parent.Parent;
-        }
-
-        void SetVariableValue(object value)
-        {
-            object expression = value is ModelItem ? ((ModelItem)value).GetCurrentValue() : value;
-            this.ReflectedObject.Properties[VariableDefaultProperty].SetValue(expression);
-        }
-
-        object GetVariableValue()
-        {
-            return this.ReflectedObject.Properties[VariableDefaultProperty].ComputedValue;
-        }
-
-        string GetToolTip()
-        {
-            ModelItem s = this.ReflectedObject.Parent.Parent;
-            IMultiValueConverter converter = (IMultiValueConverter)(this.Editor.FindResource("scopeToNameConverter"));
-            return ScopeToTooltipConverter.BuildToolTip(s, converter, CultureInfo.CurrentCulture);
-        }
-
-        object GetAnnotationText()
-        {
-            ModelProperty property = this.ReflectedObject.Properties.Find(Annotation.AnnotationTextPropertyName);
-
-            if (property != null)
-            {
-                return property.ComputedValue;
-            }
-            else
-            {
-                return null;
-            }
-        }
-
-        void SetAnnotationText(object annotationText)
-        {
-            ModelProperty property = this.ReflectedObject.Properties.Find(Annotation.AnnotationTextPropertyName);
-
-            if (property != null)
-            {
-                property.SetValue(annotationText);
-            }
-        }
-
-        protected override Type OnGetDynamicPropertyValueEditorType(string propertyName)
-        {
-            var type = this.GetVariableType();
-
-            //in case of variables which contain handles - display HandleValueEditor
-            if (typeof(Handle).IsAssignableFrom(type))
-            {
-                return typeof(HandleValueEditor);
-            }
-
-            var referenceType = typeof(PropertyValueEditor);
-            var expressionEditorType = typeof(ExpressionValueEditor);
-
-            //check if there are custom editors on the variable's type
-            var variableOfType = typeof(Variable<>).MakeGenericType(type);
-
-            //check if there are custom type editors associated with given type - 
-            //look for type editor defined for Variable<T>
-            //in search, skip ExpressionValueEditor instance - it will be returned by default for property grid, but for
-            //dataGrid nothing should be used - we use default dg template
-            var customEditorType = TypeDescriptor
-                .GetAttributes(variableOfType)
-                .OfType<EditorAttribute>()
-                .Where(p =>
-                    {
-                        Type currentType = Type.GetType(p.EditorTypeName);
-                        return (expressionEditorType != currentType && referenceType.IsAssignableFrom(currentType));
-                    })
-                .Select(p => Type.GetType(p.EditorTypeName))
-                .FirstOrDefault();
-
-
-            //return custom editor type (if any)
-            if (null != customEditorType)
-            {
-                return customEditorType;
-            }
-
-            //otherwise - return default expression value editor
-            return typeof(ExpressionValueEditor);
-        }
-
-        protected override void OnPropertyChanged(string propertyName)
-        {
-            //this method is called by the thread's dispatcher AFTER all prorties have been updated, so all the property values
-            //are updated, regardless of the editing scope deep
-            if (string.Equals(propertyName, DesignTimeVariable.VariableScopeProperty))
-            {
-                this.RaisePropertyChangedEvent(ToolTipProperty);
-                this.RaisePropertyChangedEvent(VariableScopeLevelProperty);
-            }
-            else if (string.Equals(propertyName, DesignTimeVariable.VariableNameProperty))
-            {
-                this.RaisePropertyChangedEvent(AutomationIdProperty);
-            }
-            else if (string.Equals(propertyName, DesignTimeVariable.VariableTypeProperty))
-            {
-                this.RaisePropertyChangedEvent(VariableDefaultProperty);
-            }
-            else if (string.Equals(propertyName, DesignTimeVariable.TimestampProperty))
-            {
-                if (this.variableTypeChanged)
-                {
-                    this.RaisePropertyChangedEvent(DesignTimeVariable.VariableTypeProperty);
-                    this.variableTypeChanged = false;
-                    this.CustomValueEditors.Clear();
-                    this.Editor.UpdateTypeDesigner(this);
-                }
-            }
-            base.OnPropertyChanged(propertyName);
-        }
-
-        bool ValidateVariableName(object newValue, List<string> errors)
-        {
-            if (!base.IsUndoRedoInProgress && null != this.ReflectedObject.Parent)
-            {
-                VBIdentifierName identifier = newValue as VBIdentifierName;
-
-                string newName = null;
-                if (identifier != null)
-                {
-                    newName = identifier.IdentifierName;
-                }
-
-
-                if (!string.IsNullOrEmpty(newName))
-                {
-                    Func<ModelItem, bool> checkForDuplicates =
-                        new Func<ModelItem, bool>(p => string.Equals(p.Properties[VariableNameProperty].ComputedValue, newName) && !object.Equals(p, this.ReflectedObject));
-
-                    bool duplicates = this.ReflectedObject.Parent.Parent.Properties["Variables"].Collection.Any(checkForDuplicates);
-
-                    if (duplicates)
-                    {
-                        errors.Add(string.Format(CultureInfo.CurrentUICulture, SR.DuplicateVariableName, newName));
-                    }
-                }
-                else
-                {
-                    errors.Add(SR.EmptyVariableName);
-                }
-            }
-            return 0 == errors.Count;
-        }
-
-        bool ValidateVariableScope(object newValue, List<string> errors)
-        {
-            if (!base.IsUndoRedoInProgress)
-            {
-                ModelItem scope = (newValue as ModelItem) ?? Editor.ScopesList.FirstOrDefault(p => object.Equals(p.GetCurrentValue(), newValue));
-                string currentName = this.GetVariableNameString();
-
-                Func<ModelItem, bool> checkForDuplicates =
-                    new Func<ModelItem, bool>(p => string.Equals(p.Properties[VariableNameProperty].ComputedValue, currentName) && !object.Equals(p, this.ReflectedObject));
-
-                bool duplicates = scope.Properties["Variables"].Collection.Any(checkForDuplicates);
-                if (duplicates)
-                {
-                    errors.Add(string.Format(CultureInfo.CurrentUICulture, SR.DuplicateVariableName, currentName));
-                }
-            }
-            return 0 == errors.Count;
-        }
-
-        #region Internal classes
-        internal sealed class ScopeValueEditor : PropertyValueEditor
-        {
-            public ScopeValueEditor()
-            {
-                this.InlineEditorTemplate = EditorResources.GetResources()["ScopeEditor_InlineEditorTemplate"] as DataTemplate;
-            }
-        }
-
-        #endregion
-    }
-
-    sealed class DesignTimeVariableToScopeConverter : IValueConverter
-    {
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            ModelItem designTimeVariable = value as ModelItem;
-            object result = null;
-            if (null != designTimeVariable && typeof(DesignTimeVariable).IsAssignableFrom(designTimeVariable.ItemType))
-            {
-                DesignTimeVariable variable = (DesignTimeVariable)designTimeVariable.GetCurrentValue();
-                result = variable.Editor.ScopesList;
-            }
-            return result;
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-    }
-
-    sealed class ScopeToTooltipConverter : IValueConverter
-    {
-        IMultiValueConverter baseConverter = new BreadCrumbTextConverter();
-
-        internal static string BuildToolTip(ModelItem entry, IMultiValueConverter displayNameConverter, CultureInfo culture)
-        {
-            string result = null;
-            if (null != entry && null != displayNameConverter)
-            {
-                StringBuilder sb = new StringBuilder();
-                int indent = 0;
-                ModelItem currentEntry = entry;
-                while (currentEntry != null)
-                {
-                    if (null != currentEntry.Properties["Variables"])
-                    {
-                        ++indent;
-                    }
-                    currentEntry = currentEntry.Parent;
-                }
-
-                while (entry != null)
-                {
-                    if (null != entry.Properties["Variables"])
-                    {
-                        if (sb.Length != 0)
-                        {
-                            sb.Insert(0, "/");
-                            sb.Insert(0, " ", --indent);
-                            sb.Insert(0, Environment.NewLine);
-                        }
-                        var input = new object[] { entry, null != entry.Properties["DisplayName"] ? entry.Properties["DisplayName"].Value : null, (double)short.MaxValue };
-                        sb.Insert(0, displayNameConverter.Convert(input, typeof(string), null, culture));
-                    }
-                    entry = entry.Parent;
-                }
-                result = sb.ToString();
-            }
-            return result;
-        }
-
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            return BuildToolTip(value as ModelItem, this.baseConverter, culture);
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-    }
-
-    sealed class ScopeComboBox : ComboBox
-    {
-        bool isScopeValid = true;
-
-        protected override void OnInitialized(EventArgs e)
-        {
-            base.OnInitialized(e);
-            this.Loaded += (s, args) =>
-                {
-                    //get the binding expression, and hook up exception filter
-                    var expr = this.GetBindingExpression(ScopeComboBox.SelectedItemProperty);
-                    if (null != expr && null != expr.ParentBinding)
-                    {
-                        expr.ParentBinding.UpdateSourceExceptionFilter = this.OnUpdateBindingException;
-                    }
-                };
-        }
-
-        object OnUpdateBindingException(object sender, Exception err)
-        {
-            //if exception occured, the scope as invalid
-            if (err is TargetInvocationException && err.InnerException is ValidationException || err is ValidationException)
-            {
-                this.isScopeValid = false;
-            }
-            return null;
-        }
-
-        protected override void OnSelectionChanged(SelectionChangedEventArgs e)
-        {
-            //if validation succeeded - update the control state with new selection
-            if (this.isScopeValid)
-            {
-                base.OnSelectionChanged(e);
-            }
-            //otherwise, get the binding expression and update control with current state from the source
-            else
-            {
-                var expr = this.GetBindingExpression(ScopeComboBox.SelectedItemProperty);
-                if (null != expr)
-                {
-                    expr.UpdateTarget();
-                }
-                //the next failed validation pass may set this flag to false, but if validation succeeds, it has to be set to true
-                this.isScopeValid = true;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VersionEditor.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VersionEditor.xaml.cs
deleted file mode 100644 (file)
index 2d83721..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System;
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Windows;
-    using System.Windows.Controls;
-
-    internal partial class VersionEditor : UserControl, IVersionEditor
-    {
-        private static DependencyProperty versionProperty = DependencyProperty.Register("Version", typeof(Version), typeof(VersionEditor), new PropertyMetadata(new PropertyChangedCallback(VersionEditor.OnVersionChanged)));
-        private static DependencyProperty viewModelProperty = DependencyProperty.Register("ViewModel", typeof(VersionEditorViewModel), typeof(VersionEditor));
-
-        [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors",
-            Justification = "This value must be set in contructor to ensure that ViewModel could be used")]
-        public VersionEditor()
-        {
-            this.InitializeComponent();
-            this.ViewModel = new VersionEditorViewModel(this);
-            this.ViewModel.PropertyChanged += this.OnViewModelPropertyChanged;
-        }
-
-        public static DependencyProperty VersionProperty
-        {
-            get { return versionProperty; }
-        }
-
-        public Version Version
-        {
-            get { return (Version)GetValue(VersionProperty); }
-            set { SetValue(VersionProperty, value); }
-        }
-
-        private static DependencyProperty ViewModelProperty
-        {
-            get { return viewModelProperty; }
-        }
-
-        private VersionEditorViewModel ViewModel
-        {
-            get { return (VersionEditorViewModel)GetValue(ViewModelProperty); }
-            set { SetValue(ViewModelProperty, value); }
-        }
-
-        void IVersionEditor.ShowErrorMessage(string message)
-        {
-            ErrorReporting.ShowErrorMessage(message);
-        }
-
-        private static void OnVersionChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
-        {
-            ((VersionEditor)sender).OnVersionChanged(e);
-        }
-
-        private void OnVersionChanged(DependencyPropertyChangedEventArgs e)
-        {
-            this.ViewModel.Version = (Version)e.NewValue;
-        }
-
-        private void OnViewModelPropertyChanged(object sender, PropertyChangedEventArgs e)
-        {
-            if (e.PropertyName == "Version")
-            {
-                this.Version = this.ViewModel.Version;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VersionEditorViewModel.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VersionEditorViewModel.cs
deleted file mode 100644 (file)
index 8b88eb0..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Runtime;
-
-    internal class VersionEditorViewModel : ViewModel
-    {
-        private IVersionEditor editor;
-        private Version version;
-
-        public VersionEditorViewModel(IVersionEditor editor)
-        {
-            Fx.Assert(editor != null, "editor should not be null");
-            this.editor = editor;
-        }
-
-        public string VersionText
-        {
-            get
-            {
-                if (this.version == null)
-                {
-                    return null;
-                }
-
-                return this.version.ToString();
-            }
-
-            set
-            {
-                if (this.VersionText != value)
-                {
-                    if (string.IsNullOrEmpty(value))
-                    {
-                        this.Version = null;
-                        return;
-                    }
-
-                    Exception exception = null;
-
-                    try
-                    {
-                        this.Version = Version.Parse(value);
-                    }
-                    catch (ArgumentOutOfRangeException ex)
-                    {
-                        exception = ex;
-                    }
-                    catch (ArgumentException ex)
-                    {
-                        exception = ex;
-                    }
-                    catch (FormatException ex)
-                    {
-                        exception = ex;
-                    }
-                    catch (OverflowException ex)
-                    {
-                        exception = ex;
-                    }
-
-                    if (exception != null)
-                    {
-                        this.editor.ShowErrorMessage(exception.Message);
-
-                        // update UI to its old value
-                        this.NotifyPropertyChanged("VersionText");
-                    }
-                }
-            }
-        }
-
-        public Version Version
-        {
-            get
-            {
-                return this.version;
-            }
-
-            set
-            {
-                if (this.version != value)
-                {
-                    this.version = value;
-                    this.NotifyPropertyChanged("Version");
-                    this.NotifyPropertyChanged("VersionText");
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ViewCreatedEventArgs.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ViewCreatedEventArgs.cs
deleted file mode 100644 (file)
index bf02db9..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System;
-
-    /// <summary>
-    /// Arguments for view changed event
-    /// </summary>
-    public class ViewCreatedEventArgs : EventArgs
-    {
-        private WorkflowViewElement view;
-
-        /// <summary>
-        /// Contruct a ViewChangedEventArgs object
-        /// </summary>
-        /// <param name="view">the workflow view element that is created</param>
-        public ViewCreatedEventArgs(WorkflowViewElement view)
-        {
-            if (view == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("view");
-            }
-
-            this.view = view;
-        }
-
-        /// <summary>
-        /// Gets the workflow view element that is created
-        /// </summary>
-        public WorkflowViewElement View
-        {
-            get { return this.view; }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ViewStateChangedEventArgs.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ViewStateChangedEventArgs.cs
deleted file mode 100644 (file)
index a7028ff..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Activities.Presentation.Model;
-    using System.Runtime;
-
-    [Fx.Tag.XamlVisible(false)]
-    public class ViewStateChangedEventArgs : EventArgs
-    {
-        ModelItem parentModelItem;
-        string key;
-        object newValue;
-        object oldValue;
-        
-        public ViewStateChangedEventArgs(ModelItem modelItem, string key, object newValue, object oldValue)
-        {
-            this.parentModelItem = modelItem;
-            this.key = key;
-            this.newValue = newValue;
-            this.oldValue = oldValue;
-        }
-
-        public ModelItem ParentModelItem
-        {
-            get
-            {
-                return this.parentModelItem;
-            }
-        }
-        public string Key
-        {
-            get
-            {
-                return this.key;
-            }
-        }
-
-        public object NewValue
-        {
-            get
-            {
-                return this.newValue;
-            }
-        }
-
-        public object OldValue
-        {
-            get
-            {
-                return this.oldValue;
-            }
-        }
-
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ViewStateChangedEventHandler.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ViewStateChangedEventHandler.cs
deleted file mode 100644 (file)
index 6a93927..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.View  
-{
-    public delegate void ViewStateChangedEventHandler(object sender, ViewStateChangedEventArgs e);
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ViewStateService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ViewStateService.cs
deleted file mode 100644 (file)
index de09908..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Activities.Presentation.Model;
-    using System.Collections.Generic;
-
-    public abstract class ViewStateService
-    {
-        public abstract event ViewStateChangedEventHandler ViewStateChanged;
-        public abstract event ViewStateChangedEventHandler UndoableViewStateChanged;
-        public abstract object RetrieveViewState(ModelItem modelItem, string key);
-        public abstract void StoreViewState(ModelItem modelItem, string key, object value);
-        public abstract void StoreViewStateWithUndo(ModelItem modelItem, string key, object value);
-        public abstract Dictionary<string, object> RetrieveAllViewState(ModelItem modelItem);
-        public abstract bool RemoveViewState(ModelItem modelItem, string key);
-    }
-}
\ No newline at end of file
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ViewUtilities.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ViewUtilities.cs
deleted file mode 100644 (file)
index 7903c63..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Services;
-    using System.Collections.Generic;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Media;
-
-    internal static class ViewUtilities
-    {
-        const string ExpandViewStateKey = "IsExpanded";
-        internal static bool DoesParentAlwaysExpandChildren(ModelItem modelItem, EditingContext context)
-        {
-            return IsParentOfType(modelItem, typeof(IExpandChild), context);
-        }
-
-        internal static bool DoesParentAlwaysCollapseChildren(ModelItem modelItem, EditingContext context)
-        {
-            bool parentAlwaysCollapsesChild = false;
-            Type parentDesignerType = GetParentDesignerType(modelItem, context);
-            if (typeof(WorkflowViewElement).IsAssignableFrom(parentDesignerType))
-            {
-                ActivityDesignerOptionsAttribute options = WorkflowViewService.GetAttribute<ActivityDesignerOptionsAttribute>(parentDesignerType);
-                parentAlwaysCollapsesChild = (options != null && options.AlwaysCollapseChildren);
-            }
-            return parentAlwaysCollapsesChild;
-        }
-
-        // Determines whether a particular ModelItem's view will be visible for a given breadcrumb root. 
-        //It depends on whether the intermediate designers are expanded or collapsed.
-        internal static bool IsViewVisible(ModelItem child, ModelItem root, EditingContext context)
-        {
-            if (child == root)
-            {
-                return !IsDefaultDesigner(context, root);
-            }
-
-            if (child.Parent == null)
-            {
-                return false;
-            }
-
-            WorkflowViewService viewService = GetViewService(context);
-            ModelItem parent = ModelUtilities.ReverseFindFirst(child.Parent, (ModelItem current) =>
-            {
-                return object.Equals(current, root) ||
-                    HasView(current, viewService, false) &&
-                    (!IsViewExpanded(current, context) || IsDefaultDesigner(context, current));
-            });
-
-            return object.Equals(parent, root) && !IsDefaultDesigner(context, root);
-        }
-
-        private static bool IsDefaultDesigner(EditingContext context, ModelItem item)
-        {
-            WorkflowViewService viewService = GetViewService(context);
-            Type viewType = viewService.GetDesignerType(item.ItemType);
-            return viewType == typeof(ActivityDesigner);
-        }
-
-        private static bool HasView(ModelItem modelItem, WorkflowViewService viewService, bool allowDrillIn)
-        {
-            ActivityDesignerOptionsAttribute options = WorkflowViewService.GetAttribute<ActivityDesignerOptionsAttribute>(modelItem.ItemType);
-            Type viewType = viewService.GetDesignerType(modelItem.ItemType);
-            return typeof(WorkflowViewElement).IsAssignableFrom(viewType) && (!allowDrillIn || options == null || options.AllowDrillIn);
-        }
-
-        // Get the first parent ModelItem that has a view
-        internal static ModelItem GetParentModelItemWithView(ModelItem modelItem, EditingContext context, bool allowDrillIn)
-        {
-            if (modelItem == null || modelItem.Parent == null)
-            {
-                return null;
-            }
-
-            WorkflowViewService viewService = GetViewService(context);
-
-            return ModelUtilities.ReverseFindFirst(modelItem.Parent, (ModelItem current) =>
-                {
-                    return HasView(current, viewService, allowDrillIn);
-                });
-        }
-
-        // Determine whether the view of a ModelItem is expanded without querying the view itself - the view may have not been constructed.
-        internal static bool IsViewExpanded(ModelItem modelItem, EditingContext context)
-        {
-            if (modelItem == null)
-            {
-                return false;
-            }
-
-            bool isDesignerExpanded = true;
-            bool isDesignerPinned = false;
-            object isExpandedViewState = GetViewStateService(context).RetrieveViewState(modelItem, ExpandViewStateKey);
-            object isPinnedViewState = GetViewStateService(context).RetrieveViewState(modelItem, WorkflowViewElement.PinnedViewStateKey);
-            if (isExpandedViewState != null)
-            {
-                isDesignerExpanded = (bool)isExpandedViewState;
-            }
-            if (isPinnedViewState != null)
-            {
-                isDesignerPinned = (bool)isPinnedViewState;
-            }
-
-            DesignerView designerView = context.Services.GetService<DesignerView>();
-             
-            return ShouldShowExpanded(IsBreadcrumbRoot(modelItem, context), DoesParentAlwaysExpandChildren(modelItem, context),
-                DoesParentAlwaysCollapseChildren(modelItem, context), isDesignerExpanded, designerView.ShouldExpandAll, designerView.ShouldCollapseAll, isDesignerPinned);
-        }
-
-        internal static bool IsBreadcrumbRoot(ModelItem modelItem, EditingContext context)
-        {
-            DesignerView designerView = context.Services.GetService<DesignerView>();
-            return modelItem != null && modelItem.View != null && modelItem.View.Equals(designerView.RootDesigner);
-        }
-
-        internal static bool ShouldShowExpanded(
-            bool isRootDesigner,
-            bool parentAlwaysExpandChildren,
-            bool parentAlwaysCollapseChildren,
-            bool expandState,
-            bool expandAll,
-            bool collapseAll,
-            bool pinState)
-        {
-            //ShowExpanded based on ExpandAll, CollapseAll, PinState, ExpandState
-            bool showExpanded = ShouldShowExpanded(expandState, expandAll, collapseAll, pinState);
-
-            //return value based on the position of the element in the workflow tree.
-            return (isRootDesigner || parentAlwaysExpandChildren || (!parentAlwaysCollapseChildren && showExpanded));
-        }
-
-        internal static bool ShouldShowExpanded(bool isExpanded, bool shouldExpandAll, bool shouldCollapseAll, bool isPinned)
-        {
-            if (isPinned)
-            {
-                return isExpanded;
-            }
-            else
-            {
-                return !shouldCollapseAll && (shouldExpandAll || isExpanded);
-            }
-        }
-
-        static WorkflowViewService GetViewService(EditingContext context)
-        {
-            return context.Services.GetService<ViewService>() as WorkflowViewService;
-        }
-
-        static ViewStateService GetViewStateService(EditingContext context)
-        {
-            return context.Services.GetService<ViewStateService>();
-        }
-
-        //Checks to see if the immediate parent WorkflowViewElement is of type "parentType".
-        static bool IsParentOfType(ModelItem modelItem, Type parentType, EditingContext context)
-        {
-            Type parentDesignerType = GetParentDesignerType(modelItem, context);
-            return parentType.IsAssignableFrom(parentDesignerType);
-        }
-
-        static Type GetParentDesignerType(ModelItem modelItem, EditingContext context)
-        {
-            ModelItem parent = GetParentModelItemWithView(modelItem, context, false);
-            if (parent != null)
-            {
-                return GetViewService(context).GetDesignerType(parent.ItemType);
-            }
-            return null;
-        }
-
-        internal static void MeasureView(WorkflowViewElement view, bool measureAsCollapsed)
-        {
-            bool expandState = view.ExpandState;
-            bool pinState = view.PinState;
-         
-            if (measureAsCollapsed)
-            {
-                view.ForceCollapse();
-            }
-
-            view.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
-            view.UpdateLayout();
-
-            if (view.ExpandState != expandState)
-            {
-                view.ExpandState = expandState;
-            }
-            if (view.PinState != pinState)
-            {
-                view.PinState = pinState;
-            }
-        }
-
-        // the job of this method is to construct a DisplayName for ActivityBuilder
-        // This name will be shown in breadcrumb bar.
-        // if ActivityBuilder.Name = "workflowconsoleApp.Sequence1"
-        // we want DisplayName = "Sequence1"
-        internal static string GetActivityBuilderDisplayName(ModelItem modelItem)
-        {
-            Fx.Assert(modelItem != null, "modelItem != null");
-            ModelItem nameModelItem = modelItem.Properties["Name"].Value;
-            string name = (nameModelItem == null) ? null : (string)nameModelItem.GetCurrentValue();
-
-            if (string.IsNullOrEmpty(name))
-            {
-                return string.Empty;
-            }
-
-            string displayName = string.Empty;
-            int indexOfDot = name.LastIndexOf('.');
-            if (indexOfDot > -1)
-            {
-                // if make sure there at least one character after .
-                if (indexOfDot < name.Length - 1)
-                {
-                    displayName = name.Substring(indexOfDot + 1);
-                }
-            }
-            else
-            {
-                displayName = name;
-            }
-
-            return displayName;
-        }
-
-        internal static GeneralTransform GetTransformToRoot(Visual visual)
-        {
-            Visual rootVisual = GetRootVisual(visual);
-
-            return (rootVisual != null) ? visual.TransformToAncestor(rootVisual) : null;
-        }
-
-        private static Visual GetRootVisual(Visual visual)
-        {
-            Fx.Assert(visual != null, "visual should not be null");
-
-            Visual root = null;
-
-            PresentationSource source = PresentationSource.FromDependencyObject(visual);
-            if (source != null)
-            {
-                root = source.RootVisual;
-            }
-
-            // PresentationSource will be null if the element is not in a window
-            // Window w = new Window();
-            // Button b = new Button();
-            // w.Show();
-            // w.Content = b;
-            // PresentationSource.FromDependencyObject(b) will return an instance
-            // w.Content = null;
-            // PresentationSource.FromDependencyObject(b) will return null
-            // The reason of tree walk is to make some effort to support 
-            // the scenario where user wants to capture a visual that is 
-            // not in a window. 
-            if (root == null)
-            {
-                for (DependencyObject current = visual;
-                    current != null; current = VisualTreeHelper.GetParent(current))
-                {
-                    // Maybe Visual is not enought in some case, but I don't get a sample 
-                    // till now. If it happens, add LogicalTreeHelper.GetParent() to the 
-                    // parent getting chain.
-                    Visual currentVisual = current as Visual;
-                    if (currentVisual != null)
-                    {
-                        root = currentVisual;
-                    }
-                }
-            }
-
-            return root;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VirtualizedContainerService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VirtualizedContainerService.cs
deleted file mode 100644 (file)
index a0ffc03..0000000
+++ /dev/null
@@ -1,520 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Windows;
-
-    using System.Windows.Media;
-    using System.Windows.Media.Effects;
-    using System.Windows.Documents;
-
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Documents;
-    using System.Activities.Presentation.Services;
-    using System.Activities.Presentation.View;
-    using System.Collections.ObjectModel;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Windows.Controls;
-    using System.Windows.Threading;
-    using System.Windows.Shapes;
-    using System.Windows.Input;
-    using System.Runtime;
-    using System.Activities.Presentation.Debug;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Xaml;
-    using System.ComponentModel;
-    using System.Globalization;
-    using System.Linq;
-
-    [Fx.Tag.XamlVisible(false)]
-    public class VirtualizedContainerService
-    {
-        EditingContext context;
-        QuadTree<VirtualizingContainer> tree;
-        bool isWorking = false;
-        DesignerView designerView;
-        ViewStateService viewStateService;
-        ViewService viewService;
-        IDictionary<ModelItem, FrameworkElement> modelItemToContainer;
-
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly AttachableMemberIdentifier HintSizeName = new AttachableMemberIdentifier(typeof(VirtualizedContainerService), "HintSize");
-
-
-        public VirtualizedContainerService(EditingContext context)
-        {
-            this.context = context;
-            this.tree = new QuadTree<VirtualizingContainer>();
-            this.modelItemToContainer = new Dictionary<ModelItem, FrameworkElement>();
-            this.tree.Bounds = new Rect(0, 0, int.MaxValue, int.MaxValue);
-
-            this.context.Services.Subscribe<DesignerView>((designerView) =>
-            {
-                designerView.ScrollViewer.ScrollChanged += (sender, args) =>
-                {
-                    if (!isWorking)
-                    {
-                        isWorking = true;
-                        PopulateItemsInView();
-                        isWorking = false;
-                    }
-                };
-            });
-
-        }
-
-
-        ViewStateService ViewStateService
-        {
-            get
-            {
-                if (this.viewStateService == null)
-                {
-                    this.viewStateService = this.context.Services.GetService<ViewStateService>();
-                }
-                Fx.Assert(this.viewStateService != null, "ViewStateService should not be null");
-                return this.viewStateService;
-            }
-        }
-
-        ViewService ViewService
-        {
-            get
-            {
-                if (this.viewService == null)
-                {
-                    this.viewService = this.context.Services.GetService<ViewService>();
-                }
-                Fx.Assert(this.viewService != null, "ViewService should not be null");
-                return this.viewService;
-            }
-        }
-
-
-        DesignerView DesignerView
-        {
-            get
-            {
-                if (this.designerView == null)
-                {
-                    this.designerView = this.context.Services.GetService<DesignerView>();
-                }
-                Fx.Assert(this.designerView != null, "Designer view should not be null");
-                return this.designerView;
-            }
-        }
-
-        public static object GetHintSize(object instance)
-        {
-            object viewState;
-            AttachablePropertyServices.TryGetProperty(instance, HintSizeName, out viewState);
-            return viewState;
-        }
-
-        public static void SetHintSize(object instance, object value)
-        {
-            AttachablePropertyServices.SetProperty(instance, HintSizeName, value);
-        }
-
-
-        // This method populates all items in the current scroll region.
-        // we first get the virtualizing containers inthe current scroll region
-        // ask them to populate the content, and then wait for a layout pass
-        // so that the first round of population can cause more populations
-        // we do this till all items in the current view are completely populated.
-        private void PopulateItemsInView()
-        {
-            var designers = this.tree.GetNodesInside(GetViewerBounds());
-            bool rePopulationNeeded = false;
-            foreach (VirtualizingContainer container in designers)
-            {
-                if (!container.IsPopulated)
-                {
-                    container.Populate();
-                    rePopulationNeeded = true;
-                }
-            }
-
-            if (rePopulationNeeded)
-            {
-                Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Render, (Action)(() =>
-                {
-                    PopulateItemsInView();
-                }));
-            }
-        }
-
-        // This method populates all items in the entire designer canvas
-        // this uses the same technique Populateitemsinview uses to bring items into view.
-        internal void BeginPopulateAll(Action onAfterPopulateAll)
-        {
-            Cursor oldCursor = Mouse.OverrideCursor;
-            Mouse.OverrideCursor = Cursors.Wait;
-            PopulateAllWithWaitCursor( oldCursor, onAfterPopulateAll);
-        }
-
-        void PopulateAllWithWaitCursor( Cursor oldCursor, Action onAfterPopulateAll)
-        {
-            var designers = this.tree.GetNodesInside(new Rect(0, 0, double.MaxValue, double.MaxValue));
-            bool rePopulationNeeded = false;
-            
-            foreach (VirtualizingContainer container in designers)
-            {
-                if (!container.IsPopulated)
-                {
-                    container.Populate();
-                    rePopulationNeeded = true;
-                }
-            }
-
-            if (rePopulationNeeded)
-            {
-                Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Loaded, (Action)(() =>
-                {
-                    PopulateAllWithWaitCursor(oldCursor, onAfterPopulateAll);
-                }));
-            }
-            else
-            {
-                Mouse.OverrideCursor = oldCursor;
-                if (onAfterPopulateAll != null)
-                {
-                    onAfterPopulateAll();
-                }
-            }
-        }
-
-
-        Rect GetViewerBounds()
-        {
-            ScrollViewer parentView = this.DesignerView.ScrollViewer;
-            Rect viewerBounds = new Rect(parentView.HorizontalOffset, parentView.VerticalOffset, parentView.ViewportWidth, parentView.ViewportHeight);
-            viewerBounds.Scale(1 / this.designerView.ZoomFactor, 1 / this.designerView.ZoomFactor);
-            return viewerBounds;
-        }
-
-        bool IsVirtualiztionEnabled
-        {
-            get
-            {
-                return true;
-            }
-        }
-
-        internal FrameworkElement QueryContainerForItem(ModelItem item)
-        {
-            if (null == item)
-            {
-                throw FxTrace.Exception.ArgumentNull("item");
-            }
-            FrameworkElement element;
-            this.modelItemToContainer.TryGetValue(item, out element);
-            return element;
-        }
-
-        public UIElement GetContainer(ModelItem modelItem, ICompositeView sourceContainer)
-        {
-            FrameworkElement view = null;
-            if (IsVirtualiztionEnabled)
-            {
-                view = new VirtualizingContainer(this, modelItem, sourceContainer);
-                view.Loaded += this.OnViewLoaded;
-                view.Unloaded += this.OnViewUnloaded;
-            }
-            else
-            {
-                view = this.GetViewElement(modelItem, sourceContainer);
-            }
-            return view;
-        }
-
-        void OnViewLoaded(object view, RoutedEventArgs e)
-        {
-            var virtualView = view as VirtualizingContainer;
-            var viewElement = view as WorkflowViewElement;
-
-            if (null != virtualView && !this.modelItemToContainer.ContainsKey(virtualView.ModelItem))
-            {
-                this.modelItemToContainer.Add(virtualView.ModelItem, virtualView);
-            }
-            else if (null != viewElement && !this.modelItemToContainer.ContainsKey(viewElement.ModelItem))
-            {
-                this.modelItemToContainer.Add(viewElement.ModelItem, viewElement);
-            }
-        }
-
-        void OnViewUnloaded(object view, RoutedEventArgs e)
-        {
-            var virtualView = view as VirtualizingContainer;
-            var viewElement = view as WorkflowViewElement;
-
-            if (null != virtualView && this.modelItemToContainer.ContainsKey(virtualView.ModelItem))
-            {
-                this.modelItemToContainer.Remove(virtualView.ModelItem);
-            }
-            else if (null != viewElement && this.modelItemToContainer.ContainsKey(viewElement.ModelItem))
-            {
-                this.modelItemToContainer.Remove(viewElement.ModelItem);
-            }
-        }
-
-
-        public WorkflowViewElement GetViewElement(ModelItem modelItem, ICompositeView sourceContainer)
-        {
-            WorkflowViewElement itemView = (WorkflowViewElement)this.ViewService.GetView(modelItem);
-            if (null != sourceContainer)
-            {
-                DragDropHelper.SetCompositeView(itemView, (UIElement)sourceContainer);
-            }
-            itemView.Loaded += this.OnViewLoaded;
-            itemView.Unloaded += this.OnViewUnloaded;
-
-            return itemView;
-        }
-
-
-
-
-        internal class VirtualizingContainer : Border
-        {
-            VirtualizedContainerService containerService;
-            ModelItem modelItem;
-            ICompositeView sourceContainer;
-            UIElement designerRoot;
-            bool isPopulated = false;
-            Size defaultContainerSize = new Size(20, 20);
-            Rect oldBounds;
-            VirtualizingContainer parentContainer;
-            List<VirtualizingContainer> children;
-
-            public ModelItem ModelItem
-            {
-                get
-                {
-                    return this.modelItem;
-                }
-            }
-
-            public ICompositeView ICompositeView
-            {
-                get
-                {
-                    return this.sourceContainer;
-                }
-            }
-
-            public IEnumerable<VirtualizingContainer> ChildContainers
-            {
-                get { return this.children; }
-            }
-
-            [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
-            public VirtualizingContainer(VirtualizedContainerService containerService, ModelItem modelItem, ICompositeView sourceContainer)
-            {
-                this.containerService = containerService;
-                this.modelItem = modelItem;
-                this.sourceContainer = sourceContainer;
-                this.Focusable = false;
-                this.BorderThickness = new Thickness(1);
-                SetupPlaceHolder();
-                this.children = new List<VirtualizingContainer>();
-                this.Unloaded += (sender, args) =>
-                {
-                    this.containerService.tree.Remove(this);
-                    this.oldBounds = new Rect(0, 0, 0, 0);
-                    UnRegisterFromParentContainer();
-                };
-
-                this.Loaded += (sender, args) =>
-                {
-                    RegisterWithParentContainer();
-                };
-
-            }
-
-            private void SetupPlaceHolder()
-            {
-                string sizeString = (string)(VirtualizedContainerService.GetHintSize(this.modelItem.GetCurrentValue()));
-                Size? size = null;
-                if (!string.IsNullOrEmpty(sizeString))
-                {
-                    size = Size.Parse(sizeString);
-                }
-                if (size == null)
-                {
-                    size = defaultContainerSize;
-                }
-                this.MinWidth = size.Value.Width;
-                this.MinHeight = size.Value.Height;
-            }
-
-            protected override Size ArrangeOverride(Size arrangeBounds)
-            {
-                this.Dispatcher.BeginInvoke(DispatcherPriority.Render, (Action)(() =>
-                {
-                    AddToQuadTree();
-                }));
-                return base.ArrangeOverride(arrangeBounds);
-            }
-
-
-            void RegisterWithParentContainer()
-            {
-                DependencyObject parent = VisualTreeHelper.GetParent(this);
-                while (null != parent && !(parent is VirtualizingContainer))
-                {
-                    parent = VisualTreeHelper.GetParent(parent);
-                }
-                this.parentContainer = parent as VirtualizingContainer;
-                if (parentContainer != null)
-                {
-                    if (!parentContainer.children.Contains(this))
-                    {
-                        parentContainer.children.Add(this);
-                    }
-                }
-            }
-
-            void UnRegisterFromParentContainer()
-            {
-                if (parentContainer != null)
-                {
-                    parentContainer.children.Remove(this);
-                    this.parentContainer = null;
-                }
-            }
-
-            private void AddToQuadTree()
-            {
-                try
-                {
-                    Point currentPoint = GetPosition();
-                    if (this.ActualHeight > 0 && this.ActualWidth > 0)
-                    {
-                        Rect bounds = new Rect(currentPoint, new Size(this.ActualWidth, this.ActualHeight));
-                        Rect viewerBounds = this.containerService.GetViewerBounds();
-                        bool isInView = viewerBounds.IntersectsWith(bounds) || viewerBounds.Contains(bounds) || bounds.Contains(viewerBounds);
-                        if (isInView)
-                        {
-                            this.Populate();
-                            currentPoint = GetPosition();
-                            bounds = new Rect(currentPoint, new Size(this.ActualWidth, this.ActualHeight));
-                        }
-                        else
-                        {
-                            // a previous Arrange could have led to adding this to the quadtree already.
-                            // so remove previos instances from quadtree.
-                            if (!this.isPopulated)
-                            {
-                                if (this.BorderBrush != SystemColors.GrayTextBrush)
-                                {
-                                    this.BorderBrush = SystemColors.GrayTextBrush;
-                                }
-                            }
-                         
-
-
-                        }
-
-                        if (this.oldBounds != bounds)
-                        {
-
-                            this.containerService.tree.Remove(this);
-                            this.containerService.tree.Insert(this, bounds);
-                            if (this.oldBounds != Rect.Empty)
-                            {
-                                this.Dispatcher.BeginInvoke(DispatcherPriority.Render, (Action)(() =>
-                                {
-                                    foreach (VirtualizingContainer childContainer in this.children)
-                                    {
-                                        // if there were designers registered under the old bounds let them re-register
-                                        childContainer.AddToQuadTree();
-                                    }
-                                }));
-                            }
-
-                            this.oldBounds = bounds;
-                        }
-                        
-
-                        if (this.IsPopulated)
-                        {
-                            VirtualizedContainerService.SetHintSize(this.modelItem.GetCurrentValue(), bounds.Size.ToString(CultureInfo.InvariantCulture));
-                        }
-                    }
-                }
-                catch (InvalidOperationException)
-                {
-                    // This can happen if an arrange happened within the child of the container, when not in the visual tree
-                    // for the current breadcrumb root. The GetTransform will throw invalidoperation in this case.
-                    this.containerService.tree.Remove(this);
-                }
-            }
-
-            UIElement DesignerRoot
-            {
-                get
-                {
-                    if (this.designerRoot == null)
-                    {
-                        this.designerRoot = this.containerService.DesignerView.scrollableContent;
-                    }
-                    Fx.Assert(this.designerRoot != null, "Designer's scrollable content should not be null now ");
-                    return this.designerRoot;
-                }
-            }
-
-            private Point GetPosition()
-            {
-                GeneralTransform generalTransform1 = this.TransformToAncestor((Visual)this.DesignerRoot);
-                // Get current position by transforming origin using the current transform.
-                Point currentPoint = generalTransform1.Transform(new Point(0, 0));
-                return currentPoint;
-            }
-
-
-
-            public bool IsPopulated
-            {
-                get
-                {
-                    return this.isPopulated;
-                }
-            }
-
-            internal void Populate()
-            {
-                if (!IsPopulated)
-                {
-                    this.BorderBrush = Brushes.Transparent;
-                    this.BorderThickness = new Thickness(0);
-                    this.Child = this.containerService.GetViewElement(this.ModelItem, this.ICompositeView);
-                    this.MinHeight = defaultContainerSize.Height;
-                    this.MinWidth = defaultContainerSize.Width;
-                    isPopulated = true;
-                }
-            }
-
-        }
-
-        internal static UIElement TryGetVirtualizedElement(UIElement element)
-        {
-            if (element is VirtualizedContainerService.VirtualizingContainer)
-            {
-                if (((VirtualizedContainerService.VirtualizingContainer)element).IsPopulated)
-                {
-                    return ((VirtualizedContainerService.VirtualizingContainer)element).Child;
-                }
-            }
-            return element;
-        }
-    }
-}
-
-
-
-
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VisualBasicEditor.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VisualBasicEditor.xaml.cs
deleted file mode 100644 (file)
index 9dca9ca..0000000
+++ /dev/null
@@ -1,2167 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Activities.ExpressionParser;
-    using System.Activities.Expressions;
-    using System.Activities.Presentation.Expressions;
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Services;
-    using System.Activities.Presentation.Validation;
-    using System.Activities.Presentation.Xaml;
-    using System.Activities.XamlIntegration;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Linq;
-    using System.Runtime;
-    using System.Runtime.Versioning;
-    using System.Threading;
-    using System.Windows;
-    using System.Windows.Automation;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using System.Windows.Threading;
-    using Microsoft.VisualBasic.Activities;
-    using Microsoft.Activities.Presentation;
-
-    //This control is used for expression editing in activity designers.
-    //It uses the Activity<T> TypeConverter to convert between a Activity<T> and its string representation.
-    //It defines 3 dependency properties - OwnerActivity, ExpressionModelItem and ExpressionType.
-    //ActivityModelItem is used to create the parser context required by the TypeConverter.
-    //ExpressionType is the type of the expression associated with this text box. This is required by the TypeConverter.
-
-    internal sealed partial class VisualBasicEditor : TextualExpressionEditor
-    {
-        private static readonly Type VariableValueType = typeof(VariableValue<>);
-        private static readonly Type VariableReferenceType = typeof(VariableReference<>);
-        private static readonly Type LiteralType = typeof(Literal<>);
-        private static readonly Type VisualBasicValueType = typeof(VisualBasicValue<>);
-        private static readonly Type VisualBasicReferenceType = typeof(VisualBasicReference<>);
-
-        internal static string ExpressionLanguageName = (new VisualBasicValue<string>() as ITextExpression).Language;
-
-        internal static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string), typeof(VisualBasicEditor),
-                new FrameworkPropertyMetadata(null, new PropertyChangedCallback(OnTextChanged), new CoerceValueCallback(OnTextCoerceValue)));
-
-        internal static readonly DependencyProperty ValidationStateProperty = DependencyProperty.Register("ValidationState", typeof(ValidationState), typeof(VisualBasicEditor),
-                new FrameworkPropertyMetadata(ValidationState.Valid));
-
-        internal static readonly DependencyProperty EditingStateProperty = DependencyProperty.Register("EditingState", typeof(EditingState), typeof(VisualBasicEditor),
-                new PropertyMetadata(EditingState.Idle));
-
-        internal static readonly DependencyProperty HasValidationErrorProperty = DependencyProperty.Register("HasValidationError", typeof(bool), typeof(VisualBasicEditor),
-                new PropertyMetadata(false));
-
-        internal static readonly DependencyProperty ValidationErrorMessageProperty = DependencyProperty.Register("ValidationErrorMessage", typeof(string), typeof(VisualBasicEditor),
-                new PropertyMetadata(null));
-
-        internal static readonly DependencyProperty ExpressionTextProperty = DependencyProperty.Register("ExpressionText", typeof(string), typeof(VisualBasicEditor),
-                new PropertyMetadata(null));
-
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand CompleteWordCommand = new RoutedCommand("CompleteWordCommand", typeof(VisualBasicEditor));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand GlobalIntellisenseCommand = new RoutedCommand("GlobalIntellisenseCommand", typeof(VisualBasicEditor));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand ParameterInfoCommand = new RoutedCommand("ParameterInfoCommand", typeof(VisualBasicEditor));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand QuickInfoCommand = new RoutedCommand("QuickInfoCommand", typeof(VisualBasicEditor));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand IncreaseFilterLevelCommand = new RoutedCommand("IncreaseFilterLevelCommand", typeof(VisualBasicEditor));
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly ICommand DecreaseFilterLevelCommand = new RoutedCommand("DecreaseFilterLevelCommand", typeof(VisualBasicEditor));
-
-        bool internalModelItemChange = false;
-        string previousText = null;
-        ModelProperty expressionModelProperty;
-        TypeConverter expressionConverter;
-        bool initialized = false;
-        bool isEditorLoaded = false;
-
-        IExpressionEditorService expressionEditorService;
-        IExpressionEditorInstance expressionEditorInstance;
-        TextBox editingTextBox;
-
-        Control hostControl;
-        string editorName;
-        double blockHeight = double.NaN;
-        double blockWidth = double.NaN;
-        bool isExpressionLoaded = false;
-        bool isBeginEditPending = false;
-
-        DesignerPerfEventProvider perfProvider;
-        ModelItem boundedExpression = null;
-        BackgroundWorker validator = null;
-        const int ValidationWaitTime = 800;
-
-        PropertyChangedEventHandler onExpressionModelItemChangedHandler;
-
-        [SuppressMessage(FxCop.Category.Performance, FxCop.Rule.InitializeReferenceTypeStaticFieldsInline,
-            Justification = "This is recommended way by WPF to override metadata of DependencyProperty in derived class")]
-        static VisualBasicEditor()
-        {
-            ExpressionActivityEditor.HintTextProperty.OverrideMetadata(typeof(VisualBasicEditor), new FrameworkPropertyMetadata(SR.ExpressionDefaultText));
-        }
-
-        public VisualBasicEditor()
-        {
-            InitializeComponent();
-
-            this.MinHeight = this.FontSize + 4; /* 4 pixels for border*/
-
-            this.editorName = null;
-
-            this.ContentTemplate = (DataTemplate)FindResource("textblock");
-            this.Loaded += this.OnExpressionTextBoxLoaded;
-            this.Unloaded += this.OnExpressionTextBoxUnloaded;
-        }
-
-        PropertyChangedEventHandler OnExpressionModelItemChanged
-        {
-            get
-            {
-                if (this.onExpressionModelItemChangedHandler == null)
-                {
-                    this.onExpressionModelItemChangedHandler = new PropertyChangedEventHandler(this.expressionModelItem_PropertyChanged);
-                }
-
-                return this.onExpressionModelItemChangedHandler;
-            }
-        }
-
-        protected override void OnContextMenuOpening(ContextMenuEventArgs e)
-        {
-            e.Handled = true;
-        }
-
-        protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
-        {
-            switch (e.Property.Name)
-            {
-                case "HintText":
-                    this.OnHintTextChanged(e);
-                    break;
-                case "Expression":
-                    this.OnExpressionChanged(e);
-                    break;
-                case "ExpressionType":
-                    this.OnExpressionTypeChanged(e);
-                    break;
-                case "OwnerActivity":
-                    this.OnOwnerModelItemChanged(e);
-                    break;
-                case "UseLocationExpression":
-                    this.OnUseLocationExpressionChanged(e);
-                    break;
-                case "PathToArgument":
-                    this.OnPathToArgumentChanged(e);
-                    break;
-                case "MaxLines":
-                case "MinLines":
-                    this.OnLinesChanged(e);
-                    break;
-                case "AcceptsReturn":
-                    this.OnAcceptsReturnChanged(e);
-                    break;
-                case "AcceptsTab":
-                    this.OnAcceptsTabChanged(e);
-                    break;
-                case "IsIndependentExpressionProperty":
-                    this.OnIsIndependentExpressionChanged();
-                    break;
-            }
-            base.OnPropertyChanged(e);
-        }
-
-        protected override void OnPreviewMouseRightButtonDown(MouseButtonEventArgs e)
-        {
-            base.OnPreviewMouseRightButtonDown(e);
-            e.Handled = true;
-        }
-
-        static object OnTextCoerceValue(DependencyObject dp, object value)
-        {
-            string tempText = value as string;
-            VisualBasicEditor etb = dp as VisualBasicEditor;
-            if (etb != null)
-            {
-                if (tempText != null)
-                {
-                    tempText = tempText.Trim();
-                }
-            }
-            return tempText;
-        }
-
-        protected override AutomationPeer OnCreateAutomationPeer()
-        {
-            return new VisualBasicEditorAutomationPeer(this);
-        }
-
-        protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e)
-        {
-            base.OnLostKeyboardFocus(e);
-
-            if (this.expressionEditorInstance != null &&
-            (this.expressionEditorInstance.HasAggregateFocus ||
-             (this.hostControl != null && this.hostControl.IsFocused)))
-            {
-                return;
-            }
-
-            DoLostFocus();
-        }
-
-        private void DoLostFocus()
-        {
-            KillValidator();
-
-            ValidateExpression(this);
-
-            if (this.Context != null)
-            {   // Unselect if this is the currently selected one.
-                ExpressionSelection current = this.Context.Items.GetValue<ExpressionSelection>();
-                if (current != null && current.ModelItem == this.Expression)
-                {
-                    ExpressionSelection emptySelection = new ExpressionSelection(null);
-                    this.Context.Items.SetValue(emptySelection);
-                }
-            }
-
-            // Generate and validate the expression.
-            // Get the text from the snapshot and set it to the Text property
-            if (this.expressionEditorInstance != null)
-            {
-                this.expressionEditorInstance.ClearSelection();
-            }
-
-            bool committed = false;
-            if (!this.ExplicitCommit)
-            {
-                //commit change and let the commit change code do the revert
-                committed = Commit(false);
-
-                //reset the error icon if we didn't get to set it in the commit
-                if (!committed || this.IsIndependentExpression)
-                {
-                    this.EditingState = EditingState.Idle;
-                    // Switch the control back to a textbox -
-                    // but give it the text from the editor (textbox should be bound to the Text property, so should
-                    // automatically be filled with the correct text, from when we set the Text property earlier)
-                    if (!this.ContentTemplate.Equals((DataTemplate)FindResource("textblock")))
-                    {
-                        this.ContentTemplate = (DataTemplate)FindResource("textblock");
-                    }
-                }
-            }
-
-            //raise EditorLostLogical focus - in case when some clients need to do explicit commit
-            this.RaiseEvent(new RoutedEventArgs(ExpressionTextBox.EditorLostLogicalFocusEvent, this));
-        }
-
-        private void KillValidator()
-        {
-            if (validator != null)
-            {
-                this.validator.CancelAsync();
-                this.validator.Dispose();
-                this.validator = null;
-            }
-        }
-
-        internal static bool ShouldGenerateExpression(string oldText, string newText)
-        {
-            return newText != null && !string.Equals(newText, oldText) && !(oldText == null && newText.Equals(string.Empty));
-        }
-
-        public override bool Commit(bool isExplicitCommit)
-        {
-            bool committed = false;
-            //only generate and validate the expression when when we don't require explicit commit change
-            //or when the commit is explicit
-            if (!this.ExplicitCommit || isExplicitCommit)
-            {
-                // Generate and validate the expression.
-                // Get the text from the snapshot and set it to the Text property
-                this.previousText = null;
-                // In VS
-                if (this.expressionEditorInstance != null)
-                {
-                    this.previousText = this.Text;
-                    this.Text = this.expressionEditorInstance.GetCommittedText();
-                }
-                // In rehost
-                else
-                {
-                    if (this.Expression != null)
-                    {
-                        Activity expression = this.Expression.GetCurrentValue() as Activity;
-                        // if expression is null, GetExpressionString will return null                           
-                        this.previousText = ExpressionHelper.GetExpressionString(expression, this.OwnerActivity);
-                    }
-                    else
-                    {
-                        this.previousText = null;
-                    }
-
-                    if (this.editingTextBox != null)
-                    {
-                        this.editingTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
-                    }
-                }
-
-                // If the Text is null, or equal to the previous value, or changed from null to empty, don't bother generating the expression
-                // We still need to generate the expression when it is changed from other value to EMPTY however - otherwise
-                // the case where you had an expression (valid or invalid), then deleted the whole thing will not be evaluated.
-                if (ShouldGenerateExpression(this.previousText, this.Text))
-                {
-                    GenerateExpression();
-                    committed = true;
-                }
-            }
-            if (!this.ContentTemplate.Equals((DataTemplate)FindResource("textblock")))
-            {
-                this.ContentTemplate = (DataTemplate)FindResource("textblock");
-            }
-            return committed;
-        }
-
-        protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
-        {
-            base.OnPreviewMouseLeftButtonDown(e);
-
-            if (this.Context != null)
-            {
-                ExpressionSelection expressionSelection = new ExpressionSelection(this.Expression);
-                this.Context.Items.SetValue(expressionSelection);
-            }
-        }
-
-        public override void BeginEdit()
-        {
-            //am i loaded? is current template a textblock?
-            if (this.isExpressionLoaded || null == this.Expression)
-            {
-                this.isBeginEditPending = false;
-                this.IsReadOnly = false;
-                if (this.IsLoaded && this.ContentTemplate.Equals(this.FindResource("textblock")))
-                {
-                    //get control's content presenter
-                    ContentPresenter presenter = VisualTreeUtils.GetTemplateChild<ContentPresenter>(this);
-                    if (null != presenter)
-                    {
-                        //and look for the loaded textblock
-                        TextBlock tb = (TextBlock)this.ContentTemplate.FindName("expresionTextBlock", presenter);
-                        if (null != tb)
-                        {
-                            //now - give focus to the textblock - it will trigger OnGotTextBlockFocus event, which eventually
-                            //swithc ETB into expression editing mode.
-                            tb.Focus();
-                        }
-                    }
-                }
-            }
-            else
-            {
-                this.isBeginEditPending = true;
-            }
-        }
-
-        internal bool HasAggregateFocus()
-        {
-            bool result = false;
-
-            if (this.IsLoaded)
-            {
-                if (this.expressionEditorInstance != null)
-                {
-                    result = (this.hostControl != null && this.hostControl.IsFocused) || this.expressionEditorInstance.HasAggregateFocus;
-                }
-                else
-                {
-                    result = !this.IsKeyboardFocused && this.IsKeyboardFocusWithin;
-                }
-            }
-
-            return result;
-        }
-
-        void OnTextBlockMouseLeftButtonDown(object sender, RoutedEventArgs e)
-        {
-            if (!this.IsReadOnly)
-            {
-                TextBlock textBlock = sender as TextBlock;
-                if (textBlock != null)
-                {
-                    Keyboard.Focus(textBlock);
-                    e.Handled = true;
-                }
-            }
-        }
-
-        void OnGotTextBlockFocus(object sender, RoutedEventArgs e)
-        {
-            if (this.Context == null)
-            {
-                return;
-            }
-
-            DesignerView designerView = this.Context.Services.GetService<DesignerView>();
-
-            if (!designerView.IsMultipleSelectionMode)
-            {
-                TextBlock textBlock = sender as TextBlock;
-                bool isInReadOnlyMode = this.IsReadOnly;
-                if (this.Context != null)
-                {
-                    ReadOnlyState readOnlyState = this.Context.Items.GetValue<ReadOnlyState>();
-                    isInReadOnlyMode |= readOnlyState.IsReadOnly;
-                }
-                if (null != textBlock)
-                {
-                    this.blockHeight = textBlock.ActualHeight;
-                    this.blockHeight = Math.Max(this.blockHeight, textBlock.MinHeight);
-                    this.blockHeight = Math.Min(this.blockHeight, textBlock.MaxHeight);
-                    this.blockWidth = textBlock.ActualWidth;
-                    this.blockWidth = Math.Max(this.blockWidth, textBlock.MinWidth);
-                    this.blockWidth = Math.Min(this.blockWidth, textBlock.MaxWidth);
-
-                    // If it's already an editor, don't need to switch it/reload it (don't create another editor/grid if we don't need to)
-                    // Also don't create editor when we are in read only mode
-                    if (this.ContentTemplate.Equals((DataTemplate)FindResource("textblock")) && !isInReadOnlyMode)
-                    {
-                        if (this.Context != null)
-                        {
-                            // Get the ExpressionEditorService
-                            this.expressionEditorService = this.Context.Services.GetService<IExpressionEditorService>();
-                        }
-
-                        // If the service exists, use the editor template - else switch to the textbox template
-                        if (this.expressionEditorService != null)
-                        {
-                            this.PerfProvider.WorkflowDesignerExpressionEditorLoadStart();
-                            this.ContentTemplate = (DataTemplate)FindResource("editor");
-                        }
-                        else
-                        {
-                            this.ContentTemplate = (DataTemplate)FindResource("textbox");
-                        }
-                    }
-                }
-
-                if (!isInReadOnlyMode)
-                {
-                    //disable the error icon
-                    this.StartValidator();
-                    this.EditingState = EditingState.Editing;
-                    e.Handled = true;
-                }
-            }
-        }
-
-        void OnGotEditingFocus(object sender, RoutedEventArgs e)
-        {
-            //disable the error icon
-            this.EditingState = EditingState.Editing;
-            this.StartValidator();
-        }
-
-        // This method is called when the editor data template is loaded - when the editor data template
-        // is loaded, create the editor session and the expression editor
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
-            Justification = "CreateExpressionEditor is part of a public API. Propagating exceptions might lead to VS crash.")]
-        [SuppressMessage("Reliability", "Reliability108:IsFatalRule",
-            Justification = "CreateExpressionEditor is part of a public API. Propagating exceptions might lead to VS crash.")]
-        void OnEditorLoaded(object sender, RoutedEventArgs e)
-        {
-            if (!this.isEditorLoaded)
-            {
-                // If the service exists, create an expression editor and add it to the grid - else switch to the textbox data template
-                if (this.expressionEditorService != null)
-                {
-                    Border border = (Border)sender;
-                    // Get the references and variables in scope
-                    AssemblyContextControlItem assemblies = (AssemblyContextControlItem)this.Context.Items.GetValue(typeof(AssemblyContextControlItem));
-                    List<ModelItem> declaredVariables = VisualBasicEditor.GetVariablesInScope(this.OwnerActivity);
-
-                    ImportedNamespaceContextItem importedNamespaces = this.Context.Items.GetValue<ImportedNamespaceContextItem>();
-                    importedNamespaces.EnsureInitialized(this.Context);
-                    //if the expression text is empty and the expression type is set, then we initialize the text to prompt text
-                    if (String.Equals(this.ExpressionText, string.Empty, StringComparison.OrdinalIgnoreCase) && this.ExpressionType != null)
-                    {
-                        this.Text = TypeToPromptTextConverter.GetPromptText(this.ExpressionType);
-                    }
-
-                    //this is a hack
-                    this.blockWidth = Math.Max(this.ActualWidth - 8, 0);  //8 is the margin
-                    if (this.HasErrors)
-                    {
-                        this.blockWidth = Math.Max(this.blockWidth - 16, 0); //give 16 for error icon
-                    }
-                    try
-                    {
-                        if (this.ExpressionType != null)
-                        {
-                            this.expressionEditorInstance = this.expressionEditorService.CreateExpressionEditor(assemblies, importedNamespaces, declaredVariables, this.Text, this.ExpressionType, new Size(this.blockWidth, this.blockHeight));
-                        }
-                        else
-                        {
-                            this.expressionEditorInstance = this.expressionEditorService.CreateExpressionEditor(assemblies, importedNamespaces, declaredVariables, this.Text, new Size(this.blockWidth, this.blockHeight));
-                        }
-                    }
-                    catch (Exception ex)
-                    {
-                        Trace.WriteLine(ex.Message);
-                    }
-
-                    if (this.expressionEditorInstance != null)
-                    {
-                        try
-                        {
-                            this.expressionEditorInstance.VerticalScrollBarVisibility = this.VerticalScrollBarVisibility;
-                            this.expressionEditorInstance.HorizontalScrollBarVisibility = this.HorizontalScrollBarVisibility;
-
-                            this.expressionEditorInstance.AcceptsReturn = this.AcceptsReturn;
-                            this.expressionEditorInstance.AcceptsTab = this.AcceptsTab;
-
-                            // Add the expression editor to the text panel, at column 1
-                            this.hostControl = this.expressionEditorInstance.HostControl;
-
-                            // Subscribe to this event to change scrollbar visibility on the fly for auto, and to resize the hostable editor
-                            // as necessary
-                            this.expressionEditorInstance.LostAggregateFocus += new EventHandler(OnEditorLostAggregateFocus);
-                            this.expressionEditorInstance.Closing += new EventHandler(OnEditorClosing);
-
-                            // Set up Hostable Editor properties
-                            this.expressionEditorInstance.MinLines = this.MinLines;
-                            this.expressionEditorInstance.MaxLines = this.MaxLines;
-
-                            this.expressionEditorInstance.HostControl.Style = (Style)FindResource("editorStyle");
-
-                            border.Child = this.hostControl;
-                            this.expressionEditorInstance.Focus();
-                        }
-                        catch (KeyNotFoundException ex)
-                        {
-                            Debug.Fail("Unable to find editor with the following editor name: " + this.editorName, ex.Message);
-                        }
-                    }
-                }
-
-                if (this.expressionEditorInstance == null)
-                {
-                    this.ContentTemplate = (DataTemplate)FindResource("textbox");
-                }
-                this.PerfProvider.WorkflowDesignerExpressionEditorLoaded();
-
-                this.isEditorLoaded = true;
-            }
-        }
-
-        void OnEditorClosing(object sender, EventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                //these events are expected to be unregistered during lost focus event, but
-                //we are unregistering them during unload just in case.  Ideally we want to
-                //do this in the CloseExpressionEditor method
-                this.expressionEditorInstance.LostAggregateFocus -= new EventHandler(OnEditorLostAggregateFocus);
-
-                this.expressionEditorInstance.Closing -= new EventHandler(OnEditorClosing);
-                this.expressionEditorInstance = null;
-            }
-            Border boarder = this.hostControl.Parent as Border;
-            if (boarder != null)
-            {
-                boarder.Child = null;
-            }
-            this.hostControl = null;
-            this.editorName = null;
-
-        }
-
-        void OnEditorLostAggregateFocus(object sender, EventArgs e)
-        {
-            this.DoLostFocus();
-        }
-
-        //void BindEditorProperties()
-        //{
-        //    this.hostControl.SetBinding(Control.ContextMenuProperty, "ContextMenu");
-        //    this.hostControl.SetBinding(Control.FlowDirectionProperty, "FlowDirection");
-        //    this.hostControl.SetBinding(Control.FontFamilyProperty, "FontFamily");
-        //    this.hostControl.SetBinding(Control.FontSizeProperty, "FontSize");
-        //    this.hostControl.SetBinding(Control.FontStretchProperty, "FontStretch");
-        //    this.hostControl.SetBinding(Control.FontStyleProperty, "FontStyle");
-        //    this.hostControl.SetBinding(Control.FontWeightProperty, "FontWeight");
-        //    this.hostControl.SetBinding(Control.HeightProperty, "Height");
-        //    this.hostControl.SetBinding(Control.LanguageProperty, "Language");
-        //    this.hostControl.SetBinding(Control.SnapsToDevicePixelsProperty, "SnapsToDevicePixels");
-        //}
-
-        // This method is called when the editor data template is unloaded - when the editor data template
-        // is unloaded, close the editor session and set the expression editor and editor session to null
-        void OnEditorUnloaded(object sender, RoutedEventArgs e)
-        {
-            // Blank the editorSession and the expressionEditor so as not to use up memory
-            // Destroy both as you can only ever spawn one editor per session
-            if (this.expressionEditorInstance != null)
-            {
-                //if we are unloaded during editing, this means we got here by someone clicking breadcrumb, we should try to commit
-                if (this.EditingState == EditingState.Editing)
-                {
-                    this.Commit(false);
-                }
-                this.expressionEditorInstance.Close();
-            }
-            else
-            {
-                this.editingTextBox = null;
-            }
-
-            this.isEditorLoaded = false;
-        }
-
-        // This method is to give focus and set the caret position when the TextBox DataTemplate is loaded
-        void OnTextBoxLoaded(object sender, RoutedEventArgs e)
-        {
-            TextBox textbox = (TextBox)sender;
-            this.editingTextBox = textbox;
-            textbox.ContextMenu = null;
-
-            //to workaround a but in the TextBox layout code
-            Binding binding = new Binding();
-            binding.Source = this;
-            binding.Path = new PropertyPath(VisualBasicEditor.TextProperty);
-            binding.Mode = BindingMode.TwoWay;
-            binding.UpdateSourceTrigger = UpdateSourceTrigger.Explicit;
-
-            textbox.SetBinding(TextBox.TextProperty, binding);
-
-            // Set the cursor to correct text position
-            int index = GetCharacterIndexFromPoint(textbox);
-
-            textbox.SelectionStart = index;
-            textbox.SelectionLength = 0;
-
-            textbox.Focus();
-        }
-
-        // This method is to workaround the fact that textbox.GetCharacterIndexFromPoint returns the caret
-        // to the left of the character... Thus you can never get the caret after the last character in the
-        // expression string.
-        int GetCharacterIndexFromPoint(TextBox textbox)
-        {
-            Point position = Mouse.GetPosition(textbox);
-            int index = textbox.GetCharacterIndexFromPoint(position, false);
-
-            if (index < 0)
-            {
-                // May have clicked outside the text area, get the index of nearest char
-                index = textbox.GetCharacterIndexFromPoint(position, true);
-                if (index < 0)
-                {
-                    index = 0;
-                }
-
-                // Adjust the cursor position if we clicked to the right of returned character
-                Rect charRect = textbox.GetRectFromCharacterIndex(index, true);
-                if (position.X > charRect.Left + charRect.Width / 2)
-                {
-                    index++;
-                }
-            }
-
-            return index;
-        }
-
-        static void ValidateExpression(VisualBasicEditor etb)
-        {
-            string errorMessage;
-            if (etb.DoValidation(new ExpressionValidationContext(etb), out errorMessage))
-            {
-                etb.UpdateValidationError(errorMessage);
-            }
-        }
-
-        [SuppressMessage(FxCop.Category.Usage, FxCop.Rule.ReviewUnusedParameters, Justification = "Existing code")]
-        void OnLinesChanged(DependencyPropertyChangedEventArgs e)
-        {
-            if (this.MinLines > this.MaxLines)
-            {
-                this.MaxLines = this.MinLines;
-            }
-        }
-
-        static void OnTextChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
-        {
-            VisualBasicEditor textBox = (VisualBasicEditor)dependencyObject;
-
-            if (textBox.ExpressionEditorService != null && textBox.expressionEditorInstance != null)
-            {
-                textBox.expressionEditorInstance.Text = textBox.Text;
-            }
-
-        }
-
-        void OnOwnerModelItemChanged(DependencyPropertyChangedEventArgs e)
-        {
-            this.InitializeContext(e);
-            this.OnPathToArgumentChanged(this.PathToArgument);
-        }
-
-        public override IExpressionEditorService ExpressionEditorService
-        {
-            get { return this.expressionEditorService; }
-        }
-
-        internal string Text
-        {
-            get { return (string)GetValue(TextProperty); }
-            set { SetValue(TextProperty, value); }
-        }
-
-        internal string ExpressionText
-        {
-            get { return (string)GetValue(ExpressionTextProperty); }
-            set { SetValue(ExpressionTextProperty, value); }
-        }
-
-        internal ValidationState ValidationState
-        {
-            get { return (ValidationState)GetValue(VisualBasicEditor.ValidationStateProperty); }
-            set { SetValue(VisualBasicEditor.ValidationStateProperty, value); }
-        }
-
-        internal bool HasErrors
-        {
-            get
-            {
-                bool hasErrors = false;
-                if (this.EditingState == EditingState.Idle
-                    && !this.IsIndependentExpression)
-                {
-                    if (this.Expression != null && this.ValidationService != null && this.ValidationService.ValidationStateProperty != null)
-                    {
-                        ValidationState state = this.ValidationService.ValidationStateProperty.Getter(this.Expression);
-                        hasErrors = state == ValidationState.Error;
-                    }
-                }
-                else
-                {
-                    hasErrors = this.HasValidationError;
-                }
-                return hasErrors;
-            }
-        }
-
-        internal string ErrorMessage
-        {
-            get
-            {
-                string errorMessage = string.Empty;
-
-                if (this.EditingState == EditingState.Idle && !this.IsIndependentExpression)
-                {
-                    if (this.Expression != null && this.ValidationService != null && this.ValidationService.ValidationStateProperty != null)
-                    {
-                        errorMessage = this.ValidationService.ValidationMessageProperty.Getter(this.Expression);
-                    }
-                }
-                else
-                {
-                    errorMessage = this.ValidationErrorMessage;
-                }
-                return errorMessage;
-            }
-        }
-
-        internal EditingState EditingState
-        {
-            get { return (EditingState)GetValue(EditingStateProperty); }
-            set { SetValue(EditingStateProperty, value); }
-        }
-
-        internal bool HasValidationError
-        {
-            get { return (bool)GetValue(HasValidationErrorProperty); }
-            set { SetValue(HasValidationErrorProperty, value); }
-        }
-
-        internal string ValidationErrorMessage
-        {
-            get { return (string)GetValue(ValidationErrorMessageProperty); }
-            set { SetValue(ValidationErrorMessageProperty, value); }
-        }
-
-        DesignerPerfEventProvider PerfProvider
-        {
-            get
-            {
-                if (this.perfProvider == null && this.Context != null)
-                {
-                    perfProvider = this.Context.Services.GetService<DesignerPerfEventProvider>();
-                }
-                return this.perfProvider;
-            }
-        }
-
-        ValidationService ValidationService
-        {
-            get
-            {
-                if (this.Context != null)
-                {
-                    return this.Context.Services.GetService<ValidationService>();
-                }
-                else
-                {
-                    return null;
-                }
-            }
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
-            Justification = "The conversion to an expression might fail due to invalid user input. Propagating exceptions might lead to VS crash.")]
-        [SuppressMessage("Reliability", "Reliability108:IsFatalRule",
-            Justification = "The conversion to an expression might fail due to invalid user input. Propagating exceptions might lead to VS crash.")]
-        internal void GenerateExpression()
-        {
-            Activity valueExpression = null;
-
-            // If the text is null we don't need to bother generating the expression (this would be the case the
-            // first time you enter an ETB. We still need to generate the expression when it is EMPTY however - otherwise
-            // the case where you had an expression (valid or invalid), then deleted the whole thing will not be evaluated.
-            if (this.Text != null)
-            {
-                using (ModelEditingScope scope = this.OwnerActivity.BeginEdit(SR.PropertyChangeEditingScopeDescription))
-                {
-                    this.EditingState = EditingState.Validating;
-                    // we set the expression to null
-                    // a) when the expressionText is empty AND it's a reference expression or
-                    // b) when the expressionText is empty AND the DefaultValue property is null
-                    if (this.Text.Length == 0 &&
-                        (this.UseLocationExpression || (this.DefaultValue == null)))
-                    {
-                        valueExpression = null;
-                    }
-                    else
-                    {
-                        if (this.Text.Length == 0)
-                        {
-                            this.Text = this.DefaultValue;
-                        }
-                        valueExpression = CreateVBExpression();
-                    }
-                    CreateExpressionModelItem(valueExpression);
-                    scope.Complete();
-                }
-            }
-        }
-
-        void OnValidationCompleted(object sender, EventArgs e)
-        {
-            if (this.EditingState != EditingState.Editing)
-            {
-                if (this.Expression != null && this.ValidationService != null && this.ValidationService.ValidationStateProperty != null)
-                {
-                    this.ValidationState = this.ValidationService.ValidationStateProperty.Getter(this.Expression);
-                }
-
-                this.EditingState = EditingState.Idle;
-            }
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
-            Justification = "The conversion to an expression might fail due to invalid user input. Propagating exceptions might lead to VS crash.")]
-        [SuppressMessage("Reliability", "Reliability108:IsFatalRule",
-            Justification = "The conversion to an expression might fail due to invalid user input. Propagating exceptions might lead to VS crash.")]
-        private void CreateExpressionModelItem(object valueExpression)
-        {
-            // try to wrap the droppedObject in  a ModelItem.
-            ModelItem expressionModelItem = null;
-            if (valueExpression != null)
-            {
-                ModelServiceImpl modelService = (ModelServiceImpl)this.Context.Services.GetService<ModelService>();
-                expressionModelItem = modelService.WrapAsModelItem(valueExpression);
-                expressionModelItem.PropertyChanged += this.OnExpressionModelItemChanged;
-                this.boundedExpression = expressionModelItem;
-            }
-            try
-            {
-                this.internalModelItemChange = true;
-                this.EditingState = EditingState.Validating;
-                SetValue(ExpressionProperty, expressionModelItem);
-            }
-            catch (Exception err)
-            {
-                Trace.WriteLine(string.Format(CultureInfo.CurrentUICulture, "{0}\r\n{1}", err.Message, err.StackTrace));
-                this.internalModelItemChange = false;
-            }
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
-            Justification = "The conversion to an expression might fail due to invalid user input. Propagating exceptions might lead to VS crash.")]
-        [SuppressMessage("Reliability", "Reliability108:IsFatalRule",
-            Justification = "The conversion to an expression might fail due to invalid user input. Propagating exceptions might lead to VS crash.")]
-        private Activity CreateVBExpression()
-        {
-            Activity valueExpression = null;
-            if (this.OwnerActivity != null)
-            {
-                ExpressionValidationContext validationContext = new ExpressionValidationContext(this);
-
-                Type expReturnType = null;
-                string newExpressionText = null;
-                SourceExpressionException compileErrorMessages;
-
-                try
-                {
-                    VisualBasicSettings settings = null;
-                    valueExpression = CreateVBExpression(validationContext, out newExpressionText, out expReturnType, out compileErrorMessages, out settings);
-
-                    if (settings != null)
-                    {
-                        Fx.Assert(this.Context != null, "editing context cannot be null");
-                        //merge with import designer
-                        foreach (VisualBasicImportReference reference in settings.ImportReferences)
-                        {
-                            ImportDesigner.AddImport(reference.Import, this.Context);
-                        }
-                    }
-
-                    if (!string.IsNullOrEmpty(newExpressionText))
-                    {
-                        this.previousText = this.Text;
-                        this.Text = newExpressionText;
-                    }
-                }
-                catch (Exception err)
-                {
-                    //if the VisualBasicDesignerHelper were able to resolve the type we use that
-                    if (expReturnType == null)
-                    {
-                        //if not we try to use the expression type
-                        expReturnType = this.ExpressionType;
-                    }
-
-                    //if expression type is also null, the we use object
-                    if (expReturnType == null)
-                    {
-                        expReturnType = typeof(object);
-                    }
-
-                    valueExpression = VisualBasicEditor.CreateExpressionFromString(expReturnType, this.Text, UseLocationExpression, validationContext.ParserContext);
-
-                    Trace.WriteLine(string.Format(CultureInfo.CurrentUICulture, "{0}\r\n{1}", err.Message, err.StackTrace));
-                }
-                this.ExpressionText = this.Text;
-            }
-            else
-            {
-                // If the OwnerActivity is null, do not try to compile the expression otherwise VS will crash
-                // Inform the user that OwnerActivity is null (i.e. there is a error in their code)
-                Trace.WriteLine("ExpressionTextBox OwnerActivity is null.");
-            }
-            return valueExpression;
-        }
-
-        internal static ActivityWithResult CreateExpressionFromString(string expressionText, bool isLocation, Type type)
-        {
-            return VisualBasicEditor.CreateExpressionFromString(type, expressionText, isLocation, new ParserContext());
-        }
-
-        internal static ActivityWithResult CreateExpressionFromString(Type type, string expressionText, bool isLocation, ParserContext context)
-        {
-            ActivityWithResult newExpression;
-
-            if (!isLocation)
-            {
-                newExpression = ExpressionHelper.TryCreateLiteral(type, expressionText, context);
-
-                if (newExpression != null)
-                {
-                    return newExpression;
-                }
-            }
-
-            Type targetExpressionType = null;
-            if (isLocation)
-            {
-                targetExpressionType = typeof(VisualBasicReference<>).MakeGenericType(type);
-            }
-            else
-            {
-                targetExpressionType = typeof(VisualBasicValue<>).MakeGenericType(type);
-            }
-
-            //create new visual basic value and pass expression text into it
-            newExpression = (ActivityWithResult)Activator.CreateInstance(targetExpressionType, expressionText);
-            //targetExpressionType.GetProperty("Settings").SetValue(newExpression, settings, null);
-            //this code below is never executed - it is placed here only to enable compilation support whenver VisualBasicValue constructor
-            //changes its parameter list.
-            if (null == newExpression)
-            {
-                //if this gives compilation error, please update CreateInstance parameter list above as well!
-                newExpression = new VisualBasicValue<string>(expressionText);
-            }
-
-            return newExpression;
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
-            Justification = "The conversion to an expression might fail due to invalid user input. Propagating exceptions might lead to VS crash.")]
-        [SuppressMessage("Reliability", "Reliability108:IsFatalRule",
-            Justification = "The conversion to an expression might fail due to invalid user input. Propagating exceptions might lead to VS crash.")]
-        private static Activity CreateVBExpression(ExpressionValidationContext context, out string newExpressionText, out Type expReturnType, out SourceExpressionException compileErrorMessages, out VisualBasicSettings vbSettings)
-        {
-            expReturnType = null;
-            newExpressionText = null;
-            compileErrorMessages = null;
-            vbSettings = null;
-
-            //try easy way first - look if there is a type converter which supports conversion between expression type and string
-            ActivityWithResult literal = null;
-            try
-            {
-                if (!context.UseLocationExpression)
-                {
-                    literal = ExpressionHelper.TryCreateLiteral(context.ExpressionType, context.ExpressionText, context.ParserContext);
-                }
-
-                if (literal != null)
-                {
-                    //need to get new expression text - converter might have changed its format, and we want it to be up to date
-                    IValueSerializableExpression serializableExpression = literal as IValueSerializableExpression;
-                    Fx.Assert(serializableExpression != null, "the expression has to be a Literal<>, which should be IValueSerializableExpression");
-                    if (serializableExpression.CanConvertToString(context.ParserContext))
-                    {
-                        bool shouldBeQuoted = typeof(string) == context.ExpressionType || typeof(Uri) == context.ExpressionType;
-
-                        //whether string begins and ends with quotes '"'. also, if there are
-                        //more quotes within than those begining and ending ones, do not bother with literal - assume this is an expression.
-                        bool isQuotedString = shouldBeQuoted &&
-                                context.ExpressionText.StartsWith("\"", StringComparison.CurrentCulture) &&
-                                context.ExpressionText.EndsWith("\"", StringComparison.CurrentCulture) &&
-                                context.ExpressionText.IndexOf("\"", 1, StringComparison.CurrentCulture) == context.ExpressionText.Length - 1;
-                        var formatString = isQuotedString ? "\"{0}\"" : "{0}";
-                        newExpressionText = string.Format(CultureInfo.InvariantCulture, formatString, serializableExpression.ConvertToString(context.ParserContext));
-                    }
-                }
-            }
-            //conversion failed - do nothing, let VB compiler take care of the expression
-            catch
-            {
-            }
-
-            Activity valueExpression = literal;
-
-            if (null == valueExpression)
-            {
-                if (!context.UseLocationExpression)
-                {
-                    //Compile for validation.
-                    valueExpression = VisualBasicDesignerHelper.CreatePrecompiledVisualBasicValue(context.ExpressionType, context.ExpressionText, context.ParserContext.Namespaces, context.ReferencedAssemblies, context.ParserContext, out expReturnType, out compileErrorMessages, out vbSettings);
-                }
-                else
-                {
-                    //Compile for validation.
-                    valueExpression = VisualBasicDesignerHelper.CreatePrecompiledVisualBasicReference(context.ExpressionType, context.ExpressionText, context.ParserContext.Namespaces, context.ReferencedAssemblies, context.ParserContext, out expReturnType, out compileErrorMessages, out vbSettings);
-                }
-
-                ////It's possible the inferred type of expression is a dynamic type (e.g. delegate type), in this case it will cause serialization failure.
-                ////To prevent this, we'll always convert the expression type to be object if the inferred type is in dynamic assembly and user doesn't specify any ExpressionType property
-                if ((expReturnType.Assembly.IsDynamic) && (context.ExpressionType == null))
-                {
-                    ActivityWithResult originalExpression = valueExpression as ActivityWithResult;
-                    ActivityWithResult morphedExpression;
-                    if (ExpressionHelper.TryMorphExpression(originalExpression, ExpressionHelper.IsGenericLocationExpressionType(originalExpression), typeof(object), context.EditingContext, out morphedExpression))
-                    {
-                        valueExpression = morphedExpression;
-                    }
-                }
-            }
-
-            return valueExpression;
-        }
-
-        [SuppressMessage(FxCop.Category.Usage, FxCop.Rule.ReviewUnusedParameters, Justification = "Existing code")]
-        void OnExpressionTypeChanged(DependencyPropertyChangedEventArgs e)
-        {
-            //for independent expressions, when the type changes, we need to validate the expressions
-            if (this.initialized
-                && this.IsIndependentExpression
-                && this.EditingState == EditingState.Idle)
-            {
-                ValidateExpression(this);
-            }
-        }
-
-        [SuppressMessage(FxCop.Category.Usage, FxCop.Rule.ReviewUnusedParameters, Justification = "Existing code")]
-        void OnUseLocationExpressionChanged(DependencyPropertyChangedEventArgs e)
-        {
-            //for independent expressions, when the type changes, we need to validate the expressions
-            if (this.initialized
-                && this.IsIndependentExpression
-                && this.EditingState == EditingState.Idle
-                && this.OwnerActivity != null)
-            {
-                ValidateExpression(this);
-            }
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
-            Justification = "The entered expression might be invalid and may throw on deserialization. Propagating exception might lead to VS crash")]
-        [SuppressMessage("Reliability", "Reliability108:IsFatalRule",
-            Justification = "The entered expression might be invalid and may throw on deserialization. Propagating exception might lead to VS crash")]
-        void OnExpressionChanged(DependencyPropertyChangedEventArgs e)
-        {
-            ModelItem oldExpression = e.OldValue as ModelItem;
-            if (oldExpression != null)
-            {
-                oldExpression.PropertyChanged -= this.OnExpressionModelItemChanged;
-            }
-            ModelItem expression = e.NewValue as ModelItem;
-            if (expression != null && expression != this.boundedExpression)
-            {
-                expression.PropertyChanged += this.OnExpressionModelItemChanged;
-            }
-
-            try
-            {
-                this.boundedExpression = expression;
-
-                this.OnExpressionChanged();
-            }
-            catch (Exception err)
-            {
-                //if context is set - use error reporting
-                if (null != this.Context)
-                {
-                    this.Context.Items.SetValue(new ErrorItem() { Message = err.Message, Details = err.ToString() });
-                }
-                //otherwise - fallback to message box
-                else
-                {
-                    MessageBox.Show(err.ToString(), err.Message);
-                }
-            }
-
-        }
-
-        void expressionModelItem_PropertyChanged(object sender, PropertyChangedEventArgs e)
-        {
-            ModelItem item = sender as ModelItem;
-            if (item != null)
-            {
-                if (e.PropertyName.Equals("ExpressionText", StringComparison.Ordinal))
-                {
-                    this.OnExpressionChanged();
-                }
-            }
-        }
-
-        void OnPathToArgumentChanged(DependencyPropertyChangedEventArgs e)
-        {
-            this.OnPathToArgumentChanged((string)e.NewValue);
-        }
-
-        void OnIsIndependentExpressionChanged()
-        {
-            //if this is an independent expression, we need to initialize the validation error because validation service will not validate it
-            if (this.initialized
-                && this.IsIndependentExpression
-                && this.EditingState == EditingState.Idle)
-            {
-                ValidateExpression(this);
-            }
-        }
-
-        void UpdateValidationState()
-        {
-            if (this.Expression != null && this.ValidationService != null && this.ValidationService.ValidationStateProperty != null)
-            {
-                this.ValidationState = this.ValidationService.ValidationStateProperty.Getter(this.Expression);
-            }
-            else
-            {
-                this.ValidationState = ValidationState.Valid;
-            }
-        }
-
-        //We need to react to OnExpressionChanged, since there might be multiple ExpressionTextBoxes(ETB) associated to a single Expression.
-        //All the ETBs should be updated if the value in any of the ETBs is changed.
-        void OnExpressionChanged()
-        {
-            if (this.HintText == SR.UnsupportedExpressionHintText)
-            {
-                this.HintText = SR.ExpressionDefaultText;
-                this.InitializeHintText();
-            }
-
-            if (!this.internalModelItemChange)
-            {
-                if (this.Expression == null)
-                {
-                    //new expression is null - there is no text, no previous text, erros should be clear as well as error message
-                    this.Text = string.Empty;
-                    this.previousText = this.Text;
-                    this.ExpressionText = null;
-                    this.ValidationState = ValidationState.Valid;
-                }
-                else
-                {
-                    this.UpdateValidationState();
-
-                    object expressionObject = this.Expression.GetCurrentValue();
-                    ActivityWithResult expression = expressionObject as ActivityWithResult;
-                    if (VisualBasicEditor.IsSupportedExpressionType(expression))
-                    {
-                        String expressionString = null;
-                        //create parser context - do not pass ownerActivity - it might be null at this time
-                        ParserContext context = new ParserContext();
-                        expressionString = ExpressionHelper.GetExpressionString(expression, context);
-
-                        this.Text = expressionString;
-                        this.ExpressionText = expressionString;
-                        this.previousText = this.Text;
-                        this.IsSupportedExpression = true;
-                    }
-                    else
-                    {
-                        this.Text = string.Empty;
-                        this.IsSupportedExpression = false;
-                        this.HintText = SR.UnsupportedExpressionHintText;
-                    }
-
-                    this.isExpressionLoaded = true;
-                    if (this.isBeginEditPending)
-                    {
-                        this.BeginEdit();
-                    }
-                }
-            }
-            internalModelItemChange = false;
-        }
-
-        private static bool IsSupportedExpressionType(object expressionObject)
-        {
-            ActivityWithResult expression = expressionObject as ActivityWithResult;
-            bool isSupported = false;
-            if (expression != null)
-            {
-                Type expressionType = expression.GetType();
-                Type genericExpressionType = null;
-                if (expressionType.IsGenericType)
-                {
-                    genericExpressionType = expressionType.GetGenericTypeDefinition();
-                }
-
-                if (genericExpressionType == VisualBasicValueType ||
-                    genericExpressionType == VisualBasicReferenceType ||
-                    genericExpressionType == VariableReferenceType ||
-                    genericExpressionType == VariableValueType ||
-                    (genericExpressionType == LiteralType && ExpressionHelper.CanTypeBeSerializedAsLiteral(expression.ResultType)))
-                {
-                    isSupported = true;
-                }
-            }
-
-            return isSupported;
-        }
-
-        void OnPathToArgumentChanged(string pathAsString)
-        {
-            this.expressionModelProperty = null;
-            this.expressionConverter = null;
-            if (!string.IsNullOrEmpty(pathAsString) && null != this.OwnerActivity)
-            {
-                string[] path = pathAsString.Split('.');
-                if (path.Length > 0)
-                {
-                    this.expressionModelProperty = this.OwnerActivity.Properties[path[0]];
-                    for (int i = 1; i < path.Length; ++i)
-                    {
-                        if (null != this.expressionModelProperty && null != this.expressionModelProperty.Value)
-                        {
-                            this.expressionModelProperty = this.expressionModelProperty.Value.Properties[path[i]];
-                        }
-                        else
-                        {
-                            this.expressionModelProperty = null;
-                            break;
-                        }
-                    }
-                }
-            }
-            if (null != this.expressionModelProperty)
-            {
-                this.expressionConverter = ((ModelPropertyImpl)this.expressionModelProperty).PropertyDescriptor.Converter;
-            }
-            this.InitializeHintText();
-        }
-
-        void InitializeHintText()
-        {
-            DescriptionAttribute customHint = null;
-            if (this.expressionModelProperty != null && this.expressionModelProperty.Attributes.Count != 0)
-            {
-                customHint = this.expressionModelProperty.Attributes
-                    .OfType<DescriptionAttribute>()
-                    .FirstOrDefault();
-            }
-            this.HintText = (null == customHint || string.IsNullOrEmpty(customHint.Description) ?
-                (string.Equals(this.HintText, SR.ExpressionDefaultText) ? SR.ExpressionDefaultText : this.HintText) : customHint.Description);
-
-            string hint = null;
-            if (this.HintText != null)
-            {
-                hint = this.HintText.Trim(new char[] { '<', '>' });
-                this.SetValue(AutomationProperties.HelpTextProperty, hint);
-            }
-        }
-
-        void InitializeContext(DependencyPropertyChangedEventArgs e)
-        {
-            if (e.OldValue != null)
-            {
-                // remove the OnValidationCompleted event handler on the old value
-                ModelItem modelItem = (ModelItem)e.OldValue;
-                if (modelItem != null)
-                {
-                    EditingContext context = modelItem.GetEditingContext();
-                    ValidationService validationService = context.Services.GetService<ValidationService>();
-                    if (validationService != null)
-                    {
-                        validationService.ValidationCompleted -= this.OnValidationCompleted;
-                    }
-                }
-            }
-
-
-            if (null != this.OwnerActivity)
-            {
-                if (this.ValidationService != null)
-                {
-                    this.ValidationService.ValidationCompleted += this.OnValidationCompleted;
-                    this.UpdateValidationState();
-                }
-            }
-        }
-
-        #region Command Handlers
-
-        public override bool CanCommit()
-        {
-            string currentText = this.Text;
-            if (this.expressionEditorInstance != null)
-            {
-                currentText = this.expressionEditorInstance.Text ?? this.expressionEditorInstance.Text.Trim();
-            }
-            else if (this.editingTextBox != null)
-            {
-                currentText = this.editingTextBox.Text ?? this.editingTextBox.Text.Trim();
-            }
-
-            //we dont need to commit change if currentText and previousText is the same
-            //null and empty should be considered equal in this context
-
-            return !string.Equals(currentText, this.previousText) &&
-                   !(string.IsNullOrEmpty(currentText) && string.IsNullOrEmpty(this.previousText));
-        }
-
-        void OnExpressionTextBoxLoaded(object sender, RoutedEventArgs e)
-        {
-            this.InitializeHintText();
-
-            //if this is an independent expression, we need to initialize the validation error because validation service will not validate it
-            if (this.IsIndependentExpression)
-            {
-                ValidateExpression(this);
-            }
-
-            this.initialized = true;
-        }
-
-        void OnExpressionTextBoxUnloaded(object sender, RoutedEventArgs e)
-        {
-            if (this.ValidationService != null)
-            {
-                this.ValidationService.ValidationCompleted -= this.OnValidationCompleted;
-            }
-            KillValidator();
-
-            if (this.boundedExpression != null)
-            {
-                this.boundedExpression.PropertyChanged -= this.OnExpressionModelItemChanged;
-            }
-        }
-
-        public override void OnCompleteWordCommandCanExecute(CanExecuteRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-
-                e.CanExecute = this.expressionEditorInstance.CanCompleteWord();
-                e.Handled = true;
-            }
-            else
-            {
-                e.Handled = false;
-            }
-        }
-
-        public override void OnGlobalIntellisenseCommandCanExecute(CanExecuteRoutedEventArgs e)
-        {
-
-            if (this.expressionEditorInstance != null)
-            {
-                e.CanExecute = this.expressionEditorInstance.CanGlobalIntellisense();
-                e.Handled = true;
-            }
-            else
-            {
-                e.Handled = false;
-            }
-        }
-
-        public override void OnParameterInfoCommandCanExecute(CanExecuteRoutedEventArgs e)
-        {
-
-            if (this.expressionEditorInstance != null)
-            {
-                e.CanExecute = this.expressionEditorInstance.CanParameterInfo();
-                e.Handled = true;
-            }
-            else
-            {
-                e.Handled = false;
-            }
-        }
-
-        public override void OnQuickInfoCommandCanExecute(CanExecuteRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                e.CanExecute = this.expressionEditorInstance.CanQuickInfo();
-                e.Handled = true;
-            }
-            else
-            {
-                e.Handled = false;
-            }
-        }
-
-        public override void OnIncreaseFilterLevelCommandCanExecute(CanExecuteRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                e.CanExecute = this.expressionEditorInstance.CanIncreaseFilterLevel();
-                e.Handled = true;
-            }
-            else
-            {
-                e.Handled = false;
-            }
-        }
-
-        public override void OnDecreaseFilterLevelCommandCanExecute(CanExecuteRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                e.CanExecute = this.expressionEditorInstance.CanDecreaseFilterLevel();
-                e.Handled = true;
-            }
-            else
-            {
-                e.Handled = false;
-            }
-        }
-
-        void OnCutCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                e.CanExecute = this.expressionEditorInstance.CanCut();
-                e.Handled = true;
-            }
-            else
-            {
-                e.Handled = false;
-            }
-        }
-
-        public override void OnCompleteWordCommandExecute(ExecutedRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                e.Handled = this.expressionEditorInstance.CompleteWord();
-            }
-            else
-            {
-                e.Handled = false;
-            }
-
-        }
-
-        public override void OnGlobalIntellisenseCommandExecute(ExecutedRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                e.Handled = this.expressionEditorInstance.GlobalIntellisense();
-            }
-            else
-            {
-                e.Handled = false;
-            }
-
-        }
-
-        public override void OnParameterInfoCommandExecute(ExecutedRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                e.Handled = this.expressionEditorInstance.ParameterInfo();
-            }
-            else
-            {
-                e.Handled = false;
-            }
-
-        }
-
-        public override void OnQuickInfoCommandExecute(ExecutedRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                e.Handled = this.expressionEditorInstance.QuickInfo();
-            }
-            else
-            {
-                e.Handled = false;
-            }
-
-        }
-
-        public override void OnDecreaseFilterLevelCommandExecute(ExecutedRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                e.Handled = this.expressionEditorInstance.DecreaseFilterLevel();
-            }
-            else
-            {
-                e.Handled = false;
-            }
-
-        }
-
-        public override void OnIncreaseFilterLevelCommandExecute(ExecutedRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                e.Handled = this.expressionEditorInstance.IncreaseFilterLevel();
-            }
-            else
-            {
-                e.Handled = false;
-            }
-
-        }
-
-        void OnCutCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                e.Handled = this.expressionEditorInstance.Cut();
-            }
-            else
-            {
-                e.Handled = false;
-            }
-        }
-
-        void OnCopyCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                e.CanExecute = this.expressionEditorInstance.CanCopy();
-                e.Handled = true;
-            }
-            else
-            {
-                e.Handled = false;
-            }
-        }
-
-        void OnCopyCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                e.Handled = this.expressionEditorInstance.Copy();
-            }
-            else
-            {
-                e.Handled = false;
-            }
-        }
-
-        void OnPasteCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                e.CanExecute = this.expressionEditorInstance.CanPaste();
-                e.Handled = true;
-            }
-            else
-            {
-                e.Handled = false;
-            }
-        }
-
-        void OnPasteCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                e.Handled = this.expressionEditorInstance.Paste();
-            }
-            else
-            {
-                e.Handled = false;
-            }
-        }
-
-        void OnUndoCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                e.CanExecute = this.expressionEditorInstance.CanUndo();
-                e.Handled = true;
-            }
-            else
-            {
-                e.Handled = false;
-            }
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
-            Justification = "Catch all execeptions to prevent crash.")]
-        [SuppressMessage("Reliability", "Reliability108:IsFatalRule",
-            Justification = "Catch all execeptions to prevent crash.")]
-        void OnUndoCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                try
-                {
-                    e.Handled = this.expressionEditorInstance.Undo();
-                }
-                catch (Exception ex)
-                {
-                    MessageBox.Show(ex.Message);
-                }
-            }
-            else
-            {
-                e.Handled = false;
-            }
-        }
-
-        void OnRedoCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                e.CanExecute = this.expressionEditorInstance.CanRedo();
-                e.Handled = true;
-            }
-            else
-            {
-                e.Handled = false;
-            }
-        }
-
-        void OnRedoCommandExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                e.Handled = this.expressionEditorInstance.Redo();
-            }
-            else
-            {
-                e.Handled = false;
-            }
-        }
-
-        void OnHelpExecute(object sender, ExecutedRoutedEventArgs e)
-        {
-            IIntegratedHelpService help = this.Context.Services.GetService<IIntegratedHelpService>();
-            if (help != null)
-            {
-                help.ShowHelpFromKeyword(HelpKeywords.ExpressionEditorPage);
-            }
-            else
-            {
-                System.Diagnostics.Process.Start(SR.DefaultHelpUrl);
-            }
-        }
-
-        #endregion
-
-        void OnHintTextChanged(DependencyPropertyChangedEventArgs e)
-        {
-            if (!string.Equals(SR.ExpressionDefaultText, e.NewValue) && !string.Equals(e.OldValue, e.NewValue))
-            {
-                this.InitializeHintText();
-            }
-        }
-
-        void OnAcceptsReturnChanged(DependencyPropertyChangedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                this.expressionEditorInstance.AcceptsReturn = (bool)e.NewValue;
-            }
-        }
-
-        void OnAcceptsTabChanged(DependencyPropertyChangedEventArgs e)
-        {
-            if (this.expressionEditorInstance != null)
-            {
-                this.expressionEditorInstance.AcceptsTab = (bool)e.NewValue;
-            }
-        }
-
-        void StartValidator()
-        {
-            if (this.validator == null)
-            {
-                this.validator = new BackgroundWorker();
-                this.validator.WorkerReportsProgress = true;
-                this.validator.WorkerSupportsCancellation = true;
-
-                this.validator.DoWork += delegate(object obj, DoWorkEventArgs args)
-                {
-                    BackgroundWorker worker = obj as BackgroundWorker;
-                    if (worker.CancellationPending)
-                    {
-                        args.Cancel = true;
-                        return;
-                    }
-                    ExpressionValidationContext validationContext = args.Argument as ExpressionValidationContext;
-                    if (validationContext != null)
-                    {
-                        string errorMessage;
-                        if (DoValidation(validationContext, out errorMessage))
-                        {
-                            worker.ReportProgress(0, errorMessage);
-                        }
-
-                        //sleep
-                        if (worker.CancellationPending)
-                        {
-                            args.Cancel = true;
-                            return;
-                        }
-
-                        Thread.Sleep(ValidationWaitTime);
-                        args.Result = validationContext;
-                    }
-
-                };
-
-                this.validator.RunWorkerCompleted += delegate(object obj, RunWorkerCompletedEventArgs args)
-                {
-                    if (!args.Cancelled)
-                    {
-                        ExpressionValidationContext validationContext = args.Result as ExpressionValidationContext;
-                        if (validationContext != null)
-                        {
-                            Dispatcher.BeginInvoke(new Action<ExpressionValidationContext>((target) =>
-                            {
-                                //validator could be null by the time we try to validate again or
-                                //if it's already busy
-                                if (this.validator != null && !this.validator.IsBusy)
-                                {
-                                    target.Update(this);
-                                    this.validator.RunWorkerAsync(target);
-                                }
-                            }), validationContext);
-                        }
-                    }
-                };
-
-                this.validator.ProgressChanged += delegate(object obj, ProgressChangedEventArgs args)
-                {
-                    string error = args.UserState as string;
-                    Dispatcher.BeginInvoke(new Action<string>(UpdateValidationError), error);
-                };
-
-                this.validator.RunWorkerAsync(new ExpressionValidationContext(this));
-            }
-        }
-
-        //perform one validation synchronously
-        //return value indicates whether errorMessage is updated.
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
-            Justification = "The entered expression might be invalid and may throw on deserialization. Propagating exception might lead to VS crash")]
-        [SuppressMessage("Reliability", "Reliability108:IsFatalRule",
-            Justification = "The entered expression might be invalid and may throw on deserialization. Propagating exception might lead to VS crash")]
-        bool DoValidation(ExpressionValidationContext validationContext, out string errorMessage)
-        {
-            Fx.Assert(validationContext != null, "only work when context is not null");
-            errorMessage = null;
-
-            //validate
-            //if the text is empty we clear the error message
-            if (string.IsNullOrEmpty(validationContext.ExpressionText))
-            {
-                errorMessage = null;
-                return true;
-            }
-            // if the expression text is different from the last time we run the validation we run the validation
-            else if (!string.Equals(validationContext.ExpressionText, validationContext.ValidatedExpressionText))
-            {
-                Type expReturnType = null;
-                string newExpressionText = null;
-                SourceExpressionException compileErrorMessages = null;
-                VisualBasicSettings settings = null;
-                try
-                {
-                    CreateVBExpression(validationContext, out newExpressionText, out expReturnType, out compileErrorMessages, out settings);
-                    if (compileErrorMessages != null)
-                    {
-                        errorMessage = compileErrorMessages.Message;
-                    }
-                }
-                catch (Exception err)
-                {
-                    errorMessage = err.Message;
-                }
-
-                return true;
-            }
-
-            return false;
-        }
-
-        void UpdateValidationError(string errorMessage)
-        {
-            if (!string.IsNullOrEmpty(errorMessage))
-            {
-                //report error
-                this.HasValidationError = true;
-                this.ValidationErrorMessage = errorMessage;
-            }
-            else
-            {
-                this.HasValidationError = false;
-                this.ValidationErrorMessage = null;
-            }
-        }
-
-        private class ExpressionValidationContext
-        {
-            internal ParserContext ParserContext { get; set; }
-            internal Type ExpressionType { get; set; }
-            internal String ExpressionText { get; set; }
-            internal EditingContext EditingContext { get; set; }
-            internal String ValidatedExpressionText { get; set; }
-            internal bool UseLocationExpression { get; set; }
-
-            internal ExpressionValidationContext(VisualBasicEditor etb)
-            {
-                Update(etb);
-            }
-
-            internal void Update(VisualBasicEditor etb)
-            {
-                Fx.Assert(etb.OwnerActivity != null, "Owner Activity is null");
-                this.EditingContext = etb.OwnerActivity.GetEditingContext();
-
-                //setup ParserContext
-                this.ParserContext = new ParserContext(etb.OwnerActivity)
-                {
-                    //callee is a ExpressionTextBox
-                    Instance = etb,
-                    //pass property descriptor belonging to epression's model property (if one exists)
-                    PropertyDescriptor = (null != etb.expressionModelProperty ? ((ModelPropertyImpl)etb.expressionModelProperty).PropertyDescriptor : null),
-                };
-
-                this.ExpressionType = etb.ExpressionType;
-                this.ValidatedExpressionText = this.ExpressionText;
-                if (etb.expressionEditorInstance != null)
-                {
-                    this.ExpressionText = etb.expressionEditorInstance.Text;
-                }
-                else if (etb.editingTextBox != null)
-                {
-                    this.ExpressionText = etb.editingTextBox.Text;
-                }
-                else
-                {
-                    this.ExpressionText = etb.Text;
-                }
-                this.UseLocationExpression = etb.UseLocationExpression;
-            }
-
-            internal IEnumerable<string> ReferencedAssemblies
-            {
-                get
-                {
-                    Fx.Assert(this.EditingContext != null, "ModelItem.Context = null");
-                    AssemblyContextControlItem assemblyContext = this.EditingContext.Items.GetValue<AssemblyContextControlItem>();
-                    if (assemblyContext != null)
-                    {
-                        return assemblyContext.AllAssemblyNamesInContext;
-                    }
-                    return null;
-                }
-            }
-        }
-
-        private static List<ModelItem> GetVariablesInScopeWithShadowing(ModelItem ownerActivity, bool includeArguments)
-        {
-            List<ModelItem> variablesInScope = new List<ModelItem>();
-            if (ownerActivity != null)
-            {
-                HashSet<string> variableNames = new HashSet<string>();
-                ModelItem currentItem = ownerActivity;
-                Func<ModelItem, bool> filterDelegate = new Func<ModelItem, bool>((variable) =>
-                    {
-                        string variableName = (string)variable.Properties["Name"].ComputedValue;
-                        if (variableName == null)
-                        {
-                            return false;
-                        }
-                        else
-                        {
-                            return !variableNames.Contains(variableName.ToUpperInvariant());
-                        }
-                    });
-
-                while (currentItem != null)
-                {
-                    List<ModelItem> variables = new List<ModelItem>();
-                    ModelItemCollection variablesCollection = currentItem.GetVariableCollection();
-                    if (variablesCollection != null)
-                    {
-                        variables.AddRange(variablesCollection);
-                    }
-                    variables.AddRange(currentItem.FindActivityDelegateArguments());
-
-                    // For the variables defined at the same level, shadowing doesn't apply. If there're multiple variables defined at the same level
-                    // have duplicate names when case is ignored, all of these variables should bee added as variables in scope and let validation reports
-                    // ambiguous reference error. So that we need to scan all variables defined at the same level first and then add names to the HashSet.                                        
-                    IEnumerable<ModelItem> filteredVariables = variables.Where<ModelItem>(filterDelegate);
-                    variablesInScope.AddRange(filteredVariables);
-                    foreach (ModelItem variable in filteredVariables)
-                    {
-                        variableNames.Add(((string)variable.Properties["Name"].ComputedValue).ToUpperInvariant());
-                    }
-
-                    currentItem = currentItem.Parent;
-                }
-
-                if (includeArguments)
-                {
-                    List<ModelItem> arguments = VisualBasicEditor.GetVariablesForArguments(ownerActivity.Root);
-                    variablesInScope.AddRange(arguments.Where<ModelItem>(filterDelegate));
-                }
-            }
-
-            return variablesInScope;
-        }
-
-        private static List<ModelItem> GetVariablesForArguments(ModelItem modelItem)
-        {
-            List<ModelItem> arguments = new List<ModelItem>();
-            //if expression editor is loaded in the WF which is hosted within ActivityBuilder, there is a need to pickup defined arguments
-            //and feed them as variables, so intellisense can include them
-            if (null != modelItem && ActivityBuilderHelper.IsActivityBuilderType(modelItem))
-            {
-                ModelTreeManager treeManager = ((IModelTreeItem)modelItem).ModelTreeManager;
-                //call ActivityBuilderHelper.GetVariables - it will create a collection of Variable - each variable corresponds to a specific argument
-                arguments.AddRange(
-                    ActivityBuilderHelper.GetVariables(modelItem)
-                    //create a fake model item implementation - there is no need to store that model item anywhere in the model tree, it is required
-                    //of the expression editor interface to pass instances of model items wrapping variables, rather than actual variables
-                    .Select<Variable, ModelItem>(entry => new FakeModelItemImpl(treeManager, typeof(Variable), entry, null)));
-            }
-
-            return arguments;
-        }
-
-        internal static List<ModelItem> GetVariablesInScope(ModelItem ownerActivity)
-        {
-            List<ModelItem> declaredVariables = new List<ModelItem>();
-            if (ownerActivity != null)
-            {
-                bool includeArguments = !(ownerActivity.GetCurrentValue() is ActivityBuilder);
-                FrameworkName targetFramework = WorkflowDesigner.GetTargetFramework(ownerActivity.GetEditingContext());
-                if ((targetFramework != null) && (targetFramework.IsLessThan45()))
-                {
-                    declaredVariables.AddRange(VariableHelper.FindVariablesInScope(ownerActivity));
-                    declaredVariables.AddRange(VariableHelper.FindActivityDelegateArgumentsInScope(ownerActivity));
-                    if (includeArguments)
-                    {
-                        declaredVariables.AddRange(VisualBasicEditor.GetVariablesForArguments(ownerActivity.Root));
-                    }
-                }
-                else
-                {
-                    declaredVariables.AddRange(VisualBasicEditor.GetVariablesInScopeWithShadowing(ownerActivity, includeArguments));
-                }
-            }
-
-            return declaredVariables;
-        }
-    }
-
-    internal sealed class LineToHeightConverter : IMultiValueConverter
-    {
-        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-        {
-            double convertedValue = Double.NaN;
-            bool isDefault = true;
-
-            // Calculate the height for the textblock as ExpressionTextBox exposes lines properties,
-            // and TextBlock doesn't have lines properties.
-            FontFamily fontFamily = values.OfType<FontFamily>().FirstOrDefault();
-            int lines = values.OfType<int>().FirstOrDefault();
-            double[] doubleArray = values.OfType<double>().ToArray<double>();
-
-            if (doubleArray.Length == 2)
-            {
-                double height = doubleArray[0]; // The first element of the array is going to be the height
-                double fontSize = doubleArray[1]; // The seconed element of the array is going to be the fontSize
-
-                // 0.0 is default for MinHeight, PositiveInfinity is default for MaxHeight
-                if (string.Equals(parameter as string, "MinHeight"))
-                {
-                    isDefault = (height == 0.0);
-                }
-                else if (string.Equals(parameter as string, "MaxHeight"))
-                {
-                    isDefault = (double.IsPositiveInfinity(height));
-                }
-
-                // If the height value we are evaluating is default, use Lines for sizing...
-                // If no heights (height or lines) have been explicitly specified, we would rather default the height
-                // as if the Line was 1 - so use the line heights, rather than 0.0 and/or PositiveInfinity.
-                if (isDefault)
-                {
-                    double lineHeight = fontSize * fontFamily.LineSpacing;
-
-                    if (fontFamily != null)
-                    {
-                        convertedValue = lineHeight * (double)lines + 4;
-                    }
-                }
-                else
-                {
-                    convertedValue = height;
-                }
-            }
-
-            return convertedValue;
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-    }
-
-    internal sealed class ValidationStateToErrorConverter : IMultiValueConverter
-    {
-
-        #region IMultiValueConverter Members
-
-        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-        {
-            VisualBasicEditor etb = values[0] as VisualBasicEditor;
-            if (values[0] == DependencyProperty.UnsetValue || etb == null)
-            {
-                return false;
-            }
-            return etb.HasErrors;
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotImplementedException());
-        }
-
-        #endregion
-    }
-
-    internal sealed class ValidationErrorMessageConverter : IMultiValueConverter
-    {
-        #region IMultiValueConverter Members
-
-        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
-        {
-            VisualBasicEditor etb = values[0] as VisualBasicEditor;
-            if (values[0] == DependencyProperty.UnsetValue || etb == null)
-            {
-                return false;
-            }
-            return etb.ErrorMessage;
-        }
-
-        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotImplementedException());
-        }
-
-        #endregion
-    }
-
-    internal sealed class TypeToPromptTextConverter : IValueConverter
-    {
-        #region IValueConverter Members
-
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            return TypeToPromptTextConverter.GetPromptText(value);
-        }
-
-        internal static string GetPromptText(object value)
-        {
-            Type expressionType = value as Type;
-            if (value == DependencyProperty.UnsetValue || expressionType == null || !expressionType.IsValueType)
-            {
-                return "Nothing";
-            }
-            else
-            {
-                return Activator.CreateInstance(expressionType).ToString();
-            }
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            throw FxTrace.Exception.AsError(new NotSupportedException());
-        }
-
-        #endregion
-    }
-
-
-    public enum EditingState
-    {
-        Editing,
-        Validating,
-        Idle
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VisualBasicEditorAutomationPeer.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VisualBasicEditorAutomationPeer.cs
deleted file mode 100644 (file)
index 2a13cd5..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows.Automation.Peers;
-using System.Windows;
-using System.Runtime.InteropServices;
-using System.Xml.Linq;
-using System.Globalization;
-
-namespace System.Activities.Presentation.View
-{
-    [System.Runtime.Fx.Tag.XamlVisible(false)]
-    class VisualBasicEditorAutomationPeer : UIElementAutomationPeer
-    {
-        public VisualBasicEditorAutomationPeer(VisualBasicEditor owner)
-            : base(owner)
-        {
-        }
-
-        protected override string GetItemStatusCore()
-        {
-            VisualBasicEditor textBox = this.Owner as VisualBasicEditor;
-            if (textBox != null)
-            {
-                XElement itemStatus = new XElement("VisualBasicEditorItemStatus",
-                    new XAttribute("Status", textBox.HasErrors ? "Invalid" : "Valid"),
-                    new XAttribute("EditingState", textBox.EditingState.ToString()),
-                    new XAttribute("ErrorMessage", String.IsNullOrEmpty(textBox.ErrorMessage) ? String.Empty : textBox.ErrorMessage));
-                return itemStatus.ToString();
-            }
-            return base.GetItemStatusCore();
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VisualBasicReferenceValidationFeature.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VisualBasicReferenceValidationFeature.cs
deleted file mode 100644 (file)
index f6b3c21..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation.View
-{
-    using System.Activities.Presentation.Validation;
-    using System.Activities.Validation;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Runtime;
-    using Microsoft.Activities.Presentation;
-    using Microsoft.VisualBasic.Activities;
-
-    internal class VisualBasicReferenceValidationFeature : Feature
-    {        
-        private static readonly Type VisualBasicReferenceType = typeof(VisualBasicReference<>);
-
-        public override void Initialize(EditingContext context, Type modelType)
-        {
-            Fx.Assert(
-                modelType.IsGenericType && (modelType.GetGenericTypeDefinition() == VisualBasicReferenceType),
-                "This Feature should only apply to VisualBasicReference<>");
-
-            ValidationService validationService = context.Services.GetService<ValidationService>();
-            if (validationService != null && WorkflowDesigner.GetTargetFramework(context).IsLessThan45())
-            {                
-                validationService.Settings.AdditionalConstraints.Add(VisualBasicReferenceType, new List<Constraint> { VisualBasicDesignerHelper.NameShadowingConstraint });
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VisualBasicValueValidationFeature.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VisualBasicValueValidationFeature.cs
deleted file mode 100644 (file)
index c3e1773..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation.View
-{
-    using System.Activities.Presentation.Validation;
-    using System.Activities.Validation;
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Runtime;
-    using Microsoft.Activities.Presentation;
-    using Microsoft.VisualBasic.Activities;
-
-    internal class VisualBasicValueValidationFeature : Feature
-    {
-        private static readonly Type VisualBasicValueType = typeof(VisualBasicValue<>);        
-
-        public override void Initialize(EditingContext context, Type modelType)
-        {
-            Fx.Assert(
-                modelType.IsGenericType && (modelType.GetGenericTypeDefinition() == VisualBasicValueType),
-                "This Feature should only apply to VisualBasicValue<>");
-
-            ValidationService validationService = context.Services.GetService<ValidationService>();
-            if (validationService != null && WorkflowDesigner.GetTargetFramework(context).IsLessThan45())
-            {
-                validationService.Settings.AdditionalConstraints.Add(VisualBasicValueType, new List<Constraint> { VisualBasicDesignerHelper.NameShadowingConstraint });                
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/WindowExtensionMethods.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/WindowExtensionMethods.cs
deleted file mode 100644 (file)
index e08b097..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Runtime.InteropServices;
-    using System.Windows;
-    using System.Windows.Interop;
-    using Microsoft.Tools.Common;
-
-    static class WindowExtensionMethods
-    {
-        public static void ShowContextHelpButton(this Window window)
-        {
-            IntPtr hwnd = new WindowInteropHelper(window).Handle;
-            IntPtr exStyle = Win32Interop.GetWindowLongPtr(hwnd, Win32Interop.GWL_EXSTYLE);
-            if (IntPtr.Size == 4)
-            {
-                exStyle = new IntPtr(exStyle.ToInt32() | Win32Interop.WS_EX_CONTEXTHELP);
-            }
-            else
-            {
-                exStyle = new IntPtr(exStyle.ToInt64() | ((long)Win32Interop.WS_EX_CONTEXTHELP));
-            }
-            Win32Interop.SetWindowLongPtr(new HandleRef(window, hwnd), Win32Interop.GWL_EXSTYLE, exStyle);
-        }
-
-        public static void HideMinMaxButton(this Window window)
-        {
-            IntPtr hwnd = new WindowInteropHelper(window).Handle;
-            IntPtr style = Win32Interop.GetWindowLongPtr(hwnd, Win32Interop.GWL_STYLE);
-            if (IntPtr.Size == 4)
-            {
-                int intValue = style.ToInt32();
-                intValue = SetBit(Win32Interop.WS_MAXIMIZEBOX, intValue, false);
-                intValue = SetBit(Win32Interop.WS_MINIMIZEBOX, intValue, false);
-                style = new IntPtr(intValue);
-            }
-            else
-            {
-                long longValue = style.ToInt64();
-                longValue = SetBit((long)Win32Interop.WS_MAXIMIZEBOX, longValue, false);
-                longValue = SetBit((long)Win32Interop.WS_MINIMIZEBOX, longValue, false);
-                style = new IntPtr(longValue);
-            }
-            Win32Interop.SetWindowLongPtr(new HandleRef(window, hwnd), Win32Interop.GWL_STYLE, style);
-        }
-
-        public static void AddWindowsHook(this Window window, HwndSourceHook wmHandler)
-        {
-            IntPtr hwnd = new WindowInteropHelper(window).Handle;
-            HwndSource source = HwndSource.FromHwnd(hwnd);
-            source.AddHook(wmHandler);
-        }
-
-        public static void RemoveWindowsHook(this Window window, HwndSourceHook wmHandler)
-        {
-            IntPtr hwnd = new WindowInteropHelper(window).Handle;
-            HwndSource source = HwndSource.FromHwnd(hwnd);
-            source.RemoveHook(wmHandler);
-        }
-
-        public static void HideIcon(this Window window)
-        {
-            IntPtr hwnd = new WindowInteropHelper(window).Handle;
-            IntPtr exStyle = Win32Interop.GetWindowLongPtr(hwnd, Win32Interop.GWL_EXSTYLE);
-            if (IntPtr.Size == 4)
-            {
-                exStyle = new IntPtr(exStyle.ToInt32() | Win32Interop.WS_EX_DLGMODALFRAME);
-            }
-            else
-            {
-                exStyle = new IntPtr(exStyle.ToInt64() | ((long)Win32Interop.WS_EX_DLGMODALFRAME));
-            }
-            Win32Interop.SetWindowLongPtr(new HandleRef(window, hwnd), Win32Interop.GWL_EXSTYLE, exStyle);
-
-            Win32Interop.SendMessage(hwnd, Win32Interop.WM_SETICON, new IntPtr(Win32Interop.ICON_SMALL), IntPtr.Zero);
-            Win32Interop.SendMessage(hwnd, Win32Interop.WM_SETICON, new IntPtr(Win32Interop.ICON_BIG), IntPtr.Zero);
-        }
-
-        private static long SetBit(long mask, long value, bool flag)
-        {
-            if (flag)
-            {
-                return value | mask;
-            }
-            else
-            {
-                return value & ~mask;
-            }
-        }
-
-        private static int SetBit(int mask, int value, bool flag)
-        {
-            if (flag)
-            {
-                return value | mask;
-            }
-            else
-            {
-                return value & ~mask;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/WorkflowViewManager.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/WorkflowViewManager.cs
deleted file mode 100644 (file)
index 627aea4..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Windows;
-
-    using System.Windows.Media;
-    using System.Windows.Media.Effects;
-    using System.Windows.Documents;
-
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.View;
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Documents;
-    using System.Activities.Presentation.Services;
-    using System.Collections.ObjectModel;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Runtime;
-    using System.ComponentModel.Design;
-    using System.Activities.Presentation.Annotations;
-
-
-    internal class WorkflowViewManager : ViewManager
-    {
-        const string KeywordForWorkflowDesignerHomePage = "DefaultWorkflowDesigner";
-        EditingContext context;
-        Selection oldSelection;
-        ModelService modelService;
-        System.Activities.Presentation.View.DesignerView view;
-        AttachedProperty<bool> isPrimarySelectionProperty;
-        AttachedProperty<bool> isSelectionProperty;
-        IIntegratedHelpService helpService;
-
-        public override System.Windows.Media.Visual View
-        {
-            get
-            {
-                return view;
-            }
-        }
-        public override void Initialize(EditingContext context)
-        {
-            this.context = context;
-            AttachedPropertiesService propertiesService = this.context.Services.GetService<AttachedPropertiesService>();
-            helpService = this.context.Services.GetService<IIntegratedHelpService>();
-
-            oldSelection = this.context.Items.GetValue<Selection>();
-            isPrimarySelectionProperty = new AttachedProperty<bool>()
-                {
-                    Getter = (modelItem) => (this.context.Items.GetValue<Selection>().PrimarySelection == modelItem),
-                    Name = "IsPrimarySelection",
-                    OwnerType = typeof(Object)
-                };
-
-            isSelectionProperty = new AttachedProperty<bool>()
-            {
-                Getter = (modelItem) => (((IList)this.context.Items.GetValue<Selection>().SelectedObjects).Contains(modelItem)),
-                Name = "IsSelection",
-                OwnerType = typeof(Object)
-            };
-
-
-            propertiesService.AddProperty(isPrimarySelectionProperty);
-            propertiesService.AddProperty(isSelectionProperty);
-            
-
-
-
-            if (this.context.Services.GetService<ViewService>() == null)
-            {
-                view = new System.Activities.Presentation.View.DesignerView(this.context);
-                WorkflowViewService viewService = new WorkflowViewService(context);
-                WorkflowViewStateService viewStateService = new WorkflowViewStateService(context);
-                this.context.Services.Publish<ViewService>(viewService);
-                this.context.Services.Publish<VirtualizedContainerService>(new VirtualizedContainerService(this.context));
-                this.context.Services.Publish<ViewStateService>(viewStateService);
-                this.context.Services.Publish<DesignerView>(view);
-
-                WorkflowAnnotationAdornerService annotationService = new WorkflowAnnotationAdornerService();
-                annotationService.Initialize(this.context, view.scrollViewer);
-                this.context.Services.Publish<AnnotationAdornerService>(annotationService);
-
-                this.context.Services.Subscribe<ModelService>(delegate(ModelService modelService)
-                {
-                    this.modelService = modelService;
-                    if (modelService.Root != null)
-                    {
-                        view.MakeRootDesigner(modelService.Root);
-                    }
-                    view.RestoreDesignerStates();
-                    this.context.Items.Subscribe<Selection>(new SubscribeContextCallback<Selection>(OnItemSelected));
-                });
-            }
-
-            if (helpService != null)
-            {
-                helpService.AddContextAttribute(string.Empty, KeywordForWorkflowDesignerHomePage, HelpKeywordType.F1Keyword); 
-            }
-        }
-
-        internal static string GetF1HelpTypeKeyword(Type type)
-        {
-            Fx.Assert(type != null, "type is null");
-            if (type.IsGenericType)
-            {
-                Type genericTypeDefinition = type.GetGenericTypeDefinition();
-                return genericTypeDefinition.FullName;
-            }
-            return type.FullName;
-        }
-
-        void OnItemSelected(Selection newSelection)
-        {
-            Fx.Assert(newSelection != null, "newSelection is null");
-            IList<ModelItem> newSelectionObjects = newSelection.SelectedObjects as IList<ModelItem>;
-            IList<ModelItem> oldSelectionObjects = oldSelection.SelectedObjects as IList<ModelItem>;
-
-            //Call notifyPropertyChanged for IsPrimarySelection attached property.
-            if (newSelection.PrimarySelection != null && !newSelection.PrimarySelection.Equals(oldSelection.PrimarySelection))
-            {
-                isPrimarySelectionProperty.NotifyPropertyChanged(oldSelection.PrimarySelection);
-                isPrimarySelectionProperty.NotifyPropertyChanged(newSelection.PrimarySelection);
-            }
-            else if (newSelection.PrimarySelection == null)
-            {
-                isPrimarySelectionProperty.NotifyPropertyChanged(oldSelection.PrimarySelection);
-            }
-
-
-            //call NotifyPropertyChanged for IsSelection property on ModelItems that were added or removed from selection.
-            HashSet<ModelItem> selectionChangeSet = new HashSet<ModelItem>(oldSelectionObjects);
-            selectionChangeSet.SymmetricExceptWith(newSelectionObjects);
-            foreach (ModelItem selectionChangeMI in selectionChangeSet)
-            {
-                isSelectionProperty.NotifyPropertyChanged(selectionChangeMI);
-            }
-                        
-            if (helpService != null)
-            {
-                if (oldSelection.PrimarySelection != null)
-                {         
-                    helpService.RemoveContextAttribute(string.Empty, GetF1HelpTypeKeyword(oldSelection.PrimarySelection.ItemType));
-                }
-
-                if (newSelection.PrimarySelection != null)
-                {
-                    helpService.AddContextAttribute(string.Empty, GetF1HelpTypeKeyword(newSelection.PrimarySelection.ItemType), HelpKeywordType.F1Keyword);
-                }
-            }
-            oldSelection = newSelection;
-        }
-
-
-    }
-
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/WorkflowViewService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/WorkflowViewService.cs
deleted file mode 100644 (file)
index 308f808..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Activities.Presentation;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Services;
-    using System.Activities.XamlIntegration;
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Runtime;
-    using System.ServiceModel.Activities;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Media;
-    using System.Collections.Generic;
-
-    [Fx.Tag.XamlVisible(false)]
-    public class WorkflowViewService : ViewService
-    {
-        EditingContext context;
-
-        public WorkflowViewService(EditingContext context)
-        {
-            Fx.Assert(context != null, "The passed in EditingContext is null");
-            this.context = context;
-        }
-        public event EventHandler<ViewCreatedEventArgs> ViewCreated;
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
-            Justification = "Catch all exceptions to prevent crash and always return the error view of the designer with the error message")]
-        [SuppressMessage("Reliability", "Reliability108:IsFatalRule",
-            Justification = "Catch all exceptions to prevent crash and always return the error view of the designer with the error message")]
-        public WorkflowViewElement GetViewElement(ModelItem modelItem)
-        {
-            WorkflowViewElement viewElement = null;
-            string errorString = string.Empty;
-            if (modelItem == null)
-            {
-                return null;
-            }
-
-            try
-            {
-                // try to make one from the type specified in Designer attribute.
-                // reuse existing views that are not currently parented
-                if (modelItem.View != null && ((WorkflowViewElement)modelItem.View).Parent == null)
-                {
-                    viewElement = (WorkflowViewElement)modelItem.View;
-                }
-                else
-                {
-                    viewElement = CreateViewElement(modelItem);
-                }
-
-                // now we successfully got a viewElement, lets initialize it with ModelItem;
-                if (viewElement != null)
-                {
-                    viewElement.Context = this.context;
-                    viewElement.ModelItem = modelItem;
-                    ((IModelTreeItem)modelItem).SetCurrentView(viewElement);
-                    viewElement.DataContext = viewElement;
-
-                    // Generate an event that we created a new view element.  This could be used by 
-                    // the Debugger Service to insert a breakpoint on the view element.
-                    if (this.ViewCreated != null)
-                    {
-                        this.ViewCreated(this, new ViewCreatedEventArgs(viewElement));
-                    }
-                }
-            }
-            // never crash here
-            // always report error to the customer.
-            catch (Exception e)
-            {
-                errorString = e.ToString();
-            }
-            if (viewElement == null || !(string.IsNullOrEmpty(errorString)))
-            {
-                viewElement = GenerateErrorElement(modelItem, errorString);
-            }
-            return viewElement;
-        }
-
-        internal static void ShowErrorInViewElement(WorkflowViewElement errorElement, string windowText, string toolTipText)
-        {
-            Grid errorGrid = new Grid();
-            errorGrid.Background = Brushes.Red;
-            errorGrid.Margin = new Thickness(20.0);
-            TextBlock text = new TextBlock();
-            text.Text = windowText;
-            text.Foreground = SystemColors.WindowBrush;
-            errorGrid.Children.Add(text);
-            errorGrid.ToolTip = toolTipText;
-            errorElement.Content = errorGrid;
-        }
-
-        private WorkflowViewElement GenerateErrorElement(ModelItem modelItem, string errorString)
-        {
-            WorkflowViewElement errorElement = new WorkflowViewElement();
-            string errorText = string.Format(CultureInfo.CurrentCulture, SR.CouldNotGenerateView, modelItem.ItemType.Name);
-            ShowErrorInViewElement(errorElement, errorText, errorString);
-            errorElement.Context = this.context;
-            errorElement.ModelItem = modelItem;
-            ((IModelTreeItem)modelItem).SetCurrentView(errorElement);
-            errorElement.DataContext = errorElement;
-            return errorElement;
-        }
-
-        DesignerAttribute GetDesignerAttribute(Type type)
-        {
-            DesignerAttribute designerAttribute = null;
-            //do not return designers for IValueSerializableExpression (i.e. VisualBasicValue or VisualBasicReference
-            if (!typeof(IValueSerializableExpression).IsAssignableFrom(type))
-            {
-                designerAttribute = GetAttribute<DesignerAttribute>(type);
-            }
-            return designerAttribute;
-        }
-
-        internal static T GetAttribute<T>(Type type) where T : Attribute
-        {
-            T attribute = ExtensibilityAccessor.GetAttribute<T>(type);
-            if (attribute == null && type.IsGenericType)
-            {
-                attribute = ExtensibilityAccessor.GetAttribute<T>(type.GetGenericTypeDefinition());
-            }
-            return attribute;
-        }
-
-        //Returns the designer type based on the DesignerAttribute associated with the passed in type.
-        internal Type GetDesignerType(Type type)
-        {
-            return GetDesignerType(type, false);
-        }
-
-        internal Type GetDesignerType(Type type, bool throwOnFailure)
-        {
-            Type designerType = null;
-            // Try to identify a designer using the DesignerAttribute, either on the type or from MetaDataStore
-            DesignerAttribute designerAttribute = GetDesignerAttribute(type);
-            if (designerAttribute != null && !String.IsNullOrEmpty(designerAttribute.DesignerTypeName))
-            {
-                designerType = Type.GetType(designerAttribute.DesignerTypeName, throwOnFailure);
-
-                //if we have generic activity, check if there is a designer defined at type definition i.e. Assign<T>,
-                //rather then using a default one (which happens to be ActivityDesigner)
-                if (type.IsGenericType && Type.Equals(designerType, typeof(ActivityDesigner)))
-                {
-                    Type genericType = type.GetGenericTypeDefinition();
-                    DesignerAttribute genericDesignerAttribute =
-                        TypeDescriptor.GetAttributes(genericType)[typeof(DesignerAttribute)] as DesignerAttribute;
-                    designerType =
-                        (null == genericDesignerAttribute ?
-                        designerType : Type.GetType(genericDesignerAttribute.DesignerTypeName, throwOnFailure));
-                }
-            }
-            return designerType;
-        }
-
-        protected WorkflowViewElement CreateViewElement(ModelItem modelItem)
-        {
-            Fx.Assert(modelItem != null, "The passed in ModelItem is null");
-            WorkflowViewElement viewElement = null;
-
-            Type designerType = GetDesignerType(modelItem.ItemType, true);
-
-            if (designerType != null && typeof(WorkflowViewElement).IsAssignableFrom(designerType))
-            {
-                viewElement = (WorkflowViewElement)Activator.CreateInstance(designerType);
-            }
-            return viewElement;
-        }
-
-        internal WorkflowViewElement CreateDetachedViewElement(ModelItem modelItem)
-        {
-            WorkflowViewElement viewElement = CreateViewElement(modelItem);
-
-            // now we successfully got a viewElement, lets initialize it with ModelItem;
-            if (viewElement != null)
-            {
-                viewElement.Context = this.context;
-                viewElement.ModelItem = modelItem;
-                viewElement.DataContext = viewElement;
-            }
-
-            return viewElement;
-        }
-
-        public override ModelItem GetModel(DependencyObject view)
-        {
-            if (view == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("view"));
-            }
-
-            if (view is WorkflowViewElement)
-            {
-                return ((WorkflowViewElement)view).ModelItem;
-            }
-
-            Fx.Assert("we should know if somebody is trying to get model item from thing other than WorkflowViewElement");
-            return null;
-        }
-
-        public override DependencyObject GetView(ModelItem model)
-        {
-            return GetViewElement(model);
-        }
-
-        internal bool ShouldAppearOnBreadCrumb(ModelItem modelItem, bool checkIfCanBeMadeRoot)
-        {
-            bool shouldAppearOnBreadCrumb = false;
-            if (modelItem != null)
-            {
-                Type designerType = this.GetDesignerType(modelItem.ItemType);
-                if (null != designerType)
-                {
-                    if (checkIfCanBeMadeRoot)
-                    {
-                        ActivityDesignerOptionsAttribute options = WorkflowViewService.GetAttribute<ActivityDesignerOptionsAttribute>(modelItem.ItemType);
-                        shouldAppearOnBreadCrumb = (typeof(WorkflowViewElement).IsAssignableFrom(designerType) &&
-                                                   (typeof(ActivityDesigner) != designerType || ActivityDelegateUtilities.HasActivityDelegate(modelItem.ItemType)) &&
-                                                   typeof(WorkflowService) != designerType &&
-                                                   (options == null || options.AllowDrillIn));
-                    }
-                    else
-                    {
-                        shouldAppearOnBreadCrumb = typeof(WorkflowViewElement).IsAssignableFrom(designerType);
-                    }
-                }
-            }
-            return shouldAppearOnBreadCrumb;
-
-        }   
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/WorkflowViewStateService.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/WorkflowViewStateService.cs
deleted file mode 100644 (file)
index bd9935c..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.View
-{
-    using System.Collections.Generic;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Xaml;
-    using System.Activities.Presentation.Model;
-    using System.Runtime;
-
-    //ViewState is stored as a Dictionary<string, object> on the CFx object. 
-    //ModelItem is passed in StoreViewState to get a handle to the CFx object.
-    [Fx.Tag.XamlVisible(false)]
-    public class WorkflowViewStateService : ViewStateService
-    {
-        EditingContext context;
-
-        public override event ViewStateChangedEventHandler ViewStateChanged;
-
-        public override event ViewStateChangedEventHandler UndoableViewStateChanged;
-
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
-        public static readonly AttachableMemberIdentifier ViewStateName = new AttachableMemberIdentifier(typeof(WorkflowViewStateService), "ViewState");
-        
-        UndoEngine UndoEngine
-        {
-            get
-            {
-                return this.context.Services.GetService<UndoEngine>();
-            }
-        }
-
-        public WorkflowViewStateService(EditingContext context)
-        {
-            this.context = context;
-        }
-
-        public static Dictionary<string, object> GetViewState(object instance)
-        {
-            if (instance == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("instance"));
-            }
-            Dictionary<string, object> viewState;
-            AttachablePropertyServices.TryGetProperty(instance, ViewStateName, out viewState);
-            return viewState;
-        }
-
-        public static void SetViewState(object instance, Dictionary<string, object> value)
-        {
-            if (instance == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("instance"));
-            }
-            AttachablePropertyServices.SetProperty(instance, ViewStateName, value);
-        }
-
-
-        public override object RetrieveViewState(ModelItem modelItem, string key)
-        {
-            if (modelItem == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("modelItem"));
-            }
-            if (key == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("key"));
-            }
-
-            object viewStateObj = null;
-            Dictionary<string, object> viewState = WorkflowViewStateService.GetViewState(modelItem.GetCurrentValue());
-            if (viewState != null)
-            {
-                viewState.TryGetValue(key, out viewStateObj);
-            }
-            return viewStateObj;
-        }
-
-        public override void StoreViewState(ModelItem modelItem, string key, object value)
-        {
-            if (modelItem == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("modelItem"));
-            }
-            if (key == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("key"));
-            }
-          
-            object oldValue = null;
-            Dictionary<string, object> viewState = WorkflowViewStateService.GetViewState(modelItem.GetCurrentValue());
-            if (viewState == null)
-            {
-                viewState = new Dictionary<string, object>();
-                WorkflowViewStateService.SetViewState(modelItem.GetCurrentValue(), viewState);
-            }
-            viewState.TryGetValue(key, out oldValue);
-            if (value != null)
-            {
-                viewState[key] = value;
-            }
-            else
-            {
-                RemoveViewState(modelItem, key);
-            }
-            if (this.ViewStateChanged != null && value != oldValue)
-            {
-                this.ViewStateChanged(this, new ViewStateChangedEventArgs(modelItem, key, value, oldValue));
-            }
-        }
-
-        public override bool RemoveViewState(ModelItem modelItem, string key)
-        {
-            if (modelItem == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("modelItem"));
-            }
-            if (key == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("key"));
-            }
-            bool itemRemoved = false;
-            Dictionary<string, object> viewState = WorkflowViewStateService.GetViewState(modelItem.GetCurrentValue());
-            if (viewState != null && key != null && viewState.ContainsKey(key))
-            {
-                itemRemoved = viewState.Remove(key);
-                if (viewState.Keys.Count == 0)
-                {
-                    AttachablePropertyServices.RemoveProperty(modelItem.GetCurrentValue(), ViewStateName);
-                }
-            }
-            return itemRemoved;
-        }
-
-        public override Dictionary<string, object> RetrieveAllViewState(ModelItem modelItem)
-        {
-            if (modelItem == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("modelItem"));
-            }
-            return WorkflowViewStateService.GetViewState(modelItem.GetCurrentValue());
-        }
-    
-
-        public override void StoreViewStateWithUndo(ModelItem modelItem, string key, object value)
-        {
-            object oldValue = RetrieveViewState(modelItem, key);
-            ViewStateChange vsChange = new ViewStateChange(this)
-                                        {
-                                            Item = modelItem,
-                                            Key = key,
-                                            OldValue = oldValue,
-                                            NewValue = value,
-                                        };
-            ModelTreeManager modelTreeManager = this.context.Services.GetService<ModelTreeManager>();
-            if (modelTreeManager != null)
-            {
-                modelTreeManager.AddToCurrentEditingScope(vsChange);
-            }
-        }
-
-
-        void RaiseUndoableViewStateChangedEvent(ModelItem modelItem, string key, object newValue, object oldValue)
-        {
-            if (this.UndoableViewStateChanged != null)
-            {
-                this.UndoableViewStateChanged(this, new ViewStateChangedEventArgs(modelItem, key, newValue, oldValue));
-            }
-        }
-
-
-        internal class ViewStateChange : Change
-        {
-            protected WorkflowViewStateService viewStateService;
-
-            public ModelItem Item { get; set; }
-            public string Key { get; set; }
-            public object OldValue { get; set; }
-            public object NewValue { get; set; }
-
-            public ViewStateChange(WorkflowViewStateService viewStateService) 
-            {
-                this.viewStateService = viewStateService;
-            }
-
-
-            public override string Description
-            {
-                get { return SR.ViewStateUndoUnitDescription; }
-            }
-
-            public override bool Apply()
-            {
-                viewStateService.StoreViewState(Item, Key, NewValue);
-                this.viewStateService.RaiseUndoableViewStateChangedEvent(Item, Key, NewValue, OldValue);
-                return true;
-            }
-
-            public override Change GetInverse()
-            {
-                return new ViewStateChange(this.viewStateService)
-                    {
-                        Item = this.Item,
-                        Key = this.Key,
-                        OldValue = this.NewValue,
-                        NewValue = this.OldValue
-                    };
-            }
-        }
-
-
-    }
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ViewModel.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ViewModel.cs
deleted file mode 100644 (file)
index f615960..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.ComponentModel;
-
-    internal abstract class ViewModel : INotifyPropertyChanged
-    {
-        public event PropertyChangedEventHandler PropertyChanged;
-
-        protected void NotifyPropertyChanged(string propertyName)
-        {
-            if (this.PropertyChanged != null)
-            {
-                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ViewState/ViewStateData.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ViewState/ViewStateData.cs
deleted file mode 100644 (file)
index 9dcd0c4..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.ViewState
-{
-    /// <summary>
-    /// This class acts as a surrogate for holding view state properties (VirtualizedContainerService.HintSize and WorkflowViewStateService.ViewState)
-    /// as attached properties when view state separation is done.
-    /// </summary>
-    public sealed class ViewStateData
-    {
-        /// <summary>
-        /// Creates a new instance of ViewStateData
-        /// </summary>
-        public ViewStateData() 
-        { 
-        }
-
-        /// <summary>
-        /// Gets or sets an identifier that associates an object of this class
-        /// with an activity that has matching WorkflowViewState.RefId value.
-        /// </summary>
-        public string Id { get; set; }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ViewState/ViewStateManager.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ViewState/ViewStateManager.cs
deleted file mode 100644 (file)
index 947e91e..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.ViewState
-{
-    using System.Collections.Generic;
-    using System.Collections.ObjectModel;
-    using System.Windows.Markup;
-
-    /// <summary>
-    /// This class is used to hold ViewStateData for all activities in the workflow as an attached
-    /// property on the root of the xaml document.
-    /// </summary>
-    [ContentProperty("ViewStateData")]
-    public sealed class ViewStateManager
-    {
-        Collection<ViewStateData> viewStateData;
-
-        /// <summary>
-        /// Creates a new instance of ViewStateManager
-        /// </summary>
-        public ViewStateManager()
-        {
-        }
-
-        /// <summary>
-        /// Gets a collection of ViewStateData for all activities in the workflow
-        /// </summary>
-        public Collection<ViewStateData> ViewStateData
-        {
-            get
-            {
-                if (this.viewStateData == null)
-                {
-                    this.viewStateData = new Collection<ViewStateData>();
-                }
-                return this.viewStateData;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ViewState/WorkflowViewState.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ViewState/WorkflowViewState.cs
deleted file mode 100644 (file)
index 9e02f9b..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.ViewState
-{
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime;
-    using System.Xaml;
-
-    /// <summary>
-    /// Class defining ViewStateManager and ViewStateId attached properties.
-    /// </summary>
-    public static class WorkflowViewState
-    {
-        /// <summary>
-        /// Attachable property for ViewStateManager
-        /// </summary>
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes, Justification = "XAML attached property declaration.")]
-        public static readonly AttachableMemberIdentifier ViewStateManagerProperty = new AttachableMemberIdentifier(typeof(WorkflowViewState), "ViewStateManager");
-
-        /// <summary>
-        /// Attachable property for IdRef
-        /// </summary>
-        [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes, Justification = "XAML attached property declaration.")]
-        public static readonly AttachableMemberIdentifier IdRefProperty = new AttachableMemberIdentifier(typeof(WorkflowViewState), "IdRef");
-
-        /// <summary>
-        /// Set ViewStateManager as an attached property on an object. This method is for XAML serialization purpose only and is not expected to be used by developers.
-        /// </summary>
-        /// <param name="instance">Instance object to attach ViewStateManager property on</param>
-        /// <param name="viewStateManager">ViewStateManager object to attach</param>
-        public static void SetViewStateManager(object instance, ViewStateManager viewStateManager)
-        {
-            AttachablePropertyServices.SetProperty(instance, ViewStateManagerProperty, viewStateManager);
-        }
-
-        /// <summary>
-        /// Get ViewStateManager attached property value from an object if set
-        /// </summary>
-        /// <param name="instance">Instance object to retrieve ViewStateManager attached property from</param>
-        /// <returns>ViewStateManager object if set; null otherise</returns>
-        public static ViewStateManager GetViewStateManager(object instance)
-        {
-            ViewStateManager viewStateManager;
-            if (AttachablePropertyServices.TryGetProperty(instance, ViewStateManagerProperty, out viewStateManager))
-            {
-                return viewStateManager;
-            }
-
-            return null;
-        }
-
-        /// <summary>
-        /// Set IdRef as an attached property on an object. This method is for XAML serialization purpose only and is not expected to be used by developers.
-        /// </summary>
-        /// <param name="instance">Instance object to attach IdRef property on</param>
-        /// <param name="idRef">refId value to attach</param>
-        public static void SetIdRef(object instance, string idRef)
-        {
-            AttachablePropertyServices.SetProperty(instance, IdRefProperty, idRef);
-        }
-
-        /// <summary>
-        /// Get RefId attached property value from an object if set
-        /// </summary>
-        /// <param name="instance">Instance object to retrieve RefId attached property from</param>
-        /// <returns>RefId value if set; null otherise</returns>
-        public static string GetIdRef(object instance)
-        {
-            string idRef;
-            if (AttachablePropertyServices.TryGetProperty(instance, IdRefProperty, out idRef))
-            {
-                return idRef;
-            }
-
-            return null;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ViewStateAttachedPropertyFeature.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/ViewStateAttachedPropertyFeature.cs
deleted file mode 100644 (file)
index e235ff7..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.View;
-    using System.Collections.Generic;
-    using System.Runtime;
-    abstract class ViewStateAttachedPropertyFeature : Feature
-    {
-        Type modelType;
-        ViewStateService viewStateService;
-        AttachedPropertiesService attachedPropertiesService;
-        Dictionary<string, AttachedProperty> attachedProperties = new Dictionary<string, AttachedProperty>();
-
-        public sealed override void Initialize(EditingContext context, Type modelType)
-        {
-            this.modelType = modelType;
-
-            context.Services.Subscribe<ViewStateService>(delegate(ViewStateService viewStateService)
-            {
-                this.viewStateService = viewStateService;
-                viewStateService.ViewStateChanged += this.OnViewStateChanged;
-                if (this.attachedPropertiesService != null)
-                {
-                    RegisterAttachedProperties();
-                }
-            });
-            context.Services.Subscribe<AttachedPropertiesService>(delegate(AttachedPropertiesService attachedPropertiesService)
-            {
-                this.attachedPropertiesService = attachedPropertiesService;
-                if (this.viewStateService != null)
-                {
-                    RegisterAttachedProperties();
-                }
-            });
-        }
-
-        protected abstract IEnumerable<AttachedPropertyInfo> AttachedProperties
-        {
-            get;
-        }
-
-        internal void RegisterAttachedProperty<T>(string propertyName, bool isBrowsable, bool isVisibleToModelItem, T defaultValue)
-        {
-            AttachedProperty<T> attachedProperty = new AttachedProperty<T>
-            {
-                IsBrowsable = isBrowsable,
-                IsVisibleToModelItem = isVisibleToModelItem,
-                Name = propertyName,
-                OwnerType = modelType,
-                Getter = (modelItem) =>
-                {
-                    T result = (T)viewStateService.RetrieveViewState(modelItem, propertyName);
-                    return result == null ? defaultValue : result;
-                },
-                Setter = (modelItem, value) =>
-                {
-                    if (value == null || value.Equals(defaultValue))
-                    {
-                        viewStateService.StoreViewStateWithUndo(modelItem, propertyName, null);
-                    }
-                    else
-                    {
-                        viewStateService.StoreViewStateWithUndo(modelItem, propertyName, value);
-                    }
-                }
-            };
-            attachedPropertiesService.AddProperty(attachedProperty);
-            attachedProperties.Add(propertyName, attachedProperty);
-        }
-
-        void OnViewStateChanged(object sender, ViewStateChangedEventArgs e)
-        {
-            if (attachedProperties.ContainsKey(e.Key))
-            {
-                // Checking is required to avoid infinite loop of ViewState -> AttachedProperty -> ...
-                if ((e.NewValue == null && e.OldValue != null) || !e.NewValue.Equals(e.OldValue))
-                {
-                    attachedProperties[e.Key].SetValue(e.ParentModelItem, e.NewValue);
-                }
-            }
-        }
-
-        void RegisterAttachedProperties()
-        {
-            foreach (AttachedPropertyInfo attachedPropertyInfo in this.AttachedProperties)
-            {
-                attachedPropertyInfo.Register(this);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/VisualBasicExpressionMorphHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/VisualBasicExpressionMorphHelper.cs
deleted file mode 100644 (file)
index d29bbc0..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Activities.ExpressionParser;
-    using System.Activities.Presentation.Expressions;
-    using System.Activities.Presentation.View;
-    using System.Runtime;
-    using Microsoft.VisualBasic.Activities;
-
-    class VisualBasicExpressionMorphHelper : ExpressionMorphHelper
-    {
-        public override bool TryInferReturnType(ActivityWithResult expression, EditingContext context, out Type returnType)
-        {
-            bool succeeded = false;
-            Fx.Assert(expression.GetType().GetGenericTypeDefinition() == typeof(VisualBasicValue<>) ||
-                expression.GetType().GetGenericTypeDefinition() == typeof(VisualBasicReference<>), "VisualBasicExpressionMorphHelper should only apply to VB expression.");
-                            
-            SourceExpressionException compileError;
-            VisualBasicSettings settings;
-            if (ExpressionHelper.IsGenericLocationExpressionType(expression))
-            {
-                VisualBasicDesignerHelper.RecompileVisualBasicReference(
-                        expression,
-                        out returnType,
-                        out compileError,
-                        out settings);
-            }
-            else
-            {
-                VisualBasicDesignerHelper.RecompileVisualBasicValue(
-                     expression,
-                     out returnType,
-                     out compileError,
-                     out settings);
-            }
-            if (compileError == null)
-            {
-                succeeded = true;                    
-                if (settings != null)
-                {
-                    //merge with import designer
-                    foreach (VisualBasicImportReference reference in settings.ImportReferences)
-                    {
-                        ImportDesigner.AddImport(reference.Import, context);
-                    }
-                }
-            }
-            return succeeded;
-        }
-        
-        public override bool TryMorphExpression(ActivityWithResult expression, bool isLocationExpression, Type newType, 
-            EditingContext context, out ActivityWithResult newExpression)
-        {
-            string expressionText = ExpressionHelper.GetExpressionString(expression);            
-            newExpression = VisualBasicEditor.CreateExpressionFromString(newType, expressionText, isLocationExpression, new ParserContext());
-            return true;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowDesigner.Debugger.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowDesigner.Debugger.cs
deleted file mode 100644 (file)
index de7ac27..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Activities.Debugger.Symbol;
-    using System.Activities.Presentation.Debug;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Xaml;
-    using System.Runtime;
-    using System.Xaml;
-
-    public partial class WorkflowDesigner
-    {
-        public IDesignerDebugView DebugManagerView
-        {
-            get
-            {
-                return this.DebuggerService;
-            }
-        }
-
-        DebuggerService DebuggerService
-        {
-            get
-            {
-                if (this.debuggerService == null)
-                {
-                    this.debuggerService = new DebuggerService(this.context);
-                    this.context.Services.Publish<IDesignerDebugView>(this.debuggerService);
-                }
-                return this.debuggerService;
-            }
-        }
-
-        ModelSearchServiceImpl ModelSearchService
-        {
-            get;
-            set;
-        }
-
-        internal ObjectToSourceLocationMapping ObjectToSourceLocationMapping
-        {
-            get
-            {
-                if (this.objectToSourceLocationMapping == null)
-                {
-                    this.objectToSourceLocationMapping = new ObjectToSourceLocationMapping(this.ModelSearchService);
-                }
-                return this.objectToSourceLocationMapping;
-            }
-        }
-
-        // Get the attached workflow symbol and remove it from the root.
-        WorkflowSymbol GetAttachedWorkflowSymbol()
-        {
-            object rootInstance = this.GetRootInstance();
-            WorkflowSymbol wfSymbol = null;
-
-            if (rootInstance != null)
-            {
-                Activity documentRootElement = GetRootWorkflowElement(rootInstance);
-                if (documentRootElement != null)
-                {
-                    string symbolString;
-                    if (AttachablePropertyServices.TryGetProperty<string>(documentRootElement, DebugSymbol.SymbolName, out symbolString))
-                    {
-                        try
-                        {
-                            wfSymbol = WorkflowSymbol.Decode(symbolString);
-                            // Change the name to the currently loaded file.
-                            wfSymbol.FileName = this.Context.Items.GetValue<WorkflowFileItem>().LoadedFile;
-                        }
-                        catch (Exception ex)
-                        {
-                            if (Fx.IsFatal(ex))
-                            {
-                                throw;
-                            }
-                        }
-                        finally
-                        {
-                            AttachablePropertyServices.RemoveProperty(documentRootElement, DebugSymbol.SymbolName);
-                        }
-                    }
-                }
-            }
-            return wfSymbol;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowDesigner.Helpers.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowDesigner.Helpers.cs
deleted file mode 100644 (file)
index a0e40a3..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Activities.Presentation.Documents;
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Internal.PropertyEditing.Resources;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Validation;
-    using System.Activities.Presentation.View;
-    using System.ComponentModel;
-    using System.Runtime;
-    using System.Runtime.Versioning;
-    using System.Windows;
-
-    public partial class WorkflowDesigner
-    {
-        static internal FrameworkName GetTargetFramework(EditingContext context)
-        {
-            if (context != null)
-            {
-                DesignerConfigurationService designerConfigurationService = context.Services.GetService<DesignerConfigurationService>();
-                if (designerConfigurationService != null)
-                {
-                    return designerConfigurationService.TargetFrameworkName;
-                }
-            }
-
-            return DesignerConfigurationService.DefaultTargetFrameworkName;
-        }
-
-
-        string GetLocalAssemblyName()
-        {
-            AssemblyContextControlItem assemblyItem = this.Context.Items.GetValue<AssemblyContextControlItem>();
-            return assemblyItem != null && assemblyItem.LocalAssemblyName != null ? assemblyItem.LocalAssemblyName.Name : null;
-        }
-
-
-        ViewManager GetViewManager(ModelItem modelItem)
-        {
-            Fx.Assert(modelItem != null, "modelItem cannot be null");
-            ViewManager viewManager = null;
-            // First we look for a ViewManagerAttribute. for example a ServiceContractRoot tag, could use
-            // use its own view manager if it wanted to .
-            ViewManagerAttribute viewManagerAttribute = TypeDescriptor.GetAttributes(modelItem.ItemType)[typeof(ViewManagerAttribute)] as ViewManagerAttribute;
-            if (viewManagerAttribute != null && viewManagerAttribute.ViewManagerType != null)
-            {
-                viewManager = (ViewManager)Activator.CreateInstance(viewManagerAttribute.ViewManagerType);
-
-            }
-            // If no viewmanager attribute is found we default to the workflowviewmanager
-            if (viewManager == null)
-            {
-                viewManager = new WorkflowViewManager();
-            }
-            viewManager.Initialize(this.context);
-            return viewManager;
-        }
-
-
-        object GetRootInstance()
-        {
-            return this.modelTreeManager.Root.GetCurrentValue();
-        }
-
-
-        void InitializePropertyInspectorCommandHandling()
-        {
-        }
-
-        void InitializePropertyInspectorResources()
-        {
-            this.propertyInspector.Resources.MergedDictionaries.Add(PropertyInspectorResources.GetResources());
-        }
-
-        //This is to notify VS that the WF Designer is in Modal state (eg. when a modal dialog is shown).
-        void ComponentDispatcher_EnterThreadModal(object sender, EventArgs e)
-        {
-            IModalService modalService = Context.Services.GetService<IModalService>();
-            if (modalService != null)
-            {
-                modalService.SetModalState(true);
-            }
-        }
-
-        void ComponentDispatcher_LeaveThreadModal(object sender, EventArgs e)
-        {
-            IModalService modalService = Context.Services.GetService<IModalService>();
-            if (modalService != null)
-            {
-                modalService.SetModalState(false);
-            }
-        }
-
-        void OnUndoCompleted(object sender, UndoUnitEventArgs e)
-        {
-            // If an action had caused the errorview to be shown, and undo was executed after that 
-            // try to put back the viewmanagerview back as the rootview of the designer.
-            // may be the undo might help recover from the problem.
-            if (!this.view.Children.Contains((UIElement)this.viewManager.View))
-            {
-                this.view.Children.Clear();
-                this.view.Children.Add((UIElement)this.viewManager.View);
-
-                if (this.outlineView != null)
-                {
-                    this.outlineView.Children.Clear();
-                    this.AddOutlineView();
-                }
-
-                // Clear out the error condition
-                ErrorItem errorItem = this.context.Items.GetValue<ErrorItem>();
-                errorItem.Message = null;
-                errorItem.Details = null;
-            }
-        }
-
-
-        void OnViewStateChanged(object sender, ViewStateChangedEventArgs e)
-        {
-            NotifyModelChanged();
-        }
-
-        void OnEditingScopeCompleted(object sender, EditingScopeEventArgs e)
-        {
-            if (e.EditingScope.HasEffectiveChanges)
-            {
-                NotifyModelChanged();
-
-                // The undo unit of an ImmediateEditingScope is added into undo engine in ImmediateEditingScope.Complete
-                // so we only handle non ImmediateEditingScope here
-                if (!this.modelTreeManager.RedoUndoInProgress
-                    && !(e.EditingScope is ImmediateEditingScope)
-                    && undoEngine != null
-                    && !e.EditingScope.SuppressUndo)
-                {
-                    undoEngine.AddUndoUnit(new EditingScopeUndoUnit(this.Context, this.modelTreeManager, e.EditingScope));
-                }
-            }
-        }
-
-
-        void NotifyModelChanged()   // Notify text is going to changed
-        {
-            IDocumentPersistenceService documentPersistenceService = this.Context.Services.GetService<IDocumentPersistenceService>();
-            if (documentPersistenceService != null)
-            {
-                documentPersistenceService.OnModelChanged(this.modelTreeManager.Root.GetCurrentValue());
-            }
-            else
-            {
-                this.isModelChanged = true;
-                if (this.ModelChanged != null)
-                {
-                    this.ModelChanged.Invoke(this, null);
-                }
-            }
-        }
-
-
-        void OnReadonlyStateChanged(ReadOnlyState state)
-        {
-            if (null != this.propertyInspector)
-            {
-                this.propertyInspector.IsReadOnly = state.IsReadOnly;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowDesigner.SerializationHelpers.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowDesigner.SerializationHelpers.cs
deleted file mode 100644 (file)
index 88018fb..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Activities.Debugger;
-    using System.Activities.Debugger.Symbol;
-    using System.Activities.Presentation.View;
-    using System.Activities.Presentation.Xaml;
-    using System.Activities.XamlIntegration;
-    using System.Collections.Generic;
-    using System.Diagnostics.CodeAnalysis;
-    using System.IO;
-    using System.Runtime;
-    using System.Runtime.Versioning;
-    using System.Xaml;
-    using System.Xml;
-    using Microsoft.Activities.Presentation.Xaml;
-    
-    public partial class WorkflowDesigner : IWorkflowDesignerXamlHelperExecutionContext
-    {
-        FrameworkName IWorkflowDesignerXamlHelperExecutionContext.FrameworkName
-        {
-            get { return WorkflowDesigner.GetTargetFramework(this.context); }
-        }
-
-        WorkflowDesignerXamlSchemaContext IWorkflowDesignerXamlHelperExecutionContext.XamlSchemaContext
-        {
-            get { return this.XamlSchemaContext; }
-        }
-
-        ViewStateIdManager IWorkflowDesignerXamlHelperExecutionContext.IdManager
-        {
-            get { return this.idManager; }
-        }
-
-        WorkflowSymbol IWorkflowDesignerXamlHelperExecutionContext.LastWorkflowSymbol
-        {
-            get { return this.lastWorkflowSymbol; }
-            set { this.lastWorkflowSymbol = value; }
-        }
-
-        void IWorkflowDesignerXamlHelperExecutionContext.OnSerializationCompleted(Dictionary<object, object> sourceLocationObjectToModelItemObjectMapping)
-        {
-            this.ObjectToSourceLocationMapping.SourceLocationObjectToModelItemObjectMapping = sourceLocationObjectToModelItemObjectMapping;
-            this.ObjectReferenceService.OnSaveCompleted();
-        }
-
-        void IWorkflowDesignerXamlHelperExecutionContext.OnBeforeDeserialize()
-        {
-            this.ObjectToSourceLocationMapping.Clear();
-        }
-
-        void IWorkflowDesignerXamlHelperExecutionContext.OnSourceLocationFound(object target, SourceLocation sourceLocationFound)
-        {
-            this.ObjectToSourceLocationMapping.UpdateMap(target, sourceLocationFound);
-        }
-
-        void IWorkflowDesignerXamlHelperExecutionContext.OnAfterDeserialize(Dictionary<string, SourceLocation> viewStateDataSourceLocationMapping)
-        {
-            this.ObjectToSourceLocationMapping.ViewStateDataSourceLocationMapping = viewStateDataSourceLocationMapping;
-        }
-
-        string IWorkflowDesignerXamlHelperExecutionContext.LocalAssemblyName
-        {
-            get { return this.GetLocalAssemblyName(); }
-        }
-
-        WorkflowDesignerXamlSchemaContext XamlSchemaContext
-        {
-            get
-            {
-                if (this.workflowDesignerXamlSchemaContext == null)
-                {
-                    this.workflowDesignerXamlSchemaContext = new WorkflowDesignerXamlSchemaContext(this.GetLocalAssemblyName(), this.Context);
-                }
-
-                return this.workflowDesignerXamlSchemaContext;
-            }
-        }
-
-        internal object DeserializeString(string text)
-        {
-            return new WorkflowDesignerXamlHelper(this).DeserializeString(text);
-        }
-
-        internal object DeserializeString(string text, out IList<XamlLoadErrorInfo> loadErrors, out Dictionary<object, SourceLocation> sourceLocations)
-        {
-            return new WorkflowDesignerXamlHelper(this).DeserializeString(text, out loadErrors, out sourceLocations);
-        }
-
-        internal string SerializeToString(object obj, string fileName = null)
-        {
-            return new WorkflowDesignerXamlHelper(this).SerializeToString(obj, fileName);
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.DoNotCatchGeneralExceptionTypes,
-            Justification = "Serializer might throw if it fails to serialize. Catching all exceptions to avoid VS Crash.")]
-        [SuppressMessage("Reliability", "Reliability108",
-            Justification = "Serializer might throw if it fails to serialize. Catching all exceptions to avoid VS crash.")]
-        void WriteModelToText(string fileName)
-        {
-            this.perfEventProvider.WorkflowDesignerSerializeStart();
-            object rootModelObject = this.modelTreeManager.Root.GetCurrentValue();
-            // if we are serializing a activity schema type, remove the namespace in the Name property.
-            ActivityBuilder activityBuilderType = rootModelObject as ActivityBuilder;
-
-            // now try to serialize
-            try
-            {
-                string newText = SerializeToString(rootModelObject, fileName);
-                if (string.IsNullOrEmpty(this.Text) ||
-                    (this.isModelChanged && !string.Equals(newText, this.Text, StringComparison.Ordinal)))
-                {
-                    this.Text = newText;
-                    if (this.TextChanged != null)
-                    {
-                        this.TextChanged.Invoke(this, null);
-                    }
-                }
-                this.isModelChanged = false;
-            }
-            catch (Exception e)
-            {
-                this.Context.Items.SetValue(new ErrorItem() { Message = e.Message, Details = e.ToString() });
-            }
-            this.perfEventProvider.WorkflowDesignerSerializeEnd();
-        }
-
-        void RaiseLoadError(Exception e)
-        {
-            if (this.xamlLoadErrorService != null)
-            {
-                XamlLoadErrorInfo errorInfo = null;
-                XamlException xamlEx = e as XamlException;
-                if (xamlEx != null)
-                {
-                    errorInfo = new XamlLoadErrorInfo(xamlEx.Message, xamlEx.LineNumber, xamlEx.LinePosition);
-                }
-                else
-                {
-                    XmlException xmlEx = e as XmlException;
-                    if (xmlEx != null)
-                    {
-                        errorInfo = new XamlLoadErrorInfo(xmlEx.Message, xmlEx.LineNumber, xmlEx.LinePosition);
-                    }
-                }
-                if (errorInfo != null)
-                {
-                    var errors = new XamlLoadErrorInfo[] { errorInfo };
-                    xamlLoadErrorService.ShowXamlLoadErrors(errors);
-                }
-            }
-        }
-
-        void RaiseLoadErrors(IList<XamlLoadErrorInfo> loadErrors)
-        {
-            if (this.xamlLoadErrorService != null)
-            {
-                this.xamlLoadErrorService.ShowXamlLoadErrors(loadErrors);
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowDesigner.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowDesigner.cs
deleted file mode 100644 (file)
index 86bdde2..0000000
+++ /dev/null
@@ -1,670 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Activities.Debugger;
-    using System.Activities.Debugger.Symbol;
-    using System.Activities.Presentation.Debug;
-    using System.Activities.Presentation.Documents;
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Activities.Presentation.Internal.PropertyEditing.Metadata;
-    using System.Activities.Presentation.Metadata;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Services;
-    using System.Activities.Presentation.Sqm;
-    using System.Activities.Presentation.Validation;
-    using System.Activities.Presentation.View;
-    using System.Activities.Presentation.View.TreeView;
-    using System.Activities.Presentation.Xaml;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.IO;
-    using System.Runtime;
-    using System.Runtime.Versioning;
-    using System.Security;
-    using System.Security.Policy;
-    using System.Text;
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Windows.Input;
-    using System.Windows.Interop;
-    using System.Windows.Threading;
-    using System.Xml;
-    using Microsoft.Activities.Presentation;
-    using Microsoft.Activities.Presentation.Xaml;
-
-    // This is the workflow designer context class.
-    // it provides two views the primary workflow view in View property and the property browser view in the
-    // propertyInspectorView property.
-    // Load takes a objects instance or Xaml ( in the future) to load the designer from
-    public partial class WorkflowDesigner
-    {
-        EditingContext context;
-        ModelTreeManager modelTreeManager;
-        Grid view;
-        Grid outlineView;
-        PropertyInspector propertyInspector;
-        string text;
-        ViewStateIdManager idManager;
-        string loadedFile;
-        DebuggerService debuggerService;
-        UndoEngine undoEngine;
-        ViewManager viewManager;
-        ValidationService validationService;
-        ObjectReferenceService objectReferenceService;
-        DesignerPerfEventProvider perfEventProvider;
-        bool isLoaded = false;
-        bool isModelChanged = false;
-
-        IXamlLoadErrorService xamlLoadErrorService;
-        WorkflowDesignerXamlSchemaContext workflowDesignerXamlSchemaContext;
-
-        public event TextChangedEventHandler TextChanged;
-        public event EventHandler ModelChanged;
-        WorkflowSymbol lastWorkflowSymbol;
-        ObjectToSourceLocationMapping objectToSourceLocationMapping;
-
-        internal class PreviewLoadEventArgs : EventArgs
-        {
-            object instance;
-            EditingContext context;
-
-            public PreviewLoadEventArgs(object instance, EditingContext context)
-            {
-                this.instance = instance;
-                this.context = context;
-            }
-
-            public object Instance
-            {
-                get { return this.instance; }
-            }
-
-            public EditingContext Context
-            {
-                get { return this.context; }
-            }
-        }
-        internal event EventHandler<PreviewLoadEventArgs> PreviewLoad;
-
-        [SuppressMessage(FxCop.Category.Performance, FxCop.Rule.InitializeReferenceTypeStaticFieldsInline,
-            Justification = "The static constructor is required to initialize the PropertyInspector metadata.")]
-        static WorkflowDesigner()
-        {
-            InitializePropertyInspectorMetadata();
-            DesignerMetadata metaData = new DesignerMetadata();
-            metaData.Register();
-        }
-
-        public WorkflowDesigner()
-        {
-            // create our perf trace provider first
-            this.perfEventProvider = new DesignerPerfEventProvider();            
-            this.idManager = new ViewStateIdManager();
-            this.context = new EditingContext();
-            this.ModelSearchService = new ModelSearchServiceImpl(this);
-            this.context.Items.SetValue(new ReadOnlyState { IsReadOnly = false });
-            this.view = new Grid();
-            this.view.Focusable = false;
-            
-            //add the resource dictionary to application resource so every component could reference it
-            if (Application.Current == null)
-            {
-                //create an application if it doesn't exist, make sure it will not shutdown after windows being shut down
-                Application app = new Application();
-                app.ShutdownMode = ShutdownMode.OnExplicitShutdown;
-            }
-            Fx.Assert(Application.Current != null, "Application and resources must be there");
-            Application.Current.Resources.MergedDictionaries.Add(WorkflowDesignerColors.FontAndColorResources);
-            Application.Current.Resources.MergedDictionaries.Add(WorkflowDesignerIcons.IconResourceDictionary);
-            AttachedPropertiesService propertiesService = new AttachedPropertiesService();
-            this.context.Services.Publish(typeof(AttachedPropertiesService), propertiesService);
-
-            undoEngine = new UndoEngine(context);
-            this.context.Services.Publish(typeof(UndoEngine), undoEngine);
-            undoEngine.UndoCompleted += new EventHandler<UndoUnitEventArgs>(OnUndoCompleted);
-
-            this.context.Services.Publish<ValidationService>(this.ValidationService);
-            this.context.Services.Publish<ObjectReferenceService>(this.ObjectReferenceService);
-            this.context.Services.Publish<DesignerPerfEventProvider>(this.perfEventProvider);
-            this.context.Services.Publish<FeatureManager>(new FeatureManager(this.context));
-            this.context.Services.Publish<DesignerConfigurationService>(new DesignerConfigurationService());
-
-            this.context.Services.Subscribe<ICommandService>((s) =>
-            {
-                const string addinTypeName = "Microsoft.VisualStudio.Activities.AddIn.WorkflowDesignerAddIn";
-                if (s != null && s.GetType().FullName.Equals(addinTypeName))
-                {
-                    DesignerConfigurationService service = this.context.Services.GetService<DesignerConfigurationService>();
-                    if (service != null)
-                    {
-                        service.WorkflowDesignerHostId = WorkflowDesignerHostId.Dev10;
-                    }
-                }
-            });
-
-            this.context.Services.Subscribe<IVSSqmService>((service) =>
-            {
-                const string serviceTypeName = "Microsoft.VisualStudio.Activities.AddIn.VSSqmService";
-                if (service != null && service.GetType().FullName.Equals(serviceTypeName))
-                {
-                    DesignerConfigurationService configurationService = this.context.Services.GetService<DesignerConfigurationService>();
-                    if (configurationService != null)
-                    {
-                        configurationService.WorkflowDesignerHostId = WorkflowDesignerHostId.Dev11;
-                    }
-                }
-            });
-
-            this.Context.Items.Subscribe<ErrorItem>(delegate(ErrorItem errorItem)
-            {
-                ErrorView errorView = new ErrorView();
-                errorView.Message = errorItem.Message;
-                errorView.Details = errorItem.Details;
-                errorView.Context = this.Context;
-
-                // Clear views
-                this.view.Children.Clear();
-                this.view.Children.Add(errorView);
-                if (this.outlineView != null)
-                {
-                    this.outlineView.Children.Clear();
-                }
-            }
-                );
-
-            this.context.Items.Subscribe<ReadOnlyState>(new SubscribeContextCallback<ReadOnlyState>(OnReadonlyStateChanged));
-
-            this.context.Services.Subscribe<IXamlLoadErrorService>(s => this.xamlLoadErrorService = s);
-
-            this.PreviewLoad += NamespaceSettingsHandler.PreviewLoadRoot;
-            this.view.Loaded += (s, e) =>
-            {
-                //when view is loaded, check if user did provide his own WindowHelperService - if not, provide a default one
-                if (!this.context.Services.Contains<WindowHelperService>())
-                {
-                    IntPtr hWND = IntPtr.Zero;
-                    Window ownerWindow = Window.GetWindow(this.view);
-                    if (null != ownerWindow)
-                    {
-                        WindowInteropHelper helper = new WindowInteropHelper(ownerWindow);
-                        hWND = helper.Handle;
-                    }
-                    this.Context.Services.Publish<WindowHelperService>(new WindowHelperService(hWND));
-                }
-                WindowHelperService whs = this.context.Services.GetService<WindowHelperService>();
-                whs.View = this.view;
-
-                //check if workflow command extension item is available - if not, provide default one
-                if (!this.context.Items.Contains<WorkflowCommandExtensionItem>())
-                {
-                    WorkflowCommandExtensionItem item = new WorkflowCommandExtensionItem(new DefaultCommandExtensionCallback());
-                    this.context.Items.SetValue(item);
-                }
-
-                ComponentDispatcher.EnterThreadModal += new EventHandler(ComponentDispatcher_EnterThreadModal);
-                ComponentDispatcher.LeaveThreadModal += new EventHandler(ComponentDispatcher_LeaveThreadModal);
-            };
-
-            this.view.Unloaded += (s, e) =>
-            {
-                ComponentDispatcher.EnterThreadModal -= new EventHandler(ComponentDispatcher_EnterThreadModal);
-                ComponentDispatcher.LeaveThreadModal -= new EventHandler(ComponentDispatcher_LeaveThreadModal);
-            };
-
-            this.view.IsKeyboardFocusWithinChanged += (s, e) =>
-            {
-                // The ModelTreeManager is null when there is an active ErrorItem.
-                // We have nothing to write to text in this case.
-                if (this.modelTreeManager != null && (bool)e.NewValue == false)
-                {
-                    if ((FocusManager.GetFocusedElement(this.view) as TextBox) != null)
-                    {
-                        FocusManager.SetFocusedElement(this.view, null);
-                        this.NotifyModelChanged();
-                    }
-                }
-            };
-        }
-
-        internal ValidationService ValidationService
-        {
-            get
-            {
-                if (this.validationService == null)
-                {
-                    this.validationService = new ValidationService(this.context);
-                    this.validationService.ErrorsMarked += ActivityArgumentHelper.UpdateInvalidArgumentsIfNecessary;
-                }
-
-                return this.validationService;
-            }
-        }
-
-        internal ObjectReferenceService ObjectReferenceService
-        {
-            get
-            {
-                if (this.objectReferenceService == null)
-                {
-                    this.objectReferenceService = new ObjectReferenceService(this.context);
-                }
-
-                return this.objectReferenceService;
-            }
-        }
-
-        public UIElement View
-        {
-            get
-            {
-                return this.view;
-            }
-        }
-
-        public UIElement PropertyInspectorView
-        {
-            get
-            {
-                if (this.propertyInspector == null)
-                {
-                    // We change WorkflowDesigner.PropertyInspectorView to be lazy load because the propertyinspector hosted in
-                    // Winform elementhost will not get the resource change notification from Application level resource dictionary.
-                    // So we have to have all colors be ready before propertyinspector gets initialized.
-                    this.propertyInspector = new PropertyInspector();
-                    this.propertyInspector.DesignerContextItemManager = this.context.Items;
-                    this.propertyInspector.EditingContext = this.context;
-                    this.InitializePropertyInspectorResources();
-                    this.InitializePropertyInspectorCommandHandling();
-                }
-
-                return this.propertyInspector;
-            }
-        }
-
-        public UIElement OutlineView
-        {
-            get
-            {
-                if (this.outlineView == null)
-                {
-                    this.outlineView = new Grid();
-                    this.outlineView.Focusable = false;
-                    AddOutlineView();
-                }
-
-                return this.outlineView;
-            }
-        }
-
-        void AddOutlineView()
-        {
-            DesignerTreeView treeView = new DesignerTreeView();
-            treeView.Initialize(context);
-            this.context.Services.Subscribe<ModelService>(delegate(ModelService modelService)
-            {
-                if (modelService.Root != null)
-                {
-                    treeView.SetRootDesigner(modelService.Root);
-
-                }
-                treeView.RestoreDesignerStates();
-            });
-            this.outlineView.Children.Add(treeView);
-        }
-
-
-        public EditingContext Context
-        {
-            get
-            {
-                return this.context;
-            }
-        }
-
-        public ContextMenu ContextMenu
-        {
-            get
-            {
-                if (null != this.context)
-                {
-                    DesignerView designerView = this.context.Services.GetService<DesignerView>();
-                    if (null != designerView)
-                    {
-                        return designerView.ContextMenu;
-                    }
-                }
-                return null;
-            }
-        }
-
-        public string Text
-        {
-            get { return this.text; }
-            set { this.text = value; }
-        }
-
-        [SuppressMessage(FxCop.Category.Design, "CA1044:PropertiesShouldNotBeWriteOnly",
-            Justification = "The host just sets this property for the designer to know which colors to display.")]
-        public string PropertyInspectorFontAndColorData
-        {
-            set
-            {
-                StringReader stringReader = new StringReader(value);
-                XmlReader xmlReader = XmlReader.Create(stringReader);
-                Hashtable fontAndColorDictionary = (Hashtable)System.Windows.Markup.XamlReader.Load(xmlReader);
-                foreach (string key in fontAndColorDictionary.Keys)
-                {
-                    WorkflowDesignerColors.FontAndColorResources[key] = fontAndColorDictionary[key];
-                }
-            }
-        }
-
-
-        public bool IsInErrorState()
-        {
-            ErrorItem errorItem = this.context.Items.GetValue<ErrorItem>();
-            return errorItem.Message != null && errorItem.Details != null ? true : false;
-        }
-
-        // Load using Xaml.
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.DoNotCatchGeneralExceptionTypes,
-            Justification = "Deserializer might throw if it fails to deserialize. Catching all exceptions to avoid VS Crash.")]
-        [SuppressMessage("Reliability", "Reliability108",
-            Justification = "Deserializer might throw if it fails to deserialize. Catching all exceptions to avoid VS crash.")]
-        public void Load()
-        {
-            this.perfEventProvider.WorkflowDesignerLoadStart();
-            if (!string.IsNullOrEmpty(this.text))
-            {
-                try
-                {
-                    this.perfEventProvider.WorkflowDesignerDeserializeStart();
-
-                    IList<XamlLoadErrorInfo> loadErrors;
-                    Dictionary<object, SourceLocation> sourceLocations;
-                    object deserializedObject = DeserializeString(this.text, out loadErrors, out sourceLocations);
-
-                    this.perfEventProvider.WorkflowDesignerDeserializeEnd();
-
-                    if (deserializedObject != null)
-                    {
-                        this.Load(deserializedObject);
-                        this.ValidationService.ValidateWorkflow(ValidationReason.Load);
-                    }
-                    else
-                    {
-                        StringBuilder details = new StringBuilder();
-                        foreach (XamlLoadErrorInfo error in loadErrors)
-                        {
-                            details.AppendLine(error.Message);
-                        }
-                        this.Context.Items.SetValue(new ErrorItem() { Message = SR.SeeErrorWindow, Details = details.ToString() });
-                    }
-                    if (loadErrors != null)
-                    {
-                        RaiseLoadErrors(loadErrors);
-                    }
-                    this.isModelChanged = false;
-                }
-                catch (Exception e)
-                {
-                    this.Context.Items.SetValue(new ErrorItem() { Message = e.Message, Details = e.ToString() });
-                    RaiseLoadError(e);
-                }
-            }
-            else
-            {
-                this.Context.Items.SetValue(new ErrorItem() { Message = string.Empty, Details = string.Empty });
-            }
-            if (this.IsInErrorState())
-            {
-                // Clear workflow symbol in case ErrorState changes during validation
-                this.lastWorkflowSymbol = null;
-            }
-            this.perfEventProvider.WorkflowDesignerLoadComplete();
-        }
-
-        public void Load(string fileName)
-        {
-            if (string.IsNullOrEmpty(fileName))
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("fileName"));
-            }
-            
-            DesignerConfigurationService service = this.Context.Services.GetService<DesignerConfigurationService>();
-            service.SetDefaultOfLoadingFromUntrustedSourceEnabled();
-            if (!service.LoadingFromUntrustedSourceEnabled && !IsFromUnrestrictedPath(fileName))
-            {
-                throw FxTrace.Exception.AsError(new SecurityException(string.Format(CultureInfo.CurrentUICulture, SR.UntrustedSourceDetected, fileName)));
-            }
-
-            try
-            {
-                IDocumentPersistenceService documentPersistenceService = this.Context.Services.GetService<IDocumentPersistenceService>();
-                if (documentPersistenceService != null)
-                {
-                    this.Load(documentPersistenceService.Load(fileName));
-                }
-                else
-                {
-                    using (StreamReader fileStream = new StreamReader(fileName))
-                    {
-                        this.loadedFile = fileName;
-                        WorkflowFileItem fileItem = new WorkflowFileItem();
-                        fileItem.LoadedFile = fileName;
-                        this.context.Items.SetValue(fileItem);
-                        this.Text = fileStream.ReadToEnd();
-                        this.Load();
-                    }
-                }
-            }
-            catch (Exception e)
-            {
-                if (Fx.IsFatal(e))
-                {
-                    throw;
-                }
-                else
-                {
-                    this.Context.Items.SetValue(new ErrorItem() { Message = e.Message, Details = e.ToString() });
-                }
-            }
-            if (!this.IsInErrorState())
-            {
-                if (this.debuggerService != null)
-                {
-                    this.debuggerService.InvalidateSourceLocationMapping(fileName);
-                }
-            }
-        }
-
-        // This supports loading objects instead of xaml into the designer 
-        public void Load(object instance)
-        {
-            if (isLoaded)
-            {
-                throw FxTrace.Exception.AsError(new InvalidOperationException(SR.WorkflowDesignerLoadShouldBeCalledOnlyOnce));
-            }
-
-            isLoaded = true;
-
-            if (instance == null)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("instance"));
-            }
-
-            DesignerConfigurationService configurationService = this.context.Services.GetService<DesignerConfigurationService>();
-            configurationService.ApplyDefaultPreference();
-
-            // Because we want AutoConnect/AutoSplit to be on even in Dev10 if PU1 is installed.
-            // But we cannot know whether PU1 is installed or not, we decide to enable these 2 features for all Dev10.
-            if (configurationService.WorkflowDesignerHostId == WorkflowDesignerHostId.Dev10)
-            {
-                configurationService.AutoConnectEnabled = true;
-                configurationService.AutoSplitEnabled = true;
-            }
-
-            configurationService.IsWorkflowLoaded = true;
-            configurationService.Validate();
-
-            if (this.PreviewLoad != null)
-            {
-                this.PreviewLoad(this, new PreviewLoadEventArgs(instance, this.context));
-            }
-
-            if (configurationService.TargetFrameworkName.IsLessThan45())
-            {
-                TargetFrameworkPropertyFilter.FilterOut45Properties();
-            }
-
-            modelTreeManager = new ModelTreeManager(this.context);
-            modelTreeManager.Load(instance);
-            this.context.Services.Publish(typeof(ModelTreeManager), modelTreeManager);
-            viewManager = GetViewManager(this.modelTreeManager.Root);
-            this.context.Services.Publish<ModelSearchService>(this.ModelSearchService);
-            view.Children.Add((UIElement)viewManager.View);
-
-            modelTreeManager.EditingScopeCompleted += new EventHandler<EditingScopeEventArgs>(OnEditingScopeCompleted);
-
-            this.view.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle,
-                             new Action(() => { this.perfEventProvider.WorkflowDesignerApplicationIdleAfterLoad(); }));
-
-            //Subscribe to the ViewStateChanged event of ViewStateService to show document dirty. It would be published in the call to GetViewManager().
-            WorkflowViewStateService wfViewStateService = this.Context.Services.GetService(typeof(ViewStateService)) as WorkflowViewStateService;
-            if (wfViewStateService != null)
-            {
-                wfViewStateService.UndoableViewStateChanged += new ViewStateChangedEventHandler(OnViewStateChanged);
-            }
-            this.isModelChanged = false;
-            if (!this.IsInErrorState())
-            {
-                this.lastWorkflowSymbol = GetAttachedWorkflowSymbol();
-            }
-        }
-
-        public void Save(string fileName)
-        {
-            this.isModelChanged = true; // ensure flushing any viewstate changes that does not imply model changed.
-            try
-            {
-                // Cancel pervious validation and suppress validation work.
-                this.ValidationService.DeactivateValidation();
-                Flush(fileName);
-            }
-            finally
-            {
-                this.ValidationService.ActivateValidation();
-            }
-
-            using (StreamWriter fileStreamWriter = new StreamWriter(fileName, false, Encoding.UTF8))
-            {
-                fileStreamWriter.Write(this.Text);
-                fileStreamWriter.Flush();
-            }
-
-            if (this.Context.Services.GetService<ModelService>() != null)
-            {
-                this.ValidationService.ValidateWorkflow(ValidationReason.Save);
-            }
-
-            if (this.debuggerService != null)
-            {
-                this.debuggerService.InvalidateSourceLocationMapping(fileName);
-            }
-        }
-
-        public void Flush()
-        {
-            Flush(null);
-        }
-
-        private bool IsFromUnrestrictedPath(string fileName)
-        {
-            Evidence folderEvidence = new Evidence();
-            folderEvidence.AddHostEvidence(Zone.CreateFromUrl(fileName));
-
-            PermissionSet standardFolderSandbox = SecurityManager.GetStandardSandbox(folderEvidence);
-            return standardFolderSandbox.IsUnrestricted();
-        }
-
-        void Flush(string fileName)
-        {
-            if (this.modelTreeManager == null)
-            {
-                // It's possible for modelTreeManager to be null if Load is called but the xaml file being loaded is invalid.
-                // We only want to throw exception if Load hasn't been called yet.
-                if (IsInErrorState() == false)
-                {
-                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.WorkflowDesignerLoadShouldBeCalledFirst));
-                }
-            }
-            else
-            {
-                this.FlushEdits();
-                IDocumentPersistenceService documentPersistenceService = this.Context.Services.GetService<IDocumentPersistenceService>();
-                if (documentPersistenceService != null)
-                {
-                    documentPersistenceService.Flush(this.modelTreeManager.Root.GetCurrentValue());
-                }
-                else
-                {
-                    this.WriteModelToText(fileName);
-                }
-            }
-        }
-
-        void FlushEdits()
-        {
-            UIElement oldFocus = null;
-            //check if property grid has keyboard focus within, if yes - get focused control
-            if (null != this.propertyInspector && this.propertyInspector.IsKeyboardFocusWithin)
-            {
-                oldFocus = FocusManager.GetFocusedElement(this.propertyInspector) as UIElement;
-            }
-            //check if view has keyboard focus within, if yes - get focused control
-            if (null != this.view && this.view.IsKeyboardFocusWithin)
-            {
-                oldFocus = FocusManager.GetFocusedElement(this.view) as UIElement;
-            }
-            if (null != oldFocus)
-            {
-                RoutedCommand cmd = DesignerView.CommitCommand as RoutedCommand;
-                if (cmd != null)
-                {
-                    cmd.Execute(null, oldFocus);
-                }
-            }
-
-            //commit changes within arguments and variables editor
-            var designerView = this.Context.Services.GetService<DesignerView>();
-            if (null != designerView)
-            {
-                if (null != designerView.arguments1)
-                {
-                    DataGridHelper.CommitPendingEdits(designerView.arguments1.argumentsDataGrid);
-                }
-                if (null != designerView.variables1)
-                {
-                    DataGridHelper.CommitPendingEdits(designerView.variables1.variableDataGrid);
-                }
-            }
-        }
-
-        static void InitializePropertyInspectorMetadata()
-        {
-            PropertyInspectorMetadata.Initialize();
-        }
-
-        static Activity GetRootWorkflowElement(object rootModelObject)
-        {
-            return WorkflowDesignerXamlHelper.GetRootWorkflowElement(rootModelObject);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowDesignerColors.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowDesignerColors.cs
deleted file mode 100644 (file)
index 1e99108..0000000
+++ /dev/null
@@ -1,597 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//-----------------------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Collections.Generic;
-    using System.Text;
-    using System.Windows.Media;
-    using System.Windows;
-    using System.Runtime;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-
-    public static class WorkflowDesignerColors
-    {
-        static ResourceDictionary defaultColors;
-        static ResourceDictionary highContrastColors;
-        static ResourceDictionary fontAndColorResources;
-
-        public const string WorkflowViewElementBorderColorKey = "WorkflowViewElementBorderColorKey";
-        public const string WorkflowViewElementBackgroundColorKey = "WorkflowViewElementBackgroundColorKey";
-        public const string WorkflowViewElementSelectedBackgroundColorKey = "WorkflowViewElementSelectedBackgroundColorKey";
-        public const string WorkflowViewElementSelectedBorderColorKey = "WorkflowViewElementSelectedBorderColorKey";
-        public const string DesignerViewStatusBarBackgroundColorKey = "DesignerViewStatusBarBackgroundColorKey";
-        public const string WorkflowViewElementCaptionColorKey = "WorkflowViewElementCaptionBrushColorKey";
-        public const string DesignerViewBackgroundColorKey = "DesignerViewBackgroundColorKey";
-        public const string DesignerViewShellBarColorGradientBeginKey = "DesignerViewShellBarColorGradientBeginKey";
-        public const string DesignerViewShellBarColorGradientEndKey = "DesignerViewShellBarColorGradientEndKey";
-        public const string DesignerViewShellBarSelectedColorGradientBeginKey = "DesignerViewShellBarSelectedColorGradientBeginKey";
-        public const string DesignerViewShellBarSelectedColorGradientEndKey = "DesignerViewShellBarSelectedColorGradientEndKey";
-        public const string DesignerViewShellBarHoverColorGradientBeginKey = "DesignerViewShellBarSelectedHoverGradientBeginKey";
-        public const string DesignerViewShellBarHoverColorGradientEndKey = "DesignerViewShellBarSelectedHoverGradientEndKey";
-        public const string DesignerViewShellBarControlBackgroundColorKey = "DesignerViewShellBarControlBackgroundColorKey";
-        public const string DesignerViewShellBarCaptionActiveColorKey = "DesignerViewShellBarCaptionActiveColorKey";
-        public const string DesignerViewShellBarCaptionColorKey = "DesignerViewShellBarCaptionColorKey";
-        public const string DesignerViewExpandAllCollapseAllButtonColorKey = "DesignerViewExpandAllCollapseAllButtonColorKey";
-        public const string DesignerViewExpandAllCollapseAllButtonMouseOverColorKey = "DesignerViewExpandAllCollapseAllButtonMouseOverColorKey";
-        public const string DesignerViewExpandAllCollapseAllPressedColorKey = "DesignerViewExpandAllCollapseAllPressedColorKey";
-
-        public const string ContextMenuBackgroundGradientBeginColorKey = "ContextMenuColorGradientBeginColorKey";
-        public const string ContextMenuBackgroundGradientEndColorKey = "ContextMenuColorGradientEndColorKey";
-        public const string ContextMenuBorderColorKey = "ContextMenuBorderColorKey";
-        public const string ContextMenuIconAreaColorKey = "ContextMenuIconAreaColorKey";
-        public const string ContextMenuMouseOverBeginColorKey = "ContextMenuMouseOverBeginColorKey";
-        public const string ContextMenuMouseOverMiddle1ColorKey = "ContextMenuMouseOverMiddle1ColorKey";
-        public const string ContextMenuMouseOverMiddle2ColorKey = "ContextMenuMouseOverMiddle2ColorKey";
-        public const string ContextMenuMouseOverEndColorKey = "ContextMenuMouseOverEndColorKey";
-        public const string ContextMenuMouseOverBorderColorKey = "ContextMenuMouseOverBorderColorKey";
-        public const string ContextMenuItemTextColorKey = "ContextMenuItemTextColorKey";
-        public const string ContextMenuItemTextHoverColorKey = "ContextMenuItemTextHoverColorKey";
-        public const string ContextMenuItemTextSelectedColorKey = "ContextMenuItemTextSelectedColorKey";
-        public const string ContextMenuItemTextDisabledColorKey = "ContextMenuItemTextDisabledColorKey";
-        public const string ContextMenuSeparatorColorKey = "ContextMenuSeparatorColorKey";
-
-        public static string PropertyInspectorTextBrushKey { get { return PropertyInspectorMergedResources.TextBrushKey; } }
-        public static string PropertyInspectorSelectedForegroundBrushKey { get { return PropertyInspectorMergedResources.SelectedForegroundBrushKey; } }
-        public static string PropertyInspectorSelectedBackgroundBrushKey { get { return PropertyInspectorMergedResources.SelectedBackgroundBrushKey; } }
-        public static string PropertyInspectorBackgroundBrushKey { get { return PropertyInspectorMergedResources.BackgroundBrushKey; } }
-        public static string PropertyInspectorBorderBrushKey { get { return PropertyInspectorMergedResources.BorderBrushKey; } }
-        public static string PropertyInspectorCategoryCaptionTextBrushKey { get { return PropertyInspectorMergedResources.CategoryCaptionTextBrushKey; } }
-        public static string PropertyInspectorPaneBrushKey { get { return PropertyInspectorMergedResources.PaneBrushKey; } }
-        public static string PropertyInspectorPopupBrushKey { get { return PropertyInspectorMergedResources.PopupBrushKey; } }
-        public static string PropertyInspectorToolBarItemHoverBackgroundBrushKey { get { return PropertyInspectorMergedResources.ToolBarItemHoverBackgroundBrushKey; } }
-        public static string PropertyInspectorToolBarItemHoverBorderBrushKey { get { return PropertyInspectorMergedResources.ToolBarItemHoverBorderBrushKey; } }
-        public static string PropertyInspectorToolBarItemSelectedBackgroundBrushKey { get { return PropertyInspectorMergedResources.ToolBarItemSelectedBackgroundBrushKey; } }
-        public static string PropertyInspectorToolBarItemSelectedBorderBrushKey { get { return PropertyInspectorMergedResources.ToolBarItemSelectedBorderBrushKey; } }
-        public static string PropertyInspectorToolBarBackgroundBrushKey { get { return PropertyInspectorMergedResources.ToolBarBackgroundBrushKey; } }
-        public static string PropertyInspectorToolBarSeparatorBrushKey { get { return PropertyInspectorMergedResources.ToolBarSeparatorBrushKey; } }
-        public static string PropertyInspectorToolBarTextBoxBorderBrushKey { get { return PropertyInspectorMergedResources.ToolBarTextBoxBorderBrushKey; } }
-
-
-        public const string FlowchartExpressionButtonColorKey = "FlowchartExpressionButtonColorKey";
-        public const string FlowchartExpressionButtonMouseOverColorKey = "FlowchartExpressionButtonMouseOverColorKey";
-        public const string FlowchartExpressionButtonPressedColorKey = "FlowchartExpressionButtonPressedColorKey";
-
-        
-
-        public const string AnnotationBackgroundGradientBeginColorKey = "AnnotationBackgroundGradientBeginColorKey";
-        public const string AnnotationBackgroundGradientMiddleColorKey = "AnnotationBackgroundGradientMiddleColorKey";
-        public const string AnnotationBackgroundGradientEndColorKey = "AnnotationBackgroundGradientEndColorKey";
-        public const string AnnotationBorderColorKey = "AnnotationBorderColorKey";
-        public const string AnnotationDockTextColorKey = "AnnotationDockTextColorKey";
-        public const string AnnotationUndockTextColorKey = "AnnotationUndockTextColorKey";
-        public const string AnnotationDockButtonColorKey = "AnnotationDockButtonColorKey";
-        public const string AnnotationDockButtonHoverColorKey = "AnnotationDockButtonHoverColorKey";
-        public const string AnnotationDockButtonHoverBorderColorKey = "AnnotationDockButtonHoverBorderColorKey";
-        public const string AnnotationDockButtonHoverBackgroundColorKey = "AnnotationDockButtonHoverBackgroundColorKey";
-
-        public const string OutlineViewItemHighlightBackgroundColorKey = "OutlineViewItemHighlightBackgroundColorKey";
-        public const string OutlineViewCollapsedArrowBorderColorKey = "OutlineViewCollapsedArrowBorderColorKey";
-        public const string OutlineViewCollapsedArrowHoverBorderColorKey = "OutlineViewCollapsedArrowHoverBorderColorKey";
-        public const string OutlineViewExpandedArrowColorKey = "OutlineViewExpandedArrowColorKey";
-        public const string OutlineViewExpandedArrowBorderColorKey = "OutlineViewExpandedArrowBorderColorKey";
-        public const string OutlineViewBackgroundColorKey = "OutlineViewBackgroundColorKey";
-        public const string OutlineViewItemSelectedTextColorKey = "OutlineViewTitemSelectedTextColorKey";
-        public const string OutlineViewItemTextColorKey = "OutlineViewItemTextColorKey";
-
-        public const string RubberBandRectangleColorKey = "RubberBandRectangleColorKey";
-
-        public static readonly string FontSizeKey = CreateKey("FontSizeKey");
-        public static readonly string FontFamilyKey = CreateKey("FontFamilyKey");
-        public static readonly string FontWeightKey = CreateKey("FontWeightKey");
-
-
-        static ResourceDictionary DefaultColors
-        {
-            get
-            {
-                if (defaultColors == null)
-                {
-                    Uri resourceLocator = new Uri(
-                        string.Concat(
-                        typeof(WorkflowDesignerColors).Assembly.GetName().Name,
-                        @";component/System/Activities/Presentation/DefaultColorResources.xaml"),
-                        UriKind.RelativeOrAbsolute);
-                    defaultColors = (ResourceDictionary)Application.LoadComponent(resourceLocator);
-                }
-                Fx.Assert(defaultColors != null, "Could not load default color resources.");
-                return defaultColors;
-            }
-        }
-
-        static ResourceDictionary HighContrastColors
-        {
-            get
-            {
-                if (highContrastColors == null)
-                {
-                    Uri resourceLocator = new Uri(
-                        string.Concat(
-                        typeof(WorkflowDesignerColors).Assembly.GetName().Name,
-                        @";component/System/Activities/Presentation/HighContrastColorResources.xaml"),
-                        UriKind.RelativeOrAbsolute);
-                    highContrastColors = (ResourceDictionary)Application.LoadComponent(resourceLocator);
-                }
-                Fx.Assert(highContrastColors != null, "Could not load high contrast color resources.");
-                return highContrastColors;
-            }
-        }
-
-        internal static ResourceDictionary FontAndColorResources
-        {
-            get
-            {
-                if (WorkflowDesignerColors.fontAndColorResources == null)
-                {
-                    InitializeDefaultResourceDictionary();
-                }
-
-                return WorkflowDesignerColors.fontAndColorResources;
-            }
-        }
-
-        // Trying to figure out whether or not we are in highcontrast mode is a little tricky.
-        // There are two things highcontrast mode and highcontrast color scheme. unfortunately in some platforms ( w2k3) these are not both updated from OS UX
-        // here is a good article on this http://blogs.msdn.com/oldnewthing/archive/2008/12/03/9167477.aspx
-        // highcontrast mode can be detected easily by using
-        // applications in generatel ( e.g. VS) unfortunately handle high contrast color scheme as well, so we are forced to do it
-        // This is code is dervied from the way VS does this.
-
-        static bool IsHighContrastEnabled
-        {
-            get
-            {
-                if (SystemParameters.HighContrast)
-                {
-                    return true;
-                }
-
-                if (SystemColors.ControlColor == Colors.Black && SystemColors.ControlTextColor == Colors.White)
-                {
-                    return true;
-                }
-
-                if (SystemColors.ControlColor == Colors.White && SystemColors.ControlTextColor == Colors.Black)
-                {
-                    return true;
-                }
-
-                if (SystemColors.ControlColor == Colors.Black && SystemColors.ControlTextColor == Color.FromArgb(0xff, 0x00, 0xff, 0x00))
-                {
-                    return true;
-                }
-
-                return false;
-            }
-        }
-
-
-        public static Color WorkflowViewElementBorderColor
-        {
-            get
-            {
-                return GetColor(WorkflowDesignerColors.WorkflowViewElementBorderColorKey);
-            }
-        }
-
-        public static Color WorkflowViewElementBackgroundColor
-        {
-            get
-            {
-                return GetColor(WorkflowDesignerColors.WorkflowViewElementBackgroundColorKey);
-            }
-        }
-        public static Color WorkflowViewElementSelectedBackgroundColor
-        {
-            get
-            {
-                return GetColor(WorkflowDesignerColors.WorkflowViewElementSelectedBackgroundColorKey);
-            }
-        }
-
-        public static Color GridViewRowHoverColor
-        {
-            get
-            {
-                return GetColor(WorkflowDesignerColors.WorkflowViewElementSelectedBackgroundColorKey, 0xA0);
-            }
-        }
-
-        public static Color WorkflowViewElementSelectedBorderColor
-        {
-            get
-            {
-                return GetColor(WorkflowDesignerColors.WorkflowViewElementSelectedBorderColorKey);
-            }
-        }
-        public static Color DesignerViewStatusBarBackgroundColor
-        {
-            get
-            {
-                return GetColor(WorkflowDesignerColors.DesignerViewStatusBarBackgroundColorKey);
-            }
-        }
-        public static Color WorkflowViewElementCaptionColor
-        {
-            get
-            {
-                return GetColor(WorkflowDesignerColors.WorkflowViewElementCaptionColorKey);
-            }
-        }
-        public static Color DesignerViewBackgroundColor
-        {
-            get
-            {
-                return GetColor(WorkflowDesignerColors.DesignerViewBackgroundColorKey);
-            }
-        }
-
-        public static Color DesignerViewShellBarColorGradientBeginColor
-        {
-            get { return GetColor(WorkflowDesignerColors.DesignerViewShellBarColorGradientBeginKey); }
-        }
-
-        public static Color DesignerViewShellBarColorGradientEndColor
-        {
-            get { return GetColor(WorkflowDesignerColors.DesignerViewShellBarColorGradientEndKey); }
-        }
-
-        public static Color DesignerViewShellBarSelectedColorGradientBeginColor
-        {
-            get { return GetColor(WorkflowDesignerColors.DesignerViewShellBarSelectedColorGradientBeginKey); }
-        }
-
-        public static Color DesignerViewShellBarSelectedColorGradientEndColor
-        {
-            get { return GetColor(WorkflowDesignerColors.DesignerViewShellBarSelectedColorGradientEndKey); }
-        }
-
-        public static Color DesignerViewShellBarHoverColorGradientBeginColor
-        {
-            get { return GetColor(WorkflowDesignerColors.DesignerViewShellBarHoverColorGradientBeginKey); }
-        }
-
-        public static Color DesignerViewShellBarHoverColorGradientEndColor
-        {
-            get { return GetColor(WorkflowDesignerColors.DesignerViewShellBarHoverColorGradientEndKey); }
-        }
-
-        public static Color DesignerViewShellBarControlBackgroundColor
-        {
-            get { return GetColor(WorkflowDesignerColors.DesignerViewShellBarControlBackgroundColorKey); }
-        }
-
-        public static Color DesignerViewShellBarCaptionActiveColor
-        {
-            get { return GetColor(WorkflowDesignerColors.DesignerViewShellBarCaptionActiveColorKey); }
-        }
-
-        public static Color DesignerViewShellBarCaptionColor
-        {
-            get { return GetColor(WorkflowDesignerColors.DesignerViewShellBarCaptionColorKey); }
-        }
-
-        public static Brush DesignerViewExpandAllCollapseAllButtonBrush
-        {
-            get { return GetBrush(WorkflowDesignerColors.DesignerViewExpandAllCollapseAllButtonColorKey); }
-        }
-
-        public static Brush DesignerViewExpandAllCollapseAllButtonMouseOverBrush
-        {
-            get { return GetBrush(WorkflowDesignerColors.DesignerViewExpandAllCollapseAllButtonMouseOverColorKey); }
-        }
-
-        public static Brush DesignerViewExpandAllCollapseAllPressedBrush
-        {
-            get { return GetBrush(WorkflowDesignerColors.DesignerViewExpandAllCollapseAllPressedColorKey); }
-        }
-
-        public static Color ContextMenuBackgroundGradientBeginColor
-        {
-            get { return GetColor(WorkflowDesignerColors.ContextMenuBackgroundGradientBeginColorKey); }
-        }
-        public static Color ContextMenuBackgroundGradientEndColor
-        {
-            get { return GetColor(WorkflowDesignerColors.ContextMenuBackgroundGradientEndColorKey); }
-        }
-
-        public static Color ContextMenuBorderColor
-        {
-            get { return GetColor(WorkflowDesignerColors.ContextMenuBorderColorKey); }
-        }
-
-        public static Color ContextMenuIconAreaColor
-        {
-            get { return GetColor(WorkflowDesignerColors.ContextMenuIconAreaColorKey); }
-        }
-
-        public static Color ContextMenuMouseOverBeginColor
-        {
-            get { return GetColor(WorkflowDesignerColors.ContextMenuMouseOverBeginColorKey); }
-        }
-
-        public static Color ContextMenuMouseOverMiddle1Color
-        {
-            get { return GetColor(WorkflowDesignerColors.ContextMenuMouseOverMiddle1ColorKey); }
-        }
-
-        public static Color ContextMenuMouseOverMiddle2Color
-        {
-            get { return GetColor(WorkflowDesignerColors.ContextMenuMouseOverMiddle2ColorKey); }
-        }
-
-        public static Color ContextMenuMouseOverEndColor
-        {
-            get { return GetColor(WorkflowDesignerColors.ContextMenuMouseOverEndColorKey); }
-        }
-
-        public static Color ContextMenuMouseOverBorderColor
-        {
-            get { return GetColor(WorkflowDesignerColors.ContextMenuMouseOverBorderColorKey); }
-        }
-
-        public static Color ContextMenuItemTextColor
-        {
-            get { return GetColor(WorkflowDesignerColors.ContextMenuItemTextColorKey); }
-        }
-
-        public static Color ContextMenuItemTextHoverColor
-        {
-            get { return GetColor(WorkflowDesignerColors.ContextMenuItemTextHoverColorKey); }
-        }
-
-        public static Color ContextMenuItemTextSelectedColor
-        {
-            get { return GetColor(WorkflowDesignerColors.ContextMenuItemTextSelectedColorKey); }
-        }
-
-        public static Color ContextMenuItemTextDisabledColor
-        {
-            get { return GetColor(WorkflowDesignerColors.ContextMenuItemTextDisabledColorKey); }
-        }
-
-        public static Color ContextMenuSeparatorColor
-        {
-            get { return GetColor(WorkflowDesignerColors.ContextMenuSeparatorColorKey); }
-        }
-
-        public static Brush FlowchartExpressionButtonBrush
-        {
-            get { return GetBrush(WorkflowDesignerColors.FlowchartExpressionButtonColorKey); }
-        }
-
-        public static Brush FlowchartExpressionButtonMouseOverBrush
-        {
-            get { return GetBrush(WorkflowDesignerColors.FlowchartExpressionButtonMouseOverColorKey); }
-        }
-
-        public static Brush FlowchartExpressionButtonPressedBrush
-        {
-            get { return GetBrush(WorkflowDesignerColors.FlowchartExpressionButtonPressedColorKey); }
-        }
-
-        public static Color AnnotationBackgroundGradientBeginColor
-        {
-            get { return GetColor(WorkflowDesignerColors.AnnotationBackgroundGradientBeginColorKey); }
-        }
-
-        public static Color AnnotationBackgroundGradientMiddleColor
-        {
-            get { return GetColor(WorkflowDesignerColors.AnnotationBackgroundGradientMiddleColorKey); }
-        }
-
-        public static Color AnnotationBackgroundGradientEndColor
-        {
-            get { return GetColor(WorkflowDesignerColors.AnnotationBackgroundGradientEndColorKey); }
-        }
-
-        public static Color AnnotationBorderColor
-        {
-            get { return GetColor(WorkflowDesignerColors.AnnotationBorderColorKey); }
-        }
-
-        public static Color AnnotationDockTextColor
-        {
-            get { return GetColor(WorkflowDesignerColors.AnnotationDockTextColorKey); }
-        }
-
-        public static Color AnnotationUndockTextColor
-        {
-            get { return GetColor(WorkflowDesignerColors.AnnotationUndockTextColorKey); }
-        }
-
-        public static Color AnnotationDockButtonColor
-        {
-            get { return GetColor(WorkflowDesignerColors.AnnotationDockButtonColorKey); }
-        }
-
-        public static Color AnnotationDockButtonHoverColor
-        {
-            get { return GetColor(WorkflowDesignerColors.AnnotationDockButtonHoverColorKey); }
-        }
-
-        public static Color AnnotationDockButtonHoverBorderColor
-        {
-            get { return GetColor(WorkflowDesignerColors.AnnotationDockButtonHoverBorderColorKey); }
-        }
-
-        public static Color AnnotationDockButtonHoverBackgroundColor
-        {
-            get { return GetColor(WorkflowDesignerColors.AnnotationDockButtonHoverBackgroundColorKey); }
-        }
-
-        public static Color OutlineViewItemHighlightBackgroundColor
-        {
-            get { return GetColor(WorkflowDesignerColors.OutlineViewItemHighlightBackgroundColorKey); }
-        }
-
-        public static Color OutlineViewCollapsedArrowBorderColor
-        {
-            get { return GetColor(WorkflowDesignerColors.OutlineViewCollapsedArrowBorderColorKey); }
-        }
-
-        public static Color OutlineViewCollapsedArrowHoverBorderColor
-        {
-            get { return GetColor(WorkflowDesignerColors.OutlineViewCollapsedArrowHoverBorderColorKey); }
-        }
-
-        public static Color OutlineViewExpandedArrowColor
-        {
-            get { return GetColor(WorkflowDesignerColors.OutlineViewExpandedArrowColorKey); }
-        }
-
-        public static Color OutlineViewExpandedArrowBorderColor
-        {
-            get { return GetColor(WorkflowDesignerColors.OutlineViewExpandedArrowBorderColorKey); }
-        }
-
-        public static Color OutlineViewBackgroundColor
-        {
-            get { return GetColor(WorkflowDesignerColors.OutlineViewBackgroundColorKey); }
-        }
-
-        public static Color OutlineViewItemSelectedTextColor
-        {
-            get { return GetColor(WorkflowDesignerColors.OutlineViewItemSelectedTextColorKey); }
-        }
-
-        public static Color OutlineViewItemTextColor
-        {
-            get { return GetColor(WorkflowDesignerColors.OutlineViewItemTextColorKey); }
-        }
-
-        public static FontFamily FontFamily
-        {
-            get
-            {
-                return GetFontFamily(FontFamilyKey);
-            }
-        }
-
-        public static double FontSize
-        {
-            get
-            {
-                return GetFontSize(FontSizeKey);
-            }
-        }
-
-        public static FontWeight FontWeight
-        {
-            get
-            {
-                return GetFontWeight(FontWeightKey);
-            }
-        }
-
-        internal static Brush RubberBandRectangleBrush
-        {
-            get { return GetBrush(WorkflowDesignerColors.RubberBandRectangleColorKey); }
-        }
-
-        private static Brush GetBrush(string colorKey)
-        {
-            SolidColorBrush brush = 
-                (SolidColorBrush)GetFontOrColor(colorKey, WorkflowDesignerColors.DefaultColors[colorKey], WorkflowDesignerColors.HighContrastColors[colorKey]);
-
-            if (brush.CanFreeze)
-            {
-                brush.Freeze();
-            }
-            return brush;
-        }
-
-        private static Color GetColor(string colorKey)
-        {
-            SolidColorBrush brush = (SolidColorBrush)GetBrush(colorKey);
-
-            return brush.Color;
-        }
-
-        private static Color GetColor(string colorKey, byte alpha)
-        {
-            Color color = GetColor(colorKey);
-            color.A = alpha;
-            return color;
-        }
-
-        private static FontFamily GetFontFamily(string key)
-        {
-            return (FontFamily)GetFontOrColor(key, SystemFonts.MessageFontFamily, SystemFonts.MessageFontFamily);
-        }
-
-        private static double GetFontSize(string key)
-        {
-            return (double)GetFontOrColor(key, SystemFonts.MessageFontSize, SystemFonts.MessageFontSize);
-        }
-
-        private static FontWeight GetFontWeight(string key)
-        {
-            return (FontWeight)GetFontOrColor(key, SystemFonts.MessageFontWeight, SystemFonts.MessageFontWeight);
-        }
-
-        private static object GetFontOrColor(string key, object defaultValue, object valueInHighContrast)
-        {
-            if (WorkflowDesignerColors.FontAndColorResources.Contains(key))
-            {
-                return WorkflowDesignerColors.FontAndColorResources[key];
-            }
-            else if (IsHighContrastEnabled)
-            {
-                return valueInHighContrast;
-            }
-            else
-            {
-                return defaultValue;
-            }
-        }
-
-        static string CreateKey(string name)
-        {
-            //return AdornerResources.CreateResourceKey(typeof(PropertyInspectorMergedResources), name);
-            return name;
-        }
-
-        private static void InitializeDefaultResourceDictionary()
-        {
-            ResourceDictionary resources = new ResourceDictionary();
-            resources[WorkflowDesignerColors.PropertyInspectorTextBrushKey] = new SolidColorBrush(SystemColors.ControlTextColor);
-            resources[WorkflowDesignerColors.PropertyInspectorBackgroundBrushKey] = new SolidColorBrush(SystemColors.WindowColor);
-            resources[WorkflowDesignerColors.PropertyInspectorBorderBrushKey] = new SolidColorBrush(SystemColors.ControlDarkColor);
-            resources[WorkflowDesignerColors.PropertyInspectorPaneBrushKey] = new SolidColorBrush(SystemColors.ControlColor);
-            resources[WorkflowDesignerColors.PropertyInspectorSelectedBackgroundBrushKey] = new SolidColorBrush(SystemColors.HighlightColor);
-            resources[WorkflowDesignerColors.PropertyInspectorSelectedForegroundBrushKey] = new SolidColorBrush(SystemColors.HighlightTextColor);
-            resources[WorkflowDesignerColors.PropertyInspectorToolBarItemHoverBackgroundBrushKey] = new SolidColorBrush(SystemColors.GradientActiveCaptionColor);
-            resources[WorkflowDesignerColors.PropertyInspectorToolBarItemHoverBorderBrushKey] = new SolidColorBrush(SystemColors.ActiveCaptionTextColor);
-            resources[WorkflowDesignerColors.PropertyInspectorToolBarItemSelectedBackgroundBrushKey] = new SolidColorBrush(SystemColors.GradientInactiveCaptionColor);
-            resources[WorkflowDesignerColors.PropertyInspectorToolBarItemSelectedBorderBrushKey] = new SolidColorBrush(SystemColors.ActiveCaptionTextColor);
-            resources[WorkflowDesignerColors.PropertyInspectorToolBarBackgroundBrushKey] = new SolidColorBrush(SystemColors.ControlColor);
-            resources[WorkflowDesignerColors.PropertyInspectorToolBarSeparatorBrushKey] = new SolidColorBrush(SystemColors.ControlDarkColor);
-            resources[WorkflowDesignerColors.PropertyInspectorToolBarTextBoxBorderBrushKey] = new SolidColorBrush(SystemColors.ControlDarkDarkColor);            
-
-            WorkflowDesignerColors.fontAndColorResources = resources;               
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowDesignerIcons.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowDesignerIcons.cs
deleted file mode 100644 (file)
index aa21578..0000000
+++ /dev/null
@@ -1,1538 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-using System.Collections.Generic;
-using System.Diagnostics.CodeAnalysis;
-using System.Globalization;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-    
-    /// <summary>
-    /// Exposes members representing an icon for a workflow out-of-box items.
-    /// </summary>
-    public static class WorkflowDesignerIcons
-    {
-        private static string addToCollectionIconName = "AddToCollectionIcon";
-        private static string annotationIndicatorIconName = "AnnotationIndicatorBrush";
-        private static string assignIconName = "AssignIcon";
-        private static string cancellationScopeIconName = "CancellationScopeIcon";
-        private static string clearCollectionIconName = "ClearCollectionIcon";
-        private static string compensableActivityIconName = "CompensableActivityIcon";
-        private static string compensateIconName = "CompensateIcon";
-        private static string confirmIconName = "ConfirmIcon";
-        private static string correlationScopeIconName = "CorrelationScopeIcon";
-        private static string delayIconName = "DelayIcon";
-        private static string deleteIconName = "DeleteIcon";
-        private static string deleteDisabledIconName = "DeleteDisabledIcon";
-        private static string doWhileIconName = "DoWhileIcon";
-        private static string entryIconName = "EntryIcon";
-        private static string errorValidationIconName = "ErrorValidationIcon";
-        private static string existsInCollectionIconName = "ExistsInCollectionIcon";
-        private static string exitIconName = "ExitIcon";
-        private static string extensionWindowHeaderCloseButtonName = "ExtensionWindowHeaderCloseButton";
-        private static string finalStateIconName = "FinalStateIcon";
-        private static string fitToScreenIconName = "FitToScreenIcon";
-        private static string flowchartIconName = "FlowchartIcon";
-        private static string flowDecisionIconName = "FlowDecisionIcon";
-        private static string flowDecisionIconBrushName = "FlowDecisionIconBrush";
-        private static string flowSwitchIconName = "FlowSwitchIcon";
-        private static string flowSwitchIconBrushName = "FlowSwitchIconBrush";
-        private static string forEachIconName = "ForEachIcon";
-        private static string genericLeafActivityIconName = "GenericLeafActivityIcon";
-        private static string ifIconName = "IfIcon";
-        private static string initializeCorrelationIconName = "InitializeCorrelationIcon";
-        private static string interopIconName = "InteropIcon";
-        private static string invokeDelegateIconName = "InvokeDelegateIcon";
-        private static string invokeMethodIconName = "InvokeMethodIcon";
-        private static string minimapIconName = "MinimapIcon";
-        private static string moveDownIconName = "MoveDownIcon";
-        private static string moveDownDisabledIconName = "MoveDownDisabledIcon";
-        private static string moveUpIconName = "MoveUpIcon";
-        private static string moveUpDisabledIconName = "MoveUpDisabledIcon";
-        private static string noPersistScopeIconName = "NoPersistScopeIcon";
-        private static string operationCopyIconName = "OperationCopyIcon";
-        private static string operationCopyDisabledIconName = "OperationCopyDisabledIcon";
-        private static string operationCutIconName = "OperationCutIcon";
-        private static string operationCutDisabledIconName = "OperationCutDisabledIcon";
-        private static string operationDeleteIconName = "OperationDeleteIcon";
-        private static string operationDeleteDisabledIconName = "OperationDeleteDisabledIcon";
-        private static string operationPasteIconName = "OperationPasteIcon";
-        private static string operationPasteDisabledIconName = "OperationPasteDisabledIcon";
-        private static string panModeIconName = "PanModeIcon";
-        private static string parallelForEachIconName = "ParallelForEachIcon";
-        private static string parallelIconName = "ParallelIcon";
-        private static string persistIconName = "PersistIcon";
-        private static string pickBranchIconName = "PickBranchIcon";
-        private static string pickIconName = "PickIcon";
-        private static string receiveAndSendReplyIconName = "ReceiveAndSendReplyIcon";
-        private static string receiveIconName = "ReceiveIcon";
-        private static string receiveReplyIconName = "ReceiveReplyIcon";
-        private static string removeFromCollectionIconName = "RemoveFromCollectionIcon";
-        private static string resizeGripIconName = "ResizeGripIcon";
-        private static string rethrowIconName = "RethrowIcon";
-        private static string sendAndReceiveReplyIconName = "SendAndReceiveReplyIcon";
-        private static string sendIconName = "SendIcon";
-        private static string sendReplyIconName = "SendReplyIcon";
-        private static string sequenceIconName = "SequenceIcon";
-        private static string startSymbolIconName = "StartSymbolIconBrush";
-        private static string stateIconName = "StateIcon";
-        private static string stateMachineIconName = "StateMachineIcon";
-        private static string switchIconName = "SwitchIcon";
-        private static string terminateWorkflowIconName = "TerminateWorkflowIcon";
-        private static string textBoxErrorIconName = "TextBoxErrorIcon";
-        private static string throwIconName = "ThrowIcon";
-        private static string toolboxDefaultCustomActivityName = "ToolboxDefaultCustomActivityIcon";
-        private static string transactedReceiveScopeIconName = "TransactedReceiveScopeIcon";
-        private static string transactionScopeIconName = "TransactionScopeIcon";
-        private static string transitionIconName = "TransitionIcon";
-        private static string tryCatchIconName = "TryCatchIcon";
-        private static string validationErrorIconName = "ValidationErrorIcon";
-        private static string warningValidationIconName = "WarningValidationIcon";
-        private static string whileIconName = "WhileIcon";
-        private static string writeLineIconName = "WriteLineIcon";
-        private static string zoomIconName = "ZoomIcon";
-
-        private static ResourceDictionary iconResourceDictionary;
-
-        internal static ResourceDictionary IconResourceDictionary
-        {
-            get
-            {
-                if (WorkflowDesignerIcons.iconResourceDictionary == null)
-                {
-                    InitializeDefaultResourceDictionary();
-                }
-
-                return WorkflowDesignerIcons.iconResourceDictionary;
-            }
-        }
-
-        internal static bool IsDefaultCutomActivitySetByUser { get; set; }
-
-        /// <summary>
-        /// Applies the WindowsApp style icons to all workflow out-of-box items.
-        /// </summary>
-        public static void UseWindowsStoreAppStyleIcons()
-        {
-            Uri resourceUri = new Uri(string.Concat(typeof(WorkflowDesignerIcons).Assembly.GetName().Name, @";component/Themes/Icons.WindowsApp.xaml"), UriKind.RelativeOrAbsolute);
-            ResourceDictionary windowsAppIcons = (ResourceDictionary)Application.LoadComponent(resourceUri);
-
-            if (WorkflowDesignerIcons.iconResourceDictionary == null)
-            {
-                WorkflowDesignerIcons.iconResourceDictionary = new ResourceDictionary();
-            }
-
-            foreach (string key in windowsAppIcons.Keys)
-            {
-                WorkflowDesignerIcons.iconResourceDictionary[key] = windowsAppIcons[key];
-            }
-
-            ImageSource enabledImagaSource = null;
-            ImageSource disabledImagaSource = null;
-
-            WorkflowDesignerIcons.LoadImageSourceFromResource("Copy.WindowsApp", out enabledImagaSource, out disabledImagaSource);
-            WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationCopyIconName] = WorkflowDesignerIcons.MakeIcon(enabledImagaSource);
-            WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationCopyDisabledIconName] = WorkflowDesignerIcons.MakeIcon(disabledImagaSource);
-
-            WorkflowDesignerIcons.LoadImageSourceFromResource("Cut.WindowsApp", out enabledImagaSource, out disabledImagaSource);
-            WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationCutIconName] = WorkflowDesignerIcons.MakeIcon(enabledImagaSource);
-            WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationCutDisabledIconName] = WorkflowDesignerIcons.MakeIcon(disabledImagaSource);
-
-            WorkflowDesignerIcons.LoadImageSourceFromResource("Delete.WindowsApp", out enabledImagaSource, out disabledImagaSource);
-            WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationDeleteIconName] = WorkflowDesignerIcons.MakeIcon(enabledImagaSource);
-            WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationDeleteDisabledIconName] = WorkflowDesignerIcons.MakeIcon(disabledImagaSource);
-
-            WorkflowDesignerIcons.LoadImageSourceFromResource("Paste.WindowsApp", out enabledImagaSource, out disabledImagaSource);
-            WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationPasteIconName] = WorkflowDesignerIcons.MakeIcon(enabledImagaSource);
-            WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationPasteDisabledIconName] = WorkflowDesignerIcons.MakeIcon(disabledImagaSource);
-
-            // reset the flag so that we display the toolbox default custom activity icons in toolbox.
-            WorkflowDesignerIcons.IsDefaultCutomActivitySetByUser = false;
-        }
-
-        private static void InitializeDefaultResourceDictionary()
-        {
-            Uri resourceUri = new Uri(string.Concat(typeof(WorkflowDesignerIcons).Assembly.GetName().Name, @";component/Themes/Icons.Default.xaml"), UriKind.RelativeOrAbsolute);
-            ResourceDictionary defaultIcons = (ResourceDictionary)Application.LoadComponent(resourceUri);
-
-            WorkflowDesignerIcons.iconResourceDictionary = new ResourceDictionary();
-
-            foreach (object key in defaultIcons.Keys)
-            {
-                WorkflowDesignerIcons.iconResourceDictionary[key] = defaultIcons[key];
-            }
-
-            ImageSource enabledImagaSource = null;
-            ImageSource disabledImagaSource = null;
-
-            WorkflowDesignerIcons.LoadImageSourceFromResource("Copy.Default", out enabledImagaSource, out disabledImagaSource);
-            WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationCopyIconName] = WorkflowDesignerIcons.MakeIcon(enabledImagaSource);
-            WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationCopyDisabledIconName] = WorkflowDesignerIcons.MakeIcon(disabledImagaSource);
-
-            WorkflowDesignerIcons.LoadImageSourceFromResource("Cut.Default", out enabledImagaSource, out disabledImagaSource);
-            WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationCutIconName] = WorkflowDesignerIcons.MakeIcon(enabledImagaSource);
-            WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationCutDisabledIconName] = WorkflowDesignerIcons.MakeIcon(disabledImagaSource);
-
-            WorkflowDesignerIcons.LoadImageSourceFromResource("Delete.Default", out enabledImagaSource, out disabledImagaSource);
-            WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationDeleteIconName] = WorkflowDesignerIcons.MakeIcon(enabledImagaSource);
-            WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationDeleteDisabledIconName] = WorkflowDesignerIcons.MakeIcon(disabledImagaSource);
-
-            WorkflowDesignerIcons.LoadImageSourceFromResource("Paste.Default", out enabledImagaSource, out disabledImagaSource);
-            WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationPasteIconName] = WorkflowDesignerIcons.MakeIcon(enabledImagaSource);
-            WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationPasteDisabledIconName] = WorkflowDesignerIcons.MakeIcon(disabledImagaSource);
-        }
-
-        private static void LoadImageSourceFromResource(string iconName, out ImageSource enabledImageSource, out ImageSource disabledImageSource)
-        {
-            string uri = string.Format(CultureInfo.InvariantCulture, "pack://application:,,,/System.Activities.Presentation;component/Resources/{0}.png", iconName);
-            BitmapImage image = new BitmapImage(new Uri(uri, UriKind.Absolute));
-            PixelFormat format = PixelFormats.Bgra32;
-            int width = image.PixelWidth;
-            int height = image.PixelHeight;
-            int stride = ((width * format.BitsPerPixel) + 7) / 8;
-            uint[] pixels = new uint[stride * height];
-            
-            image.CopyPixels(pixels, stride, 0);
-
-            enabledImageSource = BitmapSource.Create(width, height, image.DpiX, image.DpiY, format, null, pixels, stride);
-
-            for (int i = 0; i < pixels.Length; ++i)
-            {
-                pixels[i] = WorkflowDesignerIcons.MakePixelGray(pixels[i]);
-            }
-
-            disabledImageSource = BitmapSource.Create(width, height, image.DpiX, image.DpiY, format, null, pixels, stride);
-        }
-
-        private static DrawingBrush MakeIcon(ImageSource imageSource)
-        {
-            DrawingBrush icon = new DrawingBrush();
-            icon.Stretch = Stretch.Uniform;
-            icon.Drawing = new ImageDrawing(imageSource, new Rect(new Size(16, 16)));
-            return icon;
-        }
-
-        private static uint MakePixelGray(uint pixel)
-        {
-            byte blue = (byte)pixel;
-            byte green = (byte)(pixel >> 8);
-            byte red = (byte)(pixel >> 16);
-            byte alpha = (byte)(pixel >> 24);
-
-            byte gray = (byte)(((red * 77) + (green * 150) + (blue * 29) + 128) / 256);
-            return (uint)(alpha << 24 | gray << 16 | gray << 8 | gray);
-        }
-
-        /// <summary>
-        /// Exposes members representing an icon associating with workflow out-of-box activities.
-        /// These icons can be found in the toolbox and/or in the workflow designer.
-        /// </summary>
-        [SuppressMessage("Microsoft.Design", "CA1034", Justification = "This is what our design is.")]
-        [SuppressMessage("Microsoft.Naming", "CA1724", Justification = "This is what our design is.")]
-        public static class Activities
-        {
-            /// <summary>
-            /// Gets or sets the icon for AddToCollection activity.
-            /// </summary>
-            public static DrawingBrush AddToCollection
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.addToCollectionIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.addToCollectionIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for Assign activity.
-            /// </summary>
-            public static DrawingBrush Assign
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.assignIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.assignIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for CancellationScope activity.
-            /// </summary>
-            public static DrawingBrush CancellationScope
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.cancellationScopeIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.cancellationScopeIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for ClearCollection activity.
-            /// </summary>
-            public static DrawingBrush ClearCollection
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.clearCollectionIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.clearCollectionIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for CompensableActivity activity.
-            /// </summary>
-            public static DrawingBrush CompensableActivity
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.compensableActivityIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.compensableActivityIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for Compensate activity.
-            /// </summary>
-            public static DrawingBrush Compensate
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.compensateIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.compensateIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for Confirm activity.
-            /// </summary>
-            public static DrawingBrush Confirm
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.confirmIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.confirmIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for CorrelationScope activity.
-            /// </summary>
-            public static DrawingBrush CorrelationScope
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.correlationScopeIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.correlationScopeIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for Delay activity.
-            /// </summary>
-            public static DrawingBrush Delay
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.delayIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.delayIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for DoWhile activity.
-            /// </summary>
-            public static DrawingBrush DoWhile
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.doWhileIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.doWhileIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for ExistsInCollection activity.
-            /// </summary>
-            public static DrawingBrush ExistsInCollection
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.existsInCollectionIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.existsInCollectionIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for FinalState.
-            /// </summary>
-            public static DrawingBrush FinalState
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.finalStateIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.finalStateIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for Flowchart.
-            /// </summary>
-            public static DrawingBrush Flowchart
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowchartIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowchartIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the toolbox icon for FlowDecision.
-            /// </summary>
-            public static DrawingBrush FlowDecision
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowDecisionIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowDecisionIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the FlowDecision node in the designer.
-            /// </summary>
-            public static DrawingBrush FlowDecisionNode
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowDecisionIconBrushName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowDecisionIconBrushName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the toolbox icon for FlowSwitch.
-            /// </summary>
-            public static DrawingBrush FlowSwitch
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowSwitchIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowSwitchIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the FlowSwitch node in the designer.
-            /// </summary>
-            public static DrawingBrush FlowSwitchNode
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowSwitchIconBrushName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowSwitchIconBrushName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for ForEach activity.
-            /// </summary>
-            public static DrawingBrush ForEach
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.forEachIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.forEachIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the default icon for custom activities.
-            /// </summary>
-            public static DrawingBrush DefaultCustomActivity
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.genericLeafActivityIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IsDefaultCutomActivitySetByUser = true;
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.genericLeafActivityIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for If activity.
-            /// </summary>
-            public static DrawingBrush If
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.ifIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.ifIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for InitializeCorrelation activity.
-            /// </summary>
-            public static DrawingBrush InitializeCorrelation
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.initializeCorrelationIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.initializeCorrelationIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for Interop activity.
-            /// </summary>
-            public static DrawingBrush Interop
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.interopIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.interopIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for InvokeDelegate activity.
-            /// </summary>
-            public static DrawingBrush InvokeDelegate
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.invokeDelegateIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.invokeDelegateIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for InvokeMethod activity.
-            /// </summary>
-            public static DrawingBrush InvokeMethod
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.invokeMethodIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.invokeMethodIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for NoPersistScope activity.
-            /// </summary>
-            public static DrawingBrush NoPersistScope
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.noPersistScopeIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.noPersistScopeIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for ParallelForEach activity.
-            /// </summary>
-            public static DrawingBrush ParallelForEach
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.parallelForEachIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.parallelForEachIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for Parallel activity.
-            /// </summary>
-            public static DrawingBrush Parallel
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.parallelIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.parallelIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for Persist activity.
-            /// </summary>
-            public static DrawingBrush Persist
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.persistIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.persistIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for PickBranch.
-            /// </summary>
-            public static DrawingBrush PickBranch
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.pickBranchIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.pickBranchIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for Pick activity.
-            /// </summary>
-            public static DrawingBrush Pick
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.pickIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.pickIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for ReceiveAndSendReply.
-            /// </summary>
-            public static DrawingBrush ReceiveAndSendReply
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.receiveAndSendReplyIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.receiveAndSendReplyIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for Receive activity.
-            /// </summary>
-            public static DrawingBrush Receive
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.receiveIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.receiveIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for ReceiveReply activity.
-            /// </summary>
-            public static DrawingBrush ReceiveReply
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.receiveReplyIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.receiveReplyIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for RemoveFromCollection activity.
-            /// </summary>
-            public static DrawingBrush RemoveFromCollection
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.removeFromCollectionIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.removeFromCollectionIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for Rethrow activity.
-            /// </summary>
-            public static DrawingBrush Rethrow
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.rethrowIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.rethrowIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for SendAndReceiveReply.
-            /// </summary>
-            public static DrawingBrush SendAndReceiveReply
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.sendAndReceiveReplyIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.sendAndReceiveReplyIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for Send activity.
-            /// </summary>
-            public static DrawingBrush Send
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.sendIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.sendIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for SendReply activity.
-            /// </summary>
-            public static DrawingBrush SendReply
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.sendReplyIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.sendReplyIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for Sequence activity.
-            /// </summary>
-            public static DrawingBrush Sequence
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.sequenceIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.sequenceIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the Start node. This node is used in StateMachine and Flowchart.
-            /// </summary>
-            public static DrawingBrush StartNode
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.startSymbolIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.startSymbolIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for State.
-            /// </summary>
-            public static DrawingBrush State
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.stateIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.stateIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for a state entry in a state machine.
-            /// </summary>
-            public static DrawingBrush StateEntry
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.entryIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.entryIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for a state exit in a state machine.
-            /// </summary>
-            public static DrawingBrush StateExit
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.exitIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.exitIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for StateMachine activity.
-            /// </summary>
-            public static DrawingBrush StateMachine
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.stateMachineIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.stateMachineIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for Switch activity.
-            /// </summary>
-            public static DrawingBrush Switch
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.switchIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.switchIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for TerminateWorkflow activity.
-            /// </summary>
-            public static DrawingBrush TerminateWorkflow
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.terminateWorkflowIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.terminateWorkflowIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for Throw activity.
-            /// </summary>
-            public static DrawingBrush Throw
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.throwIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.throwIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for TransactedReceiveScope activity.
-            /// </summary>
-            public static DrawingBrush TransactedReceiveScope
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.transactedReceiveScopeIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.transactedReceiveScopeIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for TransactionScope activity.
-            /// </summary>
-            public static DrawingBrush TransactionScope
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.transactionScopeIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.transactionScopeIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for a state transition in a state machine.
-            /// </summary>
-            public static DrawingBrush StateTransition
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.transitionIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.transitionIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for TryCatch activity.
-            /// </summary>
-            public static DrawingBrush TryCatch
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.tryCatchIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.tryCatchIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for While activity.
-            /// </summary>
-            public static DrawingBrush While
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.whileIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.whileIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for WriteLine activity.
-            /// </summary>
-            public static DrawingBrush WriteLine
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.writeLineIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.writeLineIconName] = value;
-                }
-            }
-
-            internal static DrawingBrush ToolboxDefaultCustomActivity
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.toolboxDefaultCustomActivityName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.toolboxDefaultCustomActivityName] = value;
-                }
-            }
-        }
-
-        /// <summary>
-        /// Exposes members representing an icon for the context menu items (right click menu) used in the workflow designer.
-        /// </summary>
-        [SuppressMessage("Microsoft.Design", "CA1034", Justification = "This is what our design is.")]
-        public static class ContextMenuItems
-        {
-            /// <summary>
-            /// Gets or sets the icon for the context menu Copy for when the menu is enabled.
-            /// </summary>
-            public static DrawingBrush Copy
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationCopyIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationCopyIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the context menu Copy for when the menu is disabled.
-            /// </summary>
-            public static DrawingBrush CopyDisabled
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationCopyDisabledIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationCopyDisabledIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the context menu Cut for when the menu is enabled.
-            /// </summary>
-            public static DrawingBrush Cut
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationCutIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationCutIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the context menu Cut for when the menu is disabled.
-            /// </summary>
-            public static DrawingBrush CutDisabled
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationCutDisabledIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationCutDisabledIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the context menu Delete for when the menu is enabled.
-            /// </summary>
-            public static DrawingBrush Delete
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationDeleteIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationDeleteIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the context menu Delete for when the menu is disabled.
-            /// </summary>
-            public static DrawingBrush DeleteDisabled
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationDeleteDisabledIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationDeleteDisabledIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the context menu Paste for when the menu is enabled.
-            /// </summary>
-            public static DrawingBrush Paste
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationPasteIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationPasteIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the context menu Paste for when the menu is disabled.
-            /// </summary>
-            public static DrawingBrush PasteDisabled
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationPasteDisabledIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationPasteDisabledIconName] = value;
-                }
-            }
-        }
-
-        /// <summary>
-        /// Exposes members representing an icon associated with the context menu items (right click menu) used
-        /// in the workflow designer.
-        /// </summary>
-        [SuppressMessage("Microsoft.Design", "CA1034", Justification = "This is what our design is.")]
-        public static class DesignerItems
-        {
-            /// <summary>
-            /// Gets or sets the icon for an annotation.
-            /// </summary>
-            public static DrawingBrush Annotation
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.annotationIndicatorIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.annotationIndicatorIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon mainly for indicating errors in an activity definition.
-            /// Note that there are 3 properties for error validation icons.
-            /// These include ActivityErrorValidation, TextBoxErrorValidation and WorkflowErrorValidation.
-            /// For consistency, the same icon should be used for all of them.
-            /// </summary>
-            public static DrawingBrush ActivityErrorValidation
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.errorValidationIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.errorValidationIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the delete button used in DynamicArgumentDialog and TypeCollectionDesigner.
-            /// The icon is used for when the delete button is enabled.
-            /// </summary>
-            public static DrawingBrush DeleteButton
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.deleteIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.deleteIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the delete button used in DynamicArgumentDialog and TypeCollectionDesigner.
-            /// The icon is used for when the delete button is disabled.
-            /// </summary>
-            public static DrawingBrush DeleteDisabledButton
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.deleteDisabledIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.deleteDisabledIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the Fit-To-Screen button located at the bottom right of the designer.
-            /// </summary>
-            public static DrawingBrush FitToScreen
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.fitToScreenIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.fitToScreenIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the Overview control  button (also known as MiniMap) located at the bottom right of the designer.
-            /// </summary>
-            public static DrawingBrush Overview
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.minimapIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.minimapIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the close button used in the Overview control (also known as MiniMap) window.
-            /// </summary>
-            public static DrawingBrush OverviewWindowCloseButton
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.extensionWindowHeaderCloseButtonName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.extensionWindowHeaderCloseButtonName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the move-down button used in DynamicArgumentDialog and TypeCollectionDesigner.
-            /// The icon is used for when the delete button is enabled.
-            /// </summary>
-            public static DrawingBrush MoveDownButton
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.moveDownIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.moveDownIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the move-down button used in DynamicArgumentDialog and TypeCollectionDesigner.
-            /// The icon is used for when the delete button is disabled.
-            /// </summary>
-            public static DrawingBrush MoveDownDisabledButton
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.moveDownDisabledIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.moveDownDisabledIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the move-up button used in DynamicArgumentDialog and TypeCollectionDesigner.
-            /// The icon is used for when the delete button is enabled.
-            /// </summary>
-            public static DrawingBrush MoveUpButton
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.moveUpIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.moveUpIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the move-up button used in DynamicArgumentDialog and TypeCollectionDesigner.
-            /// The icon is used for when the delete button is disabled.
-            /// </summary>
-            public static DrawingBrush MoveUpDisabledButton
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.moveUpDisabledIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.moveUpDisabledIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the Pan control button located at the bottom right of the designer.
-            /// </summary>
-            public static DrawingBrush PanMode
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.panModeIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.panModeIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the resize grip control found in FlowChart and State.
-            /// </summary>
-            public static DrawingBrush ResizeGrip
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.resizeGripIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.resizeGripIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon mainly for indicating errors in an expression textbox (e.g. textboxes inside an activity designer, property grid, arguments window, etc).
-            /// Note that there are 3 properties for error validation icons.
-            /// These include ActivityErrorValidation, TextBoxErrorValidation and WorkflowErrorValidation.
-            /// For consistency, the same icon should be used for all of them.
-            /// </summary>
-            public static DrawingBrush TextBoxErrorValidation
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.textBoxErrorIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.textBoxErrorIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon mainly for indicating errors occurred when loading an invalid workflow Xaml into the designer.
-            /// Note that there are 3 properties for error validation icons.
-            /// These include ActivityErrorValidation, TextBoxErrorValidation and WorkflowErrorValidation.
-            /// For consistency, the same icon should be used for all of them.
-            /// </summary>
-            public static DrawingBrush WorkflowErrorValidation
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.validationErrorIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.validationErrorIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for indicating warnings.
-            /// </summary>
-            public static DrawingBrush WarningValidation
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.warningValidationIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.warningValidationIconName] = value;
-                }
-            }
-
-            /// <summary>
-            /// Gets or sets the icon for the Zoom control button located at the bottom right of the designer.
-            /// </summary>
-            public static DrawingBrush Zoom
-            {
-                get
-                {
-                    return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.zoomIconName] as DrawingBrush;
-                }
-
-                set
-                {
-                    WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.zoomIconName] = value;
-                }
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowElementDialog.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowElementDialog.cs
deleted file mode 100644 (file)
index 0c429b1..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-namespace System.Activities.Presentation
-{
-    using System.Windows;
-    using System.Windows.Controls;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Hosting;
-    using System.Runtime;
-
-    [Fx.Tag.XamlVisible(false)]
-    public class WorkflowElementDialog : ContentControl
-    {
-        public static readonly DependencyProperty ModelItemProperty =
-            DependencyProperty.Register("ModelItem",
-            typeof(ModelItem),
-            typeof(WorkflowElementDialog),
-            new PropertyMetadata(OnModelItemChanged));
-
-        public static readonly DependencyProperty TitleProperty =
-            DependencyProperty.Register("Title",
-            typeof(string),
-            typeof(WorkflowElementDialog));
-
-        public static readonly DependencyProperty ContextProperty =
-            DependencyProperty.Register("Context",
-            typeof(EditingContext),
-            typeof(WorkflowElementDialog));
-
-        public static readonly DependencyProperty WindowResizeModeProperty =
-            DependencyProperty.Register("WindowResizeMode", 
-            typeof(ResizeMode), 
-            typeof(WorkflowElementDialog),
-            new UIPropertyMetadata(ResizeMode.CanResize));
-
-        public static readonly DependencyProperty WindowSizeToContentProperty =
-            DependencyProperty.Register("WindowSizeToContent", 
-            typeof(SizeToContent),
-            typeof(WorkflowElementDialog), 
-            new UIPropertyMetadata(SizeToContent.WidthAndHeight));
-
-        protected WorkflowElementDialog()
-        {
-        }
-
-        public ModelItem ModelItem
-        {
-            get { return (ModelItem)GetValue(ModelItemProperty); }
-            set { SetValue(ModelItemProperty, value); }
-        }
-
-        public string Title
-        {
-            get { return (string)GetValue(TitleProperty); }
-            set { SetValue(TitleProperty, value); }
-        }
-
-        public EditingContext Context
-        {
-            get { return (EditingContext)GetValue(ContextProperty); }
-            set { SetValue(ContextProperty, value); }
-        }
-
-        public DependencyObject Owner
-        {
-            get;
-            set;
-        }
-
-        public ResizeMode WindowResizeMode
-        {
-            get { return (ResizeMode)GetValue(WindowResizeModeProperty); }
-            set { SetValue(WindowResizeModeProperty, value); }
-        }
-
-        public SizeToContent WindowSizeToContent
-        {
-            get { return (SizeToContent)GetValue(WindowSizeToContentProperty); }
-            set { SetValue(WindowSizeToContentProperty, value); }
-        }
-
-        public bool EnableMinimizeButton
-        {
-            get;
-            set;
-        }
-
-        public bool EnableMaximizeButton
-        {
-            get;
-            set;
-        }
-
-        public string HelpKeyword
-        {
-            get;
-            set;
-        }
-
-        internal Func<bool> OnOk
-        {
-            get;
-            set;
-        }
-
-        public void Show()
-        {
-            Show(false);
-        }
-
-        public bool ShowOkCancel()
-        {
-            bool? result = Show(true);
-            return result.HasValue && result.Value;
-        }
-
-        internal void CloseDialog(bool commitChanges)
-        {
-            this.Window.DialogResult = commitChanges;
-        }
-
-        internal WorkflowElementDialogWindow Window
-        {
-            get;
-            set;
-        }
-
-        bool? Show(bool okCancel)
-        {
-            WorkflowElementDialogWindow wnd = new WorkflowElementDialogWindow(this, okCancel, this.EnableMinimizeButton, this.EnableMaximizeButton, this.OnOk) 
-            { 
-                Title = this.Title 
-            };
-            if (null != this.Context)
-            {
-                WindowHelperService srv = this.Context.Services.GetService<WindowHelperService>();
-                if (null != srv)
-                {
-                    srv.TrySetWindowOwner(this.Owner, wnd);
-                }
-            }
-            wnd.Closed += (s, e) => { this.OnWorkflowElementDialogClosed(((Window)s).DialogResult); };
-            return wnd.ShowDialog();
-        }
-
-        protected override void OnInitialized(EventArgs e)
-        {
-            base.OnInitialized(e);
-            // This is necessary for WPF data bindings to work.
-            // It needs to be done explicitly, probably because
-            // this ContentControl doesn't define its own 
-            // Template.VisualTree (maybe it should).
-            this.DataContext = this;
-        }
-
-        protected void EnableOk(bool enabled)
-        {
-            if (this.Window != null)
-            {
-                this.Window.okButton.IsEnabled = enabled;
-            }
-        }
-
-        protected virtual void OnModelItemChanged(object newItem)
-        {
-        }
-
-        protected virtual void OnWorkflowElementDialogClosed(bool? dialogResult)
-        {
-        }
-
-        static void OnModelItemChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
-        {
-            WorkflowElementDialog dialog = (WorkflowElementDialog)dependencyObject;
-            dialog.OnModelItemChanged(e.NewValue);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowElementDialogWindow.xaml.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowElementDialogWindow.xaml.cs
deleted file mode 100644 (file)
index 000aed5..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Runtime;
-    using System.Windows;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Runtime.InteropServices;
-    using System.Activities.Presentation.View;
-    using System.Windows.Interop;
-    using System.Windows.Input;
-    using System.ComponentModel;
-
-    [Fx.Tag.XamlVisible(false)]
-    internal partial class WorkflowElementDialogWindow
-    {
-        WorkflowElementDialog payload;
-        bool okCancel;
-
-        //default MinButton and MaxButton to true
-        private bool enableMinButton = true;
-        private bool enableMaxButton = true;
-
-        private Func<bool> onOk;
-
-        public WorkflowElementDialogWindow(WorkflowElementDialog payload, bool okCancel, bool enableMinButton, bool enableMaxButton, Func<bool> onOk)
-        {
-            this.payload = payload;
-            this.okCancel = okCancel;
-            this.enableMinButton = enableMinButton;
-            this.enableMaxButton = enableMaxButton;
-            this.onOk = onOk;
-            InitializeComponent();
-        }
-
-        protected override void OnInitialized(EventArgs e)
-        {
-            base.OnInitialized(e);
-            this.payload.Window = this;
-            this.payloadHolder.Child = this.payload;
-
-            this.MinWidth = this.payload.MinWidth;
-            this.MinHeight = this.payload.MinHeight;
-            this.MaxWidth = this.payload.MaxWidth;
-            this.MaxHeight = this.payload.MaxHeight;
-            this.ResizeMode = this.payload.WindowResizeMode;
-            this.SizeToContent = this.payload.WindowSizeToContent;
-
-            this.Context = payload.Context;
-            if (payload.HelpKeyword != null)
-            {
-                this.HelpKeyword = payload.HelpKeyword;
-            }
-
-            if (0.0 != this.payload.MinWidth)
-            {
-                this.Width = this.payload.MinWidth;
-            }
-            if (0.0 != this.payload.MinHeight)
-            {
-                this.Height = this.payload.MinHeight;
-            }
-
-            this.payload.MinWidth = this.payload.MinHeight = 0.0;
-            this.payload.MaxWidth = this.payload.MaxWidth = double.PositiveInfinity;
-
-            if (!this.okCancel)
-            {
-                this.buttonPanel.Children.Remove(this.cancelButton);
-            }
-        }
-
-        void OK_Click(object sender, RoutedEventArgs e)
-        {
-            if (this.onOk == null || this.onOk())
-            {
-                this.DialogResult = true;
-            }
-        }
-
-        [SuppressMessage(FxCop.Category.Performance, FxCop.Rule.AvoidUncalledPrivateCode,
-            Justification = "This function is called in the xaml file")]
-        void OnWindowClosed(object sender, EventArgs e)
-        {
-            this.payload.Window = null;
-            this.payloadHolder.Child = null;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowFileItem.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowFileItem.cs
deleted file mode 100644 (file)
index 6c91591..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-
-namespace System.Activities.Presentation
-{
-    using System;
-
-    public class WorkflowFileItem : ContextItem
-    {
-        public string LoadedFile
-        { set; get; }
-
-        public sealed override Type ItemType
-        {
-            get { return typeof(WorkflowFileItem); }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowItemPresenter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowItemPresenter.cs
deleted file mode 100644 (file)
index e76ba7c..0000000
+++ /dev/null
@@ -1,1203 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Hosting;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Services;
-    using System.Activities.Presentation.View;
-    using System.Activities.Statements;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Controls;
-    using System.Windows.Data;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using System.Windows.Shapes;
-    using System.Windows.Threading;
-    using System.Timers;
-
-    enum InsertionPosition
-    {
-        Before,
-        After,
-        None,
-    }
-
-    class AutoWrapEventArgs : EventArgs
-    {
-        public Activity ExistingActivity { get; set; }
-        public InsertionPosition InsertionPosition { get; set; }
-        public List<Activity> ActivitiesToBeInserted { get; set; }
-    }
-
-    // This class provides a visual edit box to edit ModelItems. Textbox offers to edit strings, ints as a TextBlock and a cursor visually,
-    // The workflowitempresenter edits modelitems by picking their view using the view service. It presents s the visual for the modelitem
-    // pointe by Item property if it is set, it shows the hint text if the property is not set. It allows the associated item to be deleted 
-    // visually , and removes the reference to Item when deleted. It also allows droping ModelItems, to set the Item property to the dropped 
-    // item.
-    public sealed class WorkflowItemPresenter : ContentControl, ICompositeView
-    {
-        public static readonly DependencyProperty HintTextProperty =
-            DependencyProperty.Register("HintText", typeof(string), typeof(WorkflowItemPresenter), new UIPropertyMetadata(String.Empty));
-
-        public static readonly DependencyProperty ItemProperty =
-            DependencyProperty.Register("Item", typeof(ModelItem), typeof(WorkflowItemPresenter), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(WorkflowItemPresenter.OnItemChanged)));
-
-        public static readonly DependencyProperty AllowedItemTypeProperty =
-            DependencyProperty.Register("AllowedItemType", typeof(Type), typeof(WorkflowItemPresenter), new UIPropertyMetadata(typeof(object)));
-
-        public static readonly DependencyProperty IsDefaultContainerProperty =
-            DependencyProperty.Register("IsDefaultContainer", typeof(bool), typeof(WorkflowItemPresenter), new UIPropertyMetadata(false));
-
-        public static readonly DependencyProperty DroppingTypeResolvingOptionsProperty =
-            DependencyProperty.Register("DroppingTypeResolvingOptions", typeof(TypeResolvingOptions), typeof(WorkflowItemPresenter));
-
-        SpacerHelper spacerHelper;
-        Grid contentGrid;
-        StackPanel stackPanel;
-        Grid containerGrid;
-        TextBlock text;
-        EditingContext context = null;
-        bool shouldSetFocus = false;
-        bool isItemPastedOrDropped = false;
-
-        public WorkflowItemPresenter()
-        {
-            this.text = new TextBlock();
-            this.text.SetBinding(TextBlock.TextProperty, "HintText");
-            this.text.DataContext = this;
-            this.text.HorizontalAlignment = HorizontalAlignment.Center;
-            this.text.VerticalAlignment = VerticalAlignment.Center;
-            this.text.Foreground = new SolidColorBrush(SystemColors.GrayTextColor);
-            this.text.FontStyle = FontStyles.Italic;
-
-            this.contentGrid = new Grid();
-            this.contentGrid.Background = Brushes.Transparent;
-            this.contentGrid.VerticalAlignment = VerticalAlignment.Center;
-            this.contentGrid.Children.Add(text);
-
-            this.stackPanel = new StackPanel();
-            this.stackPanel.HorizontalAlignment = HorizontalAlignment.Center;
-            this.stackPanel.VerticalAlignment = VerticalAlignment.Center;
-            this.stackPanel.Children.Add(contentGrid);
-
-            this.containerGrid = new Grid();
-            this.containerGrid.Children.Add(stackPanel);
-            this.containerGrid.Background = Brushes.Transparent;
-        }
-        
-        internal bool AutoWrapInSequenceEnabled
-        {
-            get
-            {
-                // Don't allow auto wrap in sequence if allowed item isn't of type of Activity
-                return this.Context != null
-                    && this.Context.Services.GetService<DesignerConfigurationService>().AutoSurroundWithSequenceEnabled
-                    && typeof(Activity).IsAssignableFrom(this.AllowedItemType); 
-            }
-        }
-
-        Activity MyActivity
-        {
-            get
-            {
-                return this.Item == null ? null :
-                    this.Item.GetCurrentValue() as Activity;
-            }
-        }
-
-        List<Activity> ObjectList2ActivityList(IEnumerable<object> droppedObjects)
-        {
-            List<Activity> activityList = new List<Activity>();
-            foreach (object droppedObject in droppedObjects)
-            {
-                object modelObject = droppedObject;
-                if (modelObject is ModelItem)
-                {
-                    modelObject = ((ModelItem)droppedObject).GetCurrentValue();
-                }
-                if (modelObject is Activity)
-                {
-                    activityList.Add(modelObject as Activity);
-                }
-                else
-                {
-                    Fx.Assert("A non-activity is found in the list, there must be something seriously wrong!");
-                }
-            }
-            return activityList;
-        }
-
-        private List<WorkflowViewElement> ObjectList2WorkflowViewElementList(IEnumerable<object> droppedObjects)
-        {
-            List<WorkflowViewElement> movedViewElements = new List<WorkflowViewElement>();
-            foreach (object droppedObject in droppedObjects)
-            {
-                if (droppedObject is ModelItem && ((ModelItem)droppedObject).View != null)
-                {
-                    WorkflowViewElement view = (WorkflowViewElement)((ModelItem)droppedObject).View;
-                    WorkflowItemPresenter container = DragDropHelper.GetCompositeView(view) as WorkflowItemPresenter;
-                    if (container != this)
-                    {
-                        movedViewElements.Add(view);
-                    }
-                }
-            }
-            return movedViewElements;
-        }
-
-        // return true if really something is dropped, otherwise, false.
-        bool DoAutoWrapDrop(InsertionPosition insertionPos, IEnumerable<object> droppedObjects)
-        {
-            List<Activity> activityList = ObjectList2ActivityList(droppedObjects);
-            if (activityList.Count == 0)
-            {
-                return false;
-            }
-
-            AutoWrapEventArgs args = new AutoWrapEventArgs()
-            {
-                InsertionPosition = insertionPos,
-                ExistingActivity = this.MyActivity,
-                ActivitiesToBeInserted = activityList
-            };
-
-            using (ModelEditingScope scope = this.Context.Services.GetService<ModelService>().Root.BeginEdit(SR.WrapInSequenceDescription))
-            {
-                ModelItem sequenceActivity = WorkflowItemPresenter.AutoWrapInSequenceHandler(this.Context, args);
-                if (this.UpdateItem(sequenceActivity, true))
-                {
-                    scope.Complete();
-                    return true;
-                }
-                else
-                {
-                    scope.Revert();
-                    return false;
-                }
-            }
-        }
-
-        bool DoAutoWrapDrop(InsertionPosition insertionPos, DragEventArgs e, IList<object> droppedObjects = null)
-        {
-            if (droppedObjects == null)
-            {
-                ModelTreeManager manager = this.Context.Services.GetRequiredService<ModelTreeManager>();
-                EditingScope editingScope = null;
-
-                try
-                {
-                    editingScope = ModelItemHelper.TryCreateImmediateEditingScope(manager, SR.WrapInSequenceDescription);
-
-                    droppedObjects = this.GetSortedObjectList(e);
-
-                    if (!this.DoAutoWrapDrop(insertionPos, droppedObjects))
-                    {
-                        return false;
-                    }
-
-                    if (editingScope != null)
-                    {
-                        editingScope.Complete();
-                    }
-                }
-                finally
-                {
-                    if (editingScope != null)
-                    {
-                        editingScope.Dispose();
-                        editingScope = null;
-                    }
-                }
-            }
-            else
-            {
-                if (!this.DoAutoWrapDrop(insertionPos, droppedObjects))
-                {
-                    return false;
-                }
-            }
-
-            if (!DragDropHelper.IsDraggingFromToolbox(e))
-            {
-                List<WorkflowViewElement> movedViewElements = ObjectList2WorkflowViewElementList(droppedObjects);
-                DragDropHelper.SetDragDropMovedViewElements(e, movedViewElements);
-
-                //Backward compatibility for 4.0
-                if (droppedObjects.Count == 1 && movedViewElements.Count == 1)
-                {
-                    #pragma warning disable 618
-                    DragDropHelper.SetDragDropCompletedEffects(e, DragDropEffects.Move);
-                    #pragma warning restore 618
-                }
-            }
-            else
-            {
-                Fx.Assert(droppedObjects.Count == 1, "Dropping from Toolbox with count != 1");
-
-                // Set focus if it is dropping from ToolBox.
-                // In common drag/drop, the selection setting is done at the end of
-                // StartDragging().
-                if (this.Item == null)
-                {
-                    return true;
-                }
-                
-                Fx.Assert(typeof(Sequence).IsAssignableFrom(this.Item.ItemType), 
-                    "Auto Wrap didn't add a sequence. Is Item.Properties[\"Activities\"] still correct?");
-                foreach (ModelItem item in this.Item.Properties["Activities"].Collection)
-                {
-                    // Find the ModelItem whose value is an activity from Toolbox.
-                    if (item.GetCurrentValue() == droppedObjects[0])
-                    {
-                        this.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, (Action)(() =>
-                        {
-                            item.Focus();
-                        }));
-                        break;
-                    }
-                }
-            }
-
-            return true;
-        }
-
-        protected override void OnInitialized(EventArgs e)
-        {
-            base.OnInitialized(e);
-            this.AllowDrop = true;
-            this.Content = containerGrid;
-            ICompositeViewEvents containerEvents = null;
-            bool isDefault = false;
-
-            this.Loaded += (s, eventArgs) =>
-            {
-                isDefault = this.IsDefaultContainer;
-                DependencyObject parent = VisualTreeHelper.GetParent(this);
-                while (null != parent && !typeof(ICompositeViewEvents).IsAssignableFrom(parent.GetType()))
-                {
-                    parent = VisualTreeHelper.GetParent(parent);
-                }
-                containerEvents = parent as ICompositeViewEvents;
-                if (null != containerEvents)
-                {
-                    if (isDefault)
-                    {
-                        containerEvents.RegisterDefaultCompositeView(this);
-                    }
-                    else
-                    {
-                        containerEvents.RegisterCompositeView(this);
-                    }
-                }
-                this.shouldSetFocus = true;
-
-                if (this.AutoWrapInSequenceEnabled)
-                {
-                    // spacer and placer holder
-                    this.spacerHelper = new SpacerHelper(this);
-                }
-            };
-
-            this.Unloaded += (s, eventArgs) =>
-            {
-                if (null != containerEvents)
-                {
-                    if (isDefault)
-                    {
-                        containerEvents.UnregisterDefaultCompositeView(this);
-                    }
-                    else
-                    {
-                        containerEvents.UnregisterCompositeView(this);
-                    }
-                }
-                this.shouldSetFocus = false;
-
-                if (this.AutoWrapInSequenceEnabled)
-                {
-                    if (this.spacerHelper != null)
-                    {
-                        this.spacerHelper.Unload();
-                        this.spacerHelper = null;
-                    }
-                }
-            };
-        }
-
-        public string HintText
-        {
-            get { return (string)GetValue(HintTextProperty); }
-            set { SetValue(HintTextProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public ModelItem Item
-        {
-            get { return (ModelItem)GetValue(ItemProperty); }
-            set { SetValue(ItemProperty, value); }
-        }
-
-        public Type AllowedItemType
-        {
-            get { return (Type)GetValue(AllowedItemTypeProperty); }
-            set { SetValue(AllowedItemTypeProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public TypeResolvingOptions DroppingTypeResolvingOptions
-        {
-            get { return (TypeResolvingOptions)GetValue(DroppingTypeResolvingOptionsProperty); }
-            set { SetValue(DroppingTypeResolvingOptionsProperty, value); }
-        }
-
-        EditingContext Context
-        {
-            get
-            {
-                if (context == null)
-                {
-                    IModelTreeItem modelTreeItem = this.Item as IModelTreeItem;
-                    if (modelTreeItem != null)
-                    {
-                        this.context = modelTreeItem.ModelTreeManager.Context;
-                    }
-                    else // There is no ModelItem yet, try to walk up the tree to find a WorkflowViewElement.
-                    {
-                        WorkflowViewElement parentViewElement = GetParentWorkflowViewElement();
-                        if (parentViewElement != null)
-                        {
-                            this.context = parentViewElement.Context;
-                        }
-                    }
-                }
-                return context;
-            }
-        }
-
-
-        public bool IsDefaultContainer
-        {
-            get { return (bool)GetValue(IsDefaultContainerProperty); }
-            set { SetValue(IsDefaultContainerProperty, value); }
-        }
-
-        protected override void OnRender(DrawingContext drawingContext)
-        {
-            CutCopyPasteHelper.RegisterWithParentViewElement(this);
-            base.OnRender(drawingContext);
-        }
-
-        private WorkflowViewElement GetParentWorkflowViewElement()
-        {
-            // Walk the logic tree first.
-            FrameworkElement parent = (FrameworkElement)this.Parent;
-            while (parent != null && !(parent is WorkflowViewElement))
-            {
-                parent = parent.Parent as FrameworkElement;
-            }
-            WorkflowViewElement result = parent as WorkflowViewElement;
-            // If not found, walk the visual tree.
-            if (null == result)
-            {
-                parent = VisualTreeHelper.GetParent(this) as FrameworkElement;
-                while (parent != null && !(parent is WorkflowViewElement))
-                {
-                    parent = VisualTreeHelper.GetParent(parent) as FrameworkElement;
-                }
-                result = parent as WorkflowViewElement;
-            }
-            return result;
-        }
-
-
-        static void OnItemChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
-        {
-            WorkflowItemPresenter control = (WorkflowItemPresenter)dependencyObject;
-            control.OnItemChanged(e);
-        }
-
-        void OnItemChanged(DependencyPropertyChangedEventArgs e)
-        {
-            object newItem = e.NewValue;
-            PopulateContent();
-
-            if (newItem != null)
-            {
-                //We want to set the selection only if the item is dropped or pasted. 
-                //We cannot set the selection in UpdateItem, since while pasting that would still be in EditingScope and this.Item will be null.
-                if (this.isItemPastedOrDropped)
-                {
-                    Fx.Assert(this.Item != null, "Item cannot be null");
-                    // If we are currently moving from somewhere else to a WorkflowItemPresenter, the currently 
-                    // focusing view element will be removed, we need to set the keyboard focus explicitly to 
-                    // avoid WPF FocusManager to focus on an element, leading to flashing effect.
-                    Keyboard.Focus((UIElement)this.Item.View);
-                    this.isItemPastedOrDropped = false;
-                }
-                if (this.shouldSetFocus)
-                {
-                    this.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, (Action)(() =>
-                    {
-                        // check for Item == null, we found an interesting bug, where the user 
-                        // could drop something in here, and undo the change before the code below
-                        // could execute
-                        if (this.Item != null)
-                        {
-                            UIElement view = (UIElement)(this.Item.View);
-                            if (view != null)
-                            {
-                                Keyboard.Focus(view);
-                                Selection.SelectOnly(this.Context, this.Item);
-                            }
-                        }
-                        //this.shouldSetFocus = false;
-                    }));
-                }
-            }
-            else
-            {
-                // remove the selection if the previous value was selected.
-                if (this.Context != null)
-                {
-                    if (this.Context.Items.GetValue<Selection>().SelectedObjects.Contains(e.OldValue))
-                    {
-                        this.Context.Items.SetValue(new Selection(new ModelItem[] { }));
-                    }
-                }
-            }
-        }
-
-
-        void PopulateContent()
-        {
-            if (this.Item != null)
-            {
-                VirtualizedContainerService containerService = this.Context.Services.GetService<VirtualizedContainerService>();
-                UIElement itemView = containerService.GetContainer(this.Item, this);
-                this.contentGrid.Children.Clear();
-                this.contentGrid.Children.Add(itemView);
-            }
-            else
-            {
-                contentGrid.Children.Clear();
-                contentGrid.Children.Add(text);
-            }
-        }
-
-        bool UpdateItem(object newItem)
-        {
-            return UpdateItem(newItem, false);
-        }
-
-        bool UpdateItem(object newItem, bool allowReplaceExistingActivity)
-        {
-            bool updateSucceeded = false;
-            ModelItem newModelItem = newItem as ModelItem;
-            if (this.Item == null || allowReplaceExistingActivity)
-            {
-                if (newModelItem == null && newItem != null)
-                {
-                    // try to wrap the droppedObject in  a ModelItem.
-                    ModelServiceImpl modelService = (ModelServiceImpl)this.Context.Services.GetService<ModelService>();
-                    newModelItem = modelService.WrapAsModelItem(newItem);
-                }
-                if (this.CanUpdateItem(newModelItem))
-                {
-                    // In order to allow for model updates that happens during the model item is drop, this is all done in an atomic unit.
-                    using (ModelEditingScope editingScope = this.Context.Services.GetService<ModelService>().Root.BeginEdit(SR.PropertyChangeEditingScopeDescription))
-                    {
-                        this.Item = newModelItem;
-                        editingScope.Complete();
-                    }
-                    updateSucceeded = true;
-                    this.isItemPastedOrDropped = true;
-                }
-            }
-            return updateSucceeded;
-
-        }
-
-        bool CanUpdateItem(ModelItem newModelItem)
-        {
-            return null != newModelItem
-                && TypeUtilities.IsTypeCompatible(newModelItem.ItemType, this.AllowedItemType)
-                && !this.IsInParentChain(newModelItem);
-        }
-
-        List<object> GetSortedObjectList(DragEventArgs args)
-        {
-            IEnumerable<object> droppedObjects = DragDropHelper.GetDroppedObjects(this, args, this.context);
-            return DragDropHelper.SortSelectedObjects(droppedObjects);
-        }
-
-        bool DoSingleDrop(object droppedObject, DragEventArgs args)
-        {
-            if (UpdateItem(droppedObject))
-            {
-                args.Handled = true;
-                #pragma warning disable 618
-                DragDropHelper.SetDragDropCompletedEffects(args, DragDropEffects.Move);
-                #pragma warning restore 618
-                if (droppedObject is ModelItem && ((ModelItem)droppedObject).View != null)
-                {
-                    DragDropHelper.SetDragDropMovedViewElements(args, new WorkflowViewElement[] { ((ModelItem)droppedObject).View as WorkflowViewElement });
-                }
-
-                return true;
-            }
-
-            return false;
-        }
-
-        protected override void OnDrop(DragEventArgs e)
-        {
-            ModelTreeManager manager = this.Context.Services.GetService<ModelTreeManager>();
-
-            // When dragging from toolbox:
-            //     editingScope should not be null
-            //     there should only be one item
-            // When dragging from canvas:
-            //     editingScope should be null
-            // Call editingScope.Complete() to commit changes, otherwise the editing scope will be aborted
-            using (EditingScope editingScope = ModelItemHelper.TryCreateImmediateEditingScope(manager, SR.PropertyChangeEditingScopeDescription))
-            {
-                List<object> droppedObjects = this.GetSortedObjectList(e);
-#pragma warning disable 618
-                DragDropHelper.SetDragDropCompletedEffects(e, DragDropEffects.None);
-#pragma warning restore 618
-                if (droppedObjects == null || droppedObjects.Count == 0)
-                {
-                    return;
-                }
-                if (droppedObjects.Count == 1)
-                {
-                    if (this.DoSingleDrop(droppedObjects[0], e))
-                    {
-                        if (editingScope != null)
-                        {
-                            editingScope.Complete();
-                        }
-                    }
-                    return;
-                }
-                else
-                {
-                    // multi drop
-                    Fx.Assert(editingScope == null, "editingScope should be null for dragging from canvas.");
-                    this.DoAutoWrapDrop(InsertionPosition.None, e, droppedObjects);
-                }
-                base.OnDrop(e);
-            }
-        }
-
-        void OnDrag(DragEventArgs e)
-        {
-            if (!e.Handled)
-            {
-                this.UpdateEffects(e);
-                e.Handled = true;
-            }
-        }
-
-        void UpdateEffects(DragEventArgs args)
-        {
-            if (!DragDropHelper.AllowDrop(args.Data, this.Context, this.AllowedItemType))
-            {
-                args.Effects = DragDropEffects.None;
-            }
-        }
-
-        protected override void OnDragEnter(DragEventArgs e)
-        {
-            this.OnDrag(e);
-            base.OnDragEnter(e);
-        }
-
-        protected override void OnDragOver(DragEventArgs e)
-        {
-            this.OnDrag(e);
-            base.OnDragOver(e);
-        }
-
-        protected override void OnMouseDown(MouseButtonEventArgs e)
-        {
-            // do not move focus if it's a ctrl right click.
-            if (e.RightButton == MouseButtonState.Pressed)
-            {
-                if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
-                {
-                    e.Handled = true;
-                    base.OnMouseDown(e);
-                    return;
-                }
-            }
-
-            // Schedule the Keyboard.Focus command to let it execute later than WorkflowViewElement.OnMouseDown, 
-            // where WorkflowViewElement will move the keyboard focus on itself
-            this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)(() =>
-            {
-                Keyboard.Focus((FrameworkElement)this);
-            }));
-            base.OnMouseDown(e);
-        }
-
-        private bool IsInParentChain(ModelItem droppedModelItem)
-        {
-            bool isInParentChain = false;
-            // start with immediate workflowviewElement outside this.
-            WorkflowViewElement parentViewElement = GetParentWorkflowViewElement();
-            if (parentViewElement != null)
-            {
-                ModelItem parentModelItem = parentViewElement.ModelItem;
-                while (parentModelItem != null)
-                {
-                    if (parentModelItem == droppedModelItem)
-                    {
-                        isInParentChain = true;
-                        break;
-                    }
-                    parentModelItem = parentModelItem.Parent;
-                }
-            }
-            return isInParentChain;
-        }
-
-        void DeleteItem()
-        {
-            this.Item = null;
-            this.PopulateContent();
-        }
-
-        void ICompositeView.OnItemMoved(ModelItem modelItem)
-        {
-            if (this.Item == modelItem)
-            {
-                this.Item = null;
-            }
-        }
-
-        protected override AutomationPeer OnCreateAutomationPeer()
-        {
-            return new WorkflowItemPresenterAutomationPeer(this);
-        }
-
-
-        object ICompositeView.OnItemsCut(List<ModelItem> itemsToCut)
-        {
-            Fx.Assert(itemsToCut.Count == 1, "Only one item can be cut");
-            Fx.Assert(itemsToCut[0].Equals(this.Item), "Only one item can be cut.");
-            this.DeleteItem();
-            return null;
-        }
-
-        object ICompositeView.OnItemsCopied(List<ModelItem> itemsToCopy)
-        {
-            return null;
-        }
-
-        void ICompositeView.OnItemsPasted(List<object> itemsToPaste, List<object> metaData, Point pastePoint, WorkflowViewElement pastePointReference)
-        {
-            if (itemsToPaste.Count == 1)
-            {
-                // Single Paste
-                UpdateItem(itemsToPaste[0]);
-            }
-            else
-            {
-                // Mutiple Paste.
-                IList<object> sortedList = CutCopyPasteHelper.SortFromMetaData(itemsToPaste, metaData);
-                Fx.Assert(this.Item == null, "multi-paste on item != null is not supported now");
-                this.DoAutoWrapDrop(InsertionPosition.None, sortedList); 
-            }
-        }
-
-        void ICompositeView.OnItemsDelete(List<ModelItem> itemsToDelete)
-        {
-            if (null != itemsToDelete && itemsToDelete.Contains(this.Item))
-            {
-                this.DeleteItem();
-            }
-        }
-
-
-        bool ICompositeView.CanPasteItems(List<object> itemsToPaste)
-        {
-            return null != itemsToPaste &&
-                itemsToPaste.Count > 0 &&
-                null != itemsToPaste[0] &&
-                null == this.Item &&
-                ((itemsToPaste[0] is ModelItem && this.CanUpdateItem((ModelItem)itemsToPaste[0])) ||
-                (itemsToPaste[0] is Type && this.AllowedItemType.IsAssignableFrom((Type)itemsToPaste[0])) ||
-                this.AllowedItemType.IsAssignableFrom(itemsToPaste[0].GetType()));
-        }
-
-
-        class WorkflowItemPresenterAutomationPeer : UIElementAutomationPeer
-        {
-            WorkflowItemPresenter owner;
-
-            public WorkflowItemPresenterAutomationPeer(WorkflowItemPresenter owner)
-                : base(owner)
-            {
-                this.owner = owner;
-            }
-
-            protected override AutomationControlType GetAutomationControlTypeCore()
-            {
-                return AutomationControlType.Custom;
-            }
-
-            protected override string GetAutomationIdCore()
-            {
-                string baseAutomationID = base.GetAutomationIdCore();
-                if (!string.IsNullOrEmpty(baseAutomationID))
-                {
-                    return baseAutomationID;
-                }
-                return this.owner.GetType().Name;
-            }
-
-            protected override string GetNameCore()
-            {
-                // Return an empty string if an activity is dropped on the presenter
-                if (owner.Item != null)
-                {
-                    return string.Empty;
-                }
-                string name = base.GetNameCore();
-                if (string.IsNullOrEmpty(name))
-                {
-                    name = this.owner.HintText;
-                }
-                return name;
-            }
-
-            protected override string GetClassNameCore()
-            {
-                return this.owner.GetType().Name;
-            }
-        }
-
-        private static ModelItem AutoWrapInSequenceHandler(EditingContext editingContext, AutoWrapEventArgs e)
-        {
-            Fx.Assert(e.ExistingActivity != null || e.InsertionPosition == InsertionPosition.None, 
-                "Existing activity must not be null");
-
-            ModelItem sequence = editingContext.Services.GetService<ModelTreeManager>().CreateModelItem(null, new Sequence());
-            foreach (Activity activity in e.ActivitiesToBeInserted)
-            {
-                sequence.Properties["Activities"].Collection.Add(activity);
-            }
-
-            switch (e.InsertionPosition)
-            {
-                case InsertionPosition.Before:
-                    sequence.Properties["Activities"].Collection.Add(e.ExistingActivity);
-                    break;
-                case InsertionPosition.After:
-                    sequence.Properties["Activities"].Collection.Insert(0, e.ExistingActivity);
-                    break;
-                case InsertionPosition.None:
-                    break;
-                default:
-                    Fx.Assert("Invalid insert position");
-                    break;
-            }
-
-            return sequence;
-        }
-
-        // NOTE: This wrapper method is exclusively called by TransitionDesigner, because
-        // WIP of Transition.Action would handle the event if the dragged source comes from
-        // WIP of Transition.Trigger (see Bug 201342).  However, Auto-Surround spacer is usually
-        // handled in DragEnter handler of WIP, and other ActivityDesigner should not need to 
-        // access this method directly.
-        internal void ShowSpacerHelperOnDraggedItems(DragEventArgs arg)
-        {
-            this.spacerHelper.OnWfItemPresenterPreviewDragEnter(this, arg);
-        }
-
-        // classes and helpers for Spacer
-        private sealed class SpacerWrapper
-        {
-            public FrameworkElement Spacer { get; set; }
-            public SpacerPlaceholder Placeholder { get; set; }
-
-            public void ShowSpacer()
-            {
-                if (Spacer != null)
-                {
-                    Spacer.Visibility = Visibility.Visible;
-                }
-                if (Placeholder != null)
-                {
-                    Placeholder.Visibility = Visibility.Collapsed;
-                }
-            }
-
-            public void HideSpacer()
-            {
-                if (Spacer != null)
-                {
-                    Spacer.Visibility = Visibility.Collapsed;
-                }
-                if (Placeholder != null)
-                {
-                    Placeholder.Visibility = Visibility.Visible;
-                }
-            }
-
-            public bool HighlightPlaceholder
-            {
-                set
-                {
-                    this.Placeholder.TargetVisiable = value;
-                }
-            }
-        }
-
-        // All the e.Handle = true in OnDragXXXEnter/Leave/Over:
-        // Prevent the events to be further handled by OnDrag, which will set DragDropEffects to None
-        private sealed class SpacerHelper
-        {
-            public SpacerWrapper TopSpacerWrapper { get; set; }
-            public SpacerWrapper BottomSpacerWrapper { get; set; }
-            public Timer SpacerTimer { get; set; }
-
-            private WorkflowItemPresenter wfItemPresenter;
-            private SpacerWrapper SpacerToShow { get; set; }
-
-            static private SpacerHelper uniqueSpacerHelper = null;
-
-            static private SpacerHelper UniqueSpacerHelper
-            {
-                set
-                {
-                    if (uniqueSpacerHelper == value)
-                    {
-                        return;
-                    }
-                    if (uniqueSpacerHelper != null)
-                    {
-                        uniqueSpacerHelper.HighLighted = false;
-                    }
-                    uniqueSpacerHelper = value;
-                    if (uniqueSpacerHelper != null)
-                    {
-                        uniqueSpacerHelper.HighLighted = true;
-                    }
-                }
-            }
-
-            public SpacerHelper(WorkflowItemPresenter wfItemPresenter)
-            {
-                Fx.Assert(wfItemPresenter != null, "null WorkflowItemPresenter");
-                this.TopSpacerWrapper = new SpacerWrapper();
-                this.BottomSpacerWrapper = new SpacerWrapper();
-                this.wfItemPresenter = wfItemPresenter;
-                Loaded();
-            }
-
-            public bool HighLighted 
-            {
-                set
-                {
-                    this.TopSpacerWrapper.HighlightPlaceholder = value;
-                    this.BottomSpacerWrapper.HighlightPlaceholder = value;
-                }
-            }
-
-            public void Unload()
-            {
-                // event
-                this.wfItemPresenter.containerGrid.PreviewDrop  -= new DragEventHandler(OnContainerGridPreviewDrop);
-                this.wfItemPresenter.PreviewDragEnter           -= new DragEventHandler(OnWfItemPresenterPreviewDragEnter);
-                this.wfItemPresenter.PreviewDragLeave           -= new DragEventHandler(OnWfItemPresenterPreviewDragLeave);
-
-                this.TopSpacerWrapper.Placeholder.DragEnter     -= new DragEventHandler(OnTopPlaceholderDragEnter);
-                this.TopSpacerWrapper.Placeholder.DragLeave     -= new DragEventHandler(OnPlaceHoderDragLeave);
-                this.TopSpacerWrapper.Spacer.DragEnter          -= new DragEventHandler(OnTopSpacerDragEnter);
-                this.TopSpacerWrapper.Spacer.DragLeave          -= new DragEventHandler(OnTopSpacerDragLeave);
-
-                this.BottomSpacerWrapper.Placeholder.DragEnter  -= new DragEventHandler(OnBottomPlaceholderDragEnter);
-                this.BottomSpacerWrapper.Placeholder.DragLeave  -= new DragEventHandler(OnPlaceHoderDragLeave);
-                this.BottomSpacerWrapper.Spacer.DragEnter       -= new DragEventHandler(OnBottomSpacerDragEnter);
-                this.BottomSpacerWrapper.Spacer.DragLeave       -= new DragEventHandler(OnBottomSpacerDragLeave);
-
-                this.SpacerTimer.Elapsed -= new ElapsedEventHandler(OnSpacerTimerElapsed);
-            }
-
-            void UpdateEffects(DragEventArgs args)
-            {
-                if (this.wfItemPresenter.Item == null)
-                {
-                    // Item is null, then use WIP's UpdateEffects.
-                    this.wfItemPresenter.UpdateEffects(args);
-                    return;
-                }
-
-                if (!this.AllowDropOnSpacer(args))
-                {
-                    args.Effects = DragDropEffects.None;
-                }
-            }
-
-            void OnTopPlaceholderDragEnter(object sender, DragEventArgs e)
-            {
-                this.UpdateEffects(e);
-                this.OnPlaceholderEnter(this.TopSpacerWrapper, e);
-                e.Handled = true;
-            }
-
-            void OnBottomPlaceholderDragEnter(object sender, DragEventArgs e)
-            {
-                this.UpdateEffects(e);
-                this.OnPlaceholderEnter(this.BottomSpacerWrapper, e);
-                e.Handled = true;
-            }
-
-            void OnPlaceHoderDragLeave(object sender, DragEventArgs e)
-            {
-                this.UpdateEffects(e);
-                this.SpacerTimer.Stop();
-                e.Handled = true;
-            }
-
-            void OnTopSpacerDragEnter(object sender, DragEventArgs e)
-            {
-                this.UpdateEffects(e);
-                this.TopSpacerWrapper.ShowSpacer();
-                e.Handled = true;
-            }
-
-            void OnTopSpacerDragLeave(object sender, DragEventArgs e)
-            {
-                this.TopSpacerWrapper.HideSpacer();
-                e.Handled = true;
-            }
-
-            void OnBottomSpacerDragEnter(object sender, DragEventArgs e)
-            {
-                this.BottomSpacerWrapper.ShowSpacer();
-                e.Handled = true;
-            }
-
-            void OnBottomSpacerDragLeave(object sender, DragEventArgs e)
-            {
-                this.UpdateEffects(e);
-                this.BottomSpacerWrapper.HideSpacer();
-                e.Handled = true;
-            }
-
-            void OnSpacerOrPlaceholderDragOver(object sender, DragEventArgs e)
-            {
-                this.UpdateEffects(e);
-                e.Handled = true;
-            }
-
-            void OnSpacerDrop(object sender, DragEventArgs e)
-            {
-                if (!this.AllowDropOnSpacer(e))
-                {
-                    return;
-                }
-                InsertionPosition insertionPos = (sender == this.BottomSpacerWrapper.Spacer)
-                    ? InsertionPosition.After : InsertionPosition.Before;
-
-                ModelItemHelper.TryCreateImmediateEditingScopeAndExecute(this.wfItemPresenter.Context, SR.WrapInSequenceDescription, (es) =>
-                {
-                    if (this.wfItemPresenter.DoAutoWrapDrop(insertionPos, e))
-                    {
-                        // auto wrap is successful
-                        if (es != null)
-                        {
-                            // if we created an immedate editing scope, try to complete it.
-                            es.Complete();
-                        }
-                    }
-                });
-            }
-
-            void OnPlaceholderDrop(object sender, DragEventArgs e)
-            {
-                if (!this.AllowDropOnSpacer(e))
-                {
-                    return;
-                }
-                InsertionPosition insertionPos = (sender == this.BottomSpacerWrapper.Placeholder)
-                    ? InsertionPosition.After : InsertionPosition.Before;
-                ModelItemHelper.TryCreateImmediateEditingScopeAndExecute(this.wfItemPresenter.Context, SR.WrapInSequenceDescription, (es) =>
-                    {
-                        if (this.wfItemPresenter.DoAutoWrapDrop(insertionPos, e))
-                        {
-                            // auto wrap is successful
-                            if (es != null)
-                            {
-                                // if we created an immediate editing scope, try to complete it.
-                                es.Complete();
-                            }
-                        }
-                    });
-            }
-
-            void OnSpacerTimerElapsed(object sender, ElapsedEventArgs e)
-            {
-                this.wfItemPresenter.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
-                {
-                    if (this.SpacerToShow != null)
-                    {
-                        SpacerToShow.ShowSpacer();
-                        SpacerToShow = null;
-                    }
-                }));
-            }
-
-            void OnContainerGridPreviewDrop(object sender, DragEventArgs e)
-            {
-                this.SpacerTimer.Stop();
-                this.TopSpacerWrapper.HideSpacer();
-                this.BottomSpacerWrapper.HideSpacer();
-                UniqueSpacerHelper = null;
-            }
-
-            private FrameworkElement CreateAndInitializeSpacer(VerticalAlignment alignment)
-            {
-                FrameworkElement spacer = (SpacerTemplate != null)
-                    ? (FrameworkElement)SpacerTemplate.LoadContent()
-                    : new Rectangle();
-                spacer.AllowDrop = true;
-                spacer.DragOver += new DragEventHandler(OnSpacerOrPlaceholderDragOver);
-                spacer.Drop += new DragEventHandler(OnSpacerDrop);
-                spacer.VerticalAlignment = alignment;
-                spacer.IsHitTestVisible = true;
-                spacer.Visibility = Visibility.Collapsed;
-                return spacer;
-            }
-
-            void OnWfItemPresenterPreviewDragLeave(object sender, DragEventArgs e)
-            {
-                UniqueSpacerHelper = null;
-                this.TopSpacerWrapper.HideSpacer();
-                this.BottomSpacerWrapper.HideSpacer();
-            }
-
-            // this method is made internal because WorkflowItemPresenter.ShowSpacerHelperOnDraggedItems
-            // needs to access this method to show the spacer UI gesture for Auto-surround.
-            internal void OnWfItemPresenterPreviewDragEnter(object sender, DragEventArgs arg)
-            {
-                if (!this.AllowDropOnSpacer(arg))
-                {
-                    return;
-                }
-                UniqueSpacerHelper = this;
-            }
-
-            private void Loaded()
-            {
-                this.TopSpacerWrapper.Spacer            = CreateAndInitializeSpacer(VerticalAlignment.Bottom);
-                this.TopSpacerWrapper.Placeholder       = CreateSpacerPlaceHolder();
-                this.BottomSpacerWrapper.Spacer         = CreateAndInitializeSpacer(VerticalAlignment.Top);
-                this.BottomSpacerWrapper.Placeholder    = CreateSpacerPlaceHolder();
-
-                // timer
-                this.SpacerTimer = new Timer(500);
-                this.SpacerTimer.Elapsed += new ElapsedEventHandler(OnSpacerTimerElapsed);
-                this.SpacerTimer.AutoReset = false;
-
-                // view
-                this.wfItemPresenter.stackPanel.Children.Insert(0, TopSpacerWrapper.Spacer);
-                this.wfItemPresenter.stackPanel.Children.Insert(0, TopSpacerWrapper.Placeholder);
-                this.wfItemPresenter.stackPanel.Children.Insert(this.wfItemPresenter.stackPanel.Children.Count, BottomSpacerWrapper.Spacer);
-                this.wfItemPresenter.stackPanel.Children.Insert(this.wfItemPresenter.stackPanel.Children.Count, BottomSpacerWrapper.Placeholder);
-                this.wfItemPresenter.containerGrid.Background = Brushes.Transparent;
-
-                // event
-                this.wfItemPresenter.containerGrid.PreviewDrop  += new DragEventHandler(OnContainerGridPreviewDrop);
-                this.wfItemPresenter.PreviewDragEnter           += new DragEventHandler(OnWfItemPresenterPreviewDragEnter);
-                this.wfItemPresenter.PreviewDragLeave           += new DragEventHandler(OnWfItemPresenterPreviewDragLeave);
-                this.TopSpacerWrapper.Placeholder.DragEnter     += new DragEventHandler(OnTopPlaceholderDragEnter);
-                this.TopSpacerWrapper.Placeholder.DragLeave     += new DragEventHandler(OnPlaceHoderDragLeave);
-                this.TopSpacerWrapper.Spacer.DragEnter          += new DragEventHandler(OnTopSpacerDragEnter);
-                this.TopSpacerWrapper.Spacer.DragLeave          += new DragEventHandler(OnTopSpacerDragLeave);
-
-                this.BottomSpacerWrapper.Placeholder.DragEnter  += new DragEventHandler(OnBottomPlaceholderDragEnter);
-                this.BottomSpacerWrapper.Placeholder.DragLeave  += new DragEventHandler(OnPlaceHoderDragLeave);
-                this.BottomSpacerWrapper.Spacer.DragEnter       += new DragEventHandler(OnBottomSpacerDragEnter);
-                this.BottomSpacerWrapper.Spacer.DragLeave       += new DragEventHandler(OnBottomSpacerDragLeave);
-            }
-
-            private static DataTemplate defaultSpacerTemplate = CreateDefaultSpacerTemplate();
-
-            private static DataTemplate SpacerTemplate
-            {
-                get { return defaultSpacerTemplate; }
-            }
-
-            private static DataTemplate CreateDefaultSpacerTemplate()
-            {
-                FrameworkElementFactory feFactory = new FrameworkElementFactory(typeof(VerticalConnector));
-                DataTemplate dt = new DataTemplate() { VisualTree = feFactory };
-                dt.Seal();
-                return dt;
-            }
-
-            private SpacerPlaceholder CreateSpacerPlaceHolder()
-            {
-                // The place holder should be something that can triger DragEnter
-                SpacerPlaceholder spacerPlaceholder = new SpacerPlaceholder { MinHeight = 20, Visibility = Visibility.Visible, AllowDrop = true };
-                spacerPlaceholder.DragOver += new DragEventHandler(OnSpacerOrPlaceholderDragOver);
-                spacerPlaceholder.Drop += new DragEventHandler(OnPlaceholderDrop);
-                return spacerPlaceholder; 
-            }
-
-            private void OnPlaceholderEnter(SpacerWrapper wrapper, DragEventArgs e)
-            {
-                if (!this.AllowDropOnSpacer(e))
-                {
-                    return;
-                }
-                this.SpacerToShow = wrapper;
-                this.SpacerTimer.Start();
-                e.Handled = true;
-            }
-
-            private bool AllowDropOnSpacer(DragEventArgs e)
-            {
-                return (this.wfItemPresenter.Item != null
-                    && !this.IsOwnerActivityBeingDragged(e)
-                    && DragDropHelper.AllowDrop(typeof(Sequence), this.wfItemPresenter.AllowedItemType)     // Is Sequence allowed to be dropped inside the WIP? Beause it will trigger AutoWrap.
-                    && DragDropHelper.AllowDrop(e.Data, this.wfItemPresenter.Context, typeof(Activity)));   // Is the item being dragged allowed to be dropped onto Sequence?
-            }
-
-            private bool IsOwnerActivityBeingDragged(DragEventArgs e)
-            {
-                if (this.wfItemPresenter.Item == null)
-                {
-                    return false;
-                }
-                else
-                {
-                    // In case of a toolbox drop, DragDropHelper.GetObjectsToBeDropped 
-                    //  will create an instance, which will possibliy pop up a type picker
-                    //  dialog for generic activities. So check for it first and avoid
-                    //  pop up dialogs.
-                    if (DragDropHelper.IsDraggingFromToolbox(e))
-                    {
-                        return false;
-                    }
-                    IEnumerable<ModelItem> draggedObjects = DragDropHelper.GetDraggedModelItems(e);
-                    return draggedObjects.Contains(this.wfItemPresenter.Item);
-                }
-            }
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowItemsPresenter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowItemsPresenter.cs
deleted file mode 100644 (file)
index 38e814d..0000000
+++ /dev/null
@@ -1,961 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-#pragma warning disable 618
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Internal.PropertyEditing;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Services;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Collections.Specialized;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Linq;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Controls;
-    using System.Windows.Input;
-    using System.Windows.Markup;
-    using System.Windows.Media;
-    using System.Windows.Threading;
-    using System.Activities.Presentation.View;
-    using System.Windows.Shapes;
-
-    // This is similar to the WorkflowItemPresenter , but its an edit box for collections. It supports drag drop, and delete.
-    // it auto refreshes the collection on collection changed events.
-    public class WorkflowItemsPresenter : ContentControl, IMultipleDragEnabledCompositeView
-    {
-
-        public static readonly DependencyProperty HintTextProperty =
-            DependencyProperty.Register("HintText", typeof(string), typeof(WorkflowItemsPresenter), new UIPropertyMetadata(String.Empty, new PropertyChangedCallback(WorkflowItemsPresenter.OnHintTextChanged)));
-
-        public static readonly DependencyProperty ItemsProperty =
-            DependencyProperty.Register("Items", typeof(ModelItemCollection), typeof(WorkflowItemsPresenter), new FrameworkPropertyMetadata(null, new PropertyChangedCallback(WorkflowItemsPresenter.OnItemsChanged)));
-
-        public static readonly DependencyProperty SpacerTemplateProperty =
-            DependencyProperty.Register("SpacerTemplate", typeof(DataTemplate), typeof(WorkflowItemsPresenter), new UIPropertyMetadata(null));
-
-        public static readonly DependencyProperty HeaderTemplateProperty =
-            DependencyProperty.Register("HeaderTemplate", typeof(DataTemplate), typeof(WorkflowItemsPresenter), new UIPropertyMetadata(null));
-
-        public static readonly DependencyProperty FooterTemplateProperty =
-            DependencyProperty.Register("FooterTemplate", typeof(DataTemplate), typeof(WorkflowItemsPresenter), new UIPropertyMetadata(null));
-
-        public static readonly DependencyProperty ItemsPanelProperty =
-            DependencyProperty.Register("ItemsPanel", typeof(ItemsPanelTemplate), typeof(WorkflowItemsPresenter), new FrameworkPropertyMetadata(null, new PropertyChangedCallback(WorkflowItemsPresenter.OnItemsPanelChanged)));
-
-        public static readonly DependencyProperty IndexProperty =
-            DependencyProperty.RegisterAttached("Index", typeof(int), typeof(WorkflowItemsPresenter), new UIPropertyMetadata(addAtEndMarker));
-
-        public static readonly DependencyProperty AllowedItemTypeProperty =
-            DependencyProperty.Register("AllowedItemType", typeof(Type), typeof(WorkflowItemsPresenter), new UIPropertyMetadata(typeof(object)));
-
-        public static readonly DependencyProperty IsDefaultContainerProperty =
-            DependencyProperty.Register("IsDefaultContainer", typeof(bool), typeof(WorkflowItemsPresenter), new UIPropertyMetadata(false));
-
-        public static readonly DependencyProperty DroppingTypeResolvingOptionsProperty =
-            DependencyProperty.Register("DroppingTypeResolvingOptions", typeof(TypeResolvingOptions), typeof(WorkflowItemsPresenter));
-
-
-        const int addAtEndMarker = -2;
-
-        int selectedSpacerIndex;
-
-
-        ItemsControl panel;
-        Grid hintTextGrid;
-        EditingContext context = null;
-        bool isRegisteredWithParent = false;
-        bool populateOnLoad = false;
-        bool handleSpacerGotKeyboardFocus = false;
-        Grid outerGrid;
-
-        public WorkflowItemsPresenter()
-        {
-            panel = new ItemsControl();
-            panel.Focusable = false;
-            hintTextGrid = new Grid();
-            hintTextGrid.Focusable = false;
-            hintTextGrid.Background = Brushes.Transparent;
-            hintTextGrid.DataContext = this;
-            hintTextGrid.SetBinding(Grid.MinHeightProperty, "MinHeight");
-            hintTextGrid.SetBinding(Grid.MinWidthProperty, "MinWidth");
-            TextBlock text = new TextBlock();
-            text.Focusable = false;
-            text.SetBinding(TextBlock.TextProperty, "HintText");
-            text.HorizontalAlignment = HorizontalAlignment.Center;
-            text.VerticalAlignment = VerticalAlignment.Center;
-            text.DataContext = this;
-            text.Foreground = new SolidColorBrush(SystemColors.GrayTextColor);
-            text.FontStyle = FontStyles.Italic;
-            ((IAddChild)hintTextGrid).AddChild(text);
-
-            this.outerGrid = new Grid()
-            {
-                RowDefinitions = { new RowDefinition(), new RowDefinition() },
-                ColumnDefinitions = { new ColumnDefinition() }
-            };
-            Grid.SetRow(this.panel, 0);
-            Grid.SetColumn(this.panel, 0);
-            Grid.SetRow(this.hintTextGrid, 1);
-            Grid.SetColumn(this.hintTextGrid, 0);
-            this.outerGrid.Children.Add(panel);
-            this.outerGrid.Children.Add(hintTextGrid);
-        }
-
-
-        public Type AllowedItemType
-        {
-            get { return (Type)GetValue(AllowedItemTypeProperty); }
-            set { SetValue(AllowedItemTypeProperty, value); }
-        }
-
-        public string HintText
-        {
-            get { return (string)GetValue(HintTextProperty); }
-            set { SetValue(HintTextProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public DataTemplate SpacerTemplate
-        {
-            get { return (DataTemplate)GetValue(SpacerTemplateProperty); }
-            set { SetValue(SpacerTemplateProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public DataTemplate HeaderTemplate
-        {
-            get { return (DataTemplate)GetValue(HeaderTemplateProperty); }
-            set { SetValue(HeaderTemplateProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public DataTemplate FooterTemplate
-        {
-            get { return (DataTemplate)GetValue(FooterTemplateProperty); }
-            set { SetValue(FooterTemplateProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public ItemsPanelTemplate ItemsPanel
-        {
-            get { return (ItemsPanelTemplate)GetValue(ItemsPanelProperty); }
-            set { SetValue(ItemsPanelProperty, value); }
-        }
-
-        [SuppressMessage(FxCop.Category.Usage, FxCop.Rule.CollectionPropertiesShouldBeReadOnly,
-            Justification = "Setter is provided to enable setting this property in code.")]
-        [Fx.Tag.KnownXamlExternal]
-        public ModelItemCollection Items
-        {
-            get { return (ModelItemCollection)GetValue(ItemsProperty); }
-            set { SetValue(ItemsProperty, value); }
-        }
-
-        EditingContext Context
-        {
-            get
-            {
-                if (context == null)
-                {
-                    IModelTreeItem modelTreeItem = this.Items as IModelTreeItem;
-                    if (modelTreeItem != null)
-                    {
-                        this.context = modelTreeItem.ModelTreeManager.Context;
-                    }
-                }
-                return context;
-            }
-        }
-
-        public bool IsDefaultContainer
-        {
-            get { return (bool)GetValue(IsDefaultContainerProperty); }
-            set { SetValue(IsDefaultContainerProperty, value); }
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public TypeResolvingOptions DroppingTypeResolvingOptions
-        {
-            get { return (TypeResolvingOptions)GetValue(DroppingTypeResolvingOptionsProperty); }
-            set { SetValue(DroppingTypeResolvingOptionsProperty, value); }
-        }
-
-        static void OnHintTextChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
-        {
-            WorkflowItemsPresenter itemsPresenter = (WorkflowItemsPresenter)dependencyObject;
-            itemsPresenter.UpdateHintTextVisibility(e.NewValue as string);
-        }
-
-        static void OnItemsChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
-        {
-            WorkflowItemsPresenter itemsPresenter = (WorkflowItemsPresenter)dependencyObject;
-            itemsPresenter.OnItemsChanged((ModelItemCollection)e.OldValue, (ModelItemCollection)e.NewValue);
-        }
-
-        static void OnItemsPanelChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
-        {
-            WorkflowItemsPresenter itemsPresenter = (WorkflowItemsPresenter)dependencyObject;
-            itemsPresenter.panel.ItemsPanel = (ItemsPanelTemplate)e.NewValue;
-        }
-
-        void OnItemsChanged(ModelItemCollection oldItemsCollection, ModelItemCollection newItemsCollection)
-        {
-            if (oldItemsCollection != null)
-            {
-                oldItemsCollection.CollectionChanged -= this.OnCollectionChanged;
-            }
-
-            if (newItemsCollection != null)
-            {
-                newItemsCollection.CollectionChanged += this.OnCollectionChanged;
-            }
-
-            if (!isRegisteredWithParent)
-            {
-                CutCopyPasteHelper.RegisterWithParentViewElement(this);
-                isRegisteredWithParent = true;
-            }
-            populateOnLoad = false;
-            PopulateContent();
-        }
-
-        void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
-        {
-            // if this.Items is null, and we are getting a collection changed that 
-            // means this event some how happened before this can get the unloaded event
-            // and unsubscribe from this event.
-            if (this.Items == null)
-            {
-                return;
-            }
-            bool fullRepopulateNeeded = true;
-
-            // when one item is dropped into this items presenter focus on the new view element for it.
-            if (e.Action == NotifyCollectionChangedAction.Add
-                && e.NewItems != null
-                && e.NewItems.Count == 1)
-            {
-                // insert itemview and spacer
-                fullRepopulateNeeded = false;
-                int itemViewIndex = GetViewIndexForItem(e.NewStartingIndex);
-                VirtualizedContainerService containerService = this.Context.Services.GetService<VirtualizedContainerService>();
-                UIElement itemView = containerService.GetContainer((ModelItem)e.NewItems[0], this);
-                this.panel.Items.Insert(itemViewIndex, itemView as UIElement);
-                // index 2 + i*2 + 1 is spacer i+1
-                FrameworkElement spacer = CreateSpacer();
-                this.panel.Items.Insert(itemViewIndex + 1, spacer);
-
-
-                ModelItem insertedItem = (ModelItem)e.NewItems[0];
-                this.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, (Action)(() =>
-                {
-                    UIElement view = (UIElement)insertedItem.View;
-                    if (view != null)
-                    {
-                        Keyboard.Focus(view);
-                    }
-                }));
-            }
-
-            else if (e.Action == NotifyCollectionChangedAction.Remove)
-            {
-                if (e.OldItems != null && e.OldItems.Count == 1)
-                {
-                    fullRepopulateNeeded = false;
-                    int itemViewIndex = GetViewIndexForItem(e.OldStartingIndex);
-                    this.panel.Items.RemoveAt(itemViewIndex);
-                    //remove spacer also
-                    this.panel.Items.RemoveAt(itemViewIndex);
-                }
-
-                if (this.Items.Count == 0)
-                {
-                    fullRepopulateNeeded = true;
-                }
-
-                // deselect removed items
-                if (this.Context != null)
-                {
-                    IList<ModelItem> selectedItems = this.Context.Items.GetValue<Selection>().SelectedObjects.ToList();
-                    foreach (ModelItem selectedAndRemovedItem in selectedItems.Intersect(e.OldItems.Cast<ModelItem>()))
-                    {
-                        Selection.Toggle(this.Context, selectedAndRemovedItem);
-                    }
-                }
-            }
-            if (this.Items.Count > 0)
-            {
-                this.hintTextGrid.Visibility = Visibility.Collapsed;
-            }
-            else
-            {
-                this.hintTextGrid.Visibility = Visibility.Visible;
-            }
-
-            if (fullRepopulateNeeded)
-            {
-                PopulateContent();
-            }
-        }
-
-        protected override void OnInitialized(EventArgs e)
-        {
-            base.OnInitialized(e);
-            this.AllowDrop = true;
-            this.Content = outerGrid;
-            if (this.ItemsPanel != null)
-            {
-                this.panel.ItemsPanel = this.ItemsPanel;
-            }
-
-            ICompositeViewEvents containerEvents = null;
-            bool isDefault = false;
-
-            this.Loaded += (s, eventArgs) =>
-            {
-                isDefault = this.IsDefaultContainer;
-                selectedSpacerIndex = addAtEndMarker;
-                DependencyObject parent = VisualTreeHelper.GetParent(this);
-                while (null != parent && !typeof(ICompositeViewEvents).IsAssignableFrom(parent.GetType()))
-                {
-                    parent = VisualTreeHelper.GetParent(parent);
-                }
-                containerEvents = parent as ICompositeViewEvents;
-                if (null != containerEvents)
-                {
-                    if (isDefault)
-                    {
-                        containerEvents.RegisterDefaultCompositeView(this);
-                    }
-                    else
-                    {
-                        containerEvents.RegisterCompositeView(this);
-                    }
-                }
-                if (this.Items != null)
-                {
-                    //UnRegistering because of 137896: Inside tab control multiple Loaded events happen without an Unloaded event.
-                    this.Items.CollectionChanged -= new NotifyCollectionChangedEventHandler(OnCollectionChanged);
-                    this.Items.CollectionChanged += new NotifyCollectionChangedEventHandler(OnCollectionChanged);
-                }
-                if (populateOnLoad)
-                {
-                    this.PopulateContent();
-                }
-            };
-
-            this.Unloaded += (s, eventArgs) =>
-            {
-                if (null != containerEvents)
-                {
-                    if (isDefault)
-                    {
-                        containerEvents.UnregisterDefaultCompositeView(this);
-                    }
-                    else
-                    {
-                        containerEvents.UnregisterCompositeView(this);
-
-                    }
-                }
-                if (this.Items != null)
-                {
-                    this.Items.CollectionChanged -= new NotifyCollectionChangedEventHandler(OnCollectionChanged);
-                }
-                populateOnLoad = true;
-            };
-        }
-
-        void PopulateContent()
-        {
-            this.panel.Items.Clear();
-
-            if (this.Items != null)
-            {
-
-                // index 0 is header.
-                ContentControl header = new ContentControl();
-                header.Focusable = false;
-                header.ContentTemplate = this.HeaderTemplate;
-                header.SetValue(IndexProperty, 0);
-                header.Drop += new DragEventHandler(OnSpacerDrop);
-                this.panel.Items.Add(header);
-
-                // index 1 is first spacer
-                FrameworkElement startSpacer = CreateSpacer();
-                this.panel.Items.Add(startSpacer);
-
-                foreach (ModelItem item in this.Items)
-                {
-                    // index 2 + i*2 is itemView i
-                    VirtualizedContainerService containerService = this.Context.Services.GetService<VirtualizedContainerService>();
-                    UIElement itemView = containerService.GetContainer(item, this);
-                    this.panel.Items.Add(itemView as UIElement);
-                    // index 2 + i*2 + 1 is spacer i+1
-                    FrameworkElement spacer = CreateSpacer();
-                    this.panel.Items.Add(spacer);
-                }
-                // index 2 + count*2 is footer 
-                ContentControl footer = new ContentControl();
-                footer.ContentTemplate = this.FooterTemplate;
-                footer.Focusable = true;
-                footer.IsHitTestVisible = true;
-                footer.IsTabStop = true;
-                footer.SetValue(IndexProperty, addAtEndMarker);
-                footer.Drop += new DragEventHandler(OnSpacerDrop);
-                footer.LostFocus += new RoutedEventHandler(OnSpacerLostFocus);
-                footer.GotFocus += new RoutedEventHandler(OnSpacerGotFocus);
-                this.panel.Items.Add(footer);
-                footer.Focusable = false;
-            }
-            UpdateHintTextVisibility(HintText);
-        }
-
-        int GetViewIndexForItem(int itemIndex)
-        {
-            return 2 + itemIndex * 2;
-        }
-
-        int GetViewIndexForSpacer(int spacerIndex)
-        {
-            return 2 + spacerIndex * 2 + 1;
-        }
-
-        int GetSpacerIndex(int viewIndex)
-        {
-            if (viewIndex == 1)
-            {
-                return 0;
-            }
-            else
-            {
-                return (viewIndex - 3) / 2 + 1;
-            }
-        }
-
-        void UpdateHintTextVisibility(string hintText)
-        {
-            if (this.hintTextGrid != null && this.Items != null)
-            {
-                this.hintTextGrid.Visibility = (this.Items.Count == 0 && !string.IsNullOrEmpty(hintText)) ? Visibility.Visible : Visibility.Collapsed;
-            }
-        }
-
-        private IList<object> GetOrderMetaData(List<ModelItem> items)
-        {
-            List<ModelItem> sortedList = this.SortSelectedItems(new List<ModelItem>(items));
-            this.CheckListConsistentAndThrow(items, sortedList);
-            return sortedList.Select((m) => m.GetCurrentValue()).ToList();
-        }
-
-        private FrameworkElement CreateSpacer()
-        {
-            FrameworkElement spacer = (this.SpacerTemplate != null) ? (FrameworkElement)this.SpacerTemplate.LoadContent() : new Rectangle();
-            spacer.IsHitTestVisible = true;
-            Control spacerControl = spacer as Control;
-            if (spacerControl != null)
-            {
-                spacerControl.IsTabStop = true;
-            }
-            spacer.Drop += new DragEventHandler(OnSpacerDrop);
-            spacer.LostFocus += new RoutedEventHandler(OnSpacerLostFocus);
-            spacer.GotFocus += new RoutedEventHandler(OnSpacerGotFocus);
-            spacer.GotKeyboardFocus += new KeyboardFocusChangedEventHandler(OnSpacerGotKeyboardFocus);
-            spacer.MouseDown += new MouseButtonEventHandler(OnSpacerMouseDown);
-            return spacer;
-        }
-
-        void OnSpacerDrop(object sender, DragEventArgs e)
-        {
-            int index = GetSpacerIndexFromView(sender);
-            OnItemsDropped(e, index);
-        }
-
-        private int GetSpacerIndexFromView(object sender)
-        {
-            if (((DependencyObject)sender).ReadLocalValue(IndexProperty) != DependencyProperty.UnsetValue)
-            {
-                int index = (int)((DependencyObject)sender).GetValue(IndexProperty);
-                return index;
-            }
-            else
-            {
-                return GetSpacerIndex(this.panel.Items.IndexOf(sender));
-            }
-        }
-
-        void OnSpacerGotFocus(object sender, RoutedEventArgs e)
-        {
-            int index = GetSpacerIndexFromView(sender);
-            selectedSpacerIndex = index;
-        }
-
-        void OnSpacerGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
-        {
-            // Handle the event so that it won't be routed to the containing designer to affect selection
-            if (handleSpacerGotKeyboardFocus)
-            {
-                e.Handled = true;
-            }
-        }
-
-        void OnSpacerLostFocus(object sender, RoutedEventArgs e)
-        {
-            int index = GetSpacerIndexFromView(sender);
-            selectedSpacerIndex = addAtEndMarker;
-        }
-
-        void OnSpacerMouseDown(object sender, MouseButtonEventArgs e)
-        {
-            // do not move focus if it's a ctrl right click.
-            if (e.RightButton == MouseButtonState.Pressed)
-            {
-                if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
-                {
-                    return;
-                }
-            }
-
-            // Schedule the Keyboard.Focus command to let it execute later than WorkflowViewElement.OnMouseDown
-            this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)(() =>
-            {
-                this.handleSpacerGotKeyboardFocus = true;
-                Keyboard.Focus((FrameworkElement)sender);
-                this.handleSpacerGotKeyboardFocus = false;
-            }));
-        }
-
-        private bool ShouldMoveItems(List<ModelItem> sortedModelItems, int index)
-        {
-            if (sortedModelItems.Count == 0)
-            {
-                return false;
-            }
-
-            // Should move if the items are not next to each other
-            if (!AreItemsConsecutive(sortedModelItems))
-            {
-                return true;
-            }
-
-            // Should not move if the new position is just before the first item or just after the last item or between them.
-            return index < this.Items.IndexOf(sortedModelItems[0]) || index > this.Items.IndexOf(sortedModelItems.Last()) + 1;
-        }
-
-        private bool AreItemsConsecutive(List<ModelItem> sortedModelItems)
-        {
-            Fx.Assert(sortedModelItems.Count > 0, "Should have at least one item.");
-            int oldIndex = this.Items.IndexOf(sortedModelItems[0]);
-            foreach (ModelItem item in sortedModelItems)
-            {
-                if (oldIndex != this.Items.IndexOf(item))
-                {
-                    return false;
-                }
-                oldIndex++;
-            }
-            return true;
-        }
-
-        public List<ModelItem> SortSelectedItems(List<ModelItem> selectedItems)
-        {
-            if (selectedItems == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("selectedItems");
-            }
-            if (selectedItems.Count < 2)
-            {
-                return selectedItems;
-            }
-
-            List<ModelItem> list = new List<ModelItem>();
-            // If the performance here is bad, we can use HashSet for selectedItems
-            // to improve
-            foreach (ModelItem item in this.Items)
-            {
-                int index = selectedItems.IndexOf(item);
-                if (index >= 0)
-                {
-                    // use the reference in selectedItems.
-                    list.Add(selectedItems[index]);
-                }
-            }
-
-            // in case passing some items that are not in
-            // my container.
-            if (list.Count != selectedItems.Count)
-            {
-                // throw FxTrace.Exception.
-                throw FxTrace.Exception.AsError(new ArgumentException(SR.Error_CantFindItemInWIsP));
-            }
-            return list;
-        }
-
-        public void OnItemsMoved(List<ModelItem> movedItems)
-        {
-            if (movedItems == null)
-            {
-                throw FxTrace.Exception.ArgumentNull("movedItems");
-            }
-
-            DragDropHelper.ValidateItemsAreOnView(movedItems, this.Items);
-            this.OnItemsDelete(movedItems);
-        }
-
-        void OnItemsDropped(DragEventArgs e, int index)
-        {
-            ModelItemHelper.TryCreateImmediateEditingScopeAndExecute(this.Items.GetEditingContext(), System.Activities.Presentation.SR.CollectionAddEditingScopeDescription, (es) =>
-            {
-                DragDropHelper.SetDragDropCompletedEffects(e, DragDropEffects.None);
-                List<object> droppedObjects = new List<object>(DragDropHelper.GetDroppedObjects(this, e, Context));
-                List<WorkflowViewElement> movedViewElements = new List<WorkflowViewElement>();
-
-                List<object> externalMoveList = new List<object>();
-                List<ModelItem> internalMoveList = new List<ModelItem>();
-
-                // Step 1: Sort the list
-                List<object> sortedDroppingList = DragDropHelper.SortSelectedObjects(droppedObjects);
-
-
-                // Step 2: Categorize dropped objects by their source container.
-                foreach (object droppedObject in sortedDroppingList)
-                {
-                    ModelItem modelItem = droppedObject as ModelItem;
-                    WorkflowViewElement view = (modelItem == null) ? null : (modelItem.View as WorkflowViewElement);
-                    if (view == null)
-                    {
-                        externalMoveList.Add(droppedObject);
-                        continue;
-                    }
-                    UIElement container = DragDropHelper.GetCompositeView(view);
-                    if (container == this)
-                    {
-                        internalMoveList.Add(modelItem);
-                        continue;
-                    }
-                    movedViewElements.Add(view);
-                    externalMoveList.Add(droppedObject);
-                }
-
-                // Step 3: Internal movement
-                if (this.ShouldMoveItems(internalMoveList, index))
-                {
-                    foreach (ModelItem modelItem in internalMoveList)
-                    {
-                        int oldIndex = this.Items.IndexOf(modelItem);
-                        this.Items.Remove(modelItem);
-
-                        //if element is placed ahead of old location, decrement the index not to include moved object
-                        if (oldIndex < index)
-                        {
-                            this.InsertItem(index - 1, modelItem);
-                        }
-                        else
-                        {
-                            this.InsertItem(index, modelItem);
-                            index++;
-                        }
-                    }
-                }
-
-                // Step 4: External move and drop from toolbox
-                foreach (object droppedObject in externalMoveList)
-                {
-                    if (!this.IsDropAllowed(droppedObject))
-                    {
-                        continue;
-                    }
-                    this.InsertItem(index++, droppedObject);
-                    DragDropHelper.SetDragDropCompletedEffects(e, DragDropEffects.Move);
-                }
-                DragDropHelper.SetDragDropMovedViewElements(e, movedViewElements);
-                e.Handled = true;
-                if (es != null)
-                {
-                    es.Complete();
-                }
-            });
-        }
-
-        private void CheckListConsistentAndThrow(List<ModelItem> src, List<ModelItem> copied)
-        {
-            bool valid = DragDropHelper.AreListsIdenticalExceptOrder(src, copied);
-            if (!valid)
-            {
-                throw FxTrace.Exception.AsError(new InvalidOperationException(SR.Error_BadOutputFromSortSelectedItems));
-            }
-        }
-
-        private bool IsDropAllowed(object droppedObject)
-        {
-            bool isDropAllowed = false;
-            ModelItem modelItem = droppedObject as ModelItem;
-            if (modelItem != null && !IsInParentChain(modelItem))
-            {
-                if (this.AllowedItemType.IsAssignableFrom(modelItem.ItemType))
-                {
-                    isDropAllowed = true;
-                }
-            }
-            else if (droppedObject is Type && this.AllowedItemType.IsAssignableFrom((Type)droppedObject))
-            {
-                isDropAllowed = true;
-            }
-            else
-            {
-                if (this.AllowedItemType.IsAssignableFrom(droppedObject.GetType()))
-                {
-                    isDropAllowed = true;
-                }
-            }
-            return isDropAllowed;
-        }
-
-        private bool IsInParentChain(ModelItem droppedModelItem)
-        {
-            bool isInParentChain = false;
-            ModelItem parentModelItem = this.Items;
-            while (parentModelItem != null)
-            {
-                if (parentModelItem == droppedModelItem)
-                {
-                    isInParentChain = true;
-                    break;
-                }
-                parentModelItem = parentModelItem.Parent;
-            }
-            return isInParentChain;
-        }
-
-        void InsertItem(int index, object droppedObject)
-        {
-            ModelItem insertedItem = null;
-            if (index == addAtEndMarker)
-            {
-                insertedItem = this.Items.Add(droppedObject);
-            }
-            else
-            {
-                insertedItem = this.Items.Insert(index, droppedObject);
-            }
-            if (insertedItem != null)
-            {
-                Selection.SelectOnly(this.Context, insertedItem);
-            }
-        }
-
-        protected override void OnDrop(DragEventArgs e)
-        {
-            int index = addAtEndMarker;
-            WorkflowViewElement dropTarget = null;
-            if (e.OriginalSource is WorkflowViewElement)
-            {
-                dropTarget = (WorkflowViewElement)e.OriginalSource;
-            }
-            else
-            {
-                dropTarget = VisualTreeUtils.FindFocusableParent<WorkflowViewElement>((UIElement)e.OriginalSource);
-            }
-
-            if (null != dropTarget && null != dropTarget.ModelItem)
-            {
-                int targetIndex = this.Items.IndexOf(dropTarget.ModelItem);
-                if (-1 != targetIndex)
-                {
-                    index = targetIndex + 1;
-                }
-            }
-            OnItemsDropped(e, index);
-            base.OnDrop(e);
-        }
-
-        void OnDrag(DragEventArgs e)
-        {
-            if (!e.Handled)
-            {
-                if (!DragDropHelper.AllowDrop(e.Data, this.Context, this.AllowedItemType))
-                {
-                    e.Effects = DragDropEffects.None;
-                }
-                e.Handled = true;
-            }
-        }
-
-        protected override void OnDragEnter(DragEventArgs e)
-        {
-            this.OnDrag(e);
-            base.OnDragEnter(e);
-        }
-
-        protected override void OnDragOver(DragEventArgs e)
-        {
-            this.OnDrag(e);
-            base.OnDragOver(e);
-        }
-
-
-        public void OnItemMoved(ModelItem modelItem)
-        {
-            if (this.Items.Contains(modelItem))
-            {
-                this.Items.Remove(modelItem);
-            }
-        }
-
-        protected override AutomationPeer OnCreateAutomationPeer()
-        {
-            return new WorkflowItemsPresenterAutomationPeer(this);
-        }
-
-        public object OnItemsCut(List<ModelItem> itemsToCut)
-        {
-            List<object> orderMetaData = GetOrderMetaData(itemsToCut).ToList();
-            foreach (ModelItem item in itemsToCut)
-            {
-                this.Items.Remove(item);
-                this.Context.Items.SetValue(new Selection(new ArrayList()));
-            }
-            return orderMetaData;
-        }
-       
-        public object OnItemsCopied(List<ModelItem> itemsToCopy)
-        {
-            return this.GetOrderMetaData(itemsToCopy);
-        }
-
-        public void OnItemsPasted(List<object> itemsToPaste, List<object> metaData, Point pastePoint, WorkflowViewElement pastePointReference)
-        {
-            // first see if a spacer is selected.
-            int index = this.selectedSpacerIndex;
-            // else see if we can paste after a selected child
-            if (index < 0)
-            {
-                Selection currentSelection = this.Context.Items.GetValue<Selection>();
-                index = this.Items.IndexOf(currentSelection.PrimarySelection);
-                //paste after the selected child
-                if (index >= 0)
-                {
-                    index++;
-                }
-            }
-            if (index < 0)
-            {
-                index = addAtEndMarker;
-            }
-
-            IList<object> mergedItemsToPaste = CutCopyPasteHelper.SortFromMetaData(itemsToPaste, metaData);
-
-            List<ModelItem> modelItemsToSelect = new List<ModelItem>();
-
-            foreach (object itemToPaste in mergedItemsToPaste)
-            {
-                if (IsDropAllowed(itemToPaste))
-                {
-                    if (index == addAtEndMarker)
-                    {
-                        modelItemsToSelect.Add(this.Items.Add(itemToPaste));
-                    }
-                    else
-                    {
-                        modelItemsToSelect.Add(this.Items.Insert(index, itemToPaste));
-                    }
-                    if (index >= 0)
-                    {
-                        index++;
-                    }
-                }
-            }
-
-            this.Dispatcher.BeginInvoke(
-                new Action(() =>
-                {
-                    this.Context.Items.SetValue(new Selection(modelItemsToSelect));
-                }),
-                Windows.Threading.DispatcherPriority.ApplicationIdle,
-                null);
-        }
-
-        public void OnItemsDelete(List<ModelItem> itemsToDelete)
-        {
-            if (null != itemsToDelete)
-            {
-                itemsToDelete.ForEach(p =>
-                {
-                    if (null != this.Items && this.Items.Contains(p))
-                    {
-                        this.Items.Remove(p);
-                    }
-                }
-                    );
-            }
-        }
-
-        public bool CanPasteItems(List<object> itemsToPaste)
-        {
-            bool result = false;
-            if (null != itemsToPaste && itemsToPaste.Count > 0)
-            {
-                result = itemsToPaste.All(p => this.IsDropAllowed(p));
-            }
-            return result;
-        }
-
-        class WorkflowItemsPresenterAutomationPeer : UIElementAutomationPeer
-        {
-            WorkflowItemsPresenter owner;
-
-            public WorkflowItemsPresenterAutomationPeer(WorkflowItemsPresenter owner)
-                : base(owner)
-            {
-                this.owner = owner;
-            }
-
-            protected override AutomationControlType GetAutomationControlTypeCore()
-            {
-                return AutomationControlType.Custom;
-            }
-
-            protected override string GetAutomationIdCore()
-            {
-                string automationId = base.GetAutomationIdCore();
-                if (string.IsNullOrEmpty(automationId))
-                {
-                    automationId = base.GetNameCore();
-                    if (string.IsNullOrEmpty(automationId))
-                    {
-                        automationId = this.owner.GetType().Name;
-                    }
-                }
-                return automationId;
-            }
-
-            protected override string GetNameCore()
-            {
-                // Return an empty string if some activites are dropped on the presenter
-                if (owner.Items.Count > 0)
-                {
-                    return string.Empty;
-                }
-                string name = base.GetNameCore();
-                if (string.IsNullOrEmpty(name))
-                {
-                    name = this.owner.HintText;
-                }
-                return name;
-            }
-
-            protected override string GetClassNameCore()
-            {
-                return this.owner.GetType().Name;
-            }
-        }
-
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowViewElement.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/WorkflowViewElement.cs
deleted file mode 100644 (file)
index 8ab7e00..0000000
+++ /dev/null
@@ -1,1152 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-#pragma warning disable 618
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.Services;
-    using System.Activities.Presentation.View;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Runtime;
-    using System.Windows;
-    using System.Windows.Automation.Peers;
-    using System.Windows.Controls;
-    using System.Windows.Input;
-    using System.Windows.Media;
-    using System.Windows.Controls.Primitives;
-    using System.Windows.Data;
-    using System.Timers;
-    using System.Windows.Threading;
-    using System.Text;
-    using System.Linq;
-    using System.Activities.Presentation.Internal.PropertyEditing;
-
-    // This is the base class of all things visual that are associated with ModelItems.
-    // e.g state designer, workflowelement designer, activity designe etc.
-    // This provides access to the ModelItem attached to it,  and the EditingContext.
-    public class WorkflowViewElement : ContentControl, ICompositeViewEvents
-    {
-        public static readonly DependencyProperty ModelItemProperty =
-            DependencyProperty.Register("ModelItem", typeof(ModelItem), typeof(WorkflowViewElement), new FrameworkPropertyMetadata(null, new PropertyChangedCallback(WorkflowViewElement.OnModelItemChanged)));
-        public static readonly DependencyProperty ContextProperty =
-            DependencyProperty.Register("Context", typeof(EditingContext), typeof(WorkflowViewElement), new FrameworkPropertyMetadata(null, new PropertyChangedCallback(WorkflowViewElement.OnContextChanged)));
-        public static readonly DependencyProperty ExpandStateProperty = 
-            DependencyProperty.Register("ExpandState", typeof(bool), typeof(WorkflowViewElement), new FrameworkPropertyMetadata(true, new PropertyChangedCallback(WorkflowViewElement.OnExpandStateChanged)));
-        public static readonly DependencyProperty PinStateProperty =
-            DependencyProperty.Register("PinState", typeof(bool), typeof(WorkflowViewElement), new FrameworkPropertyMetadata(false, new PropertyChangedCallback(WorkflowViewElement.OnPinStateChanged)));
-        public static readonly DependencyProperty ShowExpandedProperty =
-            DependencyProperty.Register("ShowExpanded", typeof(bool), typeof(WorkflowViewElement), new FrameworkPropertyMetadata(false, new PropertyChangedCallback(WorkflowViewElement.OnShowExpandedChanged)));
-        internal readonly static DependencyProperty IsRootDesignerProperty =
-            DependencyProperty.Register("IsRootDesigner", typeof(bool), typeof(WorkflowViewElement), new FrameworkPropertyMetadata(false));
-        static readonly DependencyProperty IsReadOnlyProperty =
-            DependencyProperty.Register("IsReadOnly", typeof(bool), typeof(WorkflowViewElement), new FrameworkPropertyMetadata(false, new PropertyChangedCallback(WorkflowViewElement.OnReadOnlyChanged)));
-
-        const string ExpandViewStateKey = "IsExpanded";
-        internal const string PinnedViewStateKey = "IsPinned";
-        Timer breadCrumbTimer;
-        int lastMouseButtonDownTimeStamp;
-
-        internal string CustomItemStatus { get; set; }
-
-        static void OnExpandStateChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
-        {
-            WorkflowViewElement viewElement = obj as WorkflowViewElement;
-            viewElement.OnExpandStateChanged((bool)e.NewValue);
-        }
-
-        static void OnPinStateChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
-        {
-            WorkflowViewElement viewElement = obj as WorkflowViewElement;
-            viewElement.OnPinStateChanged((bool)e.NewValue);
-        }
-
-
-        static void OnContextChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
-        {
-            WorkflowViewElement viewElement = obj as WorkflowViewElement;
-            viewElement.OnContextChanged();
-        }
-
-        static void OnShowExpandedChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
-        {
-            WorkflowViewElement viewElement = obj as WorkflowViewElement;
-            viewElement.OnShowExpandedChanged((bool)e.NewValue);
-        }
-
-        static void OnReadOnlyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
-        {
-            WorkflowViewElement viewElement = obj as WorkflowViewElement;
-            viewElement.OnReadOnlyChanged((bool)e.NewValue);
-        }
-
-        protected virtual void OnShowExpandedChanged(bool newValue)
-        {
-        }
-
-        protected virtual void OnReadOnlyChanged(bool isReadOnly)
-        {
-        }
-
-        internal void ForceCollapse()
-        {
-            this.ExpandState = false;
-            if (this.Designer.ShouldExpandAll)
-            {
-                this.PinState = true;
-            }
-        }
-
-        void OnContextChanged()
-        {
-            //Setting the binding here so that we have a handle to DesignerView.
-            SetShowExpandedBindings();
-        }
-
-        void OnExpandStateChanged(bool newValue)
-        {
-            if (this.ModelItem != null && this.Context != null)
-            {
-                this.ViewStateService.StoreViewState(this.ModelItem, ExpandViewStateKey, newValue);
-            }
-        }
-
-        void OnPinStateChanged(bool newValue)
-        {
-            if (this.ModelItem != null && this.Context != null)
-            {
-                this.ViewStateService.StoreViewState(this.ModelItem, WorkflowViewElement.PinnedViewStateKey, newValue);
-            }
-        }
-
-        bool leftMouseButtonDown = false;
-        Point lastMouseDownPoint;
-        UIElement lastActivationElement;
-        List<ICompositeView> compositeViews;
-        ICompositeView defaultCompositeView;
-        bool rightMouseClickWithCtrlDown = false;
-        bool rightMouseClick = false;
-        bool shouldChangeSelectionOnMouseUp = false;
-
-        public WorkflowViewElement()
-        {
-            this.Collapsible = true;
-            this.IsAncestorOfRootDesigner = false;
-            this.DragHandle = this;
-
-            this.Loaded += (sender, eventArgs) =>
-                {
-                    // When the designer is loaded in Cider, the Context is not available and thus we cannot access the DesignerView (nor is it necessary)
-                    if (this.Context != null)
-                    {
-                        this.Designer.RegisterViewElement(this);
-                    }
-
-                    this.GotFocus += new RoutedEventHandler(OnGotFocusEvent);
-                    this.breadCrumbTimer = new Timer(2000);
-                    this.breadCrumbTimer.Elapsed += new ElapsedEventHandler(OnBreadCrumbTimerElapsed);
-                    this.breadCrumbTimer.AutoReset = false;
-                    this.lastActivationElement = null;
-                    this.SetValue(CutCopyPasteHelper.ChildContainersProperty, null);
-                    if (this.ModelItem != null)
-                    {
-                        ((IModelTreeItem)this.ModelItem).SetCurrentView(this);
-                    }
-
-                    //Get the ExpandState from ViewState.
-                    if (this.ModelItem != null)
-                    {
-                        object expandCollapseViewState = this.ViewStateService.RetrieveViewState(this.ModelItem, ExpandViewStateKey);
-                        object pinViewState = this.ViewStateService.RetrieveViewState(this.ModelItem, WorkflowViewElement.PinnedViewStateKey);
-                        if (expandCollapseViewState != null)
-                        {
-                            this.ExpandState = (bool)expandCollapseViewState;
-                        }
-                        if (pinViewState != null)
-                        {
-                            this.PinState = (bool)pinViewState;
-                        }
-                    }
-                    this.UseLayoutRounding = true;
-                };
-
-            this.Unloaded += (sender, eventArgs) =>
-                {
-                    // When the designer is loaded in Cider, the Context is not available and thus we cannot access the DesignerView (nor is it necessary)
-                    if (this.Context != null)
-                    {
-                        this.Designer.UnregisterViewElement(this);
-                    }
-
-                    this.GotFocus -= new RoutedEventHandler(OnGotFocusEvent);
-                    Fx.Assert(this.breadCrumbTimer != null, "The timer should not be null.");
-                    this.breadCrumbTimer.Elapsed -= new ElapsedEventHandler(OnBreadCrumbTimerElapsed);
-                    this.breadCrumbTimer.Close();
-                };
-        }
-
-        protected override void OnInitialized(EventArgs e)
-        {
-            base.OnInitialized(e);
-
-            Binding readOnlyBinding = new Binding();
-            readOnlyBinding.RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(DesignerView), 1);
-            readOnlyBinding.Path = new PropertyPath(DesignerView.IsReadOnlyProperty);
-            readOnlyBinding.Mode = BindingMode.OneWay;
-            this.SetBinding(IsReadOnlyProperty, readOnlyBinding);
-        }
-
-        void SetShowExpandedBindings()
-        {
-            MultiBinding multiBinding = new MultiBinding();
-            //Bind to ModelItem
-            Binding modelItemBinding = new Binding();
-            modelItemBinding.Source = this;
-            modelItemBinding.Path = new PropertyPath(WorkflowViewElement.ModelItemProperty);
-            //Bind to IsRootDesigner
-            Binding isRootDesignerBinding = new Binding();
-            isRootDesignerBinding.Source = this;
-            isRootDesignerBinding.Path = new PropertyPath(WorkflowViewElement.IsRootDesignerProperty);
-            //Bind to DesignerView.ExpandAll
-            Binding expandAllBinding = new Binding();
-            DesignerView view = this.Context.Services.GetService<DesignerView>();
-            expandAllBinding.Source = view;
-            expandAllBinding.Path = new PropertyPath(DesignerView.ShouldExpandAllProperty);
-            //Bind to DesignerView.CollapseAll
-            Binding collapseAllBinding = new Binding();
-            collapseAllBinding.Source = view;
-            collapseAllBinding.Path = new PropertyPath(DesignerView.ShouldCollapseAllProperty);
-            //Bind to ExpandState
-            Binding expandStateBinding = new Binding();
-            expandStateBinding.Source = this;
-            expandStateBinding.Path = new PropertyPath(WorkflowViewElement.ExpandStateProperty);
-            //Bind to PinState
-            Binding pinStateBinding = new Binding();
-            pinStateBinding.Source = this;
-            pinStateBinding.Path = new PropertyPath(WorkflowViewElement.PinStateProperty);
-            //Bind to self
-            Binding selfBinding = new Binding();
-            selfBinding.Source = this;
-            //Bind to container (to recalculate on drag-drop.)
-            Binding containerBinding = new Binding();
-            containerBinding.Source = this;
-            containerBinding.Path = new PropertyPath(DragDropHelper.DragSourceProperty);
-            multiBinding.Bindings.Add(modelItemBinding);
-            multiBinding.Bindings.Add(isRootDesignerBinding);
-            multiBinding.Bindings.Add(expandAllBinding);
-            multiBinding.Bindings.Add(collapseAllBinding);
-            multiBinding.Bindings.Add(expandStateBinding);
-            multiBinding.Bindings.Add(pinStateBinding);
-            multiBinding.Bindings.Add(selfBinding);
-            multiBinding.Bindings.Add(containerBinding);
-
-            multiBinding.Mode = BindingMode.OneWay;
-            multiBinding.Converter = new ShowExpandedMultiValueConverter();
-            BindingOperations.SetBinding(this, WorkflowViewElement.ShowExpandedProperty, multiBinding );
-        }
-
-        [Fx.Tag.KnownXamlExternal]
-        public EditingContext Context
-        {
-            get { return (EditingContext)GetValue(ContextProperty); }
-            set { SetValue(ContextProperty, value); }
-        }
-
-        public bool ExpandState
-        {
-            get { return (bool)GetValue(ExpandStateProperty); }
-            set { SetValue(ExpandStateProperty, value); }
-        }
-
-        public bool PinState
-        {
-            get { return (bool)GetValue(PinStateProperty); }
-            set { SetValue(PinStateProperty, value); }
-        }
-
-        //This guides us whether to show the expand collapse button for this ViewElement or not.
-        public bool Collapsible
-        {
-            get;
-            set;
-        }
-
-        public bool IsRootDesigner
-        {
-            get { return (bool)GetValue(IsRootDesignerProperty); }
-            internal set { SetValue(IsRootDesignerProperty, value); }
-        }
-
-        internal bool IsAncestorOfRootDesigner
-        {
-            get;
-            set;
-        }
-        
-        public bool ShowExpanded
-        {
-            get { return (bool)GetValue(ShowExpandedProperty); }
-        }
-
-        internal bool DoesParentAlwaysExpandChild()
-        {
-            return ViewUtilities.DoesParentAlwaysExpandChildren(this.ModelItem, this.Context);
-        }
-
-        internal bool DoesParentAlwaysCollapseChildren()
-        {
-            return ViewUtilities.DoesParentAlwaysCollapseChildren(this.ModelItem, this.Context);
-        }
-
-
-        [Fx.Tag.KnownXamlExternal]
-        public ModelItem ModelItem
-        {
-            get { return (ModelItem)GetValue(ModelItemProperty); }
-            set { SetValue(ModelItemProperty, value); }
-        }
-
-        public FrameworkElement DragHandle
-        {
-            get;
-            set;
-        }
-
-        protected bool IsReadOnly
-        {
-            get { return (bool)GetValue(IsReadOnlyProperty); }
-            private set { SetValue(IsReadOnlyProperty, value); }
-        }
-
-        internal ICompositeView ActiveCompositeView
-        {
-            get
-            {
-                if (!this.ShowExpanded)
-                {
-                    return null;
-                }
-                ICompositeView activeContainer = null;
-                if (null != this.compositeViews && null != this.lastActivationElement)
-                {
-                    activeContainer = this.compositeViews.Find(p =>
-                        {
-                            Visual visual = p as Visual;
-                            return (null != visual &&
-                                visual == this.lastActivationElement.FindCommonVisualAncestor(visual));
-                        });
-                }
-                activeContainer = activeContainer ?? this.DefaultCompositeView;
-
-                System.Diagnostics.Debug.WriteLine(string.Format(
-                    CultureInfo.InvariantCulture,
-                    "Active ICompositeView in '{0}' is '{1}'",
-                    this.GetType().Name, activeContainer == null ? "<null>" : activeContainer.GetHashCode().ToString(CultureInfo.InvariantCulture)));
-
-                return activeContainer;
-            }
-        }
-
-        // useful shortcuts for things we know we will be using a lot.
-        // Shortcut to viewservice in editingcontext.services
-        protected internal ViewService ViewService
-        {
-            get
-            {
-                Fx.Assert(this.Context != null, "Context should not be null ");
-                ViewService viewService = this.Context.Services.GetService<ViewService>();
-                Fx.Assert(viewService != null, "View service should never be null if we are in a valid view tree");
-                return viewService;
-            }
-        }
-
-        // Shortcut to ViewStateService in editingcontext.services
-        protected internal ViewStateService ViewStateService
-        {
-            get
-            {
-                ViewStateService viewStateService = this.Context.Services.GetService<ViewStateService>();
-                Fx.Assert(viewStateService != null, "ViewState service should never be null if we are in a valid view tree");
-                return viewStateService;
-            }
-        }
-
-        protected internal DesignerView Designer
-        {
-            get
-            {
-                DesignerView designer = this.Context.Services.GetService<DesignerView>();
-                Fx.Assert(designer != null, "DesignerView service should never be null if we are in a valid state");
-                return designer;
-            }
-        }
-
-        protected IList<ICompositeView> CompositeViews
-        {
-            get { return this.compositeViews; }
-        }
-
-        protected ICompositeView DefaultCompositeView
-        {
-            get { return this.defaultCompositeView; }
-        }
-
-        internal bool DraggingMultipleItemsEnabled
-        {
-            get { return this.Context.Services.GetService<DesignerConfigurationService>().MultipleItemsDragDropEnabled; }
-        }
-
-        protected virtual string GetAutomationIdMemberName()
-        {
-            return null;
-        }
-
-        protected virtual string GetAutomationHelpText()
-        {
-            return string.Empty;
-        }
-
-        protected internal virtual string GetAutomationItemStatus()
-        {
-            if (this.CustomItemStatus == null)
-            {
-                return string.Empty;
-            }
-            else
-            {
-                if (!this.CustomItemStatus.EndsWith(" ", StringComparison.Ordinal))
-                {
-                    this.CustomItemStatus += " ";
-                }
-                return this.CustomItemStatus;
-            }
-        }
-
-        protected override AutomationPeer OnCreateAutomationPeer()
-        {
-            return new WorkflowViewElementAutomationPeer(this);
-        }
-
-        protected internal virtual void OnEditAnnotation()
-        {
-            return;
-        }
-
-        public void RegisterDefaultCompositeView(ICompositeView container)
-        {
-            if (null == container)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("container"));
-            }
-
-            this.defaultCompositeView = container;
-
-            System.Diagnostics.Debug.WriteLine(string.Format(
-                CultureInfo.InvariantCulture,
-                "Default ICompositeView of type '{0}' for '{1}' loaded. hashcode = {2}",
-                this.defaultCompositeView.GetType().Name, this.GetType().Name, this.defaultCompositeView.GetHashCode()));
-        }
-
-        public void UnregisterDefaultCompositeView(ICompositeView container)
-        {
-            if (null == container)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("container"));
-            }
-
-            if (object.Equals(this.defaultCompositeView, container))
-            {
-                this.defaultCompositeView = null;
-            }
-        }
-
-        public void RegisterCompositeView(ICompositeView container)
-        {
-            if (null == container)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("container"));
-            }
-
-            if (null == this.CompositeViews)
-            {
-                this.compositeViews = new List<ICompositeView>();
-            }
-            if (!this.compositeViews.Contains(container))
-            {
-                System.Diagnostics.Debug.WriteLine(string.Format(
-                    CultureInfo.InvariantCulture,
-                    "ICompositeView of type '{0}' for '{1}' loaded. hashcode = {2}",
-                    container.GetType().Name, this.GetType().Name, container.GetHashCode()));
-
-                this.compositeViews.Add(container);
-            }
-        }
-
-        public void UnregisterCompositeView(ICompositeView container)
-        {
-            if (null == container)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("container"));
-            }
-
-            if (null != this.compositeViews && this.compositeViews.Contains(container))
-            {
-                System.Diagnostics.Debug.WriteLine(string.Format(
-                    CultureInfo.InvariantCulture,
-                    "ICompositeView of type '{0}' for '{1}' unloaded",
-                    container.GetType().Name, this.GetType().Name));
-
-                this.compositeViews.Remove(container);
-                if (0 == this.compositeViews.Count)
-                {
-                    this.compositeViews = null;
-                }
-            }
-        }
-
-        void OnGotFocusEvent(object sender, RoutedEventArgs e)
-        {
-            DesignerView designerView = this.Context.Services.GetService<DesignerView>();
-            if (!e.Handled && this.ModelItem != null && !designerView.IsMultipleSelectionMode)
-            {
-                Selection selection = this.Context.Items.GetValue<Selection>();
-                //update selection when following conditions apply:
-                //1. We're not trying to open context menu using right click + ctrl key.
-                //2. We're not clicking with left mouse - selection will be updated on left mouse button up
-                //3. Current selection does not contain this.ModelItem if it's mouse right click
-                bool becomesSelection = true;
-                if (this.rightMouseClickWithCtrlDown || this.leftMouseButtonDown)
-                {
-                    becomesSelection = false;
-                }
-                else if (this.rightMouseClick)
-                {
-                    foreach (ModelItem item in selection.SelectedObjects)
-                    {
-                        if (item == this.ModelItem)
-                        {
-                            becomesSelection = false;
-                            break;
-                        }
-                    }
-                }
-
-                //When there is only one selected model item, we want to change the selection when we tab into other items.
-                if (becomesSelection)
-                {
-                    Selection.SelectOnly(this.Context, this.ModelItem);
-                }
-
-                System.Diagnostics.Debug.WriteLine(
-                    string.Format(CultureInfo.InvariantCulture, "{0} ) WorkflowViewElement.OnGotFocusEvent ({1}, selection: {2}, becomesSelection {3}, raisedBy {4})",
-                    DateTime.Now.ToLocalTime(), this.GetType().Name, selection.SelectionCount, becomesSelection, e.OriginalSource));
-
-                //do not override last activation element if we get a reference to this (this will be passed as original source
-                //whenever focus is set manualy - by direct call to Keyboard.SetFocus)
-                if (!object.Equals(this, e.OriginalSource))
-                {
-                    this.lastActivationElement = e.OriginalSource as UIElement;
-                }
-                e.Handled = true;
-            }
-            else
-            {
-                this.lastActivationElement = null;
-            }
-        }
-
-        protected virtual void OnModelItemChanged(object newItem)
-        {
-        }
-
-        protected virtual void OnContextMenuLoaded(ContextMenu menu)
-        {
-        }
-
-        void MakeRootDesigner()
-        {
-            DesignerView designerView = this.Context.Services.GetService<DesignerView>();
-            if (!this.Equals(designerView.RootDesigner))
-            {
-                designerView.MakeRootDesigner(this.ModelItem);
-                this.leftMouseButtonDown = false;
-            }
-        }
-
-        protected override void OnMouseDown(MouseButtonEventArgs e)
-        {
-            this.lastMouseButtonDownTimeStamp = e.Timestamp;
-            bool shouldSetFocus = false;
-            bool shouldUpdateLastActivationPoint = false;
-            this.leftMouseButtonDown = false;
-            this.rightMouseClickWithCtrlDown = false;
-            this.rightMouseClick = false;
-            bool shouldToggle = false;
-
-            if (this.ModelItem == null)
-            {
-                return;
-            }
-
-            if (e.LeftButton == MouseButtonState.Pressed)
-            {
-                this.leftMouseButtonDown = true;
-                this.lastMouseDownPoint = e.GetPosition(this);
-                if (!Keyboard.IsKeyDown(Key.LeftCtrl) && !Keyboard.IsKeyDown(Key.RightCtrl))
-                {
-                    this.CaptureMouse();
-                }
-                else
-                {
-                    shouldToggle = true;
-                }
-
-                shouldSetFocus = Keyboard.FocusedElement != this;
-                e.Handled = true;
-                this.Designer.ShouldStillAllowRubberBandEvenIfMouseLeftButtonDownIsHandled = true;
-                shouldUpdateLastActivationPoint = true;
-            }
-
-            if (e.LeftButton == MouseButtonState.Pressed && e.ClickCount == 2 && this.Designer.lastClickedDesigner == this)
-            {
-                this.MakeRootDesigner();
-                Mouse.Capture(null);
-                e.Handled = true;
-                this.Designer.ShouldStillAllowRubberBandEvenIfMouseLeftButtonDownIsHandled = false;
-            }
-
-            if (e.RightButton == MouseButtonState.Pressed)
-            {
-                rightMouseClick = true;
-                this.lastMouseDownPoint = e.GetPosition(this);
-                if (!Keyboard.IsKeyDown(Key.LeftCtrl) && !Keyboard.IsKeyDown(Key.RightCtrl))
-                {
-                    shouldSetFocus = Keyboard.FocusedElement != this;
-                }
-                else
-                {
-                    rightMouseClickWithCtrlDown = true;
-                }
-
-                e.Handled = true;
-                shouldUpdateLastActivationPoint = true;
-            }
-
-            System.Diagnostics.Debug.WriteLine(
-                string.Format(CultureInfo.InvariantCulture, "{0} ) WorkflowViewElement.OnMouseDown ({1}, shouldSetFocus {2}, mouseCaptured {3}, raisedBy {4})",
-                DateTime.Now.ToLocalTime(), this.GetType().Name, shouldSetFocus, this.IsMouseCaptured, e.OriginalSource));
-
-            base.OnMouseDown(e);
-
-            if (shouldSetFocus)
-            {
-                System.Diagnostics.Debug.WriteLine(
-                    string.Format(CultureInfo.InvariantCulture, "{0} ) WorkflowViewElement.OnMouseDown.SetFocus ({1})",
-                    DateTime.Now.ToLocalTime(), this.GetType().Name));
-                //attempt to set focused and keyboard focused element to new designer
-                Keyboard.Focus(this);
-            }
-
-            bool isSelected = this.Context.Items.GetValue<Selection>().SelectedObjects.Contains<ModelItem>(this.ModelItem);
-
-            if (shouldToggle)
-            {
-                if (!isSelected)
-                {
-                    Selection.Toggle(this.Context, this.ModelItem);
-                }
-                else
-                {
-                    this.shouldChangeSelectionOnMouseUp = true;
-                }
-            }
-            else
-            {
-                if (!rightMouseClickWithCtrlDown)
-                {
-                    if (rightMouseClick)
-                    {
-                        // if it's right mouse click without ctrl, change selection only if the current item is not selected.
-                        bool alreadySelected = false;
-                        Selection selection = this.Context.Items.GetValue<Selection>();
-                        foreach (ModelItem item in selection.SelectedObjects)
-                        {
-                            if (item == this.ModelItem)
-                            {
-                                alreadySelected = true;
-                                break;
-                            }
-                        }
-                        if (!alreadySelected)
-                        {
-                            Selection.SelectOnly(this.Context, this.ModelItem);
-                        }
-                    }
-                    else if (this.leftMouseButtonDown)
-                    {
-                        if (!isSelected)
-                        {
-                            Selection.SelectOnly(this.Context, this.ModelItem);
-                        }
-                        else
-                        {
-                            this.shouldChangeSelectionOnMouseUp = true;
-                        }
-                    }
-                }
-            }
-
-            this.rightMouseClickWithCtrlDown = false;
-            this.rightMouseClick = false;
-
-            if (shouldUpdateLastActivationPoint)
-            {
-                this.lastActivationElement = e.OriginalSource as UIElement;
-            }
-
-            if (e.LeftButton == MouseButtonState.Pressed)
-            {
-                this.Designer.lastClickedDesigner = this;
-            }
-        }
-
-        bool AllowDragging()
-        {
-            Selection selection = this.Context.Items.GetValue<Selection>();
-            
-            if (!this.DraggingMultipleItemsEnabled)
-            {
-                if (selection.SelectionCount != 1)
-                {
-                    return false;
-                }
-            }
-
-            return selection.SelectedObjects.All<ModelItem>((p) =>
-                {
-                    return p != null && p != p.Root && p.View != null && ((WorkflowViewElement)p.View).IsVisible &&
-                        (DragDropHelper.GetCompositeView((WorkflowViewElement)p.View) as ICompositeView) != null;
-                });
-        }
-
-        protected override void OnMouseMove(MouseEventArgs e)
-        {
-            // if model item is removed, uncapture mouse and return
-            if (this.ModelItem != null && this.ModelItem != this.ModelItem.Root && this.ModelItem.Parent == null)
-            {
-                if (this.IsMouseCaptured)
-                {
-                    Mouse.Capture(null);
-                }
-                return;
-            }
-
-            if (e.LeftButton == MouseButtonState.Pressed &&
-               this.leftMouseButtonDown &&
-               this.ModelItem != null &&
-               this.IsMouseOnDragHandle(this.lastMouseDownPoint) &&
-               e.Timestamp - this.lastMouseButtonDownTimeStamp > 100)
-            {
-                //get new position
-                Point newPosition = e.GetPosition(this);
-                //calculate distance
-                Vector difference = newPosition - this.lastMouseDownPoint;
-                if (Math.Abs(difference.X) > SystemParameters.MinimumHorizontalDragDistance ||
-                    Math.Abs(difference.Y) > SystemParameters.MinimumVerticalDragDistance)
-                {
-                    Selection selection = this.Context.Items.GetValue<Selection>();
-                    // If the current model item is not selected, add it to the selection. 
-                    if (!selection.SelectedObjects.Contains(this.ModelItem))
-                    {
-                        if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
-                        {
-                            Selection.Toggle(this.Context, this.ModelItem);
-                        }
-                        else
-                        {
-                            Selection.SelectOnly(this.Context, this.ModelItem);
-                        }
-                    }
-
-                    if (this.AllowDragging())
-                    {
-                        //if mouse is caputured - release capture, drag&drop infrastructure will take care now for tracking mouse move
-                        if (this.IsMouseCaptured)
-                        {
-                            Mouse.Capture(null);
-                            StartDragging();
-                        }
-
-                        this.leftMouseButtonDown = false;
-                        e.Handled = true;
-                    }
-                }
-            }
-            
-            base.OnMouseMove(e);
-        }
-
-        private bool IsMouseOnDragHandle(Point mousePoint)
-        {
-            if (this.DragHandle != null)
-            {
-                GeneralTransform transform = this.DragHandle.TransformToAncestor(this);
-                Point dragHandleLocation = transform.Transform(new Point(0, 0));
-                Rect dragHandleRect = new Rect(dragHandleLocation, new Size(this.DragHandle.ActualWidth, this.DragHandle.ActualHeight));
-                if (dragHandleRect.Contains(mousePoint))
-                {
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        protected override void OnMouseUp(MouseButtonEventArgs e)
-        {
-            System.Diagnostics.Debug.WriteLine(
-                CultureInfo.InvariantCulture,
-                string.Format(CultureInfo.CurrentUICulture, "{0} ) WorkflowViewElement.OnMouseUp ({1}, mouseCaptured {2})",
-                DateTime.Now.ToLocalTime(), this.GetType().Name, this.IsMouseCaptured));
-
-            if (this.leftMouseButtonDown)
-            {
-                if (this.IsMouseCaptured)
-                {
-                    Mouse.Capture(null);
-                }
-
-                if (!this.Designer.SuppressSelectionOnMouseUp && this.shouldChangeSelectionOnMouseUp)
-                {
-                    if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
-                    {
-                        Selection.Toggle(this.Context, this.ModelItem);
-                    }
-                    else
-                    {
-                        Selection.SelectOnly(this.Context, this.ModelItem);
-                    }
-                }
-
-                this.leftMouseButtonDown = false;
-                e.Handled = true;
-            }
-
-            this.shouldChangeSelectionOnMouseUp = false;
-            base.OnMouseUp(e);
-        }
-
-        void OnBreadCrumbTimerElapsed(object sender, ElapsedEventArgs e)
-        {
-            this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
-                {
-                    this.breadCrumbTimer.Stop();
-                    this.MakeRootDesigner();
-                }));
-        }
-
-        void OnDrag(DragEventArgs e)
-        {
-            if (!e.Handled)
-            {
-                e.Effects = DragDropEffects.None;
-                e.Handled = true;
-            }
-        }
-
-        // This is to set the cursor to the forbidden icon when dragging to the designer.
-        // It doesn't affect the drag-drop behavior of components that have AllowDrop == ture within the designer.
-        protected override void OnDragEnter(DragEventArgs e)
-        {
-            this.OnDrag(e);
-            base.OnDragEnter(e);
-        }
-
-        // This is to set the cursor to the forbidden icon when dragging within the designer.
-        // It doesn't affect the drag-drop behavior of components that have AllowDrop == ture within the designer.
-        protected override void OnDragOver(DragEventArgs e)
-        {
-            this.OnDrag(e);
-            base.OnDragOver(e);
-        }
-
-        protected override void OnPreviewDragEnter(DragEventArgs e)
-        {
-            if (this.ShowExpanded == false)
-            {
-                this.breadCrumbTimer.Start();
-            }
-            base.OnPreviewDragEnter(e);
-        }
-
-        protected override void OnPreviewDragLeave(DragEventArgs e)
-        {
-            this.breadCrumbTimer.Stop();
-            base.OnPreviewDragLeave(e);
-        }
-
-        protected override void OnPreviewMouseUp(MouseButtonEventArgs e)
-        {
-            this.breadCrumbTimer.Stop();
-            base.OnPreviewMouseUp(e);
-        }
-
-        static void OnModelItemChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
-        {
-            WorkflowViewElement viewElement = (WorkflowViewElement)dependencyObject;
-            viewElement.OnModelItemChanged(e.NewValue);
-        }
-
-        void BeginDropAnimation(WorkflowViewElement target)
-        {
-            DropAnimation opacityAnimation = new DropAnimation();
-            target.BeginAnimation(FrameworkElement.OpacityProperty, opacityAnimation);
-        }
-
-        [SuppressMessage(FxCop.Category.Design, FxCop.Rule.DoNotCatchGeneralExceptionTypes,
-            Justification = "Catching all exceptions to avoid VS Crash.")]
-        [SuppressMessage("Reliability", "Reliability108",
-            Justification = "Catching all exceptions to avoid VS crash.")]
-
-        void StartDragging()
-        {
-            try
-            {
-                using (ModelEditingScope editingScope = this.ModelItem.BeginEdit(SR.MoveEditingScopeDescription, true))
-                {
-                    HashSet<WorkflowViewElement> draggedViews = new HashSet<WorkflowViewElement>();
-                    Dictionary<ModelItem, ICompositeView> sourceContainers = new Dictionary<ModelItem, ICompositeView>();
-                    HashSet<ICompositeView> compViewSet = new HashSet<ICompositeView>();
-                    Selection selection = this.Context.Items.GetValue<Selection>();
-                    IEnumerable<ModelItem> selectedObjects = selection.SelectedObjects;
-                    IEnumerable<ModelItem> modelItemsToDrag = DragDropHelper.GetModelItemsToDrag(selectedObjects);
-                    
-                    // Save the source containers for the dragged items
-                    foreach (ModelItem modelItem in modelItemsToDrag)
-                    {
-                        WorkflowViewElement view = (WorkflowViewElement)modelItem.View;
-                        draggedViews.Add(view);
-                        ICompositeView container = DragDropHelper.GetCompositeView(view) as ICompositeView;
-                        sourceContainers.Add(modelItem, container);
-                        // If Add returns true => the container is added the first time, which is always ok
-                        // If Add returns false => the container is added more than once
-                        //    it must be a IMultipleDragEnabledCompositeView, otherwise, return, because 
-                        //    we don't support dragging from ICompositeView.
-                        if (!compViewSet.Add(container) && !(container is IMultipleDragEnabledCompositeView))
-                        {
-                            return;
-                        }
-                    }
-                    
-                    // Calculate the anchor point for the dragged items
-                    Point relativeLocation = GetRelativeLocation(draggedViews);
-                    Point referencePoint = this.lastMouseDownPoint;
-                    referencePoint.Offset(relativeLocation.X, relativeLocation.Y);
-
-
-                    DataObject dataObject = DragDropHelper.DoDragMoveImpl(draggedViews, referencePoint);
-                    IEnumerable<WorkflowViewElement> movedViewElements = DragDropHelper.GetDragDropMovedViewElements(dataObject);
-
-                    // once drag drop is done make sure the CompositeView is notified of the change in data
-                    if (movedViewElements != null)
-                    {
-                        Dictionary<ICompositeView, List<ModelItem>> containerMovedModelItemList = new Dictionary<ICompositeView, List<ModelItem>>();
-                        
-                        // Create containerMovedModelItemList
-                        foreach (WorkflowViewElement view in movedViewElements)
-                        {
-                            ICompositeView compView = DragDropHelper.GetCompositeView(view) as ICompositeView;
-                            Fx.Assert(compView != null, "not an ICompositeView");
-                            if (!containerMovedModelItemList.ContainsKey(compView))
-                            {
-                                containerMovedModelItemList.Add(compView, new List<ModelItem>());
-                            }
-                            containerMovedModelItemList[compView].Add(view.ModelItem);
-                        }
-
-                        // Call OnItemsMoved to notify the source container.
-                        foreach (KeyValuePair<ICompositeView, List<ModelItem>> pair in containerMovedModelItemList)
-                        {
-                            if (pair.Key is IMultipleDragEnabledCompositeView)
-                            {
-                                ((IMultipleDragEnabledCompositeView)pair.Key).OnItemsMoved(pair.Value);
-                            }
-                            else
-                            {
-                                if (pair.Value.Count >= 2)
-                                {
-                                    throw FxTrace.Exception.AsError(
-                                        new InvalidOperationException(SR.Error_MovingMoreThanOneItemsFromICompositeView));
-                                }
-                                pair.Key.OnItemMoved(pair.Value[0]);
-                            }
-                        }
-
-                        // animation
-                        foreach (WorkflowViewElement view in movedViewElements)
-                        {
-                            BeginDropAnimation(view);
-                        }
-                    }
-                    // the drop target is using old DragDropHelper API and did not set the moved view elements
-                    else
-                    {
-                        DragDropEffects executedDragDropEffect = DragDropHelper.GetDragDropCompletedEffects(dataObject);
-                        if (executedDragDropEffect == DragDropEffects.Move)
-                        {
-                            if (modelItemsToDrag.Count() == 1)
-                            {
-                                ModelItem movedItem = modelItemsToDrag.First<ModelItem>();
-                                sourceContainers[movedItem].OnItemMoved(movedItem);
-                                BeginDropAnimation((WorkflowViewElement)movedItem.View);
-                            }
-                            else
-                            {
-                                throw FxTrace.Exception.AsError(new InvalidOperationException(SR.DraggingMulitpleItemsError));
-                            }
-                        }
-                    }
-                    editingScope.Complete();
-
-                    bool dropHappened = movedViewElements != null
-                        || DragDropHelper.GetDragDropCompletedEffects(dataObject) == DragDropEffects.Move;
-                    if (dropHappened)
-                    {
-                        // add the selected objects back into selection.
-                        this.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, (Action)(() =>
-                        {
-
-                            foreach (ModelItem item in selectedObjects)
-                            {
-                                // We need only the first one
-                                IInputElement viewToFocus = item == null ? null : item.View as IInputElement;
-                                if (viewToFocus != null)
-                                {
-                                    Keyboard.Focus(viewToFocus);
-                                    break;
-                                }
-                            }
-                            this.Context.Items.SetValue(new Selection(selectedObjects));
-                        }));
-                    }
-                }
-            }
-            catch (Exception e)
-            {
-                ErrorReporting.ShowErrorMessage(e.Message);
-            }
-        }
-
-        private Point GetRelativeLocation(IEnumerable<WorkflowViewElement> draggedViews)
-        {
-            HashSet<WorkflowViewElement> viewElements = new HashSet<WorkflowViewElement>(draggedViews);
-            if (!viewElements.Contains(this))
-            {
-                viewElements.Add(this);
-            }
-            Dictionary<WorkflowViewElement, Point> locations = DragDropHelper.GetViewElementRelativeLocations(viewElements);
-            return locations[this];
-        }
-
-        internal void NotifyContextMenuLoaded(ContextMenu menu)
-        {
-            if (null != menu)
-            {
-                OnContextMenuLoaded(menu);
-            }
-        }
-
-        class WorkflowViewElementAutomationPeer : UIElementAutomationPeer
-        {
-            WorkflowViewElement owner;
-
-            public WorkflowViewElementAutomationPeer(WorkflowViewElement owner)
-                : base(owner)
-            {
-                this.owner = owner;
-            }
-
-            protected override AutomationControlType GetAutomationControlTypeCore()
-            {
-                return AutomationControlType.Custom;
-            }
-
-
-            protected override string GetAutomationIdCore()
-            {
-                string automationId = this.GetClassNameCore();
-                string automationIdVariablePartMemberName = owner.GetAutomationIdMemberName();
-                if (!string.IsNullOrEmpty(automationIdVariablePartMemberName))
-                {
-                    ModelItem modelItem = this.owner.ModelItem;
-                    string variablePartOfAutomationId = string.Empty;
-                    if (modelItem != null)
-                    {
-                        ModelProperty property = modelItem.Properties[automationIdVariablePartMemberName];
-                        Fx.Assert(property != null, "property to use for Automation ID variable part missing ? are you using the right property Name?");
-                        if (property.Value != null)
-                        {
-                            variablePartOfAutomationId = property.Value.GetCurrentValue().ToString();
-                        }
-                    }
-                    automationId = variablePartOfAutomationId + "(" + this.GetClassNameCore() + ")";
-                }
-                return automationId;
-            }
-
-            protected override string GetNameCore()
-            {
-                Type itemType = null;
-                if (this.owner.ModelItem != null)
-                {
-                    itemType = this.owner.ModelItem.ItemType;
-                }
-                else
-                {
-                    itemType = this.owner.GetType();
-                }
-
-                if (itemType.IsGenericType)
-                {
-                    //append the argument types for generic types
-                    //we expect the single level of generic is sufficient for the screen reader, so we're no going into
-                    //nesting of generic types
-                    Type[] argumentTypes = itemType.GetGenericArguments();
-                    StringBuilder name = new StringBuilder(itemType.Name);
-                    name.Append('[');
-                    foreach (Type argument in argumentTypes)
-                    {
-                        name.Append(argument.Name);
-                        name.Append(',');
-                    }
-                    name.Replace(',', ']', name.Length - 1, 1);
-                    return name.ToString();
-                }
-                else
-                {
-                    return itemType.Name;
-                }
-            }
-
-            protected override string GetHelpTextCore()
-            {
-                return this.owner.GetAutomationHelpText();
-            }
-
-            protected override string GetItemStatusCore()
-            {
-                return this.owner.GetAutomationItemStatus();
-            }
-
-            protected override string GetClassNameCore()
-            {
-                return this.owner.GetType().Name;
-            }
-        }
-    }
-
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/XNameConverter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/XNameConverter.cs
deleted file mode 100644 (file)
index 87e1256..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Xml.Linq;
-
-
-    [SuppressMessage("XAML", "XAML1004",
-        Justification = "We want to keep this for internal use by the WorkflowDesigner assemblies.")]
-    sealed class XNameConverter : TypeConverter
-    {
-        public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
-        {
-            return typeof(string) == sourceType;
-        }
-
-        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
-        {
-            string currentValue = (string)value;
-            XName result = null;
-            if (null != currentValue)
-            {
-                result = currentValue;
-            }
-            return result;
-        }
-
-        public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
-        {
-            return typeof(string) == destinationType;
-        }
-
-        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
-        {
-            XName currentValue = (XName)value;
-            string result = null;
-            if (null != currentValue)
-            {
-                result = currentValue.ToString();
-            }
-            return result;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Xaml/ActivityBuilderHelper.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Xaml/ActivityBuilderHelper.cs
deleted file mode 100644 (file)
index 3e9a344..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Xaml
-{
-    using System.Activities.Presentation.Model;
-    using System.Collections.Generic;
-
-    internal static class ActivityBuilderHelper
-    {
-        internal static bool IsActivityBuilderType(ModelItem modelItem)
-        {
-            if (null == modelItem)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("modelItem"));
-            }
-            return modelItem.ItemType.IsAssignableFrom(typeof(ActivityBuilder));
-        }
-
-        internal static List<Variable> GetVariables(object input)
-        {
-            if (null == input)
-            {
-                throw FxTrace.Exception.AsError(new ArgumentNullException("input"));
-            }
-            ModelItem astAsModelItem = input as ModelItem;
-            ActivityBuilder instance = input as ActivityBuilder;
-            if (null != astAsModelItem)
-            {
-                if (!astAsModelItem.ItemType.IsAssignableFrom(typeof(ActivityBuilder)))
-                {
-                    throw FxTrace.Exception.AsError(new InvalidCastException(astAsModelItem.ItemType.FullName));
-                }
-                instance = (ActivityBuilder)astAsModelItem.GetCurrentValue();
-            }
-            else if (null == instance)
-            {
-                throw FxTrace.Exception.AsError(new InvalidCastException(input.GetType().FullName));
-            }
-
-            List<Variable> variables = new List<Variable>();
-            foreach (DynamicActivityProperty property in instance.Properties)
-            {
-                if (property != null)
-                {
-                    Variable autoVariable = GetVariableFromProperty(property);
-                    if (autoVariable != null)
-                    {
-                        variables.Add(autoVariable);
-                    }
-                }
-            }
-            return variables;
-        }
-
-        internal static Variable GetVariableFromProperty(DynamicActivityProperty property)
-        {
-            Type variableType = null;
-            Variable autoVariable = null;
-
-            if (property.Type != null)
-            {
-                Type propertyType = property.Type;
-
-                // if the property is an Argument<T> create a variable of type T
-                if (propertyType != null && typeof(Argument).IsAssignableFrom(propertyType))
-                {
-                    if (propertyType.IsGenericType)
-                    {
-                        variableType = propertyType.GetGenericArguments()[0];
-                    }
-                    else
-                    {
-                        variableType = typeof(object);
-                    }
-                }
-            }
-            if (variableType != null)
-            {
-                autoVariable = Variable.Create(property.Name, variableType, VariableModifiers.None);
-                Argument argument = property.Value as Argument;
-                if (argument != null)
-                {
-                    autoVariable.Default = argument.Expression;
-                }
-            }
-            return autoVariable;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Xaml/ErrorTolerantObjectWriter.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Xaml/ErrorTolerantObjectWriter.cs
deleted file mode 100644 (file)
index 19dd932..0000000
+++ /dev/null
@@ -1,1268 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-
-namespace System.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Activities;
-    using System.Activities.Debugger;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Globalization;
-    using System.Linq;
-    using System.Runtime;
-    using System.Text;
-    using System.Xaml;
-    using System.Xaml.Schema;
-    using Microsoft.Activities.Presentation.Xaml;
-    using NameReferenceConverter = System.Windows.Markup.NameReferenceConverter;
-
-    // This XamlWriter wraps an ObjectWriter to provide limited error tolerance, as follows:
-    // - Buffer the node stream as a tree of fragments (one for each activity) and statically validate it.
-    // - Write the node stream out to an ObjectWriter, wrapping any subtrees that failed validation 
-    //   in an ErrorActivity.
-    // - If validation fails at the root level, we don't load any object, we only provide validation errors.
-    // We are only tolerant of errors that can be detected statically; i.e. we are not resillient
-    // to XamlObjectWriter exceptions.
-
-    internal class ErrorTolerantObjectWriter : XamlWriter, IXamlLineInfoConsumer
-    {
-        // We store three main types of state:
-        // - The current state of the nodestream (XamlFrames), for validation purposes.
-        // - Buffered XamlFragments.
-        // - NameScopes, which have 
-
-        // Current state of the nodestream, for performing validation
-        WalkableStack<XamlFrame> xamlStack;
-
-        // Root of the tree of completed fragments (except for the root, which may be in progress)
-        XamlFragment rootFragment;
-
-        // Stack of in-progress fragments
-        Stack<XamlFragment> fragmentStack;
-
-        // Stack of in-progress namescopes; fragments can overlap multiple namescopes, and vice versa
-        Stack<NameScopeFrame> nameScopeStack;
-
-        // Completed namescopes, saved so we can resolve all references at end of parse
-        List<NameScopeFrame> poppedNameScopes;
-
-        // Pending NS declarations whose corresponding StartObject hasn't been written yet
-        NamespaceStackNode pendingNamespaces;
-
-        XamlObjectWriter objectWriter;
-        XamlType typeOfActivity;
-        XamlMember nameOfReference;
-        XamlValueConverter<XamlDeferringLoader> activityLoader;
-        int lineNumber, linePosition;
-
-        public string LocalAssemblyName { get; set; }
-
-        public IList<XamlLoadErrorInfo> LoadErrors { get; private set; }
-
-        public ErrorTolerantObjectWriter(XamlSchemaContext schemaContext)
-        {
-            this.xamlStack = new WalkableStack<XamlFrame>();
-            this.rootFragment = new XamlFragment(schemaContext);
-            this.fragmentStack = new Stack<XamlFragment>();
-            this.fragmentStack.Push(this.rootFragment);
-            this.nameScopeStack = new Stack<NameScopeFrame>();
-            this.nameScopeStack.Push(new NameScopeFrame(null));
-            this.poppedNameScopes = new List<NameScopeFrame>();
-            this.objectWriter = new XamlObjectWriter(schemaContext);
-            this.typeOfActivity = objectWriter.SchemaContext.GetXamlType(typeof(Activity));
-            this.nameOfReference = XamlLanguage.Reference.GetMember("Name");
-            this.activityLoader = typeOfActivity.GetMember("Implementation").DeferringLoader;
-        }
-
-        public object Result { get; private set; }
-
-        public override XamlSchemaContext SchemaContext { get { return this.objectWriter.SchemaContext; } }
-
-        public override void WriteNamespace(NamespaceDeclaration namespaceDeclaration)
-        {
-            if (this.rootFragment.HasError)
-            {
-                return;
-            }
-            if (this.pendingNamespaces == null)
-            {
-                this.pendingNamespaces = new NamespaceStackNode();
-            }
-            this.pendingNamespaces.Add(namespaceDeclaration.Prefix, namespaceDeclaration.Namespace);
-            CurrentWriter.WriteNamespace(namespaceDeclaration);
-        }
-
-        public override void WriteStartObject(XamlType type)
-        {
-            // This validation must be done before pushing the object frame, so that if there is an error,
-            // we treat the containing type as an error and not just the subtree.
-            ValidateSetMember();
-            PushXamlFrame(type);
-
-            // Pushing the activity frame must be done before the rest of validation, because if this
-            // is an unknown Activity, we want to treat just this subtree as an error, not its parent.
-            PushNewActivityFrameIfNeeded();
-            ValidateStartObject();
-            if (this.rootFragment.HasError)
-            {
-                return;
-            }
-            CurrentWriter.WriteStartObject(type);
-            CurrentFragment.ObjectDepth++;
-        }
-
-        public override void WriteGetObject()
-        {
-            PushXamlFrame(null);
-            ValidateGetObject();
-            if (this.rootFragment.HasError)
-            {
-                return;
-            }
-            CurrentWriter.WriteGetObject();
-            CurrentFragment.ObjectDepth++;
-        }
-
-        public override void WriteEndObject()
-        {
-            this.xamlStack.Pop();
-            ValidateEndObject();
-            if (this.rootFragment.HasError)
-            {
-                return;
-            }
-            CurrentWriter.WriteEndObject();
-            CurrentFragment.ObjectDepth--;
-            if (CurrentFragment.ObjectDepth == 0)
-            {
-                XamlFragment completedFragment = CurrentFragment;
-                this.fragmentStack.Pop();
-                if (this.fragmentStack.Count == 0)
-                {
-                    Fx.Assert(completedFragment == this.rootFragment, "Base of stack should be root fragment");
-                    CompleteLoad();
-                }
-                else
-                {
-                    CurrentFragment.AddChild(completedFragment);
-                }
-            }
-        }
-
-        public override void WriteStartMember(XamlMember member)
-        {
-            Fx.Assert(this.xamlStack.Count > 0 && this.xamlStack.Current.Member == null, "Unexpected StartMember");
-            this.xamlStack.Current.Member = member;
-            ValidateStartMember();
-            if (this.rootFragment.HasError)
-            {
-                return;
-            }
-            CurrentWriter.WriteStartMember(member);
-        }
-
-        public override void WriteEndMember()
-        {
-            Fx.Assert(this.xamlStack.Count > 0 && this.xamlStack.Current.Member != null, "Unexpected EndMember");
-            this.xamlStack.Current.Member = null;
-            this.xamlStack.Current.MemberIsSet = false;
-            ValidateEndMember();
-            if (this.rootFragment.HasError)
-            {
-                return;
-            }
-            CurrentWriter.WriteEndMember();
-        }
-
-        public override void WriteValue(object value)
-        {
-            ValidateValue(value);
-            if (this.rootFragment.HasError)
-            {
-                return;
-            }
-            CurrentWriter.WriteValue(value);
-        }
-
-        public void SetLineInfo(int lineNumber, int linePosition)
-        {
-            // We need to save the line info statically, for validation errors
-            this.lineNumber = lineNumber;
-            this.linePosition = linePosition;
-
-            // But we also need to keep it in [....] with the nodestream, for XOW errors
-            // XOW and XamlNodeQueue.Writer both implement IXamlLineInfoConsumer, so we can do a straight cast
-            if (this.rootFragment.HasError)
-            {
-                return;
-            }
-            ((IXamlLineInfoConsumer)CurrentWriter).SetLineInfo(lineNumber, linePosition);
-        }
-
-        // ObjectWriter always wants LineInfo
-        public bool ShouldProvideLineInfo { get { return true; } }
-
-        internal static bool IsErrorActivity(Type objectType)
-        {
-            return objectType == typeof(ErrorActivity) ||
-                (objectType != null && objectType.IsGenericType &&
-                 objectType.GetGenericTypeDefinition() == typeof(ErrorActivity<>));
-        }
-
-        // Node loop that strips out ErrorActivities on Save. Assumes that ErrorActivities are never
-        // nested, and that XamlObjectReader doesn't have line info.
-        internal static void TransformAndStripErrors(System.Xaml.XamlReader objectReader, XamlWriter writer)
-        {
-            // Every ErrorActivity is prefixed with all the NamespaceDeclarations that were in scope
-            // in the original document. We track the current namespaces in scope on Save, so that we
-            // can strip out any redundant declarations.
-            NamespaceStackNode currentNamespaces = null;
-            NamespaceStackNode pendingNamespaces = null;
-
-            while (objectReader.Read())
-            {
-                // Update the namespace stack
-                switch (objectReader.NodeType)
-                {
-                    case XamlNodeType.NamespaceDeclaration:
-                        if (pendingNamespaces == null)
-                        {
-                            pendingNamespaces = new NamespaceStackNode() { PreviousNode = currentNamespaces };
-                        }
-                        pendingNamespaces.Add(objectReader.Namespace.Prefix, objectReader.Namespace.Namespace);
-                        break;
-                    case XamlNodeType.StartObject:
-                    case XamlNodeType.GetObject:
-                        if (pendingNamespaces != null)
-                        {
-                            currentNamespaces = pendingNamespaces;
-                            pendingNamespaces = null;
-                        }
-                        currentNamespaces.ObjectDepth++;
-                        break;
-                }
-
-                if (objectReader.NodeType == XamlNodeType.StartObject && IsErrorActivity(objectReader.Type.UnderlyingType))
-                {
-                    ActivityFragment.TransformErrorActivityContents(objectReader, writer, currentNamespaces);
-                }
-                else
-                {
-                    writer.WriteNode(objectReader);
-                }
-
-                if (objectReader.NodeType == XamlNodeType.EndObject)
-                {
-                    currentNamespaces.ObjectDepth--;
-                    if (currentNamespaces.ObjectDepth == 0)
-                    {
-                        currentNamespaces = currentNamespaces.PreviousNode;
-                    }
-                }
-            }
-        }
-
-        XamlFragment CurrentFragment
-        {
-            get { return this.fragmentStack.Peek(); }
-        }
-
-        NameScopeFrame CurrentNameScope
-        {
-            get { return this.nameScopeStack.Peek(); }
-        }
-
-        XamlWriter CurrentWriter
-        {
-            get { return CurrentFragment.NodeQueue.Writer; }
-        }
-
-        static void AppendShortName(StringBuilder result, XamlType type)
-        {
-            result.Append(type.Name);
-            if (type.IsGeneric)
-            {
-                result.Append("(");
-                bool isFirst = true;
-                foreach (XamlType typeArg in type.TypeArguments)
-                {
-                    if (isFirst)
-                    {
-                        isFirst = false;
-                    }
-                    else
-                    {
-                        result.Append(",");
-                    }
-                    AppendShortName(result, typeArg);
-                }
-                result.Append(")");
-            }
-        }
-
-        // If a generic type is unknown, we don't know whether the open generic couldn't be resolved,
-        // or just its children. So we only want to surface errors for types that don't have unknown
-        // children.
-        static void GetLeafUnresolvedTypeArgs(XamlType type, HashSet<XamlType> unresolvedTypeArgs)
-        {
-            Fx.Assert(type.IsUnknown, "Method should only be called for unknown types");
-            bool hasUnknownChildren = false;
-            if (type.IsGeneric)
-            {
-                foreach (XamlType typeArg in type.TypeArguments)
-                {
-                    if (typeArg.IsUnknown)
-                    {
-                        GetLeafUnresolvedTypeArgs(typeArg, unresolvedTypeArgs);
-                        hasUnknownChildren = true;
-                    }
-                }
-            }
-            if (!hasUnknownChildren)
-            {
-                unresolvedTypeArgs.Add(type);
-            }
-        }
-
-        internal static string GetXamlMemberName(XamlMember member)
-        {
-            if (member.IsDirective)
-            {
-                return "{" + member.PreferredXamlNamespace + "}" + member.Name;
-            }
-            else
-            {
-                return GetXamlTypeName(member.DeclaringType) + "." + member.Name;
-            }
-        }
-
-        internal static string GetXamlTypeName(XamlType type)
-        {
-            string typeNs = type.PreferredXamlNamespace;
-            string typeName = GetFullTypeNameWithoutNamespace(type);
-            string clrns, assembly;
-            if (XamlNamespaceHelper.TryParseClrNsUri(typeNs, out clrns, out assembly))
-            {
-                return clrns + "." + typeName;
-            }
-            else
-            {
-                return typeNs + ":" + typeName;
-            }
-        }
-
-        static bool IsWhitespace(string value)
-        {
-            foreach (char c in value)
-            {
-                if (c != '\r' && c != '\n' && c != ' ' && c != '\t')
-                {
-                    return false;
-                }
-            }
-            return true;
-        }
-
-        // Validate named references and write out the complete nodestream to the ObjectWriter
-        void CompleteLoad()
-        {
-            CompleteNameReferences();
-            XamlFragment.FindBrokenReferences(this.rootFragment);
-
-            if (this.rootFragment.HasError)
-            {
-                this.Result = null;
-            }
-            else
-            {
-                this.rootFragment.WriteTo(this.objectWriter, false);
-                this.Result = this.objectWriter.Result;
-            }
-        }
-
-        // Gets the property type of the containing member, or its item type if it's a collection.
-        XamlType GetParentPropertyType(out bool parentIsDictionary)
-        {
-            XamlMember parentMember;
-            XamlType collectionType;
-            XamlType result = GetParentPropertyType(out parentMember, out collectionType);
-            parentIsDictionary = collectionType != null && collectionType.IsDictionary;
-            return result;
-        }
-
-        XamlType GetParentPropertyType(out XamlMember parentMember, out XamlType collectionType)
-        {
-            parentMember = this.xamlStack.Previous(1).Member;
-            Fx.Assert(parentMember != null, "StartObject or Value without preceding StartMember");
-            if (parentMember.IsDirective &&
-                (parentMember.Type.IsCollection || parentMember.Type.IsDictionary))
-            {
-                if (parentMember == XamlLanguage.Items)
-                {
-                    collectionType = this.xamlStack.Previous(1).Type;
-                    if (collectionType == null)
-                    {
-                        // This is a GetObject, need to look at the containing member
-                        collectionType = this.xamlStack.Previous(2).Member.Type;
-                    }
-                }
-                else
-                {
-                    collectionType = parentMember.Type;
-                }
-                return collectionType.ItemType;
-            }
-            collectionType = null;
-            return parentMember.Type;
-        }
-
-        // Checks whether to push a new ActivityFrame for a new StartObject (i.e. whether the object
-        // is an activity and is replaceable in case of error).
-        void PushNewActivityFrameIfNeeded()
-        {
-            Fx.Assert(this.xamlStack.Count > 0, "PushNewActivityFrameIfNeeded called without a StartObject");
-            if (this.xamlStack.Count == 1)
-            {
-                // This is the root of the document
-                return;
-            }
-            if (CurrentFragment.HasError)
-            {
-                // We're already inside an error frame, no point pushing any more frames
-                return;
-            }
-            // Check the parent property type (not the object type) because that's what determines
-            // whether we can inject an ErrorActivity.
-            bool parentIsDictionary;
-            XamlType parentType = GetParentPropertyType(out parentIsDictionary);
-            if (parentType != null && parentType.UnderlyingType != null && !parentIsDictionary &&
-                ActivityFragment.IsActivityType(parentType.UnderlyingType))
-            {
-                this.fragmentStack.Push(new ActivityFragment(SchemaContext) { Type = parentType.UnderlyingType });
-                CurrentFragment.Namespaces = this.xamlStack.Current.Namespaces;
-            }
-        }
-
-        void PushNameScope()
-        {
-            this.nameScopeStack.Push(new NameScopeFrame(this.nameScopeStack.Peek()));
-        }
-
-        void PushXamlFrame(XamlType type)
-        {
-            NamespaceStackNode currentNamespaces = this.xamlStack.Count > 0 ? this.xamlStack.Current.Namespaces : null;
-            this.xamlStack.Push(new XamlFrame { Type = type });
-            if (this.pendingNamespaces != null)
-            {
-                this.pendingNamespaces.PreviousNode = currentNamespaces;
-                this.xamlStack.Current.Namespaces = this.pendingNamespaces;
-                this.pendingNamespaces = null;
-            }
-            else
-            {
-                this.xamlStack.Current.Namespaces = currentNamespaces;
-            }
-        }
-
-        void ValidateStartObject()
-        {
-            // Check if type is known
-            XamlType type = this.xamlStack.Current.Type;
-            if (type.IsUnknown)
-            {
-                HashSet<XamlType> unresolvedTypes = null;
-                if (type.IsGeneric)
-                {
-                    unresolvedTypes = new HashSet<XamlType>();
-                    GetLeafUnresolvedTypeArgs(type, unresolvedTypes);
-                }
-                if (unresolvedTypes != null &&
-                    (unresolvedTypes.Count > 1 || !unresolvedTypes.Contains(type)))
-                {
-                    ValidationError(SR.UnresolvedGenericType, GetXamlTypeName(type));
-                    foreach (XamlType unresolvedTypeArg in unresolvedTypes)
-                    {
-                        ValidationErrorUnknownType(unresolvedTypeArg);
-                    }
-                }
-                else
-                {
-                    ValidationErrorUnknownType(type);
-                }
-            }
-            else if (this.xamlStack.Count > 1)
-            {
-                // Check assignability to parent member
-                if (!type.IsMarkupExtension)
-                {
-                    XamlMember parentMember;
-                    XamlType collectionType;
-                    XamlType expectedType = GetParentPropertyType(out parentMember, out collectionType);
-                    if (collectionType != null)
-                    {
-                        if (!CollectionAcceptsType(collectionType, type))
-                        {
-                            ValidationError(SR.UnassignableCollection, type, collectionType.ItemType, collectionType);
-                        }
-                    }
-                    else if (parentMember != null && !parentMember.IsUnknown &&
-                        !type.CanAssignTo(parentMember.Type) && parentMember.DeferringLoader == null)
-                    {
-                        ValidationError(SR.UnassignableObject, type, parentMember.Type, parentMember.Name);
-                    }
-                }
-            }
-
-            // Update the NameScope stack
-            if (type.IsNameScope && this.xamlStack.Count > 1)
-            {
-                PushNameScope();
-            }
-            CurrentNameScope.Depth++;
-        }
-
-        void ValidateGetObject()
-        {
-            XamlType type = this.xamlStack.Previous(1).Member.Type;
-            if (type.IsNameScope)
-            {
-                PushNameScope();
-            }
-            CurrentNameScope.Depth++;
-        }
-
-        // Check whether a member is set more than once
-        bool ValidateSetMember()
-        {
-            XamlFrame frame = this.xamlStack.Current;
-            if (frame != null)
-            {
-                if (frame.MemberIsSet && !frame.Member.IsUnknown && !frame.Member.IsDirective)
-                {
-                    ValidationError(SR.MemberCanOnlyBeSetOnce, frame.Member);
-                    return false;
-                }
-                frame.MemberIsSet = true;
-            }
-            return true;
-        }
-
-        bool CollectionAcceptsType(XamlType collectionType, XamlType type)
-        {
-            return collectionType.IsUnknown ||
-                collectionType.AllowedContentTypes == null ||
-                collectionType.AllowedContentTypes.Any(contentType => type.CanAssignTo(contentType));
-        }
-
-        void ValidateStartMember()
-        {
-            XamlFrame currentFrame = this.xamlStack.Current;
-            XamlMember member = currentFrame.Member;
-
-            // Make sure that the member is known.
-            // Don't bother surfacing an error for unknown instance properties or unknown content on 
-            // unknown types. It's redundant, since we'll already surface an error for the unknown type.
-            if (member == XamlLanguage.UnknownContent)
-            {
-                if (!currentFrame.Type.IsUnknown)
-                {
-                    ValidationError(SR.UnknownContent, this.xamlStack.Current.Type);
-                }
-            }
-            else if (member.IsUnknown && (member.IsAttachable || member.IsDirective || !member.DeclaringType.IsUnknown))
-            {
-                ValidationError(SR.UnresolvedMember, member.Name, member.DeclaringType);
-            }
-
-            // Check for duplicate members
-            if (currentFrame.PastMembers == null)
-            {
-                currentFrame.PastMembers = new HashSet<XamlMember>();
-            }
-            if (currentFrame.PastMembers.Contains(member))
-            {
-                ValidationError(SR.DuplicateMember, member);
-            }
-            else
-            {
-                currentFrame.PastMembers.Add(member);
-            }
-
-            // Check for misplaced attachable members
-            if (member.IsAttachable && !currentFrame.Type.IsUnknown && !currentFrame.Type.CanAssignTo(member.TargetType))
-            {
-                ValidationError(SR.MemberOnBadTargetType, member.Name, member.TargetType);
-            }
-
-            // Update the NameScope stack
-            if (member.DeferringLoader != null)
-            {
-                PushNameScope();
-            }
-            CurrentNameScope.Depth++;
-        }
-
-        void ValidateEndMember()
-        {
-            DecrementNameScopeDepth();
-        }
-
-        void ValidateEndObject()
-        {
-            DecrementNameScopeDepth();
-        }
-
-        void ValidateValue(object value)
-        {
-            XamlType type = this.xamlStack.Current.Type;
-            XamlMember member = this.xamlStack.Current.Member;
-            string valueString = value as string;
-            if (valueString == null || member.IsUnknown || !ValidateSetMember() || IsWhitespace(valueString))
-            {
-                return;
-            }
-
-            // Check if this is x:Name or RuntimeNameProperty
-            if (member == XamlLanguage.Name || (type != null && member == type.GetAliasedProperty(XamlLanguage.Name)))
-            {
-                if (!CurrentNameScope.RegisterName(valueString, CurrentFragment))
-                {
-                    ValidationError(SR.DuplicateName, valueString);
-                }
-                return;
-            }
-
-            // Check if this is an x:Reference
-            if (type == XamlLanguage.Reference && (member == this.nameOfReference || member == XamlLanguage.PositionalParameters))
-            {
-                CurrentNameScope.AddNeededName(CurrentFragment, valueString, this.lineNumber, this.linePosition);
-                return;
-            }
-            XamlValueConverter<TypeConverter> converter =
-                (member == XamlLanguage.Initialization) ? type.TypeConverter : member.TypeConverter;
-            if (converter != null && converter.ConverterType == typeof(NameReferenceConverter))
-            {
-                CurrentNameScope.AddNeededName(CurrentFragment, valueString, this.lineNumber, this.linePosition);
-            }
-
-            // Check if text is supported on this member
-            if (member == XamlLanguage.Initialization)
-            {
-                if (!type.IsUnknown && type.TypeConverter == null && !XamlLanguage.String.CanAssignTo(type))
-                {
-                    ValidationError(SR.NoTypeConverter, type);
-                }
-            }
-            else if (member.IsDirective)
-            {
-                if (member == XamlLanguage.Items)
-                {
-                    if (type == null)
-                    {
-                        // Inside a GetObject - get the type from the parent member
-                        type = this.xamlStack.Previous(1).Member.Type;
-                    }
-                    if (!CollectionAcceptsType(type, XamlLanguage.String))
-                    {
-                        ValidationError(SR.NoTextInCollection, type);
-                    }
-                }
-            }
-            else if (member.TypeConverter == null && !XamlLanguage.String.CanAssignTo(member.Type) &&
-                (member.DeferringLoader == null || member.DeferringLoader == this.activityLoader))
-            {
-                ValidationError(SR.NoTextInProperty, XamlLanguage.String, member.Type, member.Name);
-            }
-        }
-
-        void ValidationError(string message, params object[] arguments)
-        {
-            ValidationError(message, this.lineNumber, this.linePosition, arguments);
-            CurrentFragment.HasError = true;
-        }
-
-        void ValidationError(string message, int lineNumber, int linePosition, params object[] arguments)
-        {
-            // The default ToString implementations can be very clunky, especially for generics.
-            // Use our own friendlier versions instead.
-            for (int i = 0; i < arguments.Length; i++)
-            {
-                XamlType type = arguments[i] as XamlType;
-                if (type != null)
-                {
-                    arguments[i] = GetXamlTypeName(type);
-                }
-                else
-                {
-                    XamlMember member = arguments[i] as XamlMember;
-                    if (member != null)
-                    {
-                        arguments[i] = GetXamlMemberName(member);
-                    }
-                }
-            }
-            string error = string.Format(CultureInfo.CurrentCulture, message, arguments);
-            if (LoadErrors == null)
-            {
-                LoadErrors = new List<XamlLoadErrorInfo>();
-            }
-            LoadErrors.Add(new XamlLoadErrorInfo(error, lineNumber, linePosition));
-        }
-
-        [SuppressMessage(FxCop.Category.Usage, FxCop.Rule.DoNotIgnoreMethodResults, Justification =
-            "StringBuilder.Append just returns the same instance that was called")]
-        void ValidationErrorUnknownType(XamlType type)
-        {
-            StringBuilder result = new StringBuilder();
-            string clrns, assembly;
-            if (XamlNamespaceHelper.TryParseClrNsUri(type.PreferredXamlNamespace, out clrns, out assembly))
-            {
-                if (assembly == null)
-                {
-                    assembly = this.LocalAssemblyName;
-                }
-                StringBuilder typeName = new StringBuilder();
-                typeName.Append(clrns);
-                typeName.Append(".");
-                AppendShortName(typeName, type);
-                ValidationError(SR.UnresolvedTypeInAssembly, typeName, assembly);
-            }
-            else
-            {
-                StringBuilder typeName = new StringBuilder();
-                AppendShortName(typeName, type);
-                ValidationError(SR.UnresolvedTypeInNamespace, typeName, type.PreferredXamlNamespace);
-            }
-        }
-
-        void DecrementNameScopeDepth()
-        {
-            CurrentNameScope.Depth--;
-            if (CurrentNameScope.Depth == 0)
-            {
-                this.poppedNameScopes.Add(this.nameScopeStack.Pop());
-            }
-        }
-
-        // Resolves all simple name references in the tree, raising validation errors for any that
-        // can't be resolved.
-        void CompleteNameReferences()
-        {
-            foreach (NameScopeFrame nameScope in this.poppedNameScopes)
-            {
-                if (nameScope.NeededNames == null)
-                {
-                    continue;
-                }
-                foreach (NameReference reference in nameScope.NeededNames)
-                {
-                    XamlFragment target = nameScope.FindName(reference.Name);
-                    if (target == null)
-                    {
-                        ValidationError(SR.UnresolvedName, reference.LineNumber, reference.LinePosition, reference.Name);
-                        reference.Fragment.HasError = true;
-                    }
-                    else
-                    {
-                        if (target.ReferencedBy == null)
-                        {
-                            target.ReferencedBy = new HashSet<XamlFragment>();
-                        }
-                        target.ReferencedBy.Add(reference.Fragment);
-                    }
-                }
-            }
-        }
-
-        private static string GetFullTypeNameWithoutNamespace(XamlType xamlType)
-        {
-            string typeName = string.Empty;
-            if (xamlType != null)
-            {
-                typeName = xamlType.Name;
-                bool firstTypeArg = true;
-                if (xamlType.TypeArguments != null && xamlType.TypeArguments.Count > 0)
-                {
-                    typeName += "(";
-                    foreach (XamlType typeArg in xamlType.TypeArguments)
-                    {
-                        if (!firstTypeArg)
-                        {
-                            typeName += ",";
-                        }
-                        else
-                        {
-                            firstTypeArg = false;
-                        }
-                        typeName += typeArg.Name;
-                    }
-                    typeName += ")";
-                }
-            }
-            return typeName;
-        }
-
-        class XamlFrame
-        {
-            public XamlType Type { get; set; }
-            public XamlMember Member { get; set; }
-            public bool MemberIsSet { get; set; }
-            public NamespaceStackNode Namespaces { get; set; }
-            public HashSet<XamlMember> PastMembers { get; set; }
-        }
-
-        // A stack that is implemented as a list to allow walking up the stack.
-        class WalkableStack<T> : List<T> where T : class
-        {
-            public T Pop()
-            {
-                T result = this[Count - 1];
-                this.RemoveAt(Count - 1);
-                return result;
-            }
-
-            public T Previous(int index)
-            {
-                return this[Count - 1 - index];
-            }
-
-            public void Push(T frame)
-            {
-                Add(frame);
-            }
-
-            public T Current
-            {
-                get { return Count > 0 ? this[Count - 1] : null; }
-            }
-        }
-
-        // Class to buffer a tree of XAML fragments and write them back out in the correct order.
-        class XamlFragment
-        {
-            private XamlFragment firstChild;
-            private XamlFragment nextSibling;
-
-            public XamlFragment(XamlSchemaContext schemaContext)
-            {
-                NodeQueue = new XamlNodeQueue(schemaContext);
-            }
-
-            public XamlNodeQueue NodeQueue { get; private set; }
-            public int ObjectDepth { get; set; }
-            public bool HasError { get; set; }
-            public NamespaceStackNode Namespaces { get; set; }
-            public HashSet<XamlFragment> ReferencedBy { get; set; }
-
-            // Adds a child fragment at the current position of the NodeQueue.
-            // We store the fragment as a Value Node, and expand out its contents at Write time.
-            // We also store the fragments in a simple tree structure to so we can iterate them quickly.
-            public void AddChild(XamlFragment newChild)
-            {
-                NodeQueue.Writer.WriteValue(newChild);
-                XamlFragment curChild = this.firstChild;
-                if (curChild == null)
-                {
-                    this.firstChild = newChild;
-                }
-                else
-                {
-                    while (curChild.nextSibling != null)
-                    {
-                        curChild = curChild.nextSibling;
-                    }
-                    curChild.nextSibling = newChild;
-                }
-            }
-
-            // Find all references to error fragments and mark the referencing fragments as also errored.
-            public static void FindBrokenReferences(XamlFragment rootFragment)
-            {
-                // By starting from the root of the tree and walking its children, we ensure we traverse
-                // each node at least once, and so find every error fragment.
-                // Given an error fragment, we want to mark all its children and all its referencing fragments
-                // as errors, and process them recursively.
-                Queue<XamlFragment> queue = new Queue<XamlFragment>();
-                queue.Enqueue(rootFragment);
-                while (queue.Count > 0)
-                {
-                    if (rootFragment.HasError)
-                    {
-                        // We found an error at the root. We won't be able to load any part of the document,
-                        // so skip this redundant processing.
-                        return;
-                    }
-
-                    XamlFragment current = queue.Dequeue();
-                    if (current.HasError)
-                    {
-                        // Mark all this fragment's children as errored, and enqueue them for recursive processing.
-                        XamlFragment child = current.firstChild;
-                        while (child != null)
-                        {
-                            child.HasError = true;
-                            queue.Enqueue(child);
-                            child = child.nextSibling;
-                        }
-
-                        // Mark all fragments that reference this fragment as errored, and enqueue them for recursive processing.
-                        if (current.ReferencedBy != null)
-                        {
-                            foreach (XamlFragment referencingFragment in current.ReferencedBy)
-                            {
-                                referencingFragment.HasError = true;
-                                queue.Enqueue(referencingFragment);
-                            }
-                        }
-
-                        // Clear the links so that we don't traverse them again if there is a cycle.
-                        current.firstChild = null;
-                        current.ReferencedBy = null;
-                    }
-                    else
-                    {
-                        // This fragment is healthy, but we need to check for any errors in its children.
-                        // Don't remove the children, we'll need to traverse them if this fragment gets
-                        // marked as errored later.
-                        XamlFragment child = current.firstChild;
-                        while (child != null)
-                        {
-                            queue.Enqueue(child);
-                            child = child.nextSibling;
-                        }
-                    }
-                }
-            }
-
-            // Write this fragment and all its children out to the specified writer.
-            public virtual void WriteTo(XamlWriter writer, bool parentHasError)
-            {
-                // In the constrained designer scenario, we can always assume that there is line info.
-                XamlReader nodeReader = NodeQueue.Reader;
-                IXamlLineInfo lineInfo = (IXamlLineInfo)nodeReader;
-                IXamlLineInfoConsumer lineInfoConsumer = (IXamlLineInfoConsumer)writer;
-                int lineNumber = 0;
-                int linePosition = 0;
-
-                while (nodeReader.Read())
-                {
-                    if (lineInfo.LineNumber > 0 &&
-                            (lineInfo.LineNumber != lineNumber || lineInfo.LinePosition != linePosition))
-                    {
-                        lineNumber = lineInfo.LineNumber;
-                        linePosition = lineInfo.LinePosition;
-                        lineInfoConsumer.SetLineInfo(lineNumber, linePosition);
-                    }
-                    XamlFragment child = (nodeReader.NodeType == XamlNodeType.Value) ? nodeReader.Value as XamlFragment : null;
-                    if (child != null)
-                    {
-                        child.WriteTo(writer, parentHasError || HasError);
-                    }
-                    else
-                    {
-                        writer.WriteNode(nodeReader);
-                    }
-                }
-            }
-        }
-
-        class ActivityFragment : XamlFragment
-        {
-            public ActivityFragment(XamlSchemaContext schemaContext)
-                : base(schemaContext)
-            {
-            }
-
-            public Type Type { get; set; }
-
-            // We can only construct an ErrorActivity that is assignable to properties of type
-            // Activity or Activity<T>, not any of their descendants.
-            public static bool IsActivityType(Type type)
-            {
-                return type == typeof(Activity) ||
-                    (type.IsGenericType &&
-                    type.GetGenericTypeDefinition() == typeof(Activity<>));
-            }
-
-            public override void WriteTo(XamlWriter writer, bool parentHasError)
-            {
-                if (HasError && !parentHasError)
-                {
-                    Fx.Assert(this.Type != null && IsActivityType(this.Type), "Cannot create ErrorActivity for non-Activity property");
-                    Type errorType;
-                    if (this.Type == typeof(Activity))
-                    {
-                        errorType = typeof(ErrorActivity);
-                    }
-                    else
-                    {
-                        errorType = typeof(ErrorActivity<>).MakeGenericType(this.Type.GetGenericArguments()[0]);
-                    }
-                    XamlType errorXamlType = writer.SchemaContext.GetXamlType(errorType);
-                    writer.WriteStartObject(errorXamlType);
-                    writer.WriteStartMember(errorXamlType.GetMember(ErrorActivity.ErrorNodesProperty));
-
-                    XamlNodeList errorNodes = GetErrorNodes();
-                    ErrorActivity.WriteNodeList(writer, errorNodes);
-
-                    writer.WriteEndMember(); // </ErrorActivity.ErrorNodeList>
-                    writer.WriteEndObject(); // </ErrorActivity>
-                }
-                else
-                {
-                    base.WriteTo(writer, parentHasError);
-                }
-            }
-
-            // Extracts the Error Nodes contents out of the ErrorActivity and writes them to the 
-            // specified writer.
-            // Expects reader to be positioned on SO ErrorActivity and leaves it on corresponding EO.
-            public static void TransformErrorActivityContents(System.Xaml.XamlReader objectReader, XamlWriter writer,
-                NamespaceStackNode currentNamespaces)
-            {
-                XamlMember errorNodesMember = objectReader.Type.GetMember(ErrorActivity.ErrorNodesProperty);
-                // Skip past off <ErrorActivity>
-                objectReader.Read();
-
-                do
-                {
-                    Fx.Assert(objectReader.NodeType == XamlNodeType.StartMember, "Expected StartMember");
-                    if (objectReader.Member == errorNodesMember)
-                    {
-                        // Skip past <ErrorActivity.ErrorNodes>
-                        objectReader.Read();
-
-                        // Skip past the dummy StartObject & StartMember
-                        Fx.Assert(objectReader.NodeType == XamlNodeType.StartObject, "Expected StartObject");
-                        objectReader.Read();
-                        Fx.Assert(objectReader.NodeType == XamlNodeType.StartMember, "Expected StartMember");
-                        objectReader.Read();
-
-                        // Strip redundant namespaces
-                        while (objectReader.NodeType == XamlNodeType.NamespaceDeclaration)
-                        {
-                            string ns = currentNamespaces.LookupNamespace(objectReader.Namespace.Prefix);
-                            if (ns != objectReader.Namespace.Namespace &&
-                                !IsIgnorableCompatNamespace(objectReader.Namespace, currentNamespaces))
-                            {
-                                writer.WriteNamespace(objectReader.Namespace);
-                            }
-                            objectReader.Read();
-                        }
-
-                        // Pass through the original contents, stripping out any hidden APs added by
-                        // the XamlDebuggerXmlReader, since XOR wouldn't write them out.
-                        XamlType debuggerReaderType = objectReader.SchemaContext.GetXamlType(typeof(XamlDebuggerXmlReader));
-                        Fx.Assert(objectReader.NodeType == XamlNodeType.StartObject, "Expected StartObject");
-                        XamlReader subReader = objectReader.ReadSubtree();
-                        subReader.Read();
-                        while (!subReader.IsEof)
-                        {
-                            if (subReader.NodeType == XamlNodeType.StartMember &&
-                                subReader.Member.DeclaringType == debuggerReaderType &&
-                                subReader.Member.SerializationVisibility == DesignerSerializationVisibility.Hidden)
-                            {
-                                subReader.Skip();
-                            }
-                            else
-                            {
-                                writer.WriteNode(subReader);
-                                subReader.Read();
-                            }
-                        }
-
-                        // Close out the dummy StartObject & StartMember
-                        Fx.Assert(objectReader.NodeType == XamlNodeType.EndMember, "Expected EndMember");
-                        objectReader.Read();
-                        Fx.Assert(objectReader.NodeType == XamlNodeType.EndObject, "Expected EndObject");
-                        objectReader.Read();
-
-                        // Skip past </ErrorActivity.ErrorNodes>
-                        Fx.Assert(objectReader.NodeType == XamlNodeType.EndMember, "Expected EndMember");
-                        objectReader.Read();
-                    }
-                    else
-                    {
-                        // Skip any APs added by the designer
-                        Fx.Assert(objectReader.Member.IsAttachable, "Unexpected member on ErrorActivity");
-                        objectReader.Skip();
-                    }
-                }
-                while (objectReader.NodeType != XamlNodeType.EndObject); // </ErrorActivity>
-            }
-
-            // If the namespace is the markup-compat namespace, we skip writing it out as long as there
-            // is an ignorable namespace at the root of the doc; DesignTimeXamlWriter will add it to the
-            // root later. We assume that the exact prefix for markup-compat doesn't matter, just whether the
-            // namespace is defined.
-            static bool IsIgnorableCompatNamespace(NamespaceDeclaration ns, NamespaceStackNode currentNamespaces)
-            {
-                if (ns.Namespace == NameSpaces.Mc)
-                {
-                    NamespaceStackNode rootNamespaces = currentNamespaces;
-                    while (rootNamespaces.PreviousNode != null)
-                    {
-                        rootNamespaces = rootNamespaces.PreviousNode;
-                    }
-                    foreach (string rootNs in rootNamespaces.Values)
-                    {
-                        if (NameSpaces.ShouldIgnore(rootNs))
-                        {
-                            return true;
-                        }
-                    }
-                }
-                return false;
-            }
-
-            XamlNodeList GetErrorNodes()
-            {
-                XamlNodeList result = new XamlNodeList(NodeQueue.Writer.SchemaContext);
-
-                // Dummy StartObject & StartMember. This is here so that ObjectReader doesn't try
-                // to hoist all the namespaces on save, which would cause them to be added as
-                // Imports by the VBExpression converter.
-                result.Writer.WriteStartObject(XamlLanguage.Object);
-                result.Writer.WriteStartMember(XamlLanguage.UnknownContent);
-
-                // Write out all namespaces in scope to the NodeList, to ensure that the any type
-                // converters that use namespaces/prefixes still work on round trip.
-                // (We can strip out the redundant ones on Save.)
-                foreach (KeyValuePair<string, string> ns in Namespaces.FlattenNamespaces())
-                {
-                    result.Writer.WriteNamespace(new NamespaceDeclaration(ns.Value, ns.Key));
-                }
-
-                // Write out the original contents of this fragment, expanding our children if any.
-                base.WriteTo(result.Writer, true);
-
-                // Close the dummy object
-                result.Writer.WriteEndMember();
-                result.Writer.WriteEndObject();
-
-                result.Writer.Close();
-                return result;
-            }
-        }
-
-        class NameScopeFrame
-        {
-            private Dictionary<string, XamlFragment> declaredNames;
-            private List<NameReference> neededNames;
-
-            public NameScopeFrame Parent { get; private set; }
-            public int Depth { get; set; }
-            public List<NameReference> NeededNames { get { return this.neededNames; } }
-
-            public NameScopeFrame(NameScopeFrame parent)
-            {
-                Parent = parent;
-            }
-
-            public void AddNeededName(XamlFragment fragment, string name, int lineNumber, int linePosition)
-            {
-                if (this.neededNames == null)
-                {
-                    this.neededNames = new List<NameReference>();
-                }
-                this.neededNames.Add(new NameReference
-                {
-                    Fragment = fragment,
-                    Name = name,
-                    LineNumber = lineNumber,
-                    LinePosition = linePosition
-                });
-            }
-
-            public XamlFragment FindName(string name)
-            {
-                NameScopeFrame current = this;
-                do
-                {
-                    XamlFragment result = null;
-                    if (current.declaredNames != null && current.declaredNames.TryGetValue(name, out result))
-                    {
-                        return result;
-                    }
-                    current = current.Parent;
-                }
-                while (current != null);
-                return null;
-            }
-
-            public bool RegisterName(string name, XamlFragment containingFragment)
-            {
-                if (this.declaredNames == null)
-                {
-                    this.declaredNames = new Dictionary<string, XamlFragment>();
-                }
-                if (this.declaredNames.ContainsKey(name))
-                {
-                    return false;
-                }
-                this.declaredNames.Add(name, containingFragment);
-                return true;
-            }
-        }
-
-        class NameReference
-        {
-            public XamlFragment Fragment { get; set; }
-            public string Name { get; set; }
-            public int LineNumber { get; set; }
-            public int LinePosition { get; set; }
-        }
-
-        class NamespaceStackNode : Dictionary<string, string>
-        {
-            public NamespaceStackNode PreviousNode { get; set; }
-
-            public int ObjectDepth { get; set; }
-
-            public IEnumerable<KeyValuePair<string, string>> FlattenNamespaces()
-            {
-                // We need to hide not only any shadowed prefixes, but any shadowed namespaces, since
-                // XamlXmlWriter doesn't allow declaration of multiple prefixes for the same namespaace
-                // at the same scope.
-                HashSet<string> prefixes = new HashSet<string>();
-                HashSet<string> namespaces = new HashSet<string>();
-                NamespaceStackNode current = this;
-                do
-                {
-                    foreach (KeyValuePair<string, string> pair in current)
-                    {
-                        if (!prefixes.Contains(pair.Key) && !namespaces.Contains(pair.Value))
-                        {
-                            yield return pair;
-                            prefixes.Add(pair.Key);
-                            namespaces.Add(pair.Value);
-                        }
-                    }
-                    current = current.PreviousNode;
-                }
-                while (current != null);
-            }
-
-            public string LookupNamespace(string prefix)
-            {
-                NamespaceStackNode current = this;
-                do
-                {
-                    string ns;
-                    if (current.TryGetValue(prefix, out ns))
-                    {
-                        return ns;
-                    }
-                    current = current.PreviousNode;
-                }
-                while (current != null);
-                return null;
-            }
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Xaml/MultiTargetingXamlSchemaContext.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Xaml/MultiTargetingXamlSchemaContext.cs
deleted file mode 100644 (file)
index fc46207..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//----------------------------------------------------------------
-// <copyright company="Microsoft Corporation">
-//     Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System.Activities.Presentation.Hosting;
-    using System.Runtime;
-    using System.Xaml;
-    using Microsoft.Activities.Presentation.Xaml;
-
-    internal class MultiTargetingXamlSchemaContext : XamlSchemaContext
-    {
-        private MultiTargetingSupportService multiTargetingService;
-
-        public MultiTargetingXamlSchemaContext(MultiTargetingSupportService multiTargetingService)
-        {
-            Fx.Assert(multiTargetingService != null, "multiTargetingService should not be null");
-
-            this.multiTargetingService = multiTargetingService;
-        }
-
-        protected override XamlType GetXamlType(string xamlNamespace, string name, params XamlType[] typeArguments)
-        {
-            XamlType xamlType = base.GetXamlType(xamlNamespace, name, typeArguments);
-
-            if (xamlType == null || xamlType.UnderlyingType == null)
-            {
-                return xamlType;
-            }
-
-            ResolverResult resolverResult = MultiTargetingTypeResolver.Resolve(this.multiTargetingService, xamlType.UnderlyingType);
-            return MultiTargetingTypeResolver.GetXamlType(resolverResult, xamlType);
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Xaml/ObjectToSourceLocationMapping.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Xaml/ObjectToSourceLocationMapping.cs
deleted file mode 100644 (file)
index 7f024e6..0000000
+++ /dev/null
@@ -1,257 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Xaml
-{
-    using System.Activities.Debugger;
-    using System.Activities.Presentation.Model;
-    using System.Activities.Presentation.ViewState;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Runtime.Collections;
-
-    // This class is to create and hold the mapping of Activity to SourceLocation and SourceLocation to ModelItem.
-    // First, XamlReader write in activity object and its SourceLocation. Then model search service can pass in the
-    // ModelItem list to create a source location to model item mapping.
-    internal class ObjectToSourceLocationMapping
-    {
-        private IDictionary<object, SourceLocation> deserializedObjectToSourceLocationMapping;
-        private IDictionary<SourceLocation, ModelItem> sourceLocationToModelItemMapping;
-        private IDictionary<SourceLocation, ModelItem> viewStateSourceLocationToModelItemMapping;
-        private ModelSearchServiceImpl modelSearchService;
-
-        // Is the Object to SourceLocation mapping updated? generally means the file was reloaded.
-        private bool updateRequired;
-
-        internal ObjectToSourceLocationMapping(ModelSearchServiceImpl modelSearchService)
-        {
-            this.modelSearchService = modelSearchService;
-            this.deserializedObjectToSourceLocationMapping = new OrderedDictionary<object, SourceLocation>();
-            this.sourceLocationToModelItemMapping = new Dictionary<SourceLocation, ModelItem>();
-            this.viewStateSourceLocationToModelItemMapping = new Dictionary<SourceLocation, ModelItem>();
-        }
-
-        internal void Clear()
-        {
-            this.deserializedObjectToSourceLocationMapping.Clear();
-            this.updateRequired = true;
-        }
-
-        internal Dictionary<object, object> SourceLocationObjectToModelItemObjectMapping
-        {
-            get;
-            set;
-        }
-
-        internal Dictionary<string, SourceLocation> ViewStateDataSourceLocationMapping
-        {
-            get;
-            set;
-        }
-
-        internal void UpdateMap(object key, SourceLocation sourceLocation)
-        {
-            if (this.deserializedObjectToSourceLocationMapping.ContainsKey(key))
-            {
-                this.deserializedObjectToSourceLocationMapping.Remove(key);
-            }
-
-            this.deserializedObjectToSourceLocationMapping.Add(key, new SourceLocation(/* fileName = */ null,
-                sourceLocation.StartLine, sourceLocation.StartColumn,
-                sourceLocation.EndLine, sourceLocation.EndColumn));
-        }
-
-        // create a SourceLocation to ModelItem mapping based on the current activity to SourceLocation mapping.
-        private void UpdateSourceLocationToModelItemMapping(IEnumerable<ModelItem> modelItemsOnDesigner)
-        {
-            Dictionary<object, SourceLocation> validMapping = GetValidSourceLocationMapping();
-            this.sourceLocationToModelItemMapping.Clear();
-            this.viewStateSourceLocationToModelItemMapping.Clear();
-            foreach (ModelItem modelItem in modelItemsOnDesigner)
-            {
-                SourceLocation srcLocation = FindMatchSrcLocation(modelItem, validMapping);
-                if (srcLocation != null)
-                {
-                    sourceLocationToModelItemMapping.Add(srcLocation, modelItem);
-                }
-                string workflowViewStateIdRef = WorkflowViewState.GetIdRef(modelItem.GetCurrentValue());
-                if (!String.IsNullOrEmpty(workflowViewStateIdRef))
-                {
-                    SourceLocation viewStateSrcLocation = this.FindViewStateDataSrcLocationByViewStateIdRef(workflowViewStateIdRef);
-                    if (viewStateSrcLocation != null)
-                    {
-                        // In some cases duplicated key is possible, use indexer instead of Add() to avoid throw. 
-                        // See TFS bug 523908 for detailed information
-                        viewStateSourceLocationToModelItemMapping[viewStateSrcLocation] = modelItem;
-                    }
-                }
-            }
-
-            this.updateRequired = false;
-        }
-
-        // find a modelitem whose SourceLocation contains the srcLocation passed in.
-        internal ModelItem FindModelItem(SourceLocation srcLocation)
-        {
-            this.EnsureUpdated();
-            return FindModelItemInMap(srcLocation, this.sourceLocationToModelItemMapping);
-        }
-
-        internal ModelItem FindModelItemOfViewState(SourceLocation srcLocation)
-        {
-            this.EnsureUpdated();
-            return FindModelItemInMap(srcLocation, this.viewStateSourceLocationToModelItemMapping);
-        }
-
-        internal SourceLocation FindSourceLocation(ModelItem modelItem)
-        {
-            this.EnsureUpdated();
-            KeyValuePair<SourceLocation, ModelItem>? matchingMappingRecord = sourceLocationToModelItemMapping.SingleOrDefault(kvp => object.ReferenceEquals(kvp.Value, modelItem));
-            if (matchingMappingRecord.HasValue)
-            {
-                return matchingMappingRecord.Value.Key;
-            }
-            else
-            {
-                return null;
-            }
-        }
-
-        private static ModelItem FindModelItemInMap(SourceLocation sourceLocation, IDictionary<SourceLocation, ModelItem> map)
-        {
-            SourceLocation exactSourceLocation = GetExactLocation(sourceLocation, map);
-            if (exactSourceLocation == null)
-            {
-                return null;
-            }
-
-            return map[exactSourceLocation];
-        }
-
-        internal IEnumerable<ModelItem> GetObjectsWithSourceLocation()
-        {
-            this.EnsureUpdated();
-            return this.sourceLocationToModelItemMapping.Values;
-        }
-
-        private static SourceLocation FindSrcLocation(Dictionary<object, SourceLocation> mapping, Predicate<object> predicate)
-        {
-            object foundedObject = null;
-            if (mapping == null)
-            {
-                return null;
-            }
-
-            foreach (object key in mapping.Keys)
-            {
-                if (predicate(key))
-                {
-                    foundedObject = key;
-                    break;
-                }
-            }
-
-            if (foundedObject != null)
-            {
-                SourceLocation result = mapping[foundedObject];
-                mapping.Remove(foundedObject);
-                return result;
-            }
-
-            return null;
-        }
-
-        private static SourceLocation FindMatchSrcLocation(ModelItem modelItem, Dictionary<object, SourceLocation> mapping)
-        {
-            object modelObject = modelItem.GetCurrentValue();
-            return FindSrcLocation(mapping, (key) =>
-                {
-                    return object.ReferenceEquals(modelObject, key);
-                });
-        }
-
-        private SourceLocation FindViewStateDataSrcLocationByViewStateIdRef(string workflowViewStateIdRef)
-        {
-            if (this.ViewStateDataSourceLocationMapping == null)
-            {
-                return null;
-            }
-
-            SourceLocation sourceLocation = null;
-            this.ViewStateDataSourceLocationMapping.TryGetValue(workflowViewStateIdRef, out sourceLocation);
-            return sourceLocation;
-        }
-
-        // get the minimum source location which contains this source location and is in the mapping store.
-        private static SourceLocation GetExactLocation(SourceLocation approximateLocation, IDictionary<SourceLocation, ModelItem> mapping)
-        {
-            SourceLocation candidate = null;
-            foreach (SourceLocation srcLocation in mapping.Keys)
-            {
-                // in the scope?
-                if (srcLocation.Contains(approximateLocation))
-                {
-                    if (candidate != null)
-                    {
-                        // More approximate?
-                        if (candidate.Contains(srcLocation))
-                        {
-                            candidate = srcLocation;
-                        }
-                    }
-                    else
-                    {
-                        candidate = srcLocation;
-                    }
-                }
-            }
-
-            return candidate;
-        }
-
-        private void EnsureUpdated()
-        {
-            if (this.updateRequired)
-            {
-                IEnumerable<ModelItem> itemsOnDesigner = this.modelSearchService.GetItemsOnDesigner(preOrder: false, excludeRoot: false, excludeErrorActivity: false, excludeExpression: false, includeOtherObjects: true);
-                this.UpdateSourceLocationToModelItemMapping(itemsOnDesigner);
-            }
-        }
-
-        private Dictionary<object, SourceLocation> GetValidSourceLocationMapping()
-        {
-            Dictionary<object, SourceLocation> validSrcLocMapping = new Dictionary<object, SourceLocation>();
-            foreach (KeyValuePair<object, SourceLocation> entry in deserializedObjectToSourceLocationMapping)
-            {
-                if (IsValidRange(entry.Value.StartLine, entry.Value.StartColumn, entry.Value.EndLine, entry.Value.EndColumn))
-                {
-                    object sourceLocationObject = entry.Key;
-                    object modelItemObject;
-                    if (this.SourceLocationObjectToModelItemObjectMapping == null)
-                    {
-                        modelItemObject = sourceLocationObject;
-                    }
-                    else
-                    {
-                        this.SourceLocationObjectToModelItemObjectMapping.TryGetValue(sourceLocationObject, out modelItemObject);
-                    }
-
-                    if (modelItemObject != null)
-                    {
-                        validSrcLocMapping.Add(modelItemObject, entry.Value);
-                    }
-                }
-            }
-            return validSrcLocMapping;
-
-        }
-
-        private static bool IsValidRange(int startLine, int startColumn, int endLine, int endColumn)
-        {
-            return
-                (startLine > 0) && (startColumn > 0) && (endLine > 0) && (endColumn > 0) &&
-                ((startLine < endLine) || (startLine == endLine && startColumn < endColumn));
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Xaml/ShimAsPublicXamlType.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Xaml/ShimAsPublicXamlType.cs
deleted file mode 100644 (file)
index 316672a..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation.Xaml
-{
-    using System.Xaml;
-
-    // Class that takes a non-public type and acts as if it were public.
-    // Allows us to save ErrorActivitys without making that type public.
-    class ShimAsPublicXamlType : XamlType
-    {
-        public ShimAsPublicXamlType(Type type, XamlSchemaContext schemaContext) :
-            base(type, schemaContext)
-        {
-        }
-
-        protected override bool LookupIsPublic()
-        {
-            return true;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Xaml/SourceLocationExtensions.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Xaml/SourceLocationExtensions.cs
deleted file mode 100644 (file)
index 985cc4c..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-// <copyright>
-//   Copyright (c) Microsoft Corporation.  All rights reserved.
-// </copyright>
-
-namespace System.Activities.Presentation.Xaml
-{
-    using System;
-    using System.Activities.Debugger;
-    using System.Runtime;
-
-    [Serializable]
-    internal static class SourceLocationExtensions
-    {
-        internal static bool Contains(this SourceLocation outer, SourceLocation inner)
-        {
-            Fx.Assert(inner != null && outer != null, "Argument should not be null");
-
-            if ((inner.StartLine > outer.StartLine || (inner.StartLine == outer.StartLine && inner.StartColumn >= outer.StartColumn))
-             && (inner.EndLine < outer.EndLine || (inner.EndLine == outer.EndLine && inner.EndColumn <= outer.EndColumn)))
-            {
-                return true;
-            }
-
-            return false;
-        }
-    }
-}
diff --git a/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/XamlLoadErrorInfo.cs b/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/XamlLoadErrorInfo.cs
deleted file mode 100644 (file)
index f6db445..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-//----------------------------------------------------------------
-// Copyright (c) Microsoft Corporation.  All rights reserved.
-//----------------------------------------------------------------
-
-namespace System.Activities.Presentation
-{
-    using System;
-    using System.Runtime;
-
-    [Serializable]
-    [Fx.Tag.XamlVisible(false)]
-    public class XamlLoadErrorInfo
-    {
-        public XamlLoadErrorInfo(string message, int lineNumber, int linePosition)
-        {
-            this.Message = message;
-            this.LineNumber = lineNumber;
-            this.LinePosition = linePosition;
-        }
-
-        public int LineNumber { get; private set; }
-
-        public int LinePosition { get; private set; }
-
-        public string Message { get; private set; }
-
-        public string FileName { get; set; }
-    }
-}