c# backend fix
[PxpRpc.git] / csharp / dotnet / pxprpc / PxpObject.cs
blob28c49c0f4185149e5a36ba0cc3545c3a2c42e4ad
1 using System;
2 using System.Collections.Generic;
3 using System.IO;
4 using System.Text;
6 namespace pxprpc
8 public class PxpObject : IDisposable
10 protected int count;
11 protected Object content;
12 public PxpObject()
15 public PxpObject(Object c)
17 this.count = 0;
18 this.content = c;
20 public int addRef()
22 return ++this.count;
24 public int release()
26 this.count--;
27 if (this.count == 0)
29 this.Dispose();
31 return this.count;
33 public Object get()
35 return this.content;
37 public void Dispose()
39 if(content is IDisposable) {
40 ((IDisposable)content).Dispose();