示例#1
0
        /// <summary>
        /// Updates the DisplayClientLicenseUsage from a StackHashClientLicenseUsage
        /// </summary>
        /// <param name="clientLicenseUsage">StackHashClientLicenseUsage</param>
        public void UpdateClientLicenseUsage(StackHashClientLicenseUsage clientLicenseUsage)
        {
            if (clientLicenseUsage == null)
            {
                throw new ArgumentNullException("clientLicenseUsage");
            }
            if (clientLicenseUsage.ClientData == null)
            {
                throw new ArgumentNullException("clientLicenseUsage", "clientLicenseUsage.ClientData is null");
            }
            if (clientLicenseUsage.ClientData.ApplicationGuid != _stackHashClientLicenseUsage.ClientData.ApplicationGuid)
            {
                throw new InvalidOperationException("Cannot update with a different ApplicationGuid");
            }

            StackHashClientLicenseUsage oldClientLicenseUsage = _stackHashClientLicenseUsage;

            _stackHashClientLicenseUsage = clientLicenseUsage;

            if (oldClientLicenseUsage.ClientConnectTime != _stackHashClientLicenseUsage.ClientConnectTime)
            {
                RaisePropertyChanged("ClientConnectTime");
            }
            if (oldClientLicenseUsage.LastAccessTime != _stackHashClientLicenseUsage.LastAccessTime)
            {
                RaisePropertyChanged("LastAccessTime");
            }
            if (oldClientLicenseUsage.ClientData.ClientName != _stackHashClientLicenseUsage.ClientData.ClientName)
            {
                RaisePropertyChanged("ClientName");
            }
        }
示例#2
0
        /// <summary>
        /// ClientLicenseUsage Wrapper
        /// </summary>
        /// <param name="clientLicenseUsage">StackHashClientLicenseUsage</param>
        public DisplayClientLicenseUsage(StackHashClientLicenseUsage clientLicenseUsage)
        {
            if (clientLicenseUsage == null)
            {
                throw new ArgumentNullException("clientLicenseUsage");
            }
            if (clientLicenseUsage.ClientData == null)
            {
                throw new ArgumentNullException("clientLicenseUsage", "clientLicenseUsage.ClientData is null");
            }

            _stackHashClientLicenseUsage = clientLicenseUsage;
        }