def DispatchConsoleCommand(consoleCommand): if consoleCommand: # consoleCommand is a delegate for a dynamic method that embodies the # input expression from the user. Run it on the other thread. dispatcher.Invoke(consoleCommand) else: Application.Exit()
def on_click(self, sender, event): if sender == self.menuitem2 or sender == self.menuitem3: sender.Checked = not sender.Checked status = sender.Checked and ' ' or ' not ' self.label.Text = "%s is%schecked" % (sender.Text, status) elif sender == self.menuitem4: Application.Exit() else: self.label.Text = "you have clicked %s" % sender.Text
def on_click(self, sender, evernt): if sender == self.menu_file_exit: Application.Exit() elif sender == self.menu_help_about: MessageBox.Show("Mono:Accessibility winform controls test sample\n" "Developer: Novell a11y hackers", "About") else: self.label.Text = "You have clicked %s" % sender.Text
def buttonPressed(self, sender, args): global currentDir, pathContactFile, pathCallRecordsFile currentDir = sender.FindForm().Controls.Find('ImportDir',True)[0].Text #fileNameRegex = sender.FindForm().Controls.Find('fileNameRegex',True)[0].Text try: startTime = time.time() #currentDir= __file__[:__file__.rfind('\\')]+"\\EmailWhatsApp\\" #debugFile = currentDir+"/log.txt" pathContactFile = currentDir+'/contactsRecords.dat' pathCallRecordsFile = currentDir+'/callsRecords.dat' #calling the parser for results results = SPIWhatsAppEmailsParser().parse() print "Finished",('The script took {0} seconds !'.format(time.time() - startTime)) Application.Exit() except Exception as e: print traceback.format_exc() exc_type, exc_obj, exc_tb = sys.exc_info() fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1] print(exc_type, fname, exc_tb.tb_lineno) print("Oops!", sys.exc_info(), "occurred.") print('ERRO: Error importing whatsapp data.') return
def onExit(self, sender, event): self.notifyIcon.Visible = False Application.Exit()
def DispatchConsoleCommand(consoleCommand): if consoleCommand: dispatcher.Invoke(consoleCommand) else: Application.Exit()