Пример #1
0
        /// <summary>
        /// Called on both document load and reload.
        /// </summary>
        protected virtual void OnDocumentLoaded()
        {
            // Validate the document
            this.ValidationController.Validate(this.GetAllElementsForValidation(), DslValidation::ValidationCategories.Open);

            // Enable CompartmentItems events.
            global::Sawczyn.EFDesigner.EFModel.ModelRoot modelRoot = this.RootElement as global::Sawczyn.EFDesigner.EFModel.ModelRoot;
            if (modelRoot != null)
            {
                global::System.Collections.Generic.IList <DslDiagrams::PresentationElement> diagrams = DslDiagrams::PresentationViewsSubject.GetPresentation(modelRoot);
                if (diagrams.Count > 0)
                {
                    global::Sawczyn.EFDesigner.EFModel.EFModelDiagram diagram = diagrams[0] as global::Sawczyn.EFDesigner.EFModel.EFModelDiagram;
                    if (diagram != null)
                    {
                        diagram.SubscribeCompartmentItemsEvents();
                    }
                }
            }
        }