Пример #1
0
 public object CreateDesignerContext() {
     var context = new DesignerContext();
     //Set the RuntimeNameProvider so the XAML designer will call it when items are added to
     //a design surface. Since the provider does not depend on an item context, we provide it at 
     //the project level.
     // This is currently disabled because we don't successfully serialize to the remote domain
     // and the default name provider seems to work fine.  Likely installing our assembly into
     // the GAC or implementing an IsolationProvider would solve this.
     //context.RuntimeNameProvider = new PythonRuntimeNameProvider();
     return context;
 }
Пример #2
0
 public ProjectAssetProvider(DesignerContext designerContext)
 {
     this.designerContext = designerContext;
 }
Пример #3
0
 public TifImageDocumentType(DesignerContext designerContext)
     : base(designerContext)
 {
 }
Пример #4
0
 internal virtual SceneDocument CreateSceneDocument(DocumentReference documentReference, SceneXamlDocument xamlDocument, bool isReadOnly, DesignerContext designerContext)
 {
     return(new SceneDocument(documentReference, xamlDocument, isReadOnly, this.designerContext));
 }
 private static PropertyValueEditor GetPropertyEditorTemplate(IProjectContext projectContext, DesignerContext designerContext, IType type)
 {
     if (PlatformTypes.Double.IsAssignableFrom((ITypeId)type) || PlatformTypes.Double.IsAssignableFrom((ITypeId)type.NullableType))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"DoubleViewTemplate"]));
     }
     if (PlatformTypes.Int32.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"IntViewTemplate"]));
     }
     if (PlatformTypes.UInt32.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"UIntViewTemplate"]));
     }
     if (PlatformTypes.Byte.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"ByteViewTemplate"]));
     }
     if (PlatformTypes.Int16.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"ShortViewTemplate"]));
     }
     if (PlatformTypes.UInt16.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"UShortViewTemplate"]));
     }
     if (PlatformTypes.Single.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"FloatViewTemplate"]));
     }
     if (PlatformTypes.TextAlignment.IsAssignableFrom((ITypeId)type))
     {
         DataTemplate inlineEditorTemplate = new DataTemplate();
         inlineEditorTemplate.VisualTree = new FrameworkElementFactory(typeof(TextAlignmentValueEditor));
         return(new PropertyValueEditor(inlineEditorTemplate));
     }
     if (PlatformTypes.Enum.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor(!EnumsThatUseButtons.ShouldUseButtonsForEnum((ITypeId)type) ? (!EnumsThatUseButtons.ShouldUseToggleButtonsForEnum((ITypeId)type) ? (DataTemplate)PropertyEditorTemplateLookup.resources[(object)"ChoiceComboViewTemplate"] : (DataTemplate)PropertyEditorTemplateLookup.resources[(object)"ChoiceToggleButtonsViewTemplate"]) : (DataTemplate)PropertyEditorTemplateLookup.resources[(object)"ChoiceButtonsViewTemplate"]));
     }
     if (PlatformTypes.Boolean.IsAssignableFrom((ITypeId)type) || PlatformTypes.Boolean.IsAssignableFrom((ITypeId)type.NullableType))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"BoolViewTemplate"]));
     }
     if (PlatformTypes.String.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"StringViewTemplate"]));
     }
     if (PlatformTypes.Vector3D.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"Vector3DEditorTemplate"]));
     }
     if (PlatformTypes.Point3D.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"Point3DEditorTemplate"]));
     }
     if (PlatformTypes.Point.IsAssignableFrom((ITypeId)type) || PlatformTypes.Vector.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"Point2DEditorTemplate"]));
     }
     if (PlatformTypes.Color.IsAssignableFrom((ITypeId)type) || PlatformTypes.Color.IsAssignableFrom((ITypeId)type.NullableType))
     {
         DataTemplate inlineEditorTemplate = (DataTemplate)PropertyEditorTemplateLookup.resources[(object)"ColorViewTemplate"];
         return((PropertyValueEditor) new ExtendedPropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"ColorExtendedTemplate"], inlineEditorTemplate));
     }
     if (PlatformTypes.Brush.IsAssignableFrom((ITypeId)type))
     {
         DataTemplate inlineEditorTemplate = (DataTemplate)PropertyEditorTemplateLookup.resources[(object)"BrushViewTemplate"];
         return((PropertyValueEditor) new ExtendedPropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"BrushEditorTemplate"], inlineEditorTemplate));
     }
     if (PlatformTypes.Material.IsAssignableFrom((ITypeId)type))
     {
         DataTemplate extendedEditorTemplate = new DataTemplate();
         extendedEditorTemplate.VisualTree = new FrameworkElementFactory(typeof(MaterialEditor.MaterialEditor));
         DataTemplate inlineEditorTemplate = (DataTemplate)PropertyEditorTemplateLookup.resources[(object)"MaterialViewTemplate"];
         return((PropertyValueEditor) new ExtendedPropertyValueEditor(extendedEditorTemplate, inlineEditorTemplate));
     }
     if (PlatformTypes.Transform.IsAssignableFrom((ITypeId)type) || PlatformTypes.Transform3D.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"TransformEditorTemplate"]));
     }
     if (PlatformTypes.Projection.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"ProjectionEditorTemplate"]));
     }
     if (PlatformTypes.Thickness.IsAssignableFrom((ITypeId)type))
     {
         DataTemplate inlineEditorTemplate = new DataTemplate();
         inlineEditorTemplate.VisualTree = new FrameworkElementFactory(typeof(ThicknessEditor));
         return(new PropertyValueEditor(inlineEditorTemplate));
     }
     if (PlatformTypes.GridLength.IsAssignableFrom((ITypeId)type))
     {
         DataTemplate inlineEditorTemplate = new DataTemplate();
         inlineEditorTemplate.VisualTree = new FrameworkElementFactory(typeof(GridLengthEditor));
         return(new PropertyValueEditor(inlineEditorTemplate));
     }
     if (PlatformTypes.FontFamily.IsAssignableFrom((ITypeId)type))
     {
         DataTemplate inlineEditorTemplate = new DataTemplate();
         inlineEditorTemplate.VisualTree = new FrameworkElementFactory(typeof(FontFamilyValueEditor));
         return(new PropertyValueEditor(inlineEditorTemplate));
     }
     if (PlatformTypes.DrawingImage.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"DrawingImageTemplate"]));
     }
     if (PlatformTypes.KeySpline.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"KeySplineEditorTemplate"]));
     }
     if (PlatformTypes.IEasingFunction.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"EasingFunctionEditorTemplate"]));
     }
     if (ProjectNeutralTypes.TransitionEffect.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"TransitionEffectEditorTemplate"]));
     }
     if (PlatformTypes.RepeatBehavior.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"RepeatBehaviorEditorTemplate"]));
     }
     if (ProjectNeutralTypes.GeometryEffect.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"GeometryEffectEditorTemplate"]));
     }
     if (ProjectNeutralTypes.LayoutPathCollection.IsAssignableFrom((ITypeId)type))
     {
         return(new PropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"LayoutPathCollectionEditorTemplate"]));
     }
     if (PlatformTypes.DoubleCollection.IsAssignableFrom((ITypeId)type))
     {
         return((PropertyValueEditor)null);
     }
     if (PlatformTypes.PointCollection.IsAssignableFrom((ITypeId)type))
     {
         return((PropertyValueEditor)null);
     }
     if (PropertyEditorTemplateLookup.ShouldUseCollectionEditor((ITypeId)type))
     {
         DataTemplate inlineEditorTemplate = (DataTemplate)PropertyEditorTemplateLookup.resources[(object)"CollectionDialogInlineTemplate"];
         return((PropertyValueEditor) new PropertyEditorTemplateLookup.CollectionDialogPropertyValueEditor((DataTemplate)PropertyEditorTemplateLookup.resources[(object)"CollectionDialogEditorTemplate"], inlineEditorTemplate, designerContext.MessageDisplayService));
     }
     if (PropertyEditorTemplateLookup.ShouldUseObjectEditor(type))
     {
         return(PropertyEditorTemplateLookup.ObjectEditorTemplate);
     }
     return((PropertyValueEditor)null);
 }
