public static void Init(
     CFormNavigateur navigateur,
     string strCleRegistre)
 {
     m_stackNavigateurs.Push(navigateur);
     CSc2iWin32DataNavigationRegistre.Init(strCleRegistre);
 }
Example #2
0
 //----------------------------------------------------
 public static void InitNavigateurParDefaut(CFormNavigateur navigateur)
 {
     if (navigateur != null)
     {
         m_navigateurParDefaut = navigateur;
     }
 }
        //----------------------------------------------------
        public static void ShowListe(
            string strTitre,
            CListeObjetsDonnees listeAVoir,
            CFormNavigateur navigateurAssocié,
            GLColumnCollection columns,
            string strContexteUtilisation)
        {
            if (listeAVoir == null)
            {
                return;
            }

            //Créer une nouvelle liste dans le contexte de base
            CListeObjetsDonnees lst    = new CListeObjetsDonnees(CSc2iWin32DataClient.ContexteCourant, listeAVoir.TypeObjets);
            CFiltreData         filtre = CFiltreData.GetAndFiltre(listeAVoir.FiltrePrincipal,
                                                                  listeAVoir.Filtre);

            lst.Filtre = filtre;


            CFormListeExtraiteOld frm = new CFormListeExtraiteOld();

            frm.Text = strTitre;
            frm.m_navigateurAssocié = navigateurAssocié != null?navigateurAssocié:m_navigateurParDefaut;
            Image img = CFormListeStandard.CalculeNewImage(lst.TypeObjets);

            frm.m_listeObjets = lst;
            if (columns != null)
            {
                frm.m_panelListe.AllowSerializePreferences = false;
                foreach (GLColumn col in columns)
                {
                    GLColumn copie = CCloner2iSerializable.Clone(col) as GLColumn;
                    frm.m_panelListe.Columns.Add(copie);
                }
            }
            else
            {
                frm.m_panelListe.AllowSerializePreferences = true;
                if (strContexteUtilisation != null)
                {
                    frm.m_panelListe.ContexteUtilisation = strContexteUtilisation;
                }
                string   strField = DescriptionFieldAttribute.GetDescriptionField(lst.TypeObjets, "DescriptionElement");
                GLColumn col      = new GLColumn("");
                col.Propriete = strField;
                col.Width     = frm.m_panelListe.ClientSize.Width;
                frm.m_panelListe.Columns.Add(col);
            }

            frm.Show();
        }
Example #4
0
        public static CObjetDonnee SelectObjectQuickSearch(
            CFormListeStandard formListe,
            CObjetDonnee objetPreSelectionnee,
            string strTextQuick,
            string strContexteUtilisation,
            OnNewObjetDonneeEventHandler onNewObjetDonnee)
        {
            if (strTextQuick != null)
            {
                formListe.ModeQuickSearch = true;
                formListe.QuickSearchText = strTextQuick;
            }

            CObjetDonnee objetUnique = formListe.GetObjetQuickSearchSiUnique();

            /*CObjetDonnee objetUnique = CPanelFiltreRapide.GetObjetSiUnique(
             *      formListe.ListeObjets,
             *      formListe.FiltreRapide,
             *      strTextQuick);*/
            if (objetUnique != null)
            {
                formListe.Dispose();
                return(objetUnique);
            }

            formListe.ContexteUtilisation = strContexteUtilisation;

            CFormNavigateur oldNavigateur = CSc2iWin32DataNavigation.Navigateur;

            CFormNavigateurPopupListe navigateur = new CFormNavigateurPopupListe(formListe);

            CSc2iWin32DataNavigation.PushNavigateur(navigateur);

            formListe.ModeSelection             = true;
            formListe.OnObjetDoubleClicked     += new EventHandler(navigateur.OnDoubleClickFormList);
            formListe.AfterValideCreationObjet += new ObjetDonneeEventHandler(navigateur.AfterValideCreationObjet);
            formListe.OnNewObjetDonnee         += onNewObjetDonnee;

            DialogResult result = navigateur.ShowDialog();


            CObjetDonnee objetSelectionne = null;

            if (result == DialogResult.OK)
            {
                objetSelectionne = navigateur.m_objetSelectionne;
            }
            CSc2iWin32DataNavigation.PopNavigateur();
            return(objetSelectionne);
        }
