예제 #1
0
        public Branding LoadBranding()
        {
            Branding branding = new Branding();
            string   filename = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location), "Branding.xml");

            try
            {
                if (File.Exists(filename))
                {
                    XmlSerializer mySerializer =
                        new XmlSerializer(typeof(Branding));
                    FileStream myFileStream = new FileStream(filename, FileMode.Open);
                    branding = (Branding)mySerializer.Deserialize(myFileStream);
                    myFileStream.Close();
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
            return(branding);
        }
예제 #2
0
        public static Branding LoadBranding()
        {
            Branding branding = new Branding();
            string   filename = Path.Combine(Settings.ApplicationFolder, "Branding.xml");

            try
            {
                if (File.Exists(filename))
                {
                    XmlSerializer mySerializer =
                        new XmlSerializer(typeof(Branding));
                    FileStream myFileStream = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read);
                    branding = (Branding)mySerializer.Deserialize(myFileStream);
                    myFileStream.Close();
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
            return(branding);
        }
예제 #3
0
        public void Save(Branding branding)
        {
            if (branding == null)
                return;
            try
            {
                string filename = Path.Combine(DataFolder, "Branding.xml");
                XmlSerializer serializer = new XmlSerializer(typeof(Branding));
                // Create a FileStream to write with.

                Stream writer = new FileStream(filename, FileMode.Create);
                // Serialize the object, and close the TextWriter
                serializer.Serialize(writer, branding);
                writer.Close();
            }
            catch (Exception)
            {
                Log.Error("Unable to save session branding file");
            }
        }
예제 #4
0
 public Branding LoadBranding()
 {
     Branding branding = new Branding();
     string filename = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location), "Branding.xml");
     try
     {
         if (File.Exists(filename))
         {
             XmlSerializer mySerializer =
               new XmlSerializer(typeof(Branding));
             FileStream myFileStream = new FileStream(filename, FileMode.Open);
             branding = (Branding)mySerializer.Deserialize(myFileStream);
             myFileStream.Close();
         }
     }
     catch (Exception e)
     {
         Log.Error(e);
     }
     return branding;
 }
예제 #5
0
 public Branding LoadBranding()
 {
     Branding branding = new Branding();
     string filename = Path.Combine(ApplicationFolder, "Branding.xml");
     try
     {
         if (File.Exists(filename))
         {
             XmlSerializer mySerializer =
                 new XmlSerializer(typeof (Branding));
             FileStream myFileStream = new FileStream(filename, FileMode.Open);
             branding = (Branding) mySerializer.Deserialize(myFileStream);
             myFileStream.Close();
         }
     }
     catch (Exception e)
     {
         Log.Error(e);
     }
     return branding;
 }
예제 #6
0
 public static void Configure(string logFile)
 {
     Configure(AppName, logFile);
     Log.LogDebug += Log_LogDebug;
     Log.LogError += Log_LogError;
     Log.Debug(
         "--------------------------------===========================Application starting===========================--------------------------------");
     try
     {
         Log.Debug("Application version : " + Assembly.GetEntryAssembly().GetName().Version);
     }
     catch {}
     Analytics = new Analytics();
     DeviceManager = new CameraDeviceManager();
     ExternalDeviceManager = new ExternalDeviceManager();
     Trigger = new TriggerClass();
     ActionManager = new ActionManager();
     QueueManager = new QueueManager();
     Branding = new Branding();
     ScriptManager = new ScriptManager();
     PluginManager = new PluginManager();
     FilenameTemplateManager = new FilenameTemplateManager();
     _pipeServer = new PipeServerT();
     _pipeServer.Listen("DCCPipe");
 }