public void close() { if (isActive()) { doc_.Close(); doc_ = null; currentDocTextObject_ = null; } }
private void setApplication() { application_ = new Application() { Visible = true }; applicationActiveState_ = true; application_.QuitEvent += () => { applicationActiveState_ = false; }; currentDocTextObject_ = null; }
public void open() { try { if (!applicationActiveState_) { setApplication(); } // not isActive, currentdoctextobject를 닫고 this로 교체 if (!isActive()) { currentDocTextObject_?.close(); doc_ = application_.Documents.Open(path_); currentDocTextObject_ = this; } } catch (Exception e) { throw new InvalidOperationException(message: $"DocTextObject: fail to open document {path_}\r\n{e.Message}"); } }
public DocStringTextObject(string path) { path_ = path; docTextObject_ = new DocTextObject(path); }