/// <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 (Class != null) { hashCode = hashCode * 59 + Class.GetHashCode(); } if (ShortDescription != null) { hashCode = hashCode * 59 + ShortDescription.GetHashCode(); } if (UserId != null) { hashCode = hashCode * 59 + UserId.GetHashCode(); } if (UserName != null) { hashCode = hashCode * 59 + UserName.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if CauseUserIdCause instances are equal /// </summary> /// <param name="other">Instance of CauseUserIdCause to be compared</param> /// <returns>Boolean</returns> public bool Equals(CauseUserIdCause other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Class == other.Class || Class != null && Class.Equals(other.Class) ) && ( ShortDescription == other.ShortDescription || ShortDescription != null && ShortDescription.Equals(other.ShortDescription) ) && ( UserId == other.UserId || UserId != null && UserId.Equals(other.UserId) ) && ( UserName == other.UserName || UserName != null && UserName.Equals(other.UserName) )); }
public ActionResult DeleteConfirmed(int id) { ShortDescription shortDescription = db.ShortDescriptions.Find(id); db.ShortDescriptions.Remove(shortDescription); db.SaveChanges(); return(RedirectToAction("../StockManagement/Index")); }
public override bool Equals(Description other) { if (other == null) { return(false); } return(ShortDescription.Equals(other.ShortDescription, StringComparison.InvariantCultureIgnoreCase) && LongDescription.Equals(other.LongDescription, StringComparison.InvariantCultureIgnoreCase)); }
public ActionResult Edit([Bind(Include = "ShortDescriptionId,ShortTextDescription")] ShortDescription shortDescription) { if (ModelState.IsValid) { db.Entry(shortDescription).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("../StockManagement/Index")); } return(View(shortDescription)); }
public ActionResult Create([Bind(Include = "ShortDescriptionId,ShortTextDescription")] ShortDescription shortDescription) { if (ModelState.IsValid) { db.ShortDescriptions.Add(shortDescription); db.SaveChanges(); return(RedirectToAction("../StockManagement/Index")); } return(View(shortDescription)); }
public override int GetHashCode() { int result = 1; result = (result * 397) ^ (Content != null ? Content.GetHashCode() : 0); result = (result * 397) ^ CreatedOn.GetHashCode(); result = (result * 397) ^ (DefaultImageFilelName != null ? DefaultImageFilelName.GetHashCode() : 0); result = (result * 397) ^ Id.GetHashCode(); result = (result * 397) ^ (ShortDescription != null ? ShortDescription.GetHashCode() : 0); result = (result * 397) ^ (Title != null ? Title.GetHashCode() : 0); return(result); }
// GET: ShortDescriptions/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ShortDescription shortDescription = db.ShortDescriptions.Find(id); if (shortDescription == null) { return(HttpNotFound()); } return(View(shortDescription)); }
public bool HasExplicitShortDescription() { if (ShortDescription.IsEmpty()) { return(false); } if (TargetType == null) { return(true); } return(ShortDescription != TargetType.FullName.ToString()); }
///////////////////////////////////////////////////////////////////////////////////////////////////// #region Serialization ///////////////////////////////////////////////////////////////////////////////////////////////////// public override XElement ToXML(bool internalPurpose = true) { XDocument res = Utilities.CreateXMLDoc("Group", false); res.Root.Add( new XElement(ConfigReader.S2CNS + "ID", ID), new XElement(ConfigReader.S2CNS + "Name", Name.FixXML()), new XElement(ConfigReader.S2CNS + "Policy", Policy), new XElement(ConfigReader.S2CNS + "ShortDescription", ShortDescription.FixXML()), new XElement(ConfigReader.S2CNS + "Description", Description.FixXML()), new XElement(ConfigReader.S2CNS + "CreatorID", CreatorID), new XElement(ConfigReader.S2CNS + "NumOfSnippets", NumOfSnippets), new XElement(ConfigReader.S2CNS + "MembersCount", MembersCount), Preferences.ToXML(false) ); return(res.Root); }
void ReleaseDesignerOutlets() { if (Image != null) { Image.Dispose(); Image = null; } if (ShortDescription != null) { ShortDescription.Dispose(); ShortDescription = null; } if (Title != null) { Title.Dispose(); Title = null; } }
public virtual void FinishLoad(int zoneObjectSyncValue = -1) { if (zoneObjectSyncValue != -1) { ZoneObjectSyncLoad(zoneObjectSyncValue); } if (_flavorOptions != null && _flavorOptions.Count != 0) { foreach (string key in FlavorOptions.Keys) { int selectedPosition = GlobalReference.GlobalValues.Random.Next(FlavorOptions[key].Count); string selectedFlavorOption = FlavorOptions[key][selectedPosition]; ShortDescription = ShortDescription.Replace(key, selectedFlavorOption); LongDescription = LongDescription.Replace(key, selectedFlavorOption); ExamineDescription = ExamineDescription.Replace(key, selectedFlavorOption); SentenceDescription = SentenceDescription.Replace(key, selectedFlavorOption); for (int i = 0; i < KeyWords.Count; i++) { KeyWords[i] = KeyWords[i].Replace(key, selectedFlavorOption); } } } ILoadableItems loadableItem = this as ILoadableItems; if (loadableItem != null) { if (loadableItem.LoadableItems.Count > 0) { foreach (ILoadPercentage percentage in loadableItem.LoadableItems) { if (percentage.Load) { AddItem(this, percentage.Object); percentage.Object.FinishLoad(); } } } } }
/// <summary> /// Parse the ShortDescription into PsObject /// </summary> /// <param name="shortDescription">ShortDescription to be converted</param> /// <returns>PsRecommendationBaseShortDescription generated</returns> internal static PsRecommendationBaseShortDescription FromShortDescription(ShortDescription shortDescription) { if (shortDescription == null) { return(null); } PsRecommendationBaseShortDescription psRecommendationBaseShortDescription = new PsRecommendationBaseShortDescription(); if (!string.IsNullOrEmpty(shortDescription.Problem)) { psRecommendationBaseShortDescription.Problem = shortDescription.Problem; } if (!string.IsNullOrEmpty(shortDescription.Solution)) { psRecommendationBaseShortDescription.Solution = shortDescription.Solution; } return(psRecommendationBaseShortDescription); }
public override int GetHashCode() { unchecked { var hashCode = Attributes != null?Attributes.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (CatalogVisibility != null ? CatalogVisibility.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Categories != null ? Categories.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ExternalUrl != null ? ExternalUrl.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Featured.GetHashCode(); hashCode = (hashCode * 397) ^ Id; hashCode = (hashCode * 397) ^ (Images != null ? Images.GetHashCode() : 0); hashCode = (hashCode * 397) ^ InStock.GetHashCode(); hashCode = (hashCode * 397) ^ ManageStock.GetHashCode(); hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ OnSale.GetHashCode(); hashCode = (hashCode * 397) ^ ParentId; hashCode = (hashCode * 397) ^ (Permalink != null ? Permalink.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Price != null ? Price.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (PriceHtml != null ? PriceHtml.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Purchasable.GetHashCode(); hashCode = (hashCode * 397) ^ (RegularPrice != null ? RegularPrice.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (RelatedIds != null ? RelatedIds.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (SalePrice != null ? SalePrice.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ShortDescription != null ? ShortDescription.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Sku != null ? Sku.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Slug != null ? Slug.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Status != null ? Status.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (StockQuantity != null ? StockQuantity.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Tags != null ? Tags.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (TaxClass != null ? TaxClass.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (TaxStatus != null ? TaxStatus.GetHashCode() : 0); hashCode = (hashCode * 397) ^ TotalSales; hashCode = (hashCode * 397) ^ (Type != null ? Type.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Virtual.GetHashCode(); return(hashCode); } }
public virtual void ZoneObjectSyncLoad(int syncValue) { if (ZoneSyncOptions.Count != 0) { foreach (string key in ZoneSyncOptions.Keys) { string selectedFlavorOption = ZoneSyncOptions[key][syncValue]; ShortDescription = ShortDescription.Replace(key, selectedFlavorOption); LongDescription = LongDescription.Replace(key, selectedFlavorOption); ExamineDescription = ExamineDescription.Replace(key, selectedFlavorOption); if (SentenceDescription != null) //rooms do not have sentence descriptions { SentenceDescription = SentenceDescription.Replace(key, selectedFlavorOption); } if (key == "ZoneSyncKeywords") { KeyWords.AddRange(selectedFlavorOption.Split(',')); } } } }
/// <summary> /// Returns true if Product instances are equal /// </summary> /// <param name="other">Instance of Product to be compared</param> /// <returns>Boolean</returns> public bool Equals(Product other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Ean == other.Ean || Ean != null && Ean.Equals(other.Ean) ) && ( Type == other.Type || Type != null && Type.Equals(other.Type) ) && ( Status == other.Status || Status != null && Status.Equals(other.Status) ) && ( Name == other.Name || Name != null && Name.Equals(other.Name) ) && ( Streams == other.Streams || Streams != null && Streams.SequenceEqual(other.Streams) ) && ( LevelSubjects == other.LevelSubjects || LevelSubjects != null && LevelSubjects.SequenceEqual(other.LevelSubjects) ) && ( Models == other.Models || Models != null && Models.SequenceEqual(other.Models) ) && ( TrialAccessUrl == other.TrialAccessUrl || TrialAccessUrl != null && TrialAccessUrl.Equals(other.TrialAccessUrl) ) && ( DefaultAccessUrl == other.DefaultAccessUrl || DefaultAccessUrl != null && DefaultAccessUrl.Equals(other.DefaultAccessUrl) ) && ( ShortDescription == other.ShortDescription || ShortDescription != null && ShortDescription.Equals(other.ShortDescription) ) && ( LongDescription == other.LongDescription || LongDescription != null && LongDescription.Equals(other.LongDescription) ) && ( Media == other.Media || Media != null && Media.Equals(other.Media) ) && ( RelatedProducts == other.RelatedProducts || RelatedProducts != null && RelatedProducts.SequenceEqual(other.RelatedProducts) ) && ( BundledProducts == other.BundledProducts || BundledProducts != null && BundledProducts.SequenceEqual(other.BundledProducts) )); }
public void Write(EndianBinaryWriter er) { er.Write(ShortDescription.PadRight(64, '\0'), Encoding.Unicode, false); er.Write(LongDescription.PadRight(128, '\0'), Encoding.Unicode, false); er.Write(Publisher.PadRight(64, '\0'), Encoding.Unicode, false); }
/// <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 (Ean != null) { hashCode = hashCode * 59 + Ean.GetHashCode(); } if (Type != null) { hashCode = hashCode * 59 + Type.GetHashCode(); } if (Status != null) { hashCode = hashCode * 59 + Status.GetHashCode(); } if (Name != null) { hashCode = hashCode * 59 + Name.GetHashCode(); } if (Streams != null) { hashCode = hashCode * 59 + Streams.GetHashCode(); } if (LevelSubjects != null) { hashCode = hashCode * 59 + LevelSubjects.GetHashCode(); } if (Models != null) { hashCode = hashCode * 59 + Models.GetHashCode(); } if (TrialAccessUrl != null) { hashCode = hashCode * 59 + TrialAccessUrl.GetHashCode(); } if (DefaultAccessUrl != null) { hashCode = hashCode * 59 + DefaultAccessUrl.GetHashCode(); } if (ShortDescription != null) { hashCode = hashCode * 59 + ShortDescription.GetHashCode(); } if (LongDescription != null) { hashCode = hashCode * 59 + LongDescription.GetHashCode(); } if (Media != null) { hashCode = hashCode * 59 + Media.GetHashCode(); } if (RelatedProducts != null) { hashCode = hashCode * 59 + RelatedProducts.GetHashCode(); } if (BundledProducts != null) { hashCode = hashCode * 59 + BundledProducts.GetHashCode(); } return(hashCode); } }
public override int GetHashCode() { int result = 17; unchecked { if (Id != null) { result = (result * 31) + Id.GetHashCode(); } if (Name != null) { result = (result * 31) + Name.GetHashCode(); } if (ShortDescription != null) { result = (result * 31) + ShortDescription.GetHashCode(); } if (FullDescription != null) { result = (result * 31) + FullDescription.GetHashCode(); } if (MessageFormats != null) { // Use xor for dictionaries to be order-independent. int xor_0 = 0; foreach (var value_0 in MessageFormats) { xor_0 ^= value_0.Key.GetHashCode(); if (value_0.Value != null) { xor_0 ^= value_0.Value.GetHashCode(); } } result = (result * 31) + xor_0; } if (HelpUri != null) { result = (result * 31) + HelpUri.GetHashCode(); } if (Properties != null) { // Use xor for dictionaries to be order-independent. int xor_1 = 0; foreach (var value_1 in Properties) { xor_1 ^= value_1.Key.GetHashCode(); if (value_1.Value != null) { xor_1 ^= value_1.Value.GetHashCode(); } } result = (result * 31) + xor_1; } if (Tags != null) { foreach (var value_2 in Tags) { result = result * 31; if (value_2 != null) { result = (result * 31) + value_2.GetHashCode(); } } } } return(result); }
public override int GetHashCode() { return(LongDescription.GetHashCode() + ShortDescription.GetHashCode()); }