repo.or.cz
/
PxpRpc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
c# backend fix
[PxpRpc.git]
/
csharp
/
dotnet
/
pxprpc
/
PxpObject.cs
blob
28c49c0f4185149e5a36ba0cc3545c3a2c42e4ad
1
using
System
;
2
using
System
.
Collections
.
Generic
;
3
using
System
.
IO
;
4
using
System
.
Text
;
5
6
namespace
pxprpc
7
{
8
public class
PxpObject
:
IDisposable
9
{
10
protected int
count
;
11
protected
Object content
;
12
public
PxpObject
()
13
{
14
}
15
public
PxpObject
(
Object c
)
16
{
17
this
.
count
=
0
;
18
this
.
content
=
c
;
19
}
20
public int
addRef
()
21
{
22
return
++
this
.
count
;
23
}
24
public int
release
()
25
{
26
this
.
count
--;
27
if
(
this
.
count
==
0
)
28
{
29
this
.
Dispose
();
30
}
31
return this
.
count
;
32
}
33
public
Object
get
()
34
{
35
return this
.
content
;
36
}
37
public void
Dispose
()
38
{
39
if
(
content
is
IDisposable
) {
40
((
IDisposable
)
content
).
Dispose
();
41
}
42
}
43
}
44
}