예제 #1
0
 public SecurityIdentityAdded(SecurityID id, UserID userID, string displayName, string token)
     : base(id)
 {
     UserID = userID;
     DisplayName = displayName;
     Token = token;
 }
예제 #2
0
 public UserLoginSuccessReported(SecurityID securityID, UserID userID, DateTime timeUtc, string ip)
     : base(securityID)
 {
     UserID = userID;
     TimeUtc = timeUtc;
     Ip = ip;
 }
예제 #3
0
 public SecurityItemRemoved(SecurityID securityID, UserID userId, string lookup, string type)
     : base(securityID)
 {
     UserID = userId;
     Lookup = lookup;
     Type = type;
 }
예제 #4
0
        public ActionResult Publish(string title, string body)
        {
            ResultInfo ri = new ResultInfo();

            if (UserBaseBLL.Instance.IsRoot)
            {
                News model = new News()
                {
                    NTitle     = title,
                    NBody      = HttpUtility.UrlDecode(body),
                    IsDelete   = 0,
                    CreateTime = DateTime.Now,
                    CreateUser = UserID.ToString(),
                    IsTop      = 0,
                    PVCount    = 0
                };
                int result = NewsBLL.Instance.Add(model);
                if (result > 0)
                {
                    ri.Url = ConfigHelper.AppSettings("NewsDetail").FormatWith(result);
                    ri.Ok  = true;
                    ri.Msg = "新闻发布成功";
                }
                else
                {
                    ri.Msg = "新闻发布失败";
                }
            }
            else
            {
                ri.Msg = "你没有权限";
            }
            return(Result(ri));
        }
예제 #5
0
        public ActionResult Edit(GRN model)
        {
            ViewBag.Title        = "Edit";
            model.OrganizationId = OrganizationId;
            model.CreatedDate    = System.DateTime.Now;
            model.CreatedBy      = UserID.ToString();

            FillWarehouse();
            FillCurrency();
            SupplierDropdown();
            FillAdditionDeduction();
            FillEmployee();

            var repo    = new GRNRepository();
            var result1 = new GRNRepository().CHECK(model.GRNId);

            if (result1 > 0)
            {
                TempData["error"] = "Sorry! Already Used.";
                TempData["GRNNo"] = null;
                return(View("Edit", model));
            }

            else
            {
                try
                {
                    var result = new GRNRepository().UpdateGRN(model);
                    //var result3 = new GRNItemRepository().DeleteGRNADDDED(model.GRNId);
                    //var result2 = new GRNItemRepository().DeleteGRNItem(model.GRNId);
                    //var result4 = new StockUpdateRepository().DeleteGRNStockUpdate(model.GRNId);
                    //var result5 = new GRNRepository().InsertGRNDT(model);
                    if (result.GRNId > 0)
                    {
                        TempData["success"] = "Updated successfully. (" + result.GRNNo + ")";
                        TempData["GRNNo"]   = result.GRNNo;
                        return(RedirectToAction("PreviousList"));
                        //return View("Edit", model);
                    }
                    else
                    {
                        throw new Exception();
                    }
                }
                catch (SqlException)
                {
                    TempData["error"] = "Some error occured while connecting to database. Please check your network connection and try again.";
                }
                catch (NullReferenceException)
                {
                    TempData["error"] = "Some required data was missing. Please try again.";
                }
                catch (Exception)
                {
                    TempData["error"] = "Some error occured. Please try again.";
                }
                return(RedirectToAction("PreviousList"));
            }
        }
예제 #6
0
 public ActionResult Save(WorkShopGRN model)
 {
     model.OrganizationId = OrganizationId;
     model.CreatedDate    = System.DateTime.Now;
     model.CreatedBy      = UserID.ToString();
     new WorkShopGRNRepository().InsertWorkShopGRN(model);
     return(RedirectToAction("CreateWorkShopGRN"));
 }
예제 #7
0
 public Session(string accessToken, string refreshToken, DateTime lastRefreshTime, TimeSpan expiresIn, UserID id)
 {
     AccessToken     = accessToken;
     RefreshToken    = refreshToken;
     LastRefreshTime = lastRefreshTime;
     ExpiresIn       = expiresIn;
     ID = id;
 }
예제 #8
0
    public static void Add(UserID id, UserID prevId)
    {
        int idx  = (int)id;
        int prev = (int)prevId;

        m_scoreTable[idx]  += 1;
        m_scoreTable[prev] -= 1;
    }
