AGS.Editor.FontEditor.ImportFont C# (CSharp) Метод

ImportFont() приватный Метод

private ImportFont ( string fileName ) : void
fileName string
Результат void
        private void ImportFont(string fileName)
        {
            try
            {
                string newTTFName = "agsfnt" + _item.ID + ".ttf";
                string newWFNName = "agsfnt" + _item.ID + ".wfn";

                List<string> filesToCheck = new List<string>();
                filesToCheck.Add(newTTFName);
                filesToCheck.Add(newWFNName);
                if (!Factory.AGSEditor.AttemptToGetWriteAccess(filesToCheck))
                {
                    return;
                }

                if (fileName.ToLower().EndsWith(".ttf"))
                {
                    ImportTTFFont(fileName, newTTFName, newWFNName);
                }
                else
                {
                    ImportWFNFont(fileName, newTTFName, newWFNName);
                }
                Factory.NativeProxy.GameSettingsChanged(Factory.AGSEditor.CurrentGame);
                Factory.GUIController.SetPropertyGridObject(_item);
                imagePanel.Invalidate();
            }
            catch (Exception ex)
            {
                Factory.GUIController.ShowMessage("There was a problem importing the font. The error was: " + ex.Message, MessageBoxIcon.Warning);
            }
        }