コード例 #1
0
		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);
							}
						}
					}
				}
			}
		}
コード例 #2
0
 private void toolImplementList_Click(object sender, EventArgs e)
 {
     if (parent is IInterfaceImplementer && Validate())
     {
         using (ImplementDialog dialog = new ImplementDialog())
         {
             if (dialog.ShowDialog(parent as IInterfaceImplementer) == DialogResult.OK)
             {
                 foreach (Operation operation in dialog.GetSelectedOperations())
                 {
                     Implement((IInterfaceImplementer)parent, operation,
                         dialog.ImplementExplicitly);
                 }
                 OnValueChanged(lstMembers);
             }
         }
     }
 }