示例#1
0
 /// <summary>
 /// Assigns references to components that implement IReferenceable interface
 /// </summary>
 /// <param name="references">references to be assigned</param>
 /// <param name="components">a list of components to assign references</param>
 public static void SetReferences(IReferences references, IEnumerable components = null)
 {
     components = components ?? references.GetAll();
     foreach (var component in components)
     {
         SetReferencesForOne(references, component);
     }
 }
示例#2
0
        /// <summary>
        /// Clears references for components that implement IUnreferenceable interface
        /// </summary>
        /// <param name="references">a list of components to clear references</param>
        public static void UnsetReferences(IReferences references)
        {
            var components = references.GetAll();

            foreach (var component in components)
            {
                UnsetReferencesForOne(component);
            }
        }