Example #1
0
        private void btnTestDatabaseConnection_Click(object sender, EventArgs e)
        {
            SaveValues();
            RegistrySettings.writeValues();
            CoreFeature.getInstance().resetConnection();
            if (CoreFeature.getInstance().getDataConnection() == null)
            {
                MessageBox.Show("Can not connect to the database");
            }
            else
            {
                MessageBox.Show("Connection established");
            }

            /*
             * try
             * {
             *  SqlConnection con = new SqlConnection("Server=" + RegistrySettings.SqlHost + ";Database=" + RegistrySettings.SqlDatabase + ";Uid=" + RegistrySettings.SqlUsername + ";Pwd=" + RegistrySettings.SqlPassword);
             *  con.Open();
             *  if (con.State == ConnectionState.Open)
             *  {
             *      MessageBox.Show("Connection success!");
             *      con.Close();
             *      con.Dispose();
             *  }
             * }
             * catch (Exception ex)
             * {
             *  MessageBox.Show("Connection error : " + ex.Message);
             * }*/
        }
        private static JSONObject LoadProjectManifest()
        {
            string     manifestString = File.ReadAllText(RegistrySettings.Instance().ProjectManifestPath);
            JSONObject manifestJson   = JSONNode.Parse(manifestString).AsObject;

            return(manifestJson);
        }
