Esempio n. 1
0
        public void AddToTrivialTypeList(IVisualisableType type)
        {
            if (type == null)
            {
                throw new ArgumentNullResourceException("type", Resources.General_Given_Parameter_Cannot_Be_Null);
            }

            TrivialTypes.Add(new ExactMatch { FullTypeName = type.NamespaceQualifiedName });
            SaveTrivialExcludeXml();
        }
Esempio n. 2
0
        internal static void StyleLineForNonParentAssociation(ConnectionLine line, int usageCount, IVisualisableType associatedTo, bool isTrivial)
        {
            if (line == null)
            {
                throw new ArgumentNullResourceException("line", Resources.General_Given_Parameter_Cannot_Be_Null);
            }

            double thickness = 2.25 + (usageCount * 0.75);
            if (thickness > 15)
            {
                thickness = 15;
            }

            if (associatedTo.Modifiers.Kind == TypeKind.Interface)
            {
                line.Style = "AssociationLineInterface";
                line.Thickness = thickness;
            }
            else if (isTrivial)
            {
                line.Style = "AssociationLineTrivial";
                line.Thickness = thickness;
            }
            else
            {
                line.Style = "AssociationLineStrong";
                line.Thickness = thickness + 1;
            }
        }
 /// <summary>
 /// Begins the navigating to the chosen type asynchronously.
 /// Called by the view.
 /// </summary>
 /// <param name="association">The association.</param>
 public void NavigateToAssociation(IVisualisableType association)
 {
     // Notify the File Manager that a new type needs to be loaded.
     Messenger.Send(new NavigateToDiagramAssociationMessage(DiagramId, association));
 }
Esempio n. 4
0
        /// <summary>
        /// This overload is only used when Navigating to an existing type on a diagram.
        /// </summary>
        /// <param name="type">
        /// The existing type from the diagram
        /// </param>
        /// <param name="depth">
        /// A depth counter to prevent infinitely recursively loading types
        /// </param>
        /// <returns>
        /// The <see cref="IVisualisableTypeWithAssociations"/>.
        /// </returns>
        public IVisualisableTypeWithAssociations BuildSubject(IVisualisableType type, int depth)
        {
            if (type == null)
            {
                throw new ArgumentNullResourceException("type", Resources.General_Given_Parameter_Cannot_Be_Null);
            }

            Type netType = this.BuildType(type.AssemblyFileName, type.AssemblyQualifiedName);
            IVisualisableTypeWithAssociations subject = this.BuildSubject(netType, depth);
            subject.InitialiseForReuseFromCache(depth);
            return subject;
        }
Esempio n. 5
0
        public Task<IVisualisableTypeWithAssociations> LoadFromVisualisableTypeAsync(IVisualisableType type)
        {
            if (type == null)
            {
                return null;
            }

            this.RecentFiles.SetCurrentFile(type.AssemblyFileName);
            this.RecentFiles.SetCurrentType(type.AssemblyQualifiedName);
            this.RecentFiles.SaveRecentFile();

            return Task.Factory.StartNew(() => new ModelBuilder().BuildSubject(type, 0), TaskCreationOptions.LongRunning);
        }
 public NavigateToDiagramAssociationMessage(Guid diagramId, IVisualisableType type)
     : base(diagramId)
 {
     DiagramType = type;
 }