コード例 #1
0
 private void CopyProperties(FeatureSection oldProperties, FeatureSection newProperties)
 {
     foreach (var property in oldProperties)
     {
         newProperties.Add((FeatureInfo)property.Clone());
     }
     newProperties.DetailsHidden = oldProperties.DetailsHidden;
 }
コード例 #2
0
 /// <summary>
 /// Add the visuals which render a section to the given group. If the section is expanded, also add its features.
 /// </summary>
 /// <param name="context">The current render context.</param>
 /// <param name="group">The VisualGroup to add the visuals to.</param>
 /// <param name="features">The featurese which make up the section.</param>
 /// <param name="section">The name of the section (e.g. "Methods").</param>
 /// <param name="box">The rectangle which defines the remaining space inside the node visualization.</param>
 /// <returns>The rectangle which defines the remaining space inside the node visualization after the section has been drawn.</returns>
 private RectD DrawSection(IRenderContext context, VisualGroup group, FeatureSection features, String section, RectD box)
 {
     box = DrawSectionHeader(context, group, section, box, features.DetailsHidden);
     if (!features.DetailsHidden)
     {
         foreach (FeatureInfo feature in features)
         {
             box = DrawFeature(context, group, feature, box);
         }
     }
     return(box);
 }
コード例 #3
0
        // the size of the given section
        private SizeF GetSectionSize(FeatureSection features, string section)
        {
            float height = sectionFont.Height;
            SizeF size   = GetTextSize(section, sectionFont);
            float width  = ImageSize + 2f + size.Width;

            if (!features.DetailsHidden)
            {
                foreach (FeatureInfo feature in features)
                {
                    size    = GetTextSize(feature.Signature, featureFont);
                    width   = Math.Max(width, size.Width + 30f);
                    height += featureFont.Height;
                }
            }
            return(new SizeF(width, height));
        }