public AppOperation(AppOperationKind operation, string sessionId, Thread thread, ThreeDApp app)
 {
     this.Operation = operation;
     this.SessionId = sessionId;
     this.Thread    = thread;
     Start          = DateTime.Now;
     End            = DateTime.Now;
     State          = OperationState.Running;
     this.App       = app;
 }
        public AppOperation Begin(AppOperationKind operationKind, string sessionId)
        {
            var ret = new AppOperation(operationKind, sessionId, Thread.CurrentThread, app);

            lock (operations)
            {
                operations.Add(ret);
                lastOperation = ret;
            }
            currentOperation.Value = ret;
            return(ret);
        }
 public AppOperationKind[] GetOperationKinds()
 {
     lock (kinds)
     {
         var ret = new AppOperationKind[kinds.Count];
         int i   = 0;
         foreach (var entry in kinds)
         {
             ret[i++] = entry.Value;
         }
         return(ret);
     }
 }
 public AppOperationKind CreateOperationKind(string operation)
 {
     lock (kinds)
     {
         AppOperationKind kind;
         if (kinds.TryGetValue(operation, out kind))
         {
             return(kind);
         }
         var ret = new AppOperationKind(this, operation);
         kinds.Add(operation, ret);
         return(ret);
     }
 }