本文整理汇总了C#中iSpyApplication.Controls.CameraWindow.Enable方法的典型用法代码示例。如果您正苦于以下问题:C# CameraWindow.Enable方法的具体用法?C# CameraWindow.Enable怎么用?C# CameraWindow.Enable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iSpyApplication.Controls.CameraWindow
的用法示例。
在下文中一共展示了CameraWindow.Enable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DisplayCamera
public void DisplayCamera(objectsCamera cam, bool enableOnDisplay = false)
{
var cameraControl = new CameraWindow(cam,this);
SetCameraEvents(cameraControl);
cameraControl.BackColor = Conf.BackColor.ToColor();
_pnlCameras.Controls.Add(cameraControl);
cameraControl.Location = new Point(cam.x, cam.y);
cameraControl.Size = new Size(cam.width, cam.height);
cameraControl.BringToFront();
cameraControl.Tag = GetControlIndex();
var dir = Helper.GetMediaDirectory(2, cam.id);
string path = dir + "video\\" + cam.directory + "\\";
try
{
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
path = dir + "video\\" + cam.directory + "\\thumbs\\";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
//move existing thumbs into directory
var lfi =
Directory.GetFiles(dir + "video\\" + cam.directory + "\\", "*.jpg").ToList();
foreach (string file in lfi)
{
string destfile = file;
int i = destfile.LastIndexOf(@"\", StringComparison.Ordinal);
destfile = file.Substring(0, i) + @"\thumbs" + file.Substring(i);
File.Move(file, destfile);
}
}
path = dir + "video\\" + cam.directory + "\\grabs\\";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
}
catch (Exception ex)
{
LogExceptionToFile(ex);
}
if (enableOnDisplay)
cameraControl.Enable();
cameraControl.GetFiles();
}
示例2: DisplayCamera
internal void DisplayCamera(objectsCamera cam)
{
var cameraControl = new CameraWindow(cam);
SetCameraEvents(cameraControl);
cameraControl.BackColor = Conf.BackColor.ToColor();
_pnlCameras.Controls.Add(cameraControl);
cameraControl.Location = new Point(cam.x, cam.y);
cameraControl.Size = new Size(cam.width, cam.height);
cameraControl.BringToFront();
cameraControl.Tag = GetControlIndex();
if (Conf.AutoSchedule && cam.schedule.active && cam.schedule.entries.Any())
{
cam.settings.active = false;
cameraControl.ApplySchedule();
}
else
{
try
{
if (cam.settings.active)
cameraControl.Enable();
}
catch (Exception ex)
{
Log.Error("", ex);
}
}
string path = Conf.MediaDirectory + "video\\" + cam.directory + "\\";
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
path = Conf.MediaDirectory + "video\\" + cam.directory + "\\thumbs\\";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
//move existing thumbs into directory
var lfi =
Directory.GetFiles(Conf.MediaDirectory + "video\\" + cam.directory + "\\", "*.jpg").ToList();
foreach (string file in lfi)
{
string destfile = file;
int i = destfile.LastIndexOf(@"\", StringComparison.Ordinal);
destfile = file.Substring(0, i) + @"\thumbs" + file.Substring(i);
File.Move(file, destfile);
}
}
path = Conf.MediaDirectory + "video\\" + cam.directory + "\\grabs\\";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
}