示例#1
0
        public HelloMessage(OmniSecureConnectionVersion[] versions)
        {
            if (versions is null)
            {
                throw new System.ArgumentNullException("versions");
            }
            if (versions.Length > 32)
            {
                throw new System.ArgumentOutOfRangeException("versions");
            }

            this.Versions = new Omnix.Collections.ReadOnlyListSlim <OmniSecureConnectionVersion>(versions);

            {
                var __h = new System.HashCode();
                foreach (var n in this.Versions)
                {
                    if (n != default)
                    {
                        __h.Add(n.GetHashCode());
                    }
                }
                __hashCode = __h.ToHashCode();
            }
        }
示例#2
0
        public OmniSignature(string name, OmniHash hash)
        {
            if (name is null)
            {
                throw new System.ArgumentNullException("name");
            }
            if (name.Length > 32)
            {
                throw new System.ArgumentOutOfRangeException("name");
            }
            this.Name = name;
            this.Hash = hash;

            {
                var __h = new System.HashCode();
                if (this.Name != default)
                {
                    __h.Add(this.Name.GetHashCode());
                }
                if (this.Hash != default)
                {
                    __h.Add(this.Hash.GetHashCode());
                }
                __hashCode = __h.ToHashCode();
            }
        }
示例#3
0
        public ThumbnailsCache(Thumbnail[] thumbnails)
        {
            if (thumbnails is null)
            {
                throw new System.ArgumentNullException("thumbnails");
            }
            if (thumbnails.Length > 1024)
            {
                throw new System.ArgumentOutOfRangeException("thumbnails");
            }
            foreach (var n in thumbnails)
            {
                if (n is null)
                {
                    throw new System.ArgumentNullException("n");
                }
            }

            this.Thumbnails = new Omnix.Collections.ReadOnlyListSlim <Thumbnail>(thumbnails);

            {
                var __h = new System.HashCode();
                foreach (var n in this.Thumbnails)
                {
                    if (n != default)
                    {
                        __h.Add(n.GetHashCode());
                    }
                }
                __hashCode = __h.ToHashCode();
            }
        }
示例#4
0
        public FileId(string path, ulong length, Omnix.Serialization.RocketPack.Timestamp lastWriteTime)
        {
            if (path is null)
            {
                throw new System.ArgumentNullException("path");
            }
            if (path.Length > 1024)
            {
                throw new System.ArgumentOutOfRangeException("path");
            }
            this.Path          = path;
            this.Length        = length;
            this.LastWriteTime = lastWriteTime;

            {
                var __h = new System.HashCode();
                if (this.Path != default)
                {
                    __h.Add(this.Path.GetHashCode());
                }
                if (this.Length != default)
                {
                    __h.Add(this.Length.GetHashCode());
                }
                if (this.LastWriteTime != default)
                {
                    __h.Add(this.LastWriteTime.GetHashCode());
                }
                __hashCode = __h.ToHashCode();
            }
        }
示例#5
0
        public ContentId(ContentType type, string path)
        {
            if (path is null)
            {
                throw new System.ArgumentNullException("path");
            }
            if (path.Length > 1024)
            {
                throw new System.ArgumentOutOfRangeException("path");
            }

            this.Type = type;
            this.Path = path;

            {
                var __h = new System.HashCode();
                if (this.Type != default)
                {
                    __h.Add(this.Type.GetHashCode());
                }
                if (this.Path != default)
                {
                    __h.Add(this.Path.GetHashCode());
                }
                __hashCode = __h.ToHashCode();
            }
        }
示例#6
0
        public VerificationMessage(ProfileMessage profileMessage, OmniAgreementPublicKey agreementPublicKey)
        {
            if (profileMessage is null)
            {
                throw new System.ArgumentNullException("profileMessage");
            }
            if (agreementPublicKey is null)
            {
                throw new System.ArgumentNullException("agreementPublicKey");
            }

            this.ProfileMessage     = profileMessage;
            this.AgreementPublicKey = agreementPublicKey;

            {
                var __h = new System.HashCode();
                if (this.ProfileMessage != default)
                {
                    __h.Add(this.ProfileMessage.GetHashCode());
                }
                if (this.AgreementPublicKey != default)
                {
                    __h.Add(this.AgreementPublicKey.GetHashCode());
                }
                __hashCode = __h.ToHashCode();
            }
        }
