Here's how to do it:
for (int i = pageList.Count; i-- > 0; ) { if (itemsToRemoveList.Contains(mainList[i])) mainList.RemoveAt(i); }
for (int i = pageList.Count; i-- > 0; ) { if (itemsToRemoveList.Contains(mainList[i])) mainList.RemoveAt(i); }
Intro: Play around D D Did you ever come close to home? Bm Riding the tide of the silver line, D Maybe dress them up in ribbon and golds, Bm Never fall back into the one you love, D Pick pocket lady with her mind on you, Bm She'll break a million hearts until she makes it through, G D A But I declare a war on you, D A Someday soon D Hiding with the border skies, Bm Lead down ditches on the side of the road, D Be careful you don't look to the sun, Bm Lazy head lions you'll get fed to the wolves, D So rally up the soldiers there's a war to win, Bm If hearts can't be alarmed I can't let em win, G D A But I would give it all for you, D A Someday soon D G Someday soon D A Someday soon D Bury all the silver and gold, Bm We can walk to the top and look down at it all, D What happens when the feelings gone? Bm It's a love angel with the wings cut off, D So the parents tell the children 'That's no way to live' Bm So we capture what we're after left of the rest of them, G D A Antonia Jane will rise again
public static class ObjectExtensions { public static T SelectiveClone(this Object obj, string[] properties) where T: new() { T temp = new T(); PropertyInfo[] propertyInfos = typeof(T).GetProperties(); foreach (PropertyInfo pi in propertyInfos) { if(properties.Contains(pi.Name)) pi.SetValue(temp, pi.GetValue(obj, null), null); } return temp; } }
/* Product is a class with the properties "title", "titleAlias", "subTitle", "description", "price", "stock" and "id" "original" is an existing object of the class Product */ // The following copies all properties except "id" Product product = original.SelectiveClone(new string[] { "title", "titleAlias", "subTitle", "description", "price", "stock" });
<riaData:ControlParameter ParameterName="title" ControlName="filterTextBox" PropertyName="Text" />
<riaControls:DomainDataSource Name="ExampleSource" QueryName="GetExampleQuery" AutoLoad="True"> <riaControls:DomainDataSource.FilterDescriptors> <riaControls:FilterDescriptor PropertyPath="title" Operator="Contains" Value="{Binding Text, ElementName=filterTextBox}"> </riaControls:FilterDescriptor> </riaControls:DomainDataSource.FilterDescriptors> <riaControls:DomainDataSource.DomainContext> <domain:ExampleDataContext /> </riaControls:DomainDataSource.DomainContext> </riaControls:DomainDataSource>
<ListBox x:Name="myListBox" />Now you have to add e few things:
<ListBox Name="myListBox" AllowDrop="True" Drop="myListBox_Drop" DragEnter="myListBox_DragEnter" DragLeave="myListBox_DragLeave" />Lets talk about the "Drop" event for a moment. Drop supplies the event handler with the arguments from DragEventArgs: Take a look at it on MSDN. Here's how I handle the event
private void myListBox_Drop(object sender, DragEventArgs e) { FileInfo[] droppedFiles = e.Data.GetData(DataFormats.FileDrop) as FileInfo[]; for (int i = 0; i < droppedFiles.Length; i++) { this.myListBox.Items.Add(droppedFiles[i].Name); /* you have to access the data in the listbox via droppedFiles[i].OpenRead() things like File.OpenRead(droppedFiles[i].FullName) won't work because of the Silverlight 4 security model */ } e.Handled = true; }Additionally you can use the DragEnter and DragLeave event to alert the user, that dragged files can be dropped on the object - just change the background colour or something like that (a border is quite nice as well).
<div id="microgallery-view"> </div> <div class="microgallery"> <div class="microgallery-element"> <a href="Images/mercury.jpg"><img alt="Planet" src="Images/mercury.jpg" /></a> </div> <div class="microgallery-element"> <a href="Images/venus.gif"><img alt="Planet" src="Images/venus.gif" /></a> </div> <div class="microgallery-element"> <a href="Images/earth.jpg"><img alt="Planet" src="Images/earth.jpg" /></a> </div> <div class="microgallery-element"> <a href="Images/mars.jpg"><img alt="Planet" src="Images/mars.jpg" /></a> </div> <div class="microgallery-element"> <a href="Images/jupiter.jpg"><img alt="Planet" src="Images/jupiter.jpg" /></a> </div> <div class="microgallery-element"> <a href="Images/saturn.jpg"><img alt="Planet" src="Images/saturn.jpg" /></a> </div> <div class="microgallery-element"> <a href="Images/uranus.jpg"><img alt="Planet" src="Images/uranus.jpg" /></a> </div> <div class="microgallery-element"> <a href="Images/neptun.jpg"><img alt="Planet" src="Images/neptun.jpg" /></a> </div> </div>
$('.microgallery-bg').microGallery({ view: 'body' }); $('.microgallery').microGallery({ view: '#microgallery-view', defaultSelected: 2 });
$('.micromodal').microModal({ autoPositioning: true, // set true if you wish to center the modal window (default: true) overlay: { show: true, // set true if you wish to how an overlay (default: true) color: '#fff', // set the colour of the overlay (default: '#fff') opacity: 0.8 // set the opacity of the overlay (default: 0.8) } });
<button class="micromodal target-changecolor">Let's change the background colour!</button> <div id="changecolor" class="dialog"> Do you really want to do this? <br /><br /> <button onclick="$.fn.microModal.dialogs['#changecolor'].close();">No way!</button> <button onclick="$('body').css('background-color', '#fedcba');$.fn.microModal.dialogs['#changecolor'].close();">Sure</button> </div>
<div class="micro"> <a href="#">Title</a> <div>Content</div> </div>
$('.microtabs').microTabs({ selected: 1 // yeah this is the only option - which tab do you want to show on startup? });
.microtabs { margin:20px 20px; max-width:800px;} .microtabs-button { padding: 10px; background-color:#333; color:#fff; text-decoration:none; font-family:Segoe UI, Helvetica, Arial; } .microtabs-button:hover { color:#abcdef; } .microtabs-selected { background-color: #fff; color: #333; border-right:1px solid black; border-top:1px solid black; border-left:1px solid black; } .microtabs-element { background-color:#fff; color:#555; padding:10px; } .microtabs-header { margin-bottom: -1px; } .microtabs-container { border: 1px solid black;
Hey guys, this morning (yeah, beginning 7.00) I tried to implement what seemed to be quite an easy task: Dragging files out of my app onto the desktop or into an open explorer Window.
It’s not quite easy. So let’s start this small tutorial. First (of course) you create an ListView – let’s call it “FileView”.
<ListView x:Name="FileView"
PreviewMouseLeftButtonDown="FileView_PreviewMouseLeftButtonDown"
MouseMove="FileView_MouseMove">
<ListView.View>
<GridView>
<!-- Put in here whatever you need -->
<GridViewColumn Header="Name" CellTemplate="{StaticResource file}" />
</GridView>
</ListView.View>
</ListView>
Now to the code behind the xaml. You might have noticed that I added two events to the ListView. The PreviewMouseLeftButtonDown (the dragging starts) and the MouseMove (the dragging is happening).
private Point start;
private void FileView_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
this.start = e.GetPosition(null);
}
private void FileView_MouseMove(object sender, MouseEventArgs e)
{
Point mpos = e.GetPosition(null);
Vector diff = this.start - mpos;
if (e.LeftButton == MouseButtonState.Pressed &&
Math.Abs(diff.X) > SystemParameters.MinimumHorizontalDragDistance &&
Math.Abs(diff.Y) > SystemParameters.MinimumVerticalDragDistance)
{
if (this.FileView.SelectedItems.Count == 0)
{
return;
}
// right about here you get the file urls of the selected items.
// should be quite easy, if not, ask.
//string[] files = ...;
string dataFormat = DataFormats.FileDrop;
DataObject dataObject = new DataObject(dataFormat, files);
DragDrop.DoDragDrop(this.FileView, dataObject, DragDropEffects.Copy);
}
}
Now that’s that, thanks for reading.
// ============================================================================= // System.Text.StringBuilder // ============================================================================= // Implements a StringBuilder. // Differs from C#! Capacity and Length properties have been removed. // Prepend has been added. var StringBuilder = function(string) { var _str = (string == null) ? '' : string; // Appends a string to the stringbuilders internal string. this.append = function(string) { _str += string; }; // Appends a formatted string to the stringbuilders internal string. this.appendFormat = function(string, array) { for(var i = 0; i < array.length; i++) { string = string.replace('{' + i + '}', array[i]); } _str += string; }; // Inserts a string at a specified position inside a stringbuilders internal string. this.insert = function(string, position) { _str = _str.slice(0, position) + string + _str.slice(position, _str.length); }; // Removes a substring of the stringbuilders internal string. this.remove = function(start, end) { _str = _str.slice(0, start) + _str.slice(end, _str.length); }; // Replaces any substring inside the stringbuilders internal string. // Replaces any substring inside the stringbuilders internal string with ''. this.replace = function(oldValue, newValue) { newValue = (newValue == null) ? '' : newValue; while(_str.indexOf(oldValue) > -1) { _str = _str.replace(oldValue, newValue); } }; // Returns the strinbuilders internal string. this.toString = function() { return _str; }; };
exFAT can be used where the NTFS file system is not a feasible solution, due to data structure overhead, or where the file size or directory restrictions of previous versions of the FAT file system are unacceptable.Ok I want a fs that doesn't have the security features of NTFS and one which has overcome the 4 GB file size limitation of FAT32. Yeah there's a file size limitation in FAT32 - you won't be able to copy a file bigger than 4 GB to your FAT32 harddisk, in other words, you'd have to split HD movies / videos.
sudo mount -t exfat /dev/[device] /home/[user]/Desktop/Mountpoint
// sorting functions // sort numbers asc function sortNumberAsc(a, b) { var sortBy = $.fn.microView.sortedBy; aa = a[sortBy].replace(/[^0-9.,]/, ''); bb = b[sortBy].replace(/[^0-9.,]/, ''); return (aa - bb) };
// sort numbers desc function sortNumberDesc(a, b) { var sortBy = $.fn.microView.sortedBy; aa = a[sortBy].replace(/[^0-9.,]/, ''); bb = b[sortBy].replace(/[^0-9.,]/, ''); return (bb - aa) };
// sort text asc function sortTextAsc(a,b){ var sortBy = $.fn.microView.sortedBy; if(a[sortBy] == b[sortBy]){ if(a[sortBy] == b[sortBy]) return 0; return (a[sortBy] < b[sortBy]) ? -1 : 1; } return (a[sortBy] < b[sortBy]) ? -1 : 1; };
// sort text desc function sortTextDesc(a,b){ var sortBy = $.fn.microView.sortedBy; if(a[sortBy] == b[sortBy]){ if(a[sortBy] == b[sortBy]) return 0; return (a[sortBy] > b[sortBy]) ? -1 : 1; } return (a[sortBy] > b[sortBy]) ? -1 : 1; };
orientation: 'left', backgroundCssClass : 'micromenu-background', hoverCssClass : 'micromenu-hover', hasChildCssClass : 'micromenu-has-child', childCssClass : 'micromenu-child', childWidth : 400, childHeight : 200, showAnimation : function(obj) { obj.show() }, hideAnimation : function(obj) { obj.hide() }