// ALL RIGHTS RESERVED:
// ====================
// The contents of this file, and associated files in this directory, are 
// Copyright (C) SPT , all rights reserved, 2009.
// All software Source Code, Images, Database-Design and code, Graphics Design 
// and source files, and related content (collectively referred to as SOURCE) are 
// Copyright (c) SPT, 2009, All Rights Reserved.
// http://SerialPortTool.com

// PTZ Controller is a Registered Trademark of SerialPortTool.com.



using System;
using System.Data;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;
using System.Collections.Generic;
using SPT.PTZ.Core;

namespace PTZController
{
    public delegate void AuxEventHandler(PtzFunction fuction, int index);

    public partial class AuxForm : PanelForm
    {
        public AuxForm()
        {
            InitializeComponent();
        }

        private void AuxForm_Load(object sender, EventArgs e)
        {

        }

        private void onButton_Click(object sender, EventArgs e)
        {
            int n = HelpFunction.ParseIndex((sender as Control).Name);
            AuxEvent(PtzFunction.AuxiliaryOn, n);
        }

        private void offButton_Click(object sender, EventArgs e)
        {
            int n = HelpFunction.ParseIndex((sender as Control).Name);
            AuxEvent(PtzFunction.AuxiliaryOff, n);
        }

        AuxEventHandler _onAuxEvent;

        public AuxEventHandler AuxEvent
        {
            get { return _onAuxEvent; }
            set { _onAuxEvent = value; }
        }
    }
}