示例#7
0
        public AuthenticationMessage(System.ReadOnlyMemory <byte>[] hashes)
        {
            if (hashes is null)
            {
                throw new System.ArgumentNullException("hashes");
            }
            if (hashes.Length > 32)
            {
                throw new System.ArgumentOutOfRangeException("hashes");
            }
            foreach (var n in hashes)
            {
                if (n.Length > 32)
                {
                    throw new System.ArgumentOutOfRangeException("n");
                }
            }

            this.Hashes = new Omnix.Collections.ReadOnlyListSlim <System.ReadOnlyMemory <byte> >(hashes);

            {
                var __h = new System.HashCode();
                foreach (var n in this.Hashes)
                {
                    if (!n.IsEmpty)
                    {
                        __h.Add(Omnix.Base.Helpers.ObjectHelper.GetHashCode(n.Span));
                    }
                }
                __hashCode = __h.ToHashCode();
            }
        }
示例#8
0
        public SessionDataMessage(ulong sessionId, bool isCompleted, System.Buffers.IMemoryOwner <byte> data)
        {
            if (data is null)
            {
                throw new System.ArgumentNullException("data");
            }
            if (data.Memory.Length > 262144)
            {
                throw new System.ArgumentOutOfRangeException("data");
            }

            this.SessionId   = sessionId;
            this.IsCompleted = isCompleted;
            _data            = data;

            {
                var __h = new System.HashCode();
                if (this.SessionId != default)
                {
                    __h.Add(this.SessionId.GetHashCode());
                }
                if (this.IsCompleted != default)
                {
                    __h.Add(this.IsCompleted.GetHashCode());
                }
                if (!this.Data.IsEmpty)
                {
                    __h.Add(Omnix.Base.Helpers.ObjectHelper.GetHashCode(this.Data.Span));
                }
                __hashCode = __h.ToHashCode();
            }
        }
示例#9
0
        public OmniAgreementPrivateKey(Omnix.Serialization.RocketPack.Timestamp creationTime, OmniAgreementAlgorithmType algorithmType, System.ReadOnlyMemory <byte> privateKey)
        {
            if (privateKey.Length > 8192)
            {
                throw new System.ArgumentOutOfRangeException("privateKey");
            }

            this.CreationTime  = creationTime;
            this.AlgorithmType = algorithmType;
            this.PrivateKey    = privateKey;

            {
                var __h = new System.HashCode();
                if (this.CreationTime != default)
                {
                    __h.Add(this.CreationTime.GetHashCode());
                }
                if (this.AlgorithmType != default)
                {
                    __h.Add(this.AlgorithmType.GetHashCode());
                }
                if (!this.PrivateKey.IsEmpty)
                {
                    __h.Add(Omnix.Base.Helpers.ObjectHelper.GetHashCode(this.PrivateKey.Span));
                }
                __hashCode = __h.ToHashCode();
            }
        }
示例#10
0
        // TODO: why are we copying all these readonly fields of the endpoint?
        internal TcpConnector(
            TcpEndpoint endpoint,
            Communicator communicator,
            EndPoint addr,
            INetworkProxy?proxy,
            IPAddress?sourceAddr,
            int timeout,
            string connectionId)
        {
            _endpoint     = endpoint;
            _communicator = communicator;
            _addr         = addr;
            _proxy        = proxy;
            _sourceAddr   = sourceAddr;
            _timeout      = timeout;
            _connectionId = connectionId;

            var hash = new System.HashCode();

            hash.Add(_addr);
            if (_sourceAddr != null)
            {
                hash.Add(_sourceAddr);
            }
            hash.Add(_timeout);
            hash.Add(_connectionId);
            _hashCode = hash.ToHashCode();
        }
示例#11
0
        //
        // Only for use by UdpEndpointI
        //
        internal UdpConnector(
            Communicator communicator,
            EndPoint addr,
            IPAddress?sourceAddr,
            string mcastInterface,
            int mcastTtl,
            string connectionId)
        {
            _communicator   = communicator;
            _addr           = addr;
            _sourceAddr     = sourceAddr;
            _mcastInterface = mcastInterface;
            _mcastTtl       = mcastTtl;
            _connectionId   = connectionId;

            var hash = new System.HashCode();

            hash.Add(_addr);
            if (sourceAddr != null)
            {
                hash.Add(_sourceAddr);
            }
            hash.Add(_mcastInterface);
            hash.Add(_mcastTtl);
            hash.Add(_connectionId);
            _hashCode = hash.ToHashCode();
        }