Пример #6
0
 internal ResourceDictionaryContentProvider(DesignerContext designerContext, XamlDocument resourceDictionary)
 {
     this.InitCommon(designerContext);
     this.resourceDictionary = resourceDictionary;
 }
 public FontFamilyRepairProcessor(DesignerContext designerContext, FontFamilyChangeModel fontFamilyChangeModel)
     : base(designerContext, (MultiDocumentReferenceChangeModel)fontFamilyChangeModel)
 {
     this.fontFamilyChangeModel = fontFamilyChangeModel;
 }
Пример #8
0
 public AssetDocumentType(DesignerContext designerContext)
 {
     this.designerContext = designerContext;
 }
 public DesignerContextPropertyEditingHelper(DesignerContext designerContext)
     : this(designerContext, (UIElement)null)
 {
 }
 public ResourceDictionaryDocumentType(DesignerContext designerContext)
     : base(designerContext)
 {
 }
 public ReferenceVerifierProcessor(DesignerContext designerContext, DispatcherPriority priority)
     : base(designerContext, priority)
 {
     this.invalidReferences = new List <InvalidReferenceModel>();
     this.Initialize();
 }
Пример #12
0
 public EventHandlerProvider(DesignerContext designerContext, SceneDocument document, ITypeDeclaration classModel)
 {
     this.designerContext = designerContext;
     this.document        = document;
     this.classModel      = classModel;
 }
