Ejemplo n.º 1
0
        protected void AddDependency(string name, bool optional)
        {
            string searchPath = Name.DefaultSearchPath;

            if (Debugger.IsAttached)
            {
                var myAssembly     = this.GetType().Assembly;
                var myAssemblyPath = Path.GetFullPath(Path.GetDirectoryName(myAssembly.Location)).ToLowerInvariant();
                var mySourcePath   = Path.GetFullPath(myAssemblyPath.Replace(
                                                          @"\shootblues\bin", String.Format(
                                                              @"\shootbluesscripts\{0}", Name.NameWithoutExtension.ToLowerInvariant()
                                                              .Replace(".script", "")
                                                              )
                                                          ));
                if (File.Exists(Path.Combine(mySourcePath, name)))
                {
                    searchPath = mySourcePath;
                }
            }

            var sn = new ScriptName(name, searchPath);

            if (optional)
            {
                _OptionalDependencies.Add(sn);
            }
            else
            {
                _Dependencies.Add(sn);
            }
        }
Ejemplo n.º 2
0
 public override string ToString()
 {
     return("-- " + Name + " -- " + "\n" +
            Utils.ToStringProp("Pid", Pid.ToString()) +
            Utils.ToStringProp("FileName", FileName.ToString()) +
            Utils.ToStringProp("ScriptName", ScriptName.ToString()) +
            Utils.ToStringProp("SoundString", SoundString.ToString()) +
            Utils.ToStringProp("NoLogout", NoLogout.ToString()));
 }
Ejemplo n.º 3
0
        public RemoteControl(ScriptName name)
            : base(name)
        {
            AddDependency("Common.script.dll");

            CustomMenu = new ToolStripMenuItem("Remote Control");
            CustomMenu.DropDownItems.Add("Configure", null, ConfigureRemoteControl);
            CustomMenu.DropDownItems.Add("Open In Browser", null, OpenInBrowser);
            Program.AddCustomMenu(CustomMenu);
        }
Ejemplo n.º 4
0
        public TargetColors(ScriptName name)
            : base(name)
        {
            AddDependency("Common.script.dll");
            AddDependency("targetcolors.py");

            CustomMenu = new ToolStripMenuItem("Target Colors");
            CustomMenu.DropDownItems.Add("Configure", null, ConfigureTargetColors);
            CustomMenu.DropDownItems.Add("-");
            Program.AddCustomMenu(CustomMenu);
        }
Ejemplo n.º 5
0
        public EnemyPrioritizer(ScriptName name)
            : base(name)
        {
            AddDependency("Common.script.dll");
            AddDependency("enemyprioritizer.py");

            CustomMenu = new ToolStripMenuItem("Enemy Prioritizer");
            CustomMenu.DropDownItems.Add("Configure", null, ConfigureEnemyPrioritizer);
            CustomMenu.DropDownItems.Add("-");
            Program.AddCustomMenu(CustomMenu);
        }
Ejemplo n.º 6
0
        public WeaponHelper(ScriptName name)
            : base(name)
        {
            AddDependency("Common.script.dll");
            AddDependency("weaponhelper.py");

            CustomMenu = new ToolStripMenuItem("Weapon Helper");
            CustomMenu.DropDownItems.Add("Configure", null, ConfigureWeaponHelper);
            CustomMenu.DropDownItems.Add("-");
            Program.AddCustomMenu(CustomMenu);
        }
Ejemplo n.º 7
0
        public FontSizer(ScriptName name)
            : base(name)
        {
            AddDependency("Common.script.dll");
            AddDependency("fontsizer.py");

            CustomMenu = new ToolStripMenuItem("Font Sizer");
            CustomMenu.DropDownItems.Add("Configure", null, ConfigureFontSizer);
            CustomMenu.DropDownItems.Add("-");
            Program.AddCustomMenu(CustomMenu);
        }
Ejemplo n.º 8
0
        public EventNotifications(ScriptName name)
            : base(name)
        {
            AddDependency("Common.script.dll");
            AddDependency("eventnotifications.py");

            CustomMenu = new ToolStripMenuItem("Event Notifications");
            CustomMenu.DropDownItems.Add("Configure", null, ConfigureEventNotifications);
            CustomMenu.DropDownItems.Add("-");
            Program.AddCustomMenu(CustomMenu);
        }
