private ServiceRegistration()
 {
     _servicesRegistrationChangeListener = new DefaultItemRegistrationChangeListener("ServiceRegistration: Listening for service changes")
     {
         ItemsWereAdded = (location, items) => AddServiceItems(items)
                          // Service removals are not supported
     };
 }
        /// <summary>
        /// Removes the specified change <paramref name="listener"/> instance from the specified
        /// <paramref name="location"/>.
        /// </summary>
        /// <remarks>
        /// The plugin manager's synchronization object must be locked when this method is called.
        /// </remarks>
        /// <param name="location">Location to remove the listener from.</param>
        /// <param name="listener">The listener to remove.</param>
        internal static void RemoveItemRegistrationChangeListener(string location, IItemRegistrationChangeListener listener)
        {
            ICollection <IItemRegistrationChangeListener> listeners = GetListenersForLocation(location, false);

            if (listeners == null)
            {
                return;
            }
            listeners.Remove(listener);
        }
    public StringManagerBase()
    {
      _languagePluginStateTracker = new DefaultItemStateTracker("Localization system: Language resources")
        {
            // We don't care about strings which are currently in use; we don't have an overview which strings are still needed. So we don't
            // provide an implementation of RequestEnd.

            Stopped = RemoveLanguageResource
        };
      _languageResourcesRegistrationChangeListener = new DefaultItemRegistrationChangeListener("Localization system: Language resources")
        {
            ItemsWereAdded = (location, items) => AddLanguageResources(items)
            // Item removals are handled by the SkinResourcesPluginItemStateTracker
        };
    }
Example #4
0
        public StringManagerBase()
        {
            _languagePluginStateTracker = new DefaultItemStateTracker("Localization system: Language resources")
            {
                // We don't care about strings which are currently in use; we don't have an overview which strings are still needed. So we don't
                // provide an implementation of RequestEnd.

                Stopped = RemoveLanguageResource
            };
            _languageResourcesRegistrationChangeListener = new DefaultItemRegistrationChangeListener("Localization system: Language resources")
            {
                ItemsWereAdded = (location, items) => AddLanguageResources(items)
                                 // Item removals are handled by the SkinResourcesPluginItemStateTracker
            };
        }
Example #5
0
        public SkinManager()
        {
            _skinResourcesPluginItemStateTracker = new DefaultItemStateTracker("SkinManager: Usage of skin resources")
            {
                Stopped = itemRegistration => SkinResourcesWereChanged()
            };
            _skinResourcesRegistrationChangeListener = new DefaultItemRegistrationChangeListener("SkinManager: Usage of skin resources")
            {
                ItemsWereAdded = (location, items) => SkinResourcesWereChanged()
                                 // Item removals are handled by the plugin item state tracker
            };
            _backgroundManagerData = new BackgroundManagerData(this);
            IPluginManager pluginManager = ServiceRegistration.Get <IPluginManager>();

            pluginManager.AddItemRegistrationChangeListener(
                SKIN_RESOURCES_REGISTRATION_PATH, _skinResourcesRegistrationChangeListener);
            ReloadSkins();
        }
        /// <summary>
        /// Adds the specified item registration change <paramref name="listener"/> which will be notified
        /// when items are registered at the specified <paramref name="location"/>.
        /// </summary>
        /// <remarks>
        /// The plugin manager's synchronization object must be locked when this method is called.
        /// </remarks>
        /// <param name="location">Location to add the listener to. The added <paramref name="listener"/> will
        /// be called when items are added to or removed from this location in the plugin tree.</param>
        /// <param name="listener">The listener to add.</param>
        internal static void AddItemRegistrationChangeListener(string location, IItemRegistrationChangeListener listener)
        {
            ICollection <IItemRegistrationChangeListener> listeners = GetListenersForLocation(location, true);

            listeners.Add(listener);
        }
Example #7
0
    public WorkflowManager()
    {
      _modelItemStateTracker = new DefaultItemStateTracker("WorkflowManager: Model usage")
        {
            // We could store the end-requested model in an array of "suspended models" in the WF manager,
            // method WFM.GetOrLoadModel would then fail to load any of the suspended models
            EndRequested = itemRegistration => !IsModelContainedInNavigationStack(new Guid(itemRegistration.Metadata.Id)),

            Stopped = itemRegistration => NavigatePopModel(new Guid(itemRegistration.Metadata.Id))

            // If we'd maintain a collection of "suspended models" (like said in comment in method RequestEnd),
            // we would need to cancel the suspension of the continued model in the Continued delegate.
        };
      _wfStateItemStateTracker = new DefaultItemStateTracker("WorkflowManager: Workflow state usage")
        {
            Stopped = itemRegistration => ReloadWorkflowStates()
        };
      _workflowPluginItemsChangeListener = new DefaultItemRegistrationChangeListener("WorkflowManager: Workflow state usage")
        {
            ItemsWereAdded = (location, items) => ReloadWorkflowStates(),

            ItemsWereRemoved = (location, items) => ReloadWorkflowStates()
        };
    }
 public void RemoveItemRegistrationChangeListener(string location, IItemRegistrationChangeListener listener)
 {
 }
Example #9
0
 public SkinManager()
 {
   _skinResourcesPluginItemStateTracker = new DefaultItemStateTracker("SkinManager: Usage of skin resources")
     {
         Stopped = itemRegistration => SkinResourcesWereChanged()
     };
   _skinResourcesRegistrationChangeListener = new DefaultItemRegistrationChangeListener("SkinManager: Usage of skin resources")
     {
         ItemsWereAdded = (location, items) => SkinResourcesWereChanged()
         // Item removals are handled by the plugin item state tracker
     };
   _backgroundManagerData = new BackgroundManagerData(this);
   IPluginManager pluginManager = ServiceRegistration.Get<IPluginManager>();
   pluginManager.AddItemRegistrationChangeListener(
       SKIN_RESOURCES_REGISTRATION_PATH, _skinResourcesRegistrationChangeListener);
   ReloadSkins();
 }
Example #10
0
 /// <summary>
 /// Removes the specified change <paramref name="listener"/> instance from the specified
 /// <paramref name="location"/>.
 /// </summary>
 /// <remarks>
 /// The plugin manager's synchronization object must be locked when this method is called.
 /// </remarks>
 /// <param name="location">Location to remove the listener from.</param>
 /// <param name="listener">The listener to remove.</param>
 internal static void RemoveItemRegistrationChangeListener(string location, IItemRegistrationChangeListener listener)
 {
   ICollection<IItemRegistrationChangeListener> listeners = GetListenersForLocation(location, false);
   if (listeners == null)
     return;
   listeners.Remove(listener);
 }
Example #11
0
 /// <summary>
 /// Adds the specified item registration change <paramref name="listener"/> which will be notified
 /// when items are registered at the specified <paramref name="location"/>.
 /// </summary>
 /// <remarks>
 /// The plugin manager's synchronization object must be locked when this method is called.
 /// </remarks>
 /// <param name="location">Location to add the listener to. The added <paramref name="listener"/> will
 /// be called when items are added to or removed from this location in the plugin tree.</param>
 /// <param name="listener">The listener to add.</param>
 internal static void AddItemRegistrationChangeListener(string location, IItemRegistrationChangeListener listener)
 {
   ICollection<IItemRegistrationChangeListener> listeners = GetListenersForLocation(location, true);
   listeners.Add(listener);
 }