System.Net.GlobalLog.Assert C# (CSharp) Method

Assert() private method

private Assert ( string message, string detailMessage ) : void
message string
detailMessage string
return void
        public static void Assert(string message, string detailMessage)
        {
            try
            {
                Print("Assert: " + message + (!string.IsNullOrEmpty(detailMessage) ? ": " + detailMessage : ""));
                Print("*******");
                Logobject.DumpArray(false);
            }
            finally
            {
#if DEBUG && !STRESS
                Debug.Assert(false, message, detailMessage);
#else
                UnsafeNclNativeMethods.DebugBreak();
                Debugger.Break();
#endif
            }
        }

Same methods

GlobalLog::Assert ( bool condition, string messageFormat ) : void
GlobalLog::Assert ( string message ) : void

Usage Example

Beispiel #1
0
        internal void PostPop(object newOwner)
        {
            GlobalLog.Assert(!IsEmancipated, "Pooled object not in pool.");
            GlobalLog.Assert(CanBePooled, "Pooled object is not poolable.");


            lock (this) {
                if (null == m_Owner)
                {
                    m_Owner = new WeakReference(newOwner);
                }
                else
                {
                    if (null != m_Owner.Target)
                    {
                        throw new InternalException();        // pooled connection already has an owner!
                    }
                    m_Owner.Target = newOwner;
                }

                m_PooledCount--;

                if (null != Pool)
                {
                    if (0 != m_PooledCount)
                    {
                        throw new InternalException();  // popping object off stack with multiple pooledCount
                    }
                }
                else
                {
                    if (-1 != m_PooledCount)
                    {
                        throw new InternalException();  // popping object off stack with multiple pooledCount
                    }
                }
            }
        }
All Usage Examples Of System.Net.GlobalLog::Assert