Esempio n. 1
0
    // ========================================================================
    // Con- / Destruction

    #region === Con- / Destruction

    /// <summary>
    /// Initializes a new instance of <see cref="NETImport"/>.
    /// </summary>
    public NETImport(ClassDiagram diagram, ImportSettings settings)
    {
      this.diagram = diagram;
      this.settings = settings;

      types = new Dictionary<NRTypeBase, TypeBase>();
    }
Esempio n. 2
0
        // ========================================================================
        // Methods

        #region === Methods

        /// <summary>
        ///   Starts the functionality of the plugin.
        /// </summary>
        protected void Launch()
        {
            if (Workspace.HasActiveProject)
            {
                string fileName;
                using (OpenFileDialog dialog = new OpenFileDialog())
                {
                    dialog.Filter = Strings.OpenFileDialog_Filter;
                    if (dialog.ShowDialog() == DialogResult.Cancel)
                    {
                        return;
                    }
                    fileName = dialog.FileName;
                }

                ImportSettings settings = new ImportSettings();
                using (ImportSettingsForm settingsForm = new ImportSettingsForm(settings))
                {
                    if (settingsForm.ShowDialog() == DialogResult.OK)
                    {
                        ClassDiagram diagram = new ClassDiagram(CSharpLanguage.Instance);
                        if (ImportAssembly(fileName, diagram, settings))
                        {
                            Workspace.ActiveProject.Add(diagram);
                        }
                    }
                }
            }
        }
Esempio n. 3
0
        public void Persist(ClassDiagram classDiagram, CreateClassDiagramCommand command)
        {
            foreach (var contentItem in command.Contents)
            {
                var classDiagramContent = new ClassDiagramContent();
                classDiagramContent.Id     = Guid.NewGuid();
                classDiagramContent.Locale = contentItem.Locale;
                classDiagramContent.Name   = contentItem.Name;
                classDiagram.Contents.Add(classDiagramContent);
                _classDiagramContentRepository.Add(classDiagramContent);
            }

            foreach (var classData in command.Classes)
            {
                PersistClass(classDiagram, classData);
            }

            foreach (var relationData in command.Relations)
            {
                var classRelation = new ClassRelationship();
                classRelation.Id                 = Guid.NewGuid();
                classRelation.SourceId           = relationData.SourceId.Value;
                classRelation.SourceMultiplicity = relationData.SourceMultiplicity;
                classRelation.TargetId           = relationData.TargetId.Value;
                classRelation.TargetMultiplicity = relationData.TargetMultiplicity;
                classRelation.Type               = relationData.Type.Value;

                classDiagram.Relationships.Add(classRelation);
                _classRelationRepository.Add(classRelation);
            }
        }
        // assoc [ "," assoc ]*
        public IClassDiagram ParseClassDiagram()
        {
            var cd = new ClassDiagram();

            while (_genericTokens.Count > 0)
            {
                if (!ParseClassOrAssociation(cd))
                {
                    return(null);
                }

                // either no more genericTokens OR comma, otherwise error
                if (!_genericTokens.TryConsume(TokenType.Comma))
                {
                    break;
                }
            }

            if (_genericTokens.Count > 0)
            {
                FireUnexpectedError(TokenType.Unknown);
                return(null);
            }

            return(cd);
        }
Esempio n. 5
0
 private void ParseFields(ClassDiagram classDiagram, IEnumerable <SDField> fields)
 {
     foreach (var field in fields.OrderBy(o => o.Name))
     {
         classDiagram.FieldRows.Add(new ClassDiagramRow(field.Identifier, "Field", field.Accessibility, field.Name));
     }
 }
Esempio n. 6
0
 private void ParseMethods(ClassDiagram classDiagram, IEnumerable <SDMethod> methods)
 {
     foreach (var method in methods.OrderBy(o => o.Name))
     {
         classDiagram.MethodRows.Add(new ClassDiagramRow(method.Identifier, "Method", method.Accessibility, method.Name));
     }
 }
