This commit is contained in:
@@ -5,6 +5,7 @@ using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace Volian.Controls.Library
|
||||
@@ -25,6 +26,22 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
private DocVersionInfo _MyDVI;
|
||||
public DocVersionInfo MyDVI
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_MyDVI != null) return _MyDVI;
|
||||
if (_MyStepItem != null)
|
||||
{
|
||||
ItemInfo procInfo = _MyStepItem.MyItemInfo.MyProcedure as ItemInfo;
|
||||
if (procInfo == null) return null;
|
||||
_MyDVI = procInfo.ActiveParent as DocVersionInfo;
|
||||
return _MyDVI;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
private ItemInfo MyItemInfo
|
||||
{ get { return _MyStepRTB.MyItemInfo; } }
|
||||
|
||||
@@ -82,7 +99,6 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void BuildSymbolGallery(SymbolList sl, DevComponents.DotNetBar.GalleryContainer gc)
|
||||
{
|
||||
foreach (Symbol sym in sl)
|
||||
@@ -299,6 +315,8 @@ namespace Volian.Controls.Library
|
||||
btnInsPgBrk.Checked = cfg == null ? false : cfg.Step_ManualPagebreak;
|
||||
}
|
||||
btnInsPgBrk.Enabled = MyItemInfo.IsHigh;
|
||||
btnEditMode.Checked = btnCMEditMode1.Checked = MyStepItem.MyStepPanel.PanelViewEditMode != E_ViewMode.View;
|
||||
|
||||
|
||||
// if on procedure or section 'change type' & 'insert' buttons should be disabled.
|
||||
if (MyItemInfo.IsProcedure || MyItemInfo.IsSection)
|
||||
@@ -553,12 +571,16 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
else
|
||||
{
|
||||
_MyStepItem.MyStepPanel.OnLinkClicked(sender, new StepPanelLinkEventArgs(_MyStepItem, _MyStepRTB.MyLinkText));
|
||||
// for now bring up ro window. Later bring up ro editor!
|
||||
string roapp = Environment.GetEnvironmentVariable("roapp");
|
||||
LinkText lt = new LinkText(_MyStepRTB.MyLinkText);
|
||||
string roloc = lt.MyRoUsageInfo.MyRODb.FolderPath;
|
||||
System.Diagnostics.Process.Start(roapp, roloc + " " + lt.MyRoUsageInfo.ROID);
|
||||
}
|
||||
}
|
||||
private void btnChgTyp_Click(object sender, EventArgs e)
|
||||
{
|
||||
StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("Change Step Type");
|
||||
MyStepItem.MyStepPanel.OnTabDisplay(sender, args);
|
||||
}
|
||||
#endregion
|
||||
#region RHM debug
|
||||
@@ -609,6 +631,99 @@ namespace Volian.Controls.Library
|
||||
MyStepRTB.ToggleEditView();
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void btnROEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
string roapp = Environment.GetEnvironmentVariable("roapp");
|
||||
if (roapp == null)
|
||||
{
|
||||
MessageBox.Show("Could not find path to Ro Editor, check 'roapp' environment variable");
|
||||
return;
|
||||
}
|
||||
if (MyDVI==null||MyDVI.DocVersionAssociationCount < 1)
|
||||
{
|
||||
MessageBox.Show("Could not find associated path for ro data.");
|
||||
return;
|
||||
}
|
||||
string roloc = MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath;
|
||||
System.Diagnostics.Process.Start(roapp, roloc);
|
||||
}
|
||||
|
||||
private void btnUpdROVal_Click(object sender, EventArgs e)
|
||||
{
|
||||
// use rodb directory path of the first rofst for the this document version. Later, will need
|
||||
// to modify code to get which one (when there is more than one)
|
||||
if (MyDVI.DocVersionAssociations.Count < 1)
|
||||
{
|
||||
MessageBox.Show("Error Updating ro.fst. No associated ro.fst");
|
||||
return;
|
||||
}
|
||||
ROFstInfo roFstInfo = MyDVI.DocVersionAssociations[0].MyROFst;
|
||||
|
||||
string rofstPath = roFstInfo.MyRODb.FolderPath + @"\ro.fst";
|
||||
if (!File.Exists(rofstPath))
|
||||
{
|
||||
MessageBox.Show("No existing ro.fst in path " + roFstInfo.MyRODb.FolderPath + ". Check for invalid path");
|
||||
return;
|
||||
}
|
||||
FileInfo fiRofst = new FileInfo(rofstPath);
|
||||
if (roFstInfo.DTS == fiRofst.LastWriteTime)
|
||||
{
|
||||
MessageBox.Show("ro.fst files are same for path " + roFstInfo.MyRODb.FolderPath + ", import of that ro.fst will not be done");
|
||||
return;
|
||||
}
|
||||
if (roFstInfo.DTS > fiRofst.LastWriteTime)
|
||||
{
|
||||
MessageBox.Show("Cannot copy older ro.fst from " + roFstInfo.MyRODb.FolderPath + ", import of that ro.fst will not be done");
|
||||
return;
|
||||
}
|
||||
Cursor = Cursors.WaitCursor;
|
||||
|
||||
using (DocVersion dv = DocVersion.Get(MyDVI.VersionID))
|
||||
{
|
||||
ROFst newrofst = ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv.DocVersionAssociations[0], dv, roFstInfo);
|
||||
}
|
||||
Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
private void rtabAdmin_Click(object sender, EventArgs e)
|
||||
{
|
||||
btnUpdROVal.Enabled = false;
|
||||
if (MyDVI.DocVersionAssociations.Count < 1) return;
|
||||
ROFstInfo roFstInfo = MyDVI.DocVersionAssociations[0].MyROFst;
|
||||
RODbInfo rdi = RODbInfo.Get(roFstInfo.RODbID);
|
||||
|
||||
string rofstPath = rdi.FolderPath + @"\ro.fst";
|
||||
if (!File.Exists(rofstPath)) return;
|
||||
FileInfo fiRofst = new FileInfo(rofstPath);
|
||||
if (roFstInfo.DTS == fiRofst.LastWriteTime) return;
|
||||
if (roFstInfo.DTS > fiRofst.LastWriteTime) return;
|
||||
btnUpdROVal.Enabled = true;
|
||||
}
|
||||
|
||||
private void btnBookmarks_Click(object sender, EventArgs e)
|
||||
{
|
||||
StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("Bookmarks");
|
||||
MyStepItem.MyStepPanel.OnTabDisplay(sender, args);
|
||||
}
|
||||
|
||||
private void btnSearch_Click(object sender, EventArgs e)
|
||||
{
|
||||
StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("Global Search");
|
||||
MyStepItem.MyStepPanel.OnTabDisplay(sender, args);
|
||||
}
|
||||
|
||||
private void btnLibDocs_Click(object sender, EventArgs e)
|
||||
{
|
||||
StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("LibDocs");
|
||||
MyStepItem.MyStepPanel.OnTabDisplay(sender, args);
|
||||
}
|
||||
|
||||
private void btnAnnots_Click(object sender, EventArgs e)
|
||||
{
|
||||
StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("Annots");
|
||||
MyStepItem.MyStepPanel.OnTabDisplay(sender, args);
|
||||
}
|
||||
}
|
||||
public enum E_FieldToEdit { StepText, Text, Number };
|
||||
}
|
||||
|
Reference in New Issue
Block a user