public override IEnumerable <StateVariable> GetState() { return(new[] { new StateVariable { Name = "SavedSource.ResourceID", Type = StateVariable.StateType.Input, Value = SavedSource.ResourceID.ToString() }, new StateVariable { Name = "To", Type = StateVariable.StateType.Input, Value = To }, new StateVariable { Name = "Cc", Type = StateVariable.StateType.Input, Value = Cc }, new StateVariable { Name = "Bcc", Type = StateVariable.StateType.Input, Value = Bcc }, new StateVariable { Name = "Subject", Type = StateVariable.StateType.Input, Value = Subject }, new StateVariable { Name = "Attachments", Type = StateVariable.StateType.Input, Value = Attachments }, new StateVariable { Name = nameof(IsHtml), Type = StateVariable.StateType.Input, Value = IsHtml.ToString() }, new StateVariable { Name = "Body", Type = StateVariable.StateType.Input, Value = Body }, new StateVariable { Name = "Result", Type = StateVariable.StateType.Output, Value = Result } }); }
public static string ToStringContent(this HttpResponseMessage response, bool showHeaders = true, bool showBody = true, bool html = false) { var builder = new StringBuilder(); builder.Append($"{IsHtml("<i>", html)}Reponse:{IsHtml("</i>", html)} {IsHtml("<b>", html)}{(int)response.StatusCode} {response.ReasonPhrase}{IsHtml("</b>", html)}"); if (showHeaders && response.Headers.Count() > 0) { builder.Append($"{Environment.NewLine}{IsHtml("<i>", html)}Headers:{IsHtml("</i>", html)}"); foreach (var header in response.Headers) { builder.Append($"{Environment.NewLine}{IsHtml("<span style='opacity:0.5;'>", html)}{header.Key}:{string.Join(",", header.Value)}{IsHtml("</span>", html)}"); } } if (showBody && response.Content != null) { builder.Append($"{Environment.NewLine}{IsHtml("<i>", html)}Content:{IsHtml("</i>", html)}"); builder.Append($"{Environment.NewLine}{ IsHtml("<span style='opacity:0.5;'>", html)}"); builder.Append(HtmlEncoder.Default.Encode(response.Content.ReadAsStringAsync().Result)); builder.Append(IsHtml("</span>", html)); } return(builder.ToString()); }
public override int GetHashCode() { unchecked { var hashCode = base.GetHashCode(); hashCode = (hashCode * 397) ^ (SavedSource != null ? SavedSource.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (To != null ? To.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Cc != null ? Cc.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Bcc != null ? Bcc.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (DisplayName != null ? DisplayName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Subject != null ? Subject.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Attachments != null ? Attachments.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Body != null ? Body.GetHashCode() : 0); hashCode = (hashCode * 397) ^ IsHtml.GetHashCode(); hashCode = (hashCode * 397) ^ (Result != null ? Result.GetHashCode() : 0); return(hashCode); } }
public override int GetHashCode() { unchecked { var hashCode = (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ IsRequired.GetHashCode(); hashCode = (hashCode * 397) ^ Size.GetHashCode(); hashCode = (hashCode * 397) ^ ShowTime.GetHashCode(); hashCode = (hashCode * 397) ^ IsHtml.GetHashCode(); hashCode = (hashCode * 397) ^ IsIpAddress.GetHashCode(); hashCode = (hashCode * 397) ^ (ImageSource != null ? ImageSource.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Separator != null ? Separator.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (References != null ? References.GetHashCode() : 0); hashCode = (hashCode * 397) ^ IsReference.GetHashCode(); hashCode = (hashCode * 397) ^ (Alias != null ? Alias.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Format != null ? Format.GetHashCode() : 0); return(hashCode); } }
public override int GetHashCode() { unchecked { var hashCode = base.GetHashCode(); hashCode = (hashCode * 397) ^ (_emailSender != null ? _emailSender.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (_dataObject != null ? _dataObject.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (_password != null ? _password.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (_selectedEmailSource != null ? _selectedEmailSource.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (FromAccount != null ? FromAccount.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (To != null ? To.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Cc != null ? Cc.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Bcc != null ? Bcc.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)Priority; hashCode = (hashCode * 397) ^ (Subject != null ? Subject.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Attachments != null ? Attachments.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Body != null ? Body.GetHashCode() : 0); hashCode = (hashCode * 397) ^ IsHtml.GetHashCode(); hashCode = (hashCode * 397) ^ (Result != null ? Result.GetHashCode() : 0); return(hashCode); } }