Ejemplo n.º 9
0
        public EnemyPrioritizer(ScriptName name)
            : base(name)
        {
            AddDependency("Common.script.dll");
            AddDependency("enemyprioritizer.py");

            CustomMenu = new ToolStripMenuItem("Enemy Prioritizer");
            CustomMenu.DropDownItems.Add("Configure", null, ConfigureEnemyPrioritizer);
            CustomMenu.DropDownItems.Add("-");
            Program.AddCustomMenu(CustomMenu);
        }
Ejemplo n.º 10
0
        public ActiveTanker(ScriptName name)
            : base(name)
        {
            AddDependency("Common.script.dll");
            AddDependency("activetanker.py");

            CustomMenu = new ToolStripMenuItem("Active Tanker");
            CustomMenu.DropDownItems.Add("Configure", null, ConfigureActiveTanker);
            CustomMenu.DropDownItems.Add("-");
            Program.AddCustomMenu(CustomMenu);
        }
Ejemplo n.º 11
0
        public GoonfleetGateway(ScriptName name)
            : base(name)
        {
            AddDependency("Common.script.dll");
            AddDependency("EventNotifications.script.dll");

            CustomMenu = new ToolStripMenuItem("Goonfleet Gateway");
            CustomMenu.DropDownItems.Add("Configure", null, ConfigureGoonfleetGateway);
            CustomMenu.DropDownItems.Add("-");
            Program.AddCustomMenu(CustomMenu);
        }
        public GoonfleetGateway(ScriptName name)
            : base(name)
        {
            AddDependency("Common.script.dll");
            AddDependency("EventNotifications.script.dll");

            CustomMenu = new ToolStripMenuItem("Goonfleet Gateway");
            CustomMenu.DropDownItems.Add("Configure", null, ConfigureGoonfleetGateway);
            CustomMenu.DropDownItems.Add("-");
            Program.AddCustomMenu(CustomMenu);
        }
Ejemplo n.º 13
0
        public EventNotifications(ScriptName name)
            : base(name)
        {
            AddDependency("Common.script.dll");
            AddDependency("eventnotifications.py");

            CustomMenu = new ToolStripMenuItem("Event Notifications");
            CustomMenu.DropDownItems.Add("Configure", null, ConfigureEventNotifications);
            CustomMenu.DropDownItems.Add("-");
            Program.AddCustomMenu(CustomMenu);
        }
Ejemplo n.º 14
0
        public FontSizer(ScriptName name)
            : base(name)
        {
            AddDependency("Common.script.dll");
            AddDependency("fontsizer.py");

            CustomMenu = new ToolStripMenuItem("Font Sizer");
            CustomMenu.DropDownItems.Add("Configure", null, ConfigureFontSizer);
            CustomMenu.DropDownItems.Add("-");
            Program.AddCustomMenu(CustomMenu);
        }
Ejemplo n.º 15
0
        public TargetColors(ScriptName name)
            : base(name)
        {
            AddDependency("Common.script.dll");
            AddDependency("targetcolors.py");

            CustomMenu = new ToolStripMenuItem("Target Colors");
            CustomMenu.DropDownItems.Add("Configure", null, ConfigureTargetColors);
            CustomMenu.DropDownItems.Add("-");
            Program.AddCustomMenu(CustomMenu);
        }
Ejemplo n.º 16
0
        public ActiveTanker(ScriptName name)
            : base(name)
        {
            AddDependency("Common.script.dll");
            AddDependency("activetanker.py");

            CustomMenu = new ToolStripMenuItem("Active Tanker");
            CustomMenu.DropDownItems.Add("Configure", null, ConfigureActiveTanker);
            CustomMenu.DropDownItems.Add("-");
            Program.AddCustomMenu(CustomMenu);
        }
Ejemplo n.º 17
0
        public WeaponHelper(ScriptName name)
            : base(name)
        {
            AddDependency("Common.script.dll");
            AddDependency("weaponhelper.py");

            CustomMenu = new ToolStripMenuItem("Weapon Helper");
            CustomMenu.DropDownItems.Add("Configure", null, ConfigureWeaponHelper);
            CustomMenu.DropDownItems.Add("-");
            Program.AddCustomMenu(CustomMenu);
        }
Ejemplo n.º 18
0
        public BroadcastHelper(ScriptName name)
            : base(name)
        {
            AddDependency("Common.script.dll");
            AddDependency("TargetColors.script.dll", true);
            AddDependency("broadcasthelper.py");

            CustomMenu = new ToolStripMenuItem("Broadcast Helper");
            CustomMenu.DropDownItems.Add("Configure", null, ConfigureBroadcastHelper);
            CustomMenu.DropDownItems.Add("-");
            Program.AddCustomMenu(CustomMenu);
        }
