예제 #1
0
        private static void RemoveStdCombination(IStdCombinationsBean receiver, DefaultEditParams editParams)
        {
            RelationEditParameters rep = editParams as RelationEditParameters;

            if (rep == null)
            {
                return;
            }
            receiver.RemoveStdCombination((StdCombination)rep.Related);
        }
예제 #2
0
        private static void RemoveDependency(IDependencyBean receiver, DefaultEditParams editParams)
        {
            RelationEditParameters rep = editParams as RelationEditParameters;

            if (rep == null)
            {
                return;
            }
            receiver.RemoveDependency((Dependency)rep.Related);
        }
예제 #3
0
        private static void RemoveTestCase(ITestCasesBean receiver, DefaultEditParams editParams)
        {
            RelationEditParameters rep = editParams as RelationEditParameters;

            if (rep == null)
            {
                return;
            }
            receiver.RemoveTestCase((TestCase)rep.Related);
        }
예제 #4
0
        private static void RemoveExpectedResult(Effect receiver, DefaultEditParams editParams)
        {
            RelationEditParameters rep = editParams as RelationEditParameters;

            if (rep == null)
            {
                return;
            }
            receiver.RemoveExpectedResult((ExpectedResult)rep.Related);
        }
예제 #5
0
        private static void RemoveRequirement(IRequirementsBean receiver, DefaultEditParams editParams)
        {
            RelationEditParameters rep = editParams as RelationEditParameters;

            if (rep == null)
            {
                return;
            }
            receiver.RemoveRequirement((Requirement)rep.Related);
        }
예제 #6
0
        private static void AddEffect(IEffectsBean receiver, DefaultEditParams editParams)
        {
            RelationEditParameters rep = editParams as RelationEditParameters;

            if (rep == null)
            {
                return;
            }
            receiver.AddEffect((Effect)rep.Related);
        }
예제 #7
0
        private static void RemoveEquivalenceClass(IEquivalenceClassesBean receiver, DefaultEditParams editParams)
        {
            RelationEditParameters rep = editParams as RelationEditParameters;

            if (rep == null)
            {
                return;
            }
            receiver.RemoveEquivalenceClass((EquivalenceClass)rep.Related);
        }
예제 #8
0
        private static void AddObject(object receiver, DefaultEditParams editParams)
        {
            RelationEditParameters rep = editParams as RelationEditParameters;

            if (rep == null)
            {
                return;
            }
            // the method works only if the relation of the related is defined by a method called "Add[related.Type]"
            Type       type        = receiver.GetType();
            Type       relatedType = rep.Related.GetType();
            MethodInfo minfo       = type.GetMethod("Add" + relatedType.Name);

            if (minfo == null)
            {
                return;
            }
            object[] param = new object[1];
            param[0] = rep.Related;
            minfo.Invoke(receiver, param);
        }