IfcDoc.Program.ExportMvdObject C# (CSharp) Method

ExportMvdObject() private static method

Helper function to populate attributes
private static ExportMvdObject ( Element mvd, DocObject doc, bool documentation ) : void
mvd IfcDoc.Schema.MVD.Element
doc DocObject
documentation bool
return void
        private static void ExportMvdObject(Element mvd, DocObject doc, bool documentation)
        {
            mvd.Name = EnsureValidString(doc.Name);
            mvd.Uuid = doc.Uuid;
            mvd.Version = EnsureValidString(doc.Version);
            mvd.Owner = EnsureValidString(doc.Owner);
            mvd.Status = EnsureValidString(doc.Status);
            mvd.Copyright = EnsureValidString(doc.Copyright);
            mvd.Code = EnsureValidString(doc.Code);
            mvd.Author = EnsureValidString(doc.Author);

            #if false // why?
            if(mvd.Name == null)
            {
                mvd.Name = String.Empty;
            }
            #endif

            if (documentation && doc.Documentation != null)
            {
                Definition mvdDef = new Definition();
                mvdDef.Body = new Body();
                mvdDef.Body.Content = doc.Documentation;

                mvd.Definitions = new List<Definition>();
                mvd.Definitions.Add(mvdDef);

                if (doc.Localization != null && doc.Localization.Count > 0)
                {
                    mvdDef.Links = new List<Link>();
                    foreach (DocLocalization docLocal in doc.Localization)
                    {
                        Link mvdLink = new Link();
                        mvdDef.Links.Add(mvdLink);
                        mvdLink.Title = docLocal.Name;
                        mvdLink.Content = docLocal.Documentation;
                        mvdLink.Lang = docLocal.Locale;
                        mvdLink.Href = docLocal.URL;
                        mvdLink.Category = (CategoryEnum)(int)docLocal.Category;
                    }
                }
            }
        }