Beispiel #1
0
        private static void FillUsedFilesFromState(Dictionary <string, CopiedFileReference> copiedFiles, string gumProjectFolder, List <global::Gum.DataTypes.Variables.StateSave> states)
        {
            foreach (var state in states)
            {
                foreach (var variable in state.Variables.Where(item => item.Name == "SourceFile" || item.GetRootName() == "SourceFile"))
                {
                    if (variable != null && !string.IsNullOrEmpty(variable.Value as string))
                    {
                        string relativeValue = variable.Value as string;
                        if (!FileManager.IsRelative(relativeValue))
                        {
                            relativeValue = FileManager.MakeRelative(relativeValue, gumProjectFolder);
                        }
                        string fullPath = FileManager.RemoveDotDotSlash(gumProjectFolder + relativeValue);



                        if (!copiedFiles.ContainsKey(fullPath.ToLower()))
                        {
                            CopiedFileReference reference = new CopiedFileReference();
                            reference.Source      = fullPath;
                            reference.Destination = "";
                            copiedFiles.Add(fullPath.ToLower(), reference);
                        }
                    }
                }
            }
        }
        private static void FillUsedFilesFromState(Dictionary<string, CopiedFileReference> copiedFiles, string gumProjectFolder, List<global::Gum.DataTypes.Variables.StateSave> states)
        {
            foreach (var state in states)
            {
                foreach (var variable in state.Variables.Where(item => item.Name == "SourceFile" || item.GetRootName() == "SourceFile"))
                {
                    if (variable != null && !string.IsNullOrEmpty(variable.Value as string))
                    {
                        string relativeValue = variable.Value as string;
                        if (!FileManager.IsRelative(relativeValue))
                        {
                            relativeValue = FileManager.MakeRelative(relativeValue, gumProjectFolder);
                        }
                        string fullPath = FileManager.RemoveDotDotSlash(gumProjectFolder + relativeValue);



                        if (!copiedFiles.ContainsKey(fullPath.ToLower()))
                        {
                            CopiedFileReference reference = new CopiedFileReference();
                            reference.Source = fullPath;
                            reference.Destination = "";
                            copiedFiles.Add(fullPath.ToLower(), reference);
                        }
                    }
                }
            }
        }