public DLLBuilder(string path, string name, ScriptsList list, References refs, Defines defs, bool buildEditor) { _path = path; _name = name; _sources = list.GetSources(); _editorSources = list.GetEditorSources(); _references = refs; _defines = defs; }
public void RefreshScriptsList() { Filename selectedScript; if (ScriptsList.SelectedNode != null) { selectedScript = ScriptsList.SelectedNode.Tag as Filename; } else { selectedScript = null; } ScriptsList.BeginUpdate(); ScriptsList.Nodes.Clear(); while (ScriptImageList.Images.Count > 2) { ScriptImageList.Images.RemoveAt(2); } HashSet <ScriptName> traversal = new HashSet <ScriptName>(); bool temp = false; { var profileNode = new TreeNode(String.Format("Profile: {0}", Program.Profile.ProfileName)); SetNodeIcon(profileNode, Program.ProfilePath); ScriptsList.Nodes.Add(profileNode); foreach (var dep in Program.Profile.Dependencies) { traversal.Clear(); profileNode.Nodes.Add(BuildScriptNode(dep, false, traversal, out temp)); } } foreach (var script in Program.Scripts.OrderBy((fn) => fn.NameWithoutExtension)) { traversal.Clear(); var item = BuildScriptNode(script.Name, false, traversal, out temp); ScriptsList.Nodes.Add(item); if (script == selectedScript) { ScriptsList.SelectedNode = item; } } ScriptsList.EndUpdate(); UnloadScriptButton.Enabled = (ScriptsList.SelectedNode != null) && (ScriptsList.SelectedNode.Parent == null); }
public void LoadedEvent() { var colours = new List <Color>(); _model.GetCurrentConfig(ref colours, out ushort stepDuration, out bool breathingEnabled, out bool invertedRChannel, out bool invertedGChannel, out bool invertedBChannel, out MainWindowModel.FlashingSpeed flashingSpeed); foreach (Byte index in Range(1, 8)) { ColourList[index - 1].Background = new SolidColorBrush(colours[index - 1]); } StepDurationText = Convert.ToString(stepDuration); BreathingModeEnabled = breathingEnabled; InvertedRChannel = invertedRChannel; InvertedGChannel = invertedGChannel; InvertedBChannel = invertedBChannel; FlashingSpeedSelectedIndex = FlashingSpeedList.IndexOf(FlashingSpeedList.Single(x => x.Type == flashingSpeed)); ListSelectedColourIndex = 0; foreach (var s in _model.GetScripts()) { ScriptsList.Add(new ScriptItem() { Name = s }); } ScriptsSelectedIndex = ScriptsList.IndexOf(ScriptsList.FirstOrDefault(x => x.Name == _model.GetRunningScript())); if (ScriptsSelectedIndex != -1) { StopRunningScriptBtnEnabled = true; } }