예제 #9
0
파일: Card.cs 프로젝트: michdw/cardid
 public Card TrimValues()
 {
     CardID = CardID.Trim();
     UserID = UserID.Trim();
     Front  = Front.Trim();
     Back   = Back.Trim();
     return(this);
 }
 public string SetLoginData(string userName, string password)
 {
     UserID.Clear();
     PassWord.Clear();
     UserID.SendKeys(userName);
     PassWord.SendKeys(password);
     return(ClickOnLogin());
 }
예제 #11
0
 private void FrmPasswordSet_Load(object sender, EventArgs e)
 {
     FormTranslator.Translate(this, GetType().FullName);
     txtUserID.Text = UserID.ToString();
     txtPassword.Select();
     btnHidePassword.Top = btnShowPassword.Top;
     SetOkEnabled();
 }
예제 #12
0
        public override int GetHashCode()
        {
            var hashCode = 1935117043;

            hashCode = hashCode * -1521134295 + UserID.GetHashCode();
            hashCode = hashCode * -1521134295 + ConnectionID.GetHashCode();
            return(hashCode);
        }
예제 #13
0
 public void SignIntoAccount(string user, string password)
 {
     UserID.InputText(user);
     Password.InputText(password);
     //UserType.SelectDropDownOptionByText("Default"); // This step is removed in application
     WaitSeconds(3);
     SignIn.Click();
 }
 public PermissionAddedToSecurityItem(SecurityID securityID, UserID userId, string displayName, string permission, string token)
     : base(securityID)
 {
     UserID = userId;
     DisplayName = displayName;
     Permission = permission;
     Token = token;
 }
예제 #15
0
        public override int GetHashCode()
        {
            int hashCode = 13;

            hashCode = (hashCode * 7) + UserID.GetHashCode();
            hashCode = (hashCode * 7) + RoleID.GetHashCode();
            return(hashCode);
        }
예제 #16
0
        /// <summary>
        /// 获取Token
        /// </summary>
        /// <returns></returns>
        public string GetToken()
        {
            var aes = new FzLib.Cryptography.Aes();

            aes.SetStringKey(Key + UserID);
            aes.SetStringIV("");
            return(aes.Encrypt(string.Join("-", UserID.ToString(), DateTime.Now.ToString("yyyyMMdd"))));
        }
예제 #17
0
    /// <summary>
    /// 新增修改方法
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string hid = Request["hid"] + "";

        if (!string.IsNullOrWhiteSpace(hid))
        {
            Hi.Model.SYS_Hospital hospital = new Hi.BLL.SYS_Hospital().GetModel(Convert.ToInt32(hid));
            hospital.HospitalCode  = this.hospitalCode.Value.Trim();  //医院编码
            hospital.HospitalName  = this.hospitalName.Value.Trim();  //医院全称
            hospital.HospitalLevel = this.hospitalLevel.Value.Trim(); //医院级别
            hospital.Province      = this.hidProvince.Value.Trim();   //省
            hospital.City          = this.hidCity.Value.Trim();       //市
            hospital.Area          = this.hidArea.Value.Trim();       //区
            hospital.Address       = this.address.Value.Trim();       //详细地址
            if (new Hi.BLL.SYS_Hospital().Update(hospital))
            {
                Response.Redirect("hospitalInfo.aspx?hid=" + hospital.ID);
            }
            else
            {
                JScript.AlertMsgMo(this, "医院编辑失败", "function (){ window.location.reload(); }");
            }
        }
        else
        {
            List <Hi.Model.SYS_Hospital> hoslist = new Hi.BLL.SYS_Hospital().GetList("", " HospitalName='" + this.hospitalName.Value.Trim() + "'", "");

            if (hoslist != null && hoslist.Count > 0)
            {
                JScript.AlertMsgMo(this, "医院名称已存在", "function (){  }");
            }
            else
            {
                Hi.Model.SYS_Hospital hospital = new Hi.Model.SYS_Hospital();
                hospital.HospitalCode  = this.hospitalCode.Value.Trim();  //医院编码
                hospital.HospitalName  = this.hospitalName.Value.Trim();  //医院全称
                hospital.HospitalLevel = this.hospitalLevel.Value.Trim(); //医院级别
                hospital.Province      = this.hidProvince.Value.Trim();   //省
                hospital.City          = this.hidCity.Value.Trim();       //市
                hospital.Area          = this.hidArea.Value.Trim();       //区
                hospital.Address       = this.address.Value.Trim();       //详细地址
                hospital.CreateDate    = DateTime.Now;
                hospital.dr            = false;
                hospital.CreateUser    = UserID.ToString();
                hospital.IsEnabled     = true;
                hospital.ts            = DateTime.Now;
                int id = new Hi.BLL.SYS_Hospital().Add(hospital);
                if (id > 0)
                {
                    Response.Redirect("hospitalInfo.aspx?hid=" + id);
                }
                else
                {
                    JScript.AlertMsgMo(this, "医院编辑失败", "function (){ window.location.reload(); }");
                }
            }
        }
    }
