Exemplo n.º 1
0
        /// <summary>Dispose requests the VSC side to forget about this object and release or destroy all resources associated with or occupied by it. All subsequent usage attempts will be rejected.</summary>
        public Action <Action> Dispose()
        {
            Action ondone = null;

            impl.send(new ipcMsg("dispose", 1)
            {
                Data = { [""] = id }
            }, _ => {
                if (ondone != null)
                {
                    ondone();
                }
                return(true);
            });
            if (subFnIds.Count > 0)
            {
                lock (this)
                    foreach (var subfnid in subFnIds)
                    {
                        impl.cbListeners.Remove(subfnid);
                        impl.cbOther.Remove(subfnid);
                    }
                subFnIds.Clear();
            }
            return(on => ondone = on);
        }
Exemplo n.º 2
0
 /// <summary>Cancel.Now signals cancellation to the counterparty.</summary>
 public void Now()
 {
     if (impl == null || string.IsNullOrEmpty(fnId))
     {
         Vsc.OnError(impl, new Exception("vscode-appz/libs/cs#Cancel.Now called before the Cancel was announced to the counterparty."), null);
     }
     else
     {
         impl.send(new ipcMsg()
         {
             CbId = fnId
         }, null);
     }
 }