Click here to Skip to main content
15,900,724 members

Comments by EriBeh (Top 9 by date)

EriBeh 16-Sep-11 6:41am View    
Hello Mehdi,

I changed the service to a local user.
I didn't have access to the queue, changed the queues owner and the permissions now it works with the queue.

But when I try to access my mapped network-drive it says it does not find it, and when I use \\computer\directory it says wrong user or password.

I can open the target computer with windows explorer that works fine and does not ask for a username or password...

Any idea? Thanks a lot!
EriBeh 29-Jul-11 5:56am View    
Some additional info:

I can see my styled scrollbar in the textbox, the bindings are working.

But it is somehow wrong, it appears in the middle and is not scrolling.

So the error is in the Textbox style, somewhere at the "PART"... stuff,
I don't know how to use that exactly.
EriBeh 6-May-11 4:23am View    
I added LinQ namespace then it was okay, I have VS 2010.
But the solution does not work. The SubClasses have the same name and same values, but different namspace. So the SetValue does not work this way but gives an exception.
I mapped the target class manually, value after value. But it would be cool to find a solution how to do that dynamically ;-) Thanks for those suggestions and hints, I learned a lot.
EriBeh 5-May-11 4:31am View    
By the way, this only works for one subclass, not for subclasses with subclasses or structs, right?
EriBeh 5-May-11 2:38am View    
Hello yesotaso,

added your code like this:

void copyDict(object source, object target)
{
Dictionary<string, fieldinfo=""> fifsource = source.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public).ToDictionary(fi => fi.Name);
Dictionary<string, fieldinfo=""> fiftarget = target.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public).ToDictionary(fi => fi.Name);
foreach (KeyValuePair<string, fieldinfo=""> fi in fifsource)
{
if (fiftarget.ContainsKey(fi.Key) && fiftarget[fi.Key].FieldType == fi.Value.FieldType)
fiftarget[fi.Key].SetValue(target, fi.Value.GetValue(source));
}
}

Whas it thought this way? I get an error:
Error 65 'System.Array' does not contain a definition for 'ToDictionary' and no extension method 'ToDictionary' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)

Isn't there a soultion to get my last posted code working? I just need to get the value to the right place there... thanks :-)