Click here to Skip to main content
15,898,134 members
Home / Discussions / C#
   

C#

 
GeneralRe: how do I binary search a struct array? Pin
kshet2626-Oct-06 2:33
kshet2626-Oct-06 2:33 
GeneralRe: how do I binary search a struct array? Pin
Guffa26-Oct-06 10:08
Guffa26-Oct-06 10:08 
QuestionInstantiate a HTMLDocument object with the Url or Html stream Pin
Nadia Monalisa25-Oct-06 8:53
Nadia Monalisa25-Oct-06 8:53 
QuestionSafeArray Pin
C++NewBe25-Oct-06 8:49
C++NewBe25-Oct-06 8:49 
AnswerRe: SafeArray Pin
led mike25-Oct-06 10:08
led mike25-Oct-06 10:08 
QuestionAny tool for code clean up ? Pin
Nadia Monalisa25-Oct-06 8:15
Nadia Monalisa25-Oct-06 8:15 
QuestionCompare types in a plugin API Pin
Jost Pedro25-Oct-06 7:09
Jost Pedro25-Oct-06 7:09 
AnswerRe: Compare types in a plugin API Pin
led mike25-Oct-06 8:55
led mike25-Oct-06 8:55 
Here is the factory method I use in a plug-in application I have. You do not appear to have a need for the "ICustomAttributeHandler" aspect of the logic so you should ignore that part.

public static object newInstanceFromCustomAttribute( Assembly assm, System.Type tAttribute, ICustomAttributeHandler handler)
{
    object oret = null;
    Module[] modules = assm.GetModules(false);        // no resource modules needed
    for(int nMod=0; null == oret && nMod<modules.Length; nMod++)
    {
        Type[] types = modules[nMod].GetTypes();
        for(int nType=0; null == oret && nType<types.Length; nType++)
        {
            // get the array of attributes of our target type
            object[] attributes = types[nType].GetCustomAttributes(tAttribute, true);    
            for(int nAttr=0; null == oret && nAttr<attributes.Length; nAttr++)
            {
                // ask the handler if that is what it is looking for
                if( handler.attributeQualifies( attributes[nAttr] as Attribute))
                    oret = assm.CreateInstance( types[nType].FullName);
            }
        }    // for each type
    }    // for each module
    return oret;
}


led mike

GeneralRe: Compare types in a plugin API Pin
Jost Pedro26-Oct-06 0:00
Jost Pedro26-Oct-06 0:00 
Questionhow to deploy my app (vs2005) with crystalreport XI ? Pin
hdv21225-Oct-06 7:07
hdv21225-Oct-06 7:07 
AnswerRe: how to deploy my app (vs2005) with crystalreport XI ? Pin
bearfx25-Oct-06 8:33
bearfx25-Oct-06 8:33 
QuestionHow to debug when I'm developing an outlook add-in using COM? [modified] Pin
OctopusThu25-Oct-06 6:42
OctopusThu25-Oct-06 6:42 
QuestionHowTo make a dll, which can be called by VBA Pin
Ariadne25-Oct-06 6:29
Ariadne25-Oct-06 6:29 
AnswerRe: HowTo make a dll, which can be called by VBA Pin
bearfx25-Oct-06 8:35
bearfx25-Oct-06 8:35 
QuestionArray List Pin
iamnew2C#25-Oct-06 6:15
iamnew2C#25-Oct-06 6:15 
QuestionMS Web Browser control Pin
CoolASL25-Oct-06 5:42
CoolASL25-Oct-06 5:42 
AnswerRe: MS Web Browser control Pin
Judah Gabriel Himango25-Oct-06 5:48
sponsorJudah Gabriel Himango25-Oct-06 5:48 
GeneralRe: MS Web Browser control Pin
CoolASL25-Oct-06 6:13
CoolASL25-Oct-06 6:13 
AnswerRe: MS Web Browser control Pin
Martin2325-Oct-06 6:15
Martin2325-Oct-06 6:15 
QuestionLINQ (C# 3.0) Pin
Alvaro Mendez25-Oct-06 5:02
Alvaro Mendez25-Oct-06 5:02 
AnswerRe: LINQ (C# 3.0) Pin
Judah Gabriel Himango25-Oct-06 5:31
sponsorJudah Gabriel Himango25-Oct-06 5:31 
GeneralRe: LINQ (C# 3.0) Pin
Alvaro Mendez25-Oct-06 6:21
Alvaro Mendez25-Oct-06 6:21 
GeneralRe: LINQ (C# 3.0) Pin
Judah Gabriel Himango25-Oct-06 17:06
sponsorJudah Gabriel Himango25-Oct-06 17:06 
QuestionExcel and Windows Services Pin
gantww25-Oct-06 4:50
gantww25-Oct-06 4:50 
AnswerRe: Excel and Windows Services Pin
seee sharp25-Oct-06 21:48
seee sharp25-Oct-06 21:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.