예제 #1
0
 public void close()
 {
     if (isActive())
     {
         doc_.Close();
         doc_ = null;
         currentDocTextObject_ = null;
     }
 }
예제 #2
0
 private void setApplication()
 {
     application_ = new Application()
     {
         Visible = true
     };
     applicationActiveState_ = true;
     application_.QuitEvent += () => { applicationActiveState_ = false; };
     currentDocTextObject_   = null;
 }
예제 #3
0
        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}");
            }
        }
예제 #4
0
 public DocStringTextObject(string path)
 {
     path_          = path;
     docTextObject_ = new DocTextObject(path);
 }