Ejemplo n.º 1
0
 /// <summary>
 /// Finds the tab where the resources of the specified type are displayed.
 /// </summary>
 public string FindResourceTypeTab(string type)
 {
     for (int i = 0; i < _tabBar.TabCount; i++)
     {
         TabFilter filter = (TabFilter)_tabBar.GetTabTag(i);
         if (filter != null && filter.ContainsResourceType(type))
         {
             return(filter.Id);
         }
     }
     return(null);
 }
Ejemplo n.º 2
0
        public string GetResourceTab(IResource res)
        {
            string resType = res.Type;

            if (resType == "Fragment")
            {
                resType = res.GetStringProp("ContentType");
            }
            // TODO: optimize
            for (int i = 1; i < _tabBar.TabCount; i++)
            {
                TabFilter tabFilter = (TabFilter)_tabBar.GetTabTag(i);
                if (tabFilter.ContainsResourceType(resType))
                {
                    return(tabFilter.Id);
                }
                if (tabFilter.LinkPropId >= 0 && res.HasProp(tabFilter.LinkPropId))
                {
                    return(tabFilter.Id);
                }
            }
            return(null);
        }