示例#12
0
文件: Collections.cs 项目: shawvi/ice
        public static int GetHashCode <TKey, TValue>(IReadOnlyDictionary <TKey, TValue> d) where TKey : notnull
        {
            var hash = new System.HashCode();

            foreach (KeyValuePair <TKey, TValue> e in d)
            {
                hash.Add(e.Key);
                hash.Add(e.Value);
            }
            return(hash.ToHashCode());
        }
示例#13
0
        /// <summary>Computes the hash code for a dictionary.</summary>
        /// <param name="dict">The dictionary.</param>
        /// <returns>A hash code computed using the dictionary's entries.</returns>
        internal static int GetDictionaryHashCode <TKey, TValue>(this IReadOnlyDictionary <TKey, TValue> dict)
            where TKey : notnull
        {
            var hash = new System.HashCode();

            foreach (KeyValuePair <TKey, TValue> e in dict)
            {
                hash.Add(e.Key);
                hash.Add(e.Value);
            }
            return(hash.ToHashCode());
        }
示例#14
0
文件: Collections.cs 项目: shawvi/ice
        public static int GetHashCode <T>(this T[]?arr)
        {
            var hash = new System.HashCode();

            if (arr != null)
            {
                for (int i = 0; i < arr.Length; i++)
                {
                    hash.Add(arr[i]);
                }
            }
            return(hash.ToHashCode());
        }
示例#15
0
        public SessionCloseMessage(ulong sessionId)
        {
            this.SessionId = sessionId;

            {
                var __h = new System.HashCode();
                if (this.SessionId != default)
                {
                    __h.Add(this.SessionId.GetHashCode());
                }
                __hashCode = __h.ToHashCode();
            }
        }
 public override int GetHashCode()
 {
     System.HashCode hash = new System.HashCode();
     hash.Add(DisablePanoramaNavigation);
     hash.Add(LocationToLookAt);
     hash.Add(OverviewMapMode);
     hash.Add(PanoramaInfo);
     hash.Add(PanoramaLookupRadius);
     hash.Add(ShowCurrentAddress);
     hash.Add(ShowExitButton);
     hash.Add(ShowHeadingCompass);
     hash.Add(ShowProblemReporting);
     hash.Add(ShowZoomButtons);
     return(hash.ToHashCode());
 }
示例#17
0
        public OmniRpcErrorMessage(string type, string message, string stackTrace)
        {
            if (type is null)
            {
                throw new System.ArgumentNullException("type");
            }
            if (type.Length > 8192)
            {
                throw new System.ArgumentOutOfRangeException("type");
            }
            if (message is null)
            {
                throw new System.ArgumentNullException("message");
            }
            if (message.Length > 8192)
            {
                throw new System.ArgumentOutOfRangeException("message");
            }
            if (stackTrace is null)
            {
                throw new System.ArgumentNullException("stackTrace");
            }
            if (stackTrace.Length > 8192)
            {
                throw new System.ArgumentOutOfRangeException("stackTrace");
            }

            this.Type       = type;
            this.Message    = message;
            this.StackTrace = stackTrace;

            {
                var __h = new System.HashCode();
                if (this.Type != default)
                {
                    __h.Add(this.Type.GetHashCode());
                }
                if (this.Message != default)
                {
                    __h.Add(this.Message.GetHashCode());
                }
                if (this.StackTrace != default)
                {
                    __h.Add(this.StackTrace.GetHashCode());
                }
                __hashCode = __h.ToHashCode();
            }
        }
示例#18
0
        // Only for use by UdpEndpointI
        internal UdpConnector(UdpEndpoint endpoint, EndPoint addr)
        {
            _endpoint = endpoint;
            _addr     = addr;

            var hash = new System.HashCode();

            hash.Add(_addr);
            if (_endpoint.SourceAddress != null)
            {
                hash.Add(_endpoint.SourceAddress);
            }
            hash.Add(_endpoint.MulticastInterface);
            hash.Add(_endpoint.MulticastTtl);
            _hashCode = hash.ToHashCode();
        }
