コード例 #1
0
 private static void TryAddToDatabase(DbFavorite historyTarget)
 {
     using (var database = DatabaseConnections.CreateInstance())
     {
         var userSid = WindowsUserIdentifiers.GetCurrentUserSid();
         // store holds dates in UTC
         database.InsertHistory(historyTarget.Id, Moment.Now, userSid);
     }
 }
コード例 #2
0
 /// <summary>
 /// Assigns current user security id to it, if the user account is domain.
 /// For local user account this value isn't set to preserver file persistence space,
 /// because all history items than have the same value.
 /// </summary>
 void IHistoryItem.AssignCurentUser()
 {
     this.UserSid = WindowsUserIdentifiers.GetCurrentUserSid();
 }
コード例 #3
0
 /// <summary>
 /// generates mutexee per user names with global prefix to control also sessions on Terminal server
 /// </summary>
 private static string GetMutexName(string generalName)
 {
     return(string.Format("Global\\{0}.{1}", generalName, WindowsUserIdentifiers.GetCurrentUserSid()));
 }
コード例 #4
0
 /// <summary>
 ///     generates mutexee per user names with global prefix to control also sessions on Terminal server
 /// </summary>
 private static string GetMutexName(string generalName)
 {
     return($"Global\\{generalName}.{WindowsUserIdentifiers.GetCurrentUserSid()}");
 }