Esempio n. 1
0
        public static Macro LoadFromFile(string file)
        {
            Macro res = (Macro)XmlTool.DeserializeObject(file);

            res.m_pyfile = Path.ChangeExtension(file, ".py");
            return(res);
        }
Esempio n. 2
0
        public void EditProperties()
        {
            object macro = XmlTool.DeserializeObject(m_file.DataDiskPath);

            if (EditPropertiesForm.Run(macro, true))
            {
                XmlTool.SerializeObject(m_file.DataDiskPath, macro);
            }
        }
Esempio n. 3
0
 public void ReloadCustom()
 {
     try
     {
         m_customDrivers = (DbDriverSet)XmlTool.DeserializeObject(Path.Combine(Core.ConfigDirectory, "drivers.xml"));
     }
     catch (Exception)
     {
         m_customDrivers = new DbDriverSet();
     }
 }
Esempio n. 4
0
 public static void Load()
 {
     try
     {
         Instance = (UICache)XmlTool.DeserializeObject(Filename);
         if (Instance.ItemsForLoading.Count > 0 && Instance.Items.Count == 0)
         {
             Instance.ItemsForXml = Instance.ItemsForLoading;
             Instance.ItemsForLoading.Clear();
         }
     }
     catch (Exception)
     {
         Instance = new UICache();
     }
 }
Esempio n. 5
0
 public DbDriverManager()
 {
     try
     {
         m_customDrivers = (DbDriverSet)XmlTool.DeserializeObject(Path.Combine(Core.ConfigDirectory, "drivers.xml"));
     }
     catch (Exception)
     {
         m_customDrivers = new DbDriverSet();
     }
     try
     {
         m_systemDrivers = (DbDriverSet)XmlTool.DeserializeObject(Path.Combine(Core.LibDirectory, "drivers.xml"));
     }
     catch (Exception)
     {
         m_systemDrivers = new DbDriverSet();
     }
     foreach (DbDriverDefinition drv in m_systemDrivers.Drivers)
     {
         drv.IsSystem = true;
     }
 }