Beispiel #1
0
 private void loadContents()
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         this.toolStripButtonSee.Enabled       = false;
         this.toolStripButtonAuthorize.Enabled = false;
         this.toolStripButtonReject.Enabled    = false;
         this.listViewFlows.Items.Clear();
         if (this.comboBoxSites.SelectedItem is WebSiteInfo)
         {
             WebSiteInfo site = (WebSiteInfo)this.comboBoxSites.SelectedItem;
             if (this.radioButtonAll.Checked)
             {
                 foreach (FlowContentInformation info in OfficeApplication.OfficeApplicationProxy.getAllContents(site))
                 {
                     FlowItem item = new FlowItem(info);
                     this.listViewFlows.Items.Add(item);
                 }
             }
             else if (this.radioButtonMyDocuments.Checked)
             {
                 foreach (FlowContentInformation info in OfficeApplication.OfficeApplicationProxy.getMyContents(site))
                 {
                     FlowItem item = new FlowItem(info);
                     this.listViewFlows.Items.Add(item);
                 }
             }
             else
             {
                 foreach (FlowContentInformation info in OfficeApplication.OfficeApplicationProxy.getContentsForAuthorize(site))
                 {
                     FlowItem item = new FlowItem(info);
                     this.listViewFlows.Items.Add(item);
                 }
             }
         }
     }
     catch (Exception e)
     {
         OfficeApplication.WriteError(e);
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Beispiel #2
0
 private void toolStripButtonSee_Click(object sender, EventArgs e)
 {
     if (this.listViewFlows.SelectedItems.Count > 0)
     {
         FlowItem     item         = (FlowItem)this.listViewFlows.SelectedItems[0];
         ResourceInfo resourceinfo = item.FlowContentInformation.resourceInfo;
         String       version      = resourceinfo.version;
         if (version.Equals("*"))
         {
             version = resourceinfo.lastversion;
         }
         String name = null;
         try
         {
             name = OfficeApplication.OfficeDocumentProxy.createPreview(resourceinfo.repository, resourceinfo.contentid, version, resourceinfo.type);
             String urlproxy = OfficeApplication.OfficeDocumentProxy.WebAddress.ToString();
             if (!urlproxy.EndsWith("/gtw"))
             {
                 if (!urlproxy.EndsWith("/"))
                 {
                     urlproxy += "/";
                 }
                 if (!urlproxy.EndsWith("gtw"))
                 {
                     urlproxy += "gtw";
                 }
             }
             Uri         url         = new Uri(urlproxy + "?contentId=" + resourceinfo.contentid + "&versionName=" + version + "&repositoryName=" + resourceinfo.repository + "&name=" + name + "&type=" + resourceinfo.type);
             String      title       = OfficeApplication.OfficeDocumentProxy.getTitle(resourceinfo.repository, resourceinfo.contentid);
             FormPreview formPreview = new FormPreview(url, false, title);
             formPreview.ShowDialog(this);
         }
         finally
         {
             if (name != null)
             {
                 OfficeApplication.OfficeDocumentProxy.deletePreview(name);
             }
         }
     }
 }