src/Misc/EFTools/XmlCore/Model/NormalizedName.cs
/// <summary>
///     Looks in this NameReference for a namespace part matching
///     oldNamespace. If it finds it replaces oldNamespace with newNamespace
///     in the newBindingString out parameter and returns true, otherwise
///     newBindingString contains the reference as it was originally
///     and returns false.
/// </summary>
/// <returns>true if a replacement is made, otherwise false</returns>
Looks in this NameReference for a namespace part matching
oldNamespace. If it finds it replaces oldNamespace with newNamespace
in the newBindingString out parameter and returns true, otherwise
newBindingString contains the reference as it was originally
and returns false.
Looks in this NameReference for a namespace part matching oldNamespace . If it finds it replaces oldNamespace with newNamespace in the newBindingString out parameter and returns true otherwise newBindingString contains the reference as it was originally and returns false .
internal bool ConstructBindingStringWithReplacedNamespace(
            string oldNamespace, string newNamespace, out string newBindingString)
        {
            Debug.Assert(!string.IsNullOrEmpty(oldNamespace), "ConstructBindingStringWithReplacedNamespace(): null or empty oldNamespace");
            Debug.Assert(!string.IsNullOrEmpty(newNamespace), "ConstructBindingStringWithReplacedNamespace(): null or empty newNamespace");
            if (string.IsNullOrEmpty(oldNamespace)
                ||
                string.IsNullOrEmpty(newNamespace))
            {
                newBindingString = null;
                return false;
            }
            if (null == _namespacePart)
            {
                newBindingString = ToBindingString();
                return false;
            }
            if (!_namespacePart.Equals(oldNamespace, StringComparison.CurrentCulture))
            {
                newBindingString = ToBindingString();
                return false;
            }
            if (null == _remainingPart)
            {
                newBindingString = newNamespace;
            }
            else
            {
                newBindingString = newNamespace + Symbol.VALID_RUNTIME_SEPARATOR + _remainingPart;
            }
            return true;
        }
internal bool ConstructBindingStringWithReplacedNamespace ( string oldNamespace , string newNamespace , out string newBindingString ) { Debug . Assert ( ! string . IsNullOrEmpty ( oldNamespace ) , " " ) ; Debug . Assert ( ! string . IsNullOrEmpty ( newNamespace ) , " " ) ; if ( string . IsNullOrEmpty ( oldNamespace ) || string . IsNullOrEmpty ( newNamespace ) ) { newBindingString = null ; return false ; } if ( null == _namespacePart ) { newBindingString = ToBindingString ( ) ; return false ; } if ( ! _namespacePart . Equals ( oldNamespace , StringComparison . CurrentCulture ) ) { newBindingString = ToBindingString ( ) ; return false ; } if ( null == _remainingPart ) { newBindingString = newNamespace ; } else { newBindingString = newNamespace + Symbol . VALID_RUNTIME_SEPARATOR + _remainingPart ; } return true ; }
Looks in this NameReference for a namespace part matching
oldNamespace.
Looks in this NameReference for a namespace part matching oldNamespace .
// now compare the namespace part of oldBindingStringNameRef to oldNamespace  // no namespace part to replace - just return reference as it was originally // the reference has a namespace but it doesn't match oldNamespace // so just return the reference as it was originally // the reference has a namespace and it matches oldNamespace // so return set newBindingString to 'newNamespace.remaining_part_of_old_reference'
true if a replacement is made, otherwise false
true if a replacement is made otherwise false
oldNamespace
string
newNamespace
string
string
out