Exemple #1
0
        /// <summary>
        /// Standard constructor
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="ElementName"></param>
        /// <param name="shapeKey"></param>
        /// <param name="shapeViewModelSubKeys"></param>
        public UmlShapeBaseViewModel(IShapeParent parent,
                                     ShapeViewModelKey shapeKey,
                                     ShapeViewModelSubKeys shapeViewModelSubKeys,
                                     UmlTypes umlType)
            : base(parent)
        {
            this.mShapeKey = shapeKey;
            this.mShapeViewModelSubKeys = shapeViewModelSubKeys;
            this.mUmlType = umlType;

            this.mComments = new ObservableCollection <CommentViewModel>();

            this.mElementName = UmlTypeToStringConverter.Instance.Convert(umlType, umlType.GetType(), null,
                                                                          CultureInfo.InvariantCulture) as string;
        }
Exemple #2
0
        /// <summary>
        /// Get string identifier that represents the ImplementingViewModel
        /// as <seealso cref="ShapeViewModelKey"/> does. This identifier can
        /// be used by the TemplateSelector to find the implementing view
        /// (this extra property avoids an extra string cast).
        /// </summary>
        /// <param name="implementingViewModel"></param>
        /// <returns></returns>
        public static string GetPresentationStringKey(ShapeViewModelKey implementingViewModel)
        {
            switch (implementingViewModel)
            {
            case ShapeViewModelKey.Undefined:
                return(ShapeViewModelKeyStrings.ShapeUndefined);

            case ShapeViewModelKey.SquareShape:
                return(ShapeViewModelKeyStrings.ShapeSquare);

            case ShapeViewModelKey.DecisionShape:
                return(ShapeViewModelKeyStrings.ShapeDecision);

            case ShapeViewModelKey.PackageShape:
                return(ShapeViewModelKeyStrings.ShapePackage);

            case ShapeViewModelKey.BoundaryShape:
                return(ShapeViewModelKeyStrings.ShapeBoundary);

            case ShapeViewModelKey.NoteShape:
                return(ShapeViewModelKeyStrings.ShapeNote);

            case ShapeViewModelKey.NodeShape:
                return(ShapeViewModelKeyStrings.ShapeNode);

            case ShapeViewModelKey.UseCaseShape:
                return(ShapeViewModelKeyStrings.ShapeUseCase);

            case ShapeViewModelKey.CanvasShape:
                return(ShapeViewModelKeyStrings.ShapeCanvas);

            case ShapeViewModelKey.AssocationShape:
                return(ShapeViewModelKeyStrings.ShapeAssociation);

            default:
                throw new NotImplementedException();
            }
        }
Exemple #3
0
            public DataDef(string toolboxImageUrl,
                           ShapeViewModelKey implementingViewModel,
                           string shapeName,
                           string shapeStereotype,
                           string toolboxName,
                           string description,
                           string shapeImageUrl     = "",
                           bool shapeHorizontalLine = false,
                           double defaultWidth      = 95,
                           double defaultHeight     = 75)
            {
                this.ToolboxImageUrl       = toolboxImageUrl;
                this.ImplementingViewModel = implementingViewModel;
                this.ShapeName             = shapeName;
                this.ShapeStereotype       = shapeStereotype;
                this.ToolboxName           = toolboxName;
                this.ToolBoxDescription    = description;
                this.ShapeImageUrl         = shapeImageUrl;
                this.ShapeHorizontalLine   = shapeHorizontalLine;

                this.DefaultHeight = defaultHeight;
                this.DefaultWidth  = defaultWidth;
            }