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