void Update() { if (isTalking) { if (Input.GetKeyDown(KeyCode.Alpha1)) { HashText hase = DialogueManageSystem.manager.currentOptions[0]; GuiManager.manager.UpdatePlayerBody(hase.content); DialogueManageSystem.manager.ConversateNormal(hase); } if (allOptionsPresent) { if (Input.GetKeyDown(KeyCode.Alpha2)) { HashText hase = DialogueManageSystem.manager.currentOptions[1]; GuiManager.manager.UpdatePlayerBody(hase.content); DialogueManageSystem.manager.ConversateNormal(hase); } if (Input.GetKeyDown(KeyCode.Alpha3)) { HashText hase = DialogueManageSystem.manager.currentOptions[2]; GuiManager.manager.UpdatePlayerBody(hase.content); DialogueManageSystem.manager.ConversateNormal(hase); } if (Input.GetKeyDown(KeyCode.Alpha4)) { GuiManager.manager.UpdatePlayerBody("Bye Bye"); DialogueManageSystem.manager.EndConversation(); } } } }
// Use this for initialization void Start() { introResponse = new HashText(); introResponse.hash = 31; introResponse.content = "Nothing to talk"; //could be extended hashLib = new HashText[7]; for (int i = 0; i < hashLib.Length; i++) { hashLib[i] = new HashText(); } hashLib[0].hash = 0; hashLib[0].content = "See you later"; hashLib[1].hash = 10; hashLib[1].content = "I am Raja"; hashLib[2].hash = 11; hashLib[2].content = "I work under him for a project"; hashLib[3].hash = 12; hashLib[3].content = "He gives me 20,000 rupees a month"; hashLib[4].hash = 14; hashLib[4].content = "The details are secret."; hashLib[5].hash = 15; hashLib[5].content = "It is under completion"; hashLib[6].hash = 16; hashLib[6].content = "It is private . Not to be shown to anyone"; }
private void Start() { endConvo = new HashText(); endConvo.hash = 1; endConvo.content = "Okay!"; hashLib = new HashText[7]; for (int i = 0; i < hashLib.Length; i++) { hashLib[i] = new HashText(); } hashLib[0].hash = 0; hashLib[0].content = "See you later"; hashLib[1].hash = 21; hashLib[1].content = "What is your name?"; hashLib[2].hash = 22; hashLib[2].content = "What do you do here?"; hashLib[3].hash = 23; hashLib[3].content = "What's your salary?"; hashLib[4].hash = 24; hashLib[4].content = "Tell me the details of the project?"; hashLib[5].hash = 25; hashLib[5].content = "Then how is it going on?"; hashLib[6].hash = 26; hashLib[6].content = "Can you show me your project?"; }
public bool Insert(Staff obj, Dictionary <string, object> objAccount) { bool checkName = db.Staffs.Count(x => x.PSID == obj.PSID) > 0 ? true : false; //bool check = db.ApplicationUsers.Count(x => x.Username == user.Username) > 0 ? true : false; if (!checkName) { if (obj.PartnerID == -1) { obj.PartnerID = null; } db.Staffs.InsertOnSubmit(obj); if (objAccount != null) { var staffID = obj.ID; ApplicationUser user = new ApplicationUser(); user.Username = objAccount["Username"].ToString(); user.Password = HashText.GetSHA1HashData(objAccount["Password"].ToString()); user.Phone = obj.Phone; user.Status = 1; user.Locked = false; user.DateCreate = DateTime.Now; //user.StaffID = staffID; db.ApplicationUsers.InsertOnSubmit(user); } db.SubmitChanges(); return(true); } else { return(false); } }
public HashText GetIntroResponse() { HashText h = new HashText(); h.hash = 13; h.content = "Hie ! What can I do for you?"; return(h); }
public void StartNormalConvo() { // get response form Interactable HashText h = dialStore.GetIntroResponse(); GuiManager.manager.UpdateInteractableBody(h.content); currentOptions = playerDialogue.GetResponse(h); GuiManager.manager.UpdatePlayerOptions(currentOptions); }
private void Clear_Click(object sender, EventArgs e) { HashText.Clear(); PlainText.Clear(); CipherText.Clear(); PlainText.Focus(); this.Encryption.Enabled = true; }
public HashText GiveResponse(HashText question) { HashText h = null; if (question.hash == 1) { return(null); } int t = Analyse(question.hash); h = findFromLib(t); return(h); }
public void ConversateNormal(HashText h) { HashText g = dialStore.GiveResponse(h); if (g == null) { EndConversation(); return; } GuiManager.manager.UpdateInteractableBody(g.content); currentOptions = playerDialogue.GetResponse(g); GuiManager.manager.UpdatePlayerOptions(currentOptions); }
public bool UpdatePassword(ApplicationUser user, string newPass) { bool checkUName = db.ApplicationUsers.Count(x => x.Username == user.Username && x.ID != user.ID) > 0 ? true : false; //bool check = db.ApplicationUsers.Count(x => x.Username == user.Username) > 0 ? true : false; if (!checkUName) { ApplicationUser currUser = db.ApplicationUsers.FirstOrDefault(x => x.ID == user.ID); if (currUser != null) { user.Password = HashText.GetSHA1HashData(newPass); currUser.LastUpdate = DateTime.Now; currUser.UpdateBy = Constant.CurrentSessionUser; db.SubmitChanges(); } return(true); } return(false); }
void ReleaseDesignerOutlets() { if (GroupBloodText != null) { GroupBloodText.Dispose(); GroupBloodText = null; } if (HashText != null) { HashText.Dispose(); HashText = null; } if (InfoTitle != null) { InfoTitle.Dispose(); InfoTitle = null; } }
public void HashAlgorithmsMatch(HashAlgorithms enumValue) { string toHash = "`~1234567890-=qwertyuiop[]\\ASDFGHJKL:\"ZXCVBNM<>?ăîșțâ"; HashText hash = new HashText { Algorithm = enumValue, Encoding = new InArgument <Encoding>(ExpressionServices.Convert((env) => System.Text.Encoding.Unicode)) }; Dictionary <string, object> arguments = new Dictionary <string, object>(); arguments.Add(nameof(HashText.Input), toHash); WorkflowInvokerTest invoker = new WorkflowInvokerTest(hash); string activityString = (string)invoker.TestActivity(arguments)[nameof(hash.Result)]; byte[] algorithmBytes = CryptographyHelper.HashData(enumValue, Encoding.Unicode.GetBytes(toHash)); Assert.Equal(activityString, BitConverter.ToString(algorithmBytes).Replace("-", string.Empty)); }
public HashText[] GetResponse(HashText g) { int[] h; h = Analyse(g.hash); if (h.Length == 1) { allOptionsPresent = false; } else { allOptionsPresent = true; } HashText[] responseText = new HashText[h.Length]; for (int i = 0; i < h.Length; i++) { responseText[i] = findFromLib(h[i]); } return(responseText); }
public override void ViewDidLoad() { base.ViewDidLoad(); Platform.ClearBrowserCache(); SubmitButton.Hidden = false; CollectionViewDescription.Font = PointsText.Font = UIFont.FromName("ProximaNova-Regular", SizeConstants.ScreenWidth * 0.035f); ChallengeText.Font = UIFont.FromName("ProximaNova-Regular", SizeConstants.ScreenWidth * 0.065f); TimeText.Font = UIFont.FromName("ProximaNova-Regular", SizeConstants.ScreenWidth * 0.042f); HashTitle.Font = UIFont.FromName("SFProText-Regular", SizeConstants.ScreenWidth * 0.029f); HashText.Font = UIFont.FromName("SFProText-Regular", SizeConstants.ScreenWidth * 0.058f); HashBottomText.Font = UIFont.FromName("SFProText-Regular", SizeConstants.ScreenWidth * 0.03f); HashtagCopiedText.Font = UIFont.FromName("SFProText-Regular", SizeConstants.ScreenWidth * 0.029f); HashText.ShouldReturn = (textField) => { textField.ResignFirstResponder(); return(true); }; tagLongPress = new UILongPressGestureRecognizer(ShowCopiedView); HashText.AddGestureRecognizer(tagLongPress); tagTap = new UITapGestureRecognizer(ShowCopiedView); HashText.AddGestureRecognizer(tagTap); Reset(); ChallengeText.Text = Challenge.Name; TimeText.Text = Challenge.NextEventCountDown; NSString viewportScriptString = (NSString)"var meta = document.createElement('meta'); meta.setAttribute('name', 'viewport'); meta.setAttribute('content', 'width=500'); meta.setAttribute('initial-scale', '1.0'); meta.setAttribute('maximum-scale', '1.0'); meta.setAttribute('minimum-scale', '1.0'); meta.setAttribute('user-scalable', 'no'); document.getElementsByTagName('head')[0].appendChild(meta);"; WebView.Configuration.UserContentController.AddUserScript(new WKUserScript(source: viewportScriptString, injectionTime: WKUserScriptInjectionTime.AtDocumentEnd, isForMainFrameOnly: true)); WebView.ScrollView.ScrollEnabled = false; WebView.ScrollView.Bounces = false; WebView.AllowsBackForwardNavigationGestures = false; Platform.ClearBrowserCache(); }
public bool Insert(ApplicationUser user) { bool checkUName = db.ApplicationUsers.Count(x => x.Username == user.Username) > 0 ? true : false; //bool check = db.ApplicationUsers.Count(x => x.Username == user.Username) > 0 ? true : false; if (!checkUName) { user.Password = HashText.GetSHA1HashData(user.Password); user.DateCreate = DateTime.Now; user.Status = 1; //Status: // 0: Bình thường // 1: Ngưng hoạt động db.ApplicationUsers.InsertOnSubmit(user); db.SubmitChanges(); return(true); } else { return(false); } }
public int CheckLogin(string username, string password) { string hashPass = HashText.GetSHA1HashData(password); ApplicationUser currUser = db.ApplicationUsers.FirstOrDefault(x => x.Username == username && x.Password == hashPass); if (currUser != null) { if (currUser.Locked == true) { return(2); } if (currUser.Status == 1) { return(1); } else { return(0); } } return(-1); }
void ReleaseDesignerOutlets() { if (AspectHeight != null) { AspectHeight.Dispose(); AspectHeight = null; } if (ChallengeImage != null) { ChallengeImage.Dispose(); ChallengeImage = null; } if (ChallengeText != null) { ChallengeText.Dispose(); ChallengeText = null; } if (cnsWebViewHeight != null) { cnsWebViewHeight.Dispose(); cnsWebViewHeight = null; } if (CollectionView != null) { CollectionView.Dispose(); CollectionView = null; } if (CollectionViewDescription != null) { CollectionViewDescription.Dispose(); CollectionViewDescription = null; } if (HashBottomText != null) { HashBottomText.Dispose(); HashBottomText = null; } if (HashtagCopiedText != null) { HashtagCopiedText.Dispose(); HashtagCopiedText = null; } if (HashText != null) { HashText.Dispose(); HashText = null; } if (HashTitle != null) { HashTitle.Dispose(); HashTitle = null; } if (InstaCollectionView != null) { InstaCollectionView.Dispose(); InstaCollectionView = null; } if (InstaCollectionViewAspect != null) { InstaCollectionViewAspect.Dispose(); InstaCollectionViewAspect = null; } if (MainScroll != null) { MainScroll.Dispose(); MainScroll = null; } if (MainSrollBottomConstraint != null) { MainSrollBottomConstraint.Dispose(); MainSrollBottomConstraint = null; } if (PointsImage != null) { PointsImage.Dispose(); PointsImage = null; } if (PointsText != null) { PointsText.Dispose(); PointsText = null; } if (SubmitButton != null) { SubmitButton.Dispose(); SubmitButton = null; } if (TagCopiedView != null) { TagCopiedView.Dispose(); TagCopiedView = null; } if (TimeText != null) { TimeText.Dispose(); TimeText = null; } if (WebView != null) { WebView.Dispose(); WebView = null; } }