/// <summary> /// Returns true if InputCredentialsList instances are equal /// </summary> /// <param name="other">Instance of InputCredentialsList to be compared</param> /// <returns>Boolean</returns> public bool Equals(InputCredentialsList other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( UserID == other.UserID || UserID != null && UserID.Equals(other.UserID) ) && ( MaxResults == other.MaxResults || MaxResults != null && MaxResults.Equals(other.MaxResults) ) && ( PageToken == other.PageToken || PageToken != null && PageToken.Equals(other.PageToken) ) && ( ClientData == other.ClientData || ClientData != null && ClientData.Equals(other.ClientData) )); }
public override bool Equals(object obj) { if (obj == null || !(obj is ERUserPointsEntity)) { return(false); } return(UserID.Equals((obj as ERUserPointsEntity).UserID)); }
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)); }
//Equals inspiret by OOP Slides public override bool Equals(object obj) { User otherObj = obj as User; if (otherObj == null) { return(false); } return(UserID.Equals(otherObj.UserID) && Username.Equals(otherObj.Username)); }
public override bool Equals(object obj) { User other = obj as User; if (other == null) { return(false); } return(UserID.Equals(other.UserID)); }
public override bool Equals(object obj) { if (obj == null || !(obj is ERFriendEntity)) { return(false); } return(UserID.Equals((obj as ERFriendEntity).UserID) & FriendId.Equals((obj as ERFriendEntity).FriendId)); }
public override bool Equals(object obj) { var other = obj as UserRole; if (other == null) { return(false); } return(RoleID.Equals(other.RoleID) && UserID.Equals(other.UserID)); }
private void InitUI() { Action action = null; DataTable dataTable = MSCE.GetDataTable("select UserID,UserName,MeetingID from NowLogin"); if (dataTable.Rows.Count > 0) { if (UserID.Equals("")) { FromIndividualSign = true; UserID = dataTable.Rows[0]["UserID"].ToString(); UserName = dataTable.Rows[0]["UserName"].ToString(); } else { FromIndividualSign = false; btnBack.Visibility = Visibility.Visible; } MeetingID = dataTable.Rows[0]["MeetingID"].ToString(); txtName.Text = UserName + " 您好"; } if (!PicUrl.Equals("")) { txtPLS.Visibility = Visibility.Collapsed; SignPadPanel.Visibility = Visibility.Collapsed; imgSignedPicPanel.Visibility = Visibility.Visible; TaskFactory factory = Task.Factory; if (action == null) { action = new Action(_003CInitUI_003Eb__20); } factory.StartNew(action); } if (Settings.Default.EnableSignOut && FromIndividualSign) { btnSignOut.Visibility = Visibility.Visible; if (PicUrl.Equals("")) { FormatConvertedBitmap formatConvertedBitmap = new FormatConvertedBitmap(); formatConvertedBitmap.BeginInit(); formatConvertedBitmap.Source = (BitmapSource)imgSignOut.Source; formatConvertedBitmap.DestinationFormat = PixelFormats.Gray32Float; formatConvertedBitmap.EndInit(); imgSignOut.Source = formatConvertedBitmap; txtSignOut.Foreground = Brushes.Gray; btnSignOut.ToolTip = "您尚未簽到,無法簽退"; btnSignOut.IsEnabled = false; btnSignOut.Visibility = Visibility.Hidden; } else { btnSignOut.Visibility = Visibility.Visible; } } }
public override bool Equals(Object obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } Session recognitionResultsObj = obj as Session; return(UserID.Equals(recognitionResultsObj.UserID) && Start.Equals(recognitionResultsObj.Start) && ExpiresAt.Equals(ExpiresAt) && Status.Equals(Status)); }
public bool Equals(FantasyCriticUser other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(UserID.Equals(other.UserID)); }
protected override bool AuthorizeCore(System.Web.HttpContextBase httpContext) { if (UserID.Equals(Guid.Empty)) { /* not authenticated */ return(false); } else { return(true); } }
private void btnYes_MouseDown(object sender, MouseButtonEventArgs e) { if (StackLines.Count < 1 || txtPLS.Visibility == Visibility.Visible) { if (!PicUrl.Equals("")) { MessageBox.Show("已簽名,欲重新簽名請先按x清除"); } else { MessageBox.Show("請簽名後上傳"); } return; } string text = ""; DataTable dataTable = MSCE.GetDataTable("select AllowIpRange from NowLogin"); if (dataTable.Rows.Count > 0) { text = dataTable.Rows[0]["AllowIpRange"].ToString(); } if (!text.Equals("") && !IpTool.CheckInNowWifi(text)) { string courseOrMeeting_String = Settings.Default.CourseOrMeeting_String; AutoClosingMessageBox.Show(string.Format("您不在{0}室範圍內,無法使用此功能", courseOrMeeting_String.Equals("課程") ? "教" : courseOrMeeting_String)); return; } string path = System.IO.Path.Combine(ClickOnceTool.GetFilePath(), Settings.Default.SignInFolder); path = System.IO.Path.Combine(path, MeetingID, UserID); Directory.CreateDirectory(path); string str = Guid.NewGuid().ToString(); string path2 = str + ".png"; string text2 = System.IO.Path.Combine(path, path2); Application current = Application.Current; CanvasTool.SaveCanvas(current.Windows[0], SignPad, 96, text2); MouseTool.ShowLoading(); if (UserID.Equals("guest")) { UserID_Origin = UserID; UserID = ""; } else if (UserID.Equals("dept")) { UserID_Origin = UserID; UserID = ""; } GetSigninDataUpload.AsyncPOST(MeetingID, UserID, DeptID, text2, new Action <SigninDataUpload>(_003CbtnYes_MouseDown_003Eb__1f)); }
private void InitUI() { DrawingAttributes da = new DrawingAttributes(); da.Width = 7; da.Height = 7; SignPad.DefaultDrawingAttributes = da; // 這裡因為要判斷btnBack.Visibility = Visibility.Visible; // 所以把DB查詢邏輯放到這裡。 DataTable dt = MSCE.GetDataTable("select UserID,UserName,MeetingID from NowLogin"); if (dt.Rows.Count > 0) { if (UserID.Equals("") == true) { FromIndividualSign = true; UserID = dt.Rows[0]["UserID"].ToString(); UserName = dt.Rows[0]["UserName"].ToString(); } else { FromIndividualSign = false; btnBack.Visibility = Visibility.Visible; } MeetingID = dt.Rows[0]["MeetingID"].ToString(); txtName.Text = UserName + " 您好"; } if (PicUrl.Equals("") == false) { txtPLS.Visibility = Visibility.Collapsed; SignPadPanel.Visibility = Visibility.Collapsed; imgSignedPicPanel.Visibility = Visibility.Visible; Task.Factory.StartNew(() => { try { var webClient = new WebClient(); webClient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.Revalidate); var buffer = webClient.DownloadData(PicUrl); var bitmapImage = new BitmapImage(); using (var stream = new MemoryStream(buffer)) { //初始化圖片到記憶體 bitmapImage.BeginInit(); bitmapImage.CacheOption = BitmapCacheOption.OnLoad; bitmapImage.StreamSource = stream; bitmapImage.EndInit(); bitmapImage.Freeze(); } //this.Dispatcher.BeginInvoke((Action)(() => imgSignedPic.Source = bitmapImage)); this.Dispatcher.BeginInvoke((Action)(() => { if (sb != null) { sb.Stop(); } imgSignedPic.Source = bitmapImage; })); } catch (Exception ex) { LogTool.Debug(ex); } }); } if (PaperLess_Emeeting.Properties.Settings.Default.EnableSignOut == true && FromIndividualSign == true) { btnSignOut.Visibility = Visibility.Visible; //沒有簽到過,簽退圖示反灰 if (PicUrl.Equals("") == true) { FormatConvertedBitmap newFormatedBitmapSource = new FormatConvertedBitmap(); // BitmapSource objects like FormatConvertedBitmap can only have their properties // changed within a BeginInit/EndInit block. newFormatedBitmapSource.BeginInit(); // Use the BitmapSource object defined above as the source for this new // BitmapSource (chain the BitmapSource objects together). newFormatedBitmapSource.Source = (BitmapSource)imgSignOut.Source; // Set the new format to Gray32Float (grayscale). newFormatedBitmapSource.DestinationFormat = PixelFormats.Gray32Float; newFormatedBitmapSource.EndInit(); imgSignOut.Source = newFormatedBitmapSource; txtSignOut.Foreground = System.Windows.Media.Brushes.Gray; btnSignOut.ToolTip = "您尚未簽到,無法簽退"; btnSignOut.IsEnabled = false; btnSignOut.Visibility = Visibility.Hidden; } else { btnSignOut.Visibility = Visibility.Visible; } } }
private void btnYes_MouseDown(object sender, MouseButtonEventArgs e) { //if (StackLines.Count < 1 || txtPLS.Visibility == Visibility.Visible) if (SignPad.Strokes.Count < 1 || txtPLS.Visibility == Visibility.Visible) { if (PicUrl.Equals("") == false) { MessageBox.Show("已簽名,欲重新簽名請先按x清除"); return; } else { MessageBox.Show("請簽名後上傳"); return; } } string AllowIpRange = ""; DataTable dt = MSCE.GetDataTable("select AllowIpRange from NowLogin"); if (dt.Rows.Count > 0) { AllowIpRange = dt.Rows[0]["AllowIpRange"].ToString(); } if (PaperLess_Emeeting.Properties.Settings.Default.HasIpRangeMode == true && AllowIpRange.Equals("") == false && IpTool.CheckInNowWifi(AllowIpRange) == false) { string CourseOrMeeting_String = PaperLess_Emeeting.Properties.Settings.Default.CourseOrMeeting_String; AutoClosingMessageBox.Show(string.Format("您不在{0}室範圍內,無法使用此功能", CourseOrMeeting_String.Equals("課程") ? "教" : CourseOrMeeting_String)); return; } // 系統暫存資料夾 //string tempPath = System.IO.Path.GetTempPath(); //Environment.GetEnvironmentVariable("TEMP"); string SignInFolder = System.IO.Path.Combine(ClickOnceTool.GetFilePath(), PaperLess_Emeeting.Properties.Settings.Default.SignInFolder); SignInFolder = System.IO.Path.Combine(SignInFolder, MeetingID, UserID); Directory.CreateDirectory(SignInFolder); string GUID = Guid.NewGuid().ToString(); string tempFileName = GUID + ".png"; string filePath = System.IO.Path.Combine(SignInFolder, tempFileName); Application app = Application.Current; //(1) Canvas CanvasTool.SaveCanvas(app.Windows[0], this.SignPad, 96, filePath); //(2) InkCanvas //double width = SignPad.ActualWidth; //double height = SignPad.ActualHeight; //RenderTargetBitmap bmpCopied = new RenderTargetBitmap((int)Math.Round(width), (int)Math.Round(height), 96, 96, PixelFormats.Default); //DrawingVisual dv = new DrawingVisual(); //using (DrawingContext dc = dv.RenderOpen()) //{ // VisualBrush vb = new VisualBrush(SignPad); // dc.DrawRectangle(vb, null, new Rect(new System.Windows.Point(), new System.Windows.Size(width, height))); //} //bmpCopied.Render(dv); //System.Drawing.Bitmap bitmap; //using (MemoryStream outStream = new MemoryStream()) //{ // // from System.Media.BitmapImage to System.Drawing.Bitmap // BitmapEncoder enc = new BmpBitmapEncoder(); // enc.Frames.Add(BitmapFrame.Create(bmpCopied)); // enc.Save(outStream); // bitmap = new System.Drawing.Bitmap(outStream); //} //EncoderParameter qualityParam =new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 85L); //// Jpeg image codec //ImageCodecInfo jpegCodec = getEncoderInfo("image/jpeg"); //if (jpegCodec == null) // return; //EncoderParameters encoderParams = new EncoderParameters(1); //encoderParams.Param[0] = qualityParam; //Bitmap btm = new Bitmap(bitmap); //bitmap.Dispose(); //btm.Save(filePath, jpegCodec, encoderParams); //btm.Dispose(); //SigninDataUpload sdu = GetSigninDataUpload.POST(MeetingID, "UserID", filePath); MouseTool.ShowLoading(); if (UserID.Equals("guest") == true) { UserID_Origin = UserID; UserID = ""; } else if (UserID.Equals("dept") == true) { UserID_Origin = UserID; UserID = ""; } GetSigninDataUpload.AsyncPOST(MeetingID, UserID, DeptID, filePath, (sdu) => { GetSigninDataUpload_DoAction(sdu); }); }
protected bool Equals(Vote other) { return(VoteID == other.VoteID && UserID.Equals(other.UserID) && WeekId == other.WeekId); }