ArcGISCompare.MiscProcs.NoLocks C# (CSharp) Method

NoLocks() static private method

static private NoLocks ( IClass theLockClass ) : System.Boolean
theLockClass IClass
return System.Boolean
        internal static Boolean NoLocks(IClass theLockClass)
        {
            Boolean Result = false;
            ISchemaLock theLock;
            ISchemaLockInfo oneLock;
            IEnumSchemaLockInfo allLocks;

            try
            {
                theLock = (ISchemaLock)theLockClass;
                theLock.GetCurrentSchemaLocks(out allLocks);

                allLocks.Reset();
                oneLock = allLocks.Next();
                oneLock = allLocks.Next();
                if (oneLock != null)
                    Result = false;
                else { Result = true; }
                if (Result) { theLock.ChangeSchemaLock(esriSchemaLock.esriExclusiveSchemaLock); }
            }
            catch { Result = false; }

            return Result;
        }