Esempio n. 7
0
 private void ParseConstructors(ClassDiagram classDiagram, IEnumerable <SDMethod> constructors)
 {
     foreach (var constructor in constructors.OrderBy(o => o.Name))
     {
         classDiagram.ConstructorRows.Add(new ClassDiagramRow(constructor.Identifier, "Method", constructor.Accessibility, constructor.Name));
     }
 }
Esempio n. 8
0
 private void ParseEvents(ClassDiagram classDiagram, IEnumerable <SDEvent> events)
 {
     foreach (var ev in events.OrderBy(o => o.Name))
     {
         classDiagram.EventRows.Add(new ClassDiagramRow(ev.Identifier, "Event", ev.Accessibility, ev.Name));
     }
 }
Esempio n. 9
0
        public ClassDiagramControl(ClassDiagram diagram)
        {
            this.currentDiagram = diagram;
            this.Text           = currentDiagram.GetName();
            this.Name           = currentDiagram.GetName();
            this.AccessibleName = currentDiagram.GetName();
            this.menuManager    = new ClassDiagramViewMenuManager(this);
            this.menuManager.AddMenu();
            this.BackColor            = Color.White;
            this.Dock                 = DockStyle.Fill;
            this.AutoSize             = true;
            diagramWriter             = new ClassDiagramDao();
            txtDiagramBodi            = new TextBox();
            txtDiagramBodi.Multiline  = true;
            txtDiagramBodi.Text       = currentDiagram.bodi;
            txtDiagramBodi.WordWrap   = false;
            txtDiagramBodi.ScrollBars = ScrollBars.Vertical;
            txtDiagramBodi.Dock       = DockStyle.Fill;
            txtDiagramBodi.AutoSize   = true;
            txtDiagramBodi.Name       = currentDiagram.GetName();
            txtDiagramBodi.KeyUp     += new KeyEventHandler(ManageKeyCombinations);

            this.Controls.Add(txtDiagramBodi);
            this.Focus();
        }
Esempio n. 10
0
        // ========================================================================
        // Con- / Destruction

        #region === Con- / Destruction

        /// <summary>
        /// Initializes a new instance of <see cref="NETImport"/>.
        /// </summary>
        public NETImport(ClassDiagram diagram, ImportSettings settings)
        {
            this.diagram  = diagram;
            this.settings = settings;

            types = new Dictionary <NRTypeBase, TypeBase>();
        }
Esempio n. 11
0
        private void ClassSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ListInit();
            opList = new List <Operation>();

            ClassDiagram cd = XMLUtil.GetClassDiagramByName(this.cdList, (String)this.list_class.SelectedItem);

            if (cd != null)
            {
                this.list_ck.Items.Add("Dit: " + cd.Dit);
                this.list_ck.Items.Add("Cbo: " + cd.Cbo);
                this.list_ck.Items.Add("Noc: " + cd.Noc);

                foreach (String attribute in cd.Attributes)
                {
                    this.list_attribute.Items.Add(attribute);
                }

                foreach (Operation operation in cd.Operations)
                {
                    this.list_operation.Items.Add(operation.Name);
                    opList.Add(operation);
                }
            }
        }
        private double CalculateDiagramWidth(ClassDiagram classDiagram)
        {
            var allRows      = GetAllRows(classDiagram);
            var headerWidth  = (int)Math.Max(classDiagram.Name.GetWidth(14, Fonts.FontLight), classDiagram.Accessibility.GetWidth(11, Fonts.FontItalic));
            var maxWidthRows = allRows.Count > 0 ? allRows.Max(o => (int)o.Text.GetWidth(14, Fonts.FontLight)) : 0;

            return(Math.Max(headerWidth, maxWidthRows) + 65);
        }
Esempio n. 13
0
 public override void ToolMouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         this.classDiagram = new ClassDiagram(e.X, e.Y);
         Create(this.classDiagram);
     }
 }
        public static string GetDiagramText(ClassDiagram diagram)
        {
            var buffer = new StringBuilder();
            var generator = new BufferedClassDiagramGenerator(diagram, buffer);
            
            generator.Generate();

            return buffer.ToString();
        }
        public static string GetDiagramText(ClassDiagram diagram)
        {
            var buffer    = new StringBuilder();
            var generator = new BufferedClassDiagramGenerator(diagram, buffer);

            generator.Generate();

            return(buffer.ToString());
        }
        private List <ClassDiagramRow> GetAllRows(ClassDiagram classDiagram)
        {
            var allRows = new List <ClassDiagramRow>();

            allRows.AddRange(classDiagram.FieldRows);
            allRows.AddRange(classDiagram.PropertyRows);
            allRows.AddRange(classDiagram.MethodRows);
            allRows.AddRange(classDiagram.EventRows);
            return(allRows);
        }
