public override ICollection<TreeSection> GetTreeSections(OccurenceBrowserDescriptor descriptor)
        {
            var browserDescriptor = descriptor as GotoWordBrowserDescriptor;
              if (browserDescriptor == null)
            return EmptyList<TreeSection>.InstanceList;

              var sections = new List<TreeSection>();
              foreach (var section in descriptor.OccurenceSections)
              {
            var occurances = (section.Items.Count > 1) ? "textual occurances" : "textual occurance";
            var title = string.Format("Found {0} {1}", section.Items.Count, occurances);
            sections.Add(new TreeSection(section.Model, title));
              }

              return sections;
        }
        public override ICollection <TreeSection> GetTreeSections(OccurenceBrowserDescriptor descriptor)
        {
            var browserDescriptor = descriptor as GotoWordBrowserDescriptor;

            if (browserDescriptor == null)
            {
                return(EmptyList <TreeSection> .InstanceList);
            }

            var sections = new List <TreeSection>();

            foreach (var section in descriptor.OccurenceSections)
            {
                var occurrences = (section.Items.Count > 1) ? "textual occurrences" : "textual occurrence";
                var title       = string.Format("Found {0} {1}", section.Items.Count, occurrences);
                sections.Add(new TreeSection(section.Model, title));
            }

            return(sections);
        }
    /// <summary>
    /// Update descriptor's sections (sorting, titling, adding new sections) and return them.
    /// </summary>
    /// <param name="descriptor"/>
    /// <returns/>
    public override ICollection<TreeSection> GetTreeSections(OccurenceBrowserDescriptor descriptor)
    {
      var searchDescriptor = descriptor as GotoDeclaredElementsBrowserDescriptor;
      if (searchDescriptor == null)
      {
        return EmptyList<TreeSection>.InstanceList;
      }

      var model = new TreeSimpleModel();

      foreach (var result in descriptor.Items.OfType<ItemOccurence>())
      {
        model.Insert(null, result);
      }

      var tree = new TreeSection(model, "Sitecore Items");

      var list = new List<TreeSection>()
      {
        tree
      };

      return list;
    }
 public override bool IsApplicable(OccurenceBrowserDescriptor descriptor)
 {
     return descriptor is GotoWordBrowserDescriptor;
 }
 public override bool IsApplicable(OccurenceBrowserDescriptor descriptor)
 {
     return(descriptor is GotoWordBrowserDescriptor);
 }
 /// <summary>
 /// Determines whether the specified descriptor is applicable.
 /// </summary>
 /// <param name="descriptor">The descriptor.</param>
 /// <returns><c>true</c> if the specified descriptor is applicable; otherwise, <c>false</c>.</returns>
 public override bool IsApplicable(OccurenceBrowserDescriptor descriptor)
 {
   return descriptor is GotoDeclaredElementsBrowserDescriptor;
 }