Exemplo n.º 1
0
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     unchecked {
         int result = (Type != null ? Type.GetHashCode() : 0);
         result = (result * 397) ^ CanRead.GetHashCode();
         result = (result * 397) ^ CanWrite.GetHashCode();
         result = (result * 397) ^ (Query != null ? Query.GetHashCode() : 0);
         return(result);
     }
 }
Exemplo n.º 2
0
        public override int GetHashCode()
        {
            var hashCode = -1889003361;

            hashCode = hashCode * -1521134295 + base.GetHashCode();
            hashCode = hashCode * -1521134295 + Name.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <Type> .Default.GetHashCode(Type);

            hashCode = hashCode * -1521134295 + CanWrite.GetHashCode();
            hashCode = hashCode * -1521134295 + GetIsPublic.GetHashCode();
            hashCode = hashCode * -1521134295 + SetIsPublic.GetHashCode();
            return(hashCode);
        }
        public override int GetHashCode()
        {
            var hashCode = 1861411795;

            unchecked {
                if (Name != null)
                {
                    hashCode = hashCode * -1521134295 + Name.GetHashCode();
                }
                if (Category != null)
                {
                    hashCode = hashCode * -1521134295 + Category.GetHashCode();
                }
                hashCode = hashCode * -1521134295 + CanWrite.GetHashCode();
            }
            return(hashCode);
        }
Exemplo n.º 4
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    // TODO: dispose managed state (managed objects)
                    msOutput?.Dispose();
                    Done?.Dispose();
                    CanWrite?.Dispose();
                }

                // TODO: free unmanaged resources (unmanaged objects) and override finalizer
                // TODO: set large fields to null
                array         = null;
                disposedValue = true;
            }
        }
Exemplo n.º 5
0
        public void ZipAndWrite()
        {
            Zip();

            if (Next != null)
            {
                General.Log($"worker {Idx} going to wait for its turn to canWrite");

                CanWrite.WaitOne();
            }

            Write(OutFileStream);

            if (Next != null)
            {
                General.Log($"worker {Idx} Sets next archiver.canWrite");
                Next.CanWrite.Set();
            }

            General.Log($"worker {Idx} Sets done");
            Done.Set();
        }
Exemplo n.º 6
0
    public static void Main(string[] args)
    {
        CanWrite objTest = new CanWrite();

        AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(objTest.AppDomainUnhandledException_EventHandler);

        Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver : " + s_strDtTmVer);

        try
        {
            objTest.RunTest();
        }
        catch (Exception e)
        {
            Console.WriteLine(s_strTFAbbrev + " : FAIL The following exception was thorwn in RunTest(): \n" + e.ToString());
            objTest._numErrors++;
            objTest._exitValue = TCSupport.FailExitCode;
        }

        ////	Finish Diagnostics
        if (objTest._numErrors == 0)
        {
            Console.WriteLine("PASS.	 "+ s_strTFPath + " " + s_strTFName + " ,numTestcases==" + objTest._numTestcases);
        }
        else
        {
            Console.WriteLine("FAIL!	 "+ s_strTFPath + " " + s_strTFName + " ,numErrors==" + objTest._numErrors);

            if (TCSupport.PassExitCode == objTest._exitValue)
            {
                objTest._exitValue = TCSupport.FailExitCode;
            }
        }

        Environment.ExitCode = objTest._exitValue;
    }