Exemplo n.º 1
0
        //-----------------------------------------------------------------------
        private void m_linkForGrid_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (!(m_grid.DataSource is DataTable))
            {
                return;
            }
            DataTable table = (DataTable)m_grid.DataSource;
            int       nRow  = m_grid.CurrentCell.RowNumber;
            int       nCol  = m_grid.CurrentCell.ColumnNumber;

            if (nRow >= 0 && nRow < table.Rows.Count)
            {
                DataRow row = table.Rows[nRow];
                object  obj = row[m_2iList.GetNomColObject()];
                if (obj == null)
                {
                    return;
                }
                C2iWndListe.CColonne colonne = m_2iList.GetColonne(m_grid.TableStyle.GridColumnStyles[nCol].MappingName);
                if (colonne != null && colonne.ActionSurLink != null)
                {
                    CResultAErreur result = CExecuteurActionSur2iLink.ExecuteAction(this, colonne.ActionSurLink, obj);
                    if (!result)
                    {
                        CFormAlerte.Afficher(result);
                    }
                }
            }
        }
Exemplo n.º 2
0
 //-----------------------------------------------
 public void ExecuteAction(CActionSur2iLink action, IMapItem item)
 {
     if (action != null && item != null)
     {
         CExecuteurActionSur2iLink.ExecuteAction(this, action, item.Tag);
     }
 }
Exemplo n.º 3
0
 //------------------------------------------------------------------------------
 void CWndFor2iLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     if (WndFor2iLink != null && WndFor2iLink.Action != null)
     {
         CResultAErreur result = CExecuteurActionSur2iLink.ExecuteAction(
             Control,
             WndFor2iLink.Action,
             CUtilControlesWnd.GetObjetForEvalFormuleParametrage(this, EditedElement));
         if (!result)
         {
             CFormAlerte.Afficher(result.Erreur);
         }
     }
     CUtilControlesWnd.DeclencheEvenement(C2iWndLink.c_strIdEvenementLinkClicked, this);
 }
        //-------------------------------------------------------------------------
        void menuItem_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem  item   = sender as ToolStripMenuItem;
            CCoupleActionObjet couple = item != null ?
                                        item.Tag as CCoupleActionObjet :
                                        null;

            if (couple != null)
            {
                CResultAErreur result = CExecuteurActionSur2iLink.ExecuteAction(sender, couple.Action, couple.ObjetCible);
                if (!result)
                {
                    sc2i.win32.common.CFormAlerte.Afficher(result.Erreur);
                }
            }
        }
        //-------------------------------------------------------------------------------
        public static void ActionMenuItem_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem itemClic = sender as ToolStripMenuItem;

            if (itemClic != null)
            {
                CCoupleActionObjet coupleAction = itemClic.Tag as CCoupleActionObjet;
                if (coupleAction != null && coupleAction.Action != null)
                {
                    CResultAErreur result = CExecuteurActionSur2iLink.ExecuteAction(itemClic, coupleAction.Action, coupleAction.ObjetCible);
                    if (!result)
                    {
                        sc2i.win32.common.CFormAlerte.Afficher(result.Erreur);
                    }
                }
            }
        }
Exemplo n.º 6
0
        //--------------------------------------------
        void m_pictureBox_MouseClick(object sender, MouseEventArgs e)
        {
            C2iWndImage wndImage = WndAssociee as C2iWndImage;

            if (wndImage != null && wndImage.Action != null)
            {
                CResultAErreur result = CExecuteurActionSur2iLink.ExecuteAction(
                    Control,
                    wndImage.Action,
                    CUtilControlesWnd.GetObjetForEvalFormuleParametrage(this, EditedElement));
                if (!result)
                {
                    CFormAlerte.Afficher(result.Erreur);
                }
            }
            CUtilControlesWnd.DeclencheEvenement(C2iWndImage.c_strIdEvenementClick, this);
        }
Exemplo n.º 7
0
        //------------------------------------------------------------------------------
        private void m_grid_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridViewColumn col = m_grid.Columns[e.ColumnIndex];
            CParametreVisuChampTableauCroise parametre = null;

            if (m_dicColToParametreCol.TryGetValue(col.DataPropertyName, out parametre))
            {
                if (parametre.ActionSurClick != null)
                {
                    try
                    {
                        CExecuteurActionSur2iLink.ExecuteAction(this, parametre.ActionSurClick, parametre.GetObjetPourFormuleCellule(m_parametre,
                                                                                                                                     ((DataView)m_grid.DataSource)[e.RowIndex].Row,
                                                                                                                                     e.ColumnIndex));
                    }
                    catch { }
                }
            }
        }
Exemplo n.º 8
0
        //------------------------------------------------------------------------
        private void m_chartControl_MouseUp(object sender, MouseEventArgs e)
        {
            if (m_chartAreaFor3D != null)
            {
                if (Math.Abs(m_chartAreaFor3D.Area3DStyle.Inclination) <= 3 &&
                    Math.Abs(m_chartAreaFor3D.Area3DStyle.Rotation) <= 3)
                {
                    m_chartAreaFor3D.Area3DStyle.Enable3D = false;
                }
            }
            m_chartAreaFor3D       = null;
            m_chartControl.Capture = false;

            if (m_modeSouris == EModeMouseChart.SimpleMouse && m_bEnableActions)
            {
                HitTestResult test = m_chartControl.HitTest(e.X, e.Y, ChartElementType.DataPoint);
                if (test != null && test.Series != null && test.PointIndex >= 0)
                {
                    CParametreSerieDeChart pSerie = test.Series.Tag as CParametreSerieDeChart;
                    if (pSerie != null && pSerie.ClickAction != null)
                    {
                        try
                        {
                            CFuturocomDataPoint    pt     = test.Series.Points[test.PointIndex] as CFuturocomDataPoint;
                            CValeurPourChartAction valeur = new CValeurPourChartAction();
                            valeur.ValueForAction = pt.ValeurPourAction;
                            CResultAErreur result = CExecuteurActionSur2iLink.ExecuteAction(this,
                                                                                            pSerie.ClickAction, valeur);
                            if (!result)
                            {
                                CFormAlerte.Afficher(result.Erreur);
                            }
                        }
                        catch { }
                    }
                }
            }
        }