Beispiel #1
0
 internal static IEnumerable <IRegion> Filter([NotNull] this IRegionCollection @this, params string[] regionNames)
 {
     if (regionNames.Length <= 0)
     {
         return(@this);
     }
     return(@this.Where(r => regionNames.Any(f => f.EqualsIgnoreCase(r.Name))));
 }
Beispiel #2
0
        IRegion MyRegion(IRegionCollection regions)
        {
            for (int i = regions.Count() - 1; i >= 0; i--)
            {
                if (regions.ElementAt(i).Name.EndsWith("-PartyAccountabilitySearchResultsRegion") && regions.ElementAt(i).Context != null)
                {
                    return(regions.ElementAt(i));
                }
            }

            return(null);
        }
        private IRegion MyRegion(IRegionCollection regions)
        {
            for (int i = regions.Count() - 1; i >= 0; i--)
            {
                if (regions.ElementAt(i).Name.EndsWith("-ExchangeSearchResultsRegion") &&
                    regions.ElementAt(i).Context != null)
                {
                    return(regions.ElementAt(i));
                }
            }

            return(null);
        }
Beispiel #4
0
        /// <summary>
        /// Adds a region to the regionmanager with the name received as argument.
        /// </summary>
        /// <param name="regionCollection">The regionmanager's collection of regions.</param>
        /// <param name="regionName">The name to be given to the region.</param>
        /// <param name="region">The region to be added to the regionmanager.</param>
        public static void Add(this IRegionCollection regionCollection, string regionName, IRegion region)
        {
            if (region.Name != null && region.Name != regionName)
            {
                throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.RegionManagerWithDifferentNameException, region.Name, regionName), "regionName");
            }

            if (region.Name == null)
            {
                region.Name = regionName;
            }

            regionCollection.Add(region);
        }
        IRegion MyRegion(IRegionCollection regions)
        {
            for (int i = regions.Count() - 1; i >= 0; i--)
            {
                if (regions.ElementAt(i).Name.EndsWith("-PartyAccountabilitySearchResultsRegion") && regions.ElementAt(i).Context != null)
                {
                    return regions.ElementAt(i);
                }
            }

            return null;
        }
        private IRegion MyRegion(IRegionCollection regions)
        {
            for (int i = regions.Count() - 1; i >= 0; i--)
            {
                if (regions.ElementAt(i).Name.EndsWith("-SourceSystemSearchResultsRegion")
                    && regions.ElementAt(i).Context != null)
                {
                    return regions.ElementAt(i);
                }
            }

            return null;
        }
Beispiel #7
0
 public void Test()
 {
     IUnityContainer   container = ServiceLocator.Current.GetInstance <IUnityContainer>();
     IRegionCollection regions   = container.Resolve <IRegionManager>().Regions;
 }
Beispiel #8
0
 /// <summary>
 /// Search a <see cref="IRegionCollection"/> for <see cref="IRegion"/>s that contain a specific <see cref="IPanelView"/>
 /// </summary>
 /// <param name="regionCollection">The <see cref="IRegionCollection"/> to search</param>
 /// <param name="view">The <see cref="IPanelView"/> to search for</param>
 /// <returns>List of <see cref="IRegion"/>s</returns>
 public IEnumerable <IRegion> GetRegionsByView(IRegionCollection regionCollection, IPanelView view)
 {
     return(regionCollection.Where(x => x.Views.Contains(view)));
 }