예제 #18
0
        private async Task <bool> AuthenticateByAAD(string userObjectID,
                                                    string username,
                                                    string tenantID,
                                                    string upn,
                                                    string endpoint)
        {
            bool ret = true;

            UserID userID = new UserID();

            userID.groups       = new List <string>();
            userID.uid          = "99999999";
            userID.gid          = "99999999";
            userID.isAdmin      = "false";
            userID.isAuthorized = "false";


            if (!String.IsNullOrEmpty(tenantID))
            {
                var token = await _tokenCache.GetAccessTokenForAadGraph();

                if (!String.IsNullOrEmpty(token))
                {
                    OpenIDAuthentication config;
                    var scheme = Startup.GetAuthentication(username, out config);

                    if (!Object.ReferenceEquals(config, null) && config._bUseAadGraph)
                    {
                        string requestUrl = String.Format("{0}/myorganization/me/memberOf?api-version={2}",
                                                          config._graphBasePoint,
                                                          tenantID,
                                                          config._graphApiVersion);

                        HttpClient         client  = new HttpClient();
                        HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, requestUrl);
                        request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token);

                        HttpResponseMessage response = await client.SendAsync(request);

                        if (!response.IsSuccessStatusCode)
                        {
                            throw new HttpRequestException(response.ReasonPhrase);
                        }
                        string responseString = await response.Content.ReadAsStringAsync();

                        _logger.LogInformation("MemberOf information: {0}", responseString);

                        // string resourceURL = Startup.Configuration["AzureAd:ResourceURL"];
                        // var servicePointUri = new Uri(resourceURL);
                        // System.Uri serviceRoot = new Uri(servicePointUri, tenantID);
                        // var activeDirectoryClient = new ActiveDirectoryClient(serviceRoot, async => await _assertionCredential.AccessToken);
                    }
                }
            }
            // Mark user as unauthorized.
            // await AddUser(username, userID);
            return(ret);
        }
        public ActionResult EditProjectWorkDescription(WorkDescription model)
        {
            FillItem();
            FillJobCardTaskMaster();

            ViewBag.Title        = "Edit";
            model.OrganizationId = OrganizationId;
            model.CreatedDate    = System.DateTime.Now;
            model.CreatedBy      = UserID.ToString();

            var repo = new WorkDescriptionRepository();

            var result1 = new WorkDescriptionRepository().CHECK(model.WorkDescriptionId);

            if (result1 > 0)
            {
                TempData["error"] = "Sorry!!..Already Used!!";
                TempData["WorkDescriptionRefNo"] = null;
                return(View("Edit", model));
            }

            else
            {
                try
                {
                    var result3 = new WorkDescriptionRepository().DeleteWorkDescriptionTask(model.WorkDescriptionId);
                    var result2 = new WorkDescriptionRepository().DeleteWorkDescriptionItem(model.WorkDescriptionId);
                    var result4 = new WorkDescriptionRepository().DeleteWorkDescriptionHD(model.WorkDescriptionId, UserID.ToString());
                    //string id = new WorkDescriptionRepository().InsertWorkDescription(model);
                    var result = new WorkDescriptionRepository().InsertWorkDescription(model);
                    if (result.WorkDescriptionId > 0)
                    {
                        TempData["success"] = "Updated successfully!";
                        TempData["WorkDescriptionRefNo"] = result.WorkDescriptionRefNo;
                        return(RedirectToAction("FillProjectWorkDescriptionList"));
                        //return View("Edit", model);
                    }
                    else
                    {
                        throw new Exception();
                    }
                }
                catch (SqlException sx)
                {
                    TempData["error"] = "Some error occured while connecting to database. Please check your network connection and try again.|" + sx.Message;
                }
                catch (NullReferenceException nx)
                {
                    TempData["error"] = "Some required data was missing. Please try again.|" + nx.Message;
                }
                catch (Exception ex)
                {
                    TempData["error"] = "Some error occured. Please try again.|" + ex.Message;
                }
                return(RedirectToAction("FillProjectWorkDescriptionList"));
            }
        }
