/// <summary> /// Provides a listing of the tokens that the customer information can be replaced with in email templates /// </summary> /// <param name="context">An instance of the Hotcakes Request context object</param> /// <returns>List of name/value pairs of the tokens and replacement content</returns> public List <HtmlTemplateTag> GetReplaceableTags(HccRequestContext context) { var result = new List <HtmlTemplateTag>(); result.Add(new HtmlTemplateTag("[[User.Bvin]]", Bvin)); // TODO: make this obsolete result.Add(new HtmlTemplateTag("[[User.Notes]]", Notes)); result.Add(new HtmlTemplateTag("[[User.Comment]]", GlobalLocalization.GetString("UserCommentObsolete"), true)); result.Add(new HtmlTemplateTag("[[User.CreationDate]]", DateHelper.ConvertUtcToStoreTime(context.CurrentStore, CreationDateUtc).ToString())); result.Add(new HtmlTemplateTag("[[User.Email]]", Email)); result.Add(new HtmlTemplateTag("[[User.UserName]]", Username)); result.Add(new HtmlTemplateTag("[[User.FirstName]]", FirstName)); result.Add(new HtmlTemplateTag("[[User.LastLoginDate]]", DateHelper.ConvertUtcToStoreTime(context.CurrentStore, LastLoginDateUtc).ToString())); result.Add(new HtmlTemplateTag("[[User.LastName]]", LastName)); result.Add(new HtmlTemplateTag("[[User.LastUpdated]]", DateHelper.ConvertUtcToStoreTime(context.CurrentStore, LastUpdatedUtc).ToString())); result.Add(new HtmlTemplateTag("[[User.Locked]]", Locked.ToString())); result.Add(new HtmlTemplateTag("[[User.LockedUntil]]", DateHelper.ConvertUtcToStoreTime(context.CurrentStore, LockedUntilUtc).ToString())); result.Add(new HtmlTemplateTag("[[User.Password]]", Password)); return(result); }
private void CalculateInfo() { string[] infoArr = { "MOT", MOT.ToString(), "Sat Nav", SatNav.ToString(), "Locked", Locked.ToString(), "Manufacturer", Manufacturer, "Model", Model, "Wheels", Wheels.ToString(), "Gears", Gears.ToString(), "Fuel Level", FuelLevel.ToString(), "Fuel Type", FuelType.ToString(), "EngineCC", Engine.EngineCC.ToString(), "Mileage", Engine.Mileage.ToString(), "Service Needed", Engine.ServiceNeeded.ToString() }; for (int i = 0; i < infoArr.Length; i++) { Info = Info + infoArr[i] + ": "; i++; Info = Info + infoArr[i] + "\n"; } }
public void CheckForIsLocked() { float bestScore = GameplayController.Instance.BestScore; Locked = bestScore < UnlockAt; PlayerPrefs.SetString("TetherHead_" + ID, Locked.ToString()); UpdateLock(); }
internal IDictionary <string, object> GetAllValues() { var values = new Dictionary <string, object>(); values.Add("Id", Id); values.Add("NodeTypeId", NodeTypeId); values.Add("NodeType", FormatNodeType(NodeTypeId)); values.Add("ContentListId", ContentListId); values.Add("ContentListTypeId", ContentListTypeId); values.Add("ParentId", ParentId); values.Add("Name", Name); values.Add("DisplayName", DisplayName); values.Add("Path", Path); values.Add("Index", Index); values.Add("CreatingInProgress", CreatingInProgress.ToString().ToLower()); values.Add("IsDeleted", IsDeleted.ToString().ToLower()); values.Add("IsInherited", IsInherited.ToString().ToLower()); values.Add("CreationDate", FormatDate(CreationDate)); values.Add("ModificationDate", FormatDate(ModificationDate)); values.Add("CreatedById", CreatedById); values.Add("CreatedBy", FormatUser(CreatedById)); values.Add("ModifiedById", ModifiedById); values.Add("ModifiedBy", FormatUser(ModifiedById)); values.Add("VersionId", VersionId); values.Add("Version", Version.ToString()); values.Add("VersionCreationDate", FormatDate(VersionCreationDate)); values.Add("VersionModificationDate", FormatDate(VersionModificationDate)); values.Add("VersionCreatedById", VersionCreatedById); values.Add("VersionCreatedBy", FormatUser(VersionCreatedById)); values.Add("VersionModifiedById", VersionModifiedById); values.Add("VersionModifiedBy", FormatUser(VersionModifiedById)); values.Add("Locked", Locked.ToString().ToLower()); values.Add("LockedById", LockedById); values.Add("LockedBy", FormatUser(LockedById)); values.Add("ETag", ETag); values.Add("LockType", LockType); values.Add("LockTimeout", LockTimeout); values.Add("LockDate", FormatDate(LockDate)); values.Add("LockToken", LockToken); values.Add("LastLockUpdate", FormatDate(LastLockUpdate)); values.Add("IsSystem", IsSystem.ToString().ToLower()); values.Add("ClosestSecurityNodeId", ClosestSecurityNodeId); values.Add("SavingState", SavingState); foreach (var key in dynamicData.Keys) { var propType = ActiveSchema.PropertyTypes.GetItemById(key); if (propType != null) { values.Add(propType.Name.Replace("#", "_"), FormatDynamicData(dynamicData[key] ?? string.Empty, propType.DataType)); } } return(values); }
public override IODATAQueryManager DecorateFinder(IODATAQueryManager odataQuery) { if (ExpandProperties.HasValue && ExpandProperties.Value) { odataQuery = odataQuery.Expand("TemplateCollaborationUsers($expand=Role)") .Expand("TemplateCollaborationDocumentRepositories") .Expand("Roles"); } if (Status.HasValue) { if ((OnlyAuthorized.HasValue && OnlyAuthorized.Value) || (!string.IsNullOrEmpty(UserName) && IdRole != null)) { odataQuery = odataQuery.Filter(string.Concat("Status eq VecompSoftware.DocSuiteWeb.Model.Entities.Templates.TemplateCollaborationStatus'", (int)Status.Value, "'")); } else { odataQuery = odataQuery.Filter(string.Concat("Status eq VecompSoftware.DocSuiteWeb.Entity.Templates.TemplateCollaborationStatus'", (int)Status.Value, "'")); } } if (OnlyAuthorized.HasValue && OnlyAuthorized.Value) { odataQuery = odataQuery.Function(string.Format(CommonDefinition.OData.TemplateCollaborationService.FX_GetAuthorizedTemplates, UserName, Domain)); } if (!string.IsNullOrEmpty(UserName) && IdRole != null) { odataQuery = odataQuery.Function(string.Format(CommonDefinition.OData.TemplateCollaborationService.FX_GetInvalidatingTemplatesByRoleUserAccount, UserName, Domain, IdRole, DocumentType)); } if (Locked.HasValue) { odataQuery.Filter(string.Concat("IsLocked eq ", Locked.ToString().ToLower())); } if (!string.IsNullOrEmpty(DocumentType)) { string filter = string.Concat("DocumentType eq '", DocumentType, "'"); if (DocumentType.Equals("UDS", StringComparison.InvariantCultureIgnoreCase)) { filter = string.Concat(filter, " or (startswith(DocumentType, '1') and length(DocumentType) gt 2)"); } odataQuery.Filter(filter); } if (!string.IsNullOrEmpty(Name)) { odataQuery.Filter(string.Concat("Name eq '", Name, "'")); } return(base.DecorateFinder(odataQuery)); }
public void WriteXml(XmlWriter writer) { // If we reach this point through inventories we definitely have a tile // If we don't have a tile, that means we're writing a character's inventory if (Tile != null) { writer.WriteAttributeString("X", Tile.X.ToString()); writer.WriteAttributeString("Y", Tile.Y.ToString()); writer.WriteAttributeString("Z", Tile.Z.ToString()); } writer.WriteAttributeString("type", Type); writer.WriteAttributeString("maxStackSize", MaxStackSize.ToString()); writer.WriteAttributeString("stackSize", StackSize.ToString()); writer.WriteAttributeString("basePrice", BasePrice.ToString(CultureInfo.InvariantCulture)); writer.WriteAttributeString("category", Category); writer.WriteAttributeString("locked", Locked.ToString()); }
public void SaveAs(XmlDocument xml, XmlElement parent, bool create) { XmlElement self = create ? null : Self; if (null == self) { self = xml.CreateElement("BeanDefine"); parent.AppendChild(self); if (false == create) { Self = self; } } if (Parent != null) // root BeanDefine 自动设置成文件名。 { self.SetAttribute("name", Name); } self.SetAttribute("Locked", Locked.ToString()); foreach (var r in _ReferenceFroms.Values) { r.SaveAs(xml, self, create); } foreach (var e in _EnumDefines.Values) { e.SaveAs(xml, self, create); } foreach (var b in _BeanDefines.Values) { b.SaveAs(xml, self, create); } foreach (var v in _Variables) { v.SaveAs(xml, self, create); } }
public static void SaveSettings(Form form, XmlNode parentNode, string key) { var emptyNodeAlways = Xml.GetEmptyNodeAlways(Xml.GetNodeAlways(parentNode, "ToolStripConfiguration"), key); Xml.SetNewValue(emptyNodeAlways, "Size", IconSize.ToString(CultureInfo.InvariantCulture)); Xml.SetNewValue(emptyNodeAlways, "Locked", Locked.ToString()); Xml.SetNewValue(emptyNodeAlways, "Crosshairs", Crosshairs.ToString()); Xml.SetNewValue(emptyNodeAlways, "WaveformShown", WaveformShown.ToString()); foreach (Control control in form.Controls) { var stripContainer = control as ToolStripContainer; if (stripContainer == null) { continue; } WritePanel(emptyNodeAlways, stripContainer.TopToolStripPanel, "TopToolStripPanel"); WritePanel(emptyNodeAlways, stripContainer.LeftToolStripPanel, "LeftToolStripPanel"); WritePanel(emptyNodeAlways, stripContainer.RightToolStripPanel, "RightToolStripPanel"); WritePanel(emptyNodeAlways, stripContainer.BottomToolStripPanel, "BottomToolStripPanel"); break; } }
public String ToString() { return("Name: " + this.Name + "\nColor: " + this.Color.ToString() + "\nX: " + this.X + "\nY: " + this.Y + "\nLocked: " + Locked.ToString()); }
public override List <string> ToArgs() { var args = base.ToArgs(); if (!string.IsNullOrEmpty(QueryNot)) { args.Add($"q:not={QueryNot}"); } if (!string.IsNullOrEmpty(Title)) { args.Add($"title={Title}"); } if (!string.IsNullOrEmpty(TitleNot)) { args.Add($"title:not={TitleNot}"); } if (!string.IsNullOrEmpty(Selftext)) { args.Add($"selftext={Selftext}"); } if (!string.IsNullOrEmpty(SelftextNot)) { args.Add($"selftext:not={SelftextNot}"); } if (!string.IsNullOrEmpty(Score)) { args.Add($"score={Score}"); } if (!string.IsNullOrEmpty(NumComments)) { args.Add($"num_comments={NumComments}"); } if (Over18.HasValue) { args.Add($"over_18={Over18.ToString().ToLower()}"); } if (IsVideo.HasValue) { args.Add($"is_video={IsVideo.ToString().ToLower()}"); } if (Locked.HasValue) { args.Add($"locked={Locked.ToString().ToLower()}"); } if (Stickied.HasValue) { args.Add($"stickied={Stickied.ToString().ToLower()}"); } if (Spoiler.HasValue) { args.Add($"spoiler={Spoiler.ToString().ToLower()}"); } if (ContestMode.HasValue) { args.Add($"contest_mode={ContestMode.ToString().ToLower()}"); } return(args); }
public XmlNode ToXml(XmlDocument xmlDocument) { XmlNode topicXml = xmlDocument.CreateElement("topic"); topicXml.AppendChild(umbraco.xmlHelper.addTextNode(xmlDocument, "title", Title)); topicXml.AppendChild(umbraco.xmlHelper.addCDataNode(xmlDocument, "body", Body)); topicXml.AppendChild(umbraco.xmlHelper.addTextNode(xmlDocument, "urlname", UrlName)); // tags XmlNode tags = umbraco.xmlHelper.addTextNode(xmlDocument, "tags", ""); foreach (var tag in Tags) { var tagNode = umbraco.xmlHelper.addTextNode(xmlDocument, "tag", tag.Name); tagNode.Attributes.Append(umbraco.xmlHelper.addAttribute(xmlDocument, "id", tag.Id.ToString())); tagNode.Attributes.Append(umbraco.xmlHelper.addAttribute(xmlDocument, "weight", tag.Weight.ToString())); tags.AppendChild(tagNode); tags.AppendChild(tagNode); } topicXml.AppendChild(tags); if (topicXml.Attributes != null) { topicXml.Attributes.Append(umbraco.xmlHelper.addAttribute(xmlDocument, "id", Id.ToString(CultureInfo.InvariantCulture))); topicXml.Attributes.Append(umbraco.xmlHelper.addAttribute(xmlDocument, "parentId", ParentId.ToString(CultureInfo.InvariantCulture))); topicXml.Attributes.Append(umbraco.xmlHelper.addAttribute(xmlDocument, "memberId", MemberId.ToString(CultureInfo.InvariantCulture))); topicXml.Attributes.Append(umbraco.xmlHelper.addAttribute(xmlDocument, "latestReplyAuthor", LatestReplyAuthor.ToString(CultureInfo.InvariantCulture))); topicXml.Attributes.Append(umbraco.xmlHelper.addAttribute(xmlDocument, "created", Created.ToString(CultureInfo.InvariantCulture))); topicXml.Attributes.Append(umbraco.xmlHelper.addAttribute(xmlDocument, "updated", Updated.ToString(CultureInfo.InvariantCulture))); topicXml.Attributes.Append(umbraco.xmlHelper.addAttribute(xmlDocument, "locked", Locked.ToString())); topicXml.Attributes.Append(umbraco.xmlHelper.addAttribute(xmlDocument, "replies", Replies.ToString(CultureInfo.InvariantCulture))); topicXml.Attributes.Append(umbraco.xmlHelper.addAttribute(xmlDocument, "answer", Answer.ToString())); topicXml.Attributes.Append(umbraco.xmlHelper.addAttribute(xmlDocument, "score", Score.ToString())); } return(topicXml); }