Beispiel #1
0
        private cGroupList NewG(string Testo)
        {
            cGroupList g = new cGroupList
            {
                Text   = Testo,
                Width  = 200,
                Height = 200
            };

            return(g);
        }
Beispiel #2
0
        private void Carica()
        {
            string     ulMA = "";
            cMovimenti mov  = new cMovimenti();
            List <cMovimenti.sMacroArea_e_Descrizione> z = mov.MacroAree_e_Descrizioni();
            List <string> desc = mov.TutteLeDescrizioni_Array(false);

            gNoCat.ClearItems();
            pArea.Controls.Clear();

            if (desc != null)
            {
                if (desc.Count > 0)
                {
                    gNoCat.AddRange(desc);
                }
            }

            if (z != null)
            {
                if (z.Count > 0)
                {
                    int          g     = -1;
                    int          e     = -1;
                    string[]     elems = new string[z.Count];
                    cGroupList[] G     = new cGroupList[z.Count];

                    for (int i = 0; i < z.Count; i++)
                    {
                        if (!ulMA.Equals(z[i].MacroArea, StringComparison.OrdinalIgnoreCase) || i == z.Count - 1)
                        {
                            if (g > -1)
                            {
                                if (e > -1)
                                {
                                    string[] elems2 = new string[e + 1];
                                    Array.Copy(elems, elems2, e + 1);

                                    G[g].AddRange(elems2);

                                    e = -1;
                                }
                            }

                            if (!ulMA.Equals(z[i].MacroArea, StringComparison.OrdinalIgnoreCase))
                            {
                                G[g += 1] = NewG(z[i].MacroArea);
                            }
                        }

                        elems[e += 1] = z[i].Descrizione;
                        ulMA          = z[i].MacroArea;
                    }

                    if (g > -1)
                    {
                        cGroupList[] G2 = new cGroupList[g + 1];
                        Array.Copy(G, G2, g + 1);
                        pArea.Controls.AddRange(G2);
                    }
                }
            }
        }