Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I need to provide a feature of assigning shortcut keys to any file menu item or buttons at runtime by a user. I am using Visual Studio 2012. Please suggest the standard method to achieve this.
UPDATE
Storing shortcuts in config file is an option. I am searching for the best regarding
Showing shortcut keys along with menu items
Some other commands too will be included which may or may not be
shown in menu
I am lookiing for standard way to proceed not the code. Is storing in config file the best way, what should I consider if any key is changed by user at runtime other than updating config file. This will be some sort of user specific preferences.
private void AssignKey(ToolStripMenuItem item, string keyName)
{
try
{
Keys key = (Keys)Enum.Parse(typeof(Keys), keyName);
item.ShortcutKeys = key;
}
catch (ArgumentException)
{
MessageBox.Show("Unknown key " + keyName);
}
}
EDIT
Missed the update.
Anywho, just store the shortkeys in a "config" class, that has a Save method and save the it every time the software is closed.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
My company wants an Azure bot to respond to a series of “yes” and “no” answers along a conversational path with three layers. I'm using Visual Studio Community 2019 to edit code and Bot Framework Emulator (V4) to test the bot.
Here's a link to an image of the questions and answers and how the conversational flow should look:
https://cdn1.imggmi.com/uploads/2019/5/21/738797c22a7756a01fdf6786f26eb39b-full.png.
I'm not sure know how to link multiple layers of dialogue together. I've only been able to construct a bot with one layer of dialogue as shown at the URL below:
https://cdn1.imggmi.com/uploads/2019/5/21/99019e8e881d62f56ce449397ca9f191-full.png
I tried using the "SuggestedActionsBot" template, but it seems to need a major rework to make our deliverable possible.
https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/08.suggested-actions
Just for reference, here's an example of how the code for the first layer of dialogue looks:
private static string ProcessInput(string text)
{
const string FirstSequenceResponseYes = "Sure, can you explain the issue? " +
"Do you see error message such as 'Power BI Access Tokens Not Allocated?'";
const string FirstSequenceResponseNo = "Thanks, user. " +
"It's good to interact with you. Have a great day!";
switch (text)
{
case "yes":
{
return $"{FirstSequenceResponseYes}";
}
case "no":
{
return $"{FirstSequenceResponseNo}";
}
default:
{
return "Please select one of the suggested action choices.";
}
}
}
What is the best way to go about writing the code to make this deliverable possible? Are there URLs and resources someone could provide that are directly pertinent to what we're trying to achieve?
I'm not sure I understood your question exactly, as the comment say.
But for navigating layers in the bot, I would encourage you to read this documentation.
With the bot-community solution, you can create a complex dialog with several levels.
Finally, in order to create a dialog that receives only yes and no answers, I would suggest using ConfirmPrompt.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I am making a game where people listen to determine whether something is black or white. I want to store how many times they got it correct and how many times they got it wrong in a database so they can see the old results.
What kind of database (like Sqlite) should I use? How should I save this information and display it later?
You can use BinarySerializtion, XMLSerialization,......
so first create a class:
[Serializable]
public class Result
{
Public int TimesRight {get;set;}
Public int TimesWrong {get;set;}
}
now in your game:
Result result = new Result();
result.TimesRight = x; //value of times right
result.TimesWrong = y; //value of times wrong
Now choose the way you want to save it, here are some references for Binary and XML serialization:
Binary Serialization
XML Serialization
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I need to allow client to add his own language texts for labels which are under resx file. We have created resx file which contain translate text for languages.
Now client wants this feature available to his side. Generally we given option to change his language and by selection we shows label from resx file.
so we need to update this resx file dynamically.
Here is how to add / update a ResX File:
ResXResourceWriter rsxw = new ResXResourceWriter(path);
bool added = false;
if (File.Exists(path))
{
ResXResourceReader reader = new ResXResourceReader(path);
foreach (DictionaryEntry node in reader)
{
if (key == node.Key.ToString())
{
rsxw.AddResource(key, value);
added = true;
}
else rsxw.AddResource(node.Key.ToString(), node.Value);
}
}
if(!added) rsxw.AddResource(key, value);
rsxw.Close();
You should use the resx file as a fallback that is not changeable. To change it clientside is difficult and not a good approach in my opinion. As already suggested, create a database- or XML-based "override" pack. If value x has a definition within this pack, use this. Otherwise use the resx (fallback) value that is provided for value x.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to write some property item to image. Though I could not do it. But I can edit any currently added property. So I want to know is there are any property item I can use for my purpose? Here are some Id I am getting:
Id:271
type 2
Id:272
type:2
Id:274
type:3
Id:282
type:5
Id:283
type:5
Id:296
type:3
Id:306
type:2
....
etc.
My question is can I use any of the currently present property?
Sounds simple i think
<img id="myimage" data-id="data you want to pass"/>
if you want to add attribute from c# then
ddLedger.Attributes.Add('data-id','yourvalue');
So you want to access this property at backend c# then
string aa=myimage.attributes("data-id");
in string aa you will get your data....
and in jquery
$('#myimage').attr('data-id');
Now if you want to add it at run time then like this
$('#myimage').attr('data-id','your id added');
Demo
Check this url for more details
https://stackoverflow.com/a/1735239/2630817
I hope this will help you....:)
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am building a system where users are logging in to my application, which is working.and i need to display the logging user name in another form with a label
How can i do it?
thanks in advance !
logging user name in another form with a label How can i do it
You will be needing it on multiple forms so the best solution is to keep it in a common class and read from there. Like
public static class CommonClass
{
public String LoginName {get;set;}
}
then from your login form you can call it to set the value like
CommonClass.LoginName = "LoginName";
then you can use it anywhere you want
label1.Text = CommonClass.LoginName