public static void GenerateSelectedElementCode() { if (EditorLogic.CurrentElement != null) { CodeWriter.GenerateCode(EditorLogic.CurrentElement); } else if (EditorLogic.CurrentReferencedFile != null) { ReferencedFileSave rfs = EditorLogic.CurrentReferencedFile; GlobalContentCodeGenerator.UpdateLoadGlobalContentCode(); if (rfs.IsCsvOrTreatedAsCsv) { CsvCodeGenerator.GenerateAndSaveDataClass(EditorLogic.CurrentReferencedFile, rfs.CsvDelimiter); } } // Even though we may have generated a Screen/Entity, we still might want to see if we should update // CSVs: if (EditorLogic.CurrentReferencedFile != null) { ReferencedFileSave rfs = EditorLogic.CurrentReferencedFile; if (rfs.Name.ToLower().EndsWith(".csv")) { CsvCodeGenerator.GenerateAndSaveDataClass(EditorLogic.CurrentReferencedFile, rfs.CsvDelimiter); } } }
public static void UpdateChangedElements() { foreach (var element in from entitySave in ProjectManager.GlueProjectSave.Entities where entitySave.HasChanged select entitySave) { var elementTreeNode = GlueState.Self.Find.ElementTreeNode(element); if (elementTreeNode != null) { elementTreeNode.UpdateReferencedTreeNodes(); CodeWriter.GenerateCode(element); } element.HasChanged = false; } foreach (var element in from screenSave in ProjectManager.GlueProjectSave.Screens where screenSave.HasChanged select screenSave) { var elementTreeNode = GlueState.Self.Find.ElementTreeNode(element); if (elementTreeNode != null) { elementTreeNode.UpdateReferencedTreeNodes(); CodeWriter.GenerateCode(element); } element.HasChanged = false; } if (ProjectManager.GlueProjectSave.GlobalContentHasChanged) { UpdateGlobalContentTreeNodes(true); GlobalContentCodeGenerator.UpdateLoadGlobalContentCode(); } }
private void PostMoveActivity() { PopulateFrom(this.mReferencedFiles); GlobalContentCodeGenerator.UpdateLoadGlobalContentCode(); GluxCommands.Self.SaveGlux(); }
internal void ReactToGlobalContentChangedValue(string changedMember, object oldValue, ref bool updateTreeView) { updateTreeView = false; // currently nothing here will update the UI, so we can save some time with this //if (changedMember == "LoadAsynchronously") //{ // ElementViewWindow.GenerateGlobalContentFileCode(); //} GlobalContentCodeGenerator.UpdateLoadGlobalContentCode(); }
private static void AskAndAddAllContainedRfsToGlobalContent(IElement element) { string message = "Add all contained files in " + element.ToString() + " to Global Content Files? Files will still be referenced by " + element.ToString(); DialogResult dialogResult = MessageBox.Show(message, "Add to Global Content?", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { if (!element.UseGlobalContent) { string screenOrEntity = "Screen"; if (element is EntitySave) { screenOrEntity = "Entity"; } DialogResult result = MessageBox.Show("The " + screenOrEntity + " " + element.ToString() + "does not UseGlobalContent. Would you like " + " to set UseGlobalContent to true?", "Set UseGlobalContent to true?", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { element.UseGlobalContent = true; } } foreach (ReferencedFileSave rfs in element.ReferencedFiles) { bool alreadyExists = false; foreach (ReferencedFileSave existingRfs in ObjectFinder.Self.GlueProject.GlobalFiles) { if (existingRfs.Name.ToLower() == rfs.Name.ToLower()) { alreadyExists = true; break; } } if (!alreadyExists) { bool useFullPathAsName = true; ElementCommands.Self.AddReferencedFileToGlobalContent(rfs.Name, useFullPathAsName); } } GlobalContentCodeGenerator.UpdateLoadGlobalContentCode(); ProjectManager.SaveProjects(); GluxCommands.Self.SaveGlux(); } }
public static void GenerateSelectedElementAndDerivedCode() { if (GlueState.Self.CurrentElement != null) { CodeGeneratorIElement.GenerateElementAndDerivedCode(GlueState.Self.CurrentElement); } else if (EditorLogic.CurrentReferencedFile != null) { GlobalContentCodeGenerator.UpdateLoadGlobalContentCode(); // Vic asks - do we have to do anything else here? I don't think so... } }
private void ListBox_DragDrop(object sender, DragEventArgs e) { Point point = ListBox.PointToClient(new Point(e.X, e.Y)); int index = this.ListBox.IndexFromPoint(point); if (index < 0) { index = this.ListBox.Items.Count - 1; } ReferencedFileSave data = e.Data.GetData(typeof(ReferencedFileSave)) as ReferencedFileSave; this.ListBox.Items.Remove(data); mReferencedFiles.Remove(data); this.ListBox.Items.Insert(index, data); mReferencedFiles.Insert(index, data); GlobalContentCodeGenerator.UpdateLoadGlobalContentCode(); GluxCommands.Self.SaveGlux(); }
public override void StartUp() { propertiesManager = new GumxPropertiesManager(); AssetTypeInfoManager.Self.AddCommonAtis(); addGumProjectMenuItem = this.AddMenuItemTo("Add New Gum Project", HandleAddNewGumProject, "Content"); //var bmp = new Bitmap(WindowsFormsApplication1.Properties.Resources.myimage); addGumProjectMenuItem.Image = new Bitmap(GumPlugin.Resource1.GumIcon); AssignEvents(); CreateToolbar(); CodeGeneratorManager.Self.CreateElementComponentCodeGenerators(); globalContentCodeGenerator = new GlobalContentCodeGenerator(); FlatRedBall.Glue.Parsing.CodeWriter.GlobalContentCodeGenerators.Add(globalContentCodeGenerator); Gum.Managers.StandardElementsManager.Self.Initialize(); }
public void RemoveReferencedFile(ReferencedFileSave referencedFileToRemove, List <string> additionalFilesToRemove, bool regenerateCode) { var isContained = GlueState.Self.Find.IfReferencedFileSaveIsReferenced(referencedFileToRemove); /////////////////////////Early Out////////////////////////////// if (!isContained) { return; } ////////////////////////End Early Out///////////////////////////// // There are some things that need to happen: // 1. Remove the ReferencedFileSave from the Glue project (GLUX) // 2. Remove the GUI item // 3. Remove the item from the Visual Studio project. IElement container = referencedFileToRemove.GetContainer(); #region Remove the file from the current Screen or Entity if there is a current Screen or Entity if (container != null) { // The referenced file better be a globally referenced file if (!container.ReferencedFiles.Contains(referencedFileToRemove)) { throw new ArgumentException(); } else { container.ReferencedFiles.Remove(referencedFileToRemove); } // Ask about any NamedObjects that reference this file. for (int i = container.NamedObjects.Count - 1; i > -1; i--) { var nos = container.NamedObjects[i]; if (nos.SourceType == SourceType.File && nos.SourceFile == referencedFileToRemove.Name) { MainGlueWindow.Self.Invoke(() => { // Ask the user what to do here - remove it? Keep it and not compile? MultiButtonMessageBox mbmb = new MultiButtonMessageBox(); mbmb.MessageText = "The object\n" + nos.ToString() + "\nreferences the file\n" + referencedFileToRemove.Name + "\nWhat would you like to do?"; mbmb.AddButton("Remove this object", DialogResult.Yes); mbmb.AddButton("Keep it (object will not be valid until changed)", DialogResult.No); var result = mbmb.ShowDialog(); if (result == DialogResult.Yes) { container.NamedObjects.RemoveAt(i); } }); } nos.ResetVariablesReferencing(referencedFileToRemove); } MainGlueWindow.Self.Invoke(() => { if (EditorLogic.CurrentScreenTreeNode != null) { EditorLogic.CurrentScreenTreeNode.UpdateReferencedTreeNodes(); } else if (EditorLogic.CurrentEntityTreeNode != null) { EditorLogic.CurrentEntityTreeNode.UpdateReferencedTreeNodes(); } if (regenerateCode) { ElementViewWindow.GenerateSelectedElementCode(); } }); } #endregion #region else, the file is likely part of the GlobalContentFile else { ProjectManager.GlueProjectSave.GlobalFiles.Remove(referencedFileToRemove); ProjectManager.GlueProjectSave.GlobalContentHasChanged = true; // Much faster to just remove the tree node. This was done // to reuse code and make things reactive, but this has gotten // slow on bigger projects. //ElementViewWindow.UpdateGlobalContentTreeNodes(false); // don't save here because projects will get saved below Action refreshUiAction = () => { TreeNode treeNode = GlueState.Self.Find.ReferencedFileSaveTreeNode(referencedFileToRemove); if (treeNode != null) { // treeNode can be null if the user presses delete + enter really really fast, stacking 2 remove // actions if (treeNode.Tag != referencedFileToRemove) { throw new Exception("Error removing the tree node - the selected tree node doesn't reference the file being removed"); } treeNode.Parent.Nodes.Remove(treeNode); } }; MainGlueWindow.Self.Invoke((MethodInvoker) delegate { refreshUiAction(); } ); GlobalContentCodeGenerator.UpdateLoadGlobalContentCode(); List <IElement> elements = ObjectFinder.Self.GetAllElementsReferencingFile(referencedFileToRemove.Name); foreach (IElement element in elements) { if (regenerateCode) { CodeWriter.GenerateCode(element); } } } #endregion // November 10, 2015 // I feel like this may // have been old code before // we had full dependency tracking // in Glue. This file should only be // removed from the project if nothing // else references it, including no entities. // This code does just entities/screens/global // content, but doesn't check the full dependency // tree. I think we can just remove it and depend on // the code below. // Actually, removing this seems to cause problems - files // that should be removed aren't. So instead we'll chnage the // call to use the dependency tree: // replace: List <string> referencedFiles = GlueCommands.Self.FileCommands.GetAllReferencedFileNames().Select(item => item.ToLowerInvariant()).ToList(); string absoluteToLower = GlueCommands.Self.GetAbsoluteFileName(referencedFileToRemove).ToLowerInvariant(); string relativeToProject = FileManager.MakeRelative(absoluteToLower, GlueState.Self.ContentDirectory); bool isReferencedByOtherContent = referencedFiles.Contains(relativeToProject); if (isReferencedByOtherContent == false) { additionalFilesToRemove.Add(referencedFileToRemove.GetRelativePath()); string itemName = referencedFileToRemove.GetRelativePath(); string absoluteName = ProjectManager.MakeAbsolute(referencedFileToRemove.Name, true); // I don't know why we were removing the file from the ProjectBase - it should // be from the Content project //ProjectManager.RemoveItemFromProject(ProjectManager.ProjectBase, itemName); ProjectManager.RemoveItemFromProject(ProjectManager.ProjectBase.ContentProject, itemName, performSave: false); foreach (ProjectBase syncedProject in ProjectManager.SyncedProjects) { ProjectManager.RemoveItemFromProject(syncedProject.ContentProject, absoluteName); } } if (ProjectManager.IsContent(referencedFileToRemove.Name)) { UnreferencedFilesManager.Self.RefreshUnreferencedFiles(false); foreach (var file in UnreferencedFilesManager.LastAddedUnreferencedFiles) { additionalFilesToRemove.Add(file.FilePath); } } ReactToRemovalIfCsv(referencedFileToRemove, additionalFilesToRemove); GluxCommands.Self.SaveGlux(); }
public void GenerateGlobalContentCode() { GlobalContentCodeGenerator.UpdateLoadGlobalContentCode(); }
static void GenerateAllCodeSync(object throwaway) { var glueProject = GlueState.CurrentGlueProject; CameraSetupCodeGenerator.UpdateOrAddCameraSetup(); CameraSetupCodeGenerator.GenerateCallInGame1(ProjectManager.GameClassFileName, true); //Parallel.For(0, layer.data[0].tiles.Count, (count) => GlueCommands.PrintOutput("Starting to generate all Screens"); // make sure the user hasn't exited the program foreach (var screen in glueProject.Screens) { #region Check for exiting the function becuase Glue is closing if (ProjectManager.WantsToClose) { PluginManager.ReceiveOutput("Stopping generation because the project is closing"); return; } #endregion CodeWriter.GenerateCode(screen); } GlueCommands.PrintOutput("Done generating Screens, starting Entities"); // not sure which is faster: // Currently the referenced file dictionary makes this not work well: //Parallel.ForEach(GlueState.Self.CurrentGlueProject.Entities, (entity) => // { // CodeWriter.GenerateCode(entity); // }); // Let's make this thread safe: IEnumerable <EntitySave> entityList = null; lock (glueProject.Entities) { entityList = glueProject.Entities.Where(item => true).ToList(); } foreach (var entity in entityList) { #region Check for exiting the function becuase Glue is closing if (ProjectManager.WantsToClose) { PluginManager.ReceiveOutput("Stopping generation because the project is closing"); return; } #endregion CodeWriter.GenerateCode(entity); } PluginManager.ReceiveOutput("Done generating Entities, starting GlobalContent"); #region Check for exiting the function becuase Glue is closing if (ProjectManager.WantsToClose) { PluginManager.ReceiveOutput("Stopping generation because the project is closing"); return; } #endregion GlobalContentCodeGenerator.UpdateLoadGlobalContentCode(); #region Check for exiting the function becuase Glue is closing if (ProjectManager.WantsToClose) { PluginManager.ReceiveOutput("Stopping generation because the project is closing"); return; } #endregion CsvCodeGenerator.RegenerateAllCsvs(); CsvCodeGenerator.GenerateAllCustomClasses(glueProject); if (glueProject.FileVersion >= (int)GlueProjectSave.GluxVersions.AddedGeneratedGame1) { GlueCommands.GenerateCodeCommands.GenerateGame1(); } GlueCommands.PrintOutput("Done with all generation"); }
public void MoveNamedObject(TreeNode treeNodeMoving, TreeNode targetNode) { if (targetNode != null) { NamedObjectSave targetNos = targetNode.Tag as NamedObjectSave; NamedObjectSave movingNos = treeNodeMoving.Tag as NamedObjectSave; bool succeeded = false; if (targetNode == null) { // Didn't move on to anything } else if (targetNode.IsRootNamedObjectNode()) { succeeded = MoveObjectOnObjectsRoot(treeNodeMoving, targetNode, movingNos, succeeded); } else if (targetNode.IsRootCustomVariablesNode()) { MoveObjectOnRootCustomVariablesNode(treeNodeMoving, targetNode); } else if (targetNode.Tag is IElement) { succeeded = DragDropNosIntoElement(movingNos, targetNode.Tag as IElement); } else if (targetNode.IsRootEventsNode()) { succeeded = DragDropNosOnRootEventsNode(treeNodeMoving, targetNode); } else if (targetNos != null && targetNos.SourceType == SourceType.FlatRedBallType) { string targetClassType = targetNos.SourceClassType; #region Failure cases if (string.IsNullOrEmpty(targetClassType)) { MessageBox.Show("The target Object does not have a defined type. This operation is not valid"); } #endregion else if (targetClassType == "Layer") { // Only allow this if the NOS's are on the same object if (ObjectFinder.Self.GetElementContaining(movingNos) == ObjectFinder.Self.GetElementContaining(targetNos)) { succeeded = true; movingNos.LayerOn = targetNos.InstanceName; MainGlueWindow.Self.PropertyGrid.Refresh(); } } else if (targetClassType == "ShapeCollection") { succeeded = HandleDropOnShapeCollection(treeNodeMoving, targetNode, targetNos, movingNos); } else if (targetClassType == "PositionedObjectList<T>") { succeeded = HandleDropOnList(treeNodeMoving, targetNode, targetNos, movingNos); } } else { MessageBox.Show("Invalid movement"); } if (succeeded) { if (EditorLogic.CurrentElement != null) { ElementViewWindow.GenerateSelectedElementCode(); } else { GlobalContentCodeGenerator.UpdateLoadGlobalContentCode(); } ProjectManager.SaveProjects(); GluxCommands.Self.SaveGlux(); } } }
private static void DragAddFileToGlobalContent(TreeNode treeNodeMoving, ReferencedFileSave referencedFileSave) { if (referencedFileSave.GetContainerType() == ContainerType.None) { // This means the user dragged a file from global content onto the global content tree node - // we shouldn't do anything here. It's not a valid operation, but at the same time, it may have // happened accidentally and we don't want to burden the user with popups. } else { bool isAlreadyPartOfReferencedFiles = false; // If the file is already part of GlobalContent, then warn the user and do nothing foreach (ReferencedFileSave fileInGlobalContent in ObjectFinder.Self.GlueProject.GlobalFiles) { if (fileInGlobalContent.Name == referencedFileSave.Name) { isAlreadyPartOfReferencedFiles = true; break; } } if (isAlreadyPartOfReferencedFiles) { MessageBox.Show("The file\n\n" + referencedFileSave.Name + "\n\nis already a Global Content File"); } else { // If we got here, that means that the file that // the user is dragging in to Global Content Files // can be added to Global Content Files; however, the // owner of the file may not be using global content. We // should ask the user if the containing IElement should use // global content IElement container = referencedFileSave.GetContainer(); if (!container.UseGlobalContent) { string screenOrEntity = "Screen"; if (container is EntitySave) { screenOrEntity = "Entity"; } DialogResult result = MessageBox.Show("The " + screenOrEntity + " " + container.ToString() + "does not UseGlobalContent. Would you like " + " to set UseGlobalContent to true?", "Set UseGlobalContent to true?", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { container.UseGlobalContent = true; } } bool useFullPathAsName = true; ElementCommands.Self.AddReferencedFileToGlobalContent(referencedFileSave.Name, useFullPathAsName); GlobalContentCodeGenerator.UpdateLoadGlobalContentCode(); ProjectManager.SaveProjects(); GluxCommands.Self.SaveGlux(); } } }
private static void MoveReferencedFileToDirectory(ReferencedFileSave referencedFileSave, string targetDirectory) { // Things to do: // 1 Move the TreeNode from one parent TreeNode to another UPDATE: We will just refresh the UI for the Element or GlobalContent // 2 Move the file from one folder to another // 3 Remove the BuildItems from the project and add them back in the VisualStudio project // 4 Change the ReferencedFileSave's name // 5 Re-generate the containing Element (Screen or Entity) // 6 Save everything string oldNodeText = referencedFileSave.Name.Replace("/", "\\"); string newNodeText = FlatRedBall.IO.FileManager.MakeRelative(targetDirectory, ProjectManager.ProjectBase.GetAbsoluteContentFolder()) + FileManager.RemovePath(referencedFileSave.Name); newNodeText = newNodeText.Replace("/", "\\"); string oldFileName = ProjectManager.MakeAbsolute(referencedFileSave.Name, true); string targetFile = targetDirectory + FileManager.RemovePath(oldFileName); bool canMove = true; // There's so much error checking and validation that we // could/should do here, but man, I just can't spend forever // on it because I need to get the game I'm working on moving forward // But I'm going to at least improve it a little bit by having the referenced // files get copied over. Dictionary <string, string> mOldNewDependencyFileDictionary = new Dictionary <string, string>(); List <string> referencedFiles = ContentParser.GetFilesReferencedByAsset(oldFileName, TopLevelOrRecursive.Recursive); string oldDirectoryFull = FileManager.GetDirectory(oldFileName); foreach (string file in referencedFiles) { string relativeToRfs = FileManager.MakeRelative(file, FileManager.GetDirectory(oldFileName)); string targetReferencedFileName = targetDirectory + relativeToRfs; mOldNewDependencyFileDictionary.Add(file, targetReferencedFileName); if (!FileManager.IsRelativeTo(targetReferencedFileName, targetDirectory)) { MessageBox.Show("The file\n\n" + file + "\n\nis not relative to the file being moved, so it cannot be moved. You must manually move these files and manually update the file reference."); canMove = false; break; } } if (canMove && File.Exists(targetFile)) { MessageBox.Show("There is already a file by this name located in the directory you're trying to move to."); canMove = false; } if (canMove) { foreach (KeyValuePair <string, string> kvp in mOldNewDependencyFileDictionary) { if (File.Exists(kvp.Value)) { MessageBox.Show("Can't move the file because a dependency will be moved to\n\n" + kvp.Value + "\n\nand a file already exists there."); canMove = false; break; } } } if (canMove) { // 1 Move the TreeNode from one parent TreeNode to another //treeNodeMoving.Parent.Nodes.Remove(treeNodeMoving); //targetNode.Nodes.Add(treeNodeMoving); // This is updated at the bottom of this method // In case it doesn't exist System.IO.Directory.CreateDirectory(FileManager.GetDirectory(targetFile)); // 2 Move the file from one folder to another File.Move(oldFileName, targetFile); foreach (KeyValuePair <string, string> kvp in mOldNewDependencyFileDictionary) { File.Move(kvp.Key, kvp.Value); } // 3 Remove the BuildItems from the project and add them back in the VisualStudio project ProjectBase projectBase = ProjectManager.ProjectBase; if (ProjectManager.ContentProject != null) { projectBase = ProjectManager.ContentProject; } ProjectManager.RemoveItemFromProject(projectBase, oldNodeText, false); projectBase.AddContentBuildItem(targetFile); foreach (KeyValuePair <string, string> kvp in mOldNewDependencyFileDictionary) { string fileFileRelativeToProject = FileManager.MakeRelative(kvp.Key, projectBase.Directory); ProjectManager.RemoveItemFromProject(projectBase, fileFileRelativeToProject, false); projectBase.AddContentBuildItem(kvp.Value); } // TODO: This should also check to see if something else is referencing this content. // I'm going to write it to not make this check now since I'm just getting the initial system set up // 4 Change the ReferencedFileSave's name referencedFileSave.SetNameNoCall(newNodeText.Replace("\\", "/")); // No need for this, it'll get updated automatically // treeNodeMoving.Text = newNodeText; // 5 Re-generate the containing Element (Screen or Entity) if (EditorLogic.CurrentElement != null) { CodeWriter.GenerateCode(EditorLogic.CurrentElement); } else { GlobalContentCodeGenerator.UpdateLoadGlobalContentCode(); } // The new 1: Update if (EditorLogic.CurrentElement != null) { EditorLogic.CurrentElementTreeNode.UpdateReferencedTreeNodes(); } else { ElementViewWindow.UpdateGlobalContentTreeNodes(false); } // 6 Save everything GluxCommands.Self.SaveGlux(); ProjectManager.SaveProjects(); } }
public void ReactToPropertyChanged(string variableNameAsDisplayed, object oldValue, string variableName, string parentGridItemName) { var mPropertyGrid = MainGlueWindow.Self.PropertyGrid; bool updateTreeView = true; #region EventResponseSave if (EditorLogic.CurrentEventResponseSave != null) { Container.Get <EventResponseSaveSetVariableLogic>().ReactToChange( variableNameAsDisplayed, oldValue, GlueState.Self.CurrentEventResponseSave, GlueState.Self.CurrentElement); } #endregion #region State else if (EditorLogic.CurrentStateSave != null) { Container.Get <StateSaveSetVariableLogic>().ReactToStateSaveChangedValue( EditorLogic.CurrentStateSave, EditorLogic.CurrentStateSaveCategory, variableNameAsDisplayed, oldValue, EditorLogic.CurrentElement, ref updateTreeView); } #endregion #region StateCategory else if (EditorLogic.CurrentStateSaveCategory != null) { Container.Get <StateSaveCategorySetVariableLogic>().ReactToStateSaveCategoryChangedValue( EditorLogic.CurrentStateSaveCategory, variableNameAsDisplayed, oldValue, EditorLogic.CurrentElement, ref updateTreeView); } #endregion #region NamedObject else if (EditorLogic.CurrentNamedObject != null) { Container.Get <NamedObjectSetVariableLogic>().ReactToNamedObjectChangedValue( variableNameAsDisplayed, parentGridItemName, oldValue); } #endregion #region ReferencedFile else if (EditorLogic.CurrentReferencedFile != null) { Container.Get <ReferencedFileSaveSetVariableLogic>().ReactToChangedReferencedFile( variableNameAsDisplayed, oldValue, ref updateTreeView); } #endregion #region CustomVariable else if (EditorLogic.CurrentCustomVariable != null) { Container.Get <CustomVariableSaveSetVariableLogic>().ReactToCustomVariableChangedValue( variableNameAsDisplayed, EditorLogic.CurrentCustomVariable, oldValue); } else if (mPropertyGrid.SelectedObject != null && mPropertyGrid.SelectedObject is PropertyGridDisplayer && EditorLogic.CurrentElement != null && EditorLogic.CurrentElement.GetCustomVariableRecursively(variableName) != null) { Container.Get <CustomVariableSaveSetVariableLogic>().ReactToCustomVariableChangedValue( variableName, EditorLogic.CurrentElement.GetCustomVariableRecursively(variableName), oldValue); } #endregion // Check Entities and Screens after checking variables and objects #region Entity else if (EditorLogic.CurrentEntitySave != null) { Container.Get <EntitySaveSetVariableLogic>().ReactToEntityChangedValue(variableNameAsDisplayed, oldValue); } #endregion #region ScreenSave else if (EditorLogic.CurrentScreenSave != null) { Container.Get <ScreenSaveSetVariableLogic>().ReactToScreenChangedValue(variableNameAsDisplayed, oldValue); } #endregion #region Global content container node else if (EditorLogic.CurrentTreeNode.Root().IsGlobalContentContainerNode()) { Container.Get <GlobalContentSetVariableLogic>().ReactToGlobalContentChangedValue( variableNameAsDisplayed, oldValue, ref updateTreeView); } #endregion PluginManager.ReactToChangedProperty(variableNameAsDisplayed, oldValue); if (EditorLogic.CurrentElement != null) { CodeGeneratorIElement.GenerateElementDerivedAndReferenced(EditorLogic.CurrentElement); } else if (EditorLogic.CurrentReferencedFile != null) { GlobalContentCodeGenerator.UpdateLoadGlobalContentCode(); } // UpdateCurrentObjectReferencedTreeNodes // kicks off a save by default. Therefore // we don't need to call SaveProjects if UpdateCurrentObjectReferencedTreeNodes // is called. if (updateTreeView) { ElementViewWindow.UpdateCurrentObjectReferencedTreeNodes(); } else { TaskManager.Self.AddSync(ProjectManager.SaveProjects, "Saving due to variable change"); } mPropertyGrid.Refresh(); GluxCommands.Self.SaveGlux(); // Vic says: This was intented to refresh the variables at one point // but this is a messy feature. I think we should just refresh the entire // glux whenever a change is made now that it's async //RemotingManager.RefreshVariables(false); }