This repository was archived by the owner on Apr 20, 2019. It is now read-only.
forked from teamtreedyn/Binoculars
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTrackerExtenstion.cs
More file actions
63 lines (54 loc) · 2.09 KB
/
Copy pathTrackerExtenstion.cs
File metadata and controls
63 lines (54 loc) · 2.09 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
using Dynamo.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace Tracker
{
/// <summary>
/// Dynamo extension that controls the underlying Dynamo application but not its UI.
/// </summary>
public class TrackerExtension : IExtension
{
public string UniqueId => "3B234622-43B7-4EA8-86DA-54FB390BE29E";
public string Name => "Binoculars Extension";
public string DynamoVersion;
/// <summary>
/// Method that is called when Dynamo starts, but is not yet ready to be used.
/// </summary>
/// <param name="sp">Parameters that provide references to Dynamo settings and version.</param>
public void Startup(StartupParams sp)
{
DynamoVersion = sp.DynamoVersion.ToString();
TrackerEvents.DynamoVersion = DynamoVersion;
}
/// <summary>
/// Method that is called when Dynamo has finished loading and is ready to be used.
/// </summary>
/// <param name="rp">
/// Parameters that provide references to Dynamo commands, settings and events.
/// This object is supplied by Dynamo itself.
/// </param>
public void Ready(ReadyParams rp)
{
string message = "By pressing OK you agreeing to Binoculars 🔍 data collection.";
string title = "Terms of Use Agreement";
MessageBox.Show(message, title, MessageBoxButton.OK, MessageBoxImage.Exclamation);
// we can register our own events that will be triggered when specific things happen in Dynamo
// a reference to the ReadyParams is needed to do this, so we pass it on
TrackerEvents.RegisterEventHandlers(rp);
}
/// <summary>
/// Method that is called when the host Dynamo application is closed.
/// </summary>
public void Shutdown()
{
TrackerEvents.UnregisterEventHandlers();
}
public void Dispose()
{
}
}
}