سؤال

I have having a problem with this statement:

SubTransaction subTransaction = new SubTransaction(doc); if (subTransaction.Start() == 1)

هل كانت مفيدة؟

المحلول

Based on the error message, the problem is with the if statement. Try this instead:

if (subTransaction.Start() == TransactionStatus.Started) { ... }

In .NET, enum values need to be cast to int first, if you want to compare them to an int. And you probably don't want to be doing that anyway, because that just obscures the value with a magic number.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top