Example #3
0
 static void UpdateRegistry()
 {
     if (Settings.UpdateRegistry)
     {
         RegistrySettings.WriteString("INSTALLDIR", Settings.InstallDir + @"\");
     }
 }
Example #4
0
 public RegistrySettingsTest()
 {
     settings = new RegistrySettings {
         Key = @"Software\WinampNowPlayingToFile-test"
     };
     CleanUp();
 }
Example #5
0
        /// <summary>
        /// Will go load the mri for the given directory
        /// </summary>
        /// <param name="filename"></param>
        /// <exception cref="System.ArgumentException"></exception>
        private void loadMRI(string filename)
        {
            /* Try and load first (and to temp space). If we fail, it will throw an exception
             * And the rest of the code will not get run
             */
            CT newMri = CT.SmartLoad(filename);

            newMri.loadBitmapDataAllLayers();
            if (_mri != null) //save memory. TODO: use dispose instead
            {
                _mri.deleteFrames();
            }
            _mri  = newMri; //save it, now that we know it works
            _path = filename;
            RegistrySettings.saveSetting("TextureLastMRIImage", filename);

            textBoxXSize.Text      = _mri.width.ToString();
            textBoxYSize.Text      = _mri.height.ToString();
            textBoxZSize.Text      = _mri.depth.ToString();
            textBoxXVoxel.Text     = _mri.voxelSizeX.ToString();
            textBoxYVoxel.Text     = _mri.voxelSizeY.ToString();
            textBoxZVoxel.Text     = _mri.voxelSizeZ.ToString();
            textBoxLayersSize.Text = _mri.Layers.ToString();
            labelMax.Text          = (_mri.depth - 1).ToString();

            numericUpDownLayer.Minimum = 0;
            numericUpDownLayer.Maximum = _mri.Layers - 1;
            numericUpDownLayer.Value   = 0;

            trackBar1.Value   = 0;
            trackBar1.Maximum = _mri.depth - 1;
            loadFrame();
        }
Example #6
0
        private void buttonReg_Click(object sender, System.EventArgs e)
        {
            RegistrySettings rs = new RegistrySettings();

            System.Text.StringBuilder sBldr = new System.Text.StringBuilder();

            sBldr.Append(String.Format("CopyToDir: {0}\n", rs.GetCopyToDir()));
            sBldr.Append(String.Format("Size: {0}, {1}\n", rs.GetWindowSize().Width, rs.GetWindowSize().Height));
            sBldr.Append(String.Format("Position: {0}, {1}\n", rs.GetWindowPosition().X, rs.GetWindowPosition().Y));

            string[] mruArray = { "NOT SET", "NOT SET", "NOT SET", "NOT SET" };
            System.Collections.ArrayList mruList = rs.GetMRUList();
            for (int i = 0; i < mruList.Count; i++)
            {
                mruArray[i] = (string)mruList[i];
            }
            sBldr.Append(String.Format("MRU List:\n\t{0}\n\t{1}\n\t{2}\n\t{3}",
                                       mruArray[0], mruArray[1], mruArray[2], mruArray[3]));

            ConfigFile cf = rs.GetConfigSettings();

            if (cf != null)
            {
                sBldr.Append(String.Format("\nConfig Data\n\t{0}, {1}, {2}, {3}, {4}", cf.IntervalTime, cf.Randomize, cf.ScriptFileList[0].FileName, cf.ScriptFileList[1].FileName, cf.ScriptFileList[2].FileName));
            }
            string outStr = sBldr.ToString();

            MessageBox.Show(outStr);
        }
Example #7
0
        public static bool Init(string[] args)
        {
            InstallDir    = RegistrySettings.ReadString("INSTALLDIR");
            DeleteCompany = true;

            ParseCommandLine(args);

            if (!string.IsNullOrEmpty(InstallDir))
            {
                InstallDir = InstallDir.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
            }

            InstallDirWeb = Path.Combine(InstallDir, @"Code\_Source\Web");

            bool result = false;

            switch (Action)
            {
            case "INSTALL":
            case "REMOVE":
                result = (InstallDir != null);
                break;
            }

            return(result);
        }
Example #8
0
            public override PersistentStore GetSubsection(string subsectionName)
            {
                RegistryKey subKey = null;

                try
                {
                    //Open the registry key containing the settings
                    subKey = Key.OpenSubKey(subsectionName, true);
                    if (subKey == null)
                    {
                        subKey = Key.CreateSubKey(subsectionName);
                    }

                    PersistentStore result = new RegistrySettings(subKey);
                    subKey = null;
                    return(result);
                }
                finally
                {
                    if (subKey != null)
                    {
                        subKey.Close();
                    }
                }
            }
Example #9
0
        private async Task LoadDb()
        {
            Settings = SettingsRepo.Load().Result;

            SetThrottleSpeed(
                Settings.ThrottleSpeed == 0 || Settings.ThrottleSpeed == -1
                    ? "-1"
                    : (Convert.ToDouble(Settings.ThrottleSpeed) / 1000000).ToString());

            var initialFilesCount = await MusicFileRepo.CountAll();

            var issueCount = await MusicFileRepo.CountIssues();

            var uploadsCount = await MusicFileRepo.CountUploaded();

            await RegistrySettings.SetStartWithWindows(Settings.StartWithWindows);

            SetStartWithWindows(Settings.StartWithWindows);
            SetDiscoveredFilesLabel(InitialFilesCount.ToString());
            await BindWatchFoldersList();
            await InitialiseFolderWatchers();

            InitialFilesCount = Task.FromResult(initialFilesCount).Result;
            SetIssuesLabel(Task.FromResult(issueCount).Result.ToString());
            SetUploadedLabel(Task.FromResult(uploadsCount).Result.ToString());

            RunDebugCommands();
        }
        public Login()
        {
            this.InitializeComponent();

            LogManager.WriteLog("Inside Login Constructor", LogManager.enumLogLevel.Info);

            ExchangeConfigRegistryEntities.ExchangeConnectionString = RegistrySettings.ExchangeConnectionString();
            //RefreshControls();
            txtUname.Focus();
            // Insert code required on object creation below this point.

            try
            {
                SqlConnection sqlConnection = new SqlConnection(ExchangeConfigRegistryEntities.ExchangeConnectionString);
                isValidConnectionString = true;
                tbCopyrightInfo.Text    = Settings.CopyRightInfo;
            }
            catch (ArgumentException aEx)
            {
                ExceptionManager.Publish(aEx);
                isValidConnectionString = false;
            }

            MessageBox.parentOwner = this;
            txtPWD.CommandBindings.Add(new CommandBinding(ApplicationCommands.Paste, DisablePastePasswordField));
        }
Example #11
0
        public static bool Init(string[] args)
        {
            ReadArgsFromSystem();
            ParseCommandLine(args);

            AppendSlash(ref _InstallDir);
            AppendSlash(ref _InstallDirWeb);
            AppendSlash(ref _BackupDir);
            AppendSlash(ref _UpdatesDir);

            if (_InstallDirWeb == null)
            {
                _InstallDirWeb = _InstallDir + "Web\\";
            }
            if (_LogFile == null)
            {
                _LogFile = "update.log";
            }
            if (_IbnSqlUser == null)
            {
                _IbnSqlUser = "******";
            }

            RegistrySettings.WriteString(constIbnSqlUser, _IbnSqlUser);

            return(_InstallDir != null && _SqlServer != null &&
                   _SqlUser != null && _SqlDatabase != null &&
                   _SiteId > 0);
        }
Example #12
0
        private Settings()
        {
            RegistryKey eraserKey = null;

            try
            {
                //Open the registry key containing the settings
                eraserKey = Registry.CurrentUser.OpenSubKey(Program.SettingsPath, true);
                if (eraserKey == null)
                {
                    eraserKey = Registry.CurrentUser.CreateSubKey(Program.SettingsPath);
                }

                //Return the Settings object.
                registry  = new RegistrySettings(eraserKey);
                eraserKey = null;
            }
            finally
            {
                if (eraserKey != null)
                {
                    eraserKey.Close();
                }
            }
        }
Example #13
0
        public Settings()
        {
            InitializeComponent();

            RegistrySettings.loadValues();


            ReadValues();
            SqlConnection connection = CoreFeature.getInstance().getDataConnection();

            /*
             * lvAccount.Items.Clear();
             *
             * if (connection != null)
             * {
             *  //email accounts
             *  SqlCommand cmd;
             *  SqlDataReader rdr;
             *  cmd = connection.CreateCommand();
             *  cmd.CommandText = "select name from account order by name";
             *  cmd.CommandType = CommandType.Text;
             *  rdr = cmd.ExecuteReader();
             *
             *  while (rdr.Read())
             *  {
             *      lvAccount.Items.Add(rdr.GetString(0));
             *  }
             *  cmd.Dispose();
             *  rdr.Dispose();
             *
             *  connection.Close();
             * }
             */
            cboDatabaseType.SelectedIndex = 0;
        }
Example #14
0
        public void ServerThreadStart()
        {
            RegistrySettings rs = new RegistrySettings();

            if (!rs.ReadSettings())
            {
                Console.WriteLine("CouldNotReadRegistryValues");
                return;
            }

            // Start java
            System.Diagnostics.Process process = new System.Diagnostics.Process();
            String JavaExecutable = "java";

            // Determine filename
            if (!string.IsNullOrEmpty(rs.JavaLocation))
            {
                process.StartInfo.FileName = Path.Combine(rs.JavaLocation, JavaExecutable);
            }
            else
            {
                process.StartInfo.FileName = JavaExecutable; // In path
            }
            process.StartInfo.Arguments = String.Format("{0} -cp \"{1}\" {2} \"{3}\"", rs.JVMOptions, rs.ClassPath, "Composestar.DotNET.MASTER.StarLightServer", "");
            //Log.LogMessageFromResources("JavaStartMessage", process.StartInfo.Arguments ) ;

            process.StartInfo.CreateNoWindow         = false;
            process.StartInfo.RedirectStandardOutput = false;
            process.StartInfo.UseShellExecute        = false;
            process.StartInfo.RedirectStandardError  = false;

            try
            {
                process.Start();
                while (!process.HasExited)
                {
                    Thread.Sleep(100);
                }
            }
            catch (Win32Exception e)
            {
                //if (e.NativeErrorCode == ErrorFileNotFound)
                //{
                //    Log.LogErrorFromResources("JavaExecutableNotFound", process.StartInfo.FileName);
                //}
                //else if (e.NativeErrorCode == ErrorAccessDenied)
                //{
                //    Log.LogErrorFromResources("JavaExecutableAccessDenied", process.StartInfo.FileName);
                //}
                //else
                //{
                //    Log.LogErrorFromResources("ExecutionException", e.ToString());
                //}
                //return false;
            }
            finally
            {
            }
        }
 private void OnAddButtonClicked()
 {
     ManifestUtils.AddRegistry(RegistrySettings.Instance().Registry);
     ShowPackageManager();
     UpdateAddButtonEnabled();
     UpdateRemoveButtonEnabled();
     UpdateAllStatus();
 }
Example #16
0
 protected override void OnStart(string[] args)
 {
     RegistrySettings.loadValues();
     CoreFeature.getInstance().LogActivity(LogLevel.Normal, "The service was started successfully. Will checking email every " + RegistrySettings.emailCheckInterval + " second(s)", EventLogEntryType.Information);
     timer          = new Timer(RegistrySettings.emailCheckInterval * 1000); // in seconds
     timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
     timer.Start();                                                          // <- important
 }
Example #17
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     SaveValues();
     RegistrySettings.writeValues();
     RegistrySettings.loadValues();
     CoreFeature.getInstance().resetConnection();
     Close();
 }
