|
I think what it comes down to is having something that's tool-generated be modified outside of the tool. Anyways, glad you found a solution.
Life, family, faith: Give me a visit.
From my latest post: "What kind of American doesn't want to vote for sunshine and rainbows? One of those ugly conservatives, that's who."
Judah Himango
|
|
|
|
|
John Simmons / outlaw programmer wrote: How do I get around that?
Not sure, I have done that before modifying the web.config. You sure you dont have that file open in a viewer?
|
|
|
|
|
Yeah, it's .Net being retarded. I found a solution involving the Nini library.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
I have a compiled class library/dll (written in C#) and I need to get a property of an object inside it from another project. Unfortunately, the DLL structure (namespaces and type names) is virtually guarenteed to change AFTER my app has been deployed. So I've been trying to use reflection to get to the object required (having read some settings data like namespaces and type names from a db). At the moment I'm tripping up on the use of System.Reflection.Assembly - it works fine when I reflect on the current project, but when I try to read the DLL I have problems - any help would be appreciated! (Pseudo)Code follows:
public void Main()
{
Console.WriteLine(Foo("MyClassLibrary.DLL", "Person", "Name"));
}
public string Foo(string NameOfAssembly, string TypeName, string PropertyName)
{
Assembly assembly = Assembly.Load(NameOfAssembly);
foreach (Type t in a.GetTypes())
{
if (string.Equals(TypeName, t.Name))
{
type = Type.GetType(TypeName, true);
}
}
object currentObject = GetObject();
PropertyInfo propinfo = currentObject.GetType().GetProperty(PropertyName);
return propinfo.GetValue(currentObject, null).ToString();
}
[Note: We are using our own in-house tools for data access, so the above code has some database stuff removed, and for simplicity try-catch blocks are also removed]
Does anybody have any help they can offer on reflecting on a DLL?
Thanks,
Chris
[Update: Corrected a typo]
|
|
|
|
|
Never mind - seems that Assembly.LoadFrom(NameOfAssembly) will do the trick here
Note to self: Check intellisense more carefully!
|
|
|
|
|
c2423 wrote: the DLL structure (namespaces and type names) is virtually guarenteed to change AFTER my app has been deployed
That's a very bad idea, but DLL versioning should help.
|
|
|
|
|
Agreed, but its not my DLL that I'm using. Try as I might the guy writing it won't agree to keep the interface consistant, or even tell me when he makes breaking changes, or comment the code, or ........
|
|
|
|
|
Does anyone know if it's possible to get the Win32 handle to the serial port
used under the hood in System.IO.SerialPort?
The reason I want it is so I'd be able to make changes the DCB struct. I
want to set the fRtsControl to RTS_CONTROL_TOGGLE so the RTS signal will be
reset automatically when the TX buffer is empty.
The other option would be to wait for a "tx buffer empty" event to be
signalled after a call to Write. Something like this:
port.RtsEnable = true;
port.Write(buffer, 0, byteCount);
WaitForTxBufferToBeEmpty(port);
this.port.RtsEnable = false;
...but how do I implement WaitForTxBufferToBeEmpty?
|
|
|
|
|
Can anybody help me out, i want to develop code for chatting in lan. means i will supplies ip adrees to whoem i want to send the msg.
if any body have any idea pls reply
Yogesh Pekhale
pekhaleyogesh@gmail.com
|
|
|
|
|
Hi Yogesh,
Refer to the following links:
http://www.codeproject.com/KB/cs/LanChat.aspx
http://www.codeproject.com/KB/IP/ChatMasala.aspx
I hope this would be helpful.
Vinay
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
|
Hi,
I'd like to create a method that can make an instance of a class just by knowing its type. Something like:
void createInstance(Type formType)
{
ConstructorInfo info = formType.GetConstructor(new System.Type[] {this.GetType()});
FormBase res = info.Invoke( new object[] { this });
return res;
}
I think I missundertood the use of Invoke for ConstructorInfo.
Thanks,
Dirso.
|
|
|
|
|
Activator.CreateInstance()
|
|
|
|
|
|
I'm having trouble serializing my class and someone suggested I dump the xml schema from the Type/Graph to take a look.
I hunted around and couldn't figure out how to do that.
Could someone help me out?
Thanks!
|
|
|
|
|
Hehe, I will answer that!
Open the .NET/VS Command Prompt, and run the following:
xsd /t:MyNamespace.MyType yourdllorexe
|
|
|
|
|
Can you point me out in some directions of how to support drag and drop between my application and windows explorer?
The only article that I found on this was the this one written by Michael Dunn, but it's implemented in C++ and it's not even working with Windows Vista.
This article it's doing exactly what I need, but unfortunately it's not working under windows vista even though I'm running it with administrator rights
modified on Wednesday, June 11, 2008 9:33 AM
|
|
|
|
|
|
Thank you Eslam!
I found that article too but it only supports copy from the console while I am more interested in a mouse drop rather than ctrl c
|
|
|
|
|
razvan_dme wrote: but it only supports copy from the console
What console!!! It's drag and drop.
Eslam Afifi
|
|
|
|
|
Sorry, it was a typo(I meant clipboard). The application you sent me works perfectly under windows xp, but under vista it's not working anymore
|
|
|
|
|
Well, I haven't worked with Vista before so I'll leave it to the experts. Sorry I couldn't help.
Eslam Afifi
|
|
|
|
|
What error(s) are you getting under Vista?
I bet it's something to do with permissions - you may have to add an application manifest file and alter the requested execution level.
Dave
|
|
|
|
|
Hello everyone,
I think convert from Single or Double to Decimal is always fine since Decimal has broader precision and broader range. Why it is mentioned,
"Conversions from Single or Double to Decimal throw an OverflowException if the result of the conversion is not representable as a Decimal."
http://msdn.microsoft.com/en-us/library/system.decimal(VS.80).aspx
thanks in advance,
George
|
|
|
|
|
George_George wrote: I think convert from Single or Double to Decimal is always fine since Decimal has broader precision and broader range.
floating point types will always have a bigger range, but not precision.
|
|
|
|