Пример #1
0
        /// <summary>
        /// Edits the properties of an existing mod. Changes are automatically saved to the XML info file.
        /// </summary>
        /// <param name="info">The mod information to be edited</param>
        /// <param name="path">The path of the mod info file</param>
        public static void EditMod(ModInfo info, string path)
        {
            var dialog = new ModPropertyDialog {
                _info = info, _location = Path.GetDirectoryName(path)
            };

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                ModInfo.Current.SaveXml(path);
            }
        }
Пример #2
0
        /// <summary>
        /// Creates a new mod. Information is automatically saved to the XML info file.
        /// </summary>
        /// <returns>The path of the newly created mod info file, <c>null</c> if none was created</returns>
        public static string CreateMod()
        {
            var dialog = new ModPropertyDialog();

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                string path = Path.Combine(dialog._location, dialog._info.Name + ModInfo.FileExt);
                dialog._info.SaveXml(path);
                return(path);
            }
            return(null);
        }