Show / Hide Table of Contents

Class CKOffice_Word

Central manager for all Word application instances in the CoverageKiller2 system. Handles lifecycle and cleanup, including the special VSTO ThisAddIn instance.

Inheritance
object
CKOffice_Word
Implements
IDisposable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: CoverageKiller2.DOM
Assembly: CoverageKiller2.dll
Syntax
public class CKOffice_Word : IDisposable
Remarks

Version: CK2.00.00.0010

Properties

AddInApp

Gets the application instance representing the VSTO add-in, if registered.

Declaration
public CKApplication AddInApp { get; }
Property Value
Type Description
CKApplication

Applications

Gets the registered application instances managed by this office context.

Declaration
public IEnumerable<CKApplication> Applications { get; }
Property Value
Type Description
IEnumerable<CKApplication>

Instance

Gets the singleton instance of CKOffice_Word.

Declaration
public static CKOffice_Word Instance { get; }
Property Value
Type Description
CKOffice_Word

IsRunning

Indicates whether CKOffice_Word is currently running.

Declaration
public bool IsRunning { get; }
Property Value
Type Description
bool

IsTest

Declaration
public static bool IsTest { get; }
Property Value
Type Description
bool

Tracer

Declaration
public static Tracer Tracer { get; }
Property Value
Type Description
Tracer

Methods

Crash(Exception, Type, string)

Declaration
public void Crash(Exception ex, Type callerType, string callerMember = null)
Parameters
Type Name Description
Exception ex
Type callerType
string callerMember

Dispose()

Declaration
public void Dispose()

Dispose(bool)

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
bool disposing

ShutDown()

Declaration
public int ShutDown()
Returns
Type Description
int

Start()

Starts CKOffice_Word and configures logging. Also cleans up orphaned Word processes from previous runs.

Declaration
public int Start()
Returns
Type Description
int

0 if started; 1 if already running; -1 if error occurred.

TryGetAppFor(Document, out CKApplication)

Attempts to find the CKApplication instance that owns the specified Word.Document.

Declaration
public bool TryGetAppFor(Document doc, out CKApplication ckApp)
Parameters
Type Name Description
Document doc

The Word document to search for.

CKApplication ckApp

The matching CKApplication instance, if found.

Returns
Type Description
bool

True if found; otherwise false.

TryGetNewApp(out CKApplication, bool)

Attempts to create a new owned CKApplication instance.

Declaration
public int TryGetNewApp(out CKApplication app, bool visible = false)
Parameters
Type Name Description
CKApplication app

The created application wrapper, or null if failed.

bool visible

Whether the Word UI should be visible.

Returns
Type Description
int

The count of owned applications if successful; -1 if failed.

Remarks

Version: CK2.00.00.0010

TryPutAddin(ThisAddIn)

Registers the VSTO add-in as a known guest instance. It will not be owned or disposed.

Declaration
public int TryPutAddin(ThisAddIn addin)
Parameters
Type Name Description
ThisAddIn addin

The add-in instance to register.

Returns
Type Description
int

0 if registered successfully.

Implements

IDisposable

Extension Methods

PingService.PingPong<T>(T, string)
PingService.PingPong<T>(T, string, string)
PingService.PingPong<T, TResult>(T, Func<TResult>, string, string)
PingService.Ping<T>(T, string)
PingService.Ping<T>(T, string, string)
PingService.Ping<T>(T, Type[], string)
PingService.Pong<T>(T, string)
PingService.Pong<T>(T, string, string)
PingService.Pong<T>(T, Type, string)
PingService.Pong<T>(T, Type[], string)
PingService.Pong<T, TResult>(T, Func<TResult>, string, string)
In this article
Back to top Generated by DocFX