Example #18
0
        private void _buttonAddReg_Click(object sender, System.EventArgs e)
        {
            RegistrySettings rs = new RegistrySettings();

            if (!rs.AddMRUFile(_txtAddReg.Text))
            {
                MessageBox.Show("oops");
            }
        }
 private void OnRemoveButtonClicked()
 {
     ManifestUtils.RemoveRegistry(RegistrySettings.Instance().Registry.Name);
     RegistrySettings.Instance().SetAutoCheckEnabled(false);
     AutoCheckToggle.value = false;
     UpdateAddButtonEnabled();
     UpdateRemoveButtonEnabled();
     UpdateAllStatus();
 }
Example #20
0
        public static string RegRead(string argName)
        {
            string ret = RegistrySettings.ReadString(argName);

            if (ret != null && ret.Length == 0)
            {
                ret = null;
            }
            return(ret);
        }
Example #21
0
 private void nbiLoginTest_LinkClicked(object sender, NavBarLinkEventArgs e)
 {
     RegistrySettings.Username     = "******";
     RegistrySettings.Password     = "******";
     RegistrySettings.LoggedIn     = false;
     RegistrySettings.KeepLoggedIn = false;
     RegistrySettings.RememberMe   = false;
     RegistrySettings.Save();
     Close();
 }
