System.Runtime.Remoting.RemotingConfigHandler.RemotingConfigInfo.CheckForWellKnownServiceEntryWithType C# (CSharp) Méthode

CheckForWellKnownServiceEntryWithType() private méthode

private CheckForWellKnownServiceEntryWithType ( String typeName, String asmName ) : bool
typeName String
asmName String
Résultat bool
            private bool CheckForWellKnownServiceEntryWithType(String typeName, String asmName)
            {
                foreach (DictionaryEntry entry in _wellKnownExportInfo)
                {
                    WellKnownServiceTypeEntry svc = 
                        (WellKnownServiceTypeEntry)entry.Value;
                    if (typeName == svc.TypeName)
                    {
                        bool match = false;
                        
                        // need to ignore version while checking
                        if (asmName == svc.AssemblyName)
                            match = true;
                        else
                        {
                            // only well known service entry can have version info
                            if (String.Compare(svc.AssemblyName, 0, asmName, 0, asmName.Length, StringComparison.OrdinalIgnoreCase) == 0)
                            {
                                // if asmName != svc.AssemblyName and svc.AssemblyName
                                //   starts with asmName we know that svc.AssemblyName is
                                //   longer. If the next character is a comma, then the
                                //   assembly names match except for version numbers
                                //   which is ok.
                                if (svc.AssemblyName[asmName.Length] == ',')
                                    match = true;
                            }
                        }

                        // We were trying to redirect
                        if (match)
                            return true;
                    }
                }

                return false;
            } // CheckForWellKnownServiceEntryOfType