예제 #1
0
 protected virtual void OnConfApply(ConfApplyEventArgs e)
 {
     if (ConfApplyEvent != null)
     {
         ConfApplyEvent(this, e);
     }
 }
예제 #2
0
        void confApply(object sender, ConfApplyEventArgs e)
        {
            Debug.WriteLine("ConfApply");
            string strApply = Msg.DEF_SETCOMMIT + " : " + e.applyMsg;

            sbLog.AppendLine(strApply);
            setLbInfoText(strApply);
        }
예제 #3
0
        private void PatchXMLData(JObject xmlJson)
        {
            //WorkCompletedEventArgs wCe = new WorkCompletedEventArgs(false, "");
            //OnWorkCompleted(wCe);


            Boolean isUpdateProcessed          = false;
            Dictionary <string, string> dicXml = JsonConvert.DeserializeObject <Dictionary <string, string> >(xmlJson.ToString());

            foreach (KeyValuePair <string, string> value in dicXml)
            {
                XmlDocument xdClient = new XmlDocument();
                XmlDocument xdServer = new XmlDocument();
                try
                {
                    Boolean isUpdate = false;
                    Debug.WriteLine("Load : " + strDestPath + value.Key);
                    xdClient.Load(strDestPath + value.Key);
                    Debug.WriteLine("Load Complete");
                    Debug.WriteLine("Server XML : " + value.Value);
                    String xml = value.Value;
                    //String xml = HttpUtility.UrlDecode(value.Value, Encoding.UTF8);
                    xdServer.LoadXml(xml.TrimStart());

                    isUpdate = syncDiffData(xdClient.DocumentElement, xdServer.DocumentElement, ref xdClient, ref xdServer);
                    if (isUpdate)
                    {
                        ConfApplyEventArgs cAe = new ConfApplyEventArgs(false, strDestPath + value.Key);
                        OnConfApply(cAe);
                        isUpdateProcessed = true;
                    }
                    Debug.WriteLine("Save : " + strDestPath + value.Key);
                    xdClient.Save(strDestPath + value.Key);
                    Debug.WriteLine("Save Complete");
                }
                catch (Exception e)
                {
                    Debug.WriteLine("An error has occured : " + e.ToString());
                    continue;
                }
            }
            if (isUpdateProcessed)
            {
                ConfApplyCompletedEventArgs cCe = new ConfApplyCompletedEventArgs(false, "");
                OnConfApplyCompleted(cCe);
            }
            else
            {
                WorkCompletedEventArgs wCe = new WorkCompletedEventArgs(false, "");
                OnWorkCompleted(wCe);
            }
        }