internal static SPPersistedObject Get(SPServiceProxyCollection proxies)
 {
     if (proxies != null)
     {
         var method  = proxies.GetType().GetMethod("GetValue", new Type[] { });
         var generic = method.MakeGenericMethod(ServiceProxyType);
         return((SPPersistedObject)generic.Invoke(proxies, null));
     }
     return(null);
 }
        public ServiceProxyCollectionNode(SPFarm farm)
        {
            this.Text = SPMLocalization.GetString("ServiceProxies_Text");
            this.ToolTipText = SPMLocalization.GetString("ServiceProxies_ToolTip");
            this.Name = "ServiceProxies";
            this.Tag = farm.ServiceProxies;
            this.ServiceProxies = farm.ServiceProxies;
            this.SPParent = farm;

            int index = Program.Window.Explorer.AddImage(this.ImageUrl());
            this.ImageIndex = index;
            this.SelectedImageIndex = index;

            this.Nodes.Add(new ExplorerNodeBase("Dummy"));
        }
        public ServiceProxyCollectionNode(SPFarm farm)
        {
            this.Text           = SPMLocalization.GetString("ServiceProxies_Text");
            this.ToolTipText    = SPMLocalization.GetString("ServiceProxies_ToolTip");
            this.Name           = "ServiceProxies";
            this.Tag            = farm.ServiceProxies;
            this.ServiceProxies = farm.ServiceProxies;
            this.SPParent       = farm;

            int index = Program.Window.Explorer.AddImage(this.ImageUrl());

            this.ImageIndex         = index;
            this.SelectedImageIndex = index;

            this.Nodes.Add(new ExplorerNodeBase("Dummy"));
        }
        /// <summary>
        /// GetDefaultProxy method implementation
        /// </summary>
        /// <returns></returns>
        private ServiceApplicationProxy GetDefaultProxy()
        {
            SPServiceProxyCollection proxies = SPFarm.Local.ServiceProxies;

            foreach (SPServiceProxy SPSP in proxies)
            {
                foreach (SPServiceApplicationProxy SPAP in SPSP.ApplicationProxies)
                {
                    if (SPAP is ServiceApplicationProxy)
                    {
                        ServiceApplicationProxy b = SPAP as ServiceApplicationProxy;
                        return(b);
                    }
                }
            }
            return(null);
        }
        /// <summary>
        /// FindProxy method implementation
        /// </summary>
        /// <returns></returns>
        private ServiceApplicationProxy FindProxy(string selector)
        {
            SPServiceProxyCollection proxies = SPFarm.Local.ServiceProxies;

            foreach (SPServiceProxy SPSP in proxies)
            {
                foreach (SPServiceApplicationProxy SPAP in SPSP.ApplicationProxies)
                {
                    if (SPAP is ServiceApplicationProxy)
                    {
                        ServiceApplicationProxy       b   = SPAP as ServiceApplicationProxy;
                        ProxyClaimsProviderParameters prm = b.FillClaimsProviderParameters();
                        if ((prm.ClaimProviderName != null) && (prm.ClaimProviderName.ToLower().Trim().Equals(selector.ToLower().Trim())))
                        {
                            return(b);
                        }
                    }
                }
            }
            return(null);
        }