예제 #20
0
 public RegistrationSucceeded(RegistrationID registrationIdentity, SecurityID securityID, UserID userID,
                              string userDisplayName, string userToken)
     : base(registrationIdentity)
 {
     SecurityID = securityID;
     UserID = userID;
     UserDisplayName = userDisplayName;
     UserToken = userToken;
 }
예제 #21
0
 public override string ToString()
 {
     return(Status.ToString() + "?"
            + UserID.ToString() + "?"
            + FirstName + "?"
            + LastName + "?"
            + Email + "?"
            + Login);
 }
예제 #22
0
        //public string ScreenName {
        //    get {
        //        return string.Format(
        //            "{0} <{1}>",
        //            NickName,
        //            UserName
        //            );
        //    }
        //}

        protected override string[] GetSerializeFields()
        {
            return(new string[] {
                UserID.ToString(),
                UserName,
                Email,
                IsAdmin.ToString()
            });
        }
예제 #23
0
        public void ProcessGroupMessage(GroupID groupId, UserID senderId, string message)
        {
            // 检查每分钟最大调用
            if (CheckCallPerMin(groupId))
            {
                return;
            }

            // 处理以 '/' 开头的消息
            RunAutoReply(groupId, message);
            if (Config.Instance.IsSlashRequired && !message.StartsWith('/'))
            {
                if (!showedSlashTip)
                {
                    Trace.WriteLine("提示: 设置中要求命令必须以 / 开头. ");
                    showedSlashTip = true;
                }
                return;
            }
            message = message.TrimStart('/', '、', '/');

            var handler = new GroupMessageHandler(senderId, groupId, message);

            // TODO 优化task数量
            // TODO cancellation token
            Task.Run(async() =>
            {
                var sw           = Stopwatch.StartNew();
                var cancelSource = new CancellationTokenSource();
                AsyncContext.SetCancellationToken(cancelSource.Token);
                var sender = new GroupMessageSender(groupId);
                AsyncContext.SetMessageSender(sender);
                var commandProcessTask = handler.ProcessCommandInput();

                using var locker = WFBotResourceLock.Create(
                          $"命令处理 #{Interlocked.Increment(ref commandCount)} 群[{groupId}] 用户[{senderId}] 内容[{message}]");
                await Task.WhenAny(commandProcessTask, Task.Delay(TimeSpan.FromSeconds(60)));

                if (!commandProcessTask.IsCompleted)
                {
                    cancelSource.Cancel();
                    await Task.Delay(10.Seconds());
                    if (!commandProcessTask.IsCompleted)
                    {
                        sender.SendMessage($"命令 [{message}] 处理超时.");
                    }
                    Trace.WriteLine($"命令 群[{groupId}] 用户[{senderId}] 内容[{message}] 处理超时.");
                    return;
                }
#if !DEBUG
                if (commandProcessTask.Result.matched)
                {
                    Trace.WriteLine($"命令 群 [{groupId}] 用户 [{senderId}] 内容 [{message}] 处理完成: {sw.Elapsed.Seconds:N1}s.");
                }
#endif
            });
        }
예제 #24
0
        public override int GetHashCode()
        {
            int hash = GetType().GetHashCode();

            hash = (hash * 397) ^ UserID.GetHashCode();
            hash = (hash * 397) ^ ApplicationName.GetHashCode();

            return(hash);
        }
예제 #25
0
        /// <summary>
        /// Возвращает словарь параметров.
        /// </summary>
        public override Dictionary <string, string> GetParameters()
        {
            var parameters = base.GetParameters();

            parameters["group_id"] = GroupID.ToString();
            parameters["user_id"]  = UserID.ToString();

            return(parameters);
        }
예제 #26
0
        public override int GetHashCode()
        {
            int hash = GetType().GetHashCode();

            hash = (hash * 397) ^ UserID.GetHashCode();
            hash = (hash * 397) ^ TopicID.GetHashCode();

            return(hash);
        }
예제 #27
0
        /// <summary>
        /// 绑定所属会员
        /// </summary>
        private void BindUser()
        {
            UserInfoManager userInfoManager = new UserInfoManager();

            UserID.DataSource     = userInfoManager.GetUserListByCondition();
            UserID.DataTextField  = "NickName";
            UserID.DataValueField = "ID";
            UserID.DataBind();
        }
