public override int GetHashCode() { int hash = Name.GetHashCode(); if (Icon != null) { hash ^= Icon.GetHashCode(); } hash ^= IsRepeatable.GetHashCode(); hash ^= RequiredLevel.GetHashCode(); hash ^= XpLevel.GetHashCode(); hash ^= Difficulty.GetHashCode(); hash ^= CanAbandon.GetHashCode(); hash ^= IsHidden.GetHashCode(); hash ^= IsClassQuest.GetHashCode(); hash ^= IsBonus.GetHashCode(); hash ^= BonusShareable.GetHashCode(); hash ^= Category.GetHashCode(); foreach (var x in Branches) { hash ^= x.GetHashCode(); } foreach (var x in Classes) { hash ^= x.Id.GetHashCode(); } return(hash); }
/// <summary> /// /// </summary> /// <returns></returns> public override bool Save(XmlWriter writer) { if (writer == null) { return(false); } writer.WriteStartElement(Tag); writer.WriteAttributeString("hidden", IsHidden.ToString()); writer.WriteAttributeString("reusable", Reusable.ToString()); writer.WriteAttributeString("used", WasUsed.ToString()); writer.WriteAttributeString("primary", DecorationPrimary.ToString()); writer.WriteAttributeString("secondary", DecorationSecondary.ToString()); if (Scripts.Count > 0) { writer.WriteStartElement("scripts"); foreach (PressurePlateScript script in Scripts) { script.Save(writer); } writer.WriteEndElement(); } base.Save(writer); writer.WriteEndElement(); return(true); }
public override int GetHashCode() { int hash = Title.GetHashCode(); hash ^= Text.GetHashCode(); hash ^= Level.GetHashCode(); if (Image != null) { hash ^= Image.GetHashCode(); } hash ^= CategoryId.GetHashCode(); hash ^= Faction.GetHashCode(); hash ^= IsHidden.GetHashCode(); if (ClassRestricted) { foreach (var x in Classes) { hash ^= x.Fqn.GetHashCode(); } } if (HasPlanets) { foreach (var x in Planets) { hash ^= x.Id.GetHashCode(); } } return(hash); }
public override int GetHashCode() { unchecked { int hashCode = (ColumnName != null ? ColumnName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Width.GetHashCode(); hashCode = (hashCode * 397) ^ IsHidden.GetHashCode(); return(hashCode); } }
public bool IsHiddenOrParentHidden() { var isHidden = IsHidden.Value(); if (!isHidden && ParentAsset != null) { isHidden = ParentAsset.IsHiddenOrParentHidden(); } return(isHidden); }
public override int GetHashCode() { int hash = 1; if (Id.Length != 0) { hash ^= Id.GetHashCode(); } if (Name.Length != 0) { hash ^= Name.GetHashCode(); } if (Description.Length != 0) { hash ^= Description.GetHashCode(); } if (Type.Length != 0) { hash ^= Type.GetHashCode(); } if (IsDimension != false) { hash ^= IsDimension.GetHashCode(); } if (IsHidden != false) { hash ^= IsHidden.GetHashCode(); } if (NextSiblingId.Length != 0) { hash ^= NextSiblingId.GetHashCode(); } if (ParentId.Length != 0) { hash ^= ParentId.GetHashCode(); } if (HeaderId.Length != 0) { hash ^= HeaderId.GetHashCode(); } if (format_ != null) { hash ^= Format.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
/// <inheritdoc /> public override int GetHashCode() { unchecked { var hashCode = Id.GetHashCode(); hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Category != null ? Category.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Placements != null ? Placements.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Countries != null ? Countries.GetHashCode() : 0); hashCode = (hashCode * 397) ^ IsHidden.GetHashCode(); hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ModeratorDescription != null ? ModeratorDescription.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)Applicability; return(hashCode); } }
public override int GetHashCode() { int hash = Level.GetHashCode(); if (Description != null) { hash ^= Description.GetHashCode(); } if (Name != null) { hash ^= Name.GetHashCode(); } if (Icon != null) { hash ^= Icon.GetHashCode(); } hash ^= IsHidden.GetHashCode(); hash ^= IsPassive.GetHashCode(); hash ^= Cooldown.GetHashCode(); hash ^= CastingTime.GetHashCode(); hash ^= ChannelingTime.GetHashCode(); hash ^= ForceCost.GetHashCode(); hash ^= EnergyCost.GetHashCode(); hash ^= ApCost.GetHashCode(); hash ^= ApType.GetHashCode(); hash ^= MinRange.GetHashCode(); hash ^= MaxRange.GetHashCode(); hash ^= GCD.GetHashCode(); hash ^= GcdOverride.GetHashCode(); if (AbilityTokens != null) { hash ^= AbilityTokens.GetHashCode(); } hash ^= TargetArc.GetHashCode(); hash ^= TargetArcOffset.GetHashCode(); hash ^= TargetRule.GetHashCode(); hash ^= LineOfSightCheck.GetHashCode(); hash ^= Pushback.GetHashCode(); hash ^= IgnoreAlacrity.GetHashCode(); return(hash); }
/// <summary> /// /// </summary> /// <param name="writer"></param> /// <returns></returns> public override bool Save(XmlWriter writer) { if (writer == null) { return(false); } writer.WriteStartElement(Tag); writer.WriteAttributeString("hidden", IsHidden.ToString()); writer.WriteAttributeString("difficulty", Difficulty.ToString()); if (Target != null) { Target.Save("target", writer); } Damage.Save("damage", writer); base.Save(writer); writer.WriteEndElement(); return(true); }
protected bool Equals(ColumnSettings other) { return(string.Equals(ColumnName, other.ColumnName) && Width.Equals(other.Width) && IsHidden.Equals(other.IsHidden)); }
/// <summary> /// Saves the service record details given in the excel sheet data for given number of records <paramref name="RecordNo"/> and /// returns data if record successfully saved /// </summary> /// <returns> /// If the record exists in the table /// </returns> /// <param name="RecordNo">The number of records to be saved as int Value </param> internal string SaveNew(int RecordNo) { //Populate the Excel Sheet GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ServiceListing"); Thread.Sleep(1000); //Record Row No Starts with 2 in the DataSet RecordNo += 2; //Enter Title string TitleInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "Title"); Title.SendKeys(TitleInput); //Enter Description string DescriptionInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "Description"); Description.SendKeys(DescriptionInput); //Select Category string CategoryInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "Category"); if (!("" == CategoryInput || null == CategoryInput)) { ValidateCategory(CategoryInput); var selectCategory = new SelectElement(Category); selectCategory.SelectByText(CategoryInput); Thread.Sleep(1000); } //Select SubCategory string SubCategoryInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "SubCategory"); if (!("" == SubCategoryInput || null == SubCategoryInput)) { ValidateSubCategory(SubCategoryInput); var selectSubCatElement = new SelectElement(SubCategory); selectSubCatElement.SelectByText(SubCategoryInput); Thread.Sleep(500); } //Add tags //Multiple Tag values are supported using ',' seperater under the Tags column var TagsInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "Tags"); string[] Inputs = TagsInput.Split(','); foreach (var tag in Inputs) { Tags.SendKeys(tag); Tags.SendKeys(Keys.Enter); Thread.Sleep(200); } //Select Service Type var ServiceTypeInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "ServiceType"); if (!("" == ServiceTypeInput || null == ServiceTypeInput)) { ValidateServiceType(ServiceTypeInput); if (ServiceTypeInput == "Hourly basis service") { ServiceTypeHourlyBased.Click(); } else { ServiceTypeOneOff.Click(); } Thread.Sleep(500); } //Select Location Type var LocationTypeInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "LocationType"); if (!("" == LocationTypeInput || null == LocationTypeInput)) { ValidateLocationType(LocationTypeInput); if (LocationTypeInput == "On-site") { LocationTypeOnSite.Click(); } else { LocationTypeOnline.Click(); } Thread.Sleep(500); } //Enter available days var StartDateInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "StartDate"); var StartMonthInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "StartMonth"); var StartYearInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "StartYear"); var EndDateInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "EndDate"); var EndMonthInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "EndMonth"); var EndYearInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "EndYear"); var AvailDaysInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "AvailableDays"); var StartTimeInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "StartTime"); var EndTimeInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "EndTime"); if (StartDateInput != "") { StartDate.SendKeys(StartMonthInput); Thread.Sleep(200); StartDate.SendKeys(StartDateInput); Thread.Sleep(200); StartDate.SendKeys(StartYearInput); Thread.Sleep(500); } if (EndDateInput != "") { EndDate.SendKeys(EndMonthInput); Thread.Sleep(200); EndDate.SendKeys(EndDateInput); Thread.Sleep(200); EndDate.SendKeys(EndYearInput); Thread.Sleep(500); } string[] Days = AvailDaysInput.Split(','); foreach (var AvailDay in Days) { switch (AvailDay) { case "Sun": SunCheckBox.Click(); SunStartTime.SendKeys(StartTimeInput); SunEndTime.SendKeys(EndTimeInput); break; case "Mon": MonCheckBox.Click(); MonStartTime.SendKeys(StartTimeInput); MonEndTime.SendKeys(EndTimeInput); break; case "Tue": TueCheckBox.Click(); TueStartTime.SendKeys(StartTimeInput); TueEndTime.SendKeys(EndTimeInput); break; case "Wed": WedCheckBox.Click(); WedStartTime.SendKeys(StartTimeInput); WedEndTime.SendKeys(EndTimeInput); break; case "Thur": ThursCheckBox.Click(); ThursStartTime.SendKeys(StartTimeInput); ThursEndTime.SendKeys(EndTimeInput); break; case "Fri": FriCheckBox.Click(); FriStartTime.SendKeys(StartTimeInput); FriEndTime.SendKeys(EndTimeInput); break; case "Sat": SatCheckBox.Click(); SatStartTime.SendKeys(StartTimeInput); SatEndTime.SendKeys(EndTimeInput); break; } Thread.Sleep(300); } //Select Skill Trade var SkillTradeInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "SkillTrade"); if (!("" == SkillTradeInput || null == SkillTradeInput)) { ValidateSkillTradeOption(SkillTradeInput); if (SkillTradeInput == "Skill-exchange") { SkillTradeExchange.Click(); Thread.Sleep(500); //Add Skill Exchange Tags //Multiple Tag values are supported using ',' seperater under the Skill Exchange Tags column var SkillExTagsInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "SkillExchangeTags"); if (SkillExTagsInput != "") { string[] SkillExTags = SkillExTagsInput.Split(','); foreach (var skill in SkillExTags) { SkillExchangeTags.SendKeys(skill); SkillExchangeTags.SendKeys(Keys.Enter); Thread.Sleep(300); } } } else { SkillTradeCredit.Click(); Thread.Sleep(500); //Add Skill Trade Credit Amount var SkillCreditAmountInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "SkillTradeCredit"); Thread.Sleep(500); if (SkillCreditAmountInput != "") { ChargeAmount.SendKeys(SkillCreditAmountInput); Thread.Sleep(500); } } } //Add Work Samples var WorkSampleInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "WorkSamples"); if (WorkSampleInput != "") { WorkSampleUpload.Click(); AutoItX3 autoItX3 = new AutoItX3(); autoItX3.WinActivate("File Upload"); Thread.Sleep(200); autoItX3.Send(@WorkSampleInput); Thread.Sleep(500); autoItX3.Send("{ENTER}"); Thread.Sleep(1000); } //Select Active Status var ActiveInput = GlobalDefinitions.ExcelLib.ReadData(RecordNo, "Active"); if (!("" == ActiveInput || null == ActiveInput)) { ValidateActiveOption(ActiveInput); if (ActiveInput == "Active") { IsActive.Click(); } else { IsHidden.Click(); } Thread.Sleep(500); } //Save Service Details Save.Click(); Thread.Sleep(2000); //Check the saved record in the listings ManageListing manageListing = new ManageListing(); bool IsExist = manageListing.ValidateRecordInTable(CategoryInput, TitleInput); return(IsExist.ToString()); }
public override string ToString() { StringBuilder strRet = new StringBuilder(); strRet.Append("{"); //ZOrder int if (ZOrder != null) { strRet.AppendFormat("order:{0}", ZOrder.ToString()); } //Heading string if (Name != string.Empty) { strRet.AppendFormat(", name:'{0}'", Name); //strRet.AppendFormat(", index:'{0}'", ZOrder.ToString()); strRet.AppendFormat(", index:'{0}'", DataMappingName); } //DataType if (DataType != string.Empty) { strRet.AppendFormat(", sorttype:'{0}'", DataType); } //DataAlign if (DataAlign != string.Empty) { strRet.AppendFormat(", align:'{0}'", DataAlign); } //width if (Width != null) { strRet.AppendFormat(", width:{0}", Width.ToString()); } //IsSortable if (Sortable != null) { strRet.AppendFormat(", sortable:{0}", (bool)Sortable ? "true" : "false"); } //IsEditable if (IsEditable != null) { strRet.AppendFormat(", editable:{0}", (bool)IsEditable ? "true" : "false"); } //EditOptions if (EditOptions != string.Empty) { strRet.AppendFormat(", editoptions:{0}", EditOptions); } //FreezeIndex int if (Index != string.Empty) { strRet.AppendFormat(", index:'{0}'", Index); } //FreezeIndex int if (IsHidden != null) { strRet.AppendFormat(", hidden:{0}", IsHidden.ToString().ToLower()); } if (Format != string.Empty) { strRet.AppendFormat(", formatter: {0}", Format); strRet.AppendFormat(", sformatter: '{0}'", Format); } if (Resizable != null) { strRet.AppendFormat(", resizable:{0}", Resizable.ToString().ToLower()); } if (Classes != string.Empty) { strRet.AppendFormat(", classes: '{0}'", Classes); } if (IsDynamic != null) { strRet.AppendFormat(", isdynamic:{0}", (bool)IsDynamic ? "true" : "false"); } if (Frozen != null) { strRet.AppendFormat(", frozen:{0}", (bool)Frozen ? "true" : "false"); } if (SummaryType != string.Empty) { if (SummaryType.Contains("fn:")) { strRet.AppendFormat(", summaryType: {0}", SummaryType.Replace("fn:", "")); } else { strRet.AppendFormat(", summaryType: '{0}'", SummaryType); } } if (SummaryTemplate != string.Empty) { strRet.AppendFormat(", summaryTpl: '{0}'", SummaryTemplate); } if (ConditionStyleName != string.Empty) { strRet.AppendFormat(", ConditionStyleName: '{0}'", ConditionStyleName); } if (FontItalic != null) { strRet.AppendFormat(", FontItalic:{0}", (bool)FontItalic ? "true" : "false"); } if (FontBold != null) { strRet.AppendFormat(", FontBold:{0}", (bool)FontBold ? "true" : "false"); } if (FontColor != string.Empty) { strRet.AppendFormat(", FontColor: '{0}'", FontColor); } if (BackColor != string.Empty) { strRet.AppendFormat(", BackColor: '{0}'", BackColor); } if (iCSS != string.Empty) { strRet.AppendFormat(", iCSS: '{0}'", iCSS); } if (AdditionAttribute != string.Empty && AdditionAttribute != null) { string[] arr = AdditionAttribute.Split(','); if (arr.Length > 0) { for (int i = 0; i < arr.Length; i++) { strRet.AppendFormat(", {0}: {1}", arr[i].Split(':')[0], arr[i].Split(':')[1]); } } } strRet.Append("}"); return(strRet.ToString()); }