private void InitSetting() { InitCamera(); InitStyleModel(); try { string cameraDefault = ConfigurationManager.AppSettings.Get("defaultCamera").ToLower(); SelectedCamera = CameraItems.Find(_ => _.Name.ToLower().Contains(cameraDefault)); } catch { SelectedCamera = CameraItems.FirstOrDefault(); } if (SelectedCamera == null) { SelectedCamera = CameraItems.FirstOrDefault(); } try { string styleDefault = ConfigurationManager.AppSettings.Get("defaultStyle").ToLower(); SelectedStyle = StyleItems.ToList().Find(_ => _.ToLower().Contains(styleDefault)); } catch { SelectedStyle = StyleItems.FirstOrDefault(); } if (SelectedStyle == null) { SelectedStyle = StyleItems.FirstOrDefault(); } }
private void InitSetting() { InitCamera(); InitStyleModel(); BatchSize = ImageConstants.Batch; try { FrameRate = Convert.ToInt32(ConfigurationManager.AppSettings.Get("defaultFrameRate")); } catch { FrameRate = DEFAULT_FRAME_RATE; } try { string cameraDefault = ConfigurationManager.AppSettings.Get("defaultCamera").ToLower(); SelectedCamera = CameraItems.Find(_ => _.Name.ToLower().Contains(cameraDefault)); } catch { SelectedCamera = CameraItems.FirstOrDefault(); } if (SelectedCamera == null) { SelectedCamera = CameraItems.FirstOrDefault(); } try { string styleDefault = ConfigurationManager.AppSettings.Get("defaultStyle").ToLower(); SelectedStyle = StyleItems.ToList().Find(_ => _.ToLower().Contains(styleDefault)); } catch { SelectedStyle = StyleItems.FirstOrDefault(); } if (SelectedStyle == null) { SelectedStyle = StyleItems.FirstOrDefault(); } IsEnable = true; }