本文整理汇总了C#中DG类的典型用法代码示例。如果您正苦于以下问题:C# DG类的具体用法?C# DG怎么用?C# DG使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DG类属于命名空间,在下文中一共展示了DG类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: checkDelegate
static internal int checkDelegate(IntPtr l,int p,out DG.Tweening.Core.DOSetter<UnityEngine.Color> ua) {
int op = extractFunction(l,p);
if(LuaDLL.lua_isnil(l,p)) {
ua=null;
return op;
}
else if (LuaDLL.lua_isuserdata(l, p)==1)
{
ua = (DG.Tweening.Core.DOSetter<UnityEngine.Color>)checkObj(l, p);
return op;
}
LuaDelegate ld;
checkType(l, -1, out ld);
if(ld.d!=null)
{
ua = (DG.Tweening.Core.DOSetter<UnityEngine.Color>)ld.d;
return op;
}
LuaDLL.lua_pop(l,1);
l = LuaState.get(l).L;
ua = (UnityEngine.Color a1) =>
{
int error = pushTry(l);
pushValue(l,a1);
ld.pcall(1, error);
LuaDLL.lua_settop(l, error-1);
};
ld.d=ua;
return op;
}
开发者ID:xclouder,项目名称:godbattle,代码行数:32,代码来源:LuaDG_Tweening_Core_DOSetter_1_UnityEngine_Color.cs
示例2: checkDelegate
static internal int checkDelegate(IntPtr l,int p,out DG.Tweening.Core.DOGetter<System.Single> ua) {
int op = extractFunction(l,p);
if(LuaDLL.lua_isnil(l,p)) {
ua=null;
return op;
}
else if (LuaDLL.lua_isuserdata(l, p)==1)
{
ua = (DG.Tweening.Core.DOGetter<System.Single>)checkObj(l, p);
return op;
}
LuaDelegate ld;
checkType(l, -1, out ld);
if(ld.d!=null)
{
ua = (DG.Tweening.Core.DOGetter<System.Single>)ld.d;
return op;
}
LuaDLL.lua_pop(l,1);
l = LuaState.get(l).L;
ua = () =>
{
int error = pushTry(l);
ld.pcall(0, error);
float ret;
checkType(l,error+1,out ret);
LuaDLL.lua_settop(l, error-1);
return ret;
};
ld.d=ua;
return op;
}
开发者ID:xclouder,项目名称:godbattle,代码行数:34,代码来源:LuaDG_Tweening_Core_DOGetter_1_float.cs
示例3: checkDelegate
static internal int checkDelegate(IntPtr l,int p,out DG.Tweening.EaseFunction ua) {
int op = extractFunction(l,p);
if(LuaDLL.lua_isnil(l,p)) {
ua=null;
return op;
}
else if (LuaDLL.lua_isuserdata(l, p)==1)
{
ua = (DG.Tweening.EaseFunction)checkObj(l, p);
return op;
}
LuaDelegate ld;
checkType(l, -1, out ld);
if(ld.d!=null)
{
ua = (DG.Tweening.EaseFunction)ld.d;
return op;
}
LuaDLL.lua_pop(l,1);
l = LuaState.get(l).L;
ua = (float a1,float a2,float a3,float a4) =>
{
int error = pushTry(l);
pushValue(l,a1);
pushValue(l,a2);
pushValue(l,a3);
pushValue(l,a4);
ld.pcall(4, error);
float ret;
checkType(l,error+1,out ret);
LuaDLL.lua_settop(l, error-1);
return ret;
};
ld.d=ua;
return op;
}
开发者ID:xclouder,项目名称:godbattle,代码行数:38,代码来源:LuaDelegate_DG_Tweening_EaseFunction.cs
示例4: DatImagenativexfer
public STS DatImagenativexfer(DG a_dg, MSG a_msg, ref Bitmap a_bitmap)
{
STS sts;
IntPtr intptrBitmap = IntPtr.Zero;
// Submit the work to the TWAIN thread...
if (this.m_runinuithreaddelegate == null)
{
if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId))
{
lock (m_lockTwain)
{
// Set our command variables...
ThreadData threaddata = default(ThreadData);
threaddata.bitmap = a_bitmap;
threaddata.dg = a_dg;
threaddata.msg = a_msg;
threaddata.dat = DAT.IMAGENATIVEXFER;
long lIndex = m_twaincommand.Submit(threaddata);
// Submit the command and wait for the reply...
CallerToThreadSet();
ThreadToCallerWaitOne();
// Return the result...
a_bitmap = m_twaincommand.Get(lIndex).bitmap;
sts = m_twaincommand.Get(lIndex).sts;
// Clear the command variables...
m_twaincommand.Delete(lIndex);
}
return (sts);
}
}
// Log it...
if (Log.GetLevel() > 0)
{
Log.LogSendBefore(a_dg.ToString(), DAT.IMAGENATIVEXFER.ToString(), a_msg.ToString(), "");
}
// Windows...
if (ms_platform == Platform.WINDOWS)
{
// Issue the command...
try
{
if (m_blUseLegacyDSM)
{
}
else
{
}
if (this.m_runinuithreaddelegate == null)
{
if (m_blUseLegacyDSM)
{
sts = (STS)WindowsTwain32DsmEntryImagenativexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGENATIVEXFER, a_msg, ref intptrBitmap);
}
else
{
sts = (STS)WindowsTwaindsmDsmEntryImagenativexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGENATIVEXFER, a_msg, ref intptrBitmap);
}
}
else
{
if (m_blUseLegacyDSM)
{
lock (m_lockTwain)
{
ThreadData threaddata = default(ThreadData);
threaddata.intptrBitmap = IntPtr.Zero;
threaddata.dg = a_dg;
threaddata.msg = a_msg;
threaddata.dat = DAT.IMAGENATIVEXFER;
m_lIndexDatImagenativexfer = m_twaincommand.Submit(threaddata);
RunInUiThread(DatImagenativexferWindowsTwain32);
intptrBitmap = m_twaincommand.Get(m_lIndexDatImagenativexfer).intptrBitmap;
sts = m_twaincommand.Get(m_lIndexDatImagenativexfer).sts;
m_twaincommand.Delete(m_lIndexDatImagenativexfer);
}
}
else
{
lock (m_lockTwain)
{
ThreadData threaddata = default(ThreadData);
threaddata.intptrBitmap = IntPtr.Zero;
threaddata.dg = a_dg;
threaddata.msg = a_msg;
threaddata.dat = DAT.IMAGENATIVEXFER;
m_lIndexDatImagenativexfer = m_twaincommand.Submit(threaddata);
RunInUiThread(DatImagenativexferWindowsTwainDsm);
intptrBitmap = m_twaincommand.Get(m_lIndexDatImagenativexfer).intptrBitmap;
sts = m_twaincommand.Get(m_lIndexDatImagenativexfer).sts;
m_twaincommand.Delete(m_lIndexDatImagenativexfer);
}
}
}
}
//.........这里部分代码省略.........
开发者ID:mrsalustiano,项目名称:VS_C,代码行数:101,代码来源:TWAIN.cs
示例5: DatImagememxfer
public STS DatImagememxfer(DG a_dg, MSG a_msg, ref TW_IMAGEMEMXFER a_twimagememxfer)
{
STS sts;
// Submit the work to the TWAIN thread...
if (this.m_runinuithreaddelegate == null)
{
if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId))
{
lock (m_lockTwain)
{
// Set our command variables...
ThreadData threaddata = default(ThreadData);
threaddata.twimagememxfer = a_twimagememxfer;
threaddata.dg = a_dg;
threaddata.msg = a_msg;
threaddata.dat = DAT.IMAGEMEMXFER;
m_lIndexDatImagememxfer = m_twaincommand.Submit(threaddata);
// Submit the command and wait for the reply...
CallerToThreadSet();
ThreadToCallerWaitOne();
// Return the result...
a_twimagememxfer = m_twaincommand.Get(m_lIndexDatImagememxfer).twimagememxfer;
sts = m_twaincommand.Get(m_lIndexDatImagememxfer).sts;
// Clear the command variables...
m_twaincommand.Delete(m_lIndexDatImagememxfer);
}
return (sts);
}
}
// Log it...
if (Log.GetLevel() > 0)
{
Log.LogSendBefore(a_dg.ToString(), DAT.IMAGEMEMXFER.ToString(), a_msg.ToString(), ImagememferToCsv(a_twimagememxfer));
}
// Windows...
if (ms_platform == Platform.WINDOWS)
{
// Issue the command...
try
{
if (this.m_runinuithreaddelegate == null)
{
if (m_blUseLegacyDSM)
{
sts = (STS)WindowsTwain32DsmEntryImagememxfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGEMEMXFER, a_msg, ref a_twimagememxfer);
}
else
{
sts = (STS)WindowsTwaindsmDsmEntryImagememxfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGEMEMXFER, a_msg, ref a_twimagememxfer);
}
}
else
{
if (m_blUseLegacyDSM)
{
lock (m_lockTwain)
{
ThreadData threaddata = default(ThreadData);
threaddata.twimagememxfer = a_twimagememxfer;
threaddata.dg = a_dg;
threaddata.msg = a_msg;
threaddata.dat = DAT.IMAGEMEMXFER;
m_lIndexDatImagememxfer = m_twaincommand.Submit(threaddata);
RunInUiThread(DatImagememxferWindowsTwain32);
a_twimagememxfer = m_twaincommand.Get(m_lIndexDatImagememxfer).twimagememxfer;
sts = m_twaincommand.Get(m_lIndexDatImagememxfer).sts;
m_twaincommand.Delete(m_lIndexDatImagememxfer);
}
}
else
{
lock (m_lockTwain)
{
ThreadData threaddata = default(ThreadData);
threaddata.twimagememxfer = a_twimagememxfer;
threaddata.dg = a_dg;
threaddata.msg = a_msg;
threaddata.dat = DAT.IMAGEMEMXFER;
m_lIndexDatImagememxfer = m_twaincommand.Submit(threaddata);
RunInUiThread(DatImagememxferWindowsTwainDsm);
a_twimagememxfer = m_twaincommand.Get(m_lIndexDatImagememxfer).twimagememxfer;
sts = m_twaincommand.Get(m_lIndexDatImagememxfer).sts;
m_twaincommand.Delete(m_lIndexDatImagememxfer);
}
}
}
}
catch
{
// The driver crashed...
Log.LogSendAfter(STS.BUMMER.ToString(), "");
return (STS.BUMMER);
}
}
//.........这里部分代码省略.........
开发者ID:mrsalustiano,项目名称:VS_C,代码行数:101,代码来源:TWAIN.cs
示例6:
private static extern UInt16 Linux64DsmEntryJpegcompression
(
ref TW_IDENTITY origin,
ref TW_IDENTITY dest,
DG dg,
DAT dat,
MSG msg,
ref TW_JPEGCOMPRESSION twjpegcompression
);
开发者ID:mrsalustiano,项目名称:VS_C,代码行数:9,代码来源:TWAINH.cs
示例7: EmitDOTweenScaleFor
void EmitDOTweenScaleFor(Transform t, Vector3 to, float twDuration, DG.Tweening.Ease ease)
{
t.localScale = Vector3.one;
t.DOScale(to, twDuration).SetEase(ease).OnComplete(()=> EmitDOTweenScaleFor(t, to, twDuration, ease));
}
开发者ID:Grogal,项目名称:dotween,代码行数:5,代码来源:TweenEnginesComparisonInternal.cs
示例8: EmitDOTweenPositionFor
void EmitDOTweenPositionFor(Transform t, Vector3 to, float twDuration, DG.Tweening.Ease ease)
{
t.position = Vector3.zero;
t.DOMove(to, twDuration).SetEase(ease).OnComplete(()=> EmitDOTweenPositionFor(t, to, twDuration, ease));
}
开发者ID:Grogal,项目名称:dotween,代码行数:5,代码来源:TweenEnginesComparisonInternal.cs
示例9: ProcessEvent
/// <summary>
/// Our callback delegate for Linux...
/// </summary>
/// <param name="origin">Origin of message</param>
/// <param name="dest">Message target</param>
/// <param name="dg">Data group</param>
/// <param name="dat">Data argument type</param>
/// <param name="msg">Operation</param>
/// <param name="twnull">NULL pointer</param>
/// <returns>TWAIN status</returns>
private UInt16 LinuxDsmEntryCallbackProxy
(
ref TW_IDENTITY_LEGACY origin,
ref TW_IDENTITY_LEGACY dest,
DG dg,
DAT dat,
MSG msg,
IntPtr twnull
)
{
ProcessEvent(msg);
return ((UInt16)STS.SUCCESS);
}
开发者ID:mrsalustiano,项目名称:VS_C,代码行数:23,代码来源:TWAIN.cs
示例10: DatUserinterface
public STS DatUserinterface(DG a_dg, MSG a_msg, ref TW_USERINTERFACE a_twuserinterface)
{
STS sts;
// Submit the work to the TWAIN thread...
if (this.m_runinuithreaddelegate == null)
{
if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId))
{
lock (m_lockTwain)
{
// Set our command variables...
ThreadData threaddata = default(ThreadData);
threaddata.twuserinterface = a_twuserinterface;
threaddata.twuserinterface.hParent = m_intptrHwnd;
threaddata.dg = a_dg;
threaddata.msg = a_msg;
threaddata.dat = DAT.USERINTERFACE;
m_lIndexDatUserinterface = m_twaincommand.Submit(threaddata);
// Submit the command and wait for the reply...
CallerToThreadSet();
ThreadToCallerWaitOne();
// Return the result...
a_twuserinterface = m_twaincommand.Get(m_lIndexDatUserinterface).twuserinterface;
sts = m_twaincommand.Get(m_lIndexDatUserinterface).sts;
// Clear the command variables...
m_twaincommand.Delete(m_lIndexDatUserinterface);
}
return (sts);
}
}
// Well this is weird. I'm not sure how this design snuck past,
// I assume it's because of the async nature of the button presses,
// so it's easier to monitor a boolean. Regardless, we need to
// use this data to do the right thing...
if (m_blIsMsgclosedsok || m_blIsMsgclosedsreq)
{
a_msg = MSG.DISABLEDS;
}
// If we're doing a DISABLEDS, use the values we remembered from
// the last ENABLEDS...
TW_USERINTERFACE twuserinterface = a_twuserinterface;
if (a_msg == MSG.DISABLEDS)
{
twuserinterface = m_twuserinterface;
}
// Log it...
if (Log.GetLevel() > 0)
{
Log.LogSendBefore(a_dg.ToString(), DAT.USERINTERFACE.ToString(), a_msg.ToString(), UserinterfaceToCsv(twuserinterface));
}
// We need this to handle data sources that return MSG_XFERREADY in
// the midst of processing MSG_ENABLEDS...
if (a_msg == MSG.ENABLEDS)
{
m_blAcceptXferReady = true;
}
// Windows...
if (ms_platform == Platform.WINDOWS)
{
// Issue the command...
try
{
if (this.m_runinuithreaddelegate == null)
{
if (m_blUseLegacyDSM)
{
sts = (STS)WindowsTwain32DsmEntryUserinterface(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.USERINTERFACE, a_msg, ref twuserinterface);
}
else
{
sts = (STS)WindowsTwaindsmDsmEntryUserinterface(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.USERINTERFACE, a_msg, ref twuserinterface);
}
}
else
{
if (m_blUseLegacyDSM)
{
lock (m_lockTwain)
{
ThreadData threaddata = default(ThreadData);
threaddata.twuserinterface = a_twuserinterface;
threaddata.twuserinterface.hParent = m_intptrHwnd;
threaddata.dg = a_dg;
threaddata.msg = a_msg;
threaddata.dat = DAT.USERINTERFACE;
m_lIndexDatUserinterface = m_twaincommand.Submit(threaddata);
RunInUiThread(DatUserinterfaceWindowsTwain32);
a_twuserinterface = m_twaincommand.Get(m_lIndexDatUserinterface).twuserinterface;
sts = m_twaincommand.Get(m_lIndexDatUserinterface).sts;
m_twaincommand.Delete(m_lIndexDatUserinterface);
}
//.........这里部分代码省略.........
开发者ID:mrsalustiano,项目名称:VS_C,代码行数:101,代码来源:TWAIN.cs
示例11: DatParent
/// <summary>
/// Issue DSM commands...
/// </summary>
/// <param name="a_dg">Data group</param>
/// <param name="a_msg">Operation</param>
/// <param name="a_intptrHwnd">PARENT structure</param>
/// <returns>TWAIN status</returns>
public STS DatParent(DG a_dg, MSG a_msg, ref IntPtr a_intptrHwnd)
{
STS sts;
// Submit the work to the TWAIN thread...
if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId))
{
lock (m_lockTwain)
{
// Set our command variables...
ThreadData threaddata = default(ThreadData);
threaddata.intptrHwnd = a_intptrHwnd;
threaddata.dg = a_dg;
threaddata.msg = a_msg;
threaddata.dat = DAT.PARENT;
long lIndex = m_twaincommand.Submit(threaddata);
// Submit the command and wait for the reply...
CallerToThreadSet();
ThreadToCallerWaitOne();
// Return the result...
a_intptrHwnd = m_twaincommand.Get(lIndex).intptrHwnd;
sts = m_twaincommand.Get(lIndex).sts;
// Clear the command variables...
m_twaincommand.Delete(lIndex);
}
return (sts);
}
// Log it...
if (Log.GetLevel() > 0)
{
Log.LogSendBefore(a_dg.ToString(), DAT.PARENT.ToString(), a_msg.ToString(), "");
}
// Windows...
if (ms_platform == Platform.WINDOWS)
{
// Issue the command...
try
{
if (m_blUseLegacyDSM)
{
sts = (STS)WindowsTwain32DsmEntryParent(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, DAT.PARENT, a_msg, ref a_intptrHwnd);
}
else
{
sts = (STS)WindowsTwaindsmDsmEntryParent(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, DAT.PARENT, a_msg, ref a_intptrHwnd);
}
}
catch
{
// The driver crashed...
Log.LogSendAfter(STS.BUMMER.ToString(), "");
return (STS.BUMMER);
}
}
// Linux...
else if (ms_platform == Platform.LINUX)
{
// Issue the command...
try
{
if (GetMachineWordBitSize() == 32)
{
sts = (STS)LinuxDsmEntryParent(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, DAT.PARENT, a_msg, ref a_intptrHwnd);
}
else
{
sts = (STS)Linux64DsmEntryParent(ref m_twidentityApp, IntPtr.Zero, a_dg, DAT.PARENT, a_msg, ref a_intptrHwnd);
}
}
catch
{
// The driver crashed...
Log.LogSendAfter(STS.BUMMER.ToString(), "");
return (STS.BUMMER);
}
}
// Mac OS X, which has to be different...
else if (ms_platform == Platform.MACOSX)
{
// Issue the command...
try
{
sts = (STS)MacosxDsmEntryParent(ref m_twidentitymacosxApp, IntPtr.Zero, a_dg, DAT.PARENT, a_msg, ref a_intptrHwnd);
}
catch
{
//.........这里部分代码省略.........
开发者ID:mrsalustiano,项目名称:VS_C,代码行数:101,代码来源:TWAIN.cs
示例12: DatPendingxfers
/// <summary>
/// Issue pendingxfers commands...
/// </summary>
/// <param name="a_dg">Data group</param>
/// <param name="a_msg">Operation</param>
/// <param name="a_twpendingxfers">PENDINGXFERS structure</param>
/// <returns>TWAIN status</returns>
public STS DatPendingxfers(DG a_dg, MSG a_msg, ref TW_PENDINGXFERS a_twpendingxfers)
{
STS sts;
// Submit the work to the TWAIN thread...
if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId))
{
lock (m_lockTwain)
{
// Set our command variables...
ThreadData threaddata = default(ThreadData);
threaddata.twpendingxfers = a_twpendingxfers;
threaddata.dg = a_dg;
threaddata.msg = a_msg;
threaddata.dat = DAT.PENDINGXFERS;
long lIndex = m_twaincommand.Submit(threaddata);
// Submit the command and wait for the reply...
CallerToThreadSet();
ThreadToCallerWaitOne();
// Return the result...
a_twpendingxfers = m_twaincommand.Get(lIndex).twpendingxfers;
sts = m_twaincommand.Get(lIndex).sts;
// Clear the command variables...
m_twaincommand.Delete(lIndex);
}
return (sts);
}
// Log it...
if (Log.GetLevel() > 0)
{
Log.LogSendBefore(a_dg.ToString(), DAT.PENDINGXFERS.ToString(), a_msg.ToString(), "");
}
// Windows...
if (ms_platform == Platform.WINDOWS)
{
// Issue the command...
try
{
if (m_blUseLegacyDSM)
{
sts = (STS)WindowsTwain32DsmEntryPendingxfers(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.PENDINGXFERS, a_msg, ref a_twpendingxfers);
}
else
{
sts = (STS)WindowsTwaindsmDsmEntryPendingxfers(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.PENDINGXFERS, a_msg, ref a_twpendingxfers);
}
}
catch
{
// The driver crashed...
Log.LogSendAfter(STS.BUMMER.ToString(), "");
return (STS.BUMMER);
}
}
// Linux...
else if (ms_platform == Platform.LINUX)
{
// Issue the command...
try
{
if (GetMachineWordBitSize() == 32)
{
sts = (STS)LinuxDsmEntryPendingxfers(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.PENDINGXFERS, a_msg, ref a_twpendingxfers);
}
else
{
sts = (STS)Linux64DsmEntryPendingxfers(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.PENDINGXFERS, a_msg, ref a_twpendingxfers);
}
}
catch
{
// The driver crashed...
Log.LogSendAfter(STS.BUMMER.ToString(), "");
return (STS.BUMMER);
}
}
// Mac OS X, which has to be different...
else if (ms_platform == Platform.MACOSX)
{
// Issue the command...
try
{
sts = (STS)MacosxDsmEntryPendingxfers(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.PENDINGXFERS, a_msg, ref a_twpendingxfers);
}
catch
{
//.........这里部分代码省略.........
开发者ID:mrsalustiano,项目名称:VS_C,代码行数:101,代码来源:TWAIN.cs
示例13: DatCapability
/// <summary>
/// Issue capabilities commands...
/// </summary>
/// <param name="a_dg">Data group</param>
/// <param name="a_msg">Operation</param>
/// <param name="a_twcapability">CAPABILITY structure</param>
/// <returns>TWAIN status</returns>
public STS DatCapability(DG a_dg, MSG a_msg, ref TW_CAPABILITY a_twcapability)
{
STS sts;
// Submit the work to the TWAIN thread...
if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId))
{
lock (m_lockTwain)
{
ThreadData threaddata = default(ThreadData);
long lIndex = 0;
// TBD: sometimes this doesn't work! Not sure why
// yet, but a retry takes care of it.
for (int ii = 0; ii < 5; ii++)
{
// Set our command variables...
threaddata = default(ThreadData);
threaddata.twcapability = a_twcapability;
threaddata.dg = a_dg;
threaddata.msg = a_msg;
threaddata.dat = DAT.CAPABILITY;
lIndex = m_twaincommand.Submit(threaddata);
// Submit the command and wait for the reply...
CallerToThreadSet();
ThreadToCallerWaitOne();
// Hmmm...
if ( (a_msg == MSG.GETCURRENT)
&& (m_twaincommand.Get(lIndex).sts == STS.SUCCESS)
&& (m_twaincommand.Get(lIndex).twcapability.ConType == (TWON)0)
&& (m_twaincommand.Get(lIndex).twcapability.hContainer == IntPtr.Zero))
{
Thread.Sleep(1000);
continue;
}
// We're done...
break;
}
// Return the result...
a_twcapability = m_twaincommand.Get(lIndex).twcapability;
sts = m_twaincommand.Get(lIndex).sts;
// Clear the command variables...
m_twaincommand.Delete(lIndex);
}
return (sts);
}
// Log it...
if (Log.GetLevel() > 0)
{
if ((a_msg == MSG.SET) || (a_msg == MSG.SETCONSTRAINT))
{
Log.LogSendBefore(a_dg.ToString(), DAT.CAPABILITY.ToString(), a_msg.ToString(), CapabilityToCsv(a_twcapability));
}
else
{
string szCap = a_twcapability.Cap.ToString();
if (!szCap.Contains("_"))
{
szCap = "0x" + ((ushort)a_twcapability.Cap).ToString("X");
}
Log.LogSendBefore(a_dg.ToString(), DAT.CAPABILITY.ToString(), a_msg.ToString(), szCap + ",0,0");
}
}
// Windows...
if (ms_platform == Platform.WINDOWS)
{
// Issue the command...
try
{
if (m_blUseLegacyDSM)
{
sts = (STS)WindowsTwain32DsmEntryCapability(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CAPABILITY, a_msg, ref a_twcapability);
}
else
{
sts = (STS)WindowsTwaindsmDsmEntryCapability(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CAPABILITY, a_msg, ref a_twcapability);
}
}
catch
{
// The driver crashed...
Log.LogSendAfter(STS.BUMMER.ToString(), "");
return (STS.BUMMER);
}
}
//.........这里部分代码省略.........
开发者ID:mrsalustiano,项目名称:VS_C,代码行数:101,代码来源:TWAIN.cs
示例14: DatXferGroup
/// <summary>
/// Get/Set the Xfer Group...
/// </summary>
/// <param name="a_dg">Data group</param>
/// <param name="a_msg">Operation</param>
/// <param name="a_twuint32">XFERGROUP structure</param>
/// <returns>TWAIN status</returns>
public STS DatXferGroup(DG a_dg, MSG a_msg, ref UInt32 a_twuint32)
{
STS sts;
// Submit the work to the TWAIN thread...
if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId))
{
lock (m_lockTwain)
{
// Set our command variables...
ThreadData threaddata = default(ThreadData);
threaddata.twuint32 = a_twuint32;
threaddata.dg = a_dg;
threaddata.msg = a_msg;
threaddata.dat = DAT.XFERGROUP;
long lIndex = m_twaincommand.Submit(threaddata);
// Submit the command and wait for the reply...
CallerToThreadSet();
ThreadToCallerWaitOne();
// Return the result...
a_twuint32 = m_twaincommand.Get(lIndex).twuint32;
sts = m_twaincommand.Get(lIndex).sts;
// Clear the command variables...
m_twaincommand.Delete(lIndex);
}
return (sts);
}
// Log it...
if (Log.GetLevel() > 0)
{
Log.LogSendBefore(a_dg.ToString(), DAT.XFERGROUP.ToString(), a_msg.ToString(), XfergroupToCsv(a_twuint32));
}
// Windows...
if (ms_platform == Platform.WINDOWS)
{
// Issue the command...
try
{
if (m_blUseLegacyDSM)
{
sts = (STS)WindowsTwain32DsmEntryXfergroup(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.XFERGROUP, a_msg, ref a_twuint32);
}
else
{
sts = (STS)WindowsTwaindsmDsmEntryXfergroup(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.XFERGROUP, a_msg, ref a_twuint32);
}
}
catch
{
// The driver crashed...
Log.LogSendAfter(STS.BUMMER.ToString(), "");
return (STS.BUMMER);
}
}
// Linux...
else if (ms_platform == Platform.LINUX)
{
// Issue the command...
try
{
if (GetMachineWordBitSize() == 32)
{
sts = (STS)LinuxDsmEntryXfergroup(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.XFERGROUP, a_msg, ref a_twuint32);
}
else
{
sts = (STS)Linux64DsmEntryXfergroup(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.XFERGROUP, a_msg, ref a_twuint32);
}
}
catch
{
// The driver crashed...
Log.LogSendAfter(STS.BUMMER.ToString(), "");
return (STS.BUMMER);
}
}
// Mac OS X, which has to be different...
else if (ms_platform == Platform.MACOSX)
{
// Issue the command...
try
{
sts = (STS)MacosxDsmEntryXfergroup(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.XFERGROUP, a_msg, ref a_twuint32);
}
catch
{
//.........这里部分代码省略.........
开发者ID:mrsalustiano,项目名称:VS_C,代码行数:101,代码来源:TWAIN.cs
示例15: DatEntrypoint
/// <summary>
/// Get the entrypoint data...
/// </summary>
/// <param name="a_dg">Data group</param>
/// <param name="a_msg">Operation</param>
/// <param name="a_twentrypoint">ENTRYPOINT structure</param>
/// <returns>TWAIN status</returns>
public STS DatEntrypoint(DG a_dg, MSG a_msg, ref TW_ENTRYPOINT a_twentrypoint)
{
STS sts;
// Submit the work to the TWAIN thread...
if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId))
{
lock (m_lockTwain)
{
// Set our command variables...
ThreadData threaddata = default(ThreadData);
threaddata.twentrypoint = a_twentrypoint;
threaddata.dg = a_dg;
threaddata.msg = a_msg;
threaddata.dat = DAT.ENTRYPOINT;
long lIndex = m_twaincommand.Submit(threaddata);
// Submit the command and wait for the reply...
CallerToThreadSet();
ThreadToCallerWaitOne();
// Return the result...
a_twentrypoint = m_twaincommand.Get(lIndex).twentrypoint;
sts = m_twaincommand.Get(lIndex).sts;
// Clear the command variables...
m_twaincommand.Delete(lIndex);
}
return (sts);
}
// Log it...
if (Log.GetLevel() > 0)
{
Log.LogSendBefore(a_dg.ToString(), DAT.ENTRYPOINT.ToString(), a_msg.ToString(), EntrypointToCsv(a_twentrypoint));
}
// Windows...
if (ms_platform == Platform.WINDOWS)
{
// Issue the command...
try
{
if (m_blUseLegacyDSM)
{
sts = (STS)WindowsTwain32DsmEntryEntrypoint(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.ENTRYPOINT, a_msg, ref a_twentrypoint);
}
else
{
sts = (STS)WindowsTwaindsmDsmEntryEntrypoint(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.ENTRYPOINT, a_msg, ref a_twentrypoint);
}
}
catch
{
// The driver crashed...
Log.LogSendAfter(STS.BUMMER.ToString(), "");
return (STS.BUMMER);
}
}
// Linux...
else if (ms_platform == Platform.LINUX)
{
// Issue the command...
try
{
if (GetMachineWordBitSize() == 32)
{
sts = (STS)LinuxDsmEntryEntrypoint(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.ENTRYPOINT, a_msg, ref a_twentrypoint);
}
else
{
sts = (STS)Linux64DsmEntryEntrypoint(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.ENTRYPOINT, a_msg, ref a_twentrypoint);
}
}
catch
{
// The driver crashed...
Log.LogSendAfter(STS.BUMMER.ToString(), "");
return (STS.BUMMER);
}
}
// Mac OS X, which has to be different...
else if (ms_platform == Platform.MACOSX)
{
// Issue the command...
try
{
sts = (STS)MacosxDsmEntryEntrypoint(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.ENTRYPOINT, a_msg, ref a_twentrypoint);
}
catch
{
//.........这里部分代码省略.........
开发者ID:mrsalustiano,项目名称:VS_C,代码行数:101,代码来源:TWAIN.cs
示例16: DatEvent
/// <summary>
/// Issue event commands...
/// </summary>
/// <param name="a_dg">Data group</param>
/// <param name="a_msg">Operation</param>
/// <param name="a_twevent">EVENT structure</param>
/// <returns>TWAIN status</returns>
public STS DatEvent(DG a_dg, MSG a_msg, ref TW_EVENT a_twevent)
{
STS sts;
// Log it...
if (Log.GetLevel() > 1)
{
Log.LogSendBefore(a_dg.ToString(), DAT.EVENT.ToString(), a_msg.ToString(), "");
}
// Windows...
if (ms_platform == Platform.WINDOWS)
{
// Issue the command...
try
{
if (m_blUseLegacyDSM)
{
sts = (STS)WindowsTwain32DsmEntryEvent(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.EVENT, a_msg, ref a_twevent);
}
else
{
sts = (STS)WindowsTwaindsmDsmEntryEvent(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.EVENT, a_msg, ref a_twevent);
}
}
catch
{
// The driver crashed...
Log.LogSendAfter(STS.BUMMER.ToString(), "");
return (STS.BUMMER);
}
}
// Linux...
else if (ms_platform == Platform.LINUX)
{
// Issue the command...
try
{
if (GetMachineWordBitSize() == 32)
{
sts = (STS)LinuxDsmEntryEvent(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.EVENT, a_msg, ref a_twevent);
}
else
{
sts = (STS)Linux64DsmEntryEvent(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.EVENT, a_msg, ref a_twevent);
}
}
catch
{
// The driver crashed...
Log.LogSendAfter(STS.BUMMER.ToString(), "");
return (STS.BUMMER);
}
}
// Mac OS X, which has to be different...
else if (ms_platform == Platform.MACOSX)
{
// Issue the command...
try
{
sts = (STS)MacosxDsmEntryEvent(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.EVEN
|
请发表评论