Пример #13
0
 public PropertyInspectorSearchOnlineHelpCommand(DesignerContext designerContext)
     : base(designerContext)
 {
 }
Пример #14
0
 private void LoadSettings(DesignerContext designerContext)
 {
     this.configuration     = designerContext.Services.GetService <IConfigurationService>()["NewObjectDialog"];
     this.ShowAllAssemblies = (bool)this.configuration.GetProperty(ClrObjectDialogBase.showAllAssembliesProperty, (object)false);
 }
Пример #15
0
 public ArtboardOptionsPage(DesignerContext designerContext)
 {
     this.designerContext = designerContext;
 }
Пример #16
0
        public static SceneNode CreateAndSetBindingOrData(DesignerContext designerContext, SceneNode target, ReferenceStep targetProperty)
        {
            SceneNode sceneNode = (SceneNode)null;

            using (DataBindingDialog dataBindingDialog = new DataBindingDialog(target, targetProperty))
            {
                bool?nullable = dataBindingDialog.ShowDialog();
                if ((!nullable.GetValueOrDefault() ? 1 : (!nullable.HasValue ? true : false)) != 0)
                {
                    return((SceneNode)null);
                }
                using (target.ViewModel.AnimationEditor.DeferKeyFraming())
                {
                    using (SceneEditTransaction editTransaction = target.ViewModel.CreateEditTransaction(StringTable.UndoUnitSetBinding))
                    {
                        sceneNode = dataBindingDialog.model.CreateBindingOrData();
                        bool             flag    = sceneNode != null;
                        BindingSceneNode binding = sceneNode as BindingSceneNode;
                        if (binding != null)
                        {
                            flag = false;
                            if (binding.ElementBindingTarget != null)
                            {
                                binding.ElementBindingTarget.EnsureNamed();
                                binding.ElementName = binding.ElementBindingTarget.Name;
                            }
                            string errorMessage;
                            if (!binding.IsBindingLegal(target, targetProperty, out errorMessage))
                            {
                                MessageBoxArgs args = new MessageBoxArgs()
                                {
                                    Message = errorMessage,
                                    Button  = MessageBoxButton.OK,
                                    Image   = MessageBoxImage.Hand
                                };
                                int num = (int)designerContext.MessageDisplayService.ShowMessage(args);
                            }
                            else
                            {
                                IPropertyId propertyKey = (IPropertyId)targetProperty;
                                if (binding.Source != null)
                                {
                                    ISchema schema = dataBindingDialog.model.CurrentBindingSource.Schema;
                                    if (schema != null && schema.DataSource != null && schema.DataSource.DocumentNode != null)
                                    {
                                        propertyKey = BindingEditor.RefineDataContextProperty(target, (IPropertyId)targetProperty, schema.DataSource.DocumentNode);
                                    }
                                }
                                target.SetBinding(propertyKey, binding);
                                flag = true;
                            }
                        }
                        if (flag)
                        {
                            editTransaction.Commit();
                        }
                        else
                        {
                            editTransaction.Cancel();
                        }
                    }
                }
                return(sceneNode);
            }
        }
 public DesignerContextPropertyEditingHelper(DesignerContext designerContext, UIElement host)
     : base((SceneDocument)null, host)
 {
     this.designerContext = designerContext;
 }
Пример #18
0
 internal LocalValueObjectSet(object value, DesignerContext designerContext, IProjectContext projectContext)
 {
     this.localValue      = value;
     this.designerContext = designerContext;
     this.projectContext  = projectContext;
 }
Пример #19
0
 public PropertyInspectorHelpCommand(DesignerContext designerContext)
 {
     this.designerContext = designerContext;
     this.Hook();
 }
Пример #20
0
 internal ResourceDictionaryContentProvider(DesignerContext designerContext, IProjectItem projectItem)
 {
     this.InitCommon(designerContext);
     this.ProjectItem = projectItem;
 }
Пример #21
0
 internal SceneDocument(DocumentReference documentReference, SceneXamlDocument xamlDocument, bool isReadOnly, DesignerContext designerContext)
     : base(documentReference, xamlDocument.UndoService, isReadOnly)
 {
     PerformanceUtility.StartPerformanceSequence(PerformanceEvent.SceneDocumentConstructor);
     this.designerContext                   = designerContext;
     this.xamlDocument                      = xamlDocument;
     this.xamlDocument.TypesChanged        += new EventHandler(this.XamlDocument_TypesChanged);
     this.xamlDocument.RootNodeChanged     += new EventHandler(this.XamlDocument_RootNodeChanged);
     this.xamlDocument.HasTextEditsChanged += new EventHandler(this.XamlDocument_HasTextEditsChanged);
     PerformanceUtility.EndPerformanceSequence(PerformanceEvent.SceneDocumentConstructor);
 }
Пример #22
0
 public AddNewItemCommand(DesignerContext designerContext, params string[] typeFilter)
     : this(designerContext, true, typeFilter)
 {
     this.Services = (IServiceProvider)designerContext.Services;
 }
Пример #23
0
 public UserThemeAssetProvider(DesignerContext designerContext, ThemeManager themeManager, DocumentReference documentReference)
 {
     this.designerContext   = designerContext;
     this.documentReference = documentReference;
     this.themeManager      = themeManager;
 }
Пример #24
0
 protected XamlDocumentType(DesignerContext designerContext)
 {
     this.designerContext = designerContext;
 }
