How to get result from LaunchUriAsync(Uri) - c#

I'm use the following function to prompt the user to rate my app:
Launcher.LauLauncher.LaunchUriAsync(
new Uri("ms-windows-store:reviewapp?appid=" + APP_ID))
I want to check if user click on the "Cancel" button in page rating.
How can I check if the user clicks on the "Cancel" button?

Basically you're asking whether it's possible to determine whether the user actually left a rating/review when you invoke the Store URI. Unfortunately, this isn't possible at present, but it is a frequently requested capability.

Related

How to achieve AlarmApplicationManager AlarmAccessStatus as AllowedWithWakeupCapability?

The AlarmApplicationManager provides a method RequestAccessAsync() to request permission from the user to be set as an alarm app. This seems to generate a dialog with Yes and No buttons. If the user taps on No, the value returned is Denied and when user taps Yes , the value seems to be AllowedWithoutWakeupCapability. But this link explains that it can return 4 values including AllowedWithWakeupCapability. How can I achieve AllowedWithWakeupCapability so that the device can wake up from sleep mode when alarm time is reached?

hide some button in asp.net 4.0

I want to ask how can I hide some button for different users? For example, an admin can access all buttons, but a regular member cannot access some buttons (e.g. add new user button).
Set the Visible property to true or false depending on your condition (check user),to hide or show.
if(someConditionExpressionHere)
{
btnSave.Visible=true;
}
else
{
btnSave.Visible=false;
}
Assuming btnSave is the Id of the button you want to hide/ show. You should udpdate the someConditionExpressionHere with a check to see whether the user is admin or normal user.

Difference between "No" and "Cancel" in MessageBoxButtons

I was using a MessageBox to show a confirmation message when the user goes to delete an item and initially used MessageBoxButtons.YesNoCancel. Later I changed it to YesNo instead because a user pointed out that there was no real difference in "No" and "Cancel" in this case. My question is...what is the difference? Is there ever a reason to use YesNoCancel instead of YesNo?
In your case there is no difference as your question results in just one action and then finishes.
In standard usage, the Yes No Cancel usually asks a question, Yes or No will chose a different action and then proceed to do yet another action (like quitting a form), Cancel will abandon all actions.
For example: quitting Word, do you wish to save? "Yes, No, Cancel". Yes and No will continue to quit with or without saving, cancel will not save or quit.
Whatever you do, make sure Cancel does what the user expects most - I forever spam cancel if bombarded with message boxes when I have got to focus on something else. If I cancel something I don't want to lose a lot of work because I didn't have time to stop and handle it properly.
Users abuse cancel :-)
Sure there could be. For example, if there is a save dialog and you enter a filename that already exists, the dialog could ask you if you want to overwrite the file.
Yes would mean overwrite the file. No might mean append a "(1)" at the end of the file name, or prompt for a different file name. Cancel might mean don't save after-all.
You should note that Yes, No, and Cancel are all different enums and do not have the same value, so you can treat them differently.
REMEMBER TO HANDLE CANCEL ANYWAY because if the user clicks the x button in the top right corner of your dialog screen, the result of ShowDialog() is DialogResult.Cancel!
Here's an example of when YesNoCancel would be appropriate:
"Would you like to save your changes before quitting?"
Yes - Save and quit
No - Don't save and quit
Cancel - I pressed the button on accident, don't quit.
Im sure its easy enough to come up with a scenario where there would be a symantic difference between "No" as a response and "Cancel". Traditionally "Cancel" should return the program to its state before starting the current series of operations. "No" certainly doesnt have this same rule.
Example:
"Do you wish to delete file 4 of 10?"
Yes: Delete the file
No: Dont delete the file, move on to file 5 of 10
Cancel: Exit this operation and return to having not deleted any files.
I guess "Cancel" is used to abort the whole operation. If you are dealing with a huge procedure, for example, moving a set of files from one directory to another, you may want to ask something to the user about a specific file - for instance, to confirm if the user really wants to move a protected file. If the user presses "No", you ignore that item and continue the action. If the user presses "Cancel", you abort the whole action (and, maybe, rollback the previous action).
Of course, for a small procedure or a simple situation, "Cancel" and "No" have no difference.
Here's an example:
Say you are exiting an application with an unsaved file, like a word processor.
There is a confirmation when exiting that says: "Your file has changes that haven't been saved. Would you like to save them?"
In this case:
Yes = save the file and exit
No = exit and lose the changes
Cancel = abort the exit and go back to the application

Show only one instance of messagebox.show in c#

I have a created a custom keyboard shortcut for my application,
when the user press combination keys of CTRL + ALT + Q, i show
a messagebox "Are you sure you want to log out ?" Then if clicked
YES, i log out of the application.
Problem :
I want to make sure that, only once instance of message box shows.
No matter how many times the user presses the shortcut.
currently it shows multiple message box, on pressing multiple
shortcuts.
How to overcome this ?
From MSDN
A message box is a modal dialog box,
which means no input (keyboard or
mouse click) can occur except to
objects on the modal form. The program
must hide or close a modal form
(typically in response to some user
action) before input to another form
can occur.
File a bug on connect.microsoft.com !
Taking ck's comment into consideration...If you are showing a custom dialog (form) then you need to invoke the form using Form.ShowDialog() and not Show().
A quick and dirty way would be to have a class level boolean variable that tracks when the user is trying to exit. If they are, it's set to true, and your routine to display the dialog box can check this flag, then return without doing anything.
Seems like Singleton Pattern is your option.
I think you can create your own form and use the mymessageboxform.show() method, and check its dialogue result.
You'll want to make your application single instance so it can only be started once.
Single Instance App

CreateUserWizard and ContinueButton control

1)
A) One of the CreateUserWizard’s optional controls is also ContinueButton control. This control raises ContinueButtonClick event ( if CommandName is set to Continue ), but what is the purpose of this event? Thus, when should ContinueButton control be used?
B) CreatingUser event is raised by clicking on CreateUserWizardstep’s CreateUser button. I assume clicking on CreateUser also raises NextButtonClick event?
thanx
Regarding your (A) question. Here is the sample scenario: Let's say before you create a user, you need to validate whether a particular user id or a particular email address has been taken before or registered before in the database.
So in the first phase, you can ask the new user to insert his/her intended user id ,and email address, and then you can perform validation to check whether it's exist or not in the database. If it's exist, you can display an error message accordingly, and if it's not exist, you can move on to the next phase/wizard, to obtain more details before creating the user in the database.
So for the conclusion, the "Next" button is used to navigate between steps in the creating user wizard steps.
Regarding your (B) question.
According to the NextButtonClickEvent documentation, this event is only triggered when "next" button is called.
If i am not mistaken, at the last phase of the wizard steps, there will only be "Create User" button and not "Next", since that phase is the last step in the wizard steps.
Regards,
hadi

Categories

Resources