public void SetCacheInfo(Typeface typeface, float sizeInPts, HintTechnique hintTech)
        {
            //check if we have create the context for this request parameters?
            var key = new GlyphKey()
            {
                hintTech = hintTech, sizeInPts = sizeInPts, typeface = typeface
            };

            if (!_registerGlyphCollection.TryGetValue(key, out _currentGlyphDic))
            {
                //if not found
                //create new
                _currentGlyphDic = new Dictionary <ushort, T>();
                _registerGlyphCollection.Add(key, _currentGlyphDic);
            }
        }
示例#2
0
        public int CompareTo(Credential other)
        {
            Int32 idCompare = ID.CompareTo(other.ID);

            if (idCompare != 0)
            {
                return(idCompare);
            }

            Int32 glyphKeyCompare = GlyphKey.CompareTo(other.GlyphKey);

            if (glyphKeyCompare != 0)
            {
                return(glyphKeyCompare);
            }

            Int32 glyphColourCompare = GlyphColour.CompareTo(other.GlyphColour);

            if (glyphColourCompare != 0)
            {
                return(glyphColourCompare);
            }

            Int32 nameCompare = Name.CompareTo(other.Name);

            if (nameCompare != 0)
            {
                return(nameCompare);
            }

            Int32 descriptionCompare = Description.CompareTo(other.Description);

            if (descriptionCompare != 0)
            {
                return(descriptionCompare);
            }

            Int32 websiteCompare = Website.CompareTo(other.Website);

            if (websiteCompare != 0)
            {
                return(websiteCompare);
            }

            Int32 createdAtCompare = CreatedAt.CompareTo(other.CreatedAt);

            if (createdAtCompare != 0)
            {
                return(createdAtCompare);
            }

            Int32 lastUpdatedAtCompare = LastModifiedAt.CompareTo(other.LastModifiedAt);

            if (lastUpdatedAtCompare != 0)
            {
                return(lastUpdatedAtCompare);
            }

            Int32 usernameCompare = Username.CompareTo(other.Username);

            if (usernameCompare != 0)
            {
                return(usernameCompare);
            }

            Int32 passwordCompare = Password.CompareTo(other.Password);

            if (passwordCompare != 0)
            {
                return(passwordCompare);
            }

            if (Tags.Count == other.Tags.Count)
            {
                if (!Tags.OrderBy(i => i).SequenceEqual(other.Tags.OrderBy(i => i)))
                {
                    return(-1);
                }
            }
            else
            {
                return(-1);
            }

            Int32 notesCompare = Notes.CompareTo(other.Notes);

            if (notesCompare != 0)
            {
                return(notesCompare);
            }

            return(0);
        }