|
I think you may have slightly missed my point. Suppose that you use a third party library in your application and the developers didn't mark their classes as Serializable. Now, you include a reference to one of these classes through a property. This cannot be serialized because the third party class isn't serializable. To get round this, you would mark the member variable as NonSerializable.
Now, to the matter in had. I loaded this class in and successfully serialized it (granted only to XML). I guess that your problem must be elsewhere.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Oh, OK. Yes, I understand that part.
Thanks for trying my class. As for whether your news is good or bad... I'm not sure. I'm starting from scratch with a brand new solution...
|
|
|
|
|
Hi Guys is it possible to do something along the lines of
<br />
for (i=0; i < (namearray.length); i++) { string[] namearray[i] }<br />
I'm wanting to create a number of arrays dynamically depending on how many variables get loaded into my namearray, I would also like the arrays to be called whatever the variable in the array is called.
so for example:
<br />
namearray[1] = Tom namearray[2] = Dick namearray[3] = harry<br />
I would like my arrays then to be called
Tom, Dick and Harry
The namearray variables are loaded from a csv and are therefore dynamic, so thats what the for loops is for and the variables are taken from CSV headers and to make my coding a lot easier I'd like them to be called the same as the CSV headers in the file.
Hope this makes some sense
Anyhelp appreciated,
cheers
Tom
|
|
|
|
|
Hello,
I would dynamicaly create a 'System.Collections.Hashtable' and add a 'System.Collections.Specialized.StringCollection' instance.
As Key you can use the Names you got from the file.
All the best,
Martin
|
|
|
|
|
Just for future reference a guy on another forum came up with the answer,
string[] arrayNames = new string[fieldCount]; // arraySize = headers.Length?
for(int i = 0; i < headers.Length; i++) {
arrayNames[i] = headers[i];
}
This appears to create arrays named with whats in my headers array, and the length of the data in my data arrays.
Cheers
Tom
|
|
|
|
|
|
Tom,
I'm afraid I don't really understand your question, but have you looked at using jagged arrays?
Cheers,
Vikram.
"But nowadays, it means nothing. Features are never frozen, development keeps happening, bugs never get fixed, and documentation is something you might find on wikipedia."
- Marc Clifton on betas. Join the CP group at NationStates. Password: byalmightybob
|
|
|
|
|
I have a Usercontrol with a public property List<int> Links
List<int> Links= new List<int>();
public List<int> LinkLabels
{
get { return Links; }
set { Links = value; }
}
Now when i put it on a dialog and open the properties dialog in design mode i can click the (...) button and it opens up the add items to collection dialog and i can add a few int(s) to the collection but when i click ok and open it up again all entered values are gone
if i set a breakpoint at the set function then the value is empty
any help will be greatly appreciated
-Thanks
|
|
|
|
|
can you explain it more with code?
When You are adding items? in runtime or during the design?
My small attempt...
|
|
|
|
|
during design time through the public properties (in properties tab)
C++ where friends have access to your private members !
|
|
|
|
|
add
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
to the property being exported
C++ where friends have access to your private members !
|
|
|
|
|
hi all,
i want to update my existing windows application using click once,
here i fallowed the necessory steps, but i couldn't control some statements,
i could check wether the application is of clickonce by ApplicationDeployment.IsNetworkDeployed property, but i couldn't able to manage code
i mean i am checking updates manually if its already the higher version i need to desplay in messagebox which i couldn't using the below code...
<b>if (ApplicationDeployment.IsNetworkDeployed)</b> {
ApplicationDeployment CurrentDeploy = ApplicationDeployment.CurrentDeployment;
CurrentDeploy.CheckForUpdateCompleted += OnCheckForUpdateCompleted;
CurrentDeploy.UpdateCompleted += OnUpdateCompleted;
//OnCheckForUpdateCompleted(sender,e);
//OnUpdateCompleted(sender,e);
if (CurrentDeploy.CheckForUpdate())
{
CurrentDeploy.Update();
DialogResult dr = MessageBox.Show("Update Downloaded,Restart the Application", "Application Update", MessageBoxButtons.YesNo);
if (dr == DialogResult.Yes)
{
Application.Restart();
}
}
}
else <b>if(!ApplicationDeployment.IsNetworkDeployed)</b>
{
<b>MessageBox.Show("No Updates are available", "UpDate Info");</b>
}
}
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
Has anyone used this family of controls in anger, esp. the Tree/List widget? I'm especially keen to have multi-column, multi-selection, drag/drop with print/print-preview abilities - and this seems to fit nicely. Anyone got any war stories to share or other products to suggest?
Thx++
Whoops. Here's the URL:
http://www.devexpress.com/Products/NET/WinForms/XtraTreeList/Index.xml
|
|
|
|
|
Does anybody know if it is possible to use generics
in an attribute ?
Example: (what I would like to do)
class MyClass <T>{
[MyAttribute(T == typeof(ClassCase1) ? "Case1" : "Case2")]
private object MyProp{
get{...}
set{...}
}
}
Thanks
May u have a bug free day...
|
|
|
|
|
Unfortunately you can't reference a generic type parameter in an attribute, so you can't use T == in your attribute.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
i have a custom control which has a magnification property. when we change to 'double width' value, it should stretch the font on the control to double width but the height has to remain the same. similarly i have to stretch the font along y axis when 'double height' is selected for magnification. we cannot separately set the height and width of the FONT. Please help me achieve this.
Thanks
Priya
|
|
|
|
|
Hi anyone !
I have some problem with my listview.
I read from database and find 10 items. I add them to listview and listview show 10 items.
So... then I add one item to database and then i read database again, and find 11 items (i checked in debug mode). I add every each to the listview BUT, the listview just shows 10 items. (the one already there).
Whats wrong ???
If i execute in debug mode the problems does not occur. Because it goes slower ?? or what ??
Anyone that have any ideas ?
With Kind Regars
Heino
|
|
|
|
|
henur wrote: then I add one item to database
How are you doing this? Using some other program or manually, using Query Analyzer and the like? Also, are you sure your query is being committed?
Posting the relevant code snippet might be useful.
Cheers,
Vikram.
"But nowadays, it means nothing. Features are never frozen, development keeps happening, bugs never get fixed, and documentation is something you might find on wikipedia."
- Marc Clifton on betas. Join the CP group at NationStates. Password: byalmightybob
|
|
|
|
|
It's done manually. Reading a datareader and adding items by items.
If i execute in debug-mode i see information about every post, even the one that is not added to the listview.
Heino
|
|
|
|
|
Hi.
I'm handling the event on Windows clock change:
public static EventHandler timeChanged = new EventHandler(OnTimeChanged);
Microsoft.Win32.SystemEvents.TimeChanged += timeChanged;
public static void OnTimeChanged(object sender, EventArgs e)
{
// Do something....
}
Problem: I don't know how to get the part of date that has been changed: days, minutes etc.
Does somebody know how to do it?
Thanks.
Vadim G.
|
|
|
|
|
hi there.
i've got a problem. currently i'm developing a .net webservice and i need to access windows network shares from within that webservice. some of the shares are located inside the domain the server is a member of where the webservice runs, some are located on servers which are members of foreign domains where the domain the webservice server belongs to has no security trust, thus it is a foreign domain.
i'm unable to figure out how to parse the credentials to the directory- and/or fileInfo objects when creating them using the uncPath to the share(s). i tried impersonation which works well for accessing shares within the same domain the webservice server belongs to, but not for the domain it does not belong to.
i think the problem is, that the underlaying implementation of the impersonation class i use - advapi32.dll - does not know the domain controler(s) it should use to authenticate the credentials i use for the impersonation.
maybee im wrong with this thinkings...
PLZ, can anyone help me with this problem? its realy urgent, i need to get this working!
thank you very much,
dialsc
|
|
|
|
|
Hello..
i'm beginner in c# and have problems with implementing some things in my project...
i need to draw circle (ellipse) as car and different roads (from couple segments) on some map
and to be able to peek a road and navigate such car on this road and also noise if the car gets out from the road... something like this..
I tried to read some good articles here.. but i missed the main idea of such design and also do i need directx?
Thanks for any help...
Shimon
|
|
|
|
|
Hi,
I'm creating a COM object single dll server in C++, which will be used in managed code, in C#. I'm having a little trouble with types . I need to declare method wich will have one input argument and one output argument, both of string type (in C#). Now I work with arguments :
C++
HRESULT Method([in] unsigned char const* source, [out, retval] unsigned char* output);
which are (in C#) converted to :
byte Method(ref byte source);
1. what kind of declaration I need in C++, so it would be transformed to string Method(string source) (in C#);
2. How to convert that kind to char* (in C++).
thanks
|
|
|
|
|
|
Idea - what I want to do:
<br />
struct AtomicInt<br />
{<br />
Int32 m_value;<br />
public static int operator++(ref AtomicInt ai) { Interlocked.Increment(ai.m_value); });<br />
}<br />
operator ++ has to modify the struct itself, but ref doesn't seem to be allowed for operators. So I either have toi make AtomicInt a class (sucks), or I can't provide a meaningful overload for operator ++ - or am I missing something?
|
|
|
|