Esempio n. 1
0
 public ClassAttributesEntryListView(VMDirSchemaClassEntryNode node)
 {
     ClassNode = node;
     //fetch attributes from schema manager for this object class.
     if (node != null)
     {
         List <AttributeTypeDTO> required = node.ServerNode.ServerDTO.Connection.SchemaManager.GetRequiredAttributes(ClassNode.DisplayName);
         required.ForEach(x => x.IsOptional = false);
         List <AttributeTypeDTO> optional = node.ServerNode.ServerDTO.Connection.SchemaManager.GetOptionalAttributes(ClassNode.DisplayName);
         optional.ForEach(x => x.IsOptional = true);
         AttributeEntries = required;
         AttributeEntries.AddRange(optional);
     }
 }
        public static void WriteAttributeTable(this MamlWriter writer, Context context, AttributeEntries attributeEntries)
        {
            if (attributeEntries.Attributes.Count == 0 && attributeEntries.AnyAttribute == null)
            {
                return;
            }

            writer.StartTable();
            writer.StartTableHeader();
            writer.StartTableRow();

            writer.WriteRowEntry("Name");
            writer.WriteRowEntry("Type");
            writer.WriteRowEntry("Required");
            writer.WriteRowEntry("Description");

            writer.EndTableRow();
            writer.EndTableHeader();

            var sortedAttributes = from a in attributeEntries.Attributes
                                   orderby a.QualifiedName.Name
                                   select a;

            foreach (var attribute in sortedAttributes)
            {
                writer.StartTableRow();

                writer.StartTableRowEntry();
                writer.StartParagraph();
                writer.WriteAttributeTopicLink(context.TopicManager, attribute,
                                               false, 0);
                writer.EndParagraph();
                writer.EndTableRowEntry();

                writer.StartTableRowEntry();
                writer.StartParagraph();
                writer.WriteType(context, attribute.AttributeSchemaType);
                writer.EndParagraph();
                writer.EndTableRowEntry();

                writer.StartTableRowEntry();
                writer.StartParagraph();
                writer.WriteRequiredText(attribute.Use);
                writer.EndParagraph();
                writer.EndTableRowEntry();

                writer.StartTableRowEntry();
                writer.StartParagraph();
                writer.WriteSummaryForObject(context, attribute);
                writer.EndParagraph();
                writer.EndTableRowEntry();

                writer.EndTableRow();
            }

            if (attributeEntries.AnyAttribute != null)
            {
                writer.StartTableRow();

                writer.StartTableRowEntry();
                writer.StartParagraph();
                writer.WriteArtItemWithText(ArtItem.AnyAttribute, "Any");
                writer.EndParagraph();
                writer.EndTableRowEntry();

                writer.StartTableRowEntry();
                writer.WriteParagraph(String.Empty);
                writer.EndTableRowEntry();

                writer.StartTableRowEntry();
                writer.WriteParagraph(String.Empty);
                writer.EndTableRowEntry();

                writer.StartTableRowEntry();
                writer.StartParagraph();
                writer.WriteSummaryForObject(context, attributeEntries.AnyAttribute);
                writer.EndParagraph();
                writer.EndTableRowEntry();

                writer.EndTableRow();
            }

            var sortedExtensionAttributes = from a in attributeEntries.ExtensionAttributes
                                            orderby a.QualifiedName.Name
                                            select a;

            foreach (var attribute in sortedExtensionAttributes)
            {
                writer.StartTableRow();

                writer.StartTableRowEntry();
                writer.StartParagraph();
                //writer.WriteHtmlIndent(1);
                writer.WriteAttributeTopicLink(context.TopicManager, attribute,
                                               true, 1);
                writer.EndParagraph();
                writer.EndTableRowEntry();

                writer.StartTableRowEntry();
                writer.StartParagraph();
                writer.WriteType(context, attribute.AttributeSchemaType);
                writer.EndParagraph();
                writer.EndTableRowEntry();

                writer.StartTableRowEntry();
                writer.StartParagraph();
                writer.WriteRequiredText(attribute.Use);
                writer.EndParagraph();
                writer.EndTableRowEntry();

                writer.StartTableRowEntry();
                writer.StartParagraph();
                writer.WriteSummaryForObject(context, attribute);
                writer.EndParagraph();
                writer.EndTableRowEntry();

                writer.EndTableRow();
            }

            writer.EndTable();
        }
Esempio n. 3
0
        public static void WriteAttributesSection(this MamlWriter writer, Context context, AttributeEntries attributeEntries)
        {
            if (attributeEntries.Attributes.Count == 0 && attributeEntries.AnyAttribute == null)
            {
                return;
            }

            writer.StartSection("Attributes", "attributes");
            writer.WriteAttributeTable(context, attributeEntries);

            writer.StartParagraph();
            if (context.MoveToTopLink)
            {
                // Create a link to the introduction, it is the top...
                writer.WriteLink("#introduction", "Top");
            }
            writer.EndParagraph();

            writer.EndSection();
        }
 public static void WriteAttributesSection(this MamlWriter writer, Context context, AttributeEntries attributeEntries)
 {
     writer.StartSection("Attributes", "attributes");
     writer.WriteAttributeTable(context, attributeEntries);
     writer.EndSection();
 }