예제 #1
0
        public override void ToCss(TextWriter writer, IStyleFormatter formatter)
        {
            var media = Media.MediaText;
            var space = string.IsNullOrEmpty(media) ? string.Empty : " ";
            var value = string.Concat(Href.StylesheetUrl(), space, media);

            writer.Write(formatter.Rule("@import", value));
        }
예제 #2
0
        public string GetUriSuffix()
        {
            Contract.Requires(Uri.IsWellFormedUriString(Href, UriKind.Absolute));

            var uriSuffix = Href.Substring(Href.IndexOf("/api", StringComparison.InvariantCultureIgnoreCase) + 4);

            return(uriSuffix);
        }
예제 #3
0
 public ATag(int index, string tagHtml, int begin)
     : base(index, tagHtml, begin)
 {
     if (string.IsNullOrEmpty(Href) || emptyHref.IsMatch(Href.Trim()))
     {
         isEmptyHref = true;
     }
 }
예제 #4
0
 public AllowConnectivityCheckAttribute(string connectivityCheckTitle,
                                        string apiEndpoint,
                                        params string[] dependsOnPropertyNames)
 {
     ConnectivityCheckTitle = connectivityCheckTitle;
     ApiEndpoint            = apiEndpoint;
     DependsOnPropertyNames = dependsOnPropertyNames;
 }
예제 #5
0
        public override Int32 GetHashCode()
        {
            var hashCode = 19;

            hashCode *= (41 * Href.GetHashCode());
            hashCode *= (41 * Name.GetHashCode());

            return(hashCode);
        }
예제 #6
0
        public override Boolean Equals(object obj)
        {
            if (ReferenceEquals(this, obj))
            {
                return(true);
            }

            return((obj is Link other) && Href.Equals(other.Href) && Name.Equals(other.Name));
        }
예제 #7
0
 public override void Validate()
 {
     base.Validate();
     ProjectId.HasValue("项目编码不能为空").MaxLength(50, "项目编码限制长度50");
     GroupId.HasValue("链接组不能为空").MaxLength(200, "链接组限制长度50");
     Name.HasValue("链接名称不能为空").MaxLength(50, "链接名称限制长度50");
     Href.HasValue("链接地址不能为空").MaxLength(200, "链接地址限制长度200");
     //Remark.HasValue("").MaxLength(50, "");
 }
예제 #8
0
 private static void addButton(List <Object> list, Args a, string action, string caption, ref bool hasButton)
 {
     if (hasButton)
     {
         list.Add(" | ");
     }
     list.Add(new HtmlString(Href.Compose(a, action, caption)));
     hasButton = true;
 }
예제 #9
0
        internal string GetTag()
        {
            StringBuilder stringBuilder = new StringBuilder("\r\n<AREA SHAPE=\"", 120);

            if (shape == MapAreaShape.Circle)
            {
                stringBuilder.Append("circle\"");
            }
            else if (shape == MapAreaShape.Rectangle)
            {
                stringBuilder.Append("rect\"");
            }
            else if (shape == MapAreaShape.Polygon)
            {
                stringBuilder.Append("poly\"");
            }
            if (Href.Length > 0)
            {
                stringBuilder.Append(" HREF=\"");
                if (Href.StartsWith("WWW.", StringComparison.OrdinalIgnoreCase))
                {
                    stringBuilder.Append("http://");
                }
                stringBuilder.Append(Href);
                stringBuilder.Append("\"");
            }
            if (ToolTip.Length > 0)
            {
                stringBuilder.Append(" Title=\"");
                stringBuilder.Append(ToolTip);
                stringBuilder.Append("\"");
            }
            stringBuilder.Append(" COORDS=\"");
            float[] array = new float[Coordinates.Length];
            Coordinates.CopyTo(array, 0);
            bool flag = true;

            float[] array2 = array;
            foreach (float num in array2)
            {
                if (!flag)
                {
                    stringBuilder.Append(",");
                }
                flag = false;
                stringBuilder.Append((int)Math.Round(num));
            }
            stringBuilder.Append("\"");
            if (MapAreaAttributes.Length > 0)
            {
                stringBuilder.Append(" ");
                stringBuilder.Append(MapAreaAttributes);
            }
            stringBuilder.Append(">");
            return(stringBuilder.ToString());
        }
예제 #10
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Rel?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (Href?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Title?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }
예제 #11
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Attributes.GetHashCode();
         hashCode = (hashCode * 397) ^ (Href?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Text?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }
예제 #12
0
        public override void Process(TagHelperContext context, TagHelperOutput output)
        {
            output.TagName = "link";
            output.Attributes.SetAttribute("rel", Rel);

            var url = string.Concat(AppWebInfoHelper.CssDomain, Href.TrimStart('~'), "?v=",
                                    Version ? AppInfoHelper.AppVersion : string.Empty);

            output.Attributes.SetAttribute("href", url);
        }
예제 #13
0
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     unchecked
     {
         int result = base.GetHashCode();
         result = (result * 397) ^ Href?.GetHashCode() ?? 0;
         result = (result * 397) ^ Size.GetHashCode();
         return(result);
     }
 }
