Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathInternalUtils.cs
More file actions
Latest commit
46 lines (41 loc) · 1.18 KB
/
Copy pathInternalUtils.cs
File metadata and controls
46 lines (41 loc) · 1.18 KB
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
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Threading.Tasks;
namespacePlotly.NET.CSharp
{
[AttributeUsage(AttributeTargets.Class)]
internalclassTypeFormatterSourceAttribute:Attribute
{
publicTypeFormatterSourceAttribute(TypeformatterSourceType)
{
FormatterSourceType=formatterSourceType;
}
publicTypeFormatterSourceType{get;}
publicstring[]PreferredMimeTypes{get;set;}
}
internalclassMyConventionBasedFormatter
{
publicstringMimeType{get;set;}
publicboolFormat(objectinstance,TextWriterwriter)
{
if(instanceisPlotly.NET.GenericChartmyObj)
{
writer.Write($"<div>Custom formattering for {myObj}</div>");
returntrue;
}
else
{
returnfalse;
}
}
}
internalclassMyConventionBasedFormatterSource
{
publicIEnumerable<object>CreateTypeFormatters()
{
yieldreturnnewMyConventionBasedFormatter{MimeType="text/html"};
}
}
}