Ejemplo n.º 19
0
        public BroadcastHelper(ScriptName name)
            : base(name)
        {
            AddDependency("Common.script.dll");
            AddDependency("TargetColors.script.dll", true);
            AddDependency("broadcasthelper.py");

            CustomMenu = new ToolStripMenuItem("Broadcast Helper");
            CustomMenu.DropDownItems.Add("Configure", null, ConfigureBroadcastHelper);
            CustomMenu.DropDownItems.Add("-");
            Program.AddCustomMenu(CustomMenu);
        }
Ejemplo n.º 20
0
        public AutoTargeter(ScriptName name)
            : base(name)
        {
            AddDependency("Common.script.dll");
            AddDependency("EnemyPrioritizer.script.dll");
            AddDependency("TargetColors.script.dll", true);
            AddDependency("autotargeter.py");

            CustomMenu = new ToolStripMenuItem("Auto Targeter");
            CustomMenu.DropDownItems.Add("Configure", null, ConfigureAutoTargeter);
            CustomMenu.DropDownItems.Add("-");
            Program.AddCustomMenu(CustomMenu);
        }
Ejemplo n.º 21
0
        public AutoTargeter(ScriptName name)
            : base(name)
        {
            AddDependency("Common.script.dll");
            AddDependency("EnemyPrioritizer.script.dll");
            AddDependency("TargetColors.script.dll", true);
            AddDependency("autotargeter.py");

            CustomMenu = new ToolStripMenuItem("Auto Targeter");
            CustomMenu.DropDownItems.Add("Configure", null, ConfigureAutoTargeter);
            CustomMenu.DropDownItems.Add("-");
            Program.AddCustomMenu(CustomMenu);
        }
Ejemplo n.º 22
0
        internal GxTestScriptWrapper(XmlDocument performanceScript)
        {
            // read the name of the script file
            if (performanceScript.FirstChild.Attributes == null)
            {
                throw new FormatException("Malformed XML. Expected attribute list");
            }

            ScriptName = performanceScript.FirstChild.Attributes["Name"].Value;
            ScriptName = ScriptName.Replace(" ", "");
            ScriptName = ScriptName.Replace("\t", "");

            _dataPools = new List <DataPool>();
            _commands  = new List <Command>();

            # region Getting Datapools
Ejemplo n.º 23
0
 /// <summary>
 /// Saves machine data code to lua script.
 /// </summary>
 internal void SaveToScript()
 {
     if (!BsgHasCode)
     {
         ErrorMessage = ".bsg file contains no code to be exported.";
         return;
     }
     try
     {
         var path = ScriptName.EndsWith(".py") ? ScriptName : ScriptName + ".py";
         path = string.Concat(Application.dataPath, "/Scripts/", path);
         File.WriteAllText(path, Code);
         SuccessMessage = "Successfully wrote code to\n" + path;
     }
     catch (Exception e)
     {
         ErrorMessage = "Error writing code to script.\nSee console (Ctrl+K) for more info.";
         Debug.LogException(e);
     }
 }
Ejemplo n.º 24
0
        protected void AddDependency(string name, bool optional)
        {
            string searchPath = Name.DefaultSearchPath;

            if (Debugger.IsAttached) {
                var myAssembly = this.GetType().Assembly;
                var myAssemblyPath = Path.GetFullPath(Path.GetDirectoryName(myAssembly.Location)).ToLowerInvariant();
                var mySourcePath = Path.GetFullPath(myAssemblyPath.Replace(
                    @"\shootblues\bin", String.Format(
                        @"\shootbluesscripts\{0}", Name.NameWithoutExtension.ToLowerInvariant()
                        .Replace(".script", "")
                    )
                ));
                if (File.Exists(Path.Combine(mySourcePath, name)))
                    searchPath = mySourcePath;
            }

            var sn = new ScriptName(name, searchPath);
            if (optional)
                _OptionalDependencies.Add(sn);
            else
                _Dependencies.Add(sn);
        }
Ejemplo n.º 25
0
        public static string ReadLuaText(ScriptName name)
        {
            string str = string.Empty;

            switch (name)
            {
            case ScriptName.View:
                Debug.Log(mCreatorConfigPath + "view.lua");
                if (File.Exists(mCreatorConfigPath + "view.lua"))
                {
                    str = FileUtility.ReadAllText(mCreatorConfigPath + "view.lua");
                }
                // str =  GetViewLua();
                break;

            case ScriptName.Model:
                Debug.Log(mCreatorConfigPath + "model.lua");
                if (File.Exists(mCreatorConfigPath + "model.lua"))
                {
                    str = FileUtility.ReadAllText(mCreatorConfigPath + "model.lua");
                }
                // str =  GetModelLua();
                break;

            case ScriptName.Module:
                Debug.Log(mCreatorConfigPath + "module.lua");
                if (File.Exists(mCreatorConfigPath + "module.lua"))
                {
                    str = FileUtility.ReadAllText(mCreatorConfigPath + "module.lua");
                }
                // str =  GetModuleLua();
                break;
            }
            // Debug.Log(str);
            return(str);
        }
Ejemplo n.º 26
0
        public Common(ScriptName name)
            : base(name)
        {
            AddDependency("common.py");
            AddDependency("common.service.py");
            AddDependency("common.messaging.py");
            AddDependency("common.eve.py");
            AddDependency("common.eve.logger.py");
            AddDependency("common.eve.state.py");
            AddDependency("common.eve.charmonitor.py");
            AddDependency("common.sql.py");
            AddDependency("pythonexplorer.py");

            CustomMenu = new ToolStripMenuItem("Common");
            CustomMenu.DropDown.Items.Add(
                new ToolStripMenuItem("Show Log", null, (s, e) => {
                Program.Scheduler.Start(
                    ShowLogWindow(), Squared.Task.TaskExecutionPolicy.RunAsBackgroundTask
                    );
            })
                );
            CustomMenu.DropDown.Items.Add(
                new ToolStripMenuItem("Clear Log", null, (s, e) => {
                LogClear();
            })
                );
            CustomMenu.DropDown.Items.Add(new ToolStripSeparator());
            CustomMenu.DropDown.Items.Add(
                new ToolStripMenuItem("Python Explorer", null, (s, e) => {
                Program.Scheduler.Start(
                    ShowPythonExplorer(), Squared.Task.TaskExecutionPolicy.RunAsBackgroundTask
                    );
            })
                );
            Program.AddCustomMenu(CustomMenu);
        }
Ejemplo n.º 27
0
		public bool RunScript(ScriptName name)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			return RunScriptList(_scripts[(int) name]);
		}
Ejemplo n.º 28
0
        /// <summary>
        ///     this is like compiler errors/warnings when generating a bash script
        /// </summary>
        /// <returns></returns>
        public bool ValidateParameters(bool allowBlankParameters = true)
        {
            //verify short names are unique
            Dictionary <string, ParameterItem> nameDictionary     = new Dictionary <string, ParameterItem>();
            Dictionary <string, ParameterItem> variableDictionary = new Dictionary <string, ParameterItem>();

            ClearValidationErrors();
            ParameterItem item = null;

            foreach (var param in Parameters)
            {
                if (allowBlankParameters)
                {
                    if (param.ShortParameter == "" && param.LongParameter == "")
                    {
                        continue; // probably just getting started
                    }
                }
                else
                {
                    if (param.ShortParameter == "" || param.LongParameter == "" || param.VariableName == "")
                    {
                        AddValidationError(param, new ParseErrorInfo(ErrorLevel.Validation, $"Parameter[{Parameters.IndexOf(param)}]: All Long Names, Short Names, and Variable Names must be non-empty."));
                    }
                }

                if (nameDictionary.TryGetValue(param.ShortParameter, out item))
                {
                    var otherIndex = Parameters.IndexOf(item);
                    AddValidationError(param, new ParseErrorInfo(ErrorLevel.Validation, $"Parameter[{Parameters.IndexOf(param)}]: The name \"{param.ShortParameter}\" already exists for the parameter with index={otherIndex}. All Long Names and Short Names must be unique."));
                }
                else
                {
                    nameDictionary[param.ShortParameter] = param;
                }
                if (nameDictionary.TryGetValue(param.LongParameter, out item))
                {
                    var otherIndex = Parameters.IndexOf(item);
                    AddValidationError(param, new ParseErrorInfo(ErrorLevel.Validation, $"Parameter[{Parameters.IndexOf(param)}]: The name \"{param.LongParameter}\" already exists for the parameter with index={otherIndex}. All Long Names and Short Names must be unique."));
                }
                else
                {
                    nameDictionary[param.LongParameter] = param;
                }
                if (variableDictionary.TryGetValue(param.VariableName, out item))
                {
                    var otherIndex = Parameters.IndexOf(item);
                    AddValidationError(param, new ParseErrorInfo(ErrorLevel.Validation, $"Parameter[{Parameters.IndexOf(param)}]: The variable \"{param.VariableName}\" already exists for the parameter with index={otherIndex}. All Variable Names must be unique."));
                }
                else
                {
                    variableDictionary[param.VariableName] = param;
                }


                if (!param.RequiresInputString && param.ValueIfSet.Trim() == "$2")
                {
                    AddValidationError(param, new ParseErrorInfo(ErrorLevel.Validation, $"Parameter[{Parameters.IndexOf(param)}]: {param.LongParameter} has \"Require Input String\" set to False and the \"Value if Set\" to \"$2\".  \nThis combination is not allowed."));
                }
            }
            //
            //  I'm taking out these chars because they are "special" in JSON.  I found that the ":" messed up JQ processing
            //  and it seems a small price to pay to not take any risks with the names.  Note that we always Trim() the names
            //  in the ParameterOrScriptData_PropertyChanged method
            //
            string[] illegalNameChars = new string[] { ":", "{", "}", "[", "]", "\\", "'", "\"" };
            if (ScriptName != "")
            {
                foreach (string c in illegalNameChars)
                {
                    if (ScriptName.Contains(c))
                    {
                        AddValidationError(null, new ParseErrorInfo(ErrorLevel.Validation, "The following characters are illegal in the Script Name: :{}[]\"\'"));
                        break; // we only print one error anyway
                    }
                }
            }
            if (Description != "")
            {
                foreach (string c in illegalNameChars)
                {
                    if (Description.Contains(c))
                    {
                        AddValidationError(null, new ParseErrorInfo(ErrorLevel.Validation, "The following characters are illegal in the Description: :{}[]\"\'"));
                        break; // we only print one error anyway
                    }
                }
            }



            return(ParseErrors.Count == 0);
        }
Ejemplo n.º 29
0
 public override int GetHashCode()
 {
     return(ScriptName.GetHashCode());
 }
Ejemplo n.º 30
0
        private TreeNode BuildScriptNode(ScriptName script, bool optional, HashSet <ScriptName> traversal, out bool shouldExpand)
        {
            var filename = Program.FindScript(script);

            var    item = new TreeNode();
            string text = filename;

            if (text != null)
            {
                var appUri = new Uri(Path.GetDirectoryName(Application.ExecutablePath) + "\\");
                var uri    = new Uri(filename);
                var relUri = appUri.MakeRelativeUri(uri);
                text = HttpUtility.UrlDecode(relUri.ToString().Replace("/", "\\"));
            }
            else
            {
                text = script.Name;
            }
            item.Text = text;
            item.Tag  = filename;

            SetNodeIcon(item, filename ?? script.Name);

            shouldExpand = false;
            bool se = false;

            IManagedScript instance = Program.GetScriptInstance(script);

            if (instance != null)
            {
                if (!traversal.Contains(script))
                {
                    traversal.Add(script);

                    foreach (var dep in instance.Dependencies)
                    {
                        item.Nodes.Add(BuildScriptNode(dep, false, traversal, out se));
                    }

                    foreach (var dep in instance.OptionalDependencies)
                    {
                        item.Nodes.Add(BuildScriptNode(dep, true, traversal, out se));
                    }
                }

                if (se)
                {
                    item.Expand();
                    shouldExpand = true;
                }
            }
            else
            {
                if (optional)
                {
                    item.SelectedImageKey = item.ImageKey = "optional";
                    item.ToolTipText      = "Optional script not loaded.";
                }
                else
                {
                    item.SelectedImageKey = item.ImageKey = "missing";
                    item.ToolTipText      = "Script missing or failed to load!";
                }

                shouldExpand = true;
            }

            return(item);
        }
