Ejemplo n.º 1
0
 private void OpenTypeView(System.Type type)
 {
     OpenTypeProjectItem projectItem = new OpenTypeProjectItem(type, this._project);
     this._project.OpenProjectItem(projectItem, true, DocumentViewType.Default);
 }
Ejemplo n.º 2
0
 void IClassViewService.ShowType(System.Type type)
 {
     if (type == null)
     {
         throw new ArgumentNullException("type");
     }
     while (!type.IsEnum && (type.GetElementType() != null))
     {
         type = type.GetElementType();
     }
     OpenTypeProjectItem projectItem = new OpenTypeProjectItem(type, this);
     this.OpenProjectItem(projectItem, true, DocumentViewType.Default);
 }
Ejemplo n.º 3
0
 private void OnSearchResultsPosted(object sender, AsyncTaskResultPostedEventArgs e)
 {
     if ((this._searchTask != null) && (this._searchTask == sender))
     {
         ICollection data = e.Data as ICollection;
         if ((data != null) && (data.Count != 0))
         {
             try
             {
                 this._listView.BeginUpdate();
                 foreach (MemberInfo info in data)
                 {
                     System.Type reflectedType = info as System.Type;
                     string extraData = string.Empty;
                     if (reflectedType == null)
                     {
                         reflectedType = info.ReflectedType;
                         if (this._searchOnly)
                         {
                             extraData = string.Concat(new object[] { info.Name, " [", info.MemberType, "]" });
                         }
                     }
                     OpenTypeProjectItem item = new OpenTypeProjectItem(reflectedType, this._project);
                     item.EnsureTypeInformation();
                     ClassViewListViewItem item2 = new ClassViewListViewItem(item, extraData);
                     this._listView.Items.Add(item2);
                 }
             }
             finally
             {
                 this._listView.EndUpdate();
             }
             if (this._statusBar != null)
             {
                 this._statusBar.SetProgress(Math.Max(10, e.PercentComplete));
                 this._statusBar.SetText("Searching...");
             }
             this._listView.Focus();
             this.UpdateCommands();
         }
         if (e.IsComplete)
         {
             this._listView.WatermarkText = "No Classes Found";
             if (this._statusBar != null)
             {
                 this._statusBar.SetProgress(0);
                 this._statusBar.SetText(string.Empty);
             }
             this._searchTask = null;
         }
     }
 }
Ejemplo n.º 4
0
 public override Document OpenProjectItem(DocumentProjectItem projectItem, bool readOnly, DocumentViewType initialView)
 {
     IDocumentManager service = (IDocumentManager) base.GetService(typeof(IDocumentManager));
     if (service == null)
     {
         return null;
     }
     OpenTypeProjectItem item = projectItem as OpenTypeProjectItem;
     if (item == null)
     {
         item = new OpenTypeProjectItem(((TypeProjectItem) projectItem).Type, this);
     }
     return service.OpenDocument(item, true, DocumentViewType.Default);
 }