예제 #28
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// UpdateDisplayName updates the displayname to the format provided
 /// </summary>
 /// <param name="format">The format to use</param>
 /// -----------------------------------------------------------------------------
 public void UpdateDisplayName(string format)
 {
     //Replace Tokens
     format      = format.Replace("[USERID]", UserID.ToString(CultureInfo.InvariantCulture));
     format      = format.Replace("[FIRSTNAME]", FirstName);
     format      = format.Replace("[LASTNAME]", LastName);
     format      = format.Replace("[USERNAME]", Username);
     DisplayName = format;
 }
예제 #29
0
    private HttpRequestMessage GetRequestMessage(string urlSegment, HttpMethod method)
    {
        var request = new HttpRequestMessage(method, new Uri($"{BaseAPIUrl}{urlSegment}"));

        request.Headers.TryAddWithoutValidation("UserID", UserID.ToString());
        request.Headers.TryAddWithoutValidation("Application", AppName);
        request.Headers.TryAddWithoutValidation("MachineName", Environment.MachineName);
        return(request);
    }
예제 #30
0
    public void SetParam(UserID id, int charm, float hitRadius)
    {
        m_userID = id;
        m_charm  = charm;

        SphereCollider col = this.GetComponent <SphereCollider>();

        col.radius = hitRadius;
    }
예제 #31
0
        protected override void ProcessCmd(string[] args)
        {
            int abilityId = args.Length > 0 ? args[0].Trim().ToInt() : 0;

            if (abilityId > 0)
            {
                AddUserAbility(abilityId, UserID.ToInt(), 0, 0);
            }
        }
예제 #32
0
        public override bool Equals(object obj)
        {
            if (obj == null || !(obj is ERUserPointsEntity))
            {
                return(false);
            }

            return(UserID.Equals((obj as ERUserPointsEntity).UserID));
        }
예제 #33
0
    /// <summary>
    /// XBoxInputのインターフェースを作成
    /// </summary>
    /// <param name="id">ユーザーID</param>
    /// <param name="type">XBoxInputのUserID</param>
    /// <returns>作成成功か?</returns>
    public static bool CreateXBoxInterface(UserID id, XBoxInput.XBKeyCode.UserCode user)
    {
        int i = (int)id;

        XLogger.Log("Create interface= XVInputController: id= " + i.ToString());
        m_input[i] = new XVInputController(user);

        return(true);
    }
예제 #34
0
        public ActionResult Create(Item oitem)
        {
            FillItemCategory();
            FillUnit();
            InitDropdown();
            oitem.OrganizationId = OrganizationId;
            oitem.CreatedDate    = System.DateTime.Now;
            oitem.CreatedBy      = UserID.ToString();

            var repo = new ItemRepository();

            bool isexists = repo.IsFieldExistsWithActive(repo.ConnectionString(), "Item", "ItemName", oitem.ItemName, null, null);

            if (!isexists)
            {
                if (oitem.PartNo != null)
                {
                    isexists = repo.IsFieldExistsWithActive(repo.ConnectionString(), "Item", "PartNo", oitem.PartNo, null, null);
                }

                if (!isexists)
                {
                    var result = new ItemRepository().InsertItem(oitem);
                    if (result.ItemId > 0)
                    {
                        TempData["Success"] = "Saved Successfully! Reference No. is " + result.ItemRefNo;
                        return(RedirectToAction("Index"));
                    }

                    else
                    {
                        FillUnit();
                        FillItem();
                        FillJobCardTaskMaster();
                        TempData["error"] = "Some error occurred. Please try again.";
                        return(View("Create", oitem));
                    }
                }
                else
                {
                    FillUnit();
                    FillItem();
                    FillJobCardTaskMaster();
                    TempData["error"] = "This part no. already exists!";
                    return(View("Create", oitem));
                }
            }
            else
            {
                FillUnit();
                FillItem();
                FillJobCardTaskMaster();
                TempData["error"] = "This material/spare name alredy exists!";
                return(View("Create", oitem));
            }
        }
예제 #35
0
        public override bool Equals(object obj)
        {
            if (obj == null || !(obj is ERTeamOperationEntity))
            {
                return(false);
            }

            return(TeamID.Equals((obj as ERTeamOperationEntity).TeamID) &
                   UserID.Equals((obj as ERTeamOperationEntity).UserID));
        }