Пример #25
0
        private static ICollection <SceneNode> PasteData(SceneViewModel viewModel, SafeDataObject dataObject, ISceneInsertionPoint insertionPoint, bool allowInsertionPointChange, out bool canceledPasteOperation)
        {
            PerformanceUtility.MeasurePerformanceUntilRender(PerformanceEvent.PasteElements);
            canceledPasteOperation = false;
            List <SceneNode> list         = new List <SceneNode>();
            PastePackage     pastePackage = PastePackage.FromData(viewModel, dataObject);

            if (pastePackage != null)
            {
                if (allowInsertionPointChange)
                {
                    insertionPoint = PasteCommand.ComputeNewInsertionPoint(viewModel, insertionPoint, pastePackage);
                }
                if (!PasteCommand.CanAddMultipleElements(insertionPoint.SceneElement, pastePackage.Elements.Count))
                {
                    string name = insertionPoint.SceneElement.TargetType.Name;
                    viewModel.DesignerContext.MessageDisplayService.ShowError(string.Format((IFormatProvider)CultureInfo.CurrentCulture, StringTable.PasteMultipleInSingleContainerError, new object[1]
                    {
                        (object)name
                    }));
                }
                else if (pastePackage.Elements.Count == 0 && pastePackage.Storyboards.Count == 0 && pastePackage.Resources.Count > 0)
                {
                    viewModel.DesignerContext.MessageDisplayService.ShowError(StringTable.PasteElementsFailedNoElementsDialogMessage);
                }
                else
                {
                    IDictionary <DocumentNode, string> imageMap = (IDictionary <DocumentNode, string>) new Dictionary <DocumentNode, string>();
                    foreach (SceneNode sceneNode in pastePackage.Elements)
                    {
                        foreach (KeyValuePair <DocumentNode, string> keyValuePair in (IEnumerable <KeyValuePair <DocumentNode, string> >)Microsoft.Expression.DesignSurface.Utility.ResourceHelper.CreateImageReferenceMap(sceneNode.DocumentNode, pastePackage, viewModel))
                        {
                            imageMap.Add(keyValuePair);
                        }
                    }
                    foreach (SceneNode sceneNode in pastePackage.Resources)
                    {
                        foreach (KeyValuePair <DocumentNode, string> keyValuePair in (IEnumerable <KeyValuePair <DocumentNode, string> >)Microsoft.Expression.DesignSurface.Utility.ResourceHelper.CreateImageReferenceMap(sceneNode.DocumentNode, pastePackage, viewModel))
                        {
                            imageMap.Add(keyValuePair);
                        }
                    }
                    int index = 0;
                    ISupportsResources resourcesCollection = ResourceNodeHelper.GetResourcesCollection(viewModel.RootNode.DocumentNode);
                    if (resourcesCollection != null && resourcesCollection.Resources != null && resourcesCollection.Resources.SupportsChildren)
                    {
                        index = resourcesCollection.Resources.Children.Count;
                    }
                    if (Microsoft.Expression.DesignSurface.Utility.ResourceHelper.PasteResources(pastePackage, imageMap, ResourceConflictResolution.UseExisting | ResourceConflictResolution.RenameNew | ResourceConflictResolution.OverwriteOld, viewModel.RootNode, index, false))
                    {
                        ILayoutDesigner designerForParent = viewModel.GetLayoutDesignerForParent(insertionPoint.SceneElement, true);
                        List <PasteCommand.DelayedElementTranslationInfo> elementsToTranslateLater = new List <PasteCommand.DelayedElementTranslationInfo>(pastePackage.Elements.Count);
                        string copyElementToken = pastePackage.ClipboardCopyElementToken;
                        foreach (SceneElement element in pastePackage.Elements)
                        {
                            SceneElement sceneElement = PasteCommand.PasteElement(viewModel, element, elementsToTranslateLater, insertionPoint);
                            if (sceneElement != null)
                            {
                                Microsoft.Expression.DesignSurface.Utility.ResourceHelper.UpdateImageReferences(sceneElement.DocumentNode, imageMap, pastePackage, viewModel);
                                list.Add((SceneNode)sceneElement);
                                sceneElement.ClearValue(DesignTimeProperties.CopyTokenProperty);
                            }
                        }
                        if (copyElementToken != null)
                        {
                            pastePackage.SetGlobalCopyElementToken(copyElementToken);
                            PastePackage.PasteSelectionChangePending = true;
                        }
                        foreach (SceneNode childProperty in pastePackage.ChildPropertyNodes)
                        {
                            PasteCommand.PasteChildProperty(viewModel, childProperty, (IList <SceneNode>)list);
                        }
                        foreach (StoryboardTimelineSceneNode storyboard in pastePackage.Storyboards)
                        {
                            PasteCommand.PasteStoryboard(viewModel, storyboard, (IList <SceneNode>)list);
                        }
                        viewModel.Document.OnUpdatedEditTransaction();
                        viewModel.DefaultView.UpdateLayout();
                        using (viewModel.ForceBaseValue())
                        {
                            Rect empty = Rect.Empty;
                            foreach (PasteCommand.DelayedElementTranslationInfo elementTranslationInfo in elementsToTranslateLater)
                            {
                                empty.Union(elementTranslationInfo.Bounds);
                            }
                            foreach (PasteCommand.DelayedElementTranslationInfo elementTranslationInfo in elementsToTranslateLater)
                            {
                                elementTranslationInfo.UpdateTranslation(designerForParent, empty);
                            }
                        }
                    }
                    else
                    {
                        canceledPasteOperation = true;
                    }
                }
            }
            else if (dataObject.GetDataPresent(DataFormats.FileDrop))
            {
                DesignerContext designerContext = viewModel.DesignerContext;
                string[]        supportedFiles  = FileDropToolBehavior.CreateImageOrMediaDrop(designerContext).GetSupportedFiles(ClipboardService.GetDataObject());
                if (supportedFiles.Length > 0)
                {
                    IEnumerable <IProjectItem> importedItems = designerContext.ActiveProject.AddItems(Enumerable.Select <string, DocumentCreationInfo>((IEnumerable <string>)supportedFiles, (Func <string, DocumentCreationInfo>)(file => new DocumentCreationInfo()
                    {
                        SourcePath = file
                    })));
                    FileDropToolBehavior.AddItemsToDocument(viewModel.DefaultView, importedItems, new Point(0.0, 0.0), viewModel.ActiveSceneInsertionPoint);
                }
                else
                {
                    viewModel.DesignerContext.MessageDisplayService.ShowError(StringTable.PasteElementsFailedDialogMessage);
                }
            }
            else if (dataObject.GetDataPresent(DataFormats.Bitmap))
            {
                DesignerContext designerContext = viewModel.DesignerContext;
                IProjectItem    projectItem     = CutBuffer.AddImageDataFromClipboard(designerContext.ProjectManager, designerContext.ActiveProject);
                if (projectItem != null)
                {
                    FileDropToolBehavior.AddItemsToDocument(viewModel.DefaultView, (IEnumerable <IProjectItem>) new List <IProjectItem>()
                    {
                        projectItem
                    }, new Point(0.0, 0.0), viewModel.ActiveSceneInsertionPoint);
                }
                else
                {
                    viewModel.DesignerContext.MessageDisplayService.ShowError(StringTable.PasteElementsFailedDialogMessage);
                }
            }
            else
            {
                viewModel.DesignerContext.MessageDisplayService.ShowError(StringTable.PasteElementsFailedDialogMessage);
            }
            return((ICollection <SceneNode>)list);
        }
