Example #1
0
        public void SetDisplayName()
        {
            if (string.IsNullOrEmpty(RemarkName) == true)
            {
                if (string.IsNullOrEmpty(NickName) == true)
                {
                    if (string.IsNullOrEmpty(DisplayName) == true)
                    {
                        DisplayName = UserName;
                    }
                }
                else
                {
                    DisplayName = NickName;
                }
            }
            else
            {
                DisplayName = RemarkName;
            }

            var startPos = DisplayName.IndexOf("<span", StringComparison.Ordinal);

            while (startPos > -1)
            {
                var    endPos = DisplayName.IndexOf("</span>", StringComparison.Ordinal);
                string emjio  = DisplayName.Substring(startPos, endPos - startPos + 7);
                DisplayName = DisplayName.Replace(emjio, "[]");
                startPos    = DisplayName.IndexOf("<span", StringComparison.Ordinal);
            }
        }
Example #2
0
 /// <summary>
 /// Finds a match to a game object property value.
 /// </summary>
 /// <param name="filter">The filter.</param>
 /// <returns></returns>
 private bool FindMatch(string filter)
 {
     return(Name?.IndexOf(filter, StringComparison.CurrentCultureIgnoreCase) >= 0 ||
            Pak.IndexOf(filter, StringComparison.CurrentCultureIgnoreCase) >= 0 ||
            MapKey?.IndexOf(filter, StringComparison.CurrentCultureIgnoreCase) >= 0 ||
            ParentTemplateId?.IndexOf(filter, StringComparison.CurrentCultureIgnoreCase) >= 0 ||
            DisplayNameHandle?.IndexOf(filter, StringComparison.CurrentCultureIgnoreCase) >= 0 ||
            DisplayName?.IndexOf(filter, StringComparison.CurrentCultureIgnoreCase) >= 0 ||
            DescriptionHandle?.IndexOf(filter, StringComparison.CurrentCultureIgnoreCase) >= 0 ||
            Description?.IndexOf(filter, StringComparison.CurrentCultureIgnoreCase) >= 0 ||
            Icon?.IndexOf(filter, StringComparison.CurrentCultureIgnoreCase) >= 0 ||
            Stats?.IndexOf(filter, StringComparison.CurrentCultureIgnoreCase) >= 0);
 }
        public void SetDisplayName(string outputFieldName)
        {
            var index = DisplayName.IndexOf(" -", StringComparison.Ordinal);

            if (index > 0)
            {
                DisplayName = DisplayName.Remove(index);
            }

            var displayName = DisplayName;

            if (!string.IsNullOrEmpty(displayName) && displayName.Contains("Dsf"))
            {
                DisplayName = displayName;
            }
            if (!string.IsNullOrWhiteSpace(outputFieldName))
            {
                DisplayName = displayName + outputFieldName;
            }
        }
Example #4
0
        }                                     // Added with LE v1.7 API


        public string GetValidFullName()
        {
            if (!string.IsNullOrWhiteSpace(FirstName) && !string.IsNullOrWhiteSpace(LastName))
            {
                return($"{FirstName} {LastName}");
            }

            // NOTE we expect "FirstName LastName" formar
            // But customer has "LastName, FirstName"
            int index = DisplayName.IndexOf(", ");

            if (index >= 0)
            {
                string lastName  = DisplayName.Substring(0, index);
                string firstName = DisplayName.Substring(index + 2);
                return($"{firstName} {lastName}");
            }

            return(DisplayName);
        }