Ejemplo n.º 31
0
        private IEnumerator <object> RemoteCallTask(ProcessInfo process)
        {
            var channel    = process.GetNamedChannel("remotecall");
            var serializer = new JavaScriptSerializer();

            while (true)
            {
                var fNext = channel.Receive();
                using (fNext)
                    yield return(fNext);

                object[] callTuple    = serializer.Deserialize <object[]>(fNext.Result.DecodeAsciiZ());
                string   scriptName   = callTuple[0] as string;
                string   methodName   = callTuple[1] as string;
                object[] rawArguments = callTuple[2] as object[];
                long?    resultId     = null;

                if (callTuple.Length >= 4)
                {
                    resultId = Convert.ToInt64(callTuple[3]);
                }

                object[] functionArguments;
                if (rawArguments == null)
                {
                    functionArguments = new object[] { process };
                }
                else
                {
                    functionArguments = new object[rawArguments.Length + 1];

                    functionArguments[0] = process;

                    for (int i = 0; i < rawArguments.Length; i++)
                    {
                        functionArguments[i + 1] = rawArguments[i];
                    }
                }

                ScriptName sn;
                if (!Program.PythonModuleToScript.TryGetValue(scriptName, out sn))
                {
                    sn = new ScriptName(scriptName);
                }

                IManagedScript instance = Program.GetScriptInstance(sn);

                if (instance == null)
                {
                    LogPrint(process,
                             "Remote call attempted on script '{0}' that isn't loaded.", scriptName
                             );
                    continue;
                }

                IEnumerator <object> resultTask = null;
                object    result = null;
                Exception error  = null;

                try {
                    result = instance.GetType().InvokeMember(
                        methodName, BindingFlags.Instance | BindingFlags.InvokeMethod | BindingFlags.Public, null, instance, functionArguments
                        );
                } catch (Exception ex) {
                    error = ex;
                }

                if (error != null)
                {
                    if (resultId.HasValue)
                    {
                        yield return(SendRemoteCallResult(process, resultId.Value, null, error));
                    }
                    else
                    {
                        Program.Scheduler.OnTaskError(error);
                    }
                }
                else
                {
                    resultTask = result as IEnumerator <object>;

                    if (resultTask != null)
                    {
                        var fResult = Program.Scheduler.Start(
                            resultTask, TaskExecutionPolicy.RunWhileFutureLives
                            );
                        process.OwnedFutures.Add(fResult);

                        if (resultId.HasValue)
                        {
                            fResult.RegisterOnComplete((_) => {
                                object r;
                                Exception e;
                                _.GetResult(out r, out e);
                                Program.Scheduler.Start(SendRemoteCallResult(process, resultId.Value, r, e));
                            });
                        }
                    }
                    else
                    {
                        if (resultId.HasValue)
                        {
                            yield return(SendRemoteCallResult(process, resultId.Value, result, null));
                        }
                    }
                }
            }
        }
Ejemplo n.º 32
0
 public ManagedScript(ScriptName name)
 {
     Name = name;
 }
Ejemplo n.º 33
0
        private TreeNode BuildScriptNode(ScriptName script, bool optional, HashSet<ScriptName> traversal, out bool shouldExpand)
        {
            var filename = Program.FindScript(script);

            var item = new TreeNode();
            string text = filename;
            if (text != null) {
                var appUri = new Uri(Path.GetDirectoryName(Application.ExecutablePath) + "\\");
                var uri = new Uri(filename);
                var relUri = appUri.MakeRelativeUri(uri);
                text = HttpUtility.UrlDecode(relUri.ToString().Replace("/", "\\"));
            } else {
                text = script.Name;
            }
            item.Text = text;
            item.Tag = filename;

            SetNodeIcon(item, filename ?? script.Name);

            shouldExpand = false;
            bool se = false;

            IManagedScript instance = Program.GetScriptInstance(script);
            if (instance != null) {
                if (!traversal.Contains(script)) {
                    traversal.Add(script);

                    foreach (var dep in instance.Dependencies)
                        item.Nodes.Add(BuildScriptNode(dep, false, traversal, out se));

                    foreach (var dep in instance.OptionalDependencies)
                        item.Nodes.Add(BuildScriptNode(dep, true, traversal, out se));
                }

                if (se) {
                    item.Expand();
                    shouldExpand = true;
                }
            } else {
                if (optional) {
                    item.SelectedImageKey = item.ImageKey = "optional";
                    item.ToolTipText = "Optional script not loaded.";
                } else {
                    item.SelectedImageKey = item.ImageKey = "missing";
                    item.ToolTipText = "Script missing or failed to load!";
                }

                shouldExpand = true;
            }

            return item;
        }
Ejemplo n.º 34
0
 public PythonScript(ScriptName name)
     : base(name)
 {
 }
Ejemplo n.º 35
0
 /// <summary>
 /// Add a script to the list of scripts that will be rendered in the view
 /// </summary>
 /// <param name="scriptName"></param>
 public void AddScript(ScriptName scriptName)
 {
     if (!RegisteredScripts.Contains(scriptName))
     RegisteredScripts.Add(scriptName);
 }
Ejemplo n.º 36
0
 public PythonScript(ScriptName name)
     : base(name)
 {
 }
Ejemplo n.º 37
0
 public ManagedScript(ScriptName name)
 {
     Name = name;
 }