Пример #1
0
        public static void Main(string[] rgArgs)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            ErrorReport.AddProperty("EmailAddress", "*****@*****.**");
            ErrorReport.AddStandardProperties();
            ExceptionHandler.Init();

            s_loadingWnd = new SmallFadingWnd(Properties.Resources.kstidLoadingProgramMsg);

            PortableSettingsProvider.SettingsFileFolder = App.ProjectFolder;
            PortableSettingsProvider.SettingsFileName   = "PCIEditor.settings";

            string inventoryFilePath =
                FileLocator.GetDirectoryDistributedWithApplication(App.ConfigFolderName);

            // This is the poor man's way of determining whether or not the user has
            // write access to the folder in which the phonetic inventory
            // is stored. I'm sure there is a great class in .Net to use for such a
            // thing, but I couldn't find it in the little bit of digging I did. Sigh!
            string tmpFile = Path.Combine(inventoryFilePath, "!~tmpaccesstest~!");

            try
            {
                File.WriteAllText(tmpFile, string.Empty);
            }
            catch
            {
                string msg = string.Format(Properties.Resources.kstidWriteAccessErrorMsg, inventoryFilePath);
                Utils.MsgBox(msg);
                return;
            }

            File.Delete(tmpFile);

            string inventoryPath = null;

            try
            {
                // Make sure the phonetic inventory file exists.
                inventoryPath = FileLocator.GetFileDistributedWithApplication(App.ConfigFolderName,
                                                                              App.kDefaultInventoryFileName);
            }
            catch
            {
                string filePath = Utils.PrepFilePathForMsgBox(inventoryPath);
                string msg      = string.Format(Properties.Resources.kstidInventoryFileMissing, filePath);
                Utils.MsgBox(msg);
                return;
            }

            var editor = new PCIEditor();

            editor.OpenFile(inventoryPath);
            Application.Run(editor);
        }
Пример #2
0
 /// ------------------------------------------------------------------------------------
 protected override void HandleHelpClick(object sender, EventArgs e)
 {
     PCIEditor.ShowHelpTopic(@"Phonetic_Character_Inventory_Editor/Phonetic_Character_Properties.htm");
 }