Example #5
0
        public static void Superviser(CSchemaReseau schemaReseau, CFormNavigateur navigateur)
        {
            CFormSupervisionSchema form = new CFormSupervisionSchema();

            form.m_navigateur = navigateur;

            form.WindowState = FormWindowState.Maximized;
            form.InitForSchema(schemaReseau);
            form.Show();
            form.BringToFront();
            form.m_controleSchema.Enabled = false;
            form.m_controleSchema.Refresh();
            //InitCalcul(form);
            new InitCalculDelegate(InitCalcul).BeginInvoke(form, null, null);
        }
        //---------------------------------------------------------------------------
        public static void Show(IFormNavigable frm, Type typeNavigateur, System.Windows.Forms.FormWindowState windowState, IWin32Window owner)
        {
            CFormNavigateur oldNavigateur = CSc2iWin32DataNavigation.Navigateur;

            CFormNavigateurPopup navigateur = (CFormNavigateurPopup)Activator.CreateInstance(typeNavigateur, new object[] { frm });

            CSc2iWin32DataNavigation.PushNavigateur(navigateur);
            try
            {
                navigateur.WindowState = windowState;
                //LE 5/10/2007, stef
                //Il y avait ici : navigateur.TopMost = true, mais ça pose des problèmes,
                //parce que quand un navigateur popup ouvre un navigateur popup, ils se
                //passent les uns sous les autres.
                //tentative avec bringtofront
                navigateur.BringToFront();
                CFormEditionStandard formEdition = frm as CFormEditionStandard;
                if (formEdition != null)
                {
                    if (formEdition.IsEnEditionPourNouvelElement)
                    {
                        formEdition.AfterAnnulationModification += new ObjetDonneeEventHandler(CloseOnAnnuleOuValideModification);
                        formEdition.AfterValideModification     += new ObjetDonneeEventHandler(CloseOnAnnuleOuValideModification);
                    }
                }
                if (navigateur.m_contexteDonneePushedAsCurrent != null)
                {
                    CSc2iWin32DataClient.PushContexteCourant(navigateur.m_contexteDonneePushedAsCurrent);
                }
                try
                {
                    DialogResult result = navigateur.ShowDialog(owner);
                }
                finally
                {
                    if (navigateur.m_contexteDonneePushedAsCurrent != null)
                    {
                        CSc2iWin32DataClient.PopContexteCourant(navigateur.m_contexteDonneePushedAsCurrent);
                    }
                }
            }
            catch { }
            finally
            {
                CSc2iWin32DataNavigation.PopNavigateur();
            }
        }
Example #7
0
 public void Init(CSchemaReseau schemaReseau, CBasePourVueAnimee basePourVue, CFormNavigateur navigateur)
 {
     m_baseVue = basePourVue;
     m_baseVue.RefreshVueSupervision = new RefreshVueSupervisionDelegate(RefreshVueSupervision);
     m_baseVue.AfterLoadElement      = new CBasePourVueAnimee.AfterLoadElementDelegate(AfterLoadElement);
     m_navigateur        = navigateur;
     m_schemaReseau      = schemaReseau;
     m_nNbElementsToLoad = m_schemaReseau.ElementsDeSchema.Count;
     m_stackCheminsReseau.Clear();
     m_stackCheminsReseau.Push(m_schemaReseau);
     if (schemaReseau == null)
     {
         m_dessinDeSchema = null;
         return;
     }
     m_dessinDeSchema = schemaReseau.GetSchema(false);
     RedrawSchema();
 }
Example #8
0
        //-----------------------------------------------------------------------------------------------------
        private void m_menuAfficheDetailEtape_Click(object sender, EventArgs e)
        {
            CEtapeWorkflow etape = EtapeSelectionnee;

            if (etape != null)
            {
                CFormNavigateur navigateur = CFormNavigateur.FindNavigateur(this);
                if (navigateur != null)
                {
                    CReferenceTypeForm refForm = CFormFinder.GetRefFormToEdit(typeof(CEtapeWorkflow));
                    if (refForm != null)
                    {
                        CFormEditionStandard frm = refForm.GetForm(etape) as CFormEditionStandard;
                        if (frm != null)
                        {
                            navigateur.AffichePage(frm);
                        }
                    }
                }
            }
        }
 //------------------------------------------------------------------
 private void m_panelWorkflow_DoubleClicSurElement(object sender, EventArgs e)
 {
     if (!LockEdition)
     {
         EditeCurrentEtape();
     }
     else
     {
         CWorkflowEtapeDessin etape = m_panelWorkflow.EtapeSelectionnee;
         if (etape == null)
         {
             return;
         }
         CBlocWorkflow         bloc         = etape.TypeEtape != null ? etape.TypeEtape.Bloc : null;
         CBlocWorkflowWorkflow blocWorkflow = bloc as CBlocWorkflowWorkflow;
         if (blocWorkflow != null && blocWorkflow.DbKeyTypeWorkflow != null)
         {
             CTypeWorkflow typeWorkflow = new CTypeWorkflow(CSc2iWin32DataClient.ContexteCourant);
             if (typeWorkflow.ReadIfExists(blocWorkflow.DbKeyTypeWorkflow))
             {
                 CFormNavigateur navigateur = CFormNavigateur.FindNavigateur(this);
                 if (navigateur != null)
                 {
                     CReferenceTypeForm refFrm = CFormFinder.GetRefFormToEdit(typeof(CTypeWorkflow));
                     if (refFrm != null)
                     {
                         CFormEditionStandard frm = refFrm.GetForm(typeWorkflow) as CFormEditionStandard;
                         if (frm != null)
                         {
                             navigateur.AffichePage(frm);
                         }
                     }
                 }
             }
         }
     }
 }
