Exemplo n.º 1
0
 protected void GetSide(TSideWind sideWind, char tUCNType, string tUCN, char tInvolvement)
 {
     sideWind.key         = key;
     sideWind.kind        = kind;
     sideWind.date        = date;
     sideWind.ucnType     = tUCNType;
     sideWind.ucn         = tUCN;
     sideWind.involvement = tInvolvement;
 }
Exemplo n.º 2
0
    public string PrintSideLinks(Connection conn, bool newLines, bool ordinaryName, List <TLinkWind> linkWinds, char nbsp)
    {
        TLinkWind        linkWind = this;
        StringBuilder    sb       = new StringBuilder();
        List <TLinkWind> tLinkWinds;

        if (linkWinds == null)
        {
            tLinkWinds = new List <TLinkWind>();
            tLinkWinds.Add(linkWind);
            linkWinds = tLinkWinds;
        }

        if (ordinaryName)
        {
            bool first = true;

            foreach (TLinkWind tLinkWind in linkWinds)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    sb.Append(", ");
                }

                sb.Append(tLinkWind.PrintNames(conn));
            }
        }

        if (linkWind.Proxied())
        {
            TSideWind proxy    = new TSideWind();
            TSideWind redirect = new TSideWind();
            string    proxyNames;
            string    proxyInvolvement;
            bool      redirectSeparator = false;

            linkWind.GetProxy(proxy);
            proxyNames       = proxy.PrintNames(conn);
            proxyInvolvement = TInvolvement.Seek(linkWind.proxyInvolvement).name;

            if (TInvolvement.LegalSpeakers.IndexOf(proxy.involvement) != -1 ||
                linkWind.proxyKind == TProxyKind.AsWithInvolvement)
            {
                switch (linkWind.proxyKind)
                {
                case TProxyKind.IndirectAsAny1:
                {
                    if (!newLines)
                    {
                        sb.Append(",");
                    }

                    sb.AppendFormat("\nпредставляван{0} от {1}\n{2}", linkWinds.Count == 1 ? "(а)" : "и",
                                    proxyInvolvement, proxyNames);
                    break;
                }

                case TProxyKind.IndirectAsAny2:
                {
                    sb.AppendFormat("\nчрез {0}\n{1}", proxyInvolvement, proxyNames);
                    break;
                }

                case TProxyKind.IndirectAsAny3:
                {
                    sb.AppendFormat("\nсъс съгласието на {0}\n{1}", proxyInvolvement, proxyNames);
                    break;
                }

                case TProxyKind.ConsentOfIndirect:
                {
                    sb.AppendFormat("{0}\nсъс съгласието на\n{1} като {2}", nbsp, proxyNames, proxyInvolvement);
                    redirectSeparator = true;
                    break;
                }

                default:
                {
                    string prefix = String.Format("{0}\nкато {1} на{2}\n", proxyNames, proxyInvolvement, nbsp);

                    sb.Insert(0, prefix, 1);
                    redirectSeparator = true;
                    break;
                }
                }
            }
            else if (proxy.involvement == TInvolvement.Parent)  // can't happen, Parent is LegalSpeaker
            {
                sb.AppendFormat("\nсъс съгласието на {0}{1}\n{2}", proxyInvolvement, nbsp, proxyNames);
                redirectSeparator = true;
            }
            else
            {
                sb.AppendFormat("{0}\nчрез {1}\n{2}", nbsp, proxyInvolvement, proxyNames);
                redirectSeparator = true;
            }

            if (linkWind.Redirected())
            {
                if (redirectSeparator)
                {
                    sb.Append(nbsp);
                }
                linkWind.GetRedirect(redirect);
                sb.AppendFormat("\nчрез {0} ", TInvolvement.Seek(redirect.involvement).name);
                sb.Append(redirect.PrintNames(conn));
            }
        }

        if (newLines)
        {
            sb.Append("\n");
        }
        else
        {
            sb.Replace('\n', ' ');
        }

        string result = sb.ToString();

        if (!ordinaryName && result[0] == nbsp)
        {
            result = result.Substring(1).TrimStart();
        }

        return(result);
    }
Exemplo n.º 3
0
 public void GetRedirect(TSideWind sideWind)
 {
     GetSide(sideWind, redirectUCNType, redirectUCN, redirectInvolvement);
 }
Exemplo n.º 4
0
 public void GetProxy(TSideWind sideWind)
 {
     GetSide(sideWind, proxyUCNType, proxyUCN, proxyInvolvement);
 }
Exemplo n.º 5
0
 public void GetOrdinary(TSideWind sideWind)
 {
     GetSide(sideWind, ucnType, ucn, involvement);
 }