AddonManager.AddonEx.installAddon C# (CSharp) Метод

installAddon() статический приватный Метод

static private installAddon ( this addonPath ) : System.Boolean
addonPath this
Результат System.Boolean
        internal static Boolean installAddon(this String addonPath)
        {
            string extractedAddonDir = extractAddonFile(addonPath);

            try
            {
                foreach (string directory in Directory.GetDirectories(extractedAddonDir, "*", System.IO.SearchOption.TopDirectoryOnly))
                {
                    FileSystem.MoveDirectory(Path.GetDirectoryName(directory),
                        Path.GetDirectoryName(Application.ExecutablePath),
                        UIOption.AllDialogs, UICancelOption.ThrowException);
                }
                if (Directory.Exists(extractedAddonDir)) Directory.Delete(extractedAddonDir, true);
                return true;
            }
            catch (Exception)
            {
                if (Directory.Exists(extractedAddonDir)) Directory.Delete(extractedAddonDir, true);
                return false;
            }
        }
    }