Esempio n. 17
0
        private static void newJavaDiagram_Click(object sender, EventArgs e)
        {
            ToolStripItem menuItem = (ToolStripItem)sender;
            Project       project  = ((ProjectNode)menuItem.OwnerItem.Owner.Tag).Project;

            IDiagram diagram = new ClassDiagram(JavaLanguage.Instance);

            Settings.Default.DefaultLanguageName = JavaLanguage.Instance.AssemblyName;
            project.Add(diagram);
        }
Esempio n. 18
0
        public void ImportFromSource(string fileName)
        {
            var assembly = AssemblyGenerator.Generate(fileName);
            var settings = GetDefaultSettings();
            var diagram  = new ClassDiagram(CSharpLanguage.Instance);
            var importer = new NETImport(diagram, settings);

            importer.ImportAssembly(assembly.Location, useNewAppDomain: false).ShouldBeTrue();
            diagram.ToXml().ShouldMatchApproved(config => config.WithDescriminator(fileName));
        }
Esempio n. 19
0
 protected internal ClassDiagramVisitorContext(ClassDiagram diagram)
 {
     this.TypeMetaModelSet        = diagram.Types;
     this.Diagram                 = diagram;
     this.ScanMode                = this.Diagram.ScanMode;
     this.ShowMembers             = this.Diagram.ShowMembers;
     this.ShowMembersBindingFlags = this.Diagram.ShowMembersBindingFlags;
     this.ShowMethods             = this.Diagram.ShowMethods;
     this.ShowMethodsBindingFlags = this.Diagram.ShowMethodsBindingFlags;
 }
 protected internal ClassDiagramVisitorContext(ClassDiagram diagram)
 {
     this.TypeMetaModelSet = diagram.Types;
     this.Diagram = diagram;
     this.ScanMode = this.Diagram.ScanMode;
     this.ShowMembers = this.Diagram.ShowMembers;
     this.ShowMembersBindingFlags = this.Diagram.ShowMembersBindingFlags;
     this.ShowMethods = this.Diagram.ShowMethods;
     this.ShowMethodsBindingFlags = this.Diagram.ShowMethodsBindingFlags;
 }
Esempio n. 21
0
 private void mnuNewJavaDiagram_Click(object sender, EventArgs e)
 {
     if (Workspace.Default.HasActiveProject)
     {
         ShowModelExplorer = true;
         var diagram = new ClassDiagram(JavaLanguage.Instance);
         Workspace.Default.ActiveProject.Add(diagram);
         Settings.Default.DefaultLanguageName = JavaLanguage.Instance.AssemblyName;
     }
 }
 public static ClassDiagramViewModel FromModel(ClassDiagram model)
 {
     return(new ClassDiagramViewModel
     {
         Id = model.Id,
         Identifier = model.Identifier,
         PackageIdentifier = model.SpecificationItem.Package.Identifier,
         Version = model.Version,
         Contents = model.Contents.Select(ClassDiagramContentViewModel.FromModel)
     });
 }
        public Diagram CreateDiagram(String path, string name)
        {
            string       pathDiagram = fileSistem.ConbinePaths(path, name) + ".cd";
            ClassDiagram cd          = new ClassDiagram();

            cd.name = name;
            cd.path = pathDiagram;
            cd.bodi = "";
            diagramDao.WriteDiagram(cd);
            return(cd);
        }
Esempio n. 24
0
		private void AddEmptyDiagram()
		{
			TreeNode parent = Parent;

			this.Delete();
			// TODO: in the settings there should be a default diagram. This should check
			// for the default first and then only if it is a class diagram for the 
			// default language
			IDiagram diagram = new ClassDiagram(Settings.Default.GetDefaultLanguage());
			project.Add(diagram);
		}
