-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScriptingSession.cs
More file actions
executable file
·33 lines (30 loc) · 963 Bytes
/
ScriptingSession.cs
File metadata and controls
executable file
·33 lines (30 loc) · 963 Bytes
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
using Grooper;
using System;
using System.Collections.Generic;
using System.Linq;
namespace GrooperGit
{
#pragma warning disable 1591
public class ScriptingSession : ScriptObject
{
private ObjectLibrary ObjectLibrary;
private GrooperRoot Root;
public override bool Initialize(GrooperNode Item)
{
#region override allowed types
ObjectLibrary = (ObjectLibrary)Item;
Root = Item.Root;
ProjectsFolder projectsFolder = Root.Projects;
List<Type> allowedTypes = projectsFolder.AllowedChildTypes.ToList();
if (allowedTypes.Any(t => t.FullName == typeof(GitProject).FullName)) { return true; }
allowedTypes.Add(typeof(GitProject));
projectsFolder.SetAllowedTypes(allowedTypes);
#endregion
return true;
}
public override bool Uninitialize()
{
return true;
}
}
}