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); } }
/// <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(); }
/// <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())); }
/// <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()}"); }