void DisposeSelf() { try { this.Disconnect(); } catch (Exception ex) { CtkLog.Write(ex); } //斷線不用清除Event, 但Dispsoe需要, 因為即使斷線此物件仍存活著 CtkEventUtil.RemoveEventHandlersOfOwnerByFilter(this, (dlgt) => true); }
public virtual void Close() { using (var obj = this.ChannelFactory) { obj.Abort(); obj.Close(); } CtkEventUtil.RemoveEventHandlersOfOwnerByFilter(this, (dlgt) => true);//關閉就代表此類別不用了 }
void DisposeSelf() { try { this.Disconnect(); //一旦結束就死了, 需要重new, 所以清掉event沒問題 CtkEventUtil.RemoveEventHandlersOfOwnerByFilter(this, (dlgt) => true); } catch (Exception ex) { CtkLog.Write(ex); } }
public virtual void Close() { if (this.host != null) { using (var obj = this.host) { obj.Abort(); obj.Close(); } } CtkEventUtil.RemoveEventHandlersOfOwnerByFilter(this, (dlgt) => true);//關閉就代表此類別不用了 }
public void Disconnect() { this.NonStopRunStop(); if (this.ChannelFactory != null) { using (var obj = this.ChannelFactory) { obj.Abort(); obj.Close(); } } CtkEventUtil.RemoveEventHandlersOfOwnerByFilter(this, (dlgt) => true); }
public void Close() { this.CfIsRunning = false; this.areMsg.Set();//若在等訊號也通知結束等待 if (this.taskRun != null) { this.taskRun.Cancel();//取消執行Task this.taskRun.Wait(1000); this.taskRun.Dispose(); this.taskRun = null; } if (this.ProtoConn != null) { this.ProtoConn.Disconnect(); this.ProtoConn.Dispose(); this.ProtoConn = null; } CtkEventUtil.RemoveEventHandlersOfOwnerByFilter(this, (dlgt) => true); }
public virtual void Close() { foreach (var chinfo in this.channelMapper) { var ch = chinfo.Value.Channel; ch.Abort(); ch.Close(); } if (this.host != null) { using (var obj = this.host) { obj.Abort(); obj.Close(); } } CtkEventUtil.RemoveEventHandlersOfOwnerByFilter(this, (dlgt) => true);//關閉就代表此類別不用了 }
void DisposeSelf() { this.CloseStream(ref this.fwriter); CtkEventUtil.RemoveEventHandlersOfOwnerByFilter(this, (dlgt) => true); }
void DisposeSelf() { this.Disconnect(); CtkEventUtil.RemoveEventHandlersOfOwnerByFilter(this, (dlgt) => true); }
protected virtual void DisposeSelf() { //Hal統一由HalContext釋放 //MvUtil.DisposeObjTry(this.halAssembly); CtkEventUtil.RemoveEventHandlersOfOwnerByFilter(this, (dlgt) => true); }
protected virtual void DisposeSelf() { CtkEventUtil.RemoveEventHandlersOfOwnerByFilter(this, (dlgt) => true);//移除自己的Event Delegate }