Example #22
0
        internal OptionsForm(Settings settings, RegistrySettings registrySettings, FissureControl dummyFissureControl)
        {
            InitializeComponent();
            ReadSettings(Settings = settings, RegistrySettings = registrySettings);

            version.Text = $"v{WatApplication.CanonicalProductVersion}";

            imageRepository          = dummyFissureControl.ImageRepository;
            dummyFissureControl.Size = sample.Size;
            sample.Image             = dummyFissureControl.Snapshot();
        }
Example #23
0
 public ConfigurationPort(
     IRepositoryContext <DeviceDb> repoContext,
     RegistrySettings registrySettings,
     IDeviceRepository deviceRepo,
     IApplicationRepository applicationRepo)
 {
     _repoContext      = repoContext;
     _registrySettings = registrySettings;
     _deviceRepo       = deviceRepo;
     _applicationRepo  = applicationRepo;
 }
Example #24
0
        static void ReadArgsFromSystem()
        {
            InstallDir    = RegRead("INSTALLDIR");
            CommonVersion = RegistrySettings.ReadInt32(Configurator.ConstCommonVersion);

            BackupDir = Path.Combine(Environment.GetEnvironmentVariable("TEMP"), string.Concat(IbnConst.ProductFamilyShort, IbnConst.VersionMajorMinor, "UpdateBackup"));
            UpdateDir = AppDomain.CurrentDomain.BaseDirectory;

            DemoBackupDir = RegRead("DemoBackupDir");
            DemoHosts     = RegRead("DemoHosts");
        }
Example #25
0
        public static string RegRead(string name)
        {
            string result = RegistrySettings.ReadString(name);

            if (result != null && result.Length == 0)
            {
                result = null;
            }

            return(result);
        }
Example #26
0
        static void Main()
        {
            RegistrySettings.getInstance(); //prepare registry
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);


            loginDialog = new LoginDialog();
            loginDialog.Show();

            Application.Run(new Program());
        }
