コード例 #1
0
        public static void RefreshFile(string fileName)
        {
            // If it's part of global content, refresh it here.
            // We need to make this thing be relative to the project:
            string directoryToUse = AlternativeContentDirectory;

            if (string.IsNullOrEmpty(directoryToUse))
            {
                directoryToUse = ContentDirectory;
            }
            if (!string.IsNullOrEmpty(directoryToUse))
            {
                FilePath filePath = fileName;

                if (mGlobalContentFilesRuntime.LoadedRfses.Any(item => item.FilePath == fileName))
                {
                    mGlobalContentFilesRuntime.Destroy(filePath);
                }
            }


            if (CurrentElement != null)
            {
                // Make this happen on the main thread
                FlatRedBall.Instructions.InstructionManager.Add(
                    new DelegateInstruction(() => CurrentElement.RefreshFile(fileName)));
            }
        }