示例#19
0
        internal TcpConnector(TcpEndpoint endpoint, EndPoint addr, INetworkProxy?proxy)
        {
            _endpoint = endpoint;
            _addr     = addr;
            _proxy    = proxy;

            var hash = new System.HashCode();

            hash.Add(_endpoint.Protocol);
            hash.Add(_endpoint.Transport);
            hash.Add(_addr);
            if (_endpoint.SourceAddress != null)
            {
                hash.Add(_endpoint.SourceAddress);
            }
            _hashCode = hash.ToHashCode();
        }
示例#20
0
        public OmniCertificate(string name, OmniDigitalSignatureAlgorithmType algorithmType, System.ReadOnlyMemory <byte> publicKey, System.ReadOnlyMemory <byte> value)
        {
            if (name is null)
            {
                throw new System.ArgumentNullException("name");
            }
            if (name.Length > 32)
            {
                throw new System.ArgumentOutOfRangeException("name");
            }
            if (publicKey.Length > 8192)
            {
                throw new System.ArgumentOutOfRangeException("publicKey");
            }
            if (value.Length > 8192)
            {
                throw new System.ArgumentOutOfRangeException("value");
            }

            this.Name          = name;
            this.AlgorithmType = algorithmType;
            this.PublicKey     = publicKey;
            this.Value         = value;

            {
                var __h = new System.HashCode();
                if (this.Name != default)
                {
                    __h.Add(this.Name.GetHashCode());
                }
                if (this.AlgorithmType != default)
                {
                    __h.Add(this.AlgorithmType.GetHashCode());
                }
                if (!this.PublicKey.IsEmpty)
                {
                    __h.Add(Omnix.Base.Helpers.ObjectHelper.GetHashCode(this.PublicKey.Span));
                }
                if (!this.Value.IsEmpty)
                {
                    __h.Add(Omnix.Base.Helpers.ObjectHelper.GetHashCode(this.Value.Span));
                }
                __hashCode = __h.ToHashCode();
            }
        }
示例#21
0
        public SessionUpdateWindowSizeMessage(ulong sessionId, ulong size)
        {
            this.SessionId = sessionId;
            this.Size      = size;

            {
                var __h = new System.HashCode();
                if (this.SessionId != default)
                {
                    __h.Add(this.SessionId.GetHashCode());
                }
                if (this.Size != default)
                {
                    __h.Add(this.Size.GetHashCode());
                }
                __hashCode = __h.ToHashCode();
            }
        }
示例#22
0
        public SessionErrorMessage(ulong sessionId, SessionErrorType errorType)
        {
            this.SessionId = sessionId;
            this.ErrorType = errorType;

            {
                var __h = new System.HashCode();
                if (this.SessionId != default)
                {
                    __h.Add(this.SessionId.GetHashCode());
                }
                if (this.ErrorType != default)
                {
                    __h.Add(this.ErrorType.GetHashCode());
                }
                __hashCode = __h.ToHashCode();
            }
        }
示例#23
0
 public override int GetHashCode()
 {
     System.HashCode hash = new System.HashCode();
     hash.Add(Actions);
     hash.Add(CloseDelayTime);
     hash.Add(Description);
     hash.Add(HtmlContent);
     hash.Add(Location);
     hash.Add(MaxHeight);
     hash.Add(MaxWidth);
     hash.Add(Offset);
     hash.Add(ShowCloseButton);
     hash.Add(ShowPointer);
     hash.Add(Title);
     hash.Add(Visible);
     hash.Add(ZIndex);
     return(hash.ToHashCode());
 }
示例#24
0
        public ProfileMessage(ulong initialWindowSize, uint maxSessionAcceptQueueSize)
        {
            this.InitialWindowSize         = initialWindowSize;
            this.MaxSessionAcceptQueueSize = maxSessionAcceptQueueSize;

            {
                var __h = new System.HashCode();
                if (this.InitialWindowSize != default)
                {
                    __h.Add(this.InitialWindowSize.GetHashCode());
                }
                if (this.MaxSessionAcceptQueueSize != default)
                {
                    __h.Add(this.MaxSessionAcceptQueueSize.GetHashCode());
                }
                __hashCode = __h.ToHashCode();
            }
        }
示例#25
0
        //
        // Only for use by TcpEndpoint
        //
        internal TcpConnector(TransportInstance instance, EndPoint addr, INetworkProxy?proxy, IPAddress?sourceAddr,
                              int timeout, string connectionId)
        {
            _instance     = instance;
            _addr         = addr;
            _proxy        = proxy;
            _sourceAddr   = sourceAddr;
            _timeout      = timeout;
            _connectionId = connectionId;

            var hash = new System.HashCode();

            hash.Add(_addr);
            if (_sourceAddr != null)
            {
                hash.Add(_sourceAddr);
            }
            hash.Add(_timeout);
            hash.Add(_connectionId);
            _hashCode = hash.ToHashCode();
        }
