Exemplo n.º 1
0
        // Config..

        public string[] GetConfig()
        {
            if (AssemblyMainType != null)
            {
                if (AssemblyMainType.GetType().GetMethod("EDDConfigParameters") != null)
                {
                    return(AssemblyMainType.EDDConfigParameters(new string[] { }));
                }
            }
            else if (pDll != IntPtr.Zero && pConfigParameters != IntPtr.Zero)
            {
                EDDDLLInterfaces.EDDDLLIF.EDDConfigParameters edf = (EDDDLLInterfaces.EDDDLLIF.EDDConfigParameters)Marshal.GetDelegateForFunctionPointer(
                    pConfigParameters,
                    typeof(EDDDLLInterfaces.EDDDLLIF.EDDConfigParameters));
                return(edf(new string[] { }));
            }

            return(null);
        }
Exemplo n.º 2
0
        public bool SetConfig(string[] paras)
        {
            if (AssemblyMainType != null)
            {
                if (AssemblyMainType.GetType().GetMethod("EDDConfigParameters") != null)
                {
                    var ret = AssemblyMainType.EDDConfigParameters(paras);
                    return(ret.Length > 0);
                }
            }
            else if (pDll != IntPtr.Zero && pConfigParameters != IntPtr.Zero)
            {
                EDDDLLInterfaces.EDDDLLIF.EDDConfigParameters edf = (EDDDLLInterfaces.EDDDLLIF.EDDConfigParameters)Marshal.GetDelegateForFunctionPointer(
                    pConfigParameters,
                    typeof(EDDDLLInterfaces.EDDDLLIF.EDDConfigParameters));
                var r = edf(paras);
                return(r.Length > 0);
            }

            return(false);
        }