/// <summary> /// Retire _typeInfo de <see cref="AcceptedShapes"/>, /// Invoque <see cref="OnRemoveShape"/>. /// </summary> public void Remove(ShapeTypeInfo _typeInfo) { int _index = AcceptedShapes.IndexOf(_typeInfo); if (_index != -1) { AcceptedShapes.RemoveAt(_index); } OnRemoveShape?.Invoke(this, _typeInfo); }
/// <summary> /// Retourne le type du Component que ce GraphTypeInfo réclame à _type /// </summary> public Type ClaimsComponentTo(ShapeTypeInfo _type) { foreach (ClassClaimer _claimer in ClaimersForEdit) { if (_claimer.fromType == _type.TypeName) { return(SolutionClasses.Type(_claimer.claimedType)); } } return(null); }
public ShapeTypeInfo(ShapeTypeInfo _typeInfo) { foreach (Base _editableComponent in _typeInfo.EditableComponents) { EditableComponents.Add(_editableComponent); } foreach (ClassClaimer _claimer in _typeInfo.ClaimersForEdit) { ClaimersForEdit.Add(_claimer); } }
/// <summary> /// Retourne l'objet réclamé par une autre Shape. /// </summary> public Base GetClaimedComponentBy(ShapeTypeInfo _by) { for (int _i = 0; _i < ClaimedBy.Count; _i++) { if (ClaimedBy[_i] == _by) { return(ClaimedComponents[_i]); } } Type _t = _by.ClaimsComponentTo(this); if (_t == null) { return(null); } Base _newcomponent = SolutionClasses.Factory(_t.Name); ClaimedComponents.Add(_newcomponent); ClaimedBy.Add(_by); return(_newcomponent); }
public void AddShape(ShapeTypeInfo _shape) { ShapeInfos.Add(_shape); }
public void ClaimComponentToEdit(ShapeTypeInfo _toType, Type _componentType) { ClaimersForEdit.Add(new ClassClaimer(_toType.TypeName, _componentType.Name)); }
public void Accept(ShapeTypeInfo _toAccept) { AcceptedShapes.Add(_toAccept); _toAccept.AcceptedBy = this; OnAcceptShapeTypeInfo?.Invoke(this, _toAccept); }