Exemplo n.º 1
0
 public RecoverableText(RecoverableTextAndVersion parent, SourceText text)
     : base(new ConstantValueSource <SourceText>(text))
 {
     // TODO: refactor recoverable text like recoverable tree so that
     //       we can have tree/node concept in recoverable text as well.
     //       basically tree is handle that can live in memory and node is
     //       data that come and go.
     _parent = parent;
 }
Exemplo n.º 2
0
        protected static ValueSource <TextAndVersion> CreateRecoverableText(TextAndVersion text, SolutionServices services)
        {
            var result = new RecoverableTextAndVersion(CreateStrongText(text), services.TemporaryStorage);

            // This RecoverableTextAndVersion is created directly from a TextAndVersion instance. In its initial state,
            // the RecoverableTextAndVersion keeps a strong reference to the initial TextAndVersion, and only
            // transitions to a weak reference backed by temporary storage after the first time GetValue (or
            // GetValueAsync) is called. Since we know we are creating a RecoverableTextAndVersion for the purpose of
            // avoiding problematic address space overhead, we call GetValue immediately to force the object to weakly
            // hold its data from the start.
            result.GetValue();

            return(result);
        }
 public RecoverableText(RecoverableTextAndVersion parent, SourceText text)
     : base(new ConstantValueSource <SourceText>(text))
 {
     _parent = parent;
 }