
system.net.mail.SmtpClient Maven / Gradle / Ivy
/*
* MIT License
*
* Copyright (c) 2024 MASES s.r.l.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/**************************************************************************************
*
* This code was generated from a template using JCOReflector v. 1.15.0.0
*
* Manual changes to this file may cause unexpected behavior in your application.
* Manual changes to this file will be overwritten if the code is regenerated.
*
*************************************************************************************/
package system.net.mail;
import org.mases.jcobridge.*;
import org.mases.jcobridge.netreflection.*;
import java.util.ArrayList;
// Import section
import system.threading.tasks.Task;
import system.net.mail.MailMessage;
import system.threading.CancellationToken;
import system.net.ICredentialsByHost;
import system.net.ICredentialsByHostImplementation;
import system.net.mail.SmtpDeliveryFormat;
import system.net.mail.SmtpDeliveryMethod;
import system.net.ServicePoint;
import system.security.cryptography.x509certificates.X509CertificateCollection;
import system.net.mail.SendCompletedEventHandler;
/**
* The base .NET class managing System.Net.Mail.SmtpClient, System.Net.Mail, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51.
*
*
* .NET documentation at https://docs.microsoft.com/en-us/dotnet/api/System.Net.Mail.SmtpClient
*
*
* Powered by JCOBridge: more info at https://www.jcobridge.com
*
* @author MASES s.r.l https://masesgroup.com
* @version 1.15.0.0
*/
public class SmtpClient extends NetObject implements AutoCloseable {
/**
* Fully assembly qualified name: System.Net.Mail, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
*/
public static final String assemblyFullName = "System.Net.Mail, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51";
/**
* Assembly name: System.Net.Mail
*/
public static final String assemblyShortName = "System.Net.Mail";
/**
* Qualified class name: System.Net.Mail.SmtpClient
*/
public static final String className = "System.Net.Mail.SmtpClient";
static JCOBridge bridge = JCOBridgeInstance.getInstance(assemblyFullName);
/**
* The type managed from JCOBridge. See {@link JCType}
*/
public static JCType classType = createType();
static JCEnum enumInstance = null;
JCObject classInstance = null;
static JCType createType() {
try {
String classToCreate = className + ", "
+ (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
if (JCOReflector.getDebug())
JCOReflector.writeLog("Creating %s", classToCreate);
JCType typeCreated = bridge.GetType(classToCreate);
if (JCOReflector.getDebug())
JCOReflector.writeLog("Created: %s",
(typeCreated != null) ? typeCreated.toString() : "Returned null value");
return typeCreated;
} catch (JCException e) {
JCOReflector.writeLog(e);
return null;
}
}
void addReference(String ref) throws Throwable {
try {
bridge.AddReference(ref);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
/**
* Internal constructor. Use with caution
*/
public SmtpClient(java.lang.Object instance) throws Throwable {
super(instance);
if (instance instanceof JCObject) {
classInstance = (JCObject) instance;
} else
throw new Exception("Cannot manage object, it is not a JCObject");
}
public String getJCOAssemblyName() {
return assemblyFullName;
}
public String getJCOClassName() {
return className;
}
public String getJCOObjectName() {
return className + ", " + (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
}
public java.lang.Object getJCOInstance() {
return classInstance;
}
public void setJCOInstance(JCObject instance) {
classInstance = instance;
super.setJCOInstance(classInstance);
}
public JCType getJCOType() {
return classType;
}
/**
* Try to cast the {@link IJCOBridgeReflected} instance into {@link SmtpClient}, a cast assert is made to check if types are compatible.
* @param from {@link IJCOBridgeReflected} instance to be casted
* @return {@link SmtpClient} instance
* @throws java.lang.Throwable in case of error during cast operation
*/
public static SmtpClient cast(IJCOBridgeReflected from) throws Throwable {
NetType.AssertCast(classType, from);
return new SmtpClient(from.getJCOInstance());
}
// Constructors section
public SmtpClient() throws Throwable, system.NotSupportedException, system.ArgumentException, system.PlatformNotSupportedException, system.IndexOutOfRangeException, system.OutOfMemoryException, system.diagnostics.tracing.EventSourceException, system.ArgumentOutOfRangeException, system.InvalidOperationException, system.globalization.CultureNotFoundException {
try {
// add reference to assemblyName.dll file
addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
setJCOInstance((JCObject)classType.NewObject());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public SmtpClient(java.lang.String host, int port) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.NotSupportedException, system.ObjectDisposedException, system.RankException, system.IndexOutOfRangeException, system.OutOfMemoryException, system.diagnostics.tracing.EventSourceException {
try {
// add reference to assemblyName.dll file
addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
setJCOInstance((JCObject)classType.NewObject(host, port));
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public SmtpClient(java.lang.String host) throws Throwable, system.NotSupportedException, system.ArgumentException, system.PlatformNotSupportedException, system.IndexOutOfRangeException, system.OutOfMemoryException, system.diagnostics.tracing.EventSourceException, system.ArgumentOutOfRangeException, system.InvalidOperationException, system.globalization.CultureNotFoundException {
try {
// add reference to assemblyName.dll file
addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
setJCOInstance((JCObject)classType.NewObject(host));
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
// Methods section
public Task SendMailAsync(MailMessage message, CancellationToken cancellationToken) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.PlatformNotSupportedException, system.NotSupportedException, system.ObjectDisposedException, system.InvalidOperationException, system.RankException, system.ArrayTypeMismatchException, system.NullReferenceException, system.ArgumentNullException, system.MulticastNotSupportedException, system.net.mail.SmtpException, system.OutOfMemoryException, system.FormatException, system.globalization.CultureNotFoundException, system.runtime.serialization.SerializationException, system.diagnostics.UnreachableException, system.OverflowException, system.NotImplementedException, system.threading.AbandonedMutexException, system.net.sockets.SocketException, system.security.SecurityException, system.threading.tasks.TaskSchedulerException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
JCObject objSendMailAsync = (JCObject)classInstance.Invoke("SendMailAsync", message == null ? null : message.getJCOInstance(), cancellationToken == null ? null : cancellationToken.getJCOInstance());
return new Task(objSendMailAsync);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public Task SendMailAsync(MailMessage message) throws Throwable, system.ArgumentException, system.NotSupportedException, system.InvalidOperationException, system.ArgumentOutOfRangeException, system.PlatformNotSupportedException, system.NullReferenceException, system.ArgumentNullException, system.IndexOutOfRangeException, system.MulticastNotSupportedException, system.ObjectDisposedException, system.net.mail.SmtpException, system.OutOfMemoryException, system.FormatException, system.diagnostics.UnreachableException, system.OverflowException, system.NotImplementedException, system.ArrayTypeMismatchException, system.net.sockets.SocketException, system.security.SecurityException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
JCObject objSendMailAsync = (JCObject)classInstance.Invoke("SendMailAsync", message == null ? null : message.getJCOInstance());
return new Task(objSendMailAsync);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public Task SendMailAsync(java.lang.String from, java.lang.String recipients, java.lang.String subject, java.lang.String body, CancellationToken cancellationToken) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.NotSupportedException, system.ArgumentOutOfRangeException, system.FormatException, system.PlatformNotSupportedException, system.IndexOutOfRangeException, system.OutOfMemoryException, system.diagnostics.tracing.EventSourceException, system.InvalidOperationException, system.NullReferenceException, system.MulticastNotSupportedException, system.ObjectDisposedException, system.net.mail.SmtpException, system.diagnostics.UnreachableException, system.OverflowException, system.NotImplementedException, system.net.sockets.SocketException, system.security.SecurityException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
JCObject objSendMailAsync = (JCObject)classInstance.Invoke("SendMailAsync", from, recipients, subject, body, cancellationToken == null ? null : cancellationToken.getJCOInstance());
return new Task(objSendMailAsync);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public Task SendMailAsync(java.lang.String from, java.lang.String recipients, java.lang.String subject, java.lang.String body) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.NotSupportedException, system.ArgumentOutOfRangeException, system.FormatException, system.PlatformNotSupportedException, system.IndexOutOfRangeException, system.OutOfMemoryException, system.diagnostics.tracing.EventSourceException, system.InvalidOperationException, system.NullReferenceException, system.MulticastNotSupportedException, system.ObjectDisposedException, system.net.mail.SmtpException, system.diagnostics.UnreachableException, system.OverflowException, system.NotImplementedException, system.net.sockets.SocketException, system.security.SecurityException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
JCObject objSendMailAsync = (JCObject)classInstance.Invoke("SendMailAsync", from, recipients, subject, body);
return new Task(objSendMailAsync);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void Dispose() throws Throwable, system.NotSupportedException, system.ArgumentException, system.InvalidOperationException, system.PlatformNotSupportedException, system.threading.LockRecursionException, system.threading.AbandonedMutexException, system.threading.SynchronizationLockException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Invoke("Dispose");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void Send(MailMessage message) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.PlatformNotSupportedException, system.NotSupportedException, system.ObjectDisposedException, system.InvalidOperationException, system.RankException, system.ArrayTypeMismatchException, system.ArgumentNullException, system.OutOfMemoryException, system.FormatException, system.diagnostics.tracing.EventSourceException, system.threading.LockRecursionException, system.net.mail.SmtpException, system.MissingMethodException, system.reflection.TargetInvocationException, system.runtime.serialization.SerializationException, system.net.sockets.SocketException, system.io.IOException, system.diagnostics.UnreachableException, system.OverflowException, system.NotImplementedException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Invoke("Send", message == null ? null : message.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void Send(java.lang.String from, java.lang.String recipients, java.lang.String subject, java.lang.String body) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.PlatformNotSupportedException, system.NotSupportedException, system.ObjectDisposedException, system.InvalidOperationException, system.RankException, system.ArrayTypeMismatchException, system.FormatException, system.IndexOutOfRangeException, system.OutOfMemoryException, system.diagnostics.tracing.EventSourceException, system.net.sockets.SocketException, system.threading.SynchronizationLockException, system.net.mail.SmtpException, system.globalization.CultureNotFoundException, system.runtime.serialization.SerializationException, system.io.IOException, system.ArgumentNullException, system.diagnostics.UnreachableException, system.OverflowException, system.NotImplementedException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Invoke("Send", from, recipients, subject, body);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void SendAsync(MailMessage message, NetObject userToken) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.PlatformNotSupportedException, system.NotSupportedException, system.ObjectDisposedException, system.InvalidOperationException, system.RankException, system.ArrayTypeMismatchException, system.net.mail.SmtpException, system.IndexOutOfRangeException, system.OutOfMemoryException, system.FormatException, system.diagnostics.tracing.EventSourceException, system.MissingMethodException, system.reflection.TargetInvocationException, system.runtime.serialization.SerializationException, system.diagnostics.UnreachableException, system.OverflowException, system.NotImplementedException, system.ArgumentNullException, system.threading.AbandonedMutexException, system.net.sockets.SocketException, system.io.IOException, system.security.SecurityException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Invoke("SendAsync", message == null ? null : message.getJCOInstance(), userToken == null ? null : userToken.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void SendAsync(java.lang.String from, java.lang.String recipients, java.lang.String subject, java.lang.String body, NetObject userToken) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.PlatformNotSupportedException, system.NotSupportedException, system.ObjectDisposedException, system.InvalidOperationException, system.RankException, system.ArrayTypeMismatchException, system.FormatException, system.IndexOutOfRangeException, system.OutOfMemoryException, system.diagnostics.tracing.EventSourceException, system.net.mail.SmtpException, system.globalization.CultureNotFoundException, system.runtime.serialization.SerializationException, system.diagnostics.UnreachableException, system.OverflowException, system.NotImplementedException, system.threading.AbandonedMutexException, system.net.sockets.SocketException, system.security.SecurityException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Invoke("SendAsync", from, recipients, subject, body, userToken == null ? null : userToken.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void SendAsyncCancel() throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.PlatformNotSupportedException, system.NotSupportedException, system.ObjectDisposedException, system.InvalidOperationException, system.RankException, system.ArrayTypeMismatchException, system.NullReferenceException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Invoke("SendAsyncCancel");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void close() throws Exception {
try {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Invoke("Dispose");
}
catch (JCNativeException jcne) {
throw translateException(jcne);
}
} catch (Throwable t) {
throw new Exception(t);
}
}
// Properties section
public boolean getEnableSsl() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (boolean)classInstance.Get("EnableSsl");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setEnableSsl(boolean EnableSsl) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("EnableSsl", EnableSsl);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public boolean getUseDefaultCredentials() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (boolean)classInstance.Get("UseDefaultCredentials");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setUseDefaultCredentials(boolean UseDefaultCredentials) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.PlatformNotSupportedException, system.ArgumentOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.InvalidOperationException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("UseDefaultCredentials", UseDefaultCredentials);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public int getPort() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (int)classInstance.Get("Port");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setPort(int Port) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.PlatformNotSupportedException, system.ArgumentOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.InvalidOperationException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("Port", Port);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public int getTimeout() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (int)classInstance.Get("Timeout");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setTimeout(int Timeout) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.PlatformNotSupportedException, system.ArgumentOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.InvalidOperationException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("Timeout", Timeout);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public ICredentialsByHost getCredentials() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
JCObject val = (JCObject)classInstance.Get("Credentials");
return new ICredentialsByHostImplementation(val);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setCredentials(ICredentialsByHost Credentials) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.PlatformNotSupportedException, system.ArgumentOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.InvalidOperationException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("Credentials", Credentials == null ? null : Credentials.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public SmtpDeliveryFormat getDeliveryFormat() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
JCObject val = (JCObject)classInstance.Get("DeliveryFormat");
return new SmtpDeliveryFormat(val);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setDeliveryFormat(SmtpDeliveryFormat DeliveryFormat) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("DeliveryFormat", DeliveryFormat == null ? null : DeliveryFormat.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public SmtpDeliveryMethod getDeliveryMethod() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
JCObject val = (JCObject)classInstance.Get("DeliveryMethod");
return new SmtpDeliveryMethod(val);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setDeliveryMethod(SmtpDeliveryMethod DeliveryMethod) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("DeliveryMethod", DeliveryMethod == null ? null : DeliveryMethod.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public ServicePoint getServicePoint() throws Throwable, system.ArgumentNullException, system.ArgumentException, system.PlatformNotSupportedException, system.ArgumentOutOfRangeException, system.globalization.CultureNotFoundException, system.NotSupportedException, system.InvalidOperationException, system.ObjectDisposedException, system.OverflowException, system.IndexOutOfRangeException, system.FormatException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException, system.diagnostics.UnreachableException, system.UriFormatException, system.InvalidTimeZoneException, system.RankException, system.ArrayTypeMismatchException, system.InvalidCastException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
JCObject val = (JCObject)classInstance.Get("ServicePoint");
return new ServicePoint(val);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public X509CertificateCollection getClientCertificates() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
JCObject val = (JCObject)classInstance.Get("ClientCertificates");
return new X509CertificateCollection(val);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public java.lang.String getHost() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (java.lang.String)classInstance.Get("Host");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setHost(java.lang.String Host) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.PlatformNotSupportedException, system.ArgumentOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.InvalidOperationException, system.IndexOutOfRangeException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("Host", Host);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public java.lang.String getPickupDirectoryLocation() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (java.lang.String)classInstance.Get("PickupDirectoryLocation");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setPickupDirectoryLocation(java.lang.String PickupDirectoryLocation) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("PickupDirectoryLocation", PickupDirectoryLocation);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public java.lang.String getTargetName() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (java.lang.String)classInstance.Get("TargetName");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setTargetName(java.lang.String TargetName) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("TargetName", TargetName);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
// Instance Events section
public void addSendCompleted(SendCompletedEventHandler handler) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.RegisterEventListener("SendCompleted", handler);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void removeSendCompleted(SendCompletedEventHandler handler) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.UnregisterEventListener("SendCompleted", handler);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
}