Пример #26
0
        private void TransformEditorBase_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            Microsoft.Windows.Design.PropertyEditing.PropertyValue propertyValue = this.DataContext as Microsoft.Windows.Design.PropertyEditing.PropertyValue;
            SceneNodeProperty sceneNodeProperty = (SceneNodeProperty)null;

            if (propertyValue != null)
            {
                sceneNodeProperty = (SceneNodeProperty)propertyValue.ParentProperty;
            }
            if (sceneNodeProperty == this.TransformProperty)
            {
                return;
            }
            this.Unhook();
            this.TransformProperty = sceneNodeProperty;
            if (this.TransformProperty == null)
            {
                return;
            }
            this.TransformProperty.PropertyReferenceChanged += new Microsoft.Expression.DesignSurface.Documents.PropertyReferenceChangedEventHandler(this.transformProperty_PropertyReferenceChanged);
            this.designerContext = this.TransformProperty.SceneNodeObjectSet.DesignerContext;
            TransformType transformType = TransformType.Transform2D;

            if (PlatformTypes.Transform3D.IsAssignableFrom((ITypeId)this.TransformProperty.PropertyTypeId))
            {
                transformType = TransformType.Transform3D;
            }
            else if (PlatformTypes.Transform.IsAssignableFrom((ITypeId)this.TransformProperty.PropertyTypeId))
            {
                transformType = TransformType.Transform2D;
            }
            else if (PlatformTypes.Projection.IsAssignableFrom((ITypeId)this.TransformProperty.PropertyTypeId))
            {
                transformType = TransformType.PlaneProjection;
            }
            else
            {
                IType type = this.TransformProperty.SceneNodeObjectSet.ProjectContext.GetType(this.TransformProperty.GetValue().GetType());
                if (PlatformTypes.Transform3D.IsAssignableFrom((ITypeId)type))
                {
                    transformType = TransformType.Transform3D;
                }
                else if (PlatformTypes.Transform.IsAssignableFrom((ITypeId)type))
                {
                    transformType = TransformType.Transform2D;
                }
                else if (PlatformTypes.Projection.IsAssignableFrom((ITypeId)type))
                {
                    transformType = TransformType.PlaneProjection;
                }
            }
            this.ObjectSet      = this.TransformProperty.SceneNodeObjectSet;
            this.PropertyLookup = new TransformPropertyLookup(this.TransformProperty, transformType);
            this.ComponentType  = this.PropertyLookup.CreateDefaultRelativeTransform().GetType();
            this.Initialize();
            foreach (FrameworkElement frameworkElement in (IEnumerable)this.TabCollection)
            {
                frameworkElement.DataContext = (object)this;
            }
            this.UpdateModel();
        }
Пример #27
0
 internal FindAnnotationsModel(DesignerContext designerContext, Action <string> showMessageAction)
 {
     this.designerContext   = designerContext;
     this.showMessageAction = showMessageAction;
     this.AnnotationService.AnnotationDeleted += new EventHandler <AnnotationEventArgs>(this.AnnotationService_AnnotationDeleted);
 }
Пример #28
0
 public PropertyManager(DesignerContext designerContext)
 {
     this.designerContext = designerContext;
     this.designerContext.SelectionManager.LateActiveSceneUpdatePhase += new SceneUpdatePhaseEventHandler(this.SelectionManager_LateActiveSceneUpdatePhase);
     this.propertyReferenceChangedHandlerList = new SortedList <PropertyReference, List <PropertyManager.HandlerInfo> >();
 }
Пример #29
0
        private static DependencyPropertyReferenceStep GetReferenceStepFromWpf(DesignerContext designerContext, IPlatform targetPlatform, Type targetType, DependencyProperty dp)
        {
            IPlatform defaultPlatform = designerContext.DesignerDefaultPlatformService.DefaultPlatform;

            return(designerContext.PlatformConverter.ConvertFromWpfPropertyReference(new PropertyReference((ReferenceStep)DependencyPropertyReferenceStep.GetReferenceStep(defaultPlatform.Metadata.DefaultTypeResolver, targetType, dp)), (IPlatformMetadata)targetPlatform.Metadata).FirstStep as DependencyPropertyReferenceStep);
        }