///<summary></summary> public static void SendData(Program ProgramCur,Patient pat) { _path=Programs.GetProgramPath(Programs.GetCur(ProgramName.DemandForce)); if(!File.Exists(_path)) { MessageBox.Show(_path+" could not be found."); return; } if(MessageBox.Show(Lan.g("DemandForce","This may take 20 minutes or longer")+". "+Lan.g("DemandForce","Continue")+"?","",MessageBoxButtons.OKCancel)!=DialogResult.OK) { return; } _formProg=new FormProgress(); _formProg.MaxVal=100; _formProg.NumberMultiplication=1; _formProg.DisplayText=""; _formProg.NumberFormat="F";//Show whole percentages, not fractional percentages. Thread workerThread=new Thread(new ThreadStart(InstanceBridgeExport)); workerThread.Start(); if(_formProg.ShowDialog()==DialogResult.Cancel) { workerThread.Abort(); MessageBox.Show(Lan.g("DemandForce","Export cancelled")+". "+Lan.g("DemandForce","Partially created file has been deleted")+"."); CheckCreatedFile(CodeBase.ODFileUtils.CombinePaths(Path.GetDirectoryName(_path),"extract.xml")); _formProg.Dispose(); return; } MessageBox.Show(Lan.g("DemandForce","Export complete")+". "+Lan.g("DemandForce","Press OK to launch DemandForce")+"."); try { Process.Start(_path);//We might have to add extract.xml to launch command in the future. } catch { MessageBox.Show(_path+" is not available."); } _formProg.Dispose(); }
protected override IList <OutputGroup> GeneratePreviewData(IList <CaledarMonthOutputItem> monthItems) { var previewGroups = new List <OutputGroup>(); FormProgress.SetTitle("Chill-Out for a few seconds...\nPreparing Calendar for Preview..."); FormProgress.ShowProgress(FormMain); Enabled = false; foreach (var monthOutputItem in monthItems) { var tempPresentationPath = Path.Combine(Common.Core.Configuration.ResourceManager.Instance.TempFolder.LocalPath, Path.GetFileName(Path.GetTempFileName())); var previewGroup = new OutputGroup { Name = monthOutputItem.DisplayName, IsCurrent = monthOutputItem.IsCurrent, Items = new List <OutputItem>(new[] { new OutputItem { Name = monthOutputItem.DisplayName, PresentationSourcePath = tempPresentationPath, SlidesCount = 1, IsCurrent = true, SlideGeneratingAction = (processor, destinationPresentation) => { processor.AppendCalendar(monthOutputItem.CalendarMonth.OutputData, destinationPresentation); }, PreviewGeneratingAction = (processor, filePath) => { processor.PrepareCalendarPreview(filePath, monthOutputItem.CalendarMonth.OutputData); } } }) }; previewGroups.Add(previewGroup); } FormProgress.CloseProgress(); Utilities.ActivateForm(Controller.Instance.FormMain.Handle, Controller.Instance.FormMain.WindowState == FormWindowState.Maximized, false); return(previewGroups); }
private void OnConvertClick(object sender, EventArgs e) { var sourcePath = buttonEditSource.EditValue as String; if (String.IsNullOrEmpty(sourcePath) || !Directory.Exists(sourcePath)) { PopupMessageHelper.Instance.ShowWarning("Soure path is not correct"); return; } var result = false; Application.DoEvents(); FormProgress.ShowProgress("Converting Data...", () => { result = _convertManager.RunConversion(sourcePath); }); if (result) { PopupMessageHelper.Instance.ShowInformation("Conversion Successfully Complited"); } }
protected override void EmailInternal(IEnumerable <CalendarOutputData> outputData) { if (outputData == null) { return; } var commonOutputData = outputData.OfType <AdCalendarOutputData>(); var previewGroups = new List <PreviewGroup>(); FormProgress.SetTitle("Chill-Out for a few seconds...\nPreparing Calendar for Email..."); FormProgress.ShowProgress(); Enabled = false; foreach (var outputItem in commonOutputData) { var previewGroup = new PreviewGroup { Name = outputItem.MonthText, PresentationSourcePath = Path.Combine(Core.Common.ResourceManager.Instance.TempFolder.LocalPath, Path.GetFileName(Path.GetTempFileName())) }; AdSchedulePowerPointHelper.Instance.PrepareCalendarEmail(previewGroup.PresentationSourcePath, new[] { outputItem }); previewGroups.Add(previewGroup); } Enabled = true; FormProgress.CloseProgress(); if (!(previewGroups.Any() && previewGroups.All(pg => File.Exists(pg.PresentationSourcePath)))) { return; } using (var formEmail = new FormEmail(AdSchedulePowerPointHelper.Instance, BusinessObjects.Instance.HelpManager)) { formEmail.Text = "Email this Calendar"; formEmail.LoadGroups(previewGroups); Utilities.Instance.ActivateForm(Controller.Instance.FormMain.Handle, true, false); RegistryHelper.MainFormHandle = formEmail.Handle; RegistryHelper.MaximizeMainForm = false; formEmail.ShowDialog(); RegistryHelper.MaximizeMainForm = Controller.Instance.FormMain.WindowState == FormWindowState.Maximized; RegistryHelper.MainFormHandle = Controller.Instance.FormMain.Handle; } }
protected override void PdfInternal(IEnumerable <CalendarOutputData> outputData) { if (outputData == null) { return; } var commonOutputData = outputData.OfType <AdCalendarOutputData>(); TrackOutput(); var previewGroups = new List <PreviewGroup>(); Controller.Instance.ShowFloater(() => { FormProgress.SetTitle(outputData.Count() == 2 ? "Creating 2 (two) Calendar slides…\nThis will take about a minute…" : "Creating Calendar slides…\nThis will take a few minutes…"); FormProgress.ShowProgress(); Enabled = false; foreach (var outputItem in commonOutputData) { var previewGroup = new PreviewGroup { Name = outputItem.MonthText, PresentationSourcePath = Path.Combine(Core.Common.ResourceManager.Instance.TempFolder.LocalPath, Path.GetFileName(Path.GetTempFileName())) }; AdSchedulePowerPointHelper.Instance.PrepareCalendarEmail(previewGroup.PresentationSourcePath, new[] { outputItem }); previewGroups.Add(previewGroup); } var pdfFileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), String.Format("{0}-{1}.pdf", _localSchedule.Name, DateTime.Now.ToString("MM-dd-yy-hmmss"))); AdSchedulePowerPointHelper.Instance.BuildPdf(pdfFileName, previewGroups.Select(pg => pg.PresentationSourcePath)); if (File.Exists(pdfFileName)) { try { Process.Start(pdfFileName); } catch { } } Enabled = true; FormProgress.CloseProgress(); }); }
/// <summary> /// Compile given GMacDSL code into a GMacAST structure /// </summary> /// <param name="dslCode"></param> /// <returns></returns> private static AstRoot BeginCompilation(string dslCode) { //GMacSystemUtils.InitializeGMac(); //Compile GMacDSL code into GMacAST var compiler = GMacProjectCompiler.CompileDslCode(dslCode, Application.LocalUserAppDataPath, "tempTask"); //Reduce details of progress reporting during code composition compiler.Progress.DisableAfterNextReport = true; if (compiler.Progress.History.HasErrorsOrFailures) { //Compilation of GMacDSL code failed var formProgress = new FormProgress(compiler.Progress, null, null); formProgress.ShowDialog(); return(null); } //Compilation of GMacDSL code successful, return constructed GMacAST root return(compiler.Root); }
private void btnQuery_Click(object sender, EventArgs e) { var files = GetSelectedFiles("dbc"); if (files == null || !files.Any()) { MessageBox.Show("Selecione ao menos um arquivo compatível (.dbc)", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } IEnumerable <FileInfo> dbfs = null; FormProgress.Run(() => { DiscoverRepository.GetInstance().ExportFiles2DBF(files, f => dbfs = f); }, ShowError); if (dbfs?.Any() == true) { var wk = dbfs.First().Directory.FullName; FormViewTable.ShowTables(wk, dbfs.Select(f => f.Name).ToArray()); } }
private void OnSlideContentWebViewDownloadCompleted(object sender, DownloadEventArgs e) { if (!_extensionsManager.LinkViewContentExtension.ContentEnabled) { return; } switch (_afterDownloadAction) { case AfterDownloadAction.Print: ExtensionsManager.PrintFile( e.Item.FullPath, (_extensionsManager.LinkViewContentExtension.CurrentPrintableContent.CurrentPage + 1) ?? 1); break; default: _siteContainer.ParentBundle.ShowFloater(new FloaterRequestedEventArgs { AfterShow = () => { if (_extensionsManager.LinkViewContentExtension.CurrentLinkViewContent?.ContentType == LinkContentType.Video) { FormProgress.SetTitle("Chill-Out for a few seconds...\nGenerating slides so your presentation can look AWESOME!"); FormProgress.ShowOutputProgress(); _siteContainer.ParentBundle.PowerPointSingleton.InsertVideoIntoActivePresentation(e.Item.FullPath); FormProgress.CloseProgress(); } else if (_extensionsManager.LinkViewContentExtension.CurrentLinkViewContent?.ContentType == LinkContentType.PowerPoint) { FormProgress.SetTitle("Chill-Out for a few seconds...\nGenerating slides so your presentation can look AWESOME!"); FormProgress.ShowOutputProgress(); _siteContainer.ParentBundle.PowerPointSingleton.AppendSlidesFromFile(e.Item.FullPath); FormProgress.CloseProgress(); } } }); break; } }
public void LoadData(DateTime dateBegin, DateTime dateEnd) { gridControlData.DataSource = null; _data.Clear(); var isSuccessful = false; FormProgress.RunProcessWithProgress("Loading Data...", MainController.Instance.MainForm, () => { try { var client = new RestClient(MainController.SiteUrl); var request = new RestRequest("activity/list", Method.GET); request.AddParameter("dateBegin", dateBegin); request.AddParameter("dateEnd", dateEnd); var response = ResponeModel.Deserialize(client.Execute(request).Content); isSuccessful = response.IsSuccess; if (isSuccessful) { _data.AddRange(response.GetData <RawActivityModel[]>()); } } catch (Exception) { isSuccessful = false; } }); if (isSuccessful) { gridControlData.DataSource = _data; gridViewData.RefreshData(); } else { MainController.Instance.PopupMessages.ShowWarning("Error occured while loading data"); } }
private void ReviewBoardCommand(object caller, EventArgs args) { // TODO:(pv) Preselect most of the changed files according to the items selected in the Solution Explorer. // See below "GetCurrentSelection()" code. // I am holding off doing this because it is a little complicated trying to figure out what the user intended to submit. // Does selecting a folder mean to also submit all files in that folder? // What if a few files/subfolders of that folder are also selected? // Should none of the other items be selected? // For now, just check *all* visible solution items for changes... IVsOutputWindowPane owp = GetOutputWindowPaneGeneral(); if (owp != null) { owp.Activate(); } if (!solutionTracker.BackgroundInitialSolutionCrawl.IsBusy) { // The initial solution crawl is finished. // Just show the submit form as usual... ShowFormSubmit(); } else { // The initial solution crawl is still in progress. // Display a cancelable modal dialog until the solution crawl is finished. string message = "Waiting for initial solution crawl to complete..."; FormProgress progress = new FormProgress(message, message, solutionTracker.BackgroundInitialSolutionCrawl); DialogResult result = progress.ShowDialog(); if (result == DialogResult.OK) { ShowFormSubmit(); } } }
public void Output() { SaveChanges(); FormProgress.SetTitle("Chill-Out for a few seconds...\nGenerating slides so your presentation can look AWESOME!"); FormProgress.ShowProgress(); if (checkEditUseEmptyCover.Checked) { AppManager.Instance.ShowFloater(() => { AppManager.Instance.PowerPointManager.Processor.AppendGenericCover(checkEditFirstSlide.Checked); FormProgress.CloseProgress(); }); } else { AppManager.Instance.ShowFloater(() => { AppManager.Instance.PowerPointManager.Processor.AppendCover(checkEditFirstSlide.Checked); FormProgress.CloseProgress(); }); } }
private void UpdateView() { formProgress1 = new FormProgress(); formProgress1.StartPosition = FormStartPosition.Manual; formProgress1.Location = new System.Drawing.Point(this.Location.X + this.Width / 2, this.Location.Y + this.Height / 2); formProgress1.Show(); formProgress1.Refresh(); displayOptionsDialog1.OnProgress += new cbp.ProgressEventHandler(displayDirector1_OnProgress); TimeSeries.SeriesList list = input.CreateSelectedSeries(scenarioChooser1.Selected, SelectedSites()); if (list.Count > 0) { presenter.Draw(input); // displayOptionsDialog1.Draw(list, viewer1); } else { viewer1.Clear(); } }
private void OnDataSourceButtonCheckedChanged(object sender, EventArgs e) { if (!AllowToSave) { return; } var buttonItem = (ButtonItem)sender; if (!buttonItem.Checked) { return; } ApplyChanges(); ((BroadcastCalendar)EditedContent).DataSourceType = (BroadcastDataTypeEnum)buttonItem.Tag; Splash(true); FormProgress.ShowProgress("Loading Data...", () => { ReleaseControls(); LoadCalendar(); }); Splash(false); SettingsNotSaved = true; }
private void LoadTabPage(IChildTabPageContainer tabPageContainer, bool showSplash) { if (tabPageContainer == null) { return; } if (tabPageContainer.ContentControl != null) { return; } xtraTabControl.Selecting += OnTabPageSelecting; if (showSplash) { FormProgress.ShowProgress("Loading data...", () => { tabPageContainer.LoadContent(); if (tabPageContainer.ContentControl != null) { tabPageContainer.ContentControl.LoadData(); tabPageContainer.ContentControl.SlideDescriptionChanged += OnSlideDescriptionChanged; } tabPageContainer.FormatSlideHeader(); }); } else { tabPageContainer.LoadContent(); if (tabPageContainer.ContentControl != null) { tabPageContainer.ContentControl.LoadData(); tabPageContainer.ContentControl.SlideDescriptionChanged += OnSlideDescriptionChanged; } tabPageContainer.FormatSlideHeader(); } xtraTabControl.Selecting -= OnTabPageSelecting; }
///<summary></summary> public static void SendData(Program ProgramCur, Patient pat) { _path = Programs.GetProgramPath(Programs.GetCur(ProgramName.DemandForce)); if (!File.Exists(_path)) { MessageBox.Show(_path + " could not be found."); return; } if (MessageBox.Show(Lan.g("DemandForce", "This may take 20 minutes or longer") + ". " + Lan.g("DemandForce", "Continue") + "?", "", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } _formProg = new FormProgress(); _formProg.MaxVal = 100; _formProg.NumberMultiplication = 1; _formProg.DisplayText = ""; _formProg.NumberFormat = "F"; //Show whole percentages, not fractional percentages. Thread workerThread = new Thread(new ThreadStart(InstanceBridgeExport)); workerThread.Start(); if (_formProg.ShowDialog() == DialogResult.Cancel) { workerThread.Abort(); MessageBox.Show(Lan.g("DemandForce", "Export cancelled") + ". " + Lan.g("DemandForce", "Partially created file has been deleted") + "."); CheckCreatedFile(CodeBase.ODFileUtils.CombinePaths(Path.GetDirectoryName(_path), "extract.xml")); _formProg.Dispose(); return; } MessageBox.Show(Lan.g("DemandForce", "Export complete") + ". " + Lan.g("DemandForce", "Press OK to launch DemandForce") + "."); try { ODFileUtils.ProcessStart(_path); //We might have to add extract.xml to launch command in the future. } catch { MessageBox.Show(_path + " is not available."); } _formProg.Dispose(); }
public override void OutputPdf() { var outputItems = GetOutputItems(false); if (!outputItems.Any()) { return; } Controller.Instance.ShowFloater(() => { FormProgress.ShowProgress( "Chill-Out for a few seconds...\nGenerating slides so your presentation can look AWESOME!", () => { var pdfFileName = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.Desktop), String.Format("{0}-{1:MM-dd-yy-hmmss}.pdf", "star", DateTime.Now)); BusinessObjects.Instance.PowerPointManager.Processor.BuildPdf(pdfFileName, presentation => { foreach (var outputItem in outputItems) { outputItem.SlideGeneratingAction?.Invoke(BusinessObjects.Instance.PowerPointManager.Processor, presentation); } }); FormProgress.CloseProgress(); if (File.Exists(pdfFileName)) { try { Process.Start(pdfFileName); } catch { } } }, false); }); }
protected override void OpenLinkInternal() { if (FileStorageManager.Instance.UseLocalMode) { PopupMessageHelper.Instance.ShowWarning("You are not connected to the internet. Check your web connection and try again."); return; } FormProgress.SetTitle("Loading file...", true); FormProgress.ShowProgress(); var thread = new Thread(() => AsyncHelper.RunSync(async() => { if (await _file.Exists(true, true)) { await _file.Download(true); } })); thread.Start(); while (thread.IsAlive) { Application.DoEvents(); } FormProgress.CloseProgress(); if (_file.ExistsLocal()) { try { Process.Start(_file.LocalPath); } catch { } } else { PopupMessageHelper.Instance.ShowWarning("File not found"); } }
private void OpenLanLink(string linkPath) { var linkPathAvailable = false; FormProgress.ShowProgress( "Scanning your network for this location…", () => { try { linkPathAvailable = Directory.Exists(linkPath); if (linkPathAvailable) { Process.Start(linkPath); } } catch { } }, false); if (!linkPathAvailable) { MessageBox.Show("Your Browser does not allow access to this network location…", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
public static void SearchLyrics(CD cd, Track track) { FormProgress formProgress = new FormProgress(); formProgress.LabelProgress.Text = StringTable.SearchLyrics; formProgress.ProgressBar.Maximum = 1; formProgress.Show(); Application.DoEvents(); string artist = (cd.Sampler) ? track.Artist : cd.Artist; string title = track.Title; if (!string.IsNullOrEmpty(artist) && !string.IsNullOrEmpty(title)) { string lyrics = Search(artist, title); track.Lyrics = lyrics; } formProgress.ProgressBar.Value++; Application.DoEvents(); formProgress.Close(); }
public PreviewGroupControl( OutputGroup outputGroup, PowerPointProcessor mainPowerPointProcessor, Form parentForm, FormPreview previewForm) { OutputGroup = outputGroup; _mainPowerPointProcessor = mainPowerPointProcessor; _parentForm = parentForm; _previewForm = previewForm; InitializeComponent(); Text = OutputGroup.Name; FormProgress.Init(_parentForm); xtraTabControlItems.TabPages.AddRange(outputGroup.Items.Select(previewItem => new PreviewItemControl(previewItem)).ToArray()); xtraTabControlItems.ShowTabHeader = xtraTabControlItems.TabPages.Count > 1 ? DefaultBoolean.True : DefaultBoolean.False; xtraTabControlItems.SelectedTabPage = xtraTabControlItems.TabPages .OfType <PreviewItemControl>() .FirstOrDefault(previewControl => previewControl.OutputItem.IsCurrent) ?? xtraTabControlItems.SelectedTabPage; xtraTabControlItems.SelectedPageChanged += OnSelectedPreviewItemChanged; }
protected override void OnEditAction() { MethodDiagramViewer mv = this.DiagramViewer; if (mv != null) { ILimnorDesignerLoader loader = mv.DesignerHolder.Designer as ILimnorDesignerLoader; ISingleAction av = this.ActionObject as ISingleAction; string name = av.ActionData.ActionName; FormProgress.HideProgress(); if (av.ActionData.Edit(loader.Writer, mv.Method, this.FindForm(), false)) { if (name != av.ActionData.ActionName) { IMethodDiagram p = this.Parent as IMethodDiagram; if (p != null) { p.OnActionNameChanged(av.ActionData.ActionName, av.ActionId.WholeTaskId); } } mv.Changed = true; } } }
/// <summary> /// Refresh the disk selection by (re-)enumerating the available devices of the system. /// </summary> private void RefreshPage() { // store the currently selected device (if any) Device selectedDevice = SelectedDevice; // clear the devices already enumerated in the list-view lsvDevices.Items.Clear(); // enumerating the devices can take quite a time if a harddisk has to spin up: use progress dialog FormProgress dlg = new FormProgress(); dlg.DoWork += backgroundWorker_DoWork; dlg.ShowDialog(this); // the devices have been enumerated foreach (PhysicalDrive.DriveInfo drive in drives) { ListViewItem item = new ListViewItem(string.Format("{0} {1}:", PageContext.GetInstance().GetResourceString("Disk"), drive.DriveNumber)); item.Font = new Font(item.Font, FontStyle.Bold); item.Tag = new Device(drive); item.SubItems.Add(""); item.SubItems.Add(PhysicalDrive.GetAsBestFitSizeUnit(drive.Size)); item.SubItems.Add(""); lsvDevices.Items.Add(item); foreach (PhysicalDrive.PARTITION_INFORMATION_EX partition in drive.Partitions) { PhysicalDrive.VolumeInfo volumeInfo = null; foreach (PhysicalDrive.VolumeInfo volume in volumes) { if ((volume.DeviceInfo.DeviceNumber == drive.DriveNumber) && (volume.DeviceInfo.PartitionNumber == partition.PartitionNumber)) { volumeInfo = volume; break; } } item = new ListViewItem(string.Format(@"\Device\Harddisk{0}\Partition{1}", drive.DriveNumber, partition.PartitionNumber)); item.Tag = new Device(drive, partition.PartitionNumber); item.SubItems.Add((volumeInfo != null) ? volumeInfo.RootPath : string.Empty); item.SubItems.Add(PhysicalDrive.GetAsBestFitSizeUnit(partition.PartitionLength)); item.SubItems.Add((volumeInfo != null) ? volumeInfo.Label : string.Empty); lsvDevices.Items.Add(item); // re-select the previously selected device if it still exists if ((selectedDevice != null) && selectedDevice.Partition.HasValue && (drive.DriveNumber == selectedDevice.Drive.DriveNumber) && (partition.PartitionNumber == selectedDevice.Partition.Value)) { item.Focused = true; item.Selected = true; } } } // the ready state of the wizard page might have changed lsvPhysicalDrives_SelectedIndexChanged(this, new EventArgs()); }
/// <summary> /// Refresh the disk selection by (re-)enumerating the available disks of the system. /// </summary> private void RefreshPage() { // store the currently selected physical drive (if any) Device selectedDisk = SelectedDisk; // clear the physical drives already enumerated in the list-view lsvPhysicalDrives.Items.Clear(); // enumerating the physical drives can take quite a time if a harddisk has to spin up: use progress dialog FormProgress dlg = new FormProgress(); dlg.DoWork += backgroundWorker_DoWork; dlg.ShowDialog(this); // the physical drives have been enumerated foreach (PhysicalDrive.DriveInfo drive in drives) { ListViewItem item = new ListViewItem(string.Format("{0} {1}", PageContext.GetInstance().GetResourceString("Disk"), drive.DriveNumber)); item.Tag = new Device(drive); string type; switch (drive.PartitionStyle) { case PhysicalDrive.PARTITION_STYLE.PARTITION_STYLE_MBR: type = "MBR"; break; case PhysicalDrive.PARTITION_STYLE.PARTITION_STYLE_GPT: type = "GPT"; break; default: type = "RAW"; break; } item.SubItems.Add(type); item.SubItems.Add(PhysicalDrive.GetAsBestFitSizeUnit(drive.Size)); item.SubItems.Add((drive.Size / drive.Geometry.BytesPerSector).ToString()); item.SubItems.Add(string.Format("{0}/{1}/{2}", drive.Geometry.Cylinders, drive.Geometry.TracksPerCylinder, drive.Geometry.SectorsPerTrack)); lsvPhysicalDrives.Items.Add(item); // re-select the previously selected physical drive if it still exists if ((selectedDisk != null) && (drive.DriveNumber == selectedDisk.Drive.DriveNumber)) { item.Focused = true; item.Selected = true; } } // the ready state of the wizard page might have changed lsvPhysicalDrives_SelectedIndexChanged(this, new EventArgs()); }
public void Fill(Database db, ConnectionInfo ci, bool selectFirst) { isLoading = true; //trv.Nodes.Clear(); string time; var tc = new TimerCount(); using (progress = new FormProgress()) { //f.StartProgress(1, count); progress.SetMessage("Loading objects"); progress.Show(this); progress.Update(); try { tc.Next("NodeDatabase"); if (nodeDb == null) { nodeDb = new NodeDatabase(ci.Text); nodeDb.Fill(db); trv.Nodes.Add(nodeDb); trv.HandleMultiSelection = true; tc.Next("ExpandAllForce"); trv.ExpandAllForce(db); } tc.Next("DataToView"); DataToView(); tc.Next("LoadGrid"); LoadGrid(db); tc.Next("nodeDb.Expand()"); nodeDb.Expand(); if (selectFirst) { bool isSelected = false; int count = 0; var nodeTables = GetNode <NodeTables>(); foreach (NodeBase node in nodeTables.Nodes) { count++; if (node.Checked) { isSelected = true; trv.SelectedNode = node; node.EnsureVisible(); break; } } if (!isSelected) { var nodeViews = GetNode <NodeViews>(); foreach (NodeBase node in nodeViews.Nodes) { count++; if (node.Checked) { trv.SelectedNode = node; node.EnsureVisible(); break; } } } if (count <= 15) { trv.TopNode = nodeDb; } } //nodeDb.Checked = false; //nodeDb.UncheckChildren(); //nodeDb.Checked = false; time = tc.ToString(); } catch (Exception ex) { time = tc.ToString(); Program.ShowError(ex); } } //ControlUtil.ChangeFontOnlyParent(tabObjects, 12); isLoading = false; #if DEBUG2 if (db.ProviderType == EnumDbProviderType.Oracle) { Program.ShowInformation(time); } #endif }
public void PrintPdf() { Save(); var tabPages = xtraTabControlPublications.TabPages.Where(tabPage => tabPage.PageEnabled).OfType <IBasicOverviewOutputControl>(); var selectedProducts = new List <IBasicOverviewOutputControl>(); if (tabPages.Count() > 1) { using (var form = new FormSelectOutputItems()) { form.Text = "Select Products"; var currentProduct = xtraTabControlPublications.SelectedTabPage as IBasicOverviewOutputControl; foreach (var tabPage in tabPages) { var item = new CheckedListBoxItem(tabPage, tabPage.SlideName); form.checkedListBoxControlOutputItems.Items.Add(item); if (tabPage == currentProduct) { form.buttonXSelectCurrent.Tag = item; } } form.checkedListBoxControlOutputItems.CheckAll(); if (form.ShowDialog() == DialogResult.OK) { selectedProducts.AddRange(form.checkedListBoxControlOutputItems.Items. OfType <CheckedListBoxItem>(). Where(ci => ci.CheckState == CheckState.Checked). Select(ci => ci.Value). OfType <IBasicOverviewOutputControl>()); } } } else { selectedProducts.AddRange(tabPages); } if (!selectedProducts.Any()) { return; } TrackOutput(selectedProducts.OfType <PublicationBasicOverviewControl>()); FormProgress.SetTitle("Chill-Out for a few seconds...\nGenerating slides so your presentation can look AWESOME!"); Controller.Instance.ShowFloater(() => { FormProgress.ShowProgress(); var previewGroups = new List <PreviewGroup>(); previewGroups.AddRange(selectedProducts.Select(productControl => { var previewGroup = productControl.GetPreviewGroup(); if (productControl is PublicationBasicOverviewControl) { AdSchedulePowerPointHelper.Instance.PrepareBasicOverviewEmail(previewGroup.PresentationSourcePath, new[] { (PublicationBasicOverviewControl)productControl }); } else if (productControl is BasicOverviewSummaryControl) { var summaryControl = productControl as BasicOverviewSummaryControl; summaryControl.PopulateReplacementsList(); AdSchedulePowerPointHelper.Instance.PrepareBasicOverviewSummaryEmail(previewGroup.PresentationSourcePath, summaryControl); } return(previewGroup); })); var pdfFileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), String.Format("{0}-{1}.pdf", LocalSchedule.Name, DateTime.Now.ToString("MM-dd-yy-hmmss"))); AdSchedulePowerPointHelper.Instance.BuildPdf(pdfFileName, previewGroups.Select(pg => pg.PresentationSourcePath)); if (File.Exists(pdfFileName)) { try { Process.Start(pdfFileName); } catch { } } FormProgress.CloseProgress(); }); }
protected override void OnActivated(EventArgs e) { FormProgress.HideProgress(); base.OnActivated(e); }
private void OnFormLoad(object sender, EventArgs e) { PopupMessageHelper.Instance.Title = Text; FormProgress.Init(this); _convertManager.Init(); }
public void Preview() { Save(); var tabPages = xtraTabControlPublications.TabPages.Where(tabPage => tabPage.PageEnabled).OfType <IBasicOverviewOutputControl>(); var selectedProducts = new List <IBasicOverviewOutputControl>(); if (tabPages.Count() > 1) { using (var form = new FormSelectOutputItems()) { form.Text = "Select Products"; var currentProduct = xtraTabControlPublications.SelectedTabPage as IBasicOverviewOutputControl; foreach (var tabPage in tabPages) { var item = new CheckedListBoxItem(tabPage, tabPage.SlideName); form.checkedListBoxControlOutputItems.Items.Add(item); if (tabPage == currentProduct) { form.buttonXSelectCurrent.Tag = item; } } form.checkedListBoxControlOutputItems.CheckAll(); if (form.ShowDialog() == DialogResult.OK) { selectedProducts.AddRange(form.checkedListBoxControlOutputItems.Items. OfType <CheckedListBoxItem>(). Where(ci => ci.CheckState == CheckState.Checked). Select(ci => ci.Value). OfType <IBasicOverviewOutputControl>()); } } } else { selectedProducts.AddRange(tabPages); } if (!selectedProducts.Any()) { return; } var previewGroups = new List <PreviewGroup>(); FormProgress.SetTitle("Chill-Out for a few seconds...\nPreparing Preview..."); FormProgress.ShowProgress(); foreach (var productControl in selectedProducts) { var previewGroup = productControl.GetPreviewGroup(); if (productControl is PublicationBasicOverviewControl) { AdSchedulePowerPointHelper.Instance.PrepareBasicOverviewEmail(previewGroup.PresentationSourcePath, new[] { (PublicationBasicOverviewControl)productControl }); } else if (productControl is BasicOverviewSummaryControl) { var summaryControl = productControl as BasicOverviewSummaryControl; summaryControl.PopulateReplacementsList(); AdSchedulePowerPointHelper.Instance.PrepareBasicOverviewSummaryEmail(previewGroup.PresentationSourcePath, summaryControl); } previewGroups.Add(previewGroup); } Utilities.Instance.ActivateForm(Controller.Instance.FormMain.Handle, true, false); FormProgress.CloseProgress(); if (!(previewGroups.Any() && previewGroups.All(pg => File.Exists(pg.PresentationSourcePath)))) { return; } var trackAction = new Action(() => TrackOutput(selectedProducts.OfType <PublicationBasicOverviewControl>())); using (var formPreview = new FormPreview(Controller.Instance.FormMain, AdSchedulePowerPointHelper.Instance, BusinessObjects.Instance.HelpManager, Controller.Instance.ShowFloater, trackAction)) { formPreview.Text = "Preview Basic Overview"; formPreview.LoadGroups(previewGroups); RegistryHelper.MainFormHandle = formPreview.Handle; RegistryHelper.MaximizeMainForm = false; var previewResult = formPreview.ShowDialog(); RegistryHelper.MaximizeMainForm = Controller.Instance.FormMain.WindowState == FormWindowState.Maximized; RegistryHelper.MainFormHandle = Controller.Instance.FormMain.Handle; if (previewResult != DialogResult.OK) { Utilities.Instance.ActivateForm(Controller.Instance.FormMain.Handle, true, false); } } }
public void Fill(Database db, ConnectionInfo ci) { isLoading = true; trv.Nodes.Clear(); string time; var tc = new TimerCount(); file.Parameters.Tables.ForEach(p => p.IsSelected = false); file.Parameters.Views.ForEach(p => p.IsSelected = false); using (progress = new FormProgress()) { //f.StartProgress(1, count); progress.SetMessage("Loading objects"); progress.Show(this); progress.Update(); try { tc.Next("NodeDatabase"); nodeDb = new NodeDatabase(ci.Text); nodeDb.Fill(db); trv.Nodes.Add(nodeDb); trv.HandleMultiSelection = true; tc.Next("ExpandAllForce"); trv.ExpandAllForce(db); tc.Next("DataToView"); DataToView(); tc.Next("LoadGrid"); LoadGrid(db); tc.Next("nodeDb.Expand()"); nodeDb.Expand(); nodeDb.Checked = false; nodeDb.UncheckChildren(); nodeDb.Checked = false; time = tc.ToString(); } catch (Exception ex) { time = tc.ToString(); Program.ShowError(ex); } } //ControlUtil.ChangeFontOnlyParent(tabObjects, 12); isLoading = false; #if DEBUG2 if (db.ProviderType == EnumDbProviderType.Oracle) { Program.ShowInformation(time); } #endif }
public Form1() { InitializeComponent(); fpro = new FormProgress(); }
public void Init() { FormStateHelper.Init(this, Common.Core.Configuration.ResourceManager.Instance.AppSettingsFolder, MediaMetaData.Instance.DataTypeString, false) .LoadState(); Icon = BusinessObjects.Instance.ImageResourcesManager.MainAppIcon ?? Icon; buttonItemApplicationMenuNew.Image = BusinessObjects.Instance.ImageResourcesManager.MainMenuNewImage ?? buttonItemApplicationMenuNew.Image; buttonItemApplicationMenuOpen.Image = BusinessObjects.Instance.ImageResourcesManager.MainMenuOpenImage ?? buttonItemApplicationMenuOpen.Image; buttonItemApplicationMenuSave.Image = BusinessObjects.Instance.ImageResourcesManager.MainMenuSaveImage ?? buttonItemApplicationMenuSave.Image; buttonItemApplicationMenuSaveAs.Image = BusinessObjects.Instance.ImageResourcesManager.MainMenuSaveAsImage ?? buttonItemApplicationMenuSaveAs.Image; buttonItemApplicationMenuOutputPdf.Image = BusinessObjects.Instance.ImageResourcesManager.MainMenuOutputPdfImage ?? buttonItemApplicationMenuOutputPdf.Image; buttonItemApplicationMenuEmail.Image = BusinessObjects.Instance.ImageResourcesManager.MainMenuEmailImage ?? buttonItemApplicationMenuEmail.Image; buttonItemApplicationMenuSlideSettings.Image = BusinessObjects.Instance.ImageResourcesManager.MainMenuSlideSettingsImage ?? buttonItemApplicationMenuSlideSettings.Image; buttonItemApplicationMenuHelp.Image = BusinessObjects.Instance.ImageResourcesManager.MainMenuHelpImage ?? buttonItemApplicationMenuHelp.Image; buttonItemApplicationMenuExit.Image = BusinessObjects.Instance.ImageResourcesManager.MainMenuExitImage ?? buttonItemApplicationMenuExit.Image; buttonItemApplicationMenuMediaSettings.Visible = FileStorageManager.Instance.SubStorages.Count > 1; buttonItemQatSave.Image = BusinessObjects.Instance.ImageResourcesManager.QatSaveImage ?? buttonItemQatSave.Image; buttonItemQatSaveAs.Image = BusinessObjects.Instance.ImageResourcesManager.QatSaveAsImage ?? buttonItemQatSaveAs.Image; buttonItemQatFloater.Image = BusinessObjects.Instance.ImageResourcesManager.QatFloaterImage ?? buttonItemQatFloater.Image; buttonItemQatHelp.Image = BusinessObjects.Instance.ImageResourcesManager.QatHelpImage ?? buttonItemQatHelp.Image; if (BusinessObjects.Instance.ImageResourcesManager.HomeDateStartImage != null) { labelItemHomeFlightDatesStartTitle.Image = BusinessObjects.Instance.ImageResourcesManager.HomeDateStartImage; labelItemHomeFlightDatesStartTitle.Width += BusinessObjects.Instance.ImageResourcesManager.HomeDateStartImage.Width - 24; } if (BusinessObjects.Instance.ImageResourcesManager.HomeDateEndImage != null) { labelItemHomeFlightDatesEndTitle.Image = BusinessObjects.Instance.ImageResourcesManager.HomeDateEndImage; labelItemHomeFlightDatesEndTitle.Width += BusinessObjects.Instance.ImageResourcesManager.HomeDateEndImage.Width - 24; } ribbonBarHomeFlightDates.RecalcLayout(); buttonItemHomeSettings.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonSettingsImage ?? buttonItemHomeSettings.Image; ribbonBarHomeSettings.RecalcLayout(); ribbonPanelHome.PerformLayout(); if (BusinessObjects.Instance.ImageResourcesManager.ProgramScheduleRibbonLogo != null) { buttonItemProgramScheduleNew.Image = BusinessObjects.Instance.ImageResourcesManager.ProgramScheduleRibbonLogo; ribbonBarProgramScheduleNew.RecalcLayout(); } buttonItemProgramSchedulePowerPoint.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonOutputImage ?? buttonItemProgramSchedulePowerPoint.Image; ribbonBarProgramSchedulePowerPoint.RecalcLayout(); buttonItemProgramScheduleSettings.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonSettingsImage ?? buttonItemProgramScheduleSettings.Image; ribbonBarProgramScheduleSettings.RecalcLayout(); ribbonPanelProgramSchedule.PerformLayout(); if (BusinessObjects.Instance.ImageResourcesManager.SnapshotsRibbonLogo != null) { buttonItemSnapshotNew.Image = BusinessObjects.Instance.ImageResourcesManager.SnapshotsRibbonLogo; ribbonBarSnapshotNew.RecalcLayout(); } buttonItemSnapshotPowerPoint.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonOutputImage ?? buttonItemSnapshotPowerPoint.Image; ribbonBarSnapshotPowerPoint.RecalcLayout(); buttonItemSnapshotSettings.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonSettingsImage ?? buttonItemSnapshotSettings.Image; ribbonBarSnapshotSettings.RecalcLayout(); ribbonPanelSnapshot.PerformLayout(); if (BusinessObjects.Instance.ImageResourcesManager.OptionsRibbonLogo != null) { buttonItemOptionsNew.Image = BusinessObjects.Instance.ImageResourcesManager.OptionsRibbonLogo; ribbonBarOptionsNew.RecalcLayout(); } buttonItemOptionsPowerPoint.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonOutputImage ?? buttonItemOptionsPowerPoint.Image; ribbonBarOptionsPowerPoint.RecalcLayout(); buttonItemOptionsSettings.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonSettingsImage ?? buttonItemOptionsSettings.Image; ribbonBarOptionsSettings.RecalcLayout(); ribbonPanelOptions.PerformLayout(); if (BusinessObjects.Instance.ImageResourcesManager.DigitalProductsRibbonLogo != null) { buttonItemDigitalScheduleLogo.Image = BusinessObjects.Instance.ImageResourcesManager.DigitalProductsRibbonLogo; ribbonBarDigitalScheduleLogo.RecalcLayout(); } buttonItemDigitalSchedulePowerPoint.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonOutputImage ?? buttonItemDigitalSchedulePowerPoint.Image; ribbonBarDigitalSchedulePowerPoint.RecalcLayout(); ribbonPanelDigitalSchedule.PerformLayout(); buttonItemCalendar1DataSourceSchedule.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarDataSourceScheduleImage ?? buttonItemCalendar1DataSourceSchedule.Image; ribbonBarCalendar1DataSourceSchedule.RecalcLayout(); buttonItemCalendar1DataSourceSnapshots.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarDataSourceSnapshotsImage ?? buttonItemCalendar1DataSourceSnapshots.Image; ribbonBarCalendar1DataSourceSnapshots.RecalcLayout(); buttonItemCalendar1DataSourceEmpty.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarDataSourceEmptyImage ?? buttonItemCalendar1DataSourceEmpty.Image; ribbonBarCalendar1DataSourceEmpty.RecalcLayout(); buttonItemCalendar1Reset.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarResetImage ?? buttonItemCalendar1Reset.Image; ribbonBarCalendar1Reset.RecalcLayout(); buttonItemCalendar1Copy.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarDataCopyImage ?? buttonItemCalendar1Copy.Image; buttonItemCalendar1Paste.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarDataPasteImage ?? buttonItemCalendar1Paste.Image; buttonItemCalendar1Clone.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarDataCloneImage ?? buttonItemCalendar1Clone.Image; ribbonBarCalendar1Edit.RecalcLayout(); buttonItemCalendar1PowerPoint.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonOutputImage ?? buttonItemCalendar1PowerPoint.Image; ribbonBarCalendar1PowerPoint.RecalcLayout(); ribbonPanelCalendar1.PerformLayout(); buttonItemCalendar2Reset.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarResetImage ?? buttonItemCalendar2Reset.Image; ribbonBarCalendar2Reset.RecalcLayout(); buttonItemCalendar2Copy.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarDataCopyImage ?? buttonItemCalendar2Copy.Image; buttonItemCalendar2Paste.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarDataPasteImage ?? buttonItemCalendar2Paste.Image; buttonItemCalendar2Clone.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarDataCloneImage ?? buttonItemCalendar2Clone.Image; ribbonBarCalendar2Edit.RecalcLayout(); buttonItemCalendar2PowerPoint.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonOutputImage ?? buttonItemCalendar2PowerPoint.Image; ribbonBarCalendar2PowerPoint.RecalcLayout(); ribbonPanelCalendar2.PerformLayout(); buttonItemSolutionsPowerPoint.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonOutputImage ?? buttonItemSolutionsPowerPoint.Image; ribbonBarSolutionsPowerPoint.RecalcLayout(); ribbonPanelSolutions.PerformLayout(); buttonItemSlidesPowerPoint.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonOutputImage ?? buttonItemSlidesPowerPoint.Image; ribbonBarSlidesPowerPoint.RecalcLayout(); ribbonPanelSlides.PerformLayout(); if (BusinessObjects.Instance.FormStyleManager.Style.AccentColor.HasValue) { styleManager.MetroColorParameters = new MetroColorGeneratorParameters( styleManager.MetroColorParameters.CanvasColor, BusinessObjects.Instance.FormStyleManager.Style.AccentColor.Value); } if (BusinessObjects.Instance.ImageResourcesManager.ToggleSwitchSkinElement != null) { var element = SkinManager.GetSkinElement(SkinProductId.Editors, UserLookAndFeel.Default, "ToggleSwitch"); element.Image.SetImage(BusinessObjects.Instance.ImageResourcesManager.ToggleSwitchSkinElement, Color.Transparent); LookAndFeelHelper.ForceDefaultLookAndFeelChanged(); } Controller.Instance.FormMain = this; Controller.Instance.MainPanelContainer = layoutControlGroupContainer; Controller.Instance.MainPanel = layoutControlItemMainContainer; Controller.Instance.EmptyPanel = emptySpaceItem; Controller.Instance.SuperTip = superTooltip; Controller.Instance.Ribbon = ribbonControl; Controller.Instance.TabHome = ribbonTabItemHome; Controller.Instance.TabProgramSchedule = ribbonTabItemProgramSchedule; Controller.Instance.TabDigitalProduct = ribbonTabItemDigitalSchedule; Controller.Instance.TabCalendar1 = ribbonTabItemCalendar1; Controller.Instance.TabCalendar2 = ribbonTabItemCalendar2; Controller.Instance.TabGallery1 = ribbonTabItemGallery1; Controller.Instance.TabGallery2 = ribbonTabItemGallery2; Controller.Instance.TabRateCard = ribbonTabItemRateCard; Controller.Instance.TabOptions = ribbonTabItemOptions; Controller.Instance.TabSnapshot = ribbonTabItemSnapshot; Controller.Instance.TabSolutions = ribbonTabItemSolutions; Controller.Instance.TabSlides = ribbonTabItemSlides; ContentStatusBarManager.Instance.StatusBar = barBottom; ContentStatusBarManager.Instance.StatusBarMainItemsContainer = itemContainerStatusBarMainContentInfo; ContentStatusBarManager.Instance.StatusBarAdditionalItemsContainer = itemContainerStatusBarAdditionalContentInfo; ContentStatusBarManager.Instance.TextColor = BusinessObjects.Instance.FormStyleManager.Style.StatusBarTextColor; FormProgress.Init(this); #region Command Controls Controller.Instance.QatSaveButton = buttonItemQatSave; Controller.Instance.QatSaveAsButton = buttonItemQatSaveAs; Controller.Instance.QatHelpButton = buttonItemQatHelp; Controller.Instance.MenuButtonMain = applicationButtonApplicationMenu; Controller.Instance.MenuSaveButton = buttonItemApplicationMenuSave; Controller.Instance.MenuSaveAsButton = buttonItemApplicationMenuSaveAs; Controller.Instance.MenuOutputPdfButton = buttonItemApplicationMenuOutputPdf; Controller.Instance.MenuEmailButton = buttonItemApplicationMenuEmail; Controller.Instance.MenuSlideSettingsButton = buttonItemApplicationMenuSlideSettings; Controller.Instance.MenuHelpButton = buttonItemApplicationMenuHelp; Controller.Instance.RibbonCollapseButton = buttonItemCollapse; Controller.Instance.RibbonExpandButton = buttonItemExpand; Controller.Instance.RibbonPinButton = buttonItemPin; Controller.Instance.ScheduleInfoContainer = layoutControlGroupHeader; Controller.Instance.ScheduleInfoAdvertiser = simpleLabelItemAdvertiser; Controller.Instance.ScheduleInfoFlightDates = simpleLabelItemFlightDates; #region Home Controller.Instance.HomePanel = ribbonPanelHome; Controller.Instance.HomeSpecialButtons = ribbonBarHomeSpecialButtons; Controller.Instance.HomeBusinessName = comboBoxEditBusinessName; Controller.Instance.HomeDecisionMaker = comboBoxEditDecisionMaker; Controller.Instance.HomePresentationDate = dateEditPresentationDate; Controller.Instance.HomeFlightDates = ribbonBarHomeFlightDates; Controller.Instance.HomeFlightDatesStartTitle = labelItemHomeFlightDatesStartTitle; Controller.Instance.HomeFlightDatesStartValue = labelItemHomeFlightDatesStartValue; Controller.Instance.HomeFlightDatesEndTitle = labelItemHomeFlightDatesEndTitle; Controller.Instance.HomeFlightDatesEndValue = labelItemHomeFlightDatesEndValue; Controller.Instance.HomeSettings = buttonItemHomeSettings; #endregion #region Program Schedule Controller.Instance.ProgramSchedulePanel = ribbonPanelProgramSchedule; Controller.Instance.ProgramScheduleThemeBar = ribbonBarProgramScheduleTheme; Controller.Instance.ProgramScheduleSpecialButtons = ribbonBarProgramScheduleSpecialButtons; Controller.Instance.ProgramSchedulePowerPoint = buttonItemProgramSchedulePowerPoint; Controller.Instance.ProgramSchedulePowerPointCurrent = buttonItemProgramSchedulePowerPointCurrent; Controller.Instance.ProgramSchedulePowerPointAll = buttonItemProgramSchedulePowerPointAll; Controller.Instance.ProgramScheduleTheme = buttonItemProgramScheduleTheme; Controller.Instance.ProgramScheduleNew = buttonItemProgramScheduleNew; Controller.Instance.ProgramScheduleProgramAdd = buttonItemProgramScheduleProgramAdd; Controller.Instance.ProgramScheduleProgramDelete = buttonItemProgramScheduleProgramDelete; Controller.Instance.ProgramScheduleSettings = buttonItemProgramScheduleSettings; #endregion #region Digital Product Controller.Instance.DigitalProductPanel = ribbonPanelDigitalSchedule; Controller.Instance.DigitalProductLogoBar = ribbonBarDigitalScheduleLogo; Controller.Instance.DigitalProductThemeBar = ribbonBarDigitalScheduleTheme; Controller.Instance.DigitalProductSpecialButtons = ribbonBarDigitalScheduleSpecialButtons; Controller.Instance.DigitalProductPowerPoint = buttonItemDigitalSchedulePowerPoint; Controller.Instance.DigitalProductTheme = buttonItemDigitalScheduleTheme; Controller.Instance.DigitalProductAdd = buttonItemDigitalScheduleProductAdd; Controller.Instance.DigitalProductClone = buttonItemDigitalScheduleProductClone; Controller.Instance.DigitalProductDelete = buttonItemDigitalScheduleProductDelete; #endregion #region Calendar 1 Controller.Instance.Calendar1Panel = ribbonPanelCalendar1; Controller.Instance.Calendar1SpecialButtons = ribbonBarCalendar1SpecialButtons; Controller.Instance.Calendar1Copy = buttonItemCalendar1Copy; Controller.Instance.Calendar1Paste = buttonItemCalendar1Paste; Controller.Instance.Calendar1Clone = buttonItemCalendar1Clone; Controller.Instance.Calendar1PowerPoint = buttonItemCalendar1PowerPoint; Controller.Instance.Calendar1DataSourceSchedule = buttonItemCalendar1DataSourceSchedule; Controller.Instance.Calendar1DataSourceSnapshots = buttonItemCalendar1DataSourceSnapshots; Controller.Instance.Calendar1DataSourceEmpty = buttonItemCalendar1DataSourceEmpty; Controller.Instance.Calendar1Reset = buttonItemCalendar1Reset; #endregion #region Calendar 2 Controller.Instance.Calendar2Panel = ribbonPanelCalendar2; Controller.Instance.Calendar2SpecialButtons = ribbonBarCalendar2SpecialButtons; Controller.Instance.Calendar2Copy = buttonItemCalendar2Copy; Controller.Instance.Calendar2Paste = buttonItemCalendar2Paste; Controller.Instance.Calendar2Clone = buttonItemCalendar2Clone; Controller.Instance.Calendar2PowerPoint = buttonItemCalendar2PowerPoint; Controller.Instance.Calendar2Reset = buttonItemCalendar2Reset; #endregion #region Snapshot Controller.Instance.SnapshotPanel = ribbonPanelSnapshot; Controller.Instance.SnapshotThemeBar = ribbonBarSnapshotTheme; Controller.Instance.SnapshotSpecialButtons = ribbonBarSnapshotSpecialButtons; Controller.Instance.SnapshotPowerPoint = buttonItemSnapshotPowerPoint; Controller.Instance.SnapshotPowerPointCurrent = buttonItemSnapshotPowerPointCurrent; Controller.Instance.SnapshotPowerPointAll = buttonItemSnapshotPowerPointAll; Controller.Instance.SnapshotTheme = buttonItemSnapshotTheme; Controller.Instance.SnapshotNew = buttonItemSnapshotNew; Controller.Instance.SnapshotProgramAdd = buttonItemSnapshotProgramAdd; Controller.Instance.SnapshotProgramDelete = buttonItemSnapshotProgramDelete; Controller.Instance.SnapshotSettings = buttonItemSnapshotSettings; #endregion #region Options Controller.Instance.OptionsPanel = ribbonPanelOptions; Controller.Instance.OptionsThemeBar = ribbonBarOptionsTheme; Controller.Instance.OptionsSpecialButtons = ribbonBarOptionsSpecialButtons; Controller.Instance.OptionsPowerPoint = buttonItemOptionsPowerPoint; Controller.Instance.OptionsPowerPointCurrent = buttonItemOptionsPowerPointCurrent; Controller.Instance.OptionsPowerPointAll = buttonItemOptionsPowerPointAll; Controller.Instance.OptionsTheme = buttonItemOptionsTheme; Controller.Instance.OptionsNew = buttonItemOptionsNew; Controller.Instance.OptionsProgramAdd = buttonItemOptionsProgramAdd; Controller.Instance.OptionsProgramDelete = buttonItemOptionsProgramDelete; Controller.Instance.OptionsSettings = buttonItemOptionsSettings; #endregion #region Solutions Controller.Instance.SolutionsPanel = ribbonPanelSolutions; Controller.Instance.SolutionsThemeBar = ribbonBarSolutionsTheme; Controller.Instance.SolutionsSpecialButtons = ribbonBarSolutionsSpecialButtons; Controller.Instance.SolutionsPowerPoint = buttonItemSolutionsPowerPoint; Controller.Instance.SolutionsPowerPointCurrent = buttonItemSolutionsPowerPointCurrent; Controller.Instance.SolutionsPowerPointAll = buttonItemSolutionsPowerPointAll; Controller.Instance.SolutionsTheme = buttonItemSolutionsTheme; #endregion #region Slides Controller.Instance.SlidesPanel = ribbonPanelSlides; Controller.Instance.SlidesLogoBar = ribbonBarSlidesLogo; Controller.Instance.SlidesSpecialButtons = ribbonBarSlidesSpecialButtons; Controller.Instance.SlidesLogoLabel = labelItemSlideHome; Controller.Instance.SlidesPowerPoint = buttonItemSlidesPowerPoint; #endregion #region Gallery 1 Controller.Instance.Gallery1Panel = ribbonPanelGallery1; Controller.Instance.Gallery1SpecialButtons = ribbonBarGallery1SpecialButtons; Controller.Instance.Gallery1BrowseBar = ribbonBarGallery1Browse; Controller.Instance.Gallery1ImageBar = ribbonBarGallery1Image; Controller.Instance.Gallery1ZoomBar = ribbonBarGallery1Zoom; Controller.Instance.Gallery1CopyBar = ribbonBarGallery1Copy; Controller.Instance.Gallery1BrowseModeContainer = itemContainerGallery1BrowseContentType; Controller.Instance.Gallery1View = buttonItemGallery1View; Controller.Instance.Gallery1Edit = buttonItemGallery1Edit; Controller.Instance.Gallery1ImageSelect = buttonItemGallery1ImageSelect; Controller.Instance.Gallery1ImageCrop = buttonItemGallery1ImageCrop; Controller.Instance.Gallery1ZoomIn = buttonItemGallery1ZoomIn; Controller.Instance.Gallery1ZoomOut = buttonItemGallery1ZoomOut; Controller.Instance.Gallery1Copy = buttonItemGallery1Copy; Controller.Instance.Gallery1Sections = comboBoxEditGallery1Sections; Controller.Instance.Gallery1Groups = comboBoxEditGallery1Groups; #endregion #region Gallery 2 Controller.Instance.Gallery2Panel = ribbonPanelGallery2; Controller.Instance.Gallery2SpecialButtons = ribbonBarGallery2SpecialButtons; Controller.Instance.Gallery2BrowseBar = ribbonBarGallery2Browse; Controller.Instance.Gallery2ImageBar = ribbonBarGallery2Image; Controller.Instance.Gallery2ZoomBar = ribbonBarGallery2Zoom; Controller.Instance.Gallery2CopyBar = ribbonBarGallery2Copy; Controller.Instance.Gallery2BrowseModeContainer = itemContainerGallery2BrowseContentType; Controller.Instance.Gallery2View = buttonItemGallery2View; Controller.Instance.Gallery2Edit = buttonItemGallery2Edit; Controller.Instance.Gallery2ImageSelect = buttonItemGallery2ImageSelect; Controller.Instance.Gallery2ImageCrop = buttonItemGallery2ImageCrop; Controller.Instance.Gallery2ZoomIn = buttonItemGallery2ZoomIn; Controller.Instance.Gallery2ZoomOut = buttonItemGallery2ZoomOut; Controller.Instance.Gallery2Copy = buttonItemGallery2Copy; Controller.Instance.Gallery2Sections = comboBoxEditGallery2Sections; Controller.Instance.Gallery2Groups = comboBoxEditGallery2Groups; #endregion #region Rate Card Controller.Instance.RateCardPanel = ribbonPanelRateCard; Controller.Instance.RateCardSpecialButtons = ribbonBarRateCardSpecialButtons; Controller.Instance.RateCardCombo = comboBoxEditRateCards; #endregion #endregion ribbonControl.SelectedRibbonTabChanged += OnRibbonTabChanged; BusinessObjects.Instance.ScheduleManager.ScheduleOpened += (o, e) => UpdateFormTitle(); BusinessObjects.Instance.ScheduleManager.ScheduleNameChanged += (o, e) => UpdateFormTitle(); Controller.Instance.FloaterRequested += (o, e) => AppManager.Instance.ShowFloater(this, e); }
protected IList <OutputItem> GetOutputItems(bool onlyCurrentSlide) { var selectedOutputItems = new List <OutputItem>(); var availableOutputGroups = new List <OutputGroup>(); FormProgress.SetTitle("Chill-Out for a few seconds...\nLoading Slides..."); FormProgress.ShowProgress(MainForm); if (onlyCurrentSlide) { if (ActiveSlideContent != null) { availableOutputGroups.Add(ActiveSlideContent.GetOutputGroup()); } } else { var allSlides = _slides .OfType <IShiftTabPageContainer>() .ToList(); foreach (var tabPageContainer in allSlides.Where(slide => slide.ContentControl == null).ToList()) { tabPageContainer.LoadContent(); if (tabPageContainer.ContentControl is MultiTabControl multiTabControl) { multiTabControl.LoadAllTabPages(); Application.DoEvents(); } } var contentControls = allSlides .Select(container => container.ContentControl) .ToList(); foreach (var contentControl in contentControls) { var outputGroup = contentControl.GetOutputGroup(); if (outputGroup.Items.Any()) { availableOutputGroups.Add(outputGroup); } Application.DoEvents(); } } FormProgress.CloseProgress(); if (!availableOutputGroups.SelectMany(group => group.Items).Any()) { return(selectedOutputItems); } using (var form = new FormPreview( MainForm, PowerPointProcessor)) { form.LoadGroups(availableOutputGroups); if (form.ShowDialog() == DialogResult.OK) { selectedOutputItems.AddRange(form.GetSelectedItems()); } } return(selectedOutputItems); }
public static void PrintFile(string filePath, int currentPage = 0) { var printProcess = new Process(); if (FileFormatHelper.IsPowerPointFile(filePath)) { try { using (var powerPointProcessor = new PowerPointHidden()) { if (!powerPointProcessor.Connect(true)) { return; } powerPointProcessor.PrintPresentation( filePath, currentPage, printAction => FormProgress.ShowProgress("Printing...", () => { try { printAction(); } catch { } }, false)); } } catch { } } else if (FileFormatHelper.IsWordFile(filePath)) { try { printProcess.StartInfo.FileName = "winword.exe"; printProcess.StartInfo.Arguments = '"' + filePath + '"' + " /mFilePrint"; printProcess.Start(); } catch { } } else if (FileFormatHelper.IsExcelFile(filePath)) { if (ExcelHelper.Instance.Connect()) { ExcelHelper.Instance.Print(new FileInfo(filePath)); ExcelHelper.Instance.Disconnect(); } } else if (FileFormatHelper.IsPdfFile(filePath)) { try { printProcess.StartInfo.FileName = "AcroRd32.exe"; printProcess.StartInfo.Arguments = " /p " + '"' + filePath + '"'; printProcess.Start(); } catch { } } }