Example #1
0
            /// <summary>
            /// Registers a ProductTypeCachedList instance to handle Saved events.
            /// to update the list of <see cref="ProductTypeCachedInfo"/> objects.
            /// </summary>
            /// <param name="obj">The ProductTypeCachedList instance.</param>
            public static void Register(ProductTypeCachedList obj)
            {
                var mustRegister = _references == null;

                if (mustRegister)
                {
                    _references = new List <WeakReference>();
                }

                if (ProductTypeCachedList.SingleInstanceSavedHandler)
                {
                    _references.Clear();
                }

                if (!Found(obj))
                {
                    _references.Add(new WeakReference(obj));
                }

                if (mustRegister)
                {
                    ProductTypeItem.ProductTypeItemSaved += ProductTypeItemSavedHandler;
                }
            }
Example #2
0
        // TODO: edit "ProductTypeColl.cs", uncomment the "OnDeserialized" method and add the following line:
        // TODO:     Saved += OnProductTypeCollSaved;

        private void OnProductTypeCollSaved(object sender, Csla.Core.SavedEventArgs e)
        {
            // this runs on the client
            ProductTypeCachedList.InvalidateCache();
            ProductTypeCachedNVL.InvalidateCache();
        }
        // TODO: edit "ProductTypeDynaItem.cs", uncomment the "OnDeserialized" method and add the following line:
        // TODO:     ProductTypeDynaItemSaved += ProductTypeDynaItemSavedHandler;

        private void ProductTypeDynaItemSavedHandler(object sender, Csla.Core.SavedEventArgs e)
        {
            // this runs on the client
            ProductTypeCachedList.InvalidateCache();
            ProductTypeCachedNVL.InvalidateCache();
        }