Пример #1
0
 /// <summary>
 /// Convert a group of symbols to an id string.
 /// Could do this with a hash with low probability of collisions
 /// but for now just convert the symbols into a cannonical string.
 /// </summary>
 private string SymbolsToId(string[] symbols)
 {
     using (var sorted = ArrayPool <string> .GetCopy(symbols))
         using (var sb = PooledStringBuilder.Get())
         {
             Array.Sort(sorted.array, StringComparer.InvariantCultureIgnoreCase);
             return(string.Join(";", sorted.array));
         }
 }
Пример #2
0
        virtual protected void DoLoadServices(Action onCompleteCallback)
        {
            BeforeLoadServices();

            // separate configurations from registrations
            // to allow app-specific overrides to occur before any services are registered
            SetServiceRegistrations();

            var serviceRegistrations = ArrayPool <ServiceRegistration> .GetCopy(m_serviceRegistrationsByType.Values);

            Array.Sort(serviceRegistrations.array, new SortServiceRegistrationsByGroup());

            RegisterServices(serviceRegistrations.array);
            InitializeServices(serviceRegistrations.array, () => {
                DoStartServices();

                serviceRegistrations.Dispose();

                if (onCompleteCallback != null)
                {
                    onCompleteCallback();
                }
            });
        }