|
Hi,
I have a class hierarchy of objects representing typical stuff like employees, users, addresses and so on. I've defined the relationships, created a database and now want to add serialization. The top-most class is an abstract one, kind of like CObject I suppose and my objects may exist on a desktop or mobile platform.
I started to implement custom serialization but the Compact Framework doesn't support it so now I have to write my own stuff. What I'm looking for is some ideas as to how best to implement serialization for my system. Typically, each object will need to be serialized to/from my database and to/from a web service so I'm guessing I just need to write some methods to serialize to XML and/or to a MemoryStream object.
OK, assuming that's the way to implement the actual serialization, how best to define it within my hierarchy? I was thinking of two virtual methods, toXML() and fromXML() defined withing my top-most class and an abstract method called getObjectData() which all descendents *must* implement.
toXML();
toMS();
getObjectData();
Within toXML() and toMS() , there's a call to getObjectData() which gets the object data ready to be formatted into a MemoryStream object or XML.
Each object would also implement a constructor accepting an XML or MemoryStream object but I'm very new to C# so I don't know if there's a way of forcing derived classes to implement these constructors or whether I "should" or not.
What do you think? Any help much appreciated including book/article suggestions
|
|
|
|
|
Hello gurus,
I'd like to know how can I compress and decompress a byte array with the GZipStream class...
I'd like to have similar functions to do the following:
byte[] Compress(byte[] bytesToCompress)
byte[] Decompress(byte[] bytesToDecompress)
Can someone show me how to do that?
Best regards.
Thanks.
There is no spoon.
|
|
|
|
|
|
Where can i find an e-book version of "Practical Cryptography"
Thanks !
|
|
|
|
|
Hi, I'm trying to use the character "&" in a label control but it turns out to be an underscore under the character next to the "&". For example, i set text as "&ABC", it turns out to be "ABC". Any idea on how to use this character to make it appear as it is?
Best Regards.
KiT
|
|
|
|
|
Try "&&ABC".
Strange solution, but it works
|
|
|
|
|
try with double (&&) symbol.it will work
|
|
|
|
|
Also you can set property "UseMnemonic" to "false".
Best regards, Alexey.
|
|
|
|
|
Hi
I am using a UltraWebGrid from Infragistics.
One of the column is a hyperlink. I am able to pass one value through URL but how do i pass value from next coulmn also through URL.
Here is what i have
igtbl:UltraGridColumn AllowResize="Free" AllowUpdate="No" BaseColumnName="NAME" HeaderText="Name"> Header Caption="Name"><rowlayoutcolumninfo originx="5">
Footer><rowlayoutcolumninfo originx="5">
igtbl:UltraGridColumn>
igtbl:TemplatedColumn AllowResize="Free" AllowUpdate="No" BaseColumnName="CITY" DataType="System.Int32" HeaderText="City Name" Type="HyperLink">
CellTemplate>
asp:HyperLink ID="HyperLink1" runat="server" Text="<%# Container.Text %>" NavigateUrl='<%# "Detail.aspx?CITY=" + Container.Text + "&NAME=" ????????????HOW DO I PASS NAME %>' />
CellTemplate>
Header Caption="City"><rowlayoutcolumninfo originx="6">
Footer><rowlayoutcolumninfo originx="6">
igtbl:TemplatedColumn>
How do I pass the Name also through URL
Thanks
-- modified at 4:15 Wednesday 12th April, 2006
|
|
|
|
|
If you want to define a different hyperlink per row you can use the InitializeRow event. Here is an example from the Infragistics website:
<br />
private void UltraWebGrid1_InitializeRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e)<br />
{<br />
e.Row.Cells[0].Value =<br />
"<a href='http://www.infragistics.com/go.aspx?id="<br />
+<br />
e.Row.Cells[0].Value.toString()<br />
+<br />
"' >" + e.Row.Cells[0].Value.toString() + "</a>";<br />
}
Check out here for more info.
Hope that helps!
-- modified at 13:45 Wednesday 12th April, 2006
|
|
|
|
|
Yes.. this is exactly what I want to do but I have templated hyperlink column
inside Ultrawebgrid..
if i don't specify NavigationURL then I don't get the link ...
asp:HyperLink ID="HyperLink1" runat="server" Text="<%# Container.Text %>" NavigateUrl='<%# "Detail.aspx?Name=" + Container.Text + "&City=" ????? How do i get the city name which is is next coulmn %>' />
Thanks
|
|
|
|
|
How to disable fullscreen mode for a maximized form without border ?
This form must fit WorkingArea that is smaller than screen because desktop contains a custom application bar. This application bar hide itself when a form switch in fullscreen mode. But I don't want this app bar hidden when my first form is present.
Loutre Maline
|
|
|
|
|
Set FormBorderStyle property to FormBorderStyle.None
|
|
|
|
|
This property is already set.
When a form has both properties FormBorderStyle.None and FormWindowState.Maximized , the .Net Framework give it fullscreen behaviour (and system launch ABNotify.ABN_FULLSCREENAPP event). But I don't want fullscreen mode.
Loutre Maline
|
|
|
|
|
Try to set size manually without maximize action.
Get resolution from Screen.PrimaryScreen.Bounds.
|
|
|
|
|
This is a solution, but how can I detect working area change (when user move Windows application bar for example) for updating position ?
|
|
|
|
|
Try this code:
<br />
Rectangle rect = Screen.GetWorkingArea(Screen.PrimaryScreen.Bounds);<br />
Best regards, Alexey.
|
|
|
|
|
When application start, setting bounds isn't a problem.
But during application life, how application detect working area changes for updating its bounds ?
Loutre Maline
|
|
|
|
|
I think, that probability of changing size or position of application bar is very low, while user running full-screen application.
Best regards, Alexey.
|
|
|
|
|
yes short problem but me and my friends dont know about it (new users we are)
how we can open and compile VS 2005 projects with VS 2003.
mayb some assembly works.
-- modified at 3:09 Wednesday 12th April, 2006
|
|
|
|
|
and i want to work VS2005 with netFrameWork 1.1-- like this -->>the subject of the old messages about the copiled works..
|
|
|
|
|
Please don't write in bold.
You can use 2.0 code in 1.*
search tjis forum for a solution on how to use VS2005 with 1.1
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
sorry CWIZO.. i corrected the text .. thanks.
|
|
|
|
|
Ooops what I was trying to say before is that you can't use .NET 2.0 code in visual studio 2003. VS2003 just dosen't work with .NET 2.0
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
INPUT :
VC++ dll (abcd.dll) has funtion named DecryptString.
Requirement :
i need to create a dotnet project which uses this function in unmanaged dll.
Steps taken
public class CryptoAPI
{
[DllImport("abcd.dll", EntryPoint="#392")]
public static extern string DecryptString(string key,string text);
}
When i access the function in DOTNET
string EncryptedText = CryptoAPI.DecryptString(Key,PlainText);
It works fine couple of times.Some times it throws up an error
"object reference not set to instance of an object".
Can u please help me on this?
Can u tell me if i call the method - 5 times is it loaded 5 times during the runtime?
or only once when i do it for the first time.
for thendral
|
|
|
|