// constructor
        #region Constructors
        public canSendWorker(canSender sender, messageSendParams p)
        {
            this.sender = sender;

            Params = p;

            // create the timer
            timer         = new System.Windows.Forms.Timer();
            timer.Tick   += new EventHandler(callback);
            timer.Enabled = false;

            totalSent             = 0;
            remainSendToCheckStop = 0;
        }
示例#2
0
        public UcSendMessage(CanMessageSendTool canSendTool)
        {
            InitializeComponent();
            this.Dock   = DockStyle.Fill;
            this.Margin = new Padding(20, 20, 20, 20);
            CanTool     = canSendTool;
            this.sender = new canSender(this);

            grid.Dock = DockStyle.Fill;

            grid.ContextMenuStrip = contextMenu;

            contextMenu.Items.Add("New message");
            contextMenu.Items.Add("Edit Selected");
            contextMenu.Items.Add("Delete Selected");
            contextMenu.Items.Add(new ToolStripSeparator());
            contextMenu.Items.Add("Enable All");
            contextMenu.Items.Add("Disable All");
            contextMenu.Items.Add("Delete All");
            contextMenu.Items.Add(new ToolStripSeparator());
            contextMenu.Items.Add("Copy Selected");

            contextMenu.Opening     += ContextMenu_ContextMenuOpening;
            contextMenu.ItemClicked += onContextMenuClicked;


            items = new List <canSendWorker>();

            //gbAddMessage.Margin = new Padding(20);
            // features: refular and RTR message
            // trigger: timer, RTR response, on data

            // create grid:
            //checkbox (en/dis), type, id, dlc, data, interval, count, sent, remain
            guiCreateGrid();
        }