Index: Excel/ExcelLibraryTesting/ExcelLibraryTesting.csproj
===================================================================
--- Excel/ExcelLibraryTesting/ExcelLibraryTesting.csproj (revision 3367)
+++ Excel/ExcelLibraryTesting/ExcelLibraryTesting.csproj (working copy)
@@ -59,6 +59,14 @@
primaryFalse
+
+ {0002E157-0000-0000-C000-000000000046}
+ 5
+ 3
+ 0
+ primary
+ False
+
Index: Excel/ExcelLibrary/AddIn/ExcelAddInHelper.cs
===================================================================
--- Excel/ExcelLibrary/AddIn/ExcelAddInHelper.cs (revision 3367)
+++ Excel/ExcelLibrary/AddIn/ExcelAddInHelper.cs (working copy)
@@ -202,7 +202,7 @@
{
- D o c u m e n t E x c e l M S d o c = n e w D o c u m e n t E x c e l M S ( w o r k b o o k ) ;
+ D o c u m e n t O f f i c e M S d o c = n e w D o c u m e n t E x c e l M S ( w o r k b o o k ) ;
i f ( ! I s U s e r D o c ( d o c ) )
@@ -214,7 +214,7 @@
L o g A d d I n . L o g g e r . T r a c e ( " w o r k b o o k : [ " + d o c . F u l l N a m e + " ] o p e n e d " ) ;
- O n D o c u m e n t O p e n ( d o c ) ;
+ O n D o c u m e n t O p e n ( r e f d o c ) ;
}
@@ -244,16 +244,12 @@
m _ A u t o C r e a t e d W i n d o w s . C l e a r ( ) ;
- u s i n g ( D o c u m e n t E x c e l M S d o c E x c e l = n e w D o c u m e n t E x c e l M S ( w o r k b o o k ) )
+ D o c u m e n t O f f i c e M S d o c E x c e l = n e w D o c u m e n t E x c e l M S ( w o r k b o o k ) ;
- {
+ L o g A d d I n . L o g g e r . T r a c e ( " w o r k b o o k c l o s i n g : [ " + d o c E x c e l . F u l l N a m e + " ] " ) ;
- L o g A d d I n . L o g g e r . T r a c e ( " w o r k b o o k c l o s i n g : [ " + d o c E x c e l . F u l l N a m e + " ] " ) ;
+ b a s e . O n D o c u m e n t B e f o r e C l o s e ( r e f d o c E x c e l , r e f c a n c e l ) ;
- b a s e . O n D o c u m e n t B e f o r e C l o s e ( d o c E x c e l , r e f c a n c e l ) ;
-
- }
-
}
c a t c h ( E x c e p t i o n e )
@@ -280,11 +276,11 @@
{
- D o c u m e n t E x c e l M S d o c E x c e l = n e w D o c u m e n t E x c e l M S ( w o r k b o o k ) ;
+ D o c u m e n t O f f i c e M S d o c E x c e l = n e w D o c u m e n t E x c e l M S ( w o r k b o o k ) ;
L o g A d d I n . L o g g e r . T r a c e ( " B e f o r e S a v e , w o r k b o o k : [ " + d o c E x c e l . F u l l N a m e + " ] " ) ;
- b a s e . O n D o c u m e n t B e f o r e S a v e ( d o c E x c e l , s a v e A s U I , r e f c a n c e l ) ;
+ b a s e . O n D o c u m e n t B e f o r e S a v e ( r e f d o c E x c e l , s a v e A s U I , r e f c a n c e l ) ;
}
@@ -450,7 +446,7 @@
{
- D o c u m e n t E x c e l M S d o c E x c e l = ( D o c u m e n t E x c e l M S ) m _ a p p . G e t A c t i v e D o c u m e n t ( ) ;
+ D o c u m e n t O f f i c e M S d o c E x c e l = ( D o c u m e n t E x c e l M S ) m _ a p p . G e t A c t i v e D o c u m e n t ( ) ;
i f ( U s e r 3 2 . W A _ A C T I V E ! = c w p . w P a r a m . T o I n t 3 2 ( ) | | d o c E x c e l . G e t W i n d o w ( ) . H a n d l e . T o S t r i n g ( ) ! = c w p . h w n d . T o S t r i n g ( ) )
@@ -474,7 +470,7 @@
i t e m . S e c o n d V a l u e = t r u e ;
- b a s e . S e n d E d i t E v e n t ( d o c E x c e l , t r u e , E v e n t T y p e . O p e n ) ;
+ b a s e . S e n d E d i t E v e n t ( r e f d o c E x c e l , t r u e , E v e n t T y p e . O p e n ) ;
r e t u r n ;
Index: Excel/ExcelLibrary/Wrappers/DocumentExcelMS.cs
===================================================================
--- Excel/ExcelLibrary/Wrappers/DocumentExcelMS.cs (revision 3367)
+++ Excel/ExcelLibrary/Wrappers/DocumentExcelMS.cs (working copy)
@@ -390,6 +390,13 @@
return AgentUtils.Windowing.Win32Window.GetWindow(applicationWindow);
}
+ public override void SaveAs(string path)
+ {
+ DocAsExcelWorkbook.SaveAs(path,
+ m_MissingValue, m_MissingValue, m_MissingValue, m_MissingValue, m_MissingValue,
+ Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlNoChange, m_MissingValue, m_MissingValue, m_MissingValue, m_MissingValue, m_MissingValue);
+ }
+
///
/// extract iprofs from document
///
Index: Excel/ExcelLibrary/Wrappers/ApplicationExcelMS.cs
===================================================================
--- Excel/ExcelLibrary/Wrappers/ApplicationExcelMS.cs (revision 3367)
+++ Excel/ExcelLibrary/Wrappers/ApplicationExcelMS.cs (working copy)
@@ -121,6 +121,7 @@
}
}
+ //roeeimpl - XXX - here and in word - open without adding to recent docuemnts
public override Document OpenDocument(string path, bool readOnly, bool visible)
{
if (!visible)
Index: Excel/ExcelLibrary/ExcelLibrary.csproj
===================================================================
--- Excel/ExcelLibrary/ExcelLibrary.csproj (revision 3367)
+++ Excel/ExcelLibrary/ExcelLibrary.csproj (working copy)
@@ -38,6 +38,7 @@
+
@@ -67,6 +68,14 @@
primaryFalse
+
+ {0002E157-0000-0000-C000-000000000046}
+ 5
+ 3
+ 0
+ primary
+ False
+
@@ -85,6 +94,10 @@
{98828D1C-7708-4C17-98BA-1AC2E890BF5B}EventsHandling
+
+ {0E57A903-3064-43F4-9FF0-59618E59B3C5}
+ SI.RMS.Task
+ {BCDFD4B0-7535-4C6B-B5F6-A01E00F79631}ClipboardHelper
Index: Excel/ExcelLibrary/EH/EHOfficeDocEditExcel.cs
===================================================================
--- Excel/ExcelLibrary/EH/EHOfficeDocEditExcel.cs (revision 0)
+++ Excel/ExcelLibrary/EH/EHOfficeDocEditExcel.cs (revision 3534)
@@ -0,0 +1,82 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using AgentUtils;
+using ExcelLibrary.Wrappers;
+using ApplicationControl;
+using OfficeLibrary.Events;
+
+namespace ExcelLibrary.EH
+{
+ public class EHOfficeDocEditExcel : OfficeLibrary.EH.EHOfficeDocEdit, CommonUtils.IFactoryObject
+ {
+ #region Constructors
+
+ public EHOfficeDocEditExcel()
+ : base()
+ {
+ }
+
+ public EHOfficeDocEditExcel(SIEventOfficeDocEdit ev)
+ : base(ev)
+ {
+ }
+
+ #endregion
+
+ protected override void ApplyRMSAsSI(string sRMSPolic)
+ {
+ string path = Doc.Path;
+ string name = Doc.Name;
+ //Re-open as read-only, this will release the lock...
+ bool eventsOnDoc = m_Event.AddInApi.SetIsDocEventsDisabled(name, true);
+ try
+ {
+ Doc = (DocumentExcelMS)Doc.Application.OpenDocument(new DataItemFile(path), ApplicationControl.AbstractTypes.AccessMode.View);
+ try
+ {
+ using (SITmpFile tmpCopy = new SITmpFile())
+ {
+ tmpCopy.CreateUniqueName(Doc.Name);
+ Doc.SaveAs(tmpCopy.FileName);
+ using (DocumentExcelSI siDoc = new DocumentExcelSI(
+ new DataItemFile(path),
+ ApplicationControl.AbstractTypes.AccessMode.Edit))
+ {
+ siDoc.ApplyRMS(sRMSPolic, SI.RMS.Task.LicenseUtils.GetMasterLicenses());
+ }
+ }
+ }
+ finally
+ {
+ //XXX roeeimpl - handle no "AllowMacros", where we don't get back the document we opened.
+ //Re-Open as read-write.
+ Doc = (DocumentExcelMS)Doc.Application.OpenDocument(new DataItemFile(path), ApplicationControl.AbstractTypes.AccessMode.View);
+ }
+ }
+ finally
+ {
+ m_Event.AddInApi.SetIsDocEventsDisabled(name, eventsOnDoc);
+ }
+ }
+
+ #region IFactoryObject
+
+ public virtual bool IsMine(object createParams)
+ {
+ return (createParams is SIEventOfficeDocEdit) && ((SIEventOfficeDocEdit)createParams).AppType == ApplicationControl.ApplicationType.MSEXCEL;
+ }
+
+ protected virtual EventsHandling.EnforcementHandlers.EH Create(SIEventOfficeDocEdit eventInfo)
+ {
+ return new EHOfficeDocEditExcel(eventInfo);
+ }
+
+ public virtual EventsHandling.EnforcementHandlers.EH Create(object createParams)
+ {
+ return Create((SIEventOfficeDocEdit)createParams);
+ }
+
+ #endregion
+ }
+}
Index: OfficeCommon/OfficeLibrary/AddIn/OfficeAddIn.cs
===================================================================
--- OfficeCommon/OfficeLibrary/AddIn/OfficeAddIn.cs (revision 3367)
+++ OfficeCommon/OfficeLibrary/AddIn/OfficeAddIn.cs (working copy)
@@ -63,8 +63,9 @@
///
/// variables
///
- // XXX might be better to replace dictionary to save string (fullname) instead of COM objects
- protected Dictionary
Index: OfficeCommon/OfficeLibrary/Documents/DocumentOfficeMS.cs
===================================================================
--- OfficeCommon/OfficeLibrary/Documents/DocumentOfficeMS.cs (revision 3367)
+++ OfficeCommon/OfficeLibrary/Documents/DocumentOfficeMS.cs (working copy)
@@ -261,6 +261,8 @@
return remAr;
}
+ public abstract void SaveAs(string path);
+
#region IDocumentWithWindow Members
public abstract IWin32Window GetWindow();
Index: OfficeCommon/OfficeLibrary/Events/SIEventOfficeDocEdit.cs
===================================================================
--- OfficeCommon/OfficeLibrary/Events/SIEventOfficeDocEdit.cs (revision 3367)
+++ OfficeCommon/OfficeLibrary/Events/SIEventOfficeDocEdit.cs (working copy)
@@ -5,9 +5,36 @@
namespace OfficeLibrary.Events
{
+ public enum EventType
+ {
+ Open,
+ Close,
+ Paste,
+ ///
+ /// Could be user triggered Save or autosave
+ ///
+ SaveBefore,
+ ///
+ /// triggered by user initiated saves
+ ///
+ SaveAfter,
+ ///
+ /// Save as event - we know for certain that user triggered the event
+ ///
+ SaveAs,
+ ManualClassification
+ }
+
[Serializable]
public class SIEventOfficeDocEdit : EventsHandling.SIEventApplication, EventsHandling.IEventWithLocation
{
+ private OfficeLibrary.AddIn.IAddInExtApi m_AddInApi;
+ public OfficeLibrary.AddIn.IAddInExtApi AddInApi
+ {
+ get { return m_AddInApi; }
+ set { m_AddInApi = value; }
+ }
+
private bool m_NeedUIRefresh = false;
///
/// Returned param - has changes been made to the document which requires UI refresh
@@ -32,19 +59,49 @@
set { m_FullName = value; }
}
- public SIEventOfficeDocEdit(DocumentOfficeMS doc)
+ bool m_RmsNoFullCycle = true;
+ ///
+ /// RMS protection using office only, full cycle won't be performed.
+ ///
+ public bool RmsNoFullCycle
+ {
+ get { return m_RmsNoFullCycle; }
+ set { m_RmsNoFullCycle = value; }
+ }
+
+ private EventType m_EventType;
+
+ public EventType EventType
+ {
+ get { return m_EventType; }
+ set { m_EventType = value; }
+ }
+
+ public SIEventOfficeDocEdit(DocumentOfficeMS doc, EventType eventType, OfficeLibrary.AddIn.IAddInExtApi addInApi)
:
base(doc.Application.Type)
{
+ m_AddInApi = addInApi;
m_Doc = doc;
FullName = doc.FullName;
// copy manual classification options so new options will be marked
ClassificationUpdate.ManualClassificationOptions = doc.ManualClassificationOptions;
+ EventType = eventType;
+ switch (EventType)
+ {
+ case EventType.Paste :
+ case EventType.Close :
+ this.RmsNoFullCycle = false;
+ break;
+ default :
+ this.RmsNoFullCycle = true;
+ break;
+ }
}
public override string ToString()
{
- return base.ToString() + " for document: [" + FullName + "]";
+ return base.ToString() + "of type [" + EventType.ToString() + "] for document: [" + FullName + "]";
}
public Uri Location
Index: OfficeCommon/OfficeLibrary/Applications/ApplicationOfficeMS.cs
===================================================================
--- OfficeCommon/OfficeLibrary/Applications/ApplicationOfficeMS.cs (revision 3367)
+++ OfficeCommon/OfficeLibrary/Applications/ApplicationOfficeMS.cs (working copy)
@@ -106,7 +106,9 @@
public Document OpenDocument(DataItem dataStorage, AccessMode mode)
{
- throw new SIExceptionUnimplemented("Currently only support for path documents exists.");
+ if (!(dataStorage is ApplicationControl.DataItemFile))
+ throw new SIExceptionUnimplemented("Currently only support for path documents exists.");
+ return OpenDocument(((ApplicationControl.DataItemFile)dataStorage).Name, mode == AccessMode.Edit ? false : true, true);
}
public abstract Document OpenDocument(string path, bool readOnly, bool visible);
Index: OfficeCommon/OfficeLibrary/Utilities/CustomDocumentProperties.cs
===================================================================
--- OfficeCommon/OfficeLibrary/Utilities/CustomDocumentProperties.cs (revision 3367)
+++ OfficeCommon/OfficeLibrary/Utilities/CustomDocumentProperties.cs (working copy)
@@ -10,8 +10,7 @@
namespace OfficeLibrary
{
- [Serializable]
- public class CustomDocumentProperties : IDisposable
+ public class CustomDocumentProperties : MarshalByRefObject, IDisposable
{
///
Index: OfficeCommon/OfficeLibrary/EH/EHOfficeDocEdit.cs
===================================================================
--- OfficeCommon/OfficeLibrary/EH/EHOfficeDocEdit.cs (revision 3367)
+++ OfficeCommon/OfficeLibrary/EH/EHOfficeDocEdit.cs (working copy)
@@ -15,7 +15,7 @@
namespace OfficeLibrary.EH
{
- public class EHOfficeDocEdit : EHOfficeDoc, CommonUtils.IFactoryObject
+ public abstract class EHOfficeDocEdit : EHOfficeDoc
{
#region Constructors
@@ -48,22 +48,47 @@
#region EH
+ //XXX roeeimpl - read only.
+ protected abstract void ApplyRMSAsSI(string sRMSPolic);
+
+ private void ApplyRMSAsUser(string sRMSPolicy)
+ {
+ if (!Doc.HasRMSSupport())
+ {
+ Log.Logger.Info("ApplyRMS with : [" + sRMSPolicy + "] aborted - RMS not supported on office version");
+ }
+ try
+ {
+ base.ApplyRMS(sRMSPolicy);
+ m_Event.NeedUIRefresh = true;
+ }
+ catch (SIExceptionUnauthorized e)
+ {
+ Log.Logger.InfoException("ApplyRMS with : [" + sRMSPolicy + "] aborted - missing permissions to assign RMS as user: " + e.Message, e);
+ }
+ }
+
+ private bool IsRMSAsUser()
+ {
+ if (m_Event.RmsNoFullCycle)
+ return true;
+
+ if (string.IsNullOrEmpty(Doc.Path))
+ return true; //XXX roeeimpl - save into tmp path, in add-in if saved in tmp path should handle save as save-as
+
+ //XXX roeeimpl If rule says - allow author full control && no RMS or user is author - return true.
+
+ return false;
+ }
+
public override void ApplyRMS(string sRMSPolicy)
{
- if (!Doc.HasRMSSupport())
- {
- Log.Logger.Info("RMS not supported on office version");
- return;
- }
- try
- {
- base.ApplyRMS(sRMSPolicy);
- m_Event.NeedUIRefresh = true;
- }
- catch (SIExceptionUnauthorized e)
- {
- Log.Logger.InfoException("RMS template: [" + sRMSPolicy + "] not applied to missing permissions: " + e.Message, e);
- }
+ if (IsRMSAsUser())
+ {
+ ApplyRMSAsUser(sRMSPolicy);
+ return;
+ }
+ ApplyRMSAsSI(sRMSPolicy);
}
public override string FileName
@@ -83,24 +108,5 @@
}
}
#endregion
-
- #region IFactoryObject
-
- public virtual bool IsMine(object createParams)
- {
- return createParams is SIEventOfficeDocEdit;
- }
-
- protected virtual EventsHandling.EnforcementHandlers.EH Create(SIEventOfficeDocEdit eventInfo)
- {
- return new EHOfficeDocEdit(eventInfo);
- }
-
- public virtual EventsHandling.EnforcementHandlers.EH Create(object createParams)
- {
- return Create((SIEventOfficeDocEdit)createParams);
- }
-
- #endregion
}
}
Index: OfficeCommon/testing/OfficeLibraryTests/EHTests.cs
===================================================================
--- OfficeCommon/testing/OfficeLibraryTests/EHTests.cs (revision 3367)
+++ OfficeCommon/testing/OfficeLibraryTests/EHTests.cs (working copy)
@@ -127,13 +127,15 @@
try
{
// run protection
- SIEventOfficeDocEdit ev = new SIEventOfficeDocEdit(doc);
+ /* XXX
+ SIEventOfficeDocEdit ev = new SIEventOfficeDocEdit(doc, EventType.SaveBefore);
using (EHOfficeDocEdit eh = new EHOfficeDocEdit(ev))
{
eh.ApplyRMS(TemplatePath(rmsTemplate));
eh.Close();
doc.Save();
}
+ */
}
finally
{
Index: Word/WordLibrary/AddIn/WordAddinHelper.cs
===================================================================
--- Word/WordLibrary/AddIn/WordAddinHelper.cs (revision 3367)
+++ Word/WordLibrary/AddIn/WordAddinHelper.cs (working copy)
@@ -40,6 +40,42 @@
}
}
+ protected override void ApplyRMSAsSI(string sRMSPolic, DocumentWordMS doc)
+ {
+ string fullName = Doc.FullName;
+ object docState = Doc.State;
+ //roeeimpl Save state (can parallel protect original doc)
+
+ bool eventsOnDoc = m_Event.AddInApi.SetIsDocEventsDisabled(fullName, true);
+ try
+ {
+ //Save doc to temp file, present the temp file while we protect the orig.
+ using (SITmpFile visibleCopy = new SITmpFile())
+ {
+ visibleCopy.CreateUniqueName(Doc.Name);
+ bool eventsOnCopy = m_Event.AddInApi.SetIsDocEventsDisabled(visibleCopy.FileName, true);
+ try
+ {
+ Doc.SaveAs(visibleCopy.FileName);
+ SIEventOfficeProtectFileRequest protectFileEvent = new SIEventOfficeProtectFileRequest(fullName, ApplicationType.SIWORD);
+ EventsHandling.EventHandlingUtils.GetEventsHandler().HandleEvent(protectFileEvent);
+ //open original doc and restore state.(in AddIn Thread)
+ DocumentWordMS newDoc = (DocumentWordMS)Doc.Application.OpenDocument(new DataItemFile(fullName), AccessMode.Edit);
+ newDoc.State = docState;
+ Doc.Close();
+ }
+ finally
+ {
+ m_Event.AddInApi.SetIsDocEventsDisabled(visibleCopy.FileName, eventsOnCopy);
+ }
+ }
+ }
+ finally
+ {
+ m_Event.AddInApi.SetIsDocEventsDisabled(fullName, eventsOnDoc);
+ }
+ }
+
#region deligates Form ApplicationEvents4
public void OnDocumentWindowActivated(MSWord.Document Doc, MSWord.Window Wn)
@@ -49,20 +85,20 @@
if (!IsSupportedWord())
return;
- DocumentWordMS wDoc = new DocumentWordMS(Doc);
+ DocumentOfficeMS wDoc = new DocumentWordMS(Doc);
LogAddIn.Logger.Trace("doc: [" + wDoc.FullName + "] activated");
if (!m_AppStartAsVisible)
{
m_AppStartAsVisible = true;
- base.SendEditEvent(wDoc, true, EventType.Open);
+ base.SendEditEvent(ref wDoc, true, EventType.Open);
}
OnDocumentActivated(wDoc);
}
catch (Exception e)
{
- ReportException(new DocumentWordMS(Doc), e);
+ ReportException(null, e);
}
}
@@ -85,11 +121,12 @@
if (!m_app.Visible)
m_AppStartAsVisible = false;
- OnDocumentOpen(new DocumentWordMS(doc));
+ DocumentOfficeMS wDoc = new DocumentWordMS(doc);
+ OnDocumentOpen(ref wDoc);
}
catch (Exception e)
{
- ReportException(new DocumentWordMS(doc), e);
+ ReportException(null, e);
}
}
@@ -101,11 +138,12 @@
return;
LogAddIn.Logger.Trace("doc: [" + doc.FullName + "]");
- OnDocumentBeforeClose(new DocumentWordMS(doc), ref cancel);
+ DocumentOfficeMS wDoc = new DocumentWordMS(doc);
+ OnDocumentBeforeClose(ref wDoc, ref cancel);
}
catch (Exception e)
{
- ReportException(new DocumentWordMS(doc), e);
+ ReportException(null, e);
}
}
@@ -117,11 +155,12 @@
return;
LogAddIn.Logger.Trace("Before Save, doc: [" + doc.FullName + "]");
- base.OnDocumentBeforeSave(new DocumentWordMS(doc), SaveAsUI, ref cancel);
+ DocumentOfficeMS wDoc = new DocumentWordMS(doc);
+ base.OnDocumentBeforeSave(ref wDoc, SaveAsUI, ref cancel);
}
catch (Exception e)
{
- ReportException(new DocumentWordMS(doc), e);
+ ReportException(null, e);
}
}
Index: Word/WordLibrary/WordLibrary.csproj
===================================================================
--- Word/WordLibrary/WordLibrary.csproj (revision 3367)
+++ Word/WordLibrary/WordLibrary.csproj (working copy)
@@ -36,6 +36,7 @@
+
@@ -71,6 +72,10 @@
{98828D1C-7708-4C17-98BA-1AC2E890BF5B}EventsHandling
+
+ {0E57A903-3064-43F4-9FF0-59618E59B3C5}
+ SI.RMS.Task
+ {BCDFD4B0-7535-4C6B-B5F6-A01E00F79631}ClipboardHelper
Index: Word/WordLibrary/Wrappers/DocumentWordMS.cs
===================================================================
--- Word/WordLibrary/Wrappers/DocumentWordMS.cs (revision 3367)
+++ Word/WordLibrary/Wrappers/DocumentWordMS.cs (working copy)
@@ -263,6 +263,14 @@
}
+ public override void SaveAs(string path)
+ {
+ object oPath = path;
+ DocAsWordDoc.SaveAs(ref oPath,
+ ref m_MissingValue, ref m_MissingValue, ref m_MissingValue, ref m_MissingValue, ref m_MissingValue, ref m_MissingValue, ref m_MissingValue, ref m_MissingValue, ref m_MissingValue, ref m_MissingValue,
+ ref m_MissingValue, ref m_MissingValue, ref m_MissingValue, ref m_MissingValue, ref m_MissingValue);
+ }
+
public override object State
{
get
Index: Word/WordLibrary/EH/EHOfficeDocEditWord.cs
===================================================================
--- Word/WordLibrary/EH/EHOfficeDocEditWord.cs (revision 0)
+++ Word/WordLibrary/EH/EHOfficeDocEditWord.cs (revision 3534)
@@ -0,0 +1,47 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OfficeLibrary.Events;
+using AgentUtils;
+using WordLibrary.Wrappers;
+using ApplicationControl;
+using ApplicationControl.AbstractTypes;
+
+namespace WordLibrary.EH
+{
+ public class EHOfficeDocEditWord : OfficeLibrary.EH.EHOfficeDocEdit , CommonUtils.IFactoryObject
+ {
+ #region Constructors
+
+ public EHOfficeDocEditWord() : base()
+ {
+ }
+
+ public EHOfficeDocEditWord(SIEventOfficeDocEdit ev) : base(ev)
+ {
+ }
+
+ #endregion
+
+
+
+ #region IFactoryObject
+
+ public virtual bool IsMine(object createParams)
+ {
+ return (createParams is SIEventOfficeDocEdit) && ((SIEventOfficeDocEdit)createParams).AppType == ApplicationControl.ApplicationType.MSWORD;
+ }
+
+ protected virtual EventsHandling.EnforcementHandlers.EH Create(SIEventOfficeDocEdit eventInfo)
+ {
+ return new EHOfficeDocEditWord(eventInfo);
+ }
+
+ public virtual EventsHandling.EnforcementHandlers.EH Create(object createParams)
+ {
+ return Create((SIEventOfficeDocEdit)createParams);
+ }
+
+ #endregion
+ }
+}