public bool ValidCheck(bool showMsgBox) { List <string> msgs = new List <string>(); if (this.Name == null || this.Name.Equals("")) { msgs.Add(Translator.Instance.T("请指定摄像头的名称.")); } if (this.Capture != CAPTUREFLAG.NOCAPTURE && (this.Codec == null || this.Codec.Equals(""))) { msgs.Add(Translator.Instance.T("请指定录像编码格式.")); } foreach (AvailablePlugIn <IPlugIn> p in this.PlugIns.AvailablePlugInCollection) { IPlugInVideoSource i = p.Instance as IPlugInVideoSource; if (i != null && i != this.PlugInVideoSource) { continue; } p.Instance.ValidCheck(msgs); } if (msgs.Count > 0 && showMsgBox) { MessageBox.Show(Validator.MergeMessages(msgs, string.Format(Translator.Instance.T("摄像头({0})配置中存在下列错误:"), this.FullName)), MotionPreference.Instance.MessageBoxCaption, MessageBoxButtons.OK, MessageBoxIcon.Stop); } return(msgs.Count == 0); }
private void SetVideoSourceItemVisible(bool v) { IPlugInVideoSource i = this.Camera.PlugInVideoSource; if (i == null) { return; } IPlugInUI u = i as IPlugInUI; if (u == null) { return; } if (u.UIPropertyItems != null) { foreach (ZForge.Controls.PropertyGridEx.CustomProperty p in u.UIPropertyItems) { p.Visible = v; } } //this.pGridCamera.Refresh(); }