private void Implement(IInterfaceImplementer parent, Operation operation, bool mustExplicit) { if (parent == null || operation == null) { return; } Operation defined = parent.GetDefinedOperation(operation); if (!operation.Language.SupportsExplicitImplementation) { mustExplicit = false; } if (defined == null) { Operation implemented = parent.Implement(operation, mustExplicit); AddOperationToList(implemented); checkAddMethod(implemented); } else if (defined.Type != operation.Type) { Operation implemented = parent.Implement(operation, true); AddOperationToList(implemented); checkAddMethod(implemented); } }
private void AddOperations(IInterfaceImplementer implementer, InterfaceType _interface, TreeNode node) { if ((implementer == null) || (_interface == null) || (node == null)) { return; } foreach (InterfaceType baseInterface in _interface.Bases) { AddOperations(implementer, baseInterface, node); } foreach (Operation operation in _interface.Operations) { Operation defined = implementer.GetDefinedOperation(operation); if (defined == null) { CreateOperationNode(node, operation); } else if ((defined.Type != operation.Type) && _interface.Language.SupportsExplicitImplementation) { TreeNode operationNode = CreateOperationNode(node, operation); operationNode.ForeColor = Color.Gray; } } }
private void toolImplementList_Click(object sender, EventArgs e) { IInterfaceImplementer type = Shape.CompositeType as IInterfaceImplementer; if (type != null) { using (ImplementDialog dialog = new ImplementDialog()) { if (dialog.ShowDialog(type) == DialogResult.OK) { foreach (Operation operation in dialog.GetSelectedOperations()) { Operation defined = type.GetDefinedOperation(operation); bool implementExplicitly = dialog.ImplementExplicitly && type.Language.SupportsExplicitImplementation; if (defined == null) { type.Implement(operation, implementExplicitly); } else if (defined.Type != operation.Type) { type.Implement(operation, true); } } } } } }
private void AddInterface(IInterfaceImplementer implementer, InterfaceType _interface) { if (implementer == null || _interface == null) return; TreeNode node = CreateInterfaceNode(_interface.Name); AddOperations(implementer, _interface, node); }
private void AddInterface(IInterfaceImplementer implementer, InterfaceType _interface) { if ((implementer == null) || (_interface == null)) { return; } TreeNode node = CreateInterfaceNode(_interface.Name); AddOperations(implementer, _interface, node); }
public DialogResult ShowDialog(IInterfaceImplementer implementer) { if (implementer == null) return DialogResult.None; chkImplementExplicitly.Checked = false; chkImplementExplicitly.Visible = (implementer.Language.SupportsExplicitImplementation); OperationTree.Nodes.Clear(); foreach (InterfaceType _interface in implementer.Interfaces) AddInterface(implementer, _interface); RemoveEmptyNodes(); return ShowDialog(); }
protected virtual void RefreshToolAvailability() { toolOverrideList.Visible = Shape.CompositeType is SingleInharitanceType; IInterfaceImplementer implementer = Shape.CompositeType as IInterfaceImplementer; if (implementer != null) { toolImplementList.Visible = true; toolImplementList.Enabled = implementer.ImplementsInterface; } else { toolImplementList.Visible = false; } }
public DialogResult ShowDialog(IInterfaceImplementer implementer) { if (implementer == null) { return(DialogResult.None); } chkImplementExplicitly.Checked = false; chkImplementExplicitly.Visible = implementer.Language.SupportsExplicitImplementation; OperationTree.Nodes.Clear( ); foreach (InterfaceType _interface in implementer.Interfaces) { AddInterface(implementer, _interface); } RemoveEmptyNodes( ); return(ShowDialog( )); }
private void Implement(IInterfaceImplementer parent, Operation operation, bool mustExplicit) { var defined = parent.GetDefinedOperation(operation); if (!operation.Language.SupportsExplicitImplementation) { mustExplicit = false; } if (defined == null) { var implemented = parent.Implement(operation, mustExplicit); AddOperationToList(implemented); } else if (defined.Type != operation.Type) { var implemented = parent.Implement(operation, true); AddOperationToList(implemented); } }
private void AddOperations(IInterfaceImplementer implementer, InterfaceType _interface, TreeNode node) { if (implementer == null || _interface == null || node == null) return; foreach (InterfaceType baseInterface in _interface.Bases) AddOperations(implementer, baseInterface, node); foreach (Operation operation in _interface.Operations) { Operation defined = implementer.GetDefinedOperation(operation); if (defined == null) { CreateOperationNode(node, operation); } else if (defined.Type != operation.Type && _interface.Language.SupportsExplicitImplementation) { TreeNode operationNode = CreateOperationNode(node, operation); operationNode.ForeColor = Color.Gray; } } }
private void Implement(IInterfaceImplementer parent, Operation operation, bool mustExplicit) { Operation defined = parent.GetDefinedOperation(operation); if (!operation.Language.SupportsExplicitImplementation) mustExplicit = false; if (defined == null) { Operation implemented = parent.Implement(operation, mustExplicit); AddOperationToList(implemented); } else if (defined.Type != operation.Type) { Operation implemented = parent.Implement(operation, true); AddOperationToList(implemented); } }