|
private static void serialize(Object o, Stream stream)
{
SoapFormatter formatter = new SoapFormatter();
formatter.AssemblyFormat
= System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple;
formatter.Serialize(stream, o);
}
|
|
|
|
|
private void serialize( )
{
Stream stream = File.Open("Thaer.xml",FileMode.Create);
SoapFormatter formatter = new SoapFormatter();
object obj = this.button1;
formatter.AssemblyFormat=System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Full;
try
{
formatter.Serialize(stream, obj);
}
catch { }
}
int this Code The .Net Give Me This Exeption :-
Type 'System.Windows.Forms.Button' in Assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.
I Wount To Serialise The Button As Object And The TextBox
The Serialisation of it Must Have The Status Of It As Visible Or Hiden And The Size And Colore And ...............
Who I Can Do It ?
Thaer
modified on Thursday, August 7, 2008 1:44 AM
|
|
|
|
|
To make a class serializable, put: [Serializable] before the class declaration.
System.Windows.Forms.Button isn't a class you have access to, so this won't work.
You may be able to serialize the button's size, position, text, etc... If you add: [OnDeserializedAttribute()] just before a method, that method will be executed immediately after the object is deserialized.
Thus you can use the size, position, text, color, etc... to create an instance of the button following deserialization.
|
|
|
|
|
From the looks of your previous post, you just need to save a few variables,
not serialize an entire object. Is this the case? Do you know what you need?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mr Mark Salsbery .
But I Wount to Serialise the Button Or the TextBox (All Control In The Windows Application Form)
You can Hellp me ?
Thaer
|
|
|
|
|
You're going to have to implement the serialization yourself.
Custom Serialization[^]
It's up to you to decide what data needs to be serialized so you have enough to
reconstruct an object.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
friends from last couple of days i have a task to create a add-in on outlook
i search a lot and found different good and helping article at last before writing this thread i found i Link where i get all the article listed that i search and much more then that also after that i thought i should share it with u,
http://www.microeye.com/resources/res_tech_vsnet.htm
wasim khan
|
|
|
|
|
Hello everyone,
I am considering whether to implement my services (remote access services) using WCF or Web Services. My questions are,
- Key pros and cons compared with WCF and Web Services?
- I need to have better security control (e.g. some specific services are open for some specific role or user), using WCF or Web Services is better?
- Performance is not key issue. Convenient authentication (means ease to develop and maintain) and authorization is key issue.
Any comments?
thanks in advance,
George
|
|
|
|
|
George, your questions are always inciteful and interesting but you really must learn to do some of your own research rather than just turn to this message board for every last query you have.
|
|
|
|
|
Thanks J4amieC,
I have did study for WCF itself, but I am previously a Web Services developer, I have not found any documents compare them two together, and this is why I have this question.
Any referred documents?
regards,
George
|
|
|
|
|
|
Cool, J4amieC!
I have read some. One more question, if we implement a WCF service, how to write a Web Services client to consume the WCF services? I can not find any results yet from search engine.
regards,
George
|
|
|
|
|
WCF can output to multiple formats. The old style web services use the HttpSimple binding IIRC.
|
|
|
|
|
Thanks leppie,
All the samples and document I found is how to use WCF client and use meta data to consume the WCF service, how to consume the WCF as a web services (i.e. write a web services client to consume the WCF service), do you have any samples or documents?
regards,
George
|
|
|
|
|
Nice try but at this point I'm pretty sure he gets paid by the number of internet forum posts he makes so he will continue to ignore this point as he has the many times I have made it.
led mike
|
|
|
|
|
Thanks led mike,
All the samples and document I found is how to use WCF client and use meta data to consume the WCF service, how to consume the WCF as a web services (i.e. write a web services client to consume the WCF service), do you have any samples or documents?
regards,
George
|
|
|
|
|
Hi All :-
I Wount to Save the Serialisation For Form In .Net C# Windows Application
As the Position of the form in Screen And the Width and Hight for it
and the colore And The Control Status ( Visible Or Hiden ) .......
Who can Hellp me ? How ICan Do It ?
Thanks For Any Boudy Hellp me
Thaer
|
|
|
|
|
How can i perform spelling check on some C# control(like textbox)
Thanx in advance
|
|
|
|
|
Hi,
If you are working with Framework 3.0 or 3.5, Refer to this[^] link.
For Framework 2.0, its better to use the third party component because developing a spelling check function on your own requires dictionary and other components, which seems to be very complex.
I hope this would be helpful.
John Adams
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Thanx John.Actually i m of the same opinion but just want to confirm it.
|
|
|
|
|
Like in word? That´s nice.
That very complex i think. I presume that you most have a database with like +1.000.000 words to compare!!!
My advice for you is try to somehow add in MS Word to your application.
I don´t know how to achieve that but, as you know you can work with excel on visual studio as well.
GoodLuck
nelsonpaixao@yahoo.com.br
|
|
|
|
|
Hi all..
Can anyone tell me about SPSite.....
I am using SPSite on Sharepoint Server..It is working fine...
But i am getting errors while accessing remotely from client...
SPSite whether supports for client pc or only sharepoint server..?????
Plz any suggestions..
thank you
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
Hello
I'm using Query "Select * from [Sheet1$]" in C# form Fetching Data from Excel.
I want casting like " Select cast(ID as varchar(20)) as ID from [Sheet1$] ".
Can we do that in Excel Query string.
Thanks
Syed Shahid Hussain
|
|
|
|
|
Syed Shahid Hussain wrote: I want casting like " Select cast(ID as varchar(20)) as ID from [Sheet1$] ".
Can we do that in Excel Query string.
I give up. Can you?
Have you tried it to see? It would be quicker than posting a message!
Bob
Ashfield Consultants Ltd
|
|
|
|
|
How can i open multiple PDF Documents in crystal report using C#.NET
|
|
|
|