public DefaultEdit(T receiver, EditHandle <T> redo, DefaultEditParams redoParams, EditHandle <T> undo, DefaultEditParams undoParams) { this.receiver = receiver; this.RedoParams = redoParams; this.UndoParams = undoParams; this.undo = undo; this.redo = redo; }
private static void ChangeRiskLevel(Object receiver, DefaultEditParams editParams) { PropertyEditParameters parm = editParams as PropertyEditParameters; if (parm != null) { ((IRiskLevelObject)receiver).RiskLevel = (int)parm.Value; } }
private static void ChangeState(object receiver, DefaultEditParams editParams) { PropertyEditParameters parm = editParams as PropertyEditParameters; if (parm != null) { ((IStateObject)receiver).CurrentState = (State)parm.Value; } }
private static void RemoveStdCombination(IStdCombinationsBean receiver, DefaultEditParams editParams) { RelationEditParameters rep = editParams as RelationEditParameters; if (rep == null) { return; } receiver.RemoveStdCombination((StdCombination)rep.Related); }
private static void RemoveTestCase(ITestCasesBean receiver, DefaultEditParams editParams) { RelationEditParameters rep = editParams as RelationEditParameters; if (rep == null) { return; } receiver.RemoveTestCase((TestCase)rep.Related); }
private static void RemoveDependency(IDependencyBean receiver, DefaultEditParams editParams) { RelationEditParameters rep = editParams as RelationEditParameters; if (rep == null) { return; } receiver.RemoveDependency((Dependency)rep.Related); }
private static void RemoveExpectedResult(Effect receiver, DefaultEditParams editParams) { RelationEditParameters rep = editParams as RelationEditParameters; if (rep == null) { return; } receiver.RemoveExpectedResult((ExpectedResult)rep.Related); }
private static void RemoveRequirement(IRequirementsBean receiver, DefaultEditParams editParams) { RelationEditParameters rep = editParams as RelationEditParameters; if (rep == null) { return; } receiver.RemoveRequirement((Requirement)rep.Related); }
private static void AddEffect(IEffectsBean receiver, DefaultEditParams editParams) { RelationEditParameters rep = editParams as RelationEditParameters; if (rep == null) { return; } receiver.AddEffect((Effect)rep.Related); }
private static void RemoveEquivalenceClass(IEquivalenceClassesBean receiver, DefaultEditParams editParams) { RelationEditParameters rep = editParams as RelationEditParameters; if (rep == null) { return; } receiver.RemoveEquivalenceClass((EquivalenceClass)rep.Related); }
private static void ChangeProperty(object receiver, DefaultEditParams editParams) { PropertyEditParameters dep = editParams as PropertyEditParameters; if (dep == null) { return; } Type type = receiver.GetType(); PropertyInfo pinfo = type.GetProperty(dep.PropertyName); pinfo.SetValue(receiver, dep.Value, null); }
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); }
public void SetRelatedObject(object related) { UndoParams = new RelationEditParameters(related); RedoParams = new RelationEditParameters(related); }