Commit e09abb4b by Pascal Bigot

--no commit message

parent 150a84e0
......@@ -58,6 +58,7 @@ namespace CommonLib
#region données membres en mode SmartCommand
protected BTComm m_Comm = new BTComm();
protected BTComm m_CommMemmory;
protected string m_strLogFilePath;
// Liste des pages "utilisateur" ==> une par BTScreen présent dans chaque document
private List<DynamicPanelForm> m_FormList;
......@@ -744,6 +745,30 @@ namespace CommonLib
m_Comm.CloseComm();
}
public void SwitchComType(bool bVirtual)
{
if (bVirtual && m_Comm.CommType != TYPE_COMM.VIRTUAL)
{
if (m_CommMemmory == null)
m_CommMemmory = m_Comm;
m_Comm = new BTComm();
m_Comm.SetCommTypeAndParam(TYPE_COMM.VIRTUAL, "NA");
m_Comm.OnCommStateChange += new CommOpenedStateChange(this.CommeStateChangeEvent);
m_Comm.EventAddLogEvent += new AddLogEventDelegate(AddLogEvent);
}
else
{
if (m_CommMemmory != null)
{
this.DetachCommEventHandler(this.CommeStateChangeEvent);
m_Comm.EventAddLogEvent -= AddLogEvent;
m_Comm = m_CommMemmory;
m_CommMemmory = null;
}
}
}
/// <summary>
/// appelé lors du changement d'état de la connexion
/// </summary>
......
......@@ -85,13 +85,13 @@ namespace CommonLib
public BTComm()
{
// init par défaut
m_TypeComm = TYPE_COMM.ETHERNET;
m_strDestAdress = "192.168.0.99:502";
m_Comm = new EthernetComm();
m_TypeComm = TYPE_COMM.VIRTUAL;
m_strDestAdress = "NA";
m_Comm = new VirtualComm();
m_Comm.EventAddLogEvent += new AddLogEventDelegate(AddLogEvent);
((EthernetComm)m_Comm).IpAddr = "192.168.0.99";
((EthernetComm)m_Comm).Port = 502;
((EthernetComm)m_Comm).OnCommStateChange += new CommOpenedStateChange(ConnectionStateChangeEvent);
//((EthernetComm)m_Comm).IpAddr = "192.168.0.99";
//((EthernetComm)m_Comm).Port = 502;
//((EthernetComm)m_Comm).OnCommStateChange += new CommOpenedStateChange(ConnectionStateChangeEvent);
m_TimerRecieveTimeout = new System.Windows.Forms.Timer();
m_TimerRecieveTimeout.Interval = 5000;
......@@ -165,20 +165,25 @@ namespace CommonLib
return false;
m_TypeComm = CommType;
if (m_Comm != null)
{
m_Comm.EventAddLogEvent -= AddLogEvent;
m_Comm.OnCommStateChange -= ConnectionStateChangeEvent;
}
switch (m_TypeComm)
{
case TYPE_COMM.SERIAL:
m_Comm = new SerialComm();
m_Comm.EventAddLogEvent += new AddLogEventDelegate(AddLogEvent);
((SerialComm)m_Comm).OnCommStateChange += new CommOpenedStateChange(ConnectionStateChangeEvent);
m_Comm.OnCommStateChange += new CommOpenedStateChange(ConnectionStateChangeEvent);
m_strDestAdress = strParam;
((SerialComm)m_Comm).ComPort = m_strDestAdress;
break;
case TYPE_COMM.ETHERNET:
m_Comm = new EthernetComm();
m_Comm.EventAddLogEvent += new AddLogEventDelegate(AddLogEvent);
((EthernetComm)m_Comm).OnCommStateChange += new CommOpenedStateChange(ConnectionStateChangeEvent);
m_Comm.OnCommStateChange += new CommOpenedStateChange(ConnectionStateChangeEvent);
m_strDestAdress = strParam;
string[] strs = strParam.Split(':');
if (strs.Length != 2)
......@@ -190,7 +195,7 @@ namespace CommonLib
break;
case TYPE_COMM.VIRTUAL:
m_Comm = new VirtualComm();
((VirtualComm)m_Comm).OnCommStateChange += new CommOpenedStateChange(ConnectionStateChangeEvent);
m_Comm.OnCommStateChange += new CommOpenedStateChange(ConnectionStateChangeEvent);
m_strDestAdress = ((VirtualComm)m_Comm).ComParam;
// aucun paramètres
break;
......
......@@ -93,6 +93,17 @@ namespace CommonLib
/// <param name="FrameHeader"></param>
/// <returns></returns>
public abstract bool TestFrame(int FrameLenght, byte[] FrameHeader);
#region Events
public event CommOpenedStateChange OnCommStateChange;
#endregion
protected void NotifyComStateChange()
{
if (OnCommStateChange != null)
OnCommStateChange();
}
#endregion
#region Attributs
......
......@@ -31,10 +31,6 @@ namespace CommonLib
List<byte[]> m_MessageList = new List<byte[]>();
#endregion
#region Events
public event CommOpenedStateChange OnCommStateChange;
#endregion
#region constructeurs
/// <summary>
/// constructeur par défaut
......@@ -308,8 +304,7 @@ namespace CommonLib
LogEvent log = new LogEvent(LOG_EVENT_TYPE.ERROR, strmess);
AddLogEvent(log);
}
if (OnCommStateChange != null)
OnCommStateChange();
NotifyComStateChange();
}
#endregion
}
......
......@@ -23,10 +23,6 @@ namespace CommonLib
List<byte[]> m_MessageList = new List<byte[]>();
#endregion
#region Events
public event CommOpenedStateChange OnCommStateChange;
#endregion
#region cosntructeurs
/// <summary>
/// constructeur de la classe
......@@ -140,9 +136,7 @@ namespace CommonLib
if (m_PortSerie.IsOpen)
{
if (OnCommStateChange != null)
OnCommStateChange();
NotifyComStateChange();
return true;
}
else
......@@ -157,8 +151,7 @@ namespace CommonLib
{
m_PortSerie.Close();
System.Threading.Thread.Sleep(50);
if (OnCommStateChange != null)
OnCommStateChange();
NotifyComStateChange();
return true;
}
......@@ -457,8 +450,8 @@ namespace CommonLib
m_PortSerie.DiscardOutBuffer();
}
if (m_PortSerie.IsOpen == false && OnCommStateChange != null)
OnCommStateChange();
if (m_PortSerie.IsOpen == false)
NotifyComStateChange();
}
#endregion
......
......@@ -14,9 +14,6 @@ namespace CommonLib
string m_commParam = "NA";
#endregion
#region Events
public event CommOpenedStateChange OnCommStateChange;
#endregion
#region cosntructeur
/// <summary>
......@@ -108,8 +105,7 @@ namespace CommonLib
public override bool OpenComm()
{
m_bIsCommOpenned = true;
if (OnCommStateChange != null)
OnCommStateChange();
NotifyComStateChange();
return true;
}
......@@ -120,8 +116,7 @@ namespace CommonLib
public override bool CloseComm()
{
m_bIsCommOpenned = false;
if (OnCommStateChange != null)
OnCommStateChange();
NotifyComStateChange();
return true;
}
......
......@@ -387,7 +387,7 @@ namespace CommonLib
/// <returns>liste des tokens de la ligne</returns>
static public StringCollection GetAllTokens(string line)
{
StringCollection result = null;
StringCollection result = new StringCollection();
if (!string.IsNullOrEmpty(line) && !line.StartsWith("//"))
{
// on vire les espaces
......@@ -401,9 +401,9 @@ namespace CommonLib
// normalement on se retrouve avec une suite de mot séparés par des virgules
// on fini par splitter sur les virgules
string[] strTab = line.Split(',');
result = new StringCollection();
result.AddRange(strTab);
}
return result;
}
......
......@@ -13,6 +13,7 @@ namespace CommonLib
{
BTDoc m_Document = null;
BaseObject m_baseObjectItem = null;
BaseObject m_baseObjectItemMem = null;
StandardObjectPropPanel m_stdPropPanel = new StandardObjectPropPanel();
......@@ -73,30 +74,49 @@ namespace CommonLib
/// </summary>
public void Initialize()
{
bool bSkipPageRebuild = false;
if (m_baseObjectItem == null || m_baseObjectItemMem != m_baseObjectItem)
{
// on évite le rebuild complet si c'est le même objet, ou si il est du même type
if (m_baseObjectItemMem != null &&
m_baseObjectItem != null &&
m_baseObjectItemMem.GetType() == m_baseObjectItem.GetType())
bSkipPageRebuild = true;
m_baseObjectItemMem = m_baseObjectItem;
}
else
{
bSkipPageRebuild = true;
Traces.LogAddDebug(TraceCat.SmartConfig, "Config page rebuild skipped");
}
// on fait la mémo que si on a plus d'une page
if (this.tabControl1.TabPages.Count > 1)
m_iPageIndexMemory = this.tabControl1.SelectedIndex;
else
m_iPageIndexMemory = -1;
m_listPropsPanels.Clear();
m_listTitle.Clear();
tabControl1.SuspendLayout();
tabControl1.Visible = false;
tabControl1.TabPages.Clear();
m_listPropsPanels.Add(m_stdPropPanel);
m_listTitle.Add(Lang.LangSys.C("Symbol & Description"));
if (m_baseObjectItem != null)
if (!bSkipPageRebuild)
{
m_stdPropPanel.Enabled = true;
this.Text = Lang.LangSys.C("Properties of ") + m_baseObjectItem.Symbol;
if (m_baseObjectItem != null && m_Document != null)
// on reconstruit l'ensemble des pages parce que le type d'objet à changé
m_listPropsPanels.Clear();
m_listTitle.Clear();
tabControl1.SuspendLayout();
tabControl1.Visible = false;
tabControl1.TabPages.Clear();
// d'abord le panel de base
m_listPropsPanels.Add(m_stdPropPanel);
m_listTitle.Add(Lang.LangSys.C("Symbol & Description"));
if (m_baseObjectItem != null)
{
// si il y a un panneau de configuration standard sur l'objet, on l'ajoute
if (m_baseObjectItem.StdConfigPanel != null)
{
m_listPropsPanels.Add(m_baseObjectItem.StdConfigPanel as IObjectPropertyPanel);
m_listTitle.Add(Lang.LangSys.C("Properties"));
}
// on fait la liste de tout les script et on ajoute un onglet par script
if (m_baseObjectItem is IScriptable)
{
IScriptable obj = m_baseObjectItem as IScriptable;
......@@ -117,45 +137,59 @@ namespace CommonLib
m_listTitle.Add(Lang.LangSys.C(scriptType));
}
}
// on finir par toues les ajouter
for (int i = 0; i < m_listPropsPanels.Count; i++)
{
m_listPropsPanels[i].Document = this.Document;
m_listPropsPanels[i].ConfiguredItem = m_baseObjectItem;
if (m_baseObjectItem is Data)
{
m_listPropsPanels[i].ConfiguredItemGest = m_Document.GestData;
}
else if (m_baseObjectItem is BTScreen)
{
m_listPropsPanels[i].ConfiguredItemGest = m_Document.GestScreen;
}
else if (m_baseObjectItem is Function)
{
m_listPropsPanels[i].ConfiguredItemGest = m_Document.GestFunction;
}
else if (m_baseObjectItem is BTTimer)
{
m_listPropsPanels[i].ConfiguredItemGest = m_Document.GestTimer;
}
else if (m_baseObjectItem is Trame)
{
m_listPropsPanels[i].ConfiguredItemGest = m_Document.GestTrame;
}
else if (m_baseObjectItem is Logger)
{
m_listPropsPanels[i].ConfiguredItemGest = m_Document.GestLogger;
}
else if (m_baseObjectItem is BTControl)
AddPropertyTab(m_listTitle[i], m_listPropsPanels[i]);
}
}
else
{
// l'objet est null, donc la selection est vide, on met juste le panel de base
AddPropertyTab(m_listTitle[0], m_listPropsPanels[0]);
}
}
// on fait le parcours de tout les onglet pour les initialiser
if (m_baseObjectItem != null && m_Document != null)
{
m_stdPropPanel.Enabled = true;
this.Text = Lang.LangSys.C("Properties of ") + m_baseObjectItem.Symbol;
for (int i = 0; i < m_listPropsPanels.Count; i++)
{
m_listPropsPanels[i].Document = this.Document;
m_listPropsPanels[i].ConfiguredItem = m_baseObjectItem;
if (m_baseObjectItem is Data)
{
m_listPropsPanels[i].ConfiguredItemGest = m_Document.GestData;
}
else if (m_baseObjectItem is BTScreen)
{
m_listPropsPanels[i].ConfiguredItemGest = m_Document.GestScreen;
}
else if (m_baseObjectItem is Function)
{
m_listPropsPanels[i].ConfiguredItemGest = m_Document.GestFunction;
}
else if (m_baseObjectItem is BTTimer)
{
m_listPropsPanels[i].ConfiguredItemGest = m_Document.GestTimer;
}
else if (m_baseObjectItem is Trame)
{
m_listPropsPanels[i].ConfiguredItemGest = m_Document.GestTrame;
}
else if (m_baseObjectItem is Logger)
{
m_listPropsPanels[i].ConfiguredItemGest = m_Document.GestLogger;
}
else if (m_baseObjectItem is BTControl)
{
if (m_CurrentScreen != null)
{
if (m_CurrentScreen != null)
{
m_listPropsPanels[i].ConfiguredItemGest = m_CurrentScreen.Controls;
}
m_listPropsPanels[i].ConfiguredItemGest = m_CurrentScreen.Controls;
}
AddPropertyTab(m_listTitle[i], m_listPropsPanels[i]);
m_listPropsPanels[i].ObjectToPanel();
}
m_listPropsPanels[i].ObjectToPanel();
}
}
else
......@@ -163,9 +197,8 @@ namespace CommonLib
this.Text = Lang.LangSys.C("Selection is empty");
m_stdPropPanel.Enabled = false;
m_stdPropPanel.ConfiguredItem = null;
m_stdPropPanel.ObjectToPanel();
AddPropertyTab(m_listTitle[0], m_listPropsPanels[0]);
}
tabControl1.ResumeLayout();
tabControl1.Visible = true;
if (m_iPageIndexMemory != -1 && m_iPageIndexMemory < tabControl1.TabPages.Count)
......
......@@ -36,6 +36,8 @@ namespace CommonLib
if (m_Ctrl == null)
{
m_Ctrl = new Label();
((Label)m_Ctrl).UseMnemonic = false;
((Label)m_Ctrl).AutoEllipsis = true;
m_Ctrl.Location = m_RectControl.Location;
m_Ctrl.Name = m_strSymbol;
m_Ctrl.Size = m_RectControl.Size;
......
......@@ -44,6 +44,7 @@ namespace SmartApp
this.toolBarToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolsMenu = new System.Windows.Forms.ToolStripMenuItem();
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.forceCnxMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpMenu = new System.Windows.Forms.ToolStripMenuItem();
this.indexToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
......@@ -60,6 +61,8 @@ namespace SmartApp
this.colBtnConnectStart = new System.Windows.Forms.DataGridViewButtonColumn();
this.m_trayIcon = new System.Windows.Forms.NotifyIcon(this.components);
this.appEventLogPanel = new SmartApp.AppEventLogPanel();
this.forceCnxVirtualMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.restoreCnxMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip.SuspendLayout();
this.toolStrip.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridMonitor)).BeginInit();
......@@ -157,14 +160,15 @@ namespace SmartApp
this.toolBarToolStripMenuItem.CheckOnClick = true;
this.toolBarToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.toolBarToolStripMenuItem.Name = "toolBarToolStripMenuItem";
this.toolBarToolStripMenuItem.Size = new System.Drawing.Size(121, 22);
this.toolBarToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.toolBarToolStripMenuItem.Text = "&Toolbar";
this.toolBarToolStripMenuItem.Click += new System.EventHandler(this.ToolBarToolStripMenuItem_Click);
//
// toolsMenu
//
this.toolsMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.optionsToolStripMenuItem});
this.optionsToolStripMenuItem,
this.forceCnxMenuItem});
this.toolsMenu.Name = "toolsMenu";
this.toolsMenu.Size = new System.Drawing.Size(44, 20);
this.toolsMenu.Text = "&Tools";
......@@ -172,10 +176,19 @@ namespace SmartApp
// optionsToolStripMenuItem
//
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(122, 22);
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
this.optionsToolStripMenuItem.Text = "&Options";
this.optionsToolStripMenuItem.Click += new System.EventHandler(this.menuItemOptions_Click);
//
// forceCnxMenuItem
//
this.forceCnxMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.forceCnxVirtualMenuItem,
this.restoreCnxMenuItem});
this.forceCnxMenuItem.Name = "forceCnxMenuItem";
this.forceCnxMenuItem.Size = new System.Drawing.Size(195, 22);
this.forceCnxMenuItem.Text = "Force all connexions to";
//
// helpMenu
//
this.helpMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
......@@ -302,6 +315,20 @@ namespace SmartApp
this.appEventLogPanel.Size = new System.Drawing.Size(496, 200);
this.appEventLogPanel.TabIndex = 5;
//
// forceCnxVirtualMenuItem
//
this.forceCnxVirtualMenuItem.Name = "forceCnxVirtualMenuItem";
this.forceCnxVirtualMenuItem.Size = new System.Drawing.Size(183, 22);
this.forceCnxVirtualMenuItem.Text = "VIRTUAL";
this.forceCnxVirtualMenuItem.Click += new System.EventHandler(this.forceCnxVirtualMenuItem_Click);
//
// restoreCnxMenuItem
//
this.restoreCnxMenuItem.Name = "restoreCnxMenuItem";
this.restoreCnxMenuItem.Size = new System.Drawing.Size(183, 22);
this.restoreCnxMenuItem.Text = "Restore connections";
this.restoreCnxMenuItem.Click += new System.EventHandler(this.restoreCnxMenuItem_Click);
//
// MDISmartCommandMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
......@@ -360,6 +387,9 @@ namespace SmartApp
private System.Windows.Forms.DataGridViewButtonColumn colBtnConnectStart;
private AppEventLogPanel appEventLogPanel;
private System.Windows.Forms.NotifyIcon m_trayIcon;
private System.Windows.Forms.ToolStripMenuItem forceCnxMenuItem;
private System.Windows.Forms.ToolStripMenuItem forceCnxVirtualMenuItem;
private System.Windows.Forms.ToolStripMenuItem restoreCnxMenuItem;
}
}
......
......@@ -238,8 +238,14 @@ namespace SmartApp
/// <param name="doc"></param>
protected void AsyncRunStateUpdater(BaseDoc doc)
{
bool bAtLeastOneActiveProject = false;
foreach (DataGridViewRow row in dataGridMonitor.Rows)
{
if (row.Tag is BaseDoc)
{
if (((BaseDoc)row.Tag).IsRunning)
bAtLeastOneActiveProject |= true;
}
if (row.Tag == doc)
{
Image img = Resources.CxnOff;
......@@ -250,6 +256,7 @@ namespace SmartApp
break;
}
}
forceCnxMenuItem.Enabled = !bAtLeastOneActiveProject;
}
#endregion
......@@ -702,6 +709,38 @@ namespace SmartApp
m_bHideMonAfterPrjStart = optForm.HideMonitorAfterPrjStart;
}
}
private void forceCnxVirtualMenuItem_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow row in dataGridMonitor.Rows)
{
if (row.Tag is BTDoc)
{
BTDoc doc = row.Tag as BTDoc;
if (!doc.IsRunning && !doc.Communication.IsOpen)
{
doc.SwitchComType(true);
}
}
}
}
private void restoreCnxMenuItem_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow row in dataGridMonitor.Rows)
{
if (row.Tag is BTDoc)
{
BTDoc doc = row.Tag as BTDoc;
if (!doc.IsRunning && !doc.Communication.IsOpen)
{
doc.SwitchComType(false);
}
}
}
}
#endregion
#region handler du menu ?
......@@ -834,5 +873,6 @@ namespace SmartApp
}
#endregion
}
}
......@@ -194,6 +194,18 @@
<metadata name="colBtnConnectStart.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colProjName.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colProjCnxStatus.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colRunStatus.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colBtnConnectStart.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="m_trayIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>415, 17</value>
</metadata>
......
......@@ -389,7 +389,7 @@ namespace SmartApp.Ihm
{
m_PropDialog.Show(Program.CurrentMainForm);
}
m_PropDialog.BringToFront();
//m_PropDialog.BringToFront();
}
}
......
......@@ -707,7 +707,7 @@ namespace SmartApp.Ihm
this.solutionPanel.Dock = System.Windows.Forms.DockStyle.Left;
this.solutionPanel.Location = new System.Drawing.Point(0, 49);
this.solutionPanel.Name = "solutionPanel";
this.solutionPanel.Size = new System.Drawing.Size(240, 692);
this.solutionPanel.Size = new System.Drawing.Size(251, 692);
this.solutionPanel.TabIndex = 9;
//
// btnHideShowSolution
......@@ -738,7 +738,7 @@ namespace SmartApp.Ihm
this.solutionTreeView.Indent = 16;
this.solutionTreeView.Location = new System.Drawing.Point(3, 33);
this.solutionTreeView.Name = "solutionTreeView";
this.solutionTreeView.Size = new System.Drawing.Size(230, 652);
this.solutionTreeView.Size = new System.Drawing.Size(241, 652);
this.solutionTreeView.SolutionGest = null;
this.solutionTreeView.TabIndex = 0;
//
......
......@@ -388,6 +388,7 @@
//
// txtSymbol
//
this.txtSymbol.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.txtSymbol.Location = new System.Drawing.Point(16, 24);
this.txtSymbol.Name = "txtSymbol";
this.txtSymbol.Size = new System.Drawing.Size(210, 20);
......
......@@ -123,4 +123,10 @@
<metadata name="colDstDatas.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colSrcData.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colDstDatas.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>
\ No newline at end of file
......@@ -274,6 +274,7 @@ namespace SmartApp
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Manage Groups";
this.ResumeLayout(false);
this.PerformLayout();
......
......@@ -847,6 +847,8 @@ namespace SmartApp
{
if (item.IsUserVisible)
{
BaseObject bo = gest.GetFromSymbol(item.Symbol);
System.Diagnostics.Debug.Assert(bo == item);
TreeNode ItemNode = new TreeNode(item.Symbol);
ItemNode.Tag = item;
ItemNode.ImageKey = imageKey;
......
......@@ -59,6 +59,7 @@ namespace SmartAppUpdater
{
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "postUpdateCopy.bat";
psi.Arguments = " > updatelog.txt";
psi.UseShellExecute = true;
Process copyProcess = Process.Start(psi);
}
......
......@@ -111,6 +111,14 @@ namespace SmartAppUpdater
if (iRemoteIndice > iLocalIndice)
{
listAssemblyToDownload.Add(attrName.Value);
string assemblyName = Path.GetFileNameWithoutExtension(attrName.Value);
// si un assembly à une mise a jour, on prends les fichier de langue qui vont avec
if (assemblyName != "ZedGraph")
{
// le jour ou j'aurai d'autres langues, faudra trouver mieux
listAssemblyToDownload.Add("EN." + assemblyName + ".po");
listAssemblyToDownload.Add("FR." + assemblyName + ".po");
}
AddStatusLine(string.Format(
Program.LangSys.C("Component {0} must be updated (local version = {1}, server version = {2})"),
attrName.Value,
......@@ -165,9 +173,13 @@ namespace SmartAppUpdater
WebClient wc = new WebClient();
try
{
string downloadURL = Program.FileUrl + file;
string langDir = string.Empty;
if (Path.GetExtension(file) == ".po")
langDir = "Lang/";
string downloadURL = Program.FileUrl + langDir + file;
if (checkBox1.Checked)
downloadURL = Program.BetaFileUrl + file;
downloadURL = Program.BetaFileUrl + langDir + file;
wc.DownloadFile(downloadURL, Application.StartupPath + Path.DirectorySeparatorChar + "tmpUpdate" + Path.DirectorySeparatorChar + file);
AddStatusLine(Program.LangSys.C("Done") + ENDL);
......