public void OnStartupComplete(ref Array custom) { try { } catch (Exception ex) { _messageBox.ShowError(ex.ToString()); } }
public void Generate() { try { string dir = @"c:\temp\"; string templateName = "Template"; string startupFileToExecute = "Click To Build.bat"; if (_dte.Solution.IsOpen) { var templates = new List <VSTemplate>(); var templateLinks = new List <ProjectTemplateLink>(); var solutionFolder = new List <SolutionFolder>(); string name = _fileSystem.GetFileName(_dte.Solution.FileName); InitializeTokenReplacer(name); dir = dir.Combine(name); string solutionItemDir = dir.Combine(SOLUTION_ITEMS_FOLDER_NAME); string projectDestinationDirectory = dir.Combine(PROJECTS_FOLDER_NAME); _fileSystem.Delete(dir); CopyNonSolutionFiles(solutionItemDir, solutionFolder); CreateProjectTemplates(templateLinks, templates, projectDestinationDirectory); CopyProjectsToDestinationFolder(projectDestinationDirectory); CreateSolutionTemplate(templateLinks, dir, solutionFolder, templateName, startupFileToExecute); } } catch (Exception ex) { _messageBox.ShowError(ex.ToString()); } }
private static bool DoDefaultExceptionProcess(Exception ex) { IMessageBox box = ServiceProvider.GetService <IMessageBox>(); if (box != null) { box.ShowError(ex.Message); return(true); } else { return(false); } }
private void OnSolutionEventsOnAfterClosing() { _documentEvents.DocumentClosing -= DocumentEventsOnDocumentClosing; //Save state var historyRepository = _historyRepositoryFactory.CreateHistoryRepository(_currentSolution); if (!historyRepository.SaveHistory(_documentHistoryManager.GetAll())) { _messageBox.ShowError("Visual Studio Document Reopen", "Failed to save Closed Document History!"); } SolutionState = SolutionStates.None; _currentSolution = null; _documentHistoryManager.Clear(); }
private void FillControls() { try { base.FillControlsBase("InvestmentSetting.xml", earnings); double investAmount = Double.Parse(xmlTools.XmlAttributeDict["InvestmentAmount"].ToString()) / 10000; TimeLengthTxt.Text = xmlTools.XmlAttributeDict["TimeLength"].ToString(); investAmountTxt.Text = investAmount.ToString(); investYearRateTxt.Text = xmlTools.XmlAttributeDict["XMLYearRate"].ToString(); makingRMBMonthTxt.Text = xmlTools.XmlAttributeDict["MakingMoneyMonth"].ToString(); savingTxt.Text = xmlTools.XmlAttributeDict["Saving"].ToString(); } catch (Exception ex) { IMessageBox.ShowError(ex.Message); } }
private void FillControls() { try { base.FillControlsBase("DebtSetting.xml", debt); if (xmlTools.XmlAttributeDict["DebtType"].ToString() == "MEqualCaptial") { comboBox1.SelectedText = "等额本金"; } else if (xmlTools.XmlAttributeDict["DebtType"].ToString() == "MEqualInterest") { comboBox1.SelectedText = "等额本息"; } sumDebtTxt.Text = xmlTools.XmlAttributeDict["SumDebt"].ToString(); TimeLengthTxt.Text = xmlTools.XmlAttributeDict["TimeLength"].ToString(); yearRateTxt.Text = xmlTools.XmlAttributeDict["XMLYearRate"].ToString(); dateTimePicker1.Text = xmlTools.XmlAttributeDict["OnDebtTime"].ToString(); bigTimesTxt.Text = xmlTools.XmlAttributeDict["BigTimes"].ToString(); } catch (Exception ex) { IMessageBox.ShowError(ex.Message); } }
public void DownloadOrLinkFile(ProductFile file, IMessageBox MessageBox1) { //if they browsed a file then this overrides all other behavior if (_currentMode == Mode.NewUpload) { if (file == null) { file = new ProductFile(); } InitializeProductFile(file, true); if (Save(file)) { if (ProductFile.SaveFile(HccApp.CurrentStore.Id, file.Bvin, file.FileName, NewFileUpload.PostedFile)) { MessageBox1.ShowOk("File saved to server successfully"); } else { MessageBox1.ShowError( "There was an error while trying to save your file to the file system. Please check your asp.net permissions."); } } else { MessageBox1.ShowError("There was an error while trying to save your file to the database."); } } else if (_currentMode == Mode.DropDownList) { if (!string.IsNullOrWhiteSpace(FilesDropDownList.SelectedValue)) { if (file == null) { file = new ProductFile(); } InitializeProductFile(file, true); if (Save(file)) { MessageBox1.ShowOk("File saved to server successfully"); } else { MessageBox1.ShowError("There was an error while trying to save your file to the database."); } } } else if (_currentMode == Mode.FileBrowsed) { if (file == null) { file = new ProductFile(); } InitializeProductFile(file, true); if (Save(file)) { MessageBox1.ShowOk("File saved to server successfully"); } else { MessageBox1.ShowError("There was an error while trying to save your file to the database."); } } InitializeFileLists(); }
/// <summary> /// /// </summary> /// <param name="box"></param> /// <param name="msg"></param> public static void ShowError(this IMessageBox box, string msg) { box.ShowError(msg, "错误"); }
public void DownloadOrLinkFile(ProductFile file, IMessageBox MessageBox1) { //if they browsed a file then this overrides all other behavior if (_currentMode == Mode.NewUpload) { if (file == null) { file = new ProductFile(); } InitializeProductFile(file, true); if (Save(file)) { if (ProductFile.SaveFile(HccApp.CurrentStore.Id, file.Bvin, file.FileName, NewFileUpload.PostedFile)) { MessageBox1.ShowOk(Localization.GetString("FileSaveSuccess")); } else { MessageBox1.ShowError(Localization.GetString("FileSaveFailure")); } } else { MessageBox1.ShowError(Localization.GetString("FileSaveFailure")); } } else if (_currentMode == Mode.DropDownList) { if (!string.IsNullOrWhiteSpace(FilesDropDownList.SelectedValue)) { if (file == null) { file = new ProductFile(); } InitializeProductFile(file, true); if (Save(file)) { MessageBox1.ShowOk(Localization.GetString("FileSaveSuccess")); } else { MessageBox1.ShowError(Localization.GetString("FileSaveFailure")); } } } else if (_currentMode == Mode.FileBrowsed) { if (file == null) { file = new ProductFile(); } InitializeProductFile(file, true); if (Save(file)) { MessageBox1.ShowOk(Localization.GetString("FileSaveSuccess")); } else { MessageBox1.ShowError(Localization.GetString("FileSaveFailure")); } } InitializeFileLists(); }
public void DownloadOrLinkFile(ProductFile file, IMessageBox MessageBox1) { //if they browsed a file then this overrides all other behavior if (_currentMode == Mode.NewUpload) { if (file == null) { file = new ProductFile(); } InitializeProductFile(file, true); if (Save(file)) { if (ProductFile.SaveFile(MyPage.MTApp.CurrentStore.Id, file.Bvin, file.FileName, NewFileUpload.PostedFile)) { MessageBox1.ShowOk("File saved to server successfully"); } else { MessageBox1.ShowError("There was an error while trying to save your file to the file system. Please check your asp.net permissions."); } } else { MessageBox1.ShowError("There was an error while trying to save your file to the database."); } } else if (_currentMode == Mode.DropDownList) { if (FilesDropDownList.SelectedValue.Trim() != "") { if (file == null) { file = new ProductFile(); } InitializeProductFile(file, true); if (Save(file)) { MessageBox1.ShowOk("File saved to server successfully"); } else { MessageBox1.ShowError("There was an error while trying to save your file to the database."); } } } else if (_currentMode == Mode.FileBrowsed) { if (file == null) { file = new ProductFile(); } InitializeProductFile(file, true); if (Save(file)) { MessageBox1.ShowOk("File saved to server successfully"); } else { MessageBox1.ShowError("There was an error while trying to save your file to the database."); } } InitializeFileLists(); }