Click here to Skip to main content
15,885,891 members
Home / Discussions / C#
   

C#

 
AnswerRe: (c#) if (label1.Text < label2.Text); ??? Pin
OriginalGriff7-Feb-16 6:15
mveOriginalGriff7-Feb-16 6:15 
GeneralRe: (c#) if (label1.Text < label2.Text); ??? Pin
Member 104109727-Feb-16 7:08
Member 104109727-Feb-16 7:08 
AnswerRe: (c#) if (label1.Text < label2.Text); ??? Pin
Richard MacCutchan7-Feb-16 6:20
mveRichard MacCutchan7-Feb-16 6:20 
Questiontableadapter updating! Pin
Isawyouoo6-Feb-16 14:42
Isawyouoo6-Feb-16 14:42 
AnswerRe: tableadapter updating! Pin
Dave Kreskowiak6-Feb-16 16:40
mveDave Kreskowiak6-Feb-16 16:40 
GeneralRe: tableadapter updating! Pin
Isawyouoo8-Feb-16 11:33
Isawyouoo8-Feb-16 11:33 
GeneralRe: tableadapter updating! Pin
Dave Kreskowiak8-Feb-16 16:41
mveDave Kreskowiak8-Feb-16 16:41 
Questionhow can i get this to work in c# Pin
elfenliedtopfan56-Feb-16 13:52
elfenliedtopfan56-Feb-16 13:52 
how would i go about converting this following code to c# my friend sent it to me but its in c++ and i have no idea what to do with it as i code in c# code

C#
namespace Goat
{
 
    struct IBaseWeapon
    {
        virtual ~IBaseWeapon() {}
 
        virtual string GetName(void) = 0;
        virtual bool AddToCsv(string& strOut) = 0;
    };
 
    class Kap40 : public IBaseWeapon
    {
    public:
        Kap40() = default;
 
         virtual string GetName(void)
         {
                return "kap40";
         }
         virtual bool AddToCsv(string& strOut)
         {
                strOut += "xmodel, kap40_viewmodel\n";
                strOut += "xmodel, kap40_worldmodel\n";
                return true;
         }
    };
 
    class Ak47 : public IBaseWeapon
    {
    public:
        Ak47() = default;
 
         virtual string GetName(void)
         {
                return "ak47";
         }
         virtual bool AddToCsv(string& strOut)
         {
                strOut += "xmodel, ak47_viewmodel\n";
                strOut += "xmodel, ak47_worldmodel\n";
                return true;
         }
    };
 
    class WeaponsMng
    {
    public:
            WeaponsMng() = default;
 
            void AddWeapon(IBaseWeapon* pWeapon)
            {
                    // check if already added etc..
 
                    // add it.
                    weapons_.push_back(pWeapon);
            }
 
            void RemoveWeapon(const string& name)
            {
                    for(auto w : weapons_)
                    {
                        const string& curName = w->GetName();
                        if(curName == name) {
                            weapons_.remove(w);
                        }
                    }
            }
 
            string CreateCsc(void)
            {
                    string res;
 
                    for(auto w : weapons_)
                    {
                        w->AddToCsv(res);
                    }
 
                    // res now contains
                    /*
                        xmodel, kap40_viewmodel
                        xmodel, kap40_worldmodel
                        xmodel, ak47_viewmodel
                        xmodel, ak47_worldmodel
                    */
 
                    return res;
            }
 
    private:
        std::vector<IBaseWeapon*> weapons_;
    };
 
    WeaponsMng mng;
 
 
    void OnAddKap40_checkbox(bool isChecked)
    {
            if(isChecked)
                mng.AddWeapon(new Kap40());
            else
                 mng.RemoveWeapon("kap40"); // matches the name "virtual string GetName(void)" returns
    }
 
    void OnAddAk47_checkbox(bool isChecked)
    {
            if(isChecked)
                mng.AddWeapon(new ak47());
            else
                 mng.RemoveWeapon("ak47"); // matches the name "virtual string GetName(void)" returns
    }
 
}


thank you in advance
elfenliedtopfan5.
AnswerRe: how can i get this to work in c# Pin
Dave Kreskowiak6-Feb-16 16:39
mveDave Kreskowiak6-Feb-16 16:39 
AnswerRe: how can i get this to work in c# Pin
BillWoodruff7-Feb-16 2:50
professionalBillWoodruff7-Feb-16 2:50 
GeneralRe: how can i get this to work in c# Pin
Member 117127539-Feb-16 5:36
Member 117127539-Feb-16 5:36 
AnswerRe: how can i get this to work in c# Pin
Gerry Schmitz8-Feb-16 6:16
mveGerry Schmitz8-Feb-16 6:16 
QuestionHow To Start Process On Remote Machine which is tied to Particular service using C#.net WMI Pin
Tej_dev5-Feb-16 10:04
Tej_dev5-Feb-16 10:04 
AnswerRe: How To Start Process On Remote Machine which is tied to Particular service using C#.net WMI Pin
Dave Kreskowiak5-Feb-16 11:39
mveDave Kreskowiak5-Feb-16 11:39 
GeneralRe: How To Start Process On Remote Machine which is tied to Particular service using C#.net WMI Pin
Tej_dev8-Feb-16 5:10
Tej_dev8-Feb-16 5:10 
GeneralRe: How To Start Process On Remote Machine which is tied to Particular service using C#.net WMI Pin
Dave Kreskowiak8-Feb-16 8:50
mveDave Kreskowiak8-Feb-16 8:50 
GeneralRe: How To Start Process On Remote Machine which is tied to Particular service using C#.net WMI Pin
Tej_dev8-Feb-16 10:16
Tej_dev8-Feb-16 10:16 
QuestionDoes this ensure function1 and function2 use my class in thread safe way? Pin
Member 120616005-Feb-16 0:15
Member 120616005-Feb-16 0:15 
AnswerRe: Does this ensure function1 and function2 use my class in thread safe way? Pin
Eddy Vluggen5-Feb-16 7:16
professionalEddy Vluggen5-Feb-16 7:16 
GeneralRe: Does this ensure function1 and function2 use my class in thread safe way? Pin
Member 120616005-Feb-16 7:43
Member 120616005-Feb-16 7:43 
GeneralRe: Does this ensure function1 and function2 use my class in thread safe way? Pin
Eddy Vluggen5-Feb-16 9:44
professionalEddy Vluggen5-Feb-16 9:44 
GeneralRe: Does this ensure function1 and function2 use my class in thread safe way? Pin
Member 120616005-Feb-16 10:12
Member 120616005-Feb-16 10:12 
GeneralRe: Does this ensure function1 and function2 use my class in thread safe way? Pin
Eddy Vluggen5-Feb-16 11:16
professionalEddy Vluggen5-Feb-16 11:16 
GeneralRe: Does this ensure function1 and function2 use my class in thread safe way? Pin
Member 120616005-Feb-16 11:27
Member 120616005-Feb-16 11:27 
GeneralRe: Does this ensure function1 and function2 use my class in thread safe way? Pin
Eddy Vluggen5-Feb-16 23:05
professionalEddy Vluggen5-Feb-16 23:05 

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.