Пример #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (CreatedTime.Length != 0)
            {
                hash ^= CreatedTime.GetHashCode();
            }
            if (Author.Length != 0)
            {
                hash ^= Author.GetHashCode();
            }
            if (Office.Length != 0)
            {
                hash ^= Office.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Пример #2
0
 protected bool Equals(BaseEntityDto <TIdentity> other)
 {
     return(Id.Equals(other.Id) &&
            CreatedTime.ToString() == other.CreatedTime.ToString() &&
            ModifiedTime.ToString() == other.ModifiedTime.ToString() &&
            CanModify == other.CanModify);
 }
Пример #3
0
 public Dictionary <string, int> SearchIndexHash(SiteSettings ss)
 {
     if (AccessStatus != Databases.AccessStatuses.Selected)
     {
         return(null);
     }
     else
     {
         var searchIndexHash = new Dictionary <string, int>();
         SiteInfo.TenantCaches[Sessions.TenantId()]
         .SiteMenu.Breadcrumb(SiteId).SearchIndexes(searchIndexHash, 100);
         SiteId.SearchIndexes(searchIndexHash, 200);
         UpdatedTime.SearchIndexes(searchIndexHash, 200);
         WikiId.SearchIndexes(searchIndexHash, 1);
         Title.SearchIndexes(searchIndexHash, 4);
         Body.SearchIndexes(searchIndexHash, 200);
         Comments.SearchIndexes(searchIndexHash, 200);
         Creator.SearchIndexes(searchIndexHash, 100);
         Updator.SearchIndexes(searchIndexHash, 100);
         CreatedTime.SearchIndexes(searchIndexHash, 200);
         SearchIndexExtensions.OutgoingMailsSearchIndexes(
             searchIndexHash, "Wikis", WikiId);
         return(searchIndexHash);
     }
 }
Пример #4
0
 public Dictionary <string, int> SearchIndexHash(Context context, SiteSettings ss)
 {
     if (AccessStatus != Databases.AccessStatuses.Selected)
     {
         return(null);
     }
     else
     {
         var searchIndexHash = new Dictionary <string, int>();
         SiteInfo.TenantCaches.Get(context.TenantId)?
         .SiteMenu
         .Breadcrumb(context: context, siteId: SiteId)
         .SearchIndexes(context, searchIndexHash, 100);
         SiteId.SearchIndexes(context, searchIndexHash, 200);
         UpdatedTime.SearchIndexes(context, searchIndexHash, 200);
         WikiId.SearchIndexes(context, searchIndexHash, 1);
         Title.SearchIndexes(context, searchIndexHash, 4);
         Body.SearchIndexes(context, searchIndexHash, 200);
         Comments.SearchIndexes(context, searchIndexHash, 200);
         Creator.SearchIndexes(context, searchIndexHash, 100);
         Updator.SearchIndexes(context, searchIndexHash, 100);
         CreatedTime.SearchIndexes(context, searchIndexHash, 200);
         SearchIndexExtensions.OutgoingMailsSearchIndexes(
             context: context,
             searchIndexHash: searchIndexHash,
             referenceType: "Wikis",
             referenceId: WikiId);
         return(searchIndexHash);
     }
 }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (Kind != null)
         {
             hashCode = hashCode * 59 + Kind.GetHashCode();
         }
         if (CreatedTime != null)
         {
             hashCode = hashCode * 59 + CreatedTime.GetHashCode();
         }
         if (ModifiedTime != null)
         {
             hashCode = hashCode * 59 + ModifiedTime.GetHashCode();
         }
         if (Author != null)
         {
             hashCode = hashCode * 59 + Author.GetHashCode();
         }
         if (Comments != null)
         {
             hashCode = hashCode * 59 + Comments.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #6
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.createdTime)
            {
                hashcode = (hashcode * 397) + CreatedTime.GetHashCode();
            }
            if (__isset.type)
            {
                hashcode = (hashcode * 397) + Type.GetHashCode();
            }
            if (__isset.payload)
            {
                hashcode = (hashcode * 397) + Payload.GetHashCode();
            }
            if (__isset.syncToken)
            {
                hashcode = (hashcode * 397) + SyncToken.GetHashCode();
            }
            if (__isset.eventStatus)
            {
                hashcode = (hashcode * 397) + EventStatus.GetHashCode();
            }
        }
        return(hashcode);
    }