Esempio n. 25
0
        private void AddEmptyDiagram()
        {
            TreeNode parent = Parent;

            this.Delete();
            // TODO: in the settings there should be a default diagram. This should check
            // for the default first and then only if it is a class diagram for the
            // default language
            IDiagram diagram = new ClassDiagram(Settings.Default.GetDefaultLanguage());

            project.Add(diagram);
        }
 public static ClassDiagramDetailedViewModel FromModel(ClassDiagram model)
 {
     return(new ClassDiagramDetailedViewModel
     {
         Id = model.Id,
         Identifier = model.Identifier,
         Version = model.Version,
         PackageId = model.SpecificationItem.PackageId,
         Contents = model.Contents.Select(ClassDiagramContentViewModel.FromModel),
         Classes = model.Classes.Select(ClassViewModel.FromModel),
         Relations = model.Relationships.Select(ClassRelationshipViewModel.FromModel)
     });
 }
        private Size CalculateDiagramSize(ClassDiagram classDiagram)
        {
            var allRows             = GetAllRows(classDiagram);
            var headerWidth         = (int)Math.Max(classDiagram.Name.GetWidth(12, Fonts.FontLight), classDiagram.Accessibility.GetWidth(10, Fonts.FontItalic));
            var maxWidthRows        = allRows.Count > 0 ? allRows.Max(o => (int)o.Text.GetWidth(12, Fonts.FontLight)) : 0;
            var horizontalLineCount = CountSections(classDiagram);

            var size = new Size();

            size.Width  = Math.Max(headerWidth, maxWidthRows) + 65;
            size.Height = (3 * 20) + (10 * (horizontalLineCount > 0 ? horizontalLineCount - 1 : 0)) + allRows.Count * 20;

            return(size);
        }
Esempio n. 28
0
        public void TestClassDiagram1()
        {
            var document = TestHelper.SetupDocument(@"C:\temp\commontext.cs", Host);

            var w       = new Window();
            var diagram = new ClassDiagram {
                Document = document
            };
            var grid = new Grid();

            grid.Children.Add(diagram);
            w.Content = grid;
            w.ShowDialog();
        }
Esempio n. 29
0
        public void createObjectTest()
        {
            List <AppLayer.Object> myObjects = new List <AppLayer.Object>();
            ClassDiagram           myObject  = new ClassDiagram(0, 0, 100, 100);

            CreateObjectCommand myCommand = new CreateObjectCommand(myObject, ref myObjects);

            myCommand.execute();

            if (myObjects.Count != 1)
            {
                Assert.Fail();
            }
        }
Esempio n. 30
0
        public SvgRoot RenderConnectedDiagram(ClassDiagram classDiagram)
        {
            _classDiagram = classDiagram;
            _mainDiagram  = _classDiagramSvgRenderer.RenderDiagram(_classDiagram);

            CalculateMainMarginsAndSize();
            PositionMainDiagram();
            DrawBaseTypes();
            DrawImplementedInterfaces();
            DrawUsedBy();
            DrawUses();

            return(_mainDiagram);
        }
