FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Plotly.NET/src/Plotly.NET.CSharp/InternalUtils.cs at dev · plotly/Plotly.NET · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
plotly
/
Plotly.NET
Public
Notifications
You must be signed in to change notification settings
Fork
99
Star
859
Code
Issues
42
Pull requests
3
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Plotly.NET
/
src
/
Plotly.NET.CSharp
/
InternalUtils.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
46 lines (41 loc) · 1.18 KB
Breadcrumbs
Plotly.NET
/
src
/
Plotly.NET.CSharp
/
InternalUtils.cs
Copy path
File metadata and controls
46 lines (41 loc) · 1.18 KB
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
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using
System
;
using
System
.
Collections
.
Generic
;
using
System
.
Linq
;
using
System
.
Text
;
using
System
.
Threading
.
Tasks
;
namespace
Plotly
.
NET
.
CSharp
{
[
AttributeUsage
(
AttributeTargets
.
Class
)
]
internal
class
TypeFormatterSourceAttribute
:
Attribute
{
public
TypeFormatterSourceAttribute
(
Type
formatterSourceType
)
{
FormatterSourceType
=
formatterSourceType
;
}
public
Type
FormatterSourceType
{
get
;
}
public
string
[
]
PreferredMimeTypes
{
get
;
set
;
}
}
internal
class
MyConventionBasedFormatter
{
public
string
MimeType
{
get
;
set
;
}
public
bool
Format
(
object
instance
,
TextWriter
writer
)
{
if
(
instance
is
Plotly
.
NET
.
GenericChart
myObj
)
{
writer
.
Write
(
$
"<div>Custom formattering for
{
myObj
}
</div>"
)
;
return
true
;
}
else
{
return
false
;
}
}
}
internal
class
MyConventionBasedFormatterSource
{
public
IEnumerable
<
object
>
CreateTypeFormatters
(
)
{
yield
return
new
MyConventionBasedFormatter
{
MimeType
=
"text/html"
}
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL