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 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;
        }