public bool Connect(MediaDevice device, string login, string password) { bool Result = service.Connect(device, login, password); if (Result == true) { Profile[] profiles = device.ONVIF.MediaProfiles; mainForm.BindMediaProfileCollection(profiles); MediaFormManager.UpdateControls(); } return(Result); }