Inheritance: System.Windows.Forms.Form
Esempio n. 1
0
        private void diagram_ShapeConfiguring(object sender, nHydrate.Dsl.ModelElementEventArgs e)
        {
            if (this.IsImporting)
            {
                return;
            }

            var diagram = (((Microsoft.VisualStudio.Modeling.Shell.SingleDiagramDocView)(this.DocViews.First())).CurrentDiagram);
            var shape   = e.Shape;

            if (shape is EntityAssociationConnector)
            {
                var F = new nHydrate.DslPackage.Forms.RelationshipDialog(shape.Diagram.ModelElement as nHydrateModel, shape.Store, (shape as EntityAssociationConnector).ModelElement as EntityHasEntities);
                if (F.ShowDialog() != System.Windows.Forms.DialogResult.OK)
                {
                    var relation = shape.ModelElement as EntityHasEntities;
                    relation.ParentEntity.ChildEntities.Remove(relation.ParentEntity.ChildEntities.LastOrDefault());
                }
            }
            else if (shape is EntityViewAssociationConnector)
            {
                var F = new nHydrate.DslPackage.Forms.RelationshipViewDialog(shape.Diagram.ModelElement as nHydrateModel, shape.Store, (shape as EntityViewAssociationConnector).ModelElement as EntityHasViews);
                if (F.ShowDialog() != System.Windows.Forms.DialogResult.OK)
                {
                    var relation = shape.ModelElement as EntityHasViews;
                    relation.ParentEntity.ChildViews.Remove(relation.ParentEntity.ChildViews.LastOrDefault());
                }
            }
        }
Esempio n. 2
0
        private void diagram_ShapeDoubleClick(object sender, nHydrate.Dsl.ModelElementEventArgs e)
        {
            var diagram = (((Microsoft.VisualStudio.Modeling.Shell.SingleDiagramDocView)(this.DocViews.First())).CurrentDiagram);
            var shape   = e.Shape;

            if (shape is EntityAssociationConnector)
            {
                if (!(shape.Diagram as nHydrateDiagram).IsLoading)
                {
                    var F = new nHydrate.DslPackage.Forms.RelationshipDialog(shape.Diagram.ModelElement as nHydrateModel, shape.Store, (shape as EntityAssociationConnector).ModelElement as EntityHasEntities);
                    F.ShowDialog();
                }
            }
        }
Esempio n. 3
0
        private void OnMenuCommandRelationDialog(object sender, EventArgs e)
        {
            if (this.CurrentSelection.Count != 1)
            {
                return;
            }
            var store = this.CurrentDocData.Store;

            foreach (var selectedObject in this.CurrentSelection)
            {
                if (selectedObject is EntityAssociationConnector)
                {
                    var model = this.CurrentDocView.CurrentDiagram.ModelElement as nHydrateModel;
                    var F     = new nHydrate.DslPackage.Forms.RelationshipDialog(model, store, ((EntityAssociationConnector)selectedObject).ModelElement as EntityHasEntities);
                    F.ShowDialog();
                }
            }
        }
Esempio n. 4
0
 private void OnMenuCommandRelationDialog(object sender, EventArgs e)
 {
     try
     {
         if (this.CurrentSelection.Count != 1) return;
         var store = this.CurrentDocData.Store;
         foreach (var selectedObject in this.CurrentSelection)
         {
             if (selectedObject is EntityAssociationConnector)
             {
                 var model = this.CurrentDocView.CurrentDiagram.ModelElement as nHydrateModel;
                 var F = new nHydrate.DslPackage.Forms.RelationshipDialog(model, store, ((EntityAssociationConnector)selectedObject).ModelElement as EntityHasEntities);
                 F.ShowDialog();
             }
             else if (selectedObject is EntityViewAssociationConnector)
             {
                 var model = this.CurrentDocView.CurrentDiagram.ModelElement as nHydrateModel;
                 var F = new nHydrate.DslPackage.Forms.RelationshipViewDialog(model, store, ((EntityViewAssociationConnector)selectedObject).ModelElement as EntityHasViews);
                 F.ShowDialog();
             }
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Esempio n. 5
0
        private void diagram_ShapeDoubleClick(object sender, nHydrate.Dsl.ModelElementEventArgs e)
        {
            var diagram = (((Microsoft.VisualStudio.Modeling.Shell.SingleDiagramDocView)(this.DocViews.First())).CurrentDiagram);
            var shape = e.Shape;

            if (shape is EntityAssociationConnector)
            {
                if (!(shape.Diagram as nHydrateDiagram).IsLoading)
                {
                    var F = new nHydrate.DslPackage.Forms.RelationshipDialog(shape.Diagram.ModelElement as nHydrateModel, shape.Store, (shape as EntityAssociationConnector).ModelElement as EntityHasEntities);
                    F.ShowDialog();
                }
            }
            else if (shape is EntityViewAssociationConnector)
            {
                if (!(shape.Diagram as nHydrateDiagram).IsLoading)
                {
                    var F = new nHydrate.DslPackage.Forms.RelationshipViewDialog(shape.Diagram.ModelElement as nHydrateModel, shape.Store, (shape as EntityViewAssociationConnector).ModelElement as EntityHasViews);
                    F.ShowDialog();
                }
            }

        }
Esempio n. 6
0
        private void diagram_ShapeConfiguring(object sender, nHydrate.Dsl.ModelElementEventArgs e)
        {
            if (this.IsImporting) return;

            var diagram = (((Microsoft.VisualStudio.Modeling.Shell.SingleDiagramDocView)(this.DocViews.First())).CurrentDiagram);
            var shape = e.Shape;

            if (shape is EntityAssociationConnector)
            {
                var F = new nHydrate.DslPackage.Forms.RelationshipDialog(shape.Diagram.ModelElement as nHydrateModel, shape.Store, (shape as EntityAssociationConnector).ModelElement as EntityHasEntities);
                if (F.ShowDialog() != System.Windows.Forms.DialogResult.OK)
                {
                    var relation = shape.ModelElement as EntityHasEntities;
                    relation.ParentEntity.ChildEntities.Remove(relation.ParentEntity.ChildEntities.LastOrDefault());
                }
            }
            else if (shape is EntityViewAssociationConnector)
            {
                var F = new nHydrate.DslPackage.Forms.RelationshipViewDialog(shape.Diagram.ModelElement as nHydrateModel, shape.Store, (shape as EntityViewAssociationConnector).ModelElement as EntityHasViews);
                if (F.ShowDialog() != System.Windows.Forms.DialogResult.OK)
                {
                    var relation = shape.ModelElement as EntityHasViews;
                    relation.ParentEntity.ChildViews.Remove(relation.ParentEntity.ChildViews.LastOrDefault());
                }
            }

        }