Inheritance: System.Windows.Forms.Form
示例#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());
                }
            }
        }
示例#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();
                }
            }
        }
示例#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();
                }
            }
        }
示例#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;
     }
 }
示例#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();
                }
            }

        }
示例#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());
                }
            }

        }