Example #10
0
        public CFormListeAlarmeEnCours(CConsultationAlarmesEnCoursInDb consultation, CFormNavigateur navigateur)
        {
            c_nBaseControleRetombee = 15000 / c_nTimeClignote;

            List <string> strNomColonnes;
            string        st;
            TimeSpan      duree;
            DateTime      start, stop;

            m_consultationEnCours = consultation;

            m_navigateur = navigateur;

            start = DateTime.Now;

            InitializeComponent();

            this.Text             = consultation.Libelle;
            m_timerVoyant.Enabled = true;

            stop  = DateTime.Now;
            duree = stop - start; //test duree = 8 sec !!!!!!!

            m_recepteurNotifications = new CRecepteurNotification(CSc2iWin32DataClient.ContexteCourant.IdSession, typeof(CDonneeNotificationAlarmes));
            m_recepteurNotifications.OnReceiveNotification += new NotificationEventHandler(OnReceiveNotificationAlarmEnCours);

            /*   m_recepteurNotificationsStop = new CRecepteurNotification(CSc2iWin32DataClient.ContexteCourant.IdSession, typeof(CDonneeNotificationAlarmesStop));
             * m_recepteurNotificationsStop.OnReceiveNotification += new NotificationEventHandler(OnReceiveNotificationStop);
             *
             * m_recepteurNotificationsMask = new CRecepteurNotification(CSc2iWin32DataClient.ContexteCourant.IdSession, typeof(CDonneeNotificationAlarmesMask));
             * m_recepteurNotificationsMask.OnReceiveNotification += new NotificationEventHandler(OnReceiveNotificationMask);
             *
             * m_recepteurNotificationsAcknowledge = new CRecepteurNotification(CSc2iWin32DataClient.ContexteCourant.IdSession, typeof(CDonneeNotificationAlarmesAcknowledge));
             * m_recepteurNotificationsAcknowledge.OnReceiveNotification += new NotificationEventHandler(OnReceiveNotificationAcknowledge);*/


            List <CInfoAlarmeAffichee> lstEnCours = new List <CInfoAlarmeAffichee>();
            List <CInfoAlarmeAffichee> lstRetombe = new List <CInfoAlarmeAffichee>();

            m_lstViewEnCours.OnGetDonneesObjet += new GetDonneesLigneEventHandler(GetDonneesObjetEnCours);
            m_lstViewRetombe.OnGetDonneesObjet += new GetDonneesLigneEventHandler(GetDonneesObjetRetombe);

            m_lstViewEnCours.DoubleClick += new EventHandler(OnLstViewEnCoursDoubleClick);
            m_lstViewRetombe.DoubleClick += new EventHandler(OnLstViewRetombeDoubleClick);

            lstEnCours = GetAlarmsInfoFromDB();

            strNomColonnes = m_consultationEnCours.Parametres.GetColumnNames();

            m_lstViewEnCours.Init(strNomColonnes.ToArray(), lstEnCours.ToArray());

            st = I.T("End date|60023");
            strNomColonnes.Add(st);
            st = I.T("Duration|60022");
            strNomColonnes.Add(st);
            m_lstViewRetombe.Init((string[])strNomColonnes.ToArray(), lstRetombe.ToArray());

            m_strMaskAdminButtonText = I.T("Alarms masked by Administrator|60016") + " : ";
            m_strMaskBrigButtonText  = I.T("Alarms masked by Operating agent|60017") + " : ";
            m_strFrequentButtonText  = I.T("Current frequent alarms|60018") + " : ";

            InitButtonsInfo();

            MAJFrequentButtonText();
            MAJAdminButtonText();
            MAJBrigButtonText();

            m_btnMaskedOnCreation.Text = I.T("Alarms masked on creation|60047") + " : " + m_NbMasqCreat.ToString();

            label1.Text = I.T("Current alarms|60014");
            label2.Text = I.T("Cleared alarms|60015");

            CDocumentGED docSonnerie = consultation.DocumentGEDSoundFile;

            if (docSonnerie != null && docSonnerie.ReferenceDoc != null)
            {
                m_proxySonnerie = new CProxyGED(consultation.ContexteDonnee.IdSession, docSonnerie.ReferenceDoc);
                if (!m_proxySonnerie.CopieFichierEnLocal())
                {
                    m_proxySonnerie.Dispose();
                    m_proxySonnerie = null;
                }
            }

            //SetVoyantAlarme();
            Type tpVar = GetType();

            Type tpGeneric = typeof(List <>);

            tpGeneric = tpGeneric.MakeGenericType(tpVar);

            object liste = Activator.CreateInstance(tpGeneric);
        }
 public static void PushNavigateur(CFormNavigateur form)
 {
     m_stackNavigateurs.Push(form);
 }
