//------------------------------------------------------------------------------ public void ReactualiserArbre() { m_bCmbArbreInitialisee = false; Type typeConsulte = null; CListeObjetsDonnees lst = new CListeObjetsDonnees(CSc2iWin32DataClient.ContexteCourant, typeof(CConsultationHierarchique)); if (m_elementEdite != null) { lst.Filtre = new CFiltreData(CConsultationHierarchique.c_champTypeSource + " = @1", m_elementEdite.GetType().ToString()); typeConsulte = m_elementEdite.GetType(); } else { lst.Filtre = new CFiltreData(CConsultationHierarchique.c_champTypeSource + " = @1", ""); } m_cmbArbreHierarchique.Init(lst, "Libelle", true); m_cmbArbreHierarchique.AssureRemplissage(); int nIdLastConsultationUtilisee = new CTimosAppRegistre().GetLastIdConsultationHierarchiqueForGED(typeConsulte); if (nIdLastConsultationUtilisee >= 0) { CConsultationHierarchique cslt = new CConsultationHierarchique(CSc2iWin32DataClient.ContexteCourant); if (cslt.ReadIfExists(nIdLastConsultationUtilisee)) { m_cmbArbreHierarchique.ElementSelectionne = cslt; } } if (m_cmbArbreHierarchique.ElementSelectionne == null && m_cmbArbreHierarchique.Items.Count > 0) { m_cmbArbreHierarchique.SelectedIndex = 0; } m_bCmbArbreInitialisee = true; m_panelConsultationHierarchique.Visible = lst.Count > 0; }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); CTimosAppRegistre timosRegistre = new CTimosAppRegistre(); CResultAErreur result = timos.client.CInitialiseurClientTimos.InitClientTimos(timosRegistre, true, null); if (result) { CSessionClient session = CSessionClient.CreateInstance(); result = session.OpenSession( new CAuthentificationSessionSousSession(0), "Myanmar documents import", ETypeApplicationCliente.Service ); if (result) { CImportMyanmarConst.SessionClient = session; } } if (!result) { MessageBox.Show("Error while connecting to Timos, limited functions !"); } Application.Run(new CFormMain()); }
private void FillChilds(TreeNode node, CParametreTriGantt parametreTri) { m_bIsFilling = true; node.Nodes.Clear(); IElementDeGantt eltParent = node.Tag as IElementDeGantt; if (parametreTri == null) { parametreTri = CTimosAppRegistre.GetParametreTriGantt(eltParent); } eltParent.SortChilds(parametreTri); List <TreeNode> lstToAdd = new List <TreeNode>(); foreach (IElementDeGantt elt in eltParent.ElementsFils) { TreeNode nodeFils = CreateNode(elt); lstToAdd.Add(nodeFils); if (elt is CElementDeGanttProjet && ((CElementDeGanttProjet)elt).ProjetAssocie.TypeProjet.DefaultExpand) { nodeFils.Expand(); } } node.Nodes.AddRange(lstToAdd.ToArray()); m_bIsFilling = false; }
private void CFormEditModulesParametrage_Load(object sender, EventArgs e) { CWin32Traducteur.Translate(this); m_panelModulesParametrage.InitChamps(m_contexte); CParametreVisuModuleParametrage parametre = CTimosAppRegistre.GetParametreVisuModulesParametrage(); if (parametre != null) { AppliqueParametre(parametre); } }
private void SaveParametreAffichage() { CParametreVisuModuleParametrage parametre = new CParametreVisuModuleParametrage(); m_panelModulesParametrage.FillParametreAffichage(parametre); parametre.Size = Size; parametre.Position = Location; if (CFormMain.GetInstance() != null) { parametre.TimosPosition = CFormMain.GetInstance().Location; parametre.TimosSize = CFormMain.GetInstance().Size; parametre.TimosAgrandi = CFormMain.GetInstance().WindowState == FormWindowState.Maximized; CTimosAppRegistre.SaveParametreVisuModulesParametrage(parametre); } }
//------------------------------------------------------------------ private void SaveConfig(string strNomFichier) { CConfigFenetrePlanification config = Config; config.NomFichier = strNomFichier; CResultAErreur result = config.SaveFile(strNomFichier); if (!result) { CFormAlerte.Afficher(result.Erreur); } else { m_strNomFichierEnCours = strNomFichier; CTimosAppRegistre.AddRecentConfigPlanning(strNomFichier); } }
private void LoadConfig(string strNomFicher) { CConfigFenetrePlanification config = new CConfigFenetrePlanification(); CResultAErreur result = config.ReadFile(strNomFicher); if (!result) { CTimosAppRegistre.RemoveRecentConfigPlanning(strNomFicher); CFormAlerte.Afficher(result.Erreur); } else { Config = config; CTimosAppRegistre.AddRecentConfigPlanning(strNomFicher); m_strNomFichierEnCours = strNomFicher; } }
void m_menuSortBy_Click(object sender, EventArgs e) { if (m_treeNodeMenuContextuel != null) { CParametreTriGantt parametre = CTimosAppRegistre.GetParametreTriGantt(m_treeNodeMenuContextuel.Tag as IElementDeGantt); if (CFormTriGantt.GetParametre(ref parametre)) { IElementDeGantt elt = m_treeNodeMenuContextuel.Tag as IElementDeGantt; CTimosAppRegistre.SetParametreTriGantt(elt, parametre); FillChilds(m_treeNodeMenuContextuel, parametre); if (OnChangePosition != null) { OnChangePosition(this, null); } } } }
//------------------------------------------------------------------------ private void CGanttTree_DragDrop(object sender, DragEventArgs e) { UndrawZoneDestDragDrop(); if (e.Data.GetDataPresent(typeof(TreeNode)) && !LockEdition) { TreeNode nodeMoved = e.Data.GetData(typeof(TreeNode)) as TreeNode; Point pt = PointToClient(new Point(e.X, e.Y)); TreeNode nodeDest = null; bool bAfter = false; GetDestDragDrop(nodeMoved, pt, ref nodeDest, ref bAfter); if (nodeDest != null) { TreeNodeCollection nodes = nodeDest.Parent != null ? nodeDest.Parent.Nodes : Nodes; int nIndexMoved = nodes.IndexOf(nodeMoved); nodes.Remove(nodeMoved); int nIndexDest = nodes.IndexOf(nodeDest) + (bAfter ? 1 : 0); if (nIndexDest != nIndexMoved) { if (nIndexDest >= nodes.Count) { nodes.Add(nodeMoved); } else { nodes.Insert(nIndexDest, nodeMoved); } RenumerotteElements(nodes); SelectedNode = nodeMoved; if (OnChangePosition != null) { OnChangePosition(this, null); } IElementDeGantt parent = nodeMoved.Tag as IElementDeGantt; if (parent != null) { parent = parent.ElementParent; } CTimosAppRegistre.SetParametreTriGantt(parent, null); } } } }
//------------------------------------------------------------------ private void m_menuLoadFile_Opening(object sender, CancelEventArgs e) { foreach (ToolStripItem item in new ArrayList(m_menuLoadFile.Items)) { if (item != m_menuOpenConfig) { m_menuLoadFile.Items.Remove(item); } } string[] strRecents = CTimosAppRegistre.GetRecentsConfigPlanning(); if (strRecents.Length > 0) { m_menuLoadFile.Items.Add(new ToolStripSeparator()); foreach (string strRecent in strRecents) { ToolStripMenuItem itemOpenFile = new ToolStripMenuItem(CUtilTexte.TronqueLeMilieu(strRecent, 40)); itemOpenFile.Tag = strRecent; m_menuLoadFile.Items.Add(itemOpenFile); itemOpenFile.Click += new EventHandler(itemOpenFile_Click); } } }
public void ReactualiserArbre() { m_bCmbArbreInitialisee = false; if (m_schemaReseau == null) { return; } Type typeConsulte = null; CListeObjetsDonnees lst = new CListeObjetsDonnees(m_schemaReseau.ContexteDonnee, typeof(CConsultationHierarchique)); if (m_schemaReseau.SiteApparenance != null) { lst.Filtre = new CFiltreData(CConsultationHierarchique.c_champTypeSource + "=@1", typeof(CSite).ToString()); typeConsulte = typeof(CSite); } else { lst.Filtre = new CFiltreData(CConsultationHierarchique.c_champTypeSource + "=@1", ""); } m_cmbArbreHierarchique.Init(lst, "Libelle", true); m_cmbArbreHierarchique.AssureRemplissage(); int nIdLastConsultationUtilisee = new CTimosAppRegistre().GetLastIdConsultationHierarchiqueInSchema(typeConsulte); if (nIdLastConsultationUtilisee >= 0) { CConsultationHierarchique cslt = new CConsultationHierarchique(CSc2iWin32DataClient.ContexteCourant); if (cslt.ReadIfExists(nIdLastConsultationUtilisee)) { m_cmbArbreHierarchique.ElementSelectionne = cslt; } } if (m_cmbArbreHierarchique.ElementSelectionne == null && m_cmbArbreHierarchique.Items.Count > 0) { m_cmbArbreHierarchique.SelectedIndex = 0; } m_bCmbArbreInitialisee = true; }
//------------------------------------------- private void Init() { CTimosAppRegistre.FillParametreNotifications(this); }
//------------------------------------------- public static void SavePreferences() { CTimosAppRegistre.SaveParametreNotifications(Instance); }