示例#1
0
 private void EnsureOpen()
 {
     if (closed)
     {
         throw AlreadyClosedException.Create(this.GetType().FullName, "CFS Directory is already disposed.");
     }
 }
示例#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);
     }
 }
 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);
 }