Posts

Showing posts from November, 2018

Donate

Typography.Fraction and Typography.Capitals Not Working In WPF

I've been reading a post on working with Typography.Fraction and Typography.Capitals Enum on TextBlock controls and cannot get it to work as expected. After reading the Microsoft Docs, the solution was to set the FontFamily of the control to Palatino Linotype. <TextBlock Grid.Row= "0" FontSize= "32" FontFamily= "Palatino Linotype" Typography.DiscretionaryLigatures= "True" Typography.ContextualLigatures= "True" Typography.StandardLigatures= "True" > Quite effective find </TextBlock> <TextBlock Grid.Row= "1" FontSize= "32" FontFamily= "Palatino Linotype" Typography.Capitals= "AllSmallCaps" > Hello, World </TextBlock> <TextBlock Grid.Row= "2" FontSize= "32"

Collapse Or Expand A jsTree Node Programmatically

Good day all! Here's a snippet to collapse or exand a jstree node programmatically on page load based on the node id. The code below will collapse if node id is '45' while other nodes remain open. $( '#TreeRoles' ).bind( 'ready.jstree' , function (e, data) { var $tree = $( this ); $($tree.jstree().get_json($tree, { flat: true })).each( function (index, value) { var node = $tree.jstree().get_node( this .id); if (node.id === "45" ) { $tree.jstree().close_node({ "id" : node.id }); } else { $tree.jstree().open_node({ "id" : node.id }); } }); });

How To Disable Cascade Down Selection Of jsTree Child Nodes On Page Load

Hello, I'm currently working on a JavaScript Library jsTree that mimics the behavior and UI of a TreeView control in .NET. One of the issue that's bothering me was to disable the cascade down selection of jsTree Child Nodes On page load if a parent node is selected. The solution is to set the three_state attribute to false and cascade to empty or 'up as presented in the code below. $( '#TreeRoles' ).jstree({ 'checkbox' : { keep_selected_style: false , three_state: false , cascade: 'up' }, 'plugins' : [ "defaults" , "checkbox" ] });

How To Calculate Due Days Excluding Weekends In C#.NET

Here's a function that will calculate the number of days excluding weekends. The parameters passed are the priority which contains number of days and the current date. Sample priorities are 'High[1 day]', 'Average [2 days]' and 'Low [5 days]'. The function then uses Regex to extract the whole numbers from the priority string to be used for incrementing the number of days. public DateTime RecalculateDueDate( string priority, DateTime Today) { int days; int count; DateTime dueDate; count = 0; dueDate = Today; days = int .Parse(Regex.Replace(priority, "[^0-9]" , "" )); while (count < days) { dueDate = dueDate.AddDays(1); if (( int )dueDate.DayOfWeek != 0 && ( int )dueDate.DayOfWeek != 6) count++; } return dueDate; } Source Code: How To Calculate Due Days Excluding Weekends In C#.NET

Donate