예제 #36
0
 public SecurityPasswordAdded(SecurityID identity, UserID userID, string displayName,
                              string login, string passwordHash, string passwordSalt, string token)
     : base(identity)
 {
     UserID = userID;
     DisplayName = displayName;
     Login = login;
     PasswordHash = passwordHash;
     PasswordSalt = passwordSalt;
     Token = token;
 }
예제 #37
0
        public SessionIdentity(UserID user, SecurityID security, string userName,
                               string cookieString, IEnumerable<string> permissions, string token)
        {
            User = user;
            Security = security;
            UserName = userName;
            SessionDisplay = String.Format("{0} ({1})", UserName, User.GetIdenfitier());

            CookieString = cookieString;
            Permissions = new HashSet<string>(permissions);
            Token = token;
        }
예제 #38
0
파일: AuthInfo.cs 프로젝트: sahina/aec_cqrs
 public AuthInfo(UserID login, string token)
 {
     Login = login;
     Token = token;
 }
예제 #39
0
			public static Uri Show(UserID sourceID, UserID targetID)
			{
				return Build
				(
					"friendships/show",
					new
					{
						source_id = sourceID,
						target_id = targetID,
					}
				);
			}
예제 #40
0
			public static Uri Show(UserID sourceID, string targetName)
			{
				return Build
				(
					"friendships/show",
					new
					{
						source_id = sourceID,
						target_screen_name = targetName,
					}
				);
			}
예제 #41
0
			public static Uri Show(string sourceName, UserID targetID)
			{
				return Build
				(
					"friendships/show",
					new
					{
						source_screen_name = sourceName,
						target_id = targetID,
					}
				);
			}
예제 #42
0
			public static Uri Create(UserID id)
			{
				return Build
				(
					"blocks/create.json",
					new
					{
						user_id = id,
					}
				);
			}
예제 #43
0
			public static Uri Destroy(UserID id)
			{
				return Build
				(
					"blocks/destroy.json",
					new
					{
						user_id = id,
					}
				);
			}
예제 #44
0
			public static Uri Exists(UserID id)
			{
				return Build
				(
					"blocks/exists.json",
					new
					{
						user_id = id,
						include_entities = true,
					}
				);
			}
예제 #45
0
 public static SessionIdentity Create(string dispay, UserID user, string token,
                                      SecurityID sec, params string[] permissions)
 {
     var auth = new AuthInfo(user, token);
     return new SessionIdentity(user, sec, dispay, auth.ToCookieString(), permissions, token);
 }
예제 #46
0
#pragma warning disable 1591

		public static Uri ReportSpam(UserID id)
		{
			return Build
			(
				"report_spam.json",
				new
				{
					user_id = id,
				}
			);
		}
예제 #47
0
		/// <summary>
		/// 指定したユーザ ID に割り当てられたキャッシュを取得するか、指定された外部取得処理を実行しキャッシュします。
		/// </summary>
		/// <param name="id">探索または割り当てるキャッシュのユーザ ID。</param>
		/// <param name="body">指定したユーザ ID がキャッシュされていなかった場合実行される取得処理。</param>
		/// <returns>指定したユーザ ID に割り当てられたキャッシュが存在する場合はそのキャッシュ。無い場合は指定された外部取得処理の取得結果。</returns>
		public User RetrieveUser(UserID id, Func<UserID, User> body)
		{
			Clean();

			using (rwl.AcquireReaderLock())
			{
				var e = new EventArgs<UserID, User>(id, null);

				ResolveUserByID.RaiseEvent(this, e);

				if (e.Value2 != null)
					return e.Value2;

				if (usersByID.ContainsKey(id))
					return usersByID[id];
			}

			return SetUser(body(id));
		}
예제 #48
0
 public UserCreated(SecurityID securityID, UserID userID, TimeSpan activityThreshold)
     : base(securityID)
 {
     UserID = userID;
     ActivityThreshold = activityThreshold;
 }
 public SecurityItemDisplayNameUpdated(SecurityID securityID, UserID userId, string displayName)
     : base(securityID)
 {
     UserID = userId;
     DisplayName = displayName;
 }
예제 #50
0
 public UserUnlocked(SecurityID securityID, UserID userID, string unlockReason)
     : base(securityID)
 {
     UserID = userID;
     UnlockReason = unlockReason;
 }