SharpTox.Core.Tox.Dispose C# (CSharp) Method

Dispose() public method

Releases all resources used by this instance of Tox.
public Dispose ( ) : void
return void
        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

Same methods

Tox::Dispose ( bool disposing ) : void

Usage Example

Ejemplo n.º 1
0
        public void TestToxEncryptionLoad()
        {
            var tox1 = new Tox(ToxOptions.Default);
            tox1.Name = "Test";
            tox1.StatusMessage = "Hey";

            var key = new ToxEncryptionKey("heythisisatest");
            var data = tox1.GetData(key);

            Assert.IsNotNull(data, "Failed to encrypt the Tox data");
            Assert.IsTrue(data.IsEncrypted, "We encrypted the data, but toxencryptsave thinks we didn't");

            var tox2 = new Tox(ToxOptions.Default, ToxData.FromBytes(data.Bytes), key);

            if (tox2.Id != tox1.Id)
                Assert.Fail("Failed to load tox data correctly, tox id's don't match");

            if (tox2.Name != tox1.Name)
                Assert.Fail("Failed to load tox data correctly, names don't match");

            if (tox2.StatusMessage != tox1.StatusMessage)
                Assert.Fail("Failed to load tox data correctly, status messages don't match");

            tox1.Dispose();
            tox2.Dispose();
        }
All Usage Examples Of SharpTox.Core.Tox::Dispose