예제 #1
0
 // caller may be null when not called as a worksheet function.
 public AsyncObservableState(Guid id, AsyncCallInfo callInfo, ExcelReference caller, IExcelObservable observable)
 {
     _id          = id.ToString();
     _callInfo    = callInfo;
     _observable  = observable;
     _callerState = AsyncCallerState.GetCallerState(caller); // caller might be null, _callerState should not be
 }
예제 #2
0
 // caller may be null when not called as a worksheet function.
 public AsyncObservableState(Guid id, AsyncCallInfo callInfo, ExcelReference caller, ExcelObservableOptions options, IExcelObservable observable)
 {
     _callInfo = callInfo;
     if (options == ExcelObservableOptions.None)
     {
         _topics = new string[] { id.ToString() }
     }
     ;
     else
     {
         _topics = new string[] { id.ToString(), ((int)options).ToString() }
     };
     _observable  = observable;
     _callerState = AsyncCallerState.GetCallerState(caller); // caller might be null, _callerState should not be
 }
예제 #3
0
        // caller might be null
        public static AsyncCallerState GetCallerState(ExcelReference caller)
        {
            if (caller == null)
            {
                return(new AsyncCallerState(null));
            }

            AsyncCallerState callerState;

            if (!_callerStates.TryGetValue(caller, out callerState))
            {
                callerState           = new AsyncCallerState(caller);
                _callerStates[caller] = callerState;
            }
            return(callerState);
        }