Ejemplo n.º 1
0
 private void LoadData()
 {
     XmlDocManager.Instance.ReadFromXml();
     m_dllCollections    = Protocol.Manager.XmlDocManager.Instance.DllInfo;
     m_dllCollectionsBak = m_dllCollections.Clone() as XmlDllCollections;
     Init(); //初始化
 }
Ejemplo n.º 2
0
 private void tsButRevert_Click(object sender, EventArgs e)
 {
     // 判断是否做了修改
     if (!IsChanged(m_dllCollections, m_dllCollectionsBak))
     {
         // 如果没做修改,就不需要撤销
         // 在判断是否属于添加模式,如果是的话, 提示
         if (panel4ChannelAdd.Visible == true || panel4DataAdd.Visible == true)
         {
             if (MessageBox.Show("确定要取消添加?", "撤销", MessageBoxButtons.YesNo) == DialogResult.Yes)
             {
                 if (m_bIsInChannelType)
                 {
                     ResetChannelPanel();
                 }
                 else
                 {
                     ResetDataPanel();
                 }
                 SetModified(false);
                 Init(); //初始化
             }
         }
         else
         {
             MessageBox.Show("没做任何修改,无需撤销");
         }
         return;
     }
     if (MessageBox.Show("确定要撤销已修改的配置信息?", "撤销修改", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         // 菜单栏上面的撤销按钮
         if (m_bIsInChannelType)
         {
             ResetChannelPanel();
         }
         else
         {
             ResetDataPanel();
         }
         SetModified(false);
         m_dllCollections = m_dllCollectionsBak.Clone() as XmlDllCollections;
         Init(); //初始化
     }
 }