private void FormConfig_Shown(object sender, EventArgs e)
        {
            foreach (var item in Program.Plugins)
            {
                ISmartPlugins plugin = Program.Plugins[item.Key];

                TabControlPanel tabCorpodoab = new TabControlPanel();
                TabItem         tabNomedoTab = new TabItem();
                UserControl     painel       = plugin.PainelConfiguracoes;
                painel.Dock = DockStyle.Fill;

                //
                // tabCorpodoab
                //
                tabCorpodoab.DisabledBackColor = Color.Empty;
                tabCorpodoab.Dock    = DockStyle.Fill;
                tabCorpodoab.Padding = new System.Windows.Forms.Padding(1);
                tabCorpodoab.TabItem = tabNomedoTab;
                tabCorpodoab.Controls.Add(painel);

                //
                // tabNomedoTab
                //
                tabNomedoTab.AttachedControl = tabCorpodoab;
                tabNomedoTab.Text            = plugin.Titulo;

                ControleTabulacao.Controls.Add(tabCorpodoab);
                ControleTabulacao.Tabs.Add(tabNomedoTab);
            }
        }
Exemple #2
0
 private static void Application_ApplicationExit(object sender, EventArgs e)
 {
     if (Plugins != null)
     {
         foreach (var item in Plugins)
         {
             ISmartPlugins plugin = Plugins[item.Key];
             plugin.Finalizar();
         }
     }
 }
Exemple #3
0
 private static void ExecutarProcedimentoInicialdoPlugin()
 {
     foreach (var item in Plugins)
     {
         ISmartPlugins plugin = Plugins[item.Key];
         plugin.Logs += (object sender, EventArgs e) => { Log.Info(sender); };
         plugin.AoIdentificarDispositivo += (object sender, EventArgs e) =>
         {
             if (MonitorPedestres != null && MonitorPedestres.Visible == true)
             {
                 MonitorPedestres.ExibirIdentificacao(sender);
             }
         };
         plugin.Iniciar();
     }
 }
Exemple #4
0
        internal ContextMenuStrip Montar()
        {
            ContextMenuStrip menu = new ContextMenuStrip();

            // Monta um item do menu para cada plugin carregado
            foreach (var plugin in Program.Plugins)
            {
                ISmartPlugins item = Program.Plugins[plugin.Key];

                ToolStripMenuItem itemmenu = new ToolStripMenuItem
                {
                    Text  = item.Titulo,
                    Image = item.Icone
                };

                itemmenu.Click += (object sender, EventArgs e) =>
                {
                    item.Exibir();
                };
                menu.Items.Add(itemmenu);
            }


            // Monitor de pessoas
            ToolStripMenuItem monitor_pedestres = new ToolStripMenuItem
            {
                Text  = "Monitor de pedestres",
                Image = Properties.Resources.monitor_pedestre1
            };

            monitor_pedestres.Click += Monitor_pedestres_Click;;
            menu.Items.Add(monitor_pedestres);

            // Monitor de veiculos
            ToolStripMenuItem monitor_veiculos = new ToolStripMenuItem
            {
                Text  = "Monitor de veículos",
                Image = Properties.Resources.monitor_veiculos1
            };

            monitor_veiculos.Click += Monitor_veiculos_Click;
            menu.Items.Add(monitor_veiculos);


            // Adiciona um separador
            menu.Items.Add(new ToolStripSeparator());

            // Configurações
            ToolStripMenuItem configuracoes = new ToolStripMenuItem
            {
                Text  = "Configurações",
                Image = Properties.Resources.info1
            };

            configuracoes.Click += Configuracoes_Click;
            menu.Items.Add(configuracoes);

            // Mostra o formulário sobre
            ToolStripMenuItem sobre = new ToolStripMenuItem
            {
                Text  = "Sobre",
                Image = Properties.Resources.info1
            };

            sobre.Click += Sobre_Click;
            menu.Items.Add(sobre);

            // Adiciona um separador
            menu.Items.Add(new ToolStripSeparator());

            // Finaliza o sistema
            ToolStripMenuItem sair = new ToolStripMenuItem
            {
                Text  = "Sair",
                Image = Properties.Resources.sair1
            };

            sair.Click += Sair_Click;
            menu.Items.Add(sair);

            return(menu);
        }