Beispiel #1
0
        public void UpdateRelationship(int index, Relationship relationship)
        {
            switch (relationship.GetType().Name)
            {
            case "OneToOneRelationship":
                Interfaces.Events.RaiseDataChangedEvent(GetType(), (MethodInfo)MethodBase.GetCurrentMethod(), _oneToOneRelationships[index], relationship);
                _oneToOneRelationships[index] = (OneToOneRelationship)relationship;
                break;

            case "OneToManyRelationship":
                Interfaces.Events.RaiseDataChangedEvent(GetType(), (MethodInfo)MethodBase.GetCurrentMethod(), _oneToManyRelationships[index], relationship);
                _oneToManyRelationships[index] = (OneToManyRelationship)relationship;
                break;

            case "ManyToOneRelationship":
                Interfaces.Events.RaiseDataChangedEvent(GetType(), (MethodInfo)MethodBase.GetCurrentMethod(), _manyToOneRelationships[index], relationship);
                _manyToOneRelationships[index] = (ManyToOneRelationship)relationship;
                break;

            case "ManyToManyRelationship":
                Interfaces.Events.RaiseDataChangedEvent(GetType(), (MethodInfo)MethodBase.GetCurrentMethod(), _manyToManyRelationships[index], relationship);
                _manyToManyRelationships[index] = (ManyToManyRelationship)relationship;
                break;

            default:

                throw new NotImplementedException("This relationship type has not been coded yet.");
            }
        }
Beispiel #2
0
        public void RemoveRelationship(Relationship relationship)
        {
            Interfaces.Events.RaiseDataChangedEvent(GetType(), (MethodInfo)MethodBase.GetCurrentMethod(), relationship, null);

            switch (relationship.GetType().Name)
            {
            case "OneToOneRelationship":
                _oneToOneRelationships.Remove((OneToOneRelationship)relationship);
                break;

            case "OneToManyRelationship":
                _oneToManyRelationships.Remove((OneToManyRelationship)relationship);
                break;

            case "ManyToOneRelationship":
                _manyToOneRelationships.Remove((ManyToOneRelationship)relationship);
                break;

            case "ManyToManyRelationship":
                _manyToManyRelationships.Remove((ManyToManyRelationship)relationship);
                break;

            default:

                throw new NotImplementedException("This relationship type has not been coded yet.");
            }
        }
        public FormRelationship(Relationship relationship, ScriptObject[] scriptObjects)
        {
            InitializeComponent();
            ucHeading1.Text = "";

            TypeOfRelationship = relationship.GetType();
            _parent = relationship.Parent;
            _primaryRelationship = relationship;
            _scriptObjects = scriptObjects;
            ArchAngel.Interfaces.Events.ShadeMainForm();
        }
Beispiel #4
0
        public void UpdateRelationship(int index, Relationship relationship)
        {
            switch (relationship.GetType().Name)
            {
                case "OneToOneRelationship":
                    Interfaces.Events.RaiseDataChangedEvent(GetType(), (MethodInfo)MethodBase.GetCurrentMethod(), _oneToOneRelationships[index], relationship);
                    _oneToOneRelationships[index] = (OneToOneRelationship)relationship;
                    break;
                case "OneToManyRelationship":
                    Interfaces.Events.RaiseDataChangedEvent(GetType(), (MethodInfo)MethodBase.GetCurrentMethod(), _oneToManyRelationships[index], relationship);
                    _oneToManyRelationships[index] = (OneToManyRelationship)relationship;
                    break;
                case "ManyToOneRelationship":
                    Interfaces.Events.RaiseDataChangedEvent(GetType(), (MethodInfo)MethodBase.GetCurrentMethod(), _manyToOneRelationships[index], relationship);
                    _manyToOneRelationships[index] = (ManyToOneRelationship)relationship;
                    break;
                case "ManyToManyRelationship":
                    Interfaces.Events.RaiseDataChangedEvent(GetType(), (MethodInfo)MethodBase.GetCurrentMethod(), _manyToManyRelationships[index], relationship);
                    _manyToManyRelationships[index] = (ManyToManyRelationship)relationship;
                    break;
                default:

                    throw new NotImplementedException("This relationship type has not been coded yet.");
            }
        }
Beispiel #5
0
        public void RemoveRelationship(Relationship relationship)
        {
            Interfaces.Events.RaiseDataChangedEvent(GetType(), (MethodInfo)MethodBase.GetCurrentMethod(), relationship, null);

            switch (relationship.GetType().Name)
            {
                case "OneToOneRelationship":
                    _oneToOneRelationships.Remove((OneToOneRelationship)relationship);
                    break;
                case "OneToManyRelationship":
                    _oneToManyRelationships.Remove((OneToManyRelationship)relationship);
                    break;
                case "ManyToOneRelationship":
                    _manyToOneRelationships.Remove((ManyToOneRelationship)relationship);
                    break;
                case "ManyToManyRelationship":
                    _manyToManyRelationships.Remove((ManyToManyRelationship)relationship);
                    break;
                default:

                    throw new NotImplementedException("This relationship type has not been coded yet.");
            }
        }