예제 #1
0
    public void SetValue(string directoryPath, string logId)
    {
        gameObject.SetActive(true);

        fileName     = null;
        currentIndex = 0;
        pictureCount = 0;

        List <FileInfo> filesList = new List <FileInfo> ();

        if (Directory.Exists(directoryPath))
        {
            files        = System.IO.Directory.GetFiles(directoryPath, "*.jpg");
            pictureCount = files.Length;
            fileName     = new string[pictureCount];
            for (int i = 0; i < pictureCount; i++)
            {
                filesList.Add(new FileInfo(files[i]));
            }

            filesList.Sort(delegate(FileInfo x, FileInfo y) {
                return(x.LastWriteTime.CompareTo(y.LastWriteTime));
            });

            for (int i = 0; i < pictureCount; i++)
            {
                fileName[i] = filesList[i].Name.Replace(".jpg", "");
            }
        }
        BtnPre.GetComponent <BoxCollider>().enabled  = false;
        BtnNext.GetComponent <BoxCollider>().enabled = false;
        if (pictureCount > 1)
        {
            BtnNext.GetComponent <BoxCollider>().enabled = true;
        }

        if (pictureCount >= 1)
        {
            VideoPatrolDetailLogDao vpdlDao = new VideoPatrolDetailLogDao();
            vpdlDao.Select001(logId);

            logInfos = vpdlDao.Result;

            LoadPicture(currentIndex);
        }
    }
예제 #2
0
    public void SetValue(VideoPatrolLogInfo PatrolLogInfo)
    {
        Logger.Instance.WriteLog("加载视频巡航日志");
        Person.text   = PatrolLogInfo.person;
        PlanName.text = PatrolLogInfo.planName;

        DetailLogGrid.transform.DestroyChildren();

        VideoPatrolDetailLogDao vpdlDao = new VideoPatrolDetailLogDao();

        vpdlDao.Select001(PatrolLogInfo.id);
        VideoPatrolDetailLogInfo info;
        GameObject go;

        for (int i = 0; i < vpdlDao.Result.Count; i++)
        {
            info = vpdlDao.Result[i];
            go   = Instantiate(VideoPatrolDetailLogItemPrefab) as GameObject;
            DetailLogGrid.AddChild(go.transform);
            go.transform.localScale = new Vector3(1, 1, 1);
            go.GetComponent <VideoPatrolDetailLogItem>().SetValue((i + 1) + "", info);
        }
    }