|
Thanks a lot. that helps much. just anaother question related to the same topic: knowing that I can define the set of types that a set can contains, can I specify the order of types deserialization. For example, I have the classes student and professor that inherit from the class person.
the class persons contains the following set
[xmlarrayitem("Student", typeof(Student)),xmlarrayitem("Professor", typeof(Professor))]
[xmlarray("PersonsSet")]
public Person[] PersonsSet
{
get;set;
}
How can I specify that the professor elements has to be all deserealized before the student elements no matter how they are ordered in the xml document.
Thanks in advance.
|
|
|
|
|
Mehdi_S wrote: How can I specify that the professor elements has to be all deserealized before the student elements no matter how they are ordered in the xml document.
Taking your example; there's a difference in getting an order in the properties and getting an order in the items within the collection. You can change the order of the properties by adding those tags to the Person class. The collection would be serialized using that information.
Implementing ISerializable [^] or even IXmlSerializable [^] would be more appropriate for complexer structures. That way you can control the order of the properties and the data. There's a really nice CodeProject article on IXmlSerializable here[^].
Good luck
I are Troll
|
|
|
|
|
Hi I'm Creating a DLL File "Fr6Customise.dll" and Code is
Imports System
Namespace Fr6Customise
Public Class LoadModule
Public Shared Function ViewModule() As Boolean
Return True
End Function
End Class
End Namespace
----------------------------------------
Now I am using that dll in my project whenever needed...
Dim CAssembly As Assembly = Assembly.LoadFrom(My.Application.Info.DirectoryPath & "\" & "FR6Customise.dll")
Dim scriptType As Type = CAssembly.GetType("Fr6Customise. LoadModule")
Dim mi As MethodInfo = scriptType.GetMethod("ViewModule")
But, when I am using this Code scriptType always return Nothing. There is any error found in this Code.
How Can I Solevd It. Pl, Help me.
Arindam Banerjee
Sr. Software Developer
Rance Computer Pvt Ltd.
Kolkata (India)
|
|
|
|
|
...
Dim scriptType As Type = CAssembly.GetType("Fr6Customise.Fr6Customise.LoadModule")
....
That works for me, it's the fullname of the type
|
|
|
|
|
No, its Return "Nothing"
Can You Just Email me Your Code.My Email ID : webarindam@gmail.com
Arindam Banerjee
Sr. Software Developer
Rance Computer Pvt Ltd.
Kolkata (India)
|
|
|
|
|
Look in your application properties (of Fr6Customize)
The value of your "Root namespace" is the root of the fullname of your Type.
To see all types add the following line :
Dim types() as Type = CAssembly.GetTypes()
Set a breakpoint after this line and add a watch.
BTW just nitpicking, your code
CAssembly.GetType("Fr6Customise. LoadModule") has a space in the name.
no luck mailing my code : "reason: 552-5.7.0 Our system detected an illegal attachment on your message."
modified on Tuesday, January 19, 2010 9:05 AM
|
|
|
|
|
I'm working on an "add-on enabled" application where assemblies are deployed (copied / uploaded) to a server (and a reference added to a database) making the add-on available to the user. To set the standards of the add-on I've created a separate library with the interface definitions that I can even send to 3rd party vendors.
Problem comes when I try to instantiate the uploaded assembly and cast the instance back to my interface definition. My test add-on is 2 dll's, one for the add-on and one for the interface definition which I put together in the same folder, the instance is created correctly and I can get the public attributes with reflection but the instance type is object and cannot be cast to my interface type.
Any ideas? I have played around with different ways to load the assembly file but it does not seem to make a difference...
If I check if the Interface is implemented on the Type it is (assemb.GetTypes().Where(t => t.GetInterface("MyInterface") != null).FirstOrDefault() ), but I suspect that the problem is that its checking by name...
____________________________________________________________
Be brave little warrior, be VERY brave
|
|
|
|
|
This is something similar, perhaps it will give you some ideas. Application Suite Template[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi Mark,
Thanks for the post. I cannot get the code to run (only have VS 2010 B2) installed, but the architecture is quite different to what I'm using. I'm using an interface that I share between 2 different projects, 1 being the application and 1 being the addon. What you are doing with Activator.CreateInstance I have also tried and I experienced to problems described...
I can quite easily get an instance of a class in an assembly, and the instance class will be based on my interface that I shared, yet I cannot cast my instance to the interface...
____________________________________________________________
Be brave little warrior, be VERY brave
|
|
|
|
|
|
Why not take a look into the Managed Extensebility Framework (MEF)? It's very powerful (clickety[^]).
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I looked at MEF and I just couldn't understand the mecahnism. Another chap at my work looked at it and couldn't figure it out either...
I'm confused at a high and a low technical level, but all the examples I get shows you how easy it is, and over the years I have grown petrified of things that looks way easy in an example...
Apart from the link above (which I'll have another look at), do you have some advanced samples that shows the workings?
____________________________________________________________
Be brave little warrior, be VERY brave
|
|
|
|
|
Sacha Barber has an excellent sample here[^].
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I have a problem.I have made a digital dairy compromising of three forms.The first form gives an intro to dairy, the second form contains text boxes of "name","phone number", "email id",etc and the third form re-displays this info in labels and asks user if they want to save data as it is or want to edit it.In case the user clicks edit form two is opened if one chooses save form 1 opens.The problem with me is that my frm displays the last saved information instead of displaying empty text boxes when chosen "new" button from form one.Help me!!!!!!!!!!!!!!
|
|
|
|
|
emma watson wrote: The problem with me is that my frm displays the last saved information instead of displaying empty text boxes when chosen "new" button from form one.
You could clear the values of the different controls in your editForm_Load. How does the form load it's data? Can you paste the code where you load the data, and the code that's behind the "New"-button?
I are Troll
|
|
|
|
|
Hi,
Though i am a non-Technical person.A software developer of my company(Mindfire Solutions) has done an analysis on VB.net.Please visit the following links.
http://www.mindfiresolutions.com/VBNET-104.php[^]VBDOT net.
Cheers,
Eliza
Mindfire: India's Only Company to be both Apple Premier & Microsoft Gold certified.
|
|
|
|
|
Hi All,
I want to develop an 3D Image rendering software using DIRECTX which can perform some 3D Operations.My customer wants the software developed on .Net Framework.
I have experience in coding in MFC in VC6.0.If i develop an application in MFC dialog based application in Visual Studio 2008,will it be built on .Net Framework?
Also,i have done some image processing coding in C++.Basically i have some classes defined in .h and .cpp files which i want to include in the .Net application which i am going to develop.
For the above requirements should i go for VC++.Net(Forms based developed in VS 2008) application or VC++(MFC based developed in VS 2008)?
Please advice.
Thanks ,
Ashwath.
|
|
|
|
|
ashwath1979 wrote: If i develop an application in MFC dialog based application in Visual Studio 2008,will it be built on .Net Framework?
You shouldn't even have to ask this question! Of course MFC is not .NET !!!
You can use your C++ code in .NET by using PInvoke and creating an interop library to your functions.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
What are you suggesting - that the acceptable base level of knowledge is your own? Anyone who knows less is somehow deficient, stupid or both? It's a perfectly legitimate question from someone who does not know the answer. That's why people ask questions - so they can learn from people who know a little more.
Please be a bit more respectful towards those whose knowledge is different to yours.
|
|
|
|
|
Are you the ghost of Christmas past? I think I can understand though, with only two posts in two years I guess it takes you that long to read everything.
We have a voting system here, you may have noticed it, if you find a posting to be offensive or a bad, then vote appropriately. However, I see that no one else has responded or voted in the last seven months so it can be posited that either no one else, particularly the OP, found any offense. Perhaps you more sensitive or are just troll.
I await your response in March, 2011
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Okay, you clearly reserve the right to be as arrogantly dismissive about anyone you please. That's your problem mainly, not mine. I hope the questioner wasn't in the least bit sensitive to your reply.
|
|
|
|
|
I just tried to use StreamResourceInfo to read a zip file, after much struggling I found out that its actually part of System.Windows, and not the System.Windows that gives us dll's or Windows development, the System.Windows that gives us WPF and Silverlight... Now I ask you what does reading a zip file have to do with UI technology...
Same goes for the very popular ObservableCollection<T>, try to find that in a non-UI project...
Is MS in such a hurry with XAML that they are not bothered about putting things where they belong? What will they call the class that can read Zip Files in Class Library projects if they do it? (Does one exist?)
ARGH!
____________________________________________________________
Be brave little warrior, be VERY brave
|
|
|
|
|
Hi All,
I am pretty new in terms of MSBuild, so please dont humilate my naive questions
Can someone plz tell me what's the benefit to use MSBuild and why we need it. we can create a porject in M/S visual studio and then build the project in the M/S visual studio. I dont know why we need this tool(M/S Build)?
Many thanks
|
|
|
|
|
Tasks such as creating installs, updating version numbers, creating escrows, distributing the final packages, etc. can be automated and made easier with what MSBuild (or Nant) provide.
The dev env just does a build.
There are only 10 types of people in this world — those who understand binary, and those who don't. |
|
|
|
|
|
Thanks very much, can you please offer me an example that does all of or some of those tasks?
|
|
|
|