Пример #7
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((CreatedTime.GetHashCode() * 397) ^ (Name != null ? Name.GetHashCode() : 0));
     }
 }
Пример #8
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.mid)
            {
                hashcode = (hashcode * 397) + Mid.GetHashCode();
            }
            if (__isset.createdTime)
            {
                hashcode = (hashcode * 397) + CreatedTime.GetHashCode();
            }
            if (__isset.modifiedTime)
            {
                hashcode = (hashcode * 397) + ModifiedTime.GetHashCode();
            }
            if (__isset.status)
            {
                hashcode = (hashcode * 397) + Status.GetHashCode();
            }
            if (__isset.settings)
            {
                hashcode = (hashcode * 397) + Settings.GetHashCode();
            }
            if (__isset.displayNameOverridden)
            {
                hashcode = (hashcode * 397) + DisplayNameOverridden.GetHashCode();
            }
        }
        return(hashcode);
    }
Пример #9
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.mid)
            {
                hashcode = (hashcode * 397) + Mid.GetHashCode();
            }
            if (__isset.createdTime)
            {
                hashcode = (hashcode * 397) + CreatedTime.GetHashCode();
            }
            if (__isset.contacts)
            {
                hashcode = (hashcode * 397) + TCollections.GetHashCode(Contacts);
            }
            if (__isset.notificationDisabled)
            {
                hashcode = (hashcode * 397) + NotificationDisabled.GetHashCode();
            }
            if (__isset.memberMids)
            {
                hashcode = (hashcode * 397) + TCollections.GetHashCode(MemberMids);
            }
        }
        return(hashcode);
    }
Пример #10
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.key)
            {
                hashcode = (hashcode * 397) + Key.GetHashCode();
            }
            if (__isset.targets)
            {
                hashcode = (hashcode * 397) + TCollections.GetHashCode(Targets);
            }
            if (__isset.createdTime)
            {
                hashcode = (hashcode * 397) + CreatedTime.GetHashCode();
            }
            if (__isset.data)
            {
                hashcode = (hashcode * 397) + Data.GetHashCode();
            }
            if (__isset.maxDelay)
            {
                hashcode = (hashcode * 397) + MaxDelay.GetHashCode();
            }
        }
        return(hashcode);
    }
Пример #11
0
 /// <summary>
 ///     Serves as a hash function for a particular type.
 /// </summary>
 /// <returns>A hash code for the current <see cref="T:System.Object" />.</returns>
 public override int GetHashCode()
 {
     return(CreatedTime.GetHashCode()
            ^ DirectoryCount.GetHashCode()
            ^ FileCount.GetHashCode()
            ^ ModifiedTime.GetHashCode()
            ^ Size.GetHashCode());
 }
Пример #12
0
 public override string ToString()
 {
     return($"Block - " +
            $"{Environment.NewLine}Timestamp: {CreatedTime.ToTimestamp()} " +
            $"{Environment.NewLine}Previous Hash: {PreviousHash} " +
            $"{Environment.NewLine}Hash: {Hash} " +
            $"{Environment.NewLine}Data: {GetSerializedData()}");
 }
Пример #13
0
 public UserFile(string path)
 {
     Name        = Path.GetFileNameWithoutExtension(path);
     CreatedTime = File.GetCreationTime(path);
     DisplayTime = CreatedTime.ToLongDateString();
     FilePath    = path;
     Size        = FileHelper.GetFileSize(path);
 }
Пример #14
0
    public override string ToString()
    {
        var  sb      = new StringBuilder("SquareEvent(");
        bool __first = true;

        if (__isset.createdTime)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("CreatedTime: ");
            CreatedTime.ToString(sb);
        }
        if (__isset.type)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Type: ");
            Type.ToString(sb);
        }
        if (Payload != null && __isset.payload)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Payload: ");
            Payload.ToString(sb);
        }
        if (SyncToken != null && __isset.syncToken)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("SyncToken: ");
            SyncToken.ToString(sb);
        }
        if (__isset.eventStatus)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("EventStatus: ");
            EventStatus.ToString(sb);
        }
        sb.Append(")");
        return(sb.ToString());
    }