Example #12
0
        //-------------------------------------------------------------------------------------
        public static void AfficheAlarmes(CMemoryDb database, CParametrageAffichageListeAlarmes paramConsultation, CFormNavigateur nav)
        {
            CFormConsultationAlarmesEnCours form = new CFormConsultationAlarmesEnCours();

            form.Text         = paramConsultation.Libelle;
            form.m_dataBase   = database;
            form.m_navigateur = nav;
            form.TopMost      = false;
            CParametreAffichageListeAlarmes parametre = paramConsultation.ParametreAffichageAlarmes;

            if (parametre == null)
            {
                parametre = CParametreAffichageListeAlarmes.ParametreParDefaut;
            }

            form.m_parametreAffichage = parametre;

            CDocumentGED docSonnerie = paramConsultation.DocumentFichierSon;

            if (docSonnerie != null && docSonnerie.ReferenceDoc != null)
            {
                CProxyGED proxySonnerie = new CProxyGED(paramConsultation.ContexteDonnee.IdSession, docSonnerie.ReferenceDoc);
                if (proxySonnerie.CopieFichierEnLocal())
                {
                    form.m_proxySonnerie = proxySonnerie;
                }
                else
                {
                    proxySonnerie.Dispose();
                    proxySonnerie = null;
                }
            }

            form.m_dicImages.Clear();
            CListeObjetsDonnees listTypesAlarmes = new CListeObjetsDonnees(paramConsultation.ContexteDonnee, typeof(CTypeAlarme));

            foreach (CTypeAlarme typeAlarme in listTypesAlarmes)
            {
                if (typeAlarme.Image != null)
                {
                    form.m_dicImages.Add(typeAlarme.Id.ToString(), typeAlarme.Image);
                }
            }

            form.Show();
        }
Example #13
0
        //-------------------------------------------------------------------
        private void m_menuEditWorkflow_Click(object sender, EventArgs e)
        {
            CWorkflowEtapeDessin etape = EtapeSelectionnee;

            if (etape == null)
            {
                return;
            }
            CBlocWorkflowWorkflow blocwkf = etape != null && etape.TypeEtape != null ?
                                            etape.TypeEtape.Bloc as CBlocWorkflowWorkflow : null;

            if (blocwkf != null)
            {
                CReferenceTypeForm refFrm = CFormFinder.GetRefFormToEdit(typeof(CTypeWorkflow));
                if (refFrm != null)
                {
                    CTypeWorkflow typeWorkflow = null;
                    if (blocwkf.DbKeyTypeWorkflow == null)
                    {
                        if (!LockEdition)
                        {
                            typeWorkflow = new CTypeWorkflow(CSc2iWin32DataClient.ContexteCourant);
                            typeWorkflow.CreateNew();
                            typeWorkflow.Libelle = blocwkf.TypeEtape.Libelle;
                        }
                    }
                    else
                    {
                        typeWorkflow = new CTypeWorkflow(CSc2iWin32DataClient.ContexteCourant);
                        if (!typeWorkflow.ReadIfExists(blocwkf.DbKeyTypeWorkflow))
                        {
                            typeWorkflow = null;
                        }
                    }
                    if (typeWorkflow != null)
                    {
                        CFormNavigateur navigateur = null;
                        if (LockEdition)
                        {
                            Form frm = FindForm();
                            if (frm != null)
                            {
                                Control ctrl = frm.Parent;
                                while (ctrl != null && ctrl.Parent != null && !(ctrl is CFormNavigateur))
                                {
                                    ctrl = ctrl.Parent;
                                }
                                if (typeof(CFormNavigateur).IsAssignableFrom(ctrl.GetType()))
                                {
                                    navigateur = (CFormNavigateur)ctrl;
                                }
                            }
                        }
                        CFormEditionStandard frmEdition = refFrm.GetForm(typeWorkflow) as CFormEditionStandard;
                        if (navigateur == null && frmEdition != null)
                        {
                            CFormNavigateurPopup.Show(frmEdition);
                            if (!LockEdition && typeWorkflow.IsValide() && typeWorkflow.Id >= 0)
                            {
                                blocwkf.DbKeyTypeWorkflow = typeWorkflow.DbKey;
                                etape.TypeEtape.Bloc      = blocwkf;
                            }
                        }
                        else
                        {
                            navigateur.AffichePage(frmEdition);
                        }
                    }
                }
            }
        }