Example #1
0
        public override string ToString()
        {
            string vRoot   = SiteConfig.SiteVRoot;
            bool   isEqual = (DetailObjectID.ToString() == TargetObjectID.ToString());

            StringBuilder format = new StringBuilder(GetFormatString(isEqual), 300);

            try
            {
                if (format.ToString().IndexOf("{U}") > -1)
                {
                    format = format.Replace("{U}", string.Format("<a href='{0}{1}'>{2}</a>", vRoot, Helper.GetDetailLink(Helper.GetObjectTypeNumericID("User"), UserNickname), UserNickname));
                }

                if (format.ToString().IndexOf("{T}") > -1)
                {
                    format = format.Replace("{T}", string.Format("<a href='{0}{1}'>{2}</a>", vRoot, Helper.GetDetailLink(TargetObjectType, TargetObjectID.ToString()), TargetObjectText));
                }

                if (format.ToString().IndexOf("{TTX}") > -1)
                {
                    format = format.Replace("{TTX}", TargetObjectText);
                }

                if (format.ToString().IndexOf("{D}") > -1)
                {
                    format = format.Replace("{D}", string.Format("<a href='{0}{1}'>{2}</a>", vRoot, Helper.GetDetailLink(DetailObjectType, DetailObjectID.ToString()), DetailObjectText));
                }

                if (format.ToString().IndexOf("{DTX}") > -1)
                {
                    format = format.Replace("{DTX}", DetailObjectText);
                }

                if (format.ToString().IndexOf("{TOT}") > -1)
                {
                    if (ActivityWhat == UserActivityWhat.HasUploadetMultipleObjects)
                    {
                        format = format.Replace("{TOT}", Helper.GetObjectName(TargetObjectType, true));
                    }
                    else
                    {
                        format = format.Replace("{TOT}", Helper.GetObjectName(TargetObjectType, true));
                    }
                }

                if (format.ToString().IndexOf("{DOT}") > -1)
                {
                    if (ActivityWhat == UserActivityWhat.HasUploadetMultipleObjects)
                    {
                        format = format.Replace("{DOT}", Helper.GetObjectName(DetailObjectType, false));
                    }
                    else
                    {
                        format = format.Replace("{DOT}", Helper.GetObjectName(DetailObjectType, true));
                    }
                }
            }
            catch (Exception)
            {
                format.Append("*** Formatting error");
            }

            return(format.ToString());
        }
Example #2
0
        public override string ToString()
        {
            bool isEqual = (DetailObjectID.ToString() == TargetObjectID.ToString());

            StringBuilder format = new StringBuilder(GetFormatString(isEqual), 300);

            try
            {
                if (format.ToString().IndexOf("{U}") > -1)
                {
                    if (UserNickname == Constants.ANONYMOUS_USERNAME)
                    {
                        format = format.Replace("{U}", GuiLanguage.GetGuiLanguage("DataAccess").GetString("TextAnAnonymousUser"));
                    }
                    else
                    {
                        format = format.Replace("{U}", string.Format("<a href='{0}'>{1}</a>", Helper.GetDetailLink(Helper.GetObjectTypeNumericID("User"), UserNickname), UserNickname));
                    }
                }

                if (format.ToString().IndexOf("{T}") > -1)
                {
                    if (TargetObjectType == Helper.GetObjectTypeNumericID("ProfileCommunity"))
                    {
                        format = format.Replace("{T}", string.Format("<a href='{0}'>{1}</a>", Helper.GetDetailLink("User", TargetObjectText), TargetObjectText));
                    }
                    else
                    {
                        format = format.Replace("{T}", string.Format("<a href='{0}'>{1}</a>", Helper.GetDetailLink(TargetObjectType, TargetObjectID.ToString()), TargetObjectText));
                    }
                }

                if (format.ToString().IndexOf("{TTX}") > -1)
                {
                    format = format.Replace("{TTX}", TargetObjectText);
                }

                if (format.ToString().IndexOf("{D}") > -1)
                {
                    format = format.Replace("{D}", string.Format("<a href='{0}'>{1}</a>", Helper.GetDetailLink(DetailObjectType, DetailObjectID.ToString()), DetailObjectText));
                }

                if (format.ToString().IndexOf("{DTX}") > -1)
                {
                    format = format.Replace("{DTX}", DetailObjectText);
                }

                if (format.ToString().IndexOf("{TOT}") > -1)
                {
                    if (ActivityWhat == UserActivityWhat.HasUploadetMultipleObjects)
                    {
                        format = format.Replace("{TOT}", Helper.GetObjectName(TargetObjectType, true));
                    }
                    else
                    {
                        format = format.Replace("{TOT}", Helper.GetObjectName(TargetObjectType, true));
                    }
                }

                if (format.ToString().IndexOf("{DOT}") > -1)
                {
                    if (ActivityWhat == UserActivityWhat.HasUploadetMultipleObjects)
                    {
                        format = format.Replace("{DOT}", Helper.GetObjectName(DetailObjectType, false));
                    }
                    else
                    {
                        format = format.Replace("{DOT}", Helper.GetObjectName(DetailObjectType, true));
                    }
                }
            }
            catch (Exception)
            {
                format.Append("*** Formatting error");
            }

            return(format.ToString());
        }