HelloWorld.DefaultNameService.CanReset C# (CSharp) Method

CanReset() public method

public CanReset ( string oldName, string newName ) : bool
oldName string
newName string
return bool
        public bool CanReset( string oldName, string newName )
        {
            lock ( sync )
              {

            if ( allocatedNames.Contains( newName ) )
              return false;

            if ( !regex.IsMatch( newName ) )
              return false;

            allocatedNames.Remove( oldName );
            allocatedNames.Add( newName );
            return true;
              }
        }