Example #1
0
 protected virtual void Dispose(bool disposing)
 {
     if (OutputWriter != null)
     {
         OutputWriter.Dispose();
     }
 }
Example #2
0
        /// <summary>
        /// Signals the current view to apply the last view filter that was started on the buffered output
        /// </summary>
        protected void EndFiltering()
        {
            string      original = OutputWriter.ToString();
            IViewFilter filter   = viewFilters.Pop();
            string      filtered = filter.ApplyOn(original);

            OutputWriter.Dispose();
            OutputWriter = outputWriters.Pop();
            OutputWriter.Write(filtered);
        }
Example #3
0
		/// <summary>
		///   釋放腳本資源
		/// </summary>
		/// <param name="disposing">是否正在處理資源中</param>
		internal override void Dispose(bool disposing) {
			if (!this.__bDisposed) {
				__bDisposed = true;
				if (disposing) {
					base.Dispose(disposing);

					onScriptParameters = null;

					//清除腳本設計者所建立的物件與變數
					try {
						StopCalc();
					} catch(Exception __errExcep1) {
						if (logger.IsErrorEnabled) logger.ErrorFormat("{0}\r\n{1}", __errExcep1.Message, __errExcep1.StackTrace);
					}

					try {
						Destroy();
					} catch(Exception __errExcep2) {
						if (logger.IsErrorEnabled) logger.ErrorFormat("{0}\r\n{1}", __errExcep2.Message, __errExcep2.StackTrace);
					}

					CStudyDestroy();

					//清理使用者繪圖文字物件
					__cDrawTexts.Clear();

					//清理輸出寫入者
					OutputWriter cOutputWriter = __cOutputWriter as OutputWriter;
					cOutputWriter.Dispose();

					//清除函數與變數
					ClearFunctions();
					ClearVariables();
				}
			}
		}