Пример #1
0
    public ElementoLista RetiraElementoI(int i)
    {
        ElementoLista anteriorAux = this.LocalizaElementoI(i - 1);
        ElementoLista aux         = anteriorAux.proximo;

        anteriorAux.proximo = aux.proximo;
        aux.proximo         = null;

        return(aux);
    }
Пример #2
0
    public ElementoLista LocalizaElementoI(int i)
    {
        int           count = 0;
        ElementoLista aux   = primeiro;

        do
        {
            aux = aux.proximo;
            count++;
        }while (count != i);

        return(aux);
    }
Пример #3
0
    public override void CargarLista(int id)
    {
        base.CargarLista(id);

        Subdependencie subdependencie = TI_API.GetSubdependencie(myIndex);

        DebugUnity.Log("Load Studies: [" + myIndex + "] " + subdependencie.name);

        if (subdependencie.studies != null)
        {
            for (int i = 0; i < subdependencie.studies.Length; i++)
            {
                ElementoLista el = AddBoton(subdependencie.studies[i].name + " " + subdependencie.studies[i].date + (!string.IsNullOrEmpty(subdependencie.studies[i].off_url) ? " (Scan)" : "") + (!string.IsNullOrEmpty(subdependencie.studies[i].pdf_url) ? " (PDF)" : ""), i);

                el.elegirEntregable = elegirEntregable;
            }
        }
    }
Пример #4
0
    //public virtual void Atras()
    //{
    //    if (listaAnterior != null)
    //    {
    //        gameObject.SetActive(false);
    //        listaAnterior.CargarLista();
    //        VaciarLista();
    //    }
    //}

    protected ElementoLista AddBoton(string name, int index)
    {
        Vector3       vec    = Vector3.zero;
        RectTransform myRect = gameObject.GetComponent <RectTransform>();

        GameObject lastCreated = Instantiate(btnModelo, transform) as GameObject;

        RectTransform recT   = lastCreated.GetComponent <RectTransform>();
        Vector2       sizeLC = recT.sizeDelta;

        sizeLC.x = myRect.rect.width;

        //Debug.Log(sizeLC.x);

        recT.sizeDelta = sizeLC;

        vec.y = vec.y - recT.sizeDelta.y * listaBotones.Count;
        recT.localPosition = vec;



        lastCreated.SetActive(true);


        ElementoLista el = lastCreated.GetComponent <ElementoLista>();

        el.manager = manager;
        el.Setear(name, index);
        listaBotones.Add(lastCreated);
        Vector2 size = content.sizeDelta;

        size.y            = recT.sizeDelta.y * listaBotones.Count;
        content.sizeDelta = size;
        Debug.Log("Size: " + recT.sizeDelta.y + " Y: " + vec.y + " ," + recT.gameObject.name, recT.gameObject);

        return(el);
    }
Пример #5
0
 public void InsereFinal(ElementoLista elemento)
 {
     ultimo.proximo = elemento;
     ultimo         = elemento;
 }
Пример #6
0
 public ListaEncadeada()
 {
     sentinela = new ElementoLista();
     primeiro  = ultimo = sentinela;
 }