private void FormFullScreenPdf_Load(object sender, EventArgs e) { this.previewControl.Qualidade = FedoraHelper.TranslateQualityEnum(this.preSelectedQuality); lstView.Focus(); if (lstView.Items.Count > 0) { lstView.selectItem(lstView.Items[0]); } }
public void Clear(bool preserveQualitySelected) { this.webBrowser.Navigate(""); this.objectoActual = null; this.isDocumentLoaded = false; this.cmbQuality.Enabled = false; if (!preserveQualitySelected) { this.cmbQuality.SelectedItem = FedoraHelper.TranslateQualityEnum(defaultQuality); } errorLabel.Text = ""; errorLabel.Visible = true; lblFicheiro.Text = ""; this.Cursor = Cursors.Default; }
public void ShowPDF(string pid) { this.cmbQuality.Enabled = true; this.Cursor = Cursors.WaitCursor; this.objectoActual = pid; var qualidade = FedoraHelper.TranslateQualityEnum(cmbQuality.SelectedItem as string); bool success; string errorMessage; string fileName = SessionHelper.AppConfiguration.GetCurrentAppconfiguration().FedoraHelperSingleton.GetDisseminatorByUrl(pid, qualidade, out success, out errorMessage); if (success) { errorLabel.Visible = false; Uri fileUri; if (Uri.TryCreate(@fileName, UriKind.RelativeOrAbsolute, out fileUri)) { webBrowser.Navigate(fileUri); } else { Clear(); } } else { ShowError(errorMessage); } // obter o nome (do ficheiro) da primeira imagem do objeto digital var od = SessionHelper.AppConfiguration.GetCurrentAppconfiguration().FedoraHelperSingleton.LoadID(pid, null) as ObjDigSimples; if (od != null) { lblFicheiro.Text = od.fich_associados.First().url.Split('/').Last(); } else { lblFicheiro.Text = "n/d"; } this.Cursor = Cursors.Default; }
public frmObjetoDigitalSimples() { InitializeComponent(); ficheirosOrderManager1.OrderManagerSelectedIndexChangedEvent += new EventHandler <BeforeNewSelectionEventArgs>(OrderManagerSelectedIndexChangedEvent); ficheirosOrderManager1.FullScreenInvoked += new EventHandler <EventArgs>(FicheirosOrderManager1_FullScreenInvoked); ficheirosOrderManager1.AttachedFileAdded += new EventHandler <EventArgs>(FicheirosOrderManager1_AttachedFileAdded); ficheirosOrderManager1.AttachedFileDeleted += new EventHandler <EventArgs>(FicheirosOrderManager1_AttachedFileDeleted); versionControl.Enabled = false; ButtonTI.Image = SharedResourcesOld.CurrentSharedResources.ChamarPicker; CurrentToolTip.SetToolTip(ButtonTI, "Adicionar título predefinido"); var configRow = GisaDataSetHelper.GetInstance().GlobalConfig.Cast <GISADataset.GlobalConfigRow>().Single(); var defaultQuality = configRow.IsQualidadeImagemNull() ? Quality.Low : FedoraHelper.TranslateQualityEnum(configRow.QualidadeImagem); this.previewControl.SetupOtherMode(); }
public ControlObjetoDigital() { InitializeComponent(); DocumentoSimplesOrderManager1.OrderManagerSelectedIndexChangedEvent += new EventHandler <BeforeNewSelectionEventArgs>(OrderManagerSelectedIndexChangedEvent); DocumentoSimplesOrderManager1.FullScreenInvoked += new EventHandler <EventArgs>(DocumentoSimplesOrderManager1_FullScreenInvoked); DocumentoSimplesOrderManager1.NewInvoked += new EventHandler <EventArgs>(DocumentoSimplesOrderManager1_NewInvoked); DocumentoSimplesOrderManager1.EditInvoked += new EventHandler <EventArgs>(DocumentoSimplesOrderManager1_EditInvoked); DocumentoSimplesOrderManager1.RemoveInvoked += new EventHandler <EventArgs>(DocumentoSimplesOrderManager1_RemoveInvoked); FicheirosOrderManager1.OrderManagerSelectedIndexChangedEvent += new EventHandler <BeforeNewSelectionEventArgs>(OrderManagerSelectedIndexChangedEvent); FicheirosOrderManager1.FullScreenInvoked += new EventHandler <EventArgs>(FicheirosOrderManager1_FullScreenInvoked); FicheirosOrderManager1.AttachedFileAdded += new EventHandler <EventArgs>(FicheirosOrderManager1_AttachedFileAdded); FicheirosOrderManager1.AttachedFileDeleted += new EventHandler <EventArgs>(FicheirosOrderManager1_AttachedFileDeleted); var configRow = GisaDataSetHelper.GetInstance().GlobalConfig.Cast <GISADataset.GlobalConfigRow>().Single(); var defaultQuality = configRow.IsQualidadeImagemNull() ? Quality.Low : FedoraHelper.TranslateQualityEnum(configRow.QualidadeImagem); this.previewControl.SetupOtherMode(); }
private void btnFullScreen_Click(object sender, EventArgs e) { // Clonar a lista de nós a apresentar em modo full screen List <ListViewItem> clonedItemList = new List <ListViewItem>(); var nodesList = trvODsFedora.Nodes.Count > 1 ? trvODsFedora.Nodes : trvODsFedora.Nodes[0].Nodes; if (trvODsFedora.Nodes.Count == 1 && nodesList.Count == 0) { var item = new ListViewItem(trvODsFedora.Nodes[0].Text) { Tag = new ObjDigSimples() { pid = ((GISADataset.ObjetoDigitalRow)trvODsFedora.Nodes[0].Tag).pid } }; FormFullScreenPdf ecraCompleto = new FormFullScreenPdf(new List <ListViewItem>() { item }, 0, FedoraHelper.TranslateQualityEnum(controlFedoraPdfViewer1.Qualidade)); ecraCompleto.ShowDialog(); } else { clonedItemList.AddRange(nodesList.Cast <TreeNode>().Select(node => new ListViewItem(node.Text) { Tag = new ObjDigSimples() { pid = ((GISADataset.ObjetoDigitalRow)node.Tag).pid } })); var selectedItemIndex = trvODsFedora.SelectedNode != null ? trvODsFedora.SelectedNode.Index : -1; // Instanciar uma janela modal para mostrar a lista clonada (passamos o identificador do objecto pai, caso exista) FormFullScreenPdf ecraCompleto = new FormFullScreenPdf(clonedItemList, selectedItemIndex, FedoraHelper.TranslateQualityEnum(controlFedoraPdfViewer1.Qualidade)); ecraCompleto.ShowDialog(); } }
public ControlFedoraPdfViewer() { InitializeComponent(); //GISADataset.GlobalConfigRow configRow = null; //var defaultQuality = Quality.Low; var configRow = GisaDataSetHelper.GetInstance().GlobalConfig.Cast <GISADataset.GlobalConfigRow>().Single(); defaultQuality = configRow.IsQualidadeImagemNull() ? Quality.Low : FedoraHelper.TranslateQualityEnum(configRow.QualidadeImagem); foreach (Quality quality in Enum.GetValues(typeof(Quality))) { var qualityString = FedoraHelper.TranslateQualityEnum(quality); cmbQuality.Items.Add(qualityString); if (quality == defaultQuality) { cmbQuality.SelectedItem = qualityString; } } objectoActual = null; isDocumentLoaded = false; }
private void ShellOpenImg() { if (this.pictImagem == null) { return; } this.Cursor = Cursors.WaitCursor; try { string sUrl = null; System.Diagnostics.Process p = new System.Diagnostics.Process(); switch (TipoAcessoRecurso) { case ResourceAccessType.Web: if (((GISADataset.GlobalConfigRow)(GisaDataSetHelper.GetInstance().GlobalConfig.Select()[0])).URLBaseActivo) { sUrl = string.Format(((GISADataset.GlobalConfigRow)(GisaDataSetHelper.GetInstance().GlobalConfig.Select()[0])).URLBase.Replace("<id>", "{0}"), SourceLocation); } else { sUrl = SourceLocation; } break; case ResourceAccessType.Smb: sUrl = SourceLocation; break; case ResourceAccessType.Fedora: var configRow = GisaDataSetHelper.GetInstance().GlobalConfig.Cast <GISADataset.GlobalConfigRow>().Single(); var qualidade = configRow.IsQualidadeImagemNull() ? Quality.Low : FedoraHelper.TranslateQualityEnum(configRow.QualidadeImagem); bool success; string errorMessage; sUrl = SessionHelper.AppConfiguration.GetCurrentAppconfiguration().FedoraHelperSingleton.GetDisseminatorByUrl(SourceLocation, qualidade, out success, out errorMessage); if (String.IsNullOrEmpty(sUrl) || !File.Exists(sUrl) || !success) { sUrl = null; } if (!success) { MessageBox.Show(errorMessage, "Repositório Digital", MessageBoxButtons.OK, MessageBoxIcon.Warning); } break; case ResourceAccessType.DICAnexo: sUrl = DocInPortoHelper.getDocInPortoAnexo(SourceLocation, OtherLocationParams); // break; case ResourceAccessType.DICConteudo: sUrl = DocInPortoHelper.getDocInPortoConteudo(SourceLocation); break; } if (sUrl != null && sUrl.Length > 0) { p = System.Diagnostics.Process.Start(sUrl); } } catch (Win32Exception ex) { Trace.WriteLine(ex.ToString()); if (ex.NativeErrorCode == 2) { //ERROR FILE NOT FOUND MessageBox.Show("O caminho especificado não é válido.", "Imagem", MessageBoxButtons.OK, MessageBoxIcon.Error); } } this.Cursor = Cursors.Default; }
public void ShowFullScreenMode(List <ListViewItem> itemsToDisplay, int selectedItemIndex) { // Clonar a lista de nós a apresentar em modo full screen List <ListViewItem> clonedItemList = new List <ListViewItem>(); FormFullScreenPdf ecraCompleto = null; if (mViewMode == ObjetoDigitalFedoraHelper.Contexto.imagens) { clonedItemList.AddRange(itemsToDisplay.Select(item => item.Clone() as ListViewItem)); // Instanciar uma janela modal para mostrar a lista clonada (passamos o identificador do objeto pai, caso exista) ecraCompleto = new FormFullScreenPdf(clonedItemList, selectedItemIndex, FedoraHelper.TranslateQualityEnum(previewControl.Qualidade)); } else { clonedItemList.AddRange(itemsToDisplay .Where(item => item.Tag.GetType() == typeof(ObjDigSimples) && FedoraHelper.HasObjDigReadPermission(((ObjDigSimples)item.Tag).pid)) .Select(item => new ListViewItem(item.SubItems[DocumentoSimplesOrderManager1.colDesignacaoOD.Index].Text) { Tag = item.Tag })); int newSelectedItemIndex = -1; if (selectedItemIndex >= 0) { var od = itemsToDisplay[selectedItemIndex].Tag as ObjDigSimples; newSelectedItemIndex = od == null ? -1 : clonedItemList.FindIndex(item => ((ObjDigSimples)item.Tag).pid.Equals(od.pid)); } // Instanciar uma janela modal para mostrar a lista clonada (passamos o identificador do objeto pai, caso exista) ecraCompleto = new FormFullScreenPdf(clonedItemList, newSelectedItemIndex, FedoraHelper.TranslateQualityEnum(previewControl.Qualidade)); } ecraCompleto.ShowDialog(); }
public void ShowFullScreenMode(List <ListViewItem> itemsToDisplay, int selectedItemIndex) { // Clonar a lista de nós a apresentar em modo full screen List <ListViewItem> clonedItemList = new List <ListViewItem>(); clonedItemList.AddRange(itemsToDisplay.Select(item => item.Clone() as ListViewItem)); // Instanciar uma janela modal para mostrar a lista clonada (passamos o identificador do objecto pai, caso exista) FormFullScreenPdf ecraCompleto = new FormFullScreenPdf(clonedItemList, selectedItemIndex, FedoraHelper.TranslateQualityEnum(previewControl.Qualidade)); ecraCompleto.ShowDialog(); }