コード例 #1
0
ファイル: Class1.cs プロジェクト: nicolasramos009/Cambio
    public void OnCmd(ref EdmCmd poCmd, ref System.Array ppoData)
    {
        //Handle the hook
        string name = null;

        switch (poCmd.meCmdType)
        {
        case EdmCmdType.EdmCmd_PreState:
            name = "PreState";
            break;

        case EdmCmdType.EdmCmd_PostAdd:
            name = "PostAdd";
            break;

        case EdmCmdType.EdmCmd_PostLock:
            name = "PostLock";
            break;

        case EdmCmdType.EdmCmd_PreUnlock:
            name = "PreUnlock";
            break;

        case EdmCmdType.EdmCmd_PostUnlock:
            name = "PostUnlock";
            break;

        default:
            name = "?";
            break;
        }



        string message = null;

        message = "sasasa";
        int index = 0;

        // index = Information.LBound(ppoData);
        index = ppoData.GetLowerBound(0);
        int last = 0;

        //last = Information.UBound(ppoData);
        last = ppoData.GetUpperBound(0);

        //Append the paths of all files to a message string
        while (index <= last)
        {
            message = message + ((EdmCmdData)(ppoData.GetValue(index))).mbsStrData1 + Environment.NewLine;//Constants.vbLf;
            index   = index + 1;
        }

        //Display a message to the user
        message = "The following files were affected by a " + name + " hook:" + Environment.NewLine /*Constants.vbLf */ + message;

        EdmVault5 vault = default(EdmVault5);

        vault = (EdmVault5)poCmd.mpoVault;
        vault.MsgBox(poCmd.mlParentWnd, message);



        if (poCmd.meCmdType == EdmCmdType.EdmCmd_Menu)
        {
            if (poCmd.mlCmdID == 1)
            {
                System.Windows.Forms.MessageBox.Show("C# Add-in");
            }
        }
    }