예제 #14
0
        internal string GetTag()
        {
            StringBuilder stringBuilder = new StringBuilder("\r\n<AREA SHAPE=\"", 120);

            if (shape == MapAreaShape.Circle)
            {
                stringBuilder.Append("circle\"");
            }
            else if (shape == MapAreaShape.Rectangle)
            {
                stringBuilder.Append("rect\"");
            }
            else if (shape == MapAreaShape.Polygon)
            {
                stringBuilder.Append("poly\"");
            }
            if (Href.Length > 0)
            {
                stringBuilder.Append(" HREF=\"");
                if (Href.ToUpper(CultureInfo.InvariantCulture).StartsWith("WWW.", StringComparison.Ordinal))
                {
                    stringBuilder.Append("http://");
                }
                stringBuilder.Append(Href);
                stringBuilder.Append("\"");
            }
            if (ToolTip.Length > 0)
            {
                stringBuilder.Append(" Title=\"");
                stringBuilder.Append(ToolTip);
                stringBuilder.Append("\"");
            }
            stringBuilder.Append(" COORDS=\"");
            bool flag = true;

            int[] array = Coordinates;
            foreach (int value in array)
            {
                if (!flag)
                {
                    stringBuilder.Append(",");
                }
                flag = false;
                stringBuilder.Append(value);
            }
            stringBuilder.Append("\"");
            if (MapAreaAttributes.Length > 0)
            {
                stringBuilder.Append(" ");
                stringBuilder.Append(MapAreaAttributes);
            }
            stringBuilder.Append(">");
            return(stringBuilder.ToString());
        }
예제 #15
0
 public override int GetHashCode()
 {
     unchecked          // Overflow is fine, just wrap
     {
         int hash = 17; // Suitable nullity checks etc, of course :)
         hash = hash * 23 + (Href == null ? 587 : Href.GetHashCode());
         hash = hash * 23 + Rel.GetHashCode();
         hash = hash * 23 + (Description == null ? 587 : Description.GetHashCode());
         return(hash);
     }
 }
예제 #16
0
 public Domain.Link ToDomain(bool needUser)
 {
     return(new() {
         Id = Id,
         User = new Ref <Domain.User>(UserId, needUser ? User?.ToDomain() : null),
         Title = new Title(Title),
         Subtitle = new Subtitle(Subtitle),
         IconName = new IconName(IconName),
         Href = new Href(Href),
         CreatedAt = CreatedAt,
     });
 }
예제 #17
0
 /// <summary>
 /// Gets the link to the end point
 /// </summary>
 /// <param name="Match">Match found</param>
 /// <returns>The end point or empty string</returns>
 protected static string GetLink(Match Match)
 {
     if (Match.Value.IndexOf("openid.server") > 0)
     {
         Match = Href.Match(Match.Value);
         if (Match.Success)
         {
             return(Match.Groups[1].Value);
         }
     }
     return("");
 }
예제 #18
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (!(obj is RuleDetails))
            {
                return(false);
            }


            return(Href != null &&
                   ((RuleDetails)obj).Href != null &&
                   Href.Equals(((RuleDetails)obj).Href));
        }
예제 #19
0
        /// <summary>
        /// Returns true if HalLink instances are equal
        /// </summary>
        /// <param name="other">Instance of HalLink to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(HalLink other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Href == other.Href ||
                     Href != null &&
                     Href.Equals(other.Href)
                     ) &&
                 (
                     Templated == other.Templated ||

                     Templated.Equals(other.Templated)
                 ) &&
                 (
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                 ) &&
                 (
                     Deprecation == other.Deprecation ||
                     Deprecation != null &&
                     Deprecation.Equals(other.Deprecation)
                 ) &&
                 (
                     Profile == other.Profile ||
                     Profile != null &&
                     Profile.Equals(other.Profile)
                 ) &&
                 (
                     Title == other.Title ||
                     Title != null &&
                     Title.Equals(other.Title)
                 ) &&
                 (
                     Hreflang == other.Hreflang ||
                     Hreflang != null &&
                     Hreflang.Equals(other.Hreflang)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ));
        }
예제 #20
0
        public override bool Equals(object obj)
        {
            if (!(obj is CRObject))
            {
                return(false);
            }


            return(Href != null &&
                   (obj as CRObject).Href != null &&
                   Href.Equals((obj as CRObject).Href));
        }
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     unchecked
     {
         int result = base.GetHashCode();
         if (Href != null)
         {
             result = (result * 397) ^ Href.GetHashCode();
         }
         result = (result * 397) ^ Size.GetHashCode();
         return(result);
     }
 }
예제 #22
0
        /// <summary>
        /// 取得数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        private Href GetData(int id)
        {
            Href model = new Href();

            if (id > 0)
            {
                model = bll.GetModel(id);
            }
            model.Name = Request.Form["ipt_Name"] != "" ? Request.Form["ipt_Name"] : "";
            model.Url  = Request.Form["ipt_Url"] != "" ? Request.Form["ipt_Url"] : "";

            return(model);
        }
