Fixed ItemSelected so that Comment works properly.
Added code back in so that Word displays properly. Allow the same document to be opened after Word hang
This commit is contained in:
@@ -112,15 +112,43 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
private bool _Created = false;
|
||||
private int _Unique = 0;
|
||||
private string Unique
|
||||
{
|
||||
get
|
||||
{
|
||||
string retval = "";
|
||||
if (_Unique != 0) retval = "_" + _Unique.ToString();
|
||||
_Unique++;
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
private void CreateFile()
|
||||
{
|
||||
if (_MyDocument == null) return;
|
||||
_MyFile = new FileInfo(string.Format(@"{0}\tmp_{1}." + Extension , TemporaryFolder, MyDocument.DocID));
|
||||
FileStream fs = _MyFile.Create();
|
||||
fs.Write(MyDocument.DocContent, 0, MyDocument.DocContent.Length);
|
||||
fs.Close();
|
||||
_MyFile.CreationTime = _MyDocument.DTS;
|
||||
_MyFile.LastWriteTime = _MyDocument.DTS;
|
||||
while (!_Created)
|
||||
CreateTemporaryFile();
|
||||
}
|
||||
|
||||
private void CreateTemporaryFile()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_MyDocument != null)
|
||||
{
|
||||
_MyFile = new FileInfo(string.Format(@"{0}\tmp_{1}{2}.{3}", TemporaryFolder, MyDocument.DocID, Unique, Extension));
|
||||
FileStream fs = _MyFile.Create();
|
||||
fs.Write(MyDocument.DocContent, 0, MyDocument.DocContent.Length);
|
||||
fs.Close();
|
||||
_MyFile.CreationTime = _MyDocument.DTS;
|
||||
_MyFile.LastWriteTime = _MyDocument.DTS;
|
||||
_Created = true;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
public void SaveFile()
|
||||
{
|
||||
|
Reference in New Issue
Block a user