Source/NFX/SealedString.cs
/// <summary>
/// Returns an existing SealedString instance for existing data or allocates a new one.
/// This method is thread-safe
/// </summary>
Returns an existing SealedString instance for existing data or allocates a new one.
This method is thread-safe
Returns an existing SealedString instance for existing data or allocates a new one . This method is thread - safe
public SealedString Seal(string value, out bool existed)
              {
                if (value==null) throw new NFXException(StringConsts.ARGUMENT_ERROR+"SealedString.Scope.Seal(value==null)");
                SealedString result;
                lock(m_Data)
                {
                  if (!m_Data.TryGetValue(value, out result))
                  {
                    existed = false;
                    result = new SealedString(value);
                    m_Data.Add(value, result);
                  }
                  else existed = true;
                }
                return result;
              }
public SealedString Seal ( string value , out bool existed ) { if ( value == null ) throw new NFXException ( StringConsts . ARGUMENT_ERROR + " " ) ; SealedString result ; lock ( m_Data ) { if ( ! m_Data . TryGetValue ( value , out result ) ) { existed = false ; result = new SealedString ( value ) ; m_Data . Add ( value , result ) ; } else existed = true ; } return result ; }
Returns an existing SealedString instance for existing data or allocates a new one.
Returns an existing SealedString instance for existing data or allocates a new one .
value
string
bool
out