示例#26
0
        public OmniAddress(string value)
        {
            if (value is null)
            {
                throw new System.ArgumentNullException("value");
            }
            if (value.Length > 8192)
            {
                throw new System.ArgumentOutOfRangeException("value");
            }

            this.Value = value;

            {
                var __h = new System.HashCode();
                if (this.Value != default)
                {
                    __h.Add(this.Value.GetHashCode());
                }
                __hashCode = __h.ToHashCode();
            }
        }
示例#27
0
        //
        // Only for use by UdpEndpointI
        //
        internal UdpConnector(TransportInstance instance, EndPoint addr, EndPoint?sourceAddr, string mcastInterface,
                              int mcastTtl, string connectionId)
        {
            _instance       = instance;
            _addr           = addr;
            _sourceAddr     = sourceAddr;
            _mcastInterface = mcastInterface;
            _mcastTtl       = mcastTtl;
            _connectionId   = connectionId;

            var hash = new System.HashCode();

            hash.Add(_addr);
            if (sourceAddr != null)
            {
                hash.Add(_sourceAddr);
            }
            hash.Add(_mcastInterface);
            hash.Add(_mcastTtl);
            hash.Add(_connectionId);
            _hashCode = hash.ToHashCode();
        }
示例#28
0
        public Thumbnail(System.Buffers.IMemoryOwner <byte> value)
        {
            if (value is null)
            {
                throw new System.ArgumentNullException("value");
            }
            if (value.Memory.Length > 33554432)
            {
                throw new System.ArgumentOutOfRangeException("value");
            }

            _value = value;

            {
                var __h = new System.HashCode();
                if (!this.Value.IsEmpty)
                {
                    __h.Add(Omnix.Base.Helpers.ObjectHelper.GetHashCode(this.Value.Span));
                }
                __hashCode = __h.ToHashCode();
            }
        }
示例#29
0
        public LxnaOptions(string configDirectoryPath)
        {
            if (configDirectoryPath is null)
            {
                throw new System.ArgumentNullException("configDirectoryPath");
            }
            if (configDirectoryPath.Length > 1024)
            {
                throw new System.ArgumentOutOfRangeException("configDirectoryPath");
            }

            this.ConfigDirectoryPath = configDirectoryPath;

            {
                var __h = new System.HashCode();
                if (this.ConfigDirectoryPath != default)
                {
                    __h.Add(this.ConfigDirectoryPath.GetHashCode());
                }
                __hashCode = __h.ToHashCode();
            }
        }
示例#30
0
 public override int GetHashCode()
 {
     System.HashCode hash = new System.HashCode();
     hash.Add(base.GetHashCode());
     hash.Add(AllowHidingLabelsOfRoad);
     hash.Add(AllowInfoboxOverflow);
     hash.Add(BackgroundColor);
     hash.Add(Credentials);
     hash.Add(DisableBirdseye);
     hash.Add(DisableKeyboardInput);
     hash.Add(DisableMapTypeSelectorMouseOver);
     hash.Add(DisablePanning);
     hash.Add(DisableScrollWheelZoom);
     hash.Add(DisableStreetside);
     hash.Add(DisableStreetsideAutoCoverage);
     hash.Add(DisableZooming);
     hash.Add(EnableClickableLogo);
     hash.Add(EnableCORS);
     hash.Add(EnableHighDpi);
     hash.Add(EnableInertia);
     hash.Add(LiteMode);
     hash.Add(MaxBounds);
     hash.Add(MaxZoom);
     hash.Add(MinZoom);
     hash.Add(NavigationBarMode);
     hash.Add(NavigationBarOrientation);
     hash.Add(ShowBreadcrumb);
     hash.Add(ShowDashboard);
     hash.Add(ShowLocateMeButton);
     hash.Add(ShowMapTypeSelector);
     hash.Add(ShowScalebar);
     hash.Add(ShowTermsLink);
     hash.Add(ShowTrafficButton);
     hash.Add(ShowZoomButtons);
     hash.Add(StreetsideOptions);
     hash.Add(SupportedMapTypes);
     return(hash.ToHashCode());
 }