|
Actually this type of problem occur due to .net framework missing on the Client System.
to run .net application it required its perquisites. It runs on higher version of XP because .net framework resides implicitly which is not in XP.
so be confirm about it or give us more details what exception is generating while running your application on XP.
|
|
|
|
|
which exception it is throwing?
|
|
|
|
|
Is it possible to use LINQ on an un-typed IList collection? Specifically I'm interested in ListView.SelectedItems. I want to remove every item except item "i".
Not sure how that would work since if I don't know the type, how would I run the query? Although, I'd really only be comparing object o.
|
|
|
|
|
It is not untyped, ListView.SelectedItems returns a collection of ListViewItem(s).
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote:
It is not untyped, ListView.SelectedItems returns a collection of
ListViewItem(s).
----
You are mistaken sir . ListView.SelectedItems most certainly does NOT return ListViewItems (unless you are binding to stock ListViewItems). It returns whatever type you are binding with.
If my ItemsSource is a ObservableCollection<Widget>, SelectedItems returns a collection of Widgets, not ListViewItems.
The definition of ListView.SelectedItems is:
[BindableAttribute(true)]
public IList SelectedItems { get; }
As you can see, un-typed .
Also, when I look in the debugger, SelectedItems is actually a:
- SelectedItems Count = 1 System.Collections.IList {System.Windows.Controls.SelectedItemCollection}
System.Windows.Controls.SelectedItemCollection is a private class.
Naturally, this fails:
IList<ListViewItem> selectedItems = SelectedItems as IList<ListViewItem>;
because it ain't that type . Unless you meant something else.
But regardless, as I look in the debugger, <whatever you want to say SelectedItems returned>[0] is NOT a ListViewItem, its a Widget.
My issue is that I don't know what type it is, so I need to do a RemoveAllExceptThis as an object.
|
|
|
|
|
I stand corrected. I was thinking of something else
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I don't think so, not directly at least, the standard LINQ operators work on IEnumerable<T> , whereas ListView.SelectedListViewItemCollection only implements IEnumerable . Could be wrong though!
|
|
|
|
|
Yeah, thats what it seems like... Oh well. Thanks anyways.
|
|
|
|
|
It shouldn't be too hard to create your own specialized wrapper version of the collection, perhaps with an explicit conversion operator, that implements IEnumerable<T>
|
|
|
|
|
Meh... I just gave up on the LINQ idea and used a regular loop. Much easier .
|
|
|
|
|
It often is!
For the sake of the thread... this could do with some more work, but using a generic ListViewItem class and the Cast method of Linq, something like this works.
public class ListViewItem<T> : ListViewItem
{
private T data;
public T Data
{
get { return data; }
set { data = value; }
}
public static IEnumerable<ListViewItem<T>> GetListViewSelectedItems(ListView listView)
{
return listView.SelectedItems.Cast<ListViewItem<T>>();
}
}
ListViewItem<string> itemA = new ListViewItem<string>();
itemA.Data = "a";
itemA.Text = "A";
ListViewItem<string> itemB = new ListViewItem<string>();
itemB.Data = "b";
itemB.Text = "B";
listView.Items.Add(itemA);
listView.Items.Add(itemB);
IEnumerable<ListViewItem<string>> selectedItems =
ListViewItem<string>.GetListViewSelectedItems(listView);
|
|
|
|
|
Hah... nice. Well, I gave you a 5 for the effort. I figured it could be done someway, but thats waaaay overkill for what I was trying to do . Thanks though.
|
|
|
|
|
i have downloaded your project mp3 player.
it works great. i want to develop vcd cutter in your mp3 player. kindly help me from where i do start. waiting for the reply.
thanks
|
|
|
|
|
You start by contacting the person who wrote the project, there is a comment section at the bottom. This is a general C# forum, we have no idea which project you downloaded.
|
|
|
|
|
you should go there from where you have download project and then ask question by using New Message at the Comment and Discussions.
take a look at the bottom you will find it easily.
|
|
|
|
|
HI,
I want to know that how to count the number of messages in sim memory and how to get the index of last message stored in memory using c#.I dont have any idea how to do this. I am using At command for "AT+CMGR=index" for reading sms. But i dont know how to get the index number of last message stored in memory.
Thanks in advance.
Regards,
Aeman
modified on Saturday, April 2, 2011 9:23 AM
|
|
|
|
|
In application, Ajax response is large size of string(around 1 mb file read and thas data return to Ajax request ). we want reduced that response data so i planned to compress the data after getting response decompress and show it to browser ...
Compress and decompress is possible to do... want to use any third party files...
sever side C# and client using jquery..
Thanks
|
|
|
|
|
Why aren't you asking this in the web development forum?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Why do you keep asking the same question?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
App-domain, According to my understanding is, like in the presentation layer, I am giving memory to at dll at run-time, on completion of operation, this is segregated from the presentation layer ?
Please correct if there is any mistake.
modified on Thursday, March 31, 2011 7:13 AM
|
|
|
|
|
Hmm. Slightly confused by what you're saying. These are totally different things.
Your presentation layer is typically your GUI or other type of user-interface.
An AppDomain is conceptually like a mini-process (Window's process) that can be hosted with others in a single Process, for the benefit of performance/scalability etc. whilst providing some isolation between other domains.
Regards,
Rob Philpott.
|
|
|
|
|
Hello,
I'm building a plugin system for a hardware communicator system.
So a plugin is actually a device communicator and the core program has many plugins that communicate with devices and write something to the database.
Now, I have solved many things, I have made a DevicePlugin interface and have dynamically loaded and instantiated the plugins, and it works. The only thing that is bothering me is plugin crashes, for some reasons a plugin can sometimes crash (throw an unexpected exception) and a single plugin can crash my entire system.
So my question is is there some way to put the entire plugin assembly intoa try catch so when plugin crashes the core system remains intact.
Any help greatly appreciated.
Thanks!
|
|
|
|
|
Load each plugin into a separate AppDomain and set the AppDomain's UnhandledException handler.
Also, unless plugins are starting threads that cause crashes, you can simply wrap a try/catch around the point where you call into the plugin. But if they're talking to devices they probably do.
|
|
|
|
|
Thank you I will try that.
|
|
|
|
|
To second what Bob says, AppDomains are great for plug-in architectures. As well as providing robust protection of the process if something goes wrong, you can also unload them and that's the only way to 'unplug' a plug-in (craziness aside).
Regards,
Rob Philpott.
|
|
|
|