/[xmltv_parser]/trunk/libxmltv/Core/XMLTVRuntimeInstance.cs
ViewVC logotype

Diff of /trunk/libxmltv/Core/XMLTVRuntimeInstance.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 45 by william, Fri Mar 8 03:41:18 2013 UTC revision 50 by william, Fri Mar 8 06:15:44 2013 UTC
# Line 3  using System.Collections.Generic; Line 3  using System.Collections.Generic;
3  using System.Linq;  using System.Linq;
4  using System.Text;  using System.Text;
5  using libxmltv.Interfaces;  using libxmltv.Interfaces;
6    using System.ComponentModel;
7    
8  namespace libxmltv.Core  namespace libxmltv.Core
9  {  {
10        [Serializable]
11      internal class XMLTVRuntimeInstance : MarshalByRefObject, IXMLTVRuntimeInstance      internal class XMLTVRuntimeInstance : MarshalByRefObject, IXMLTVRuntimeInstance
12      {      {
13          public XMLTVRuntimeInstance(string xmlfile) { CreateInstance(xmlfile); }          public XMLTVRuntimeInstance(string xmlfile) : this(xmlfile, null) { }
14          private void CreateInstance(string xmlfile)          public XMLTVRuntimeInstance(string xmlfile, EventHandler<CancelEventArgs> t) { CreateInstance(xmlfile,t); }
15            private void CreateInstance(string xmlfile, EventHandler<CancelEventArgs> t)
16          {          {
17              using (Instance = new XMLTVInstance(xmlfile, this))              CancelEvent = t;
18                using (XMLTVInstance instance = new XMLTVInstance(xmlfile, this))
19              {              {
20              }              }
21          }          }
22          internal XMLTVInstance Instance { get; private set; }  
23            //internal XMLTVInstance Instance { get; private set; }
24    
25          #region IXMLTV_LOADER members          #region IXMLTV_LOADER members
26          public System.IO.FileInfo XmlFile { get; set; }          public System.IO.FileInfo XmlFile { get; set; }
27          public System.Xml.Linq.XDocument XmlDoc { get; set; }          public string XmlDoc { get; set; }
28          #endregion          #endregion
29          #region IXMLTV_PARSER Members          #region IXMLTV_PARSER Members
30          public IXMLTVSource Source { get; set; }          public IXMLTVSource Source { get; set; }
# Line 27  namespace libxmltv.Core Line 32  namespace libxmltv.Core
32          public Dictionary<int, IXMLTVProgram> Programs { get; set; }          public Dictionary<int, IXMLTVProgram> Programs { get; set; }
33          #endregion            #endregion  
34            
35            //internal IXMLTVSerializer<IXMLTVRuntimeInstance> Serializer
36            //{
37            //    get
38            //    {
39            //        return new XMLTVSerializer<IXMLTVRuntimeInstance>(this);
40            //    }
41            //}
42          //public void Dispose()          //public void Dispose()
43          //{          //{
44          //    IsDisposing = true;          //    IsDisposing = true;
45          //    //throw new NotImplementedException();          //    //throw new NotImplementedException();
46          //}          //}
47          public bool IsDisposing { get; private set; }          //public bool IsDisposing { get; private set; }
48    
49    
50            private event EventHandler<CancelEventArgs> CancelEvent = null;
51    
52            public bool IsAborting
53            {
54                get
55                {
56                    if (CancelEvent != null)
57                    {
58                        CancelEventArgs e = new CancelEventArgs();
59                        CancelEvent.Invoke(this, e);
60                        if (e.Cancel)
61                        {
62                            xmltv_logger.Log.Verbose.Debug.WriteLine("Detected Instance abort event...");
63                        }
64                        return e.Cancel;
65                    }
66                    return false;
67                }
68            }
69    
70    
71      }      }
72    
73      internal class XMLTVInstance : IDisposable      internal class XMLTVInstance : IDisposable

Legend:
Removed from v.45  
changed lines
  Added in v.50

  ViewVC Help
Powered by ViewVC 1.1.22