https://anewkindofhuman.com/dozen-places-educate-online-free/
Monday, December 4, 2017
Friday, November 10, 2017
JumpList in WPF application
Reference to JumpList in WPF application
https://blog.codeinside.eu/2015/11/30/working-with-jumplists-in-wpf-apps/
https://msdn.microsoft.com/en-us/library/ff770767.aspx
Creating JumpLists via XAML
Small warning: If you try this on Windows Vista, your app will just crash…
JumpLists are registred per application and the easiest way to create a (static) JumpList is via XAML in the App.xaml:
http://schemas.microsoft.com/winfx/2006/xaml/presentation
Creating JumpLists via Code
The “coding” JumpList API is a bit odd to use, but still easy to understand:
var jt = new JumpTask
{
ApplicationPath = "C:\\Windows\\notepad.exe",
Arguments = "readme.txt",
Title = "Recent Entry for Notepad",
CustomCategory = "Dummy"
};
JumpList.AddToRecentCategory(jt);
var jt2 = new JumpTask
{
ApplicationPath = "C:\\Windows\\notepad.exe",
Arguments = "readme.txt",
Title = "Code Entry for Notepad",
CustomCategory = "Dummy"
};
var currentJumplist = JumpList.GetJumpList(App.Current);
currentJumplist.JumpItems.Add(jt2);
currentJumplist.Apply();
The “Apply()” call is needed, otherwise the new JumpItem will not be added. As you can see, you can create new JumpList entries, add (and I think you could also remove items) from the default recent category. Besides JumpTasks there is JumpPath, which just contains a link.
In the XAML Part I also hooked up some events, so your application can get notified when a user pins something or removes something which you might want to handle.
Wednesday, November 1, 2017
Monday, August 21, 2017
MVC Sample to send current url while redirect to another page
public ActionResult MyNextAction()
{
return Redirect(Request.Referrer);
}
public ActionResult MyFirstAction()
{
return RedirectToAction("MyNextAction",
new { r = Request.Url.ToString() });
}
then:
public ActionResult MyNextAction()
{
return Redirect(Request.QueryString["r"]);
}
{
return Redirect(Request.Referrer);
}
public ActionResult MyFirstAction()
{
return RedirectToAction("MyNextAction",
new { r = Request.Url.ToString() });
}
then:
public ActionResult MyNextAction()
{
return Redirect(Request.QueryString["r"]);
}
Friday, August 18, 2017
jQuery find td data
Simple jQuery Selector to highlight selected table row
and get table data
value
$(SELECTOR_TR).click(function (e) {
var val= $(this).find('td:eq(1)').text();
$(SELECTOR_TR).removeClass(CSS_CLASS_TR_SELECTED );
$(this).addClass(CSS_CLASS_TR_SELECTED);
});
Get selected text from dropdown
$('#SelectOption').find('option:selected').text();
https://stackoverflow.com/questions/4376664/jquery-access-input-hidden-value
and get table data
value
$(SELECTOR_TR).click(function (e) {
var val= $(this).find('td:eq(1)').text();
$(SELECTOR_TR).removeClass(CSS_CLASS_TR_SELECTED );
$(this).addClass(CSS_CLASS_TR_SELECTED);
});
Get selected text from dropdown
$('#SelectOption').find('option:selected').text();
https://stackoverflow.com/questions/4376664/jquery-access-input-hidden-value
You can access hidden fields' values with
val()
, just like you can do on any other input element: type="hidden" id="foo" name="zyx" value="bar" />
alert($('input#foo').val());
alert($('input[name=zyx]').val());
alert($('input[type=hidden]').val());
alert($(':hidden#foo').val());
alert($('input:hidden[name=zyx]').val());
Those all mean the same thing in this example.
Thursday, July 13, 2017
Example for git rebase and git rm
https://git-scm.com/book/en/v2/Git-Branching-Rebasing
$ git checkout experiment
$ git rebase master
https://stackoverflow.com/questions/6313126/how-to-remove-a-directory-from-git-repository
git rm -r --cached myFolder
Friday, April 14, 2017
Common mistake made while using MVC web api
Route not found
Make sure the arguments used in Route and the function parameters are same
Wednesday, April 12, 2017
GIT Visual Studio , Problem while switching from one branch to another branch
Got the error while switching to a branch
Cannot complete the operation because of existing changes to the following 2 files:
But the files are already committed.
The answer in the following SO post helps
http://stackoverflow.com/questions/28907086/vs2013-git-cannot-complete-the-operation-because-of-existing-changes-to-the-f
- Find the offending file in Explorer
- Rename it to remove its extension
- Go back to VS, you'll find the Changes window shows the file with the rename action
- Undo the rename change on that file
This should reset the state of the file and make it forget that there's a change on the file.
Now, you can simply switch or pull or do whatever was being blocked.
Now, you can simply switch or pull or do whatever was being blocked.
Subscribe to:
Posts (Atom)