Пример #1
0
        /// <summary>
        /// Returns true if ConversationAccount instances are equal
        /// </summary>
        /// <param name="other">Instance of ConversationAccount to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ConversationAccount other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     IsGroup == other.IsGroup ||
                     IsGroup != null &&
                     IsGroup.Equals(other.IsGroup)
                     ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ));
        }
Пример #2
0
        /// <inheritdoc />
        public override int GetHashCode()
        {
            unchecked
            {
                int hashCode = GroupInviteLink != null?GroupInviteLink.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ IsGroup.GetHashCode();
                hashCode = (hashCode * 397) ^ (Participants != null ? Participants.GetHashCode() : 0);
                return(hashCode);
            }
        }
Пример #3
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Id.GetHashCode();
         hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsGroup.GetHashCode();
         hashCode = (hashCode * 397) ^ (GroupProjectPath != null ? GroupProjectPath.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ GroupProjectId.GetHashCode();
         return(hashCode);
     }
 }
Пример #4
0
 /// <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 (IsGroup != null)
         {
             hashCode = hashCode * 59 + IsGroup.GetHashCode();
         }
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #5
0
        // ========================================================

        #region Generated and modified Equals and GetHashCode methods

        protected bool Equals(IeUserGroup other)
        {
            return(Id.GetValueOrDefault() == other.Id.GetValueOrDefault() && string.Equals(Name, other.Name) && IsGroup.GetValueOrDefault() == other.IsGroup.GetValueOrDefault() && string.Equals(GroupProjectPath, other.GroupProjectPath) && GroupProjectId.GetValueOrDefault() == other.GroupProjectId.GetValueOrDefault());
        }
Пример #6
0
        /*
         * <propertyDescription name="Microsoft.SDKSample.DirectoryLevel" formatID="{581CF603-2925-4acf-BB5A-3D3EB39EACD3}" propID="3">
         *  <description>Number of directory levels to this item.</description>
         *  <searchInfo inInvertedIndex="false" isColumn="false,
         *  <typeInfo canStackBy="false" type="Int32"/>
         *  <labelInfo label="Directory Level"/>
         * </propertyDescription>
         */
        internal XmlElement GetXmlPropertyDescription(XmlDocument doc)
        {
            var desc = doc.CreateElement("propertyDescription");

            desc.SetAttribute("name", CanonicalName);
            desc.SetAttribute("formatID", FormatId.ToString("B").ToUpper());
            desc.SetAttribute("propID", PropertyId.ToString());

            var search = doc.CreateElement("searchInfo");

            search.SetAttribute("inInvertedIndex", InInvertedIndex.ToString());
            if (IsColumn)
            {
                search.SetAttribute("isColumn", IsColumn.ToString());
                search.SetAttribute("isColumnSparse", IsColumnSparse.ToString());
                search.SetAttribute("columnIndexType", ColumnIndexType.ToString());
            }
            if (MaxSize != 512)
            {
                search.SetAttribute("maxSize", MaxSize.ToString());
            }
            if (Mnemonics != null && Mnemonics.Length > 0)
            {
                search.SetAttribute("mnemonics", Mnemonics);
            }
            desc.AppendChild(search);

            var label = doc.CreateElement("labelInfo");

            label.SetAttribute("label", DisplayName);
            label.SetAttribute("sortDescription", SortDescription.ToString());
            if (EditInvitation != null && EditInvitation.Length > 0)
            {
                label.SetAttribute("invitationText", EditInvitation);
            }
            if (HideLabel)
            {
                label.SetAttribute("hideLabel", HideLabel.ToString());
            }
            desc.AppendChild(label);

            var type = doc.CreateElement("typeInfo");

            type.SetAttribute("type", Type.ToString());
            if (GroupingRange != PropertyGroupingRange.Discrete)
            {
                type.SetAttribute("groupingRange", GroupingRange.ToString());
            }
            if (IsInnate)
            {
                type.SetAttribute("isInnate", IsInnate.ToString());
            }
            if (IsInnate && CanBePurged)
            {
                type.SetAttribute("canBePurged", CanBePurged.ToString());
            }
            //if (MultipleValues)
            type.SetAttribute("multipleValues", MultipleValues.ToString());
            if (IsGroup)
            {
                type.SetAttribute("isGroup", IsGroup.ToString());
            }
            if (AggregationType != PropertyAggregationType.Default)
            {
                type.SetAttribute("aggregationType", AggregationType.ToString());
            }
            if (IsTreeProperty)
            {
                type.SetAttribute("isTreeProperty", IsTreeProperty.ToString());
            }
            if (IsViewable)
            {
                type.SetAttribute("isViewable", IsViewable.ToString());
            }
            if (SearchRawValue)
            {
                type.SetAttribute("searchRawValue", SearchRawValue.ToString());
            }
            if (ConditionType != PropertyConditionType.String)
            {
                type.SetAttribute("conditionType", ConditionType.ToString());
            }
            if (ConditionOperation != ConditionOperationConfigured.Equal)
            {
                type.SetAttribute("defaultOperation", ConditionOperation.ToString());
            }
            desc.AppendChild(type);

            var display = doc.CreateElement("displayInfo");

            display.SetAttribute("displayType", DisplayType.ToString());
            if (DisplayType == PropertyDisplayType.String && StringFormat != StringFormat.General)
            {
                var format = doc.CreateElement("stringFormat");
                format.SetAttribute("formatAs", StringFormat.ToString());
                display.AppendChild(format);
            }
            if (DisplayType == PropertyDisplayType.Boolean && BooleanFormat != BooleanFormat.YesNo)
            {
                var format = doc.CreateElement("booleanFormat");
                format.SetAttribute("formatAs", BooleanFormat.ToString());
                display.AppendChild(format);
            }
            if (DisplayType == PropertyDisplayType.Number && NumberFormat != NumberFormat.General)
            {
                var format = doc.CreateElement("numberFormat");
                format.SetAttribute("formatAs", NumberFormat.ToString());
                display.AppendChild(format);
            }
            if (DisplayType == PropertyDisplayType.DateTime && DateTimeFormat != DateTimeFormat.General)
            {
                var format = doc.CreateElement("dateTimeFormat");
                format.SetAttribute("formatAs", DateTimeFormat.ToString());
                display.AppendChild(format);
            }



            if (DefaultColumnWidth != 20)
            {
                display.SetAttribute("defaultColumnWidth", DefaultColumnWidth.ToString());
            }
            if (Alignment != PropertyAlignmentType.Left)
            {
                display.SetAttribute("alignment", Alignment.ToString());
            }
            //if (RelativeDescriptionType != RelativeDescriptionType.General)
            //  display.SetAttribute("relativeDescriptionType", RelativeDescriptionType.ToString());
            if (DefaultSortDirection != SortDirection.Ascending)
            {
                display.SetAttribute("defaultSortDirection", DefaultSortDirection.ToString());
            }
            if (EditControl != EditControl.Default)
            {
                var edit = doc.CreateElement("editControl");
                edit.SetAttribute("control", EditControl.ToString());
                display.AppendChild(edit);
            }
            desc.AppendChild(display);

            return(desc);
        }