public bool Initialize(ParameterBase Parameters) { CameraClient.Init(); this.cameraParameter = Parameters as IPCameraParameter; this.cameraClient = new CameraClient(); int error = this.cameraClient.Login(this.cameraParameter.Address, this.cameraParameter.Port, this.cameraParameter.UserName, this.cameraParameter.Password, this.cameraParameter.DeviceSpecification, this.cameraParameter.DeviceSN); return(error <= 0); }
public static void SaveParameter(IPCameraParameter Parameter, string ConfigPath) { string xml = Utility.XmlSerialize(Parameter, null, "utf-8"); using (FileStream fileStream = new FileStream(ConfigPath, FileMode.Create, FileAccess.Write, FileShare.Write)) { using (StreamWriter streamWriter = new StreamWriter(fileStream)) { streamWriter.Write(xml); } } }
public static IPCameraParameter LoadParameter(string ConfigPath) { string xml = ""; IPCameraParameter cameraParameter = null; using (FileStream fileStream = new FileStream(ConfigPath, FileMode.Open, FileAccess.Read, FileShare.Read)) { using (StreamReader streamReader = new StreamReader(fileStream)) { xml = streamReader.ReadToEnd(); } } cameraParameter = Utility.XmlDeserialize <IPCameraParameter>(xml, null, "utf-8"); return(cameraParameter); }