|
Seen it done once or twice. 
|
|
|
|
|
Richard MacCutchan wrote: Try calling a girl "hen" in Glasgow.
Eh? They wouldn't blink an eye, it's part of the common vernacular.
|
|
|
|
|
Well it was in the days when I was hanging round the docks up there. But these days it is taken as an invitation for a punch in the mouth ... or some softer part of a man's body.
|
|
|
|
|
As a Glaswegian mahsel we'll just have to agree to disagree on that one 
|
|
|
|
|
Interpreting a word from one language in a different language may be fun for entertainment purposes, but that's about all. Except possibly in marketing. When Honda Fitta was to be sold in Scandianvian markets, it was renamed Honda Jazz. "Fitte" means "c**t" in Scandinavian languages.
For a more direct comment: In Norwegian, bird names for girls are certainly not always derogatory. A common term for a sexy young girl is "rype", according to Wikipedia the English name is "lagopus". Not even metooers will come after you for referring to a girl as a "rype". And, isn't "chick" a short form of "chicken"?
It shall be noted that if "hen" were of English origin, and you tried to translate that to Norwegian, to "høne", you should not use that term to refer to a girl: Besides being a bird, it is used as a slang term for the female parts (not the entire girl). So it would be like calling a girl a c**t. While we are at it: Another slang term for the same is "mus" (English: mouse). When you put your hand on that pointing device, you may think we had found another term for it in Norwegian. We did not. So you can imagine what some people jokingly call the scroll wheel.
|
|
|
|
|
In Scotland "hen" is just a slang word for a female, it isn't derogatory (though it is slightly working-class so still frowned on by some) which is why no-one would be offended if you said it.
|
|
|
|
|
i am a women
thanks 4 paying attention to that :P
|
|
|
|
|
Win 10, C#:
wmic calls give me the "drive type" as a small integer, a System.IO.drivetype value, running from 0 to 6. All standard disks are drive type 3, "Fixed" (or possibly type 4, "Network").
Is there any general way to distinguish between flash and magnetic "Fixed" disks? I know that I could check the manfacturer's id against a huge table identifying all the disks of all manufacturers ... There obviously is a simpler, more general way: Windows handles flash disks differently from magnetic disks. So how does Windows distinguish - and how can I do the same?
Yes, I could try to do some accesses and decide based on timing. I do not consider that a clean solution. There must be a better one, but which?
|
|
|
|
|
Yes, you can get it from the ManagementScope:
ManagementScope scope = new ManagementScope(@"\\.\root\microsoft\windows\storage");
using (ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM MSFT_PhysicalDisk"))
{
string type = "";
scope.Connect();
searcher.Scope = scope;
foreach (ManagementObject queryObj in searcher.Get())
{
switch (Convert.ToInt16(queryObj["MediaType"]))
{
case 1:
type = "Unspecified";
break;
case 3:
type = "HDD";
break;
case 4:
type = "SSD";
break;
case 5:
type = "SCM";
break;
default:
type = "Unspecified";
break;
}
Console.WriteLine($"{queryObj.Path}:{type}");
}
}
I didn't write that code, and it's several years old, so I no longer remember where I got it ... but it works.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Thanks a lot. Foun other interesting filelds there as well, e.g. bus type.
(What I need the info for is to give a rough estimate of the expected time to complete a set of file operations before they are actually performed. Both disk technology and bus type are essential for getting good estimates.)
|
|
|
|
|
You're welcome!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I want to display data in a DataGridView and I would like filter the shown rows during runtime. After a lot of googling I came to the conclusion that the best approach would be to place my data in a DataTable and then bind this to my DataGridView. I have done this and I read on e.g. DataView RowFilter Syntax [C#][^] that there are several pre-defined filters available. However, I want to write to my own filter delegate, that returns true or false depending on whether the row should be shown or not. Is this not possible to do?
|
|
|
|
|
|
In the link (DataTable.Select Method (System.Data) | Microsoft Docs[^]) I can only find these prototypes:
Select()
Select(String)
Select(String, String)
Select(String, String, DataViewRowState) How can I supply a delegate using any of those methods?
I guess a workaround would be to create a hidden column named ShowThisRow and run through it with a for-loop and set the value to either true or false and then apply the standard string expression filters on that column. But it doesn't feels like it's the right way to do it, there must be a better solution to this (probably using a different class than DataTable to hold the data).
|
|
|
|
|
When I was googling I came across this video Created by Camtasia Studio 3[^] and 6 minutes into to it the programmer adds a delegate that would fit my needs perfectly. But I guess I must have misunderstood something, I thought this was included directly in .NET without writing extra code.
|
|
|
|
|
That's using a custom class which adds support for filtering with a delegate:
BindingListView[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I think it seems really great, but I don't seem to able to add rows after the DataGridView has been initialized. Nothing happened when I added an object to my source List<> and BindingListView does not have an Add-method. It has a AddNew-method, but that bring up a file browser dialog!?!?
|
|
|
|
|
As far as I can see, there's nothing in that library which would show a file browser dialog. You'll need to debug your code to see what's happening.
From what I can see, if you want it to reflect changes made to the underlying list, you'll need to pass in a BindingList<T>[^] instead of a List<T> .
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you, that worked great!
|
|
|
|
|
You can pass in a row filter to the DataView constructor, but it has to be a string using the Expression Syntax[^]; you can't pass in a custom delegate.
The BindingSource has a Filter property[^], but again it's a string using the same syntax.
In WPF, you can supply a filter delegate to the ICollectionView . But that's not much help if you're using Windows Forms.
You could obviously select the filtered rows using LINQ, and even use the CopyToDataTable extension method to create a new DataTable from the filtered rows. But then you'd have to change the data source every time the filter changed, and you'd lose the connection to the original rows.
I don't think there's a good answer for this.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I want to display a number of files (=the path and file name) in a table (DataGridView or similar). However, I do not have all the files in a single List (or array), instead I have a List of ParentClass objects that each contains a list of ChildClass objects and then finally each ChildClass object contains a List of files. Can I show these files in a table, preferrably using BindingSource, or it is impossible since not all the files are not in a single List?
|
|
|
|
|
It's not impossible, but a single control only has one BindingSource, so you can't just "set it and go" - you will have to create your table manually, and add each row yourself. You can then use the table as a BindingSource to display it all together.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
What are the benefits of using BindingSource to display the data? Would it, for example, enable me to use the filter functionality of BindingSource? Does this approach mean I basically first construct an array with all the files and then bind that array to the table? If so, how can I go from a cell (row number and column number) to the parent and child objects?
modified 22-May-20 3:23am.
|
|
|
|
|
I have seen some examples on the Internet where there are expandable/collapsible rows in the DataGridView. Maybe such an approach would suit my needs better. Could I then use the BindingSource?
|
|
|
|
|