Example #27
0
        public static void DetectLocations(List <TroveLocation> locations)
        {
            try
            {
                log.Info("Detecting Trove Locations");
                var potentialLocs = new Dictionary <string, string>();

                log.Debug("Adding locations from registry");
                RegistrySettings.GetTroveLocations(potentialLocs);

                // Try common program files locations
                string programFiles    = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
                string programFilesX86 = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
                if (!string.IsNullOrEmpty(programFilesX86))
                {
                    log.Debug("Adding program files x86 locations");
                    potentialLocs.AddIfMissing(Path.Combine(programFilesX86, @"Glyph\Games\Trove\Live"), "Trove Live (Glyph)");
                    potentialLocs.AddIfMissing(Path.Combine(programFilesX86, @"Glyph\Games\Trove\PTS"), "Trove PTS (Glyph)");
                    potentialLocs.AddIfMissing(Path.Combine(programFilesX86, @"Steam\steamapps\common\Trove\Live"), "Trove Live (Steam)");
                    potentialLocs.AddIfMissing(Path.Combine(programFilesX86, @"Steam\steamapps\common\Trove\Games\Trove\Live"), "Trove Live (Steam)");
                    potentialLocs.AddIfMissing(Path.Combine(programFilesX86, @"Steam\steamapps\common\Trove\PTS"), "Trove PTS (Steam)");
                    potentialLocs.AddIfMissing(Path.Combine(programFilesX86, @"Steam\steamapps\common\Trove\Games\Trove\PTS"), "Trove PTS (Steam)");
                }
                if (!string.IsNullOrEmpty(programFiles) && programFiles != programFilesX86)
                {
                    log.Debug("Adding program files locations");
                    potentialLocs.AddIfMissing(Path.Combine(programFiles, @"Glyph\Games\Trove\Live"), "Trove Live (Glyph)");
                    potentialLocs.AddIfMissing(Path.Combine(programFiles, @"Glyph\Games\Trove\PTS"), "Trove PTS (Glyph)");
                    potentialLocs.AddIfMissing(Path.Combine(programFiles, @"Steam\steamapps\common\Trove\Live"), "Trove Live (Steam)");
                    potentialLocs.AddIfMissing(Path.Combine(programFiles, @"Steam\steamapps\common\Trove\Games\Trove\Live"), "Trove Live (Steam)");
                    potentialLocs.AddIfMissing(Path.Combine(programFiles, @"Steam\steamapps\common\Trove\PTS"), "Trove PTS (Steam)");
                    potentialLocs.AddIfMissing(Path.Combine(programFiles, @"Steam\steamapps\common\Trove\Games\Trove\PTS"), "Trove PTS (Steam)");
                }

                log.InfoFormat("Searching {0} potential locations", potentialLocs.Count);
                foreach (var loc in potentialLocs)
                {
                    if (File.Exists(Path.Combine(loc.Key, TroveExecutableFileName)))
                    {
                        // Add the location if this path does not already exist
                        if (!locations.Any(l => l.LocationPath.ToLower() == loc.Key.ToLower()))
                        {
                            locations.Add(new TroveLocation(loc.Value, loc.Key));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                log.Warn("Error detecting locations", ex);
            }
        }
 // Token: 0x06000516 RID: 1302 RVA: 0x0002101C File Offset: 0x0001F21C
 private InformationServiceSubscriptionProvider(Func <string, InfoServiceProxy> proxyFactory, string netObjectOperationEndpoint)
 {
     if (!RegistrySettings.IsFullOrion())
     {
         throw new InvalidOperationException("Subscription of Indications on non primary poller.");
     }
     if (string.IsNullOrEmpty(netObjectOperationEndpoint))
     {
         throw new ArgumentException("netObjectOperationEndpoint");
     }
     this.netObjectOperationEndpoint = netObjectOperationEndpoint;
     this.swisProxy = proxyFactory("localhost");
 }
Example #29
0
 private void CbLanguages_EditValueChanging(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e)
 {
     foreach (string name in Enum.GetNames(typeof(SupportedLanguage)))
     {
         if (e.NewValue.ToString().CompareTo(name) == 0)
         {
             LanguageManager.ChangeLanguage((SupportedLanguage)Enum.Parse(typeof(SupportedLanguage), name), this);
             RegistrySettings.Language = name;
             RegistrySettings.Save();
             break;
         }
     }
 }
        public Task InitializeAsync()
        {
            return(Task.Run(async() =>
            {
                _repo = new Repository(new DirectoryInfo(BasePath).Parent.Parent.FullName.ToString(), new RepositoryOptions());

                var settings = GitHelper.GetGitSettings();
                var options = new FetchOptions
                {
                    CredentialsProvider = new CredentialsHandler((url, usernameFromUrl, types) =>
                                                                 new UsernamePasswordCredentials()
                    {
                        Username = settings.Username,
                        Password = RegistrySettings.DecryptData(settings.Password)
                    })
                };
                if (_repo.RetrieveStatus().IsDirty)
                {
                    throw new Exception("Dirty repo: " + FullName);
                }



                var minimum = new System.Version(2, 50, 0, 0);
                if (RemoteProject == null || RemoteProject.Version == null)
                {
                    SuggestedVersion = minimum;
                }
                else
                {
                    var v = System.Version.Parse(RemoteProject.Version);
                    if (v < minimum)
                    {
                        SuggestedVersion = minimum;
                    }
                    else
                    {
                        SuggestedVersion = new System.Version(v.Major, v.Minor, v.Build, v.Revision + 1);
                    }
                }



                await GetDependenciesAsync();

                Translations = await TranslatorParser.GetTranslations(Name, Path.GetDirectoryName(CsProjPath));

                CanBeUpdated = (ProjectType == ProjectType.Module || Name == "Panacea") &&
                               (HasDifferentHash || HasDifferentTranslations);
            }));
        }
Example #31
0
        public AllSettings()
        {
            TabSettings = new ObservableCollection<TabSettings>();
            GeoIPSettings = new List<ParametersPair>();
            ExportSettings = new ExportSettings();
            PageSize = DefaultPageSize;
            MaxBandwidth = 1;
            RevertUsedProxiesOnExit = true;
            ShareUsageStatistic = true;
            ParseDetails = new List<ParseDetails>();
            SelectedCulture = new LanguageManager().DefaultLanguage.Culture;
            RegistrySettings = new RegistrySettings();
            IgnoredHttpProxyTypes = new HttpProxyTypes[] 
            {
                HttpProxyTypes.ChangesContent,
                HttpProxyTypes.Transparent
            };

            MainWindowState = new MainWindowState();
            ResultGridColumnWidth = new List<double>();
        }