예제 #23
0
 public static Ret To(Href location)
 {
     return(new Ret
     {
         Status = new Ret.RetStatus
         {
             Code = HttpStatusCode.RedirectKeepVerb,
             Headers = new HashMap <string> {
                 { HeaderNames.Location, location }
             }
         }
     });
 }
예제 #24
0
파일: BackToHtml.cs 프로젝트: rakale/MyShop
        internal static List <object> htmlStrings(Args a)
        {
            a.PageUrl   = new Uri($"./{getPageUrl(a.PageUrl)}", UriKind.Relative);
            a.Handler   = getHandler(a.Handler);
            a.Action    = null;
            a.ItemId    = null;
            a.Title     = getTitle(a.Title);
            a.ControlId = "backToList";
            var s = Href.Compose(a);

            return(new List <object> {
                new HtmlString(s)
            });
        }
예제 #25
0
        internal static List <object> htmlStrings(bool hasSelect, bool hasEdit, bool hasDetails, bool hasDelete, Args a,
                                                  params IHtmlContent[] values)
        {
            var list = new List <object>();

            foreach (var value in values)
            {
                addValue(list, value);
            }
            list.Add(new HtmlString("<td>"));
            var hasButton = false;

            if (hasSelect)
            {
                list.Add(new HtmlString(Href.Compose(a, Actions.Index, Captions.Select)));
                hasButton = true;
            }

            if (hasEdit)
            {
                if (hasButton)
                {
                    list.Add(" | ");
                }
                list.Add(new HtmlString(Href.Compose(a, Actions.Edit, Captions.Edit)));
                hasButton = true;
            }

            if (hasDetails)
            {
                if (hasButton)
                {
                    list.Add(" | ");
                }
                list.Add(new HtmlString(Href.Compose(a, Actions.Details, Captions.Details)));
                hasButton = true;
            }

            if (hasDelete)
            {
                if (hasButton)
                {
                    list.Add(" | ");
                }
                list.Add(new HtmlString(Href.Compose(a, Actions.Delete, Captions.Delete)));
                list.Add(new HtmlString("</td>"));
            }

            return(list);
        }
예제 #26
0
        public TableOfContentsEntry(string id, string text, int order, string href)
        {
            Id    = id ?? throw new ArgumentNullException(nameof(id));
            Text  = text ?? throw new ArgumentNullException(nameof(text));
            Order = order;
            Href  = href ?? throw new ArgumentNullException(nameof(href));

            var idx = Href.IndexOf('#');

            if (idx != -1)
            {
                Href = Href.Substring(0, idx);
            }
        }
        /// <summary>
        /// Returns true if PartyRef instances are equal
        /// </summary>
        /// <param name="other">Instance of PartyRef to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PartyRef other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     PartyRefType == other.PartyRefType ||
                     PartyRefType != null &&
                     PartyRefType.Equals(other.PartyRefType)
                     ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Href == other.Href ||
                     Href != null &&
                     Href.Equals(other.Href)
                 ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Individual == other.Individual ||
                     Individual != null &&
                     Individual.SequenceEqual(other.Individual)
                 ) &&
                 (
                     Organization == other.Organization ||
                     Organization != null &&
                     Organization.SequenceEqual(other.Organization)
                 ));
        }
        /// <summary>
        /// Returns true if Organization instances are equal
        /// </summary>
        /// <param name="other">Instance of Organization to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Organization other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     TradingName == other.TradingName ||
                     TradingName != null &&
                     TradingName.Equals(other.TradingName)
                 ) &&
                 (
                     Href == other.Href ||
                     Href != null &&
                     Href.Equals(other.Href)
                 ) &&
                 (
                     IsLegalEntity == other.IsLegalEntity ||
                     IsLegalEntity != null &&
                     IsLegalEntity.Equals(other.IsLegalEntity)
                 ) &&
                 (
                     OrganizationType == other.OrganizationType ||
                     OrganizationType != null &&
                     OrganizationType.Equals(other.OrganizationType)
                 ) &&
                 (
                     NameType == other.NameType ||
                     NameType != null &&
                     NameType.Equals(other.NameType)
                 ) &&
                 (
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                 ));
        }
예제 #29
0
        public static Entity SetSelfLink(this Entity entity, Href href, Action <Link> options = null)
        {
            var self = new Link();

            self.AddRel(Rel.Self);
            self.Href = href;

            var links = entity.WithLinks();

            links.RemoveWhen(x => x.Rel.Has(Rel.Self));
            links.Add(self);

            options?.Invoke(self);

            return(entity);
        }
예제 #30
0
        public static Entity AddLink(this Entity entity, Href href, Action <Link> options = null)
        {
            var link = new Link {
                Href = href
            };

            entity.WithLinks().Add(link);

            options?.Invoke(link);

            if (link.WithRel().Count == 0)
            {
                link.AddRel(Rel.Link);
            }
            return(entity);
        }