コード例 #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);
     }
 }
コード例 #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);
 }