Exemplo n.º 1
0
 private void EnsureOpen()
 {
     if (closed)
     {
         throw AlreadyClosedException.Create(this.GetType().FullName, "CFS Directory is already disposed.");
     }
 }
Exemplo n.º 2
0
 // LUCENENET specific - rather than using all of this exception catching nonsense
 // for control flow, we check whether we are disposed first.
 private void EnsureOpen()
 {
     if (buffers is null)
     {
         throw AlreadyClosedException.Create(this.GetType().FullName, "Already disposed: " + this);
     }
 }
Exemplo n.º 3
0
 void Test_AlreadyClosedException_Serialization()
 {
     AlreadyClosedException ace = new AlreadyClosedException("Test");
     System.Runtime.Serialization.Formatters.Binary.BinaryFormatter bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
     System.IO.MemoryStream ms = new System.IO.MemoryStream();
     bf.Serialize(ms, ace);
     ms.Seek(0, System.IO.SeekOrigin.Begin);
     AlreadyClosedException ace2 = (AlreadyClosedException)bf.Deserialize(ms);
 }