Esempio n. 31
0
 public override void ToolMouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left && canvas != null)
     {
         canvas.DeselectAllObjects();
         selectedObject = canvas.SelectObjectAt(e.X, e.Y);
         if (selectedObject is ClassDiagram)
         {
             ClassDiagram classDiagram = (selectedObject as ClassDiagram);
             string       value        = PopUpForm("Property Name");
             classDiagram.AddPropertyText(value);
         }
     }
 }
        private int RenderHeader(ClassDiagram classDiagram, int position)
        {
            var formattedAccessibility = new FormattedText(classDiagram.Accessibility, CultureInfo.CurrentCulture, FlowDirection.LeftToRight, Fonts.FontItalic, 10, Brushes.Black);

            _context.DrawText(formattedAccessibility, new Point((_diagramSize.Width - classDiagram.Accessibility.GetWidth(10, Fonts.FontItalic)) / 2, position));

            var formattedName = new FormattedText(classDiagram.Name, CultureInfo.CurrentCulture, FlowDirection.LeftToRight, Fonts.FontLight, 12, Brushes.Black);

            _context.DrawText(formattedName, new Point((_diagramSize.Width - classDiagram.Name.GetWidth(12, Fonts.FontLight)) / 2, position += 15));
            position += 20;

            _context.DrawLine(new Pen(Brushes.Black, 1), new Point(1, position), new Point(_diagramSize.Width - 1, position));
            position += 10;
            return(position);
        }
        private void RenderAllRowSections(ClassDiagram classDiagram, int position)
        {
            var renderLine = FollowingSectionsNotEmpty(classDiagram, "Fields");

            position = RenderRowSection(classDiagram.FieldRows, position, _diagramSize, renderLine);

            renderLine = FollowingSectionsNotEmpty(classDiagram, "Events");
            position   = RenderRowSection(classDiagram.EventRows, position, _diagramSize, renderLine);

            renderLine = FollowingSectionsNotEmpty(classDiagram, "Methods");
            position   = RenderRowSection(classDiagram.ConstructorRows, position, _diagramSize, false);
            position   = RenderRowSection(classDiagram.MethodRows, position, _diagramSize, renderLine);

            RenderRowSection(classDiagram.PropertyRows, position, _diagramSize, false);
        }
        public double CalculateDiagramHeight(ClassDiagram classDiagram)
        {
            var allRows          = GetAllRows(classDiagram);
            var notEmptySections =
                (classDiagram.FieldRows.Count != 0 ? 1 : 0) +
                (classDiagram.PropertyRows.Count != 0 ? 1 : 0) +
                (classDiagram.MethodRows.Count != 0 || classDiagram.ConstructorRows.Count != 0 ? 1 : 0) +
                (classDiagram.EventRows.Count != 0 ? 1 : 0);

            var allRowsHeight = allRows.Count * 25 + (notEmptySections > 0 ? (notEmptySections - 1) * 10 : 0);

            //Das Firstrowoffset gibt den y wert der unterkante der ersten row an
            //damit der wert korrekt ist muss eine row (ohne margin) von der berechnung abgezogen werden
            return((FIRSTROW_OFFSET_Y - 15) + allRowsHeight);
        }
Esempio n. 35
0
        public static string Save(string outputDirectory, ClassDiagram diagram, IRunnerRecorder recorder)
        {
            var filePath = Path.Combine(outputDirectory, "{0}.nplant".FormatWith(diagram.Name.ReplaceIllegalPathCharacters('_')));

            if (File.Exists(filePath))
                File.Delete(filePath);

            using (var file = File.CreateText(filePath))
            {
                var generator = new FileClassDiagramGenerator(diagram, file);
                generator.Generate();
                
                recorder.Log("Diagram '{0}' written...".FormatWith(diagram.GetType().FullName));
                recorder.Record(filePath);
            }

            return filePath;
        }
 public SimulatedClassDiagramGenerator(ClassDiagram diagram) : base(diagram)
 {
     _definition = diagram;
 }
Esempio n. 37
0
 public ClassDiagramGenerator(ClassDiagram definition)
 {
     _definition = definition.CheckForNullArg("definition");
 }
 public BufferedClassDiagramGenerator(ClassDiagram definition, StringBuilder buffer) : base(definition)
 {
     _buffer = buffer;
 }
Esempio n. 39
0
 public LoadedDiagram(ClassDiagram diagram)
 {
     _diagram = diagram;
     _name = _diagram.Name;
 }
Esempio n. 40
0
		private static void newJavaDiagram_Click(object sender, EventArgs e)
		{
			ToolStripItem menuItem = (ToolStripItem) sender;
			Project project = ((ProjectNode) menuItem.OwnerItem.Owner.Tag).Project;

			IDiagram diagram = new ClassDiagram(JavaLanguage.Instance);
			Settings.Default.DefaultLanguageName = JavaLanguage.Instance.AssemblyName;
			project.Add(diagram);
		}
Esempio n. 41
0
 public ClassDiagramGeneration(ClassDiagram diagram) : this(new ClassDiagramVisitorContext(diagram))
 {
 }
