void IConfigMapPath.ResolveSiteArgument(string siteArgument, out string siteName, out string siteID)
 {
     if ((string.IsNullOrEmpty(siteArgument) || StringUtil.EqualsIgnoreCase(siteArgument, "1")) || StringUtil.EqualsIgnoreCase(siteArgument, this._defaultSiteName))
     {
         siteName = this._defaultSiteName;
         siteID   = "1";
     }
     else
     {
         siteName = string.Empty;
         siteID   = string.Empty;
         bool flag = false;
         if (IISMapPath.IsSiteId(siteArgument))
         {
             flag = this.MBGetSiteNameFromSiteID(siteArgument, out siteName);
         }
         if (flag)
         {
             siteID = siteArgument;
         }
         else if (this.MBGetSiteIDFromSiteName(siteArgument, out siteID))
         {
             siteName = siteArgument;
         }
         else
         {
             siteName = siteArgument;
             siteID   = string.Empty;
         }
     }
 }
        void IConfigMapPath.ResolveSiteArgument(string siteArgument, out string siteName, out string siteID)
        {
            Debug.Trace("MapPath", "ProcHostMP.ResolveSiteArgument(" + siteArgument + ")\n");


            if (String.IsNullOrEmpty(siteArgument) ||
                StringUtil.EqualsIgnoreCase(siteArgument, ProcessHostConfigUtils.DEFAULT_SITE_ID_STRING) ||
                StringUtil.EqualsIgnoreCase(siteArgument, ProcessHostConfigUtils.GetSiteNameFromId(ProcessHostConfigUtils.DEFAULT_SITE_ID_UINT)))
            {
                siteName = ProcessHostConfigUtils.GetSiteNameFromId(ProcessHostConfigUtils.DEFAULT_SITE_ID_UINT);
                siteID   = ProcessHostConfigUtils.DEFAULT_SITE_ID_STRING;
            }
            else
            {
                siteName = String.Empty;
                siteID   = String.Empty;

                string resolvedName = null;
                if (IISMapPath.IsSiteId(siteArgument))
                {
                    uint id;

                    if (UInt32.TryParse(siteArgument, out id))
                    {
                        resolvedName = ProcessHostConfigUtils.GetSiteNameFromId(id);
                    }
                }
                // try to resolve the string
                else
                {
                    uint id = UnsafeIISMethods.MgdResolveSiteName(IntPtr.Zero, siteArgument);
                    if (id != 0)
                    {
                        siteID   = id.ToString(CultureInfo.InvariantCulture);
                        siteName = siteArgument;
                        return;
                    }
                }

                if (!String.IsNullOrEmpty(resolvedName))
                {
                    siteName = resolvedName;
                    siteID   = siteArgument;
                }
                else
                {
                    siteName = siteArgument;
                    siteID   = String.Empty;
                }
            }

            Debug.Assert(!String.IsNullOrEmpty(siteName), "!String.IsNullOrEmpty(siteName), siteArg=" + siteArgument);
        }
 void IConfigMapPath.ResolveSiteArgument(string siteArgument, out string siteName, out string siteID)
 {
     if ((string.IsNullOrEmpty(siteArgument) || StringUtil.EqualsIgnoreCase(siteArgument, "1")) || StringUtil.EqualsIgnoreCase(siteArgument, this._nativeConfig.GetSiteNameFromId(1)))
     {
         siteName = this._nativeConfig.GetSiteNameFromId(1);
         siteID   = "1";
     }
     else
     {
         siteName = string.Empty;
         siteID   = string.Empty;
         string siteNameFromId = null;
         if (IISMapPath.IsSiteId(siteArgument))
         {
             uint num;
             if (uint.TryParse(siteArgument, out num))
             {
                 siteNameFromId = this._nativeConfig.GetSiteNameFromId(num);
             }
         }
         else
         {
             uint num2 = this._nativeConfig.MgdResolveSiteName(siteArgument);
             if (num2 != 0)
             {
                 siteID   = num2.ToString(CultureInfo.InvariantCulture);
                 siteName = siteArgument;
                 return;
             }
         }
         if (!string.IsNullOrEmpty(siteNameFromId))
         {
             siteName = siteNameFromId;
             siteID   = siteArgument;
         }
         else
         {
             siteName = siteArgument;
             siteID   = string.Empty;
         }
     }
 }
 void IConfigMapPath.ResolveSiteArgument(string siteArgument, out string siteName, out string siteID)
 {
     if ((string.IsNullOrEmpty(siteArgument) || StringUtil.EqualsIgnoreCase(siteArgument, "1")) || StringUtil.EqualsIgnoreCase(siteArgument, ProcessHostConfigUtils.GetSiteNameFromId(1)))
     {
         siteName = ProcessHostConfigUtils.GetSiteNameFromId(1);
         siteID   = "1";
     }
     else
     {
         siteName = string.Empty;
         siteID   = string.Empty;
         string siteNameFromId = null;
         if (IISMapPath.IsSiteId(siteArgument))
         {
             uint num;
             if (uint.TryParse(siteArgument, out num))
             {
                 siteNameFromId = ProcessHostConfigUtils.GetSiteNameFromId(num);
             }
         }
         else
         {
             uint num2 = UnsafeIISMethods.MgdResolveSiteName(IntPtr.Zero, siteArgument);
             if (num2 != 0)
             {
                 siteID   = num2.ToString(CultureInfo.InvariantCulture);
                 siteName = siteArgument;
                 return;
             }
         }
         if (!string.IsNullOrEmpty(siteNameFromId))
         {
             siteName = siteNameFromId;
             siteID   = siteArgument;
         }
         else
         {
             siteName = siteArgument;
             siteID   = string.Empty;
         }
     }
 }
Ejemplo n.º 5
0
        void IConfigMapPath.ResolveSiteArgument(string siteArgument, out string siteName, out string siteID)
        {
            if (String.IsNullOrEmpty(siteArgument) ||
                StringUtil.EqualsIgnoreCase(siteArgument, DEFAULT_SITEID) ||
                StringUtil.EqualsIgnoreCase(siteArgument, _defaultSiteName))
            {
                siteName = _defaultSiteName;
                siteID   = DEFAULT_SITEID;
            }
            else
            {
                siteName = String.Empty;
                siteID   = String.Empty;

                bool found = false;
                if (IISMapPath.IsSiteId(siteArgument))
                {
                    found = MBGetSiteNameFromSiteID(siteArgument, out siteName);
                }

                if (found)
                {
                    siteID = siteArgument;
                }
                else
                {
                    found = MBGetSiteIDFromSiteName(siteArgument, out siteID);
                    if (found)
                    {
                        siteName = siteArgument;
                    }
                    else
                    {
                        siteName = siteArgument;
                        siteID   = String.Empty;
                    }
                }
            }
        }