Exemplo n.º 1
0
        public WizardDialog(Settings.Settings settings)
        {
            Settings = settings;
            InitializeComponent();

            Steps = new List <WizardStep>();
        }
Exemplo n.º 2
0
        private void btnSettings_Click(object sender, EventArgs e)
        {
            pnlChoise.Location = new Point(150, 122);

            Settings.Settings settings = new Settings.Settings();
            ShowInPanelView(settings);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Constructor
 /// </summary>
 public TeamspeakProcessor(Settings.Settings Settings)
 {
     internalSettings = Settings;
     done = false;
     paused = false;
     shutdowndone = false;
 }
Exemplo n.º 4
0
        private void printToFile(MemoryStream ms, string name, StreamWriter logFile = null)
        {
            //Console.WriteLine(ms.Position);
            Settings.Settings settings = SettingsManager.Load();
            var buffer = new byte[4];
            var start  = ms.Position;

            ms.Read(buffer, 0, buffer.Length);
            uint blockLenComp = BitConverter.ToUInt32(buffer, 0);

            ms.Read(buffer, 0, buffer.Length);
            uint blockLenUnComp = BitConverter.ToUInt32(buffer, 0);

            var subBlockBuffer = new byte[blockLenComp - 4];

            ms.Read(subBlockBuffer, 0, subBlockBuffer.Length);
            var end = ms.Position;

            ms.Seek(0, SeekOrigin.Current);
            var subBlockData = Compressor.Decomp(subBlockBuffer);
            var uncompLength = subBlockData.Length;

            using (var fs = new FileStream(Path.Combine(settings.SavePath, name), FileMode.OpenOrCreate))
            {
                fs.Write(subBlockData, 0, subBlockData.Length);
                fs.Flush();
            }
            if (logFile != null)
            {
                logFile.WriteLine("{0}: {1}/{2}/{3}", name, start, end, uncompLength);
            }
            //ms.Seek(2, SeekOrigin.Current);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Initial a new LogFile-Writer
 /// </summary>
 /// <param name="procControle">Controle to controle the backup or restore process</param>
 /// <param name="procControle">Logfile Mode, create or restore a backup</param>
 /// <param name="progressStore">The store for the progress</param>
 /// <param name="writeLogFile">Should Logfiles been written. If it is false, no Logfiles will be created.</param>
 public LogFile(Settings.Settings procControle, TaskControle.ControleMode mode, ProgressStore progressStore, bool writeLogFile)
 {
     this._mode          = mode;
     this._progressStore = progressStore;
     this._procControle  = procControle;
     this._writeLogFile  = writeLogFile;
 }
Exemplo n.º 6
0
        public ScreenShotModel(VideoSourcesViewModel videoSourcesViewModel,
                               ISystemTray systemTray,
                               IRegionProvider regionProvider,
                               IMainWindow mainWindow,
                               IVideoSourcePicker sourcePicker,
                               IAudioPlayer audioPlayer,
                               IEnumerable <IImageWriterItem> imageWriters,
                               Settings.Settings settings,
                               LanguageManager loc,
                               IPlatformServices platformServices)
        {
            _videoSourcesViewModel = videoSourcesViewModel;
            _systemTray            = systemTray;
            _regionProvider        = regionProvider;
            _mainWindow            = mainWindow;
            _sourcePicker          = sourcePicker;
            _audioPlayer           = audioPlayer;
            _settings         = settings;
            _loc              = loc;
            _platformServices = platformServices;

            AvailableImageWriters = imageWriters.ToList();

            if (!AvailableImageWriters.Any(imageWriterItem => imageWriterItem.Active))
            {
                AvailableImageWriters[0].Active = true;
            }
        }
Exemplo n.º 7
0
        public TestBase()
        {
            if (TestBase._settings == null)
            {
                var dir  = Directory.GetCurrentDirectory();
                var path = Path.Combine(dir, TestBase.SettingsName);

                if (!File.Exists(path))
                {
                    var tmplPath = Path.Combine(dir, TestBase.SettingsTemplateName);
                    if (!File.Exists(tmplPath))
                    {
                        throw new InvalidOperationException("File[settings.template.json] Not Found.");
                    }

                    try
                    {
                        File.Copy(tmplPath, path);
                    }
                    catch (Exception ex)
                    {
                        throw new InvalidOperationException("File[settings.template.json] Copy Failed.", ex);
                    }
                }

                var json = File.ReadAllText(path, Encoding.UTF8);
                TestBase._settings = JsonConvert
                                     .DeserializeObject <MopidySharpTest.Settings.Settings>(json);
            }

            Mopidy.Settings.ConnectionType = Mopidy.Settings.Connection.WebSocket;
            //Mopidy.Settings.ConnectionType = Mopidy.Settings.Connection.HttpPost;
            Mopidy.Settings.ServerAddress = TestBase._settings.ServerAddress;
            Mopidy.Settings.ServerPort    = TestBase._settings.Port;
        }
Exemplo n.º 8
0
        public ImportProject(Settings.Settings settings) : base(settings)
        {
            _importProjectPath = new ImportProjectPath();
            _importFiles       = new ImportProjectFiles();

            AddSteps(_importProjectPath, _importFiles);
        }
Exemplo n.º 9
0
 private static void CreateInputSetting(Panel parent, Settings.Settings settings, string categoryName, string propertyName, object propertyObject)
 {
     CreateSettingsEntry(parent, $"MENU.SETTINGS.TABS.{categoryName.ToUpper()}.{propertyName.ToUpper()}.TITLE", Utils.GetPropertyValue(propertyObject, propertyName).ToString(), $"MENU.SETTINGS.TABS.{categoryName.ToUpper()}.{propertyName.ToUpper()}.DESCRIPTION", (value) =>
     {
         UpdateSettingsProperty(settings, propertyObject, propertyName, value);
     });
 }
Exemplo n.º 10
0
 /// <summary>
 /// Each HTTP processor object handles one client.  If Keep-Alive is enabled then this
 /// object will be reused for subsequent requests until the client breaks keep-alive.
 /// This usually happens when it times out.  Because this could easily lead to a DoS
 /// attack, we keep track of the number of open processors and only allow 100 to be
 /// persistent active at any one time.  Additionally, we do not allow more than 500
 /// outstanding requests.
 /// </summary>
 /// <param name="docRoot">Root-Directory of the HTTP Server</param>
 /// <param name="s">the Socket to work with</param>
 /// <param name="webserver">the "master" HttpServer Object of this Client</param>
 public HttpProcessor(Socket s, Settings.Settings Settings)
 {
     internalSettings = Settings;
     this.s = s;
     docRootFile = new FileInfo(internalSettings.HTTP.DocumentRoot);
     headers = new Hashtable();
     Template_Processor = new TemplateProcessor(internalSettings);
 }
Exemplo n.º 11
0
 public FileHelper(Settings.Settings setting,
                   IDbWriterFactory dbWriterFactory,
                   IDataBaseServiceFactory dataBaseServiceFactory)
 {
     _setting                = setting;
     _dbWriterFactory        = dbWriterFactory;
     _dataBaseServiceFactory = dataBaseServiceFactory;
 }
Exemplo n.º 12
0
 public void SerializeSettings()
 {
     Settings.Settings settings = new Settings.Settings
                                  {
                                      Languages = new List<Language> {Misc.GetLanguageSlovenian()},
                                  };
     XmlSerialization xmlSerialization = new XmlSerialization();
     xmlSerialization.Serialize(settings, FileName);
 }
Exemplo n.º 13
0
 public TestBootstrapper()
 {
     UniqueNameCreator      = new UniqueNameCreator();
     LocalActorRefFactory   = new DefaultLocalActorRefFactory();
     DeadLetterActorCreator = (path, system) => new DeadLetterActorRef(path, system);
     Scheduler             = new SynchronousScheduler();
     DefaultMailboxCreator = scheduler => new UnboundedMailbox(scheduler);
     Settings = new Settings.Settings();
 }
Exemplo n.º 14
0
 /// <summary>
 /// Constructor
 /// </summary>
 public BeaconProcessor(Settings.Settings Settings)
 {
     PlaySounds = new List<string>();
     internalSettings = Settings;
     done = false;
     restart = false;
     currentlyPlaying = false;
     shutdowndone = false;
 }
Exemplo n.º 15
0
        private void ExportKdTreeExecute(object obj)
        {
            /*foreach (var chunk in chunks)
             * {
             *  using (var ms = new MemoryStream(chunk)){
             *      var buffer = new byte[4];
             *      ms.Read(buffer, 0, buffer.Length);
             *      uint uncompLength = BitConverter.ToUInt32(buffer, 0);
             *      var subBlockBuffer=new byte[uncompLength];
             *      Compressor.Decomp(subBlockBuffer);
             *  }
             * {
             *
             *
             * //deblockify();*/
            Settings.Settings settings = SettingsManager.Load();
            var logFile = new StreamWriter(new FileStream(Path.Combine(settings.SavePath, "exportLogFile.txt"), FileMode.OpenOrCreate));

            logFile.WriteLine("kdf values:");
            foreach (var propValue in this.ParentProperty.Instance.PropertyValues)
            {
                logFile.WriteLine("{0}:\t{1}", propValue.Property.Name, propValue.Value);
                //propValue.Property.Name
            }

            var data = GetBytes();

            logFile.WriteLine("blob export data, start byte/end byte/uncompressed length:");
            using (var ms = new MemoryStream(data))
            {
                var buffer = new byte[4];

                ms.Read(buffer, 0, buffer.Length);
                uint fileLength = BitConverter.ToUInt32(buffer, 0);
                //printToFile(ms, "VertexPositionBuffer", logFile);

                readVertexes(ms);

                printToFile(ms, "VertexNormaleBuffer", logFile);
                //ms.Seek(8, SeekOrigin.Current);
                uncompressedPrintToFile(ms, "3rdPartUnComp", 8, logFile);
                printToFile(ms, "IndexBuffer", logFile);
                //ms.Seek(4, SeekOrigin.Current);
                uncompressedPrintToFile(ms, "5thPartUnComp", 4, logFile);
                printToFile(ms, "TriangleIndexBuffer", logFile);
                var off = ms.Position % 8;
                if (off == 0)
                {
                    off = 8;
                }
                //ms.Seek(72-off, SeekOrigin.Current);
                uncompressedPrintToFile(ms, "7thPartUncomp", (int)(72 - off), logFile);
                printToFile(ms, "Subtrees", logFile);
            }
            logFile.Flush();
        }
Exemplo n.º 16
0
        public async Task <bool> GetLoginValidityAsync()
        {
            Settings.Settings legacySettings = Settings.Settings.Instance;
            DsrProfile        dsr            = await new LoginController().GetByDsrPhoneNumberAsync(legacySettings.DsrPhone);

            return(this.LoginValid(
                       dsr.LastOnlineLogin,
                       DateTime.Now,
                       legacySettings.ExpirePeriodInDays));
        }
Exemplo n.º 17
0
        public void TestShell()
        {
            var mockCoordinator = new Mock<IDialogCoordinator>();
            ISettings settings = new Settings.Settings(Settings.Serializers.SettingsSerializerFactory.Get("JSON"), "settings.TEST");
            settings.InitializeDefaults();
            ShellViewModel svm = new ShellViewModel(new StubbedWindowManager(), mockCoordinator.Object, settings);
            var mock = new Mock<IrcConnection>();

            svm.ActivateItem(new IrcTabViewModel(mock.Object) {DisplayName = "Test"});
            Assert.IsTrue(svm.Tabs.Count == 1);
        }
Exemplo n.º 18
0
 /// <summary>
 /// Constructor
 /// </summary>
 public SerialportProcessor(Settings.Settings Settings)
 {
     internalSettings = Settings;
     done = false;
     Enabled = false;
     Enable = false;
     Disable = true;
     paused = false;
     Port = null;
     shutdowndone = false;
 }
Exemplo n.º 19
0
        private static void CreateSwitchSetting(Panel parent, Settings.Settings settings, string categoryName, string propertyName, object propertyObject)
        {
            TranslationCheckbox checkbox = parent.Add.TranslationCheckbox(new TranslationData($"MENU.SETTINGS.TABS.{categoryName.ToUpper()}.{propertyName.ToUpper()}.TITLE"));

            checkbox.AddTooltip(new TranslationData($"MENU.SETTINGS.TABS.{categoryName.ToUpper()}.{propertyName.ToUpper()}.DESCRIPTION"));
            checkbox.Checked = Utils.GetPropertyValue <bool>(propertyObject, propertyName);
            checkbox.AddEventListener("onchange", (panelEvent) =>
            {
                UpdateSettingsProperty(settings, propertyObject, propertyName, checkbox.Checked);
            });
        }
Exemplo n.º 20
0
 /// <inheritdoc />
 public void Initialize(Settings.Settings settings)
 {
     if (settings.ColorSettings.ElsEnabled)
     {
         _colors = new ElsColors(_elsSettingsManager);
     }
     else
     {
         _colors = new PluginConfigColors(settings.ColorSettings);
     }
 }
 static void Main(string[] args)
 {
     var settings = new Settings.Settings();
     //settings.Changed += (obj, __) => Console.WriteLine("Root changed!"); //\nNew:\n{0}", obj);
     settings.Mail.Changed += (obj, __) => Console.WriteLine("Mail changed!"); //\nNew:\n{0}", obj);
     settings.Mail.Pop3.Changed += (obj, __) => Console.WriteLine("Pop3 changed!"); //\nNew:\n{0}", obj);
     Console.WriteLine(string.Format("Default settings:\n{0}", settings));
     settings.LoadAndWatch(@"..\..\RuntimeSettings.yaml");
     Console.WriteLine(string.Format("Loaded settings:\n{0}", settings));
     Console.ReadLine();
 }
Exemplo n.º 22
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (_settings == null)
            {
                _settings = new Settings.Settings();
            }
            textBoxServices.Lines = _settings.Services ?? new string[0];
            FillUpdateComboBox();
            GetFormLocationSize(_parent);
        }
Exemplo n.º 23
0
        private void ExportRawExecute(object obj)
        {
            Settings.Settings settings = SettingsManager.Load();

            var buffer = GetBytes();

            using (var fs = new FileStream(Path.Combine(settings.SavePath, string.Format("blobdump_{0}", DateTime.Now.ToString("dd_MM_yyyy_HH_mm_ff"))), FileMode.OpenOrCreate))
            {
                fs.Write(buffer, 0, buffer.Length);
                fs.Flush();
            }
        }
Exemplo n.º 24
0
        public NewProject(Settings.Settings settings, ProjectType projectType) : base(settings)
        {
            _newProjectPath   = new NewProjectPath();
            _projectTemplates = new ProjectTemplates();

            ProjectType = projectType;
            _newProjectPath.Directory =
                string.IsNullOrWhiteSpace(Settings.DefaultProjectDirectory)
                                        ? Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
                                        : Settings.DefaultProjectDirectory;

            AddSteps(_newProjectPath, _projectTemplates);
        }
Exemplo n.º 25
0
        public DiskWriter(ISystemTray systemTray,
                          IMessageProvider messageProvider,
                          Settings.Settings settings,
                          LanguageManager loc,
                          IRecentList recentList)
        {
            _systemTray      = systemTray;
            _messageProvider = messageProvider;
            _settings        = settings;
            _loc             = loc;
            _recentList      = recentList;

            loc.LanguageChanged += cultureInfo => RaisePropertyChanged(nameof(Display));
        }
 public void StartServer(Settings.Settings settings)
 {
     try
     {
         server       = new ServerObject(ref settings);
         listenThread = new Thread(new ThreadStart(server.Listen));
         listenThread.Start();
     }
     catch (Exception ex)
     {
         server.Disconnect();
         Console.WriteLine(ex.Message);
     }
 }
Exemplo n.º 27
0
        public void TestShell()
        {
            var       mockCoordinator = new Mock <IDialogCoordinator>();
            ISettings settings        = new Settings.Settings(Settings.Serializers.SettingsSerializerFactory.Get("JSON"), "settings.TEST");

            settings.InitializeDefaults();
            ShellViewModel svm  = new ShellViewModel(new StubbedWindowManager(), mockCoordinator.Object, settings);
            var            mock = new Mock <IrcConnection>();

            svm.ActivateItem(new IrcTabViewModel(mock.Object)
            {
                DisplayName = "Test"
            });
            Assert.IsTrue(svm.Tabs.Count == 1);
        }
Exemplo n.º 28
0
        /// Sauvegarde la configuration courante :
        /// - Position et taille de la ListBar
        /// - Position et taille de la ToolBar

        public void SaveConfiguration()
        {
            Settings.Settings settings = SettingManager.Instance.Settings;
            if (listBar != null)
            {
                settings.ListBarSize     = listBar.Size;
                settings.ListBarLocation = listBar.Location;
            }
            if (toolBar != null)
            {
                settings.ToolBarSize     = toolBar.Size;
                settings.ToolBarLocation = toolBar.Location;
            }
            SettingManager.Instance.Save();
        }
Exemplo n.º 29
0
 public RememberByName(Settings.Settings settings,
                       VideoSourcesViewModel videoSourcesViewModel,
                       VideoWritersViewModel videoWritersViewModel,
                       AudioSource audioSource,
                       IWebCamProvider webCamProvider,
                       ScreenShotModel screenShotModel,
                       IEnumerable <IVideoSourceProvider> videoSourceProviders)
 {
     _settings = settings;
     _videoSourcesViewModel = videoSourcesViewModel;
     _videoWritersViewModel = videoWritersViewModel;
     _audioSource           = audioSource;
     _webCamProvider        = webCamProvider;
     _screenShotModel       = screenShotModel;
     _videoSourceProviders  = videoSourceProviders;
 }
Exemplo n.º 30
0
 /*private void deblockify()
  * {
  *  var data = GetBytes();
  *  using (var ms = new MemoryStream(data))
  *  {
  *
  *      var buffer = new byte[4];
  *      ms.Read(buffer, 0, buffer.Length);
  *      uint fileLength = BitConverter.ToUInt32(buffer, 0);
  *      chunks.Add(getNextChunk(ms));
  *      chunks.Add(getNextChunk(ms));
  *      ms.Read(buffer, 0, buffer.Length);
  *      ms.Read(buffer, 0, buffer.Length);
  *      mysteryNumber = BitConverter.ToUInt32(buffer, 0);
  *      chunks.Add(getNextChunk(ms));
  *      ms.Read(buffer, 0, buffer.Length);
  *      chunks.Add(getNextChunk(ms));
  *      mysteryChunk = new byte[mysteryChunkLenth];
  *      ms.Read(mysteryChunk, 0, mysteryChunk.Length);
  *      chunks.Add(getNextChunk(ms));
  *  }
  *
  * }*/
 /*private byte[] getNextChunk(MemoryStream ms)
  * {
  *  var buffer = new byte[4];
  *  ms.Read(buffer, 0, buffer.Length);
  *  uint chunkLength = BitConverter.ToUInt32(buffer, 0);
  *  byte[] bytes = new byte[chunkLength];
  *  ms.Read(bytes, 0, bytes.Length);
  *  return bytes;
  * }*/
 private void uncompressedPrintToFile(MemoryStream ms, string name, int length, StreamWriter logFile = null)
 {
     Settings.Settings settings = SettingsManager.Load();
     using (var fs = new FileStream(Path.Combine(settings.SavePath, name), FileMode.OpenOrCreate))
     {
         var buffer = new byte[length];
         var start  = ms.Position;
         ms.Read(buffer, 0, length);
         var end = ms.Position;
         fs.Write(buffer, 0, length);
         fs.Flush();
         if (logFile != null)
         {
             logFile.WriteLine("{0}: {1}/{2}/{3}", name, start, end, length);
         }
     }
 }
Exemplo n.º 31
0
        /*private float getHalfFloat(byte[] bytes){
         *
         * }*/
        public void readVertexes(MemoryStream ms)
        {
            Settings.Settings settings = SettingsManager.Load();
            var buffer = new byte[4];
            var start  = ms.Position;

            ms.Read(buffer, 0, buffer.Length);
            uint blockLenComp = BitConverter.ToUInt32(buffer, 0);

            ms.Read(buffer, 0, buffer.Length);
            uint blockLenUnComp = BitConverter.ToUInt32(buffer, 0);

            var subBlockBuffer = new byte[blockLenComp - 4];

            ms.Read(subBlockBuffer, 0, subBlockBuffer.Length);
            var end = ms.Position;

            ms.Seek(0, SeekOrigin.Current);
            var subBlockData = Compressor.Decomp(subBlockBuffer);
            var uncompLength = subBlockData.Length;

            var vertexFile   = new StreamWriter(new FileStream(Path.Combine(settings.SavePath, "vertexes.csv"), FileMode.Create));
            var readPosition = 0;
            var nbVertexes   = BitConverter.ToInt32(subBlockData, readPosition);

            readPosition += 4;
            var unknown = BitConverter.ToInt32(subBlockData, readPosition);

            readPosition += 4;
            //vertexFile.WriteLine("{0}\t{1}\t{2}", nbVertexes, unknown, 0);
            for (var i = 0; i < nbVertexes; i++)
            {
                for (var j = 0; j < 3; j++)
                {
                    var b = new byte[2];
                    b[1] = subBlockData[readPosition++];
                    b[0] = subBlockData[readPosition++];
                    //var val = Half.ToHalf(b, 0);//
                    var val = BitConverter.ToUInt16(b, 0);
                    vertexFile.Write("{0}\t", val);
                    //readPosition += 2;
                }
                vertexFile.WriteLine();
            }
            vertexFile.Flush();
        }
Exemplo n.º 32
0
        public RecordingModel(Settings.Settings settings,
                              LanguageManager languageManager,
                              ISystemTray systemTray,
                              IRegionProvider regionProvider,
                              WebCamOverlay webcamOverlay,
                              IMainWindow mainWindow,
                              IPreviewWindow previewWindow,
                              VideoSourcesViewModel videoSourcesViewModel,
                              VideoWritersViewModel videoWritersViewModel,
                              AudioSource audioSource,
                              IWebCamProvider webCamProvider,
                              KeymapViewModel keymap,
                              IAudioPlayer audioPlayer,
                              IRecentList recentList,
                              TimerModel timerModel) : base(settings, languageManager)
        {
            _systemTray            = systemTray;
            _regionProvider        = regionProvider;
            _webcamOverlay         = webcamOverlay;
            _mainWindow            = mainWindow;
            _previewWindow         = previewWindow;
            _videoSourcesViewModel = videoSourcesViewModel;
            _videoWritersViewModel = videoWritersViewModel;
            _audioSource           = audioSource;
            _webCamProvider        = webCamProvider;
            _keymap      = keymap;
            _audioPlayer = audioPlayer;
            _recentList  = recentList;
            _timerModel  = timerModel;

            SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;

            timerModel.CountdownElapsed += InternalStartRecording;
            timerModel.DurationElapsed  += async() =>
            {
                if (_syncContext != null)
                {
                    _syncContext.Post(async state => await StopRecording(), null);
                }
                else
                {
                    await StopRecording();
                }
            };
        }
Exemplo n.º 33
0
        private static void UpdateSettingsProperty <T>(Settings.Settings settings, object propertyObject, string propertyName, T value)
        {
            Utils.SetPropertyValue(propertyObject, propertyName, value);

            if (Gamemode.Game.Instance.Debug)
            {
                Log.Debug($"Set {propertyName} to {value}");
            }

            if (settings is ServerSettings serverSettings)
            {
                SettingFunctions.SendSettingsToServer(serverSettings);
            }
            else
            {
                GameEvent.Register(new Events.Settings.ChangeEvent());
            }
        }
Exemplo n.º 34
0
        public async Task On3CommasLinkClicked()
        {
            var settingsPersisted = !string.IsNullOrWhiteSpace(Properties.Settings.Default.ApiKey3Commas);
            var settings          = new Settings.Settings(settingsPersisted, "3Commas API Credentials", "Permissions Needed: BotsRead, BotsWrite, AccountsRead", _keys.ApiKey3Commas, _keys.Secret3Commas);
            var dr = settings.ShowDialog();

            if (dr == DialogResult.OK)
            {
                _keys.ApiKey3Commas = settings.ApiKey;
                _keys.Secret3Commas = settings.Secret;

                Properties.Settings.Default.ApiKey3Commas = settings.PersistKeys ? settings.ApiKey : "";
                Properties.Settings.Default.Secret3Commas = settings.PersistKeys ? settings.Secret : "";
                Properties.Settings.Default.Save();

                await RefreshBots();
            }
        }
Exemplo n.º 35
0
        public ImageUploadWriter(DiskWriter diskWriter,
                                 ISystemTray systemTray,
                                 IMessageProvider messageProvider,
                                 Settings.Settings settings,
                                 LanguageManager languageManager,
                                 IRecentList recentList,
                                 IImageUploader imgUploader)
        {
            _imgUploader = imgUploader;

            _diskWriter      = diskWriter;
            _systemTray      = systemTray;
            _messageProvider = messageProvider;
            _settings        = settings;
            _loc             = languageManager;
            _recentList      = recentList;

            languageManager.LanguageChanged += cultureInfo => RaisePropertyChanged(nameof(Display));
        }
Exemplo n.º 36
0
        public SettingsDialog()
        {
            InitializeComponent();
            AresSettings.ReadFromConfigFile();
            Settings.Settings settings = Settings.Settings.Instance;
            projectFileBox.Text = settings.RecentFiles.GetFiles().Count > 0 ? settings.RecentFiles.GetFiles()[0].FilePath : "";
            playerPathBox.Text  = FindLocalPlayer();
            musicFilesBox.Text  = settings.MusicDirectory;
            soundFilesBox.Text  = settings.SoundDirectory;
            tcpPortUpDown.Value = settings.TcpPort;
            udpPortUpDown.Value = settings.UdpPort;
            bool foundAddress   = false;
            bool foundV4Address = false;
            int  v4AddressIndex = 0;

            foreach (System.Net.IPAddress address in System.Net.Dns.GetHostAddresses(String.Empty))
            {
                if (address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
                {
                    foundV4Address = true;
                    v4AddressIndex = ipAddressBox.Items.Count;
                }
                String s = address.ToString();
                ipAddressBox.Items.Add(s);
                if (s.Equals(settings.IPAddress))
                {
                    foundAddress = true;
                }
            }
            if (foundAddress)
            {
                ipAddressBox.SelectedItem = settings.IPAddress;
            }
            else if (ipAddressBox.Items.Count > 0)
            {
                ipAddressBox.SelectedIndex = foundV4Address ? v4AddressIndex : 0;
                settings.IPAddress         = ipAddressBox.SelectedItem.ToString();
            }
            else
            {
                ipAddressBox.Enabled = false;
            }
        }
Exemplo n.º 37
0
        public static byte[] CreateReport(byte[] exportZip, Settings.Settings settings, IEnumerable <ExcelWorksheet> customSheets)
        {
            using (var inputStream = new MemoryStream(exportZip))
                using (var outputStream = new MemoryStream())
                    using (var excelFile = new ExcelPackage())
                    {
                        var loader = ZipUtilities.ReadArchive(
                            inputStream,
                            entry => entry.FullName == "apple_health_export/export.xml",
                            entry => new XmlReaderExportLoader(entry.Open()))
                                     .FirstOrDefault();

                        BuildReport(loader.Records, loader.Workouts, excelFile.Workbook, settings, customSheets);

                        excelFile.SaveAs(outputStream);

                        return(outputStream.ToArray());
                    }
        }
Exemplo n.º 38
0
        private void InitSettings()
        {
            settings = Util.LoadSettings();
            if (settings.Login == null)
                settings.Login = new Login();

            login = settings.Login;

            if (login != null)
            {
                if (!string.IsNullOrEmpty(login.User))
                    txtUsername.Text = login.User;

                if (!string.IsNullOrEmpty(login.Server))
                    txtServer.Text = login.Server;

                if (!string.IsNullOrEmpty(login.Password))
                    txtPassword.Text    = login.Password;
            }
        }
Exemplo n.º 39
0
 /// <summary>
 /// Gets settings from xml file
 /// </summary>
 private void LoadSettings()
 {
     try
     {
         _settings = _settings.FromXml();
     }
     catch (Exception)
     {
         Logging.Logger.Log(Logging.SeverityGrades.Warning, "Settings file is corrupted, loading default values");
         _settings = new Settings.Settings();
         _settings.ToXml();
     }
 }
Exemplo n.º 40
0
        /// <summary>
        /// Constructor of the Templace Processor
        /// </summary>
        /// <param name="vcrscheduler">the VCRScheduler...so we can get the </param>
        public TemplateProcessor(Settings.Settings Settings)
        {
            internalSettings = Settings;

            SettingsNames = internalSettings.GetSettingsNameListings();
        }
Exemplo n.º 41
0
 public HttpServer(Settings.Settings Settings)
 {
     internalSettings = Settings;
 }