-
Notifications
You must be signed in to change notification settings - Fork 0
/
About.cs
67 lines (60 loc) · 2.18 KB
/
About.cs
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
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using md.stdl.Interfaces;
using mp.pddn;
using Notui;
using VVVV.PluginInterfaces.V2;
namespace Notuiv
{
[Startable]
public class VersionWriter : IStartable
{
public static string VersionPath { get; private set; }
public static string VvvvDir { get; private set; }
public void Start()
{
var ver = typeof(VersionWriter).Assembly.GetName().Version.ToString();
VvvvDir = Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName);
if (VvvvDir != null)
{
VersionPath = Path.Combine(VvvvDir, "packs", "Notuiv", "version.info");
File.WriteAllText(VersionPath, ver);
}
else
{
VersionPath = "null";
}
}
public void Shutdown() { Start(); }
}
[PluginInfo(
Name = "About",
Category = "Notuiv",
Author = "microdee"
)]
public class AboutNode : IPluginEvaluate, IPartImportsSatisfiedNotification
{
[Output("Notuiv Version")] public ISpread<string> FVer;
[Output("Notui Version")] public ISpread<string> FNotuiVer;
[Output("md.stdl Version")] public ISpread<string> FMdStdlVer;
[Output("mp.pddn Version")] public ISpread<string> FMpPddnVer;
[Output("Version File Path")] public ISpread<string> FVerPath;
[Output("VVVV Dir")] public ISpread<string> FVDir;
public void Evaluate(int SpreadMax) { }
public void OnImportsSatisfied()
{
FVer[0] = typeof(AboutNode).Assembly.GetName().Version.ToString();
FNotuiVer[0] = typeof(NotuiContext).Assembly.GetName().Version.ToString();
FMdStdlVer[0] = typeof(IMainlooping).Assembly.GetName().Version.ToString();
FMpPddnVer[0] = typeof(SpreadWrapper).Assembly.GetName().Version.ToString();
FVDir[0] = VersionWriter.VvvvDir;
FVerPath[0] = VersionWriter.VersionPath;
}
}
}