All Downloads are FREE. Search and download functionalities are using the official Maven repository.

system.reflection.AssemblyName 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.14.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.reflection;

import org.mases.jcobridge.*;
import org.mases.jcobridge.netreflection.*;
import java.util.ArrayList;

// Import section
import system.reflection.AssemblyName;
import system.runtime.serialization.SerializationInfo;
import system.runtime.serialization.StreamingContext;
import system.Guid;
import system.UInt32;
import system.configuration.assemblies.AssemblyHashAlgorithm;
import system.configuration.assemblies.AssemblyVersionCompatibility;
import system.globalization.CultureInfo;
import system.reflection.AssemblyContentType;
import system.reflection.AssemblyNameFlags;
import system.reflection.ProcessorArchitecture;
import system.reflection.StrongNameKeyPair;
import system.Version;


/**
 * The base .NET class managing System.Reflection.AssemblyName, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
 * 

* * .NET documentation at https://docs.microsoft.com/en-us/dotnet/api/System.Reflection.AssemblyName *

* * Powered by JCOBridge: more info at https://www.jcobridge.com * * @author MASES s.r.l https://masesgroup.com * @version 1.14.0.0 */ public class AssemblyName extends NetObject { /** * Fully assembly qualified name: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 */ public static final String assemblyFullName = "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; /** * Assembly name: mscorlib */ public static final String assemblyShortName = "mscorlib"; /** * Qualified class name: System.Reflection.AssemblyName */ public static final String className = "System.Reflection.AssemblyName"; 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 AssemblyName(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 AssemblyName}, a cast assert is made to check if types are compatible. * @param from {@link IJCOBridgeReflected} instance to be casted * @return {@link AssemblyName} instance * @throws java.lang.Throwable in case of error during cast operation */ public static AssemblyName cast(IJCOBridgeReflected from) throws Throwable { NetType.AssertCast(classType, from); return new AssemblyName(from.getJCOInstance()); } // Constructors section public AssemblyName() throws Throwable { try { // add reference to assemblyName.dll file addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); setJCOInstance((JCObject)classType.NewObject()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public AssemblyName(java.lang.String assemblyName) throws Throwable, system.ArgumentNullException, system.ArgumentException { try { // add reference to assemblyName.dll file addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); setJCOInstance((JCObject)classType.NewObject(assemblyName)); } catch (JCNativeException jcne) { throw translateException(jcne); } } // Methods section public static boolean ReferenceMatchesDefinition(AssemblyName reference, AssemblyName definition) throws Throwable { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { return (boolean)classType.Invoke("ReferenceMatchesDefinition", reference == null ? null : reference.getJCOInstance(), definition == null ? null : definition.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public byte[] GetPublicKey() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { ArrayList resultingArrayList = new ArrayList(); JCObject resultingObjects = (JCObject)classInstance.Invoke("GetPublicKey"); for (java.lang.Object resultingObject : resultingObjects) { resultingArrayList.add(resultingObject); } byte[] resultingArray = new byte[resultingArrayList.size()]; for(int indexGetPublicKey = 0; indexGetPublicKey < resultingArrayList.size(); indexGetPublicKey++ ) { resultingArray[indexGetPublicKey] = (byte)resultingArrayList.get(indexGetPublicKey); } return resultingArray; } catch (JCNativeException jcne) { throw translateException(jcne); } } public byte[] GetPublicKeyToken() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { ArrayList resultingArrayList = new ArrayList(); JCObject resultingObjects = (JCObject)classInstance.Invoke("GetPublicKeyToken"); for (java.lang.Object resultingObject : resultingObjects) { resultingArrayList.add(resultingObject); } byte[] resultingArray = new byte[resultingArrayList.size()]; for(int indexGetPublicKeyToken = 0; indexGetPublicKeyToken < resultingArrayList.size(); indexGetPublicKeyToken++ ) { resultingArray[indexGetPublicKeyToken] = (byte)resultingArrayList.get(indexGetPublicKeyToken); } return resultingArray; } catch (JCNativeException jcne) { throw translateException(jcne); } } public NetObject Clone() throws Throwable, system.ArgumentNullException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject objClone = (JCObject)classInstance.Invoke("Clone"); return new NetObject(objClone); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static AssemblyName GetAssemblyName(java.lang.String assemblyFile) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.io.PathTooLongException, system.ArgumentOutOfRangeException, system.OutOfMemoryException, system.IndexOutOfRangeException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objGetAssemblyName = (JCObject)classType.Invoke("GetAssemblyName", assemblyFile); return new AssemblyName(objGetAssemblyName); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void GetObjectData(SerializationInfo info, StreamingContext context) throws Throwable, system.ArgumentNullException, system.runtime.serialization.SerializationException, system.ArgumentException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Invoke("GetObjectData", info == null ? null : info.getJCOInstance(), context == null ? null : context.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void OnDeserialization(NetObject sender) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.ArgumentOutOfRangeException, system.FormatException, system.runtime.serialization.SerializationException, system.globalization.CultureNotFoundException, system.NotSupportedException, system.IndexOutOfRangeException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Invoke("OnDeserialization", sender == null ? null : sender.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void SetPublicKey(byte[] publicKey) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Invoke("SetPublicKey", (java.lang.Object)publicKey); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void SetPublicKey(JCORefOut dupParam0) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Invoke("SetPublicKey", (java.lang.Object)dupParam0.getJCRefOut()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void SetPublicKeyToken(byte[] publicKeyToken) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Invoke("SetPublicKeyToken", (java.lang.Object)publicKeyToken); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void SetPublicKeyToken(JCORefOut dupParam0) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Invoke("SetPublicKeyToken", (java.lang.Object)dupParam0.getJCRefOut()); } catch (JCNativeException jcne) { throw translateException(jcne); } } /** * @deprecated Not for public use because the method is implemented in .NET with an explicit interface. * Use the static To_AssemblyName method available in _AssemblyName to obtain an object with an invocable method */ @Deprecated public void GetTypeInfoCount(JCORefOut pcTInfo) throws Throwable { throw new UnsupportedOperationException("Not for public use because the method is implemented with an explicit interface. Use To_AssemblyName to obtain the full interface."); } // Properties section public AssemblyHashAlgorithm getHashAlgorithm() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject val = (JCObject)classInstance.Get("HashAlgorithm"); return new AssemblyHashAlgorithm(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void setHashAlgorithm(AssemblyHashAlgorithm HashAlgorithm) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Set("HashAlgorithm", HashAlgorithm == null ? null : HashAlgorithm.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public AssemblyVersionCompatibility getVersionCompatibility() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject val = (JCObject)classInstance.Get("VersionCompatibility"); return new AssemblyVersionCompatibility(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void setVersionCompatibility(AssemblyVersionCompatibility VersionCompatibility) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Set("VersionCompatibility", VersionCompatibility == null ? null : VersionCompatibility.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public CultureInfo getCultureInfo() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject val = (JCObject)classInstance.Get("CultureInfo"); return new CultureInfo(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void setCultureInfo(CultureInfo CultureInfo) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Set("CultureInfo", CultureInfo == null ? null : CultureInfo.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public AssemblyContentType getContentType() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject val = (JCObject)classInstance.Get("ContentType"); return new AssemblyContentType(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void setContentType(AssemblyContentType ContentType) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Set("ContentType", ContentType == null ? null : ContentType.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public AssemblyNameFlags getFlags() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject val = (JCObject)classInstance.Get("Flags"); return new AssemblyNameFlags(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void setFlags(AssemblyNameFlags Flags) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Set("Flags", Flags == null ? null : Flags.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public ProcessorArchitecture getProcessorArchitecture() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject val = (JCObject)classInstance.Get("ProcessorArchitecture"); return new ProcessorArchitecture(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void setProcessorArchitecture(ProcessorArchitecture ProcessorArchitecture) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Set("ProcessorArchitecture", ProcessorArchitecture == null ? null : ProcessorArchitecture.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public StrongNameKeyPair getKeyPair() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject val = (JCObject)classInstance.Get("KeyPair"); return new StrongNameKeyPair(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void setKeyPair(StrongNameKeyPair KeyPair) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Set("KeyPair", KeyPair == null ? null : KeyPair.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public java.lang.String getCodeBase() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (java.lang.String)classInstance.Get("CodeBase"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void setCodeBase(java.lang.String CodeBase) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Set("CodeBase", CodeBase); } catch (JCNativeException jcne) { throw translateException(jcne); } } public java.lang.String getCultureName() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (java.lang.String)classInstance.Get("CultureName"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void setCultureName(java.lang.String CultureName) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.globalization.CultureNotFoundException, system.InvalidOperationException, system.NotSupportedException, system.NullReferenceException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Set("CultureName", CultureName); } catch (JCNativeException jcne) { throw translateException(jcne); } } public java.lang.String getEscapedCodeBase() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (java.lang.String)classInstance.Get("EscapedCodeBase"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public java.lang.String getFullName() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (java.lang.String)classInstance.Get("FullName"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public java.lang.String getName() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (java.lang.String)classInstance.Get("Name"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void setName(java.lang.String Name) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Set("Name", Name); } catch (JCNativeException jcne) { throw translateException(jcne); } } public Version getVersion() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject val = (JCObject)classInstance.Get("Version"); return new Version(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void setVersion(Version Version) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Set("Version", Version == null ? null : Version.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } // Instance Events section }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy