Ejemplo n.º 1
0
        /// <summary>
        /// Reads in the XML Settings file.
        /// </summary>
        private void ReadAddinSettingsOnInitialized(object source, ApplicationInitializedEventArgs args)
        {
            try
            {
                //read list of tools
                csvFileName = "HOK" + versionNumber + "Addins.csv";
                csvFileName = Path.Combine(addinResources, csvFileName);
                if (File.Exists(csvFileName))
                {
                    addins.AddinCollection = CsvUtil.ReadAddInList(csvFileName, sourceDirectory, installDirectory);
                }

                //override settings
                settingPath = Path.Combine(installDirectory, settingFile);
                SettingUtil.ReadConfig(settingPath, ref addins);

                //add addins
                addins.AddinCollection.Where(x => x.ToolLoadType == LoadType.Always).ToList().ForEach(AddPlugin);
            }
            catch (Exception ex)
            {
                Log.AppendLog(LogMessageType.EXCEPTION, ex.Message);
            }
        }