Esempio n. 42
0
 public ClassDiagramSimulation(ClassDiagram diagram)
 {
     _definition = diagram;
     _context = _definition.CreateGenerationContext();
 }
Esempio n. 43
0
		public ConnectionCreator(ClassDiagram diagram, RelationshipType type)
		{
			this.diagram = diagram;
			this.type = type;
		}
Esempio n. 44
0
		public virtual void SaveDiagram(DslModeling::SerializationResult serializationResult, ClassDiagram diagram, string diagramFileName, global::System.Text.Encoding encoding, bool writeOptionalPropertiesWithDefaultValue)
		{
			#region Check Parameters
			if (serializationResult == null)
				throw new global::System.ArgumentNullException("serializationResult");
			if (diagram == null)
				throw new global::System.ArgumentNullException("diagram");
			if (string.IsNullOrEmpty(diagramFileName))
				throw new global::System.ArgumentNullException("diagramFileName");
			#endregion
	
			if (serializationResult.Failed)
				return;
	
			using (global::System.IO.MemoryStream diagramFileContent = this.InternalSaveDiagram(serializationResult, diagram, diagramFileName, encoding, writeOptionalPropertiesWithDefaultValue))
			{
				if (!serializationResult.Failed)
				{
					// Only write the contents if there's no error encountered during serialization.
					if (diagramFileContent != null)
					{
						using (global::System.IO.FileStream fileStream = new global::System.IO.FileStream(diagramFileName, global::System.IO.FileMode.Create, global::System.IO.FileAccess.Write, global::System.IO.FileShare.None))
						{
							using (global::System.IO.BinaryWriter writer = new global::System.IO.BinaryWriter(fileStream, encoding))
							{
								writer.Write(diagramFileContent.ToArray());
							}
						}
					}
				}
			}
		}
Esempio n. 45
0
    // ========================================================================
    // Methods

    #region === Methods

    /// <summary>
    ///   Starts the functionality of the plugin.
    /// </summary>
    protected void Launch()
    {
      if(Workspace.HasActiveProject)
      {
        string fileName;
        using (OpenFileDialog dialog = new OpenFileDialog())
        {
          dialog.Filter = Strings.OpenFileDialog_Filter;
          if (dialog.ShowDialog() == DialogResult.Cancel)
            return;
          fileName = dialog.FileName;
        }

        ImportSettings settings = new ImportSettings();
        using(ImportSettingsForm settingsForm = new ImportSettingsForm(settings))
        {
          if(settingsForm.ShowDialog() == DialogResult.OK)
          {
            ClassDiagram diagram = new ClassDiagram(CSharpLanguage.Instance);
            NETImport importer = new NETImport(diagram, settings);

            if(importer.ImportAssembly(fileName))
            {
              Workspace.ActiveProject.Add(diagram);
            }
          }
        }
      }
    }
Esempio n. 46
0
		/// <summary>
		/// Saves the given diagram to the given file, with default encoding (UTF-8).
		/// </summary>
		/// <param name="serializationResult">Stores serialization result from the save operation.</param>
		/// <param name="diagram">ClassDiagram to be saved.</param>
		/// <param name="diagramFileName">Name of the file in which the diagram will be saved.</param>
		/// <param name="writeOptionalPropertiesWithDefaultValue">Whether optional properties with default value will be saved.</param>
		public virtual void SaveDiagram(DslModeling::SerializationResult serializationResult, ClassDiagram diagram, string diagramFileName, bool writeOptionalPropertiesWithDefaultValue)
		{
			this.SaveDiagram(serializationResult, diagram, diagramFileName, global::System.Text.Encoding.UTF8, writeOptionalPropertiesWithDefaultValue);
		}
Esempio n. 47
0
		/// <summary>
		/// Saves the given diagram to the given file, with default encoding (UTF-8), and optional properties with default value will not
		/// be written out.
		/// </summary>
		/// <param name="serializationResult">Stores serialization result from the save operation.</param>
		/// <param name="diagram">ClassDiagram to be saved.</param>
		/// <param name="diagramFileName">Name of the file in which the diagram will be saved.</param>
		public virtual void SaveDiagram(DslModeling::SerializationResult serializationResult, ClassDiagram diagram, string diagramFileName)
		{
			this.SaveDiagram(serializationResult, diagram, diagramFileName, global::System.Text.Encoding.UTF8, false);
		}
