Esempio n. 1
0
    public static MediaGallery CreateInstance(Profiable profiable, List <Sprite> images)
    {
        MediaGallery gallery = CreateInstance <MediaGallery>();

        gallery.init(profiable, images);
        return(gallery);
    }
Esempio n. 2
0
    protected override void setAttributes()
    {
        if (gallery.getProfiable() != null)
        {
            Profiable profiable = gallery.getProfiable();

            // set up gallery label
            label.text = profiable.getLabel() + " Gallery";

            // set up profiable header
            switch (profiable.getTypeID())
            {
            case DatabaseObject.DEPARTMENT:
                profiableHeader.text = "Department:";
                break;

            case DatabaseObject.EMPLOYEE:
                profiableHeader.text = "Employee:";
                break;

            default:
                break;
            }

            // set up profiable button
            profiableButton.setup(this, profiable);
        }

        // set up pictures
        if (gallery.getImages() != null)
        {
            if (gallery.getImages().Count == 0 || gallery.getImages()[0] == null)
            {
                noPicsLabel.gameObject.SetActive(true);
            }
            else
            {
                List <Sprite> images = gallery.getImages();
                foreach (Sprite image in images)
                {
                    Image imageHolder = Instantiate(imagePrefab, transform.position, Quaternion.identity) as Image;
                    imageHolder.sprite = image;
                    imageHolder.transform.SetParent(picturesParent.transform, true);
                }
            }
        }
        else
        {
            noPicsLabel.gameObject.SetActive(true);
        }
    }
Esempio n. 3
0
    public void setup(SearchManager searchManager, Profiable profiable, string keyword)
    {
        this.profiable     = profiable;
        this.numExtraChars = Mathf.Abs(keyword.Length - profiable.getLabel().Length);

        switch (profiable.getTypeID())
        {
        case DatabaseObject.DEPARTMENT:
            labelText.text = SearchManager.DEP;
            break;

        case DatabaseObject.EMPLOYEE:
            labelText.text = SearchManager.EMP;
            break;

        default:
            break;
        }

        databaseObjectButton.setup(searchManager, profiable);
    }
Esempio n. 4
0
 public void setProfiable(Profiable profiable)
 {
     this.profiable = profiable;
     this.label     = profiable.getLabel() + " " + constantLabel;
 }
Esempio n. 5
0
 private void init(Profiable profiable, List <Sprite> images)
 {
     this.profiable = profiable;
     this.images    = images;
     this.databaseObjectInit(constantLabel);
 }
Esempio n. 6
0
 // constructors
 private void init()
 {
     profiable = null;
     images    = new List <Sprite>();
     this.databaseObjectInit(constantLabel);
 }