Menu

[378a80]: / TextPreviewLibrary / Plugin-Base.cs  Maximize  Restore  History

Download this file

94 lines (77 with data), 2.9 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
using LILO_Packager.v2.Core.Visuals;
using LILO_Packager.v2.Core.Updates;
using LILO_Packager.v2.plugins.PluginCore;
using System.Collections.ObjectModel;
using System.Windows.Forms;
using Telerik.Windows.Documents.Spreadsheet.Expressions.Functions;
using TextPreviewLibrary.Core.Formats;
namespace TextPreviewLibrary
{
public class PluginBase : IPluginBase
{
public string Name { get; set; } = "TextPreviewLibrary";
public PluginID ID { get; set; } = PluginID.GetID("tpl", "lbl", "lvl02");
public string Description { get; set; } = "A Library for previewing plain based Files";
public string Version { get; set; } = "v0.1";
public static SemanticVersion _sVersion = new SemanticVersion(0, 1, 2, "alpha", false);
public Form PluginInterface { get; set; } = Core.PluginInterface.Instance("v0.1", PluginID.GetID("tpl", "lbl", "lvl02"), "Text-Preview",true);
public static ThemeManager _thManager;
public ObservableCollection<object> DynamicValues { get; set; }
public PluginResponse Execute(PluginParameters args)
{
var para = new PluginResponse();
try
{
if(args.themeManager != null)
{
_thManager = (ThemeManager)args.themeManager;
}
else
{
_thManager = ThemeManager.Initialize();
}
var file = (string)args.Context[0];
Core.PluginInterface.Instance(null, null, null, false).SetContent(new CrypterTextFile()
{
RtfContent = File.ReadAllText(file),
IsLocked = true,
FileName = Path.GetFileName(file),
Author = "n/a"
});
para.HasError = false;
para.Message = "Executed Succesfully";
para.MessageID = "0x0";
}
catch (Exception ex)
{
para.HasError = true;
para.Message = ex.Message;
para.MessageID = "0x10";
}
return para;
}
public PluginResponse Initialize(PluginParameters args)
{
var para = new PluginResponse();
try
{
para.HasError = false;
para.Message = "Initilized Succesfully";
para.MessageID = "0x0";
return para;
}
catch (Exception ex)
{
para.HasError = true;
para.Message = ex.Message;
para.MessageID = "0x10";
return para;
}
}
public PluginResponse Close()
{
var para = new PluginResponse();
return para;
}
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.