示例#1
0
        public void GetCameraFilters(EventHandler <AsyncWorkerCallbackEventArgs <IList <CameraFilter> > > callback)
        {
            try
            {
                AsyncWorkerHandle <IList <CameraFilter> > handle = AsyncWorkerHelper.DoWork <IList <CameraFilter> >(
                    delegate(object sender, DoWorkEventArgs e)
                {
                    List <CameraFilter> filters = new List <CameraFilter>();

                    GetCameraFiltersRequest request   = new GetCameraFiltersRequest();
                    GetCameraFiltersResponse response =
                        ServiceProvider.GetService <IDeviceConnectorService, IDeviceConnectorCallbackService>(
                            ViewModelLocator.ServiceClient,
                            ViewModelLocator.SelectedService.HostName,
                            ViewModelLocator.SelectedService.Uri.ToString()
                            ).GetCameraFilters(request);

                    if (response.Filters != null)
                    {
                        foreach (var item in response.Filters)
                        {
                            CameraFilter filter = new CameraFilter(item.Name, item.Uri);
                            filters.Add(filter);
                        }
                    }

                    e.Result = filters;
                },
                    null, callback);
            }
            catch (Exception ex)
            {
                ExceptionHandler.Handle(ex);
            }
        }
        internal static CameraFilterData Translate(CameraFilter filter)
        {
            CameraFilterData data = new CameraFilterData();

            data.Name = filter.Name;
            data.Uri  = filter.Uri;
            return(data);
        }
示例#3
0
    // Use this for initialization
    void Start()
    {
        instance = this;

        Debug.Log("Starting GameController");
        timeOfDay = timeOfDawn;

        sunAngles = sun.transform.eulerAngles;

        cameraFilterControl = Camera.main.GetComponent <CameraFilter>();

        // initial state
        areaAwakened = new bool[numAreas];
        for (int a = 0; a < numAreas; a++)
        {
            areaAwakened[a] = false;
        }

        // TESTING
        areaAwakened[2] = true;
    }
示例#4
0
        public IList <CameraFilter> GetCameraFilters()
        {
            List <CameraFilter> filters = new List <CameraFilter>();

            try
            {
                FilterInfoCollection localFilters = new FilterInfoCollection(FilterCategory.VideoInputDevice);
                for (int i = 0; i < localFilters.Count; i++)
                {
                    CameraFilter filter = new CameraFilter(localFilters[i].MonikerString)
                    {
                        Name = localFilters[i].Name
                    };
                    filters.Add(filter);
                }
            }
            catch (ApplicationException ex)
            {
                ExceptionHandler.Handle(ex);
            }

            return(filters);
        }