FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnet/src/runtime/Codecs/RawProxyEncoder.cs at master · sdpython/pythonnet · GitHub
This repository was archived by the owner on Jul 22, 2023. It is now read-only.
sdpython
pythonnet
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonnet
/
src
/
runtime
/
Codecs
/
RawProxyEncoder.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
20 lines (17 loc) · 599 Bytes
Breadcrumbs
pythonnet
/
src
/
runtime
/
Codecs
/
RawProxyEncoder.cs
Copy path
File metadata and controls
20 lines (17 loc) · 599 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using
System
;
namespace
Python
.
Runtime
.
Codecs
{
/// <summary>
/// A .NET object encoder, that returns raw proxies (e.g. no conversion to Python types).
/// <para>You must inherit from this class and override <see cref="CanEncode"/>.</para>
/// </summary>
public
class
RawProxyEncoder
:
IPyObjectEncoder
{
public
PyObject
TryEncode
(
object
value
)
{
if
(
value
is
null
)
throw
new
ArgumentNullException
(
nameof
(
value
)
)
;
return
PyObject
.
FromManagedObject
(
value
)
;
}
public
virtual
bool
CanEncode
(
Type
type
)
=>
false
;
}
}
Back
|
FazBrowse Home
|
New Git URL