Esempio n. 48
0
		internal protected virtual ClassDiagram CreateDiagramHelper(DslModeling::Partition diagramPartition, DslModeling::ModelElement modelRoot)
		{
			ClassDiagram diagram = new ClassDiagram(diagramPartition);
			return diagram;
		}
Esempio n. 49
0
		private global::System.IO.MemoryStream InternalSaveDiagram(DslModeling::SerializationResult serializationResult, ClassDiagram diagram, string diagramFileName, global::System.Text.Encoding encoding, bool writeOptionalPropertiesWithDefaultValue)
		{
			#region Check Parameters
			global::System.Diagnostics.Debug.Assert(serializationResult != null);
			global::System.Diagnostics.Debug.Assert(diagram != null);
			global::System.Diagnostics.Debug.Assert(!serializationResult.Failed);
			#endregion
	
			DslModeling::DomainXmlSerializerDirectory directory = this.GetDirectory(diagram.Store);
	
			
			global::System.IO.MemoryStream newFileContent = new global::System.IO.MemoryStream();
			
			DslModeling::SerializationContext serializationContext = new DslModeling::SerializationContext(directory, diagramFileName, serializationResult);
			this.InitializeSerializationContext(diagram.Partition, serializationContext, false);
			// MonikerResolver shouldn't be required in Save operation, so not calling SetupMonikerResolver() here.
			serializationContext.WriteOptionalPropertiesWithDefaultValue = writeOptionalPropertiesWithDefaultValue;
			global::System.Xml.XmlWriterSettings settings = AgileModelerSerializationHelper.Instance.CreateXmlWriterSettings(serializationContext, true, encoding);
			using (global::System.Xml.XmlWriter writer = global::System.Xml.XmlWriter.Create(newFileContent, settings))
			{
				this.WriteRootElement(serializationContext, diagram, writer);
			}
	
			return newFileContent;
		}
Esempio n. 50
0
 public ClassDiagramFormatter(ClassDiagram diagram, ClassDiagramVisitorContext context)
 {
     _diagram = diagram;
     _context = context;
 }
Esempio n. 51
0
 public ClassDiagramVisitorContext(ClassDiagram diagram, TypeMetaModelSet metaModelSet)
 {
     this.TypeMetaModelSet = metaModelSet;
     this.Diagram = diagram;
 }
Esempio n. 52
0
 public override IDescriptorWriter GetWriter(ClassDiagram diagram)
 {
     return new ClassWriter(diagram, this);
 }
Esempio n. 53
0
 public DiscoveredDiagram(string @namespace, ClassDiagram diagram)
 {
     Namespace = @namespace;
     Diagram = diagram;
 }
Esempio n. 54
0
 public override IDescriptorWriter GetWriter(ClassDiagram diagram)
 {
     return new EnumWriter(this.ReflectedType);
 }
Esempio n. 55
0
 internal ClassDiagramPackage(string name, ClassDiagram diagram)
 {
     _diagram = diagram;
     _name = name;
 }
Esempio n. 56
0
 public ClassWriter(ClassDiagram diagram, ClassDescriptor @class)
 {
     _diagram = diagram;
     this._class = @class;
 }
Esempio n. 57
0
 public abstract IDescriptorWriter GetWriter(ClassDiagram diagram);
 public FileClassDiagramGenerator(ClassDiagram definition, StreamWriter file) : base(definition)
 {
     _file = file;
 }
Esempio n. 59
0
		private void mnuNewJavaDiagram_Click(object sender, EventArgs e)
		{
			if (Workspace.Default.HasActiveProject)
			{
				ShowModelExplorer = true;
				var diagram = new ClassDiagram(JavaLanguage.Instance);
				Workspace.Default.ActiveProject.Add(diagram);
				Settings.Default.DefaultLanguageName = JavaLanguage.Instance.AssemblyName;
			}
		}
Esempio n. 60
0
 protected ClassDiagramGenerator(ClassDiagram definition)
 {
     Definition = definition.CheckForNullArg("definition");
 }