Пример #15
0
    public override string ToString()
    {
        var  sb      = new StringBuilder("Room(");
        bool __first = true;

        if (Mid != null && __isset.mid)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Mid: ");
            Mid.ToString(sb);
        }
        if (__isset.createdTime)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("CreatedTime: ");
            CreatedTime.ToString(sb);
        }
        if (Contacts != null && __isset.contacts)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Contacts: ");
            Contacts.ToString(sb);
        }
        if (__isset.notificationDisabled)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("NotificationDisabled: ");
            NotificationDisabled.ToString(sb);
        }
        if (MemberMids != null && __isset.memberMids)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("MemberMids: ");
            MemberMids.ToString(sb);
        }
        sb.Append(")");
        return(sb.ToString());
    }
Пример #16
0
    public override string ToString()
    {
        var  sb      = new StringBuilder("GlobalEvent(");
        bool __first = true;

        if (Key != null && __isset.key)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Key: ");
            Key.ToString(sb);
        }
        if (Targets != null && __isset.targets)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Targets: ");
            Targets.ToString(sb);
        }
        if (__isset.createdTime)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("CreatedTime: ");
            CreatedTime.ToString(sb);
        }
        if (__isset.data)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Data: ");
            Data.ToString(sb);
        }
        if (__isset.maxDelay)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("MaxDelay: ");
            MaxDelay.ToString(sb);
        }
        sb.Append(")");
        return(sb.ToString());
    }
Пример #17
0
 public void PrintFullPost()
 {
     Console.WriteLine("Date Posted: " + CreatedTime.ToLongDateString());
     Console.WriteLine(Title);
     Console.WriteLine();
     Console.WriteLine(Description);
     Console.WriteLine();
     Console.WriteLine("Votes: " + Votes);
 }
Пример #18
0
 public void Print()
 {
     Console.WriteLine("Title: " + Title);
     Console.WriteLine("Description: " + Description);
     Console.WriteLine("Date Posted: " + CreatedTime.ToLongDateString());
     Console.ForegroundColor = ConsoleColor.Red;
     Console.WriteLine("\nTotal Votes Count: " + Votes);
     Console.ResetColor();
     Console.ReadLine();
 }
Пример #19
0
        public string FullText(
            SiteSettings ss, bool backgroundTask = false, bool onCreating = false)
        {
            if (Parameters.Search.Provider != "FullText")
            {
                return(null);
            }
            if (!Parameters.Search.CreateIndexes && !backgroundTask)
            {
                return(null);
            }
            if (AccessStatus == Databases.AccessStatuses.NotFound)
            {
                return(null);
            }
            var fullText = new List <string>();

            SiteInfo.TenantCaches[Sessions.TenantId()]
            .SiteMenu.Breadcrumb(SiteId).FullText(fullText);
            SiteId.FullText(fullText);
            ss.EditorColumns.ForEach(columnName =>
            {
                switch (columnName)
                {
                case "WikiId":
                    WikiId.FullText(fullText);
                    break;

                case "Title":
                    Title.FullText(fullText);
                    break;

                case "Body":
                    Body.FullText(fullText);
                    break;

                case "Comments":
                    Comments.FullText(fullText);
                    break;
                }
            });
            Creator.FullText(fullText);
            Updator.FullText(fullText);
            CreatedTime.FullText(fullText);
            UpdatedTime.FullText(fullText);
            if (!onCreating)
            {
                FullTextExtensions.OutgoingMailsFullText(fullText, "Wikis", WikiId);
            }
            return(fullText
                   .Where(o => !o.IsNullOrEmpty())
                   .Select(o => o.Trim())
                   .Distinct()
                   .Join(" "));
        }
Пример #20
0
        public override string ToString()
        {
            string localIp   = LocalIPAddress.IsNullOrEmpty() ? "NO_LOCAL_IP" : LocalIPAddress;
            string remoteIp  = RemoteIPAddress.IsNullOrEmpty() ? "NO_REMOTE_IP" : RemoteIPAddress;
            string logString = $"[{CreatedTime.ToString("dd/MM/yyyy:HH:mm:ss UTC")}] [{TraceId} - {ID} - {Username.ToLengthyString(12)}] [{Priority.ToString().ToLengthyString(8)} - {EventId} - {EventName}] [{localIp.ToLengthyString(15)} | {remoteIp.ToLengthyString(15)}] [{Source}]";

            if (!Message.IsNullOrEmpty())
            {
                logString += $"\n\t ==> { Message }";
            }
            return(logString);
        }
        /// <summary>
        /// Returns true if ModelFlowChartMeta instances are equal
        /// </summary>
        /// <param name="other">Instance of ModelFlowChartMeta to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ModelFlowChartMeta other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     Kind == other.Kind ||
                     Kind != null &&
                     Kind.Equals(other.Kind)
                 ) &&
                 (
                     CreatedTime == other.CreatedTime ||
                     CreatedTime != null &&
                     CreatedTime.Equals(other.CreatedTime)
                 ) &&
                 (
                     LastModifiedTime == other.LastModifiedTime ||
                     LastModifiedTime != null &&
                     LastModifiedTime.Equals(other.LastModifiedTime)
                 ) &&
                 (
                     Author == other.Author ||
                     Author != null &&
                     Author.Equals(other.Author)
                 ) &&
                 (
                     EditMode == other.EditMode ||
                     EditMode != null &&
                     EditMode.Equals(other.EditMode)
                 ) &&
                 (
                     Config == other.Config ||
                     Config != null &&
                     Config.Equals(other.Config)
                 ) &&
                 (
                     Comments == other.Comments ||
                     Comments != null &&
                     Comments.Equals(other.Comments)
                 ));
        }
Пример #22
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Id;
         hashCode = (hashCode * 397) ^ CreatorUserId;
         hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CreatedTime.GetHashCode();
         hashCode = (hashCode * 397) ^ Softdelete.GetHashCode();
         return(hashCode);
     }
 }
 public bool Equals(IMarker other)
 {
     return
         (other != null &&
          Id.Equals(other.Id) &&
          Name == other.Name &&
          RelativePosition.Equals(other.RelativePosition) &&
          RelativeRotationEuler.Equals(other.RelativeRotationEuler) &&
          ObjectScale.Equals(other.ObjectScale) &&
          CreatedTime.Equals(other.CreatedTime) &&
          LastUpdatedTime.Equals(other.LastUpdatedTime) &&
          LastUsedTime.Equals(other.LastUsedTime));
 }
Пример #24
0
        /// <summary>
        /// 判断两个实体是否是同一数据记录的实体
        /// </summary>
        /// <param name="obj">要比较的实体信息</param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            EntityBase <TKey> entity = obj as EntityBase <TKey>;

            if (entity == null)
            {
                return(false);
            }
            return(Id.Equals(entity.Id) && CreatedTime.Equals(entity.CreatedTime));
        }
Пример #25
0
            public Session(string name = MAIN_SESSION_NAME)
            {
                TimeMark  = CreatedTime.ToString("yyMMddHHmmss");
                this.name = name;

                //if (Log.mode == Mode.ONLY_LOG)
                //    throw new Exception("SessionDir cannot be used in Log.Mode.ONLY_LOG");

                path = get_path(name);
                if (Log.mode == Mode.SESSIONS && writeLog)
                {
                    Directory.CreateDirectory(path);
                }
            }
Пример #26
0
        public CheckInWrapper(Checkin i_RealCheckIn)
        {
            r_RealCheckIn     = i_RealCheckIn;
            r_CheckInLocation = new PointLatLng((double)r_RealCheckIn.Place.Location.Latitude, (double)r_RealCheckIn.Place.Location.Longitude);
            updateProperties();

            StringBuilder descriptionToToolTip = new StringBuilder();

            descriptionToToolTip.AppendLine("Name: " + Name);
            descriptionToToolTip.AppendLine("You Been there on: " + CreatedTime.ToString());

            r_CheckInMarkerOnMap             = new GMarkerGoogle(r_CheckInLocation, GMarkerGoogleType.pink);
            r_CheckInMarkerOnMap.ToolTipText = descriptionToToolTip.ToString();
        }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Id.GetHashCode();
         hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ RelativePosition.GetHashCode();
         hashCode = (hashCode * 397) ^ RelativeRotationEuler.GetHashCode();
         hashCode = (hashCode * 397) ^ ObjectScale.GetHashCode();
         hashCode = (hashCode * 397) ^ CreatedTime.GetHashCode();
         hashCode = (hashCode * 397) ^ LastUpdatedTime.GetHashCode();
         hashCode = (hashCode * 397) ^ LastUsedTime.GetHashCode();
         return(hashCode);
     }
 }
Пример #28
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.revision)
            {
                hashcode = (hashcode * 397) + Revision.GetHashCode();
            }
            if (__isset.createdTime)
            {
                hashcode = (hashcode * 397) + CreatedTime.GetHashCode();
            }
            if (__isset.type)
            {
                hashcode = (hashcode * 397) + Type.GetHashCode();
            }
            if (__isset.reqSeq)
            {
                hashcode = (hashcode * 397) + ReqSeq.GetHashCode();
            }
            if (__isset.checksum)
            {
                hashcode = (hashcode * 397) + Checksum.GetHashCode();
            }
            if (__isset.status)
            {
                hashcode = (hashcode * 397) + Status.GetHashCode();
            }
            if (__isset.param1)
            {
                hashcode = (hashcode * 397) + Param1.GetHashCode();
            }
            if (__isset.param2)
            {
                hashcode = (hashcode * 397) + Param2.GetHashCode();
            }
            if (__isset.param3)
            {
                hashcode = (hashcode * 397) + Param3.GetHashCode();
            }
            if (__isset.message)
            {
                hashcode = (hashcode * 397) + Message.GetHashCode();
            }
        }
        return(hashcode);
    }
Пример #29
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.id)
            {
                hashcode = (hashcode * 397) + Id.GetHashCode();
            }
            if (__isset.createdTime)
            {
                hashcode = (hashcode * 397) + CreatedTime.GetHashCode();
            }
            if (__isset.name)
            {
                hashcode = (hashcode * 397) + Name.GetHashCode();
            }
            if (__isset.pictureStatus)
            {
                hashcode = (hashcode * 397) + PictureStatus.GetHashCode();
            }
            if (__isset.preventedJoinByTicket)
            {
                hashcode = (hashcode * 397) + PreventedJoinByTicket.GetHashCode();
            }
            if (__isset.groupPreference)
            {
                hashcode = (hashcode * 397) + GroupPreference.GetHashCode();
            }
            if (__isset.members)
            {
                hashcode = (hashcode * 397) + TCollections.GetHashCode(Members);
            }
            if (__isset.creator)
            {
                hashcode = (hashcode * 397) + Creator.GetHashCode();
            }
            if (__isset.invitee)
            {
                hashcode = (hashcode * 397) + TCollections.GetHashCode(Invitee);
            }
            if (__isset.notificationDisabled)
            {
                hashcode = (hashcode * 397) + NotificationDisabled.GetHashCode();
            }
        }
        return(hashcode);
    }
Пример #30
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.id)
            {
                hashcode = (hashcode * 397) + Id.GetHashCode();
            }
            if (__isset.to)
            {
                hashcode = (hashcode * 397) + To.GetHashCode();
            }
            if (__isset.from_)
            {
                hashcode = (hashcode * 397) + From_.GetHashCode();
            }
            if (__isset.toChannel)
            {
                hashcode = (hashcode * 397) + ToChannel.GetHashCode();
            }
            if (__isset.fromChannel)
            {
                hashcode = (hashcode * 397) + FromChannel.GetHashCode();
            }
            if (__isset.eventType)
            {
                hashcode = (hashcode * 397) + EventType.GetHashCode();
            }
            if (__isset.createdTime)
            {
                hashcode = (hashcode * 397) + CreatedTime.GetHashCode();
            }
            if (__isset.operationRevision)
            {
                hashcode = (hashcode * 397) + OperationRevision.GetHashCode();
            }
            if (__isset.content)
            {
                hashcode = (hashcode * 397) + TCollections.GetHashCode(Content);
            }
            if (__isset.push)
            {
                hashcode = (hashcode * 397) + TCollections.GetHashCode(Push);
            }
        }
        return(hashcode);
    }