protected Singleton()
 {
     if (instance == null)
     {
         FARLogger.DebugFormat("Singleton {0} is created", this);
     }
     else
     {
         FARLogger.TraceFormat("{0} is a Singleton but an instance already exists", this);
     }
 }
Exemple #2
0
        private void InitTask()
        {
            Assembly[] assemblies = ReflectionUtils.LoadedAssemblies;
            var        types      = new List <Type>(ReflectionUtils.GetTypes(assemblies));

            AddonTypes.AddRange(ReflectionUtils.FindAttribute <FARAddonAttribute>(types));
            ReloadableTypes.AddRange(ReflectionUtils.FindTypes <IReloadable>(types, true));

            if (AddonTypes.Count == 0)
            {
                FARLogger.Trace("No FARAddon types found");
            }
            if (ReloadableTypes.Count == 0)
            {
                FARLogger.Trace("No IReloadable types found");
            }

            // sort by descending priority order
            AddonTypes.Sort((x, y) => y.First.Priority.CompareTo(x.First.Priority));

            // output some debug information
            FARLogger.TraceFormat(TraceMessage());
        }