Exemplo n.º 1
0
        private static void CheckPatternModel(IPatternModelSchema patternModel)
        {
            Console.WriteLine("Pattern: " + patternModel.Pattern.Name);

            CheckAutomation(patternModel.Pattern.AutomationSettings, "");

            var designView = patternModel.Pattern.Views.First();

            foreach (var element in ((IElementSchemaContainer)designView).Elements)
            {
                CheckElement(element, 1);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new view in the current pattern.
        /// </summary>
        public static IViewSchema CreateNewViewDiagram(this IPatternModelSchema patternModel, ModelingDocData docData, string name)
        {
            Guard.NotNull(() => patternModel, patternModel);
            Guard.NotNull(() => docData, docData);
            Guard.NotNull(() => name, name);

            // Create a new diagram
            var diagramId = PatternModelDocHelper.CreateNewViewDiagram(patternModel as PatternModelSchema, docData);

            // Create a new view
            IViewSchema view = null;

            if (diagramId != Guid.Empty)
            {
                view = patternModel.Pattern.CreateViewSchema(vw =>
                {
                    ((INamedElementSchema)vw).Name = name;
                    vw.DiagramId = diagramId.ToString();
                });
            }

            return(view);
        }