private void LoadSettings() { using (DecoupledStorage lStorage = OptInitials.Storage) { this.m_devInitials = lStorage.ReadString(STR_Preferences, STR_DevInitials, ""); this.m_devName = lStorage.ReadString(STR_Preferences, STR_DevName, ""); this.m_fullName = lStorage.ReadBoolean(STR_Preferences, STR_FullNameComment, false); this.m_dateformat = lStorage.ReadString(STR_Preferences, STR_DateFormat, "MM/dd/yyyy"); } }
private void OnPreparePage(object sender, OptionsPageStorageEventArgs ea) { DecoupledStorage storage = GetStorage(); modelEditorPathButtonEdit.Text = storage.ReadString(PageName, ModelEditorPath, modelEditorPathButtonEdit.Text); projectConverterPathButtonEdit.Text = storage.ReadString(PageName, ProjectConverterPath, projectConverterPathButtonEdit.Text); testExecutorButtonEdit.Text = storage.ReadString(PageName, TestExecutorPath, testExecutorButtonEdit.Text); publicTokenTextEdit.Text = storage.ReadString(PageName, Token, publicTokenTextEdit.Text); formatOnSaveCheckEdit.Checked = storage.ReadBoolean(PageName, FormatOnSave, formatOnSaveCheckEdit.Checked); checkEditDebugME.Checked = storage.ReadBoolean(PageName, DebugME, checkEditDebugME.Checked); gridControl1.DataSource = GetConnectionStrings(); gridControl2.DataSource = GetSourceCodeInfos(); }
private void convertProject_Execute(ExecuteEventArgs ea) { using (var storage = new DecoupledStorage(typeof(Options))) { string path = storage.ReadString(Options.GetPageName(), "projectConverterPath"); string token = storage.ReadString(Options.GetPageName(), "token"); if (!string.IsNullOrEmpty(path) && !string.IsNullOrEmpty(token)) { var directoryName = Path.GetDirectoryName(CodeRush.Solution.Active.FileName); var userName = string.Format("/s /k:{0} \"{1}\"", token, directoryName); Process.Start(path, userName); actionHint1.Text = "Project Converter Started !!!"; Rectangle rectangle = Screen.PrimaryScreen.Bounds; actionHint1.PointTo(new Point(rectangle.Width / 2, rectangle.Height / 2)); } } }
/// <summary> /// Loads the command binding from the specified section. /// </summary> /// <param name="decoupledStorage"></param> /// <param name="section"></param> /// <returns>Returns true if this command was most recently selected.</returns> public bool Load(DecoupledStorage decoupledStorage, string section) { _CustomData = decoupledStorage.ReadString(section, "CustomData", ""); _Command = decoupledStorage.ReadString(section, "Command", ""); _Comments = decoupledStorage.ReadString(section, "Comments", ""); _Parameters = decoupledStorage.ReadString(section, "Parameters", ""); _CtrlKeyDown = decoupledStorage.ReadBoolean(section, "CtrlKeyDown", false); _AnyShiftModifier = decoupledStorage.ReadBoolean(section, "AnyShiftModifier", false); _AltKeyDown = decoupledStorage.ReadBoolean(section, "AltKeyDown", false); _ShiftKeyDown = decoupledStorage.ReadBoolean(section, "ShiftKeyDown", false); _Enabled = decoupledStorage.ReadBoolean(section, "Enabled", true); _Context.Load(decoupledStorage, section, "Context"); _ContextRoot = new ContextNode(_Context.Selected); return(decoupledStorage.ReadBoolean(section, "Selected", false)); }
public virtual void Load(DecoupledStorage storage, string section, int index) { Name = storage.ReadString(section, "Name" + index); column = storage.ReadInt32(section, "Column" + index); row = storage.ReadInt32(section, "Row" + index); Repeating = storage.ReadBoolean(section, "Repeating" + index); }
public static Settings LoadSettings(DecoupledStorage storage) { Settings settings = new Settings(); settings.AttributeNames = storage.ReadString("XMLNav", "AttributeNames", "id|ref"); return(settings); }
internal static List <string> GetExclusions() { List <string> list = new List <string>(); using (DecoupledStorage settings = CodeRush.Options.GetStorage(OptionsCategory, OptionsPageName)) { int excludeCount = settings.ReadInt32(Summary, ExcludeSummaryKey, -1); if (excludeCount == -1) { list.Add(".*(?i)[.]designer[.]cs$"); list.Add(".*(?i)[.]designer[.]vb$"); list.Add("(?i)AssemblyInfo[.]cs$"); } else { for (int i = 0; i < excludeCount; i++) { list.Add(settings.ReadString(ExcludeKey, ExcludeKey + i, true)); } } } return(list); }
// DXCore-generated code... #region Initialize protected override void Initialize() { base.Initialize(); DecoupledStorage storage = GetStorage(); modelEditorPathButtonEdit.Text = storage.ReadString(PageName, ModelEditorPath, modelEditorPathButtonEdit.Text); projectConverterPathButtonEdit.Text = storage.ReadString(PageName, ProjectConverterPath, projectConverterPathButtonEdit.Text); gacUtilPathButtonEdit.Text = storage.ReadString(PageName, GacUtilPath, gacUtilPathButtonEdit.Text); publicTokenTextEdit.Text = storage.ReadString(PageName, Token, publicTokenTextEdit.Text); gacUtilRegexButtonEdit.Text = storage.ReadString(PageName, GacUtilRegex, gacUtilRegexButtonEdit.Text); formatOnSaveCheckEdit.Checked = storage.ReadBoolean(PageName, FormatOnSave, formatOnSaveCheckEdit.Checked); gridControl1.DataSource = GetConnectionStrings(); gridControl2.DataSource = GetSourceCodeInfos(); gridView1.KeyDown += GridView1OnKeyDown; gridView2.KeyDown += GridView1OnKeyDown; }
public static List<Replacement> LoadReplacements(DecoupledStorage storage) { var xml = storage.ReadString("Replacements", "Replacements", "<root/>"); List<Replacement> Replacements = new List<Replacement>(); XElement root = XElement.Parse(xml); foreach (XElement item in root.Elements()) { Replacement Replacement = new Replacement(item.Attribute("replace").Value, item.Attribute("with").Value); Replacements.Add(Replacement); } return Replacements; }
protected void LoadFolderInfo(DecoupledStorage storage) { if (storage == null) { return; } Enabled = storage.ReadBoolean("FolderInfo", "Enabled", true); string lDescription = storage.ReadString("FolderInfo", "Description", ""); //Description = TextUtils.DecodeText(lDescription); Description = CodeRush.StrUtil.DecodeText(lDescription); FolderState = (FolderState)storage.ReadEnum("FolderInfo", "FolderState", typeof(FolderState), FolderState.Collapsed); }
public void Start(ProjectWrapper projectWrapper) { string outputFileName = projectWrapper.OutPutFileName; if (outputFileName.ToLower().EndsWith(".exe")) outputFileName += ".config"; using (var storage = new DecoupledStorage(typeof(Options))) { string path = storage.ReadString(Options.GetPageName(), "modelEditorPath"); if (!String.IsNullOrEmpty(path)) { StartMEProcess(projectWrapper, outputFileName, path); return; } const string modeleditorpathPathIsEmpty = "ModelEditorPath path is empty"; MessageBox.Show(modeleditorpathPathIsEmpty); } }
internal static List <string> GetContentExclusions() { List <string> list = new List <string>(); using (DecoupledStorage settings = CodeRush.Options.GetStorage(OptionsCategory, OptionsPageName)) { int excludeCount = settings.ReadInt32(Summary, ExcludeContentSummaryKey, 0); for (int i = 0; i < excludeCount; i++) { list.Add(settings.ReadString(ExcludeContentKey, ExcludeContentKey + i, true)); } } return(list); }
private void loadSettings() { try { using (DecoupledStorage storage = OptExtractHqlNamedQuery.Storage) { enabled = storage.ReadBoolean("ExtractHqlNamedQuery", "Enabled", true); findHqlFileStrategy = storage.ReadInt32("ExtractHqlNamedQuery", "FindHqlFileStrategy", 0); hqlNamedQueryFileName = storage.ReadString("ExtractHqlNamedQuery", "HqlNamedQueryFileName", "NamedQueries.hbm.xml"); } } catch (Exception ex) { ShowException(ex); } }
private void LoadCodeGroups() { bool loaded; groups.Clear(); //Get groups from config //if none are retieved load the defaults using (DecoupledStorage storage = GetStorage()) { string configXml = storage.ReadString(CatagoryName, ConfigKey); loaded = LoadFromXmlString(configXml); } if (loaded == false) { LoadDefaults(); Save(); LoadCodeGroups(); } }
void loadSettings() { try { using (DecoupledStorage storage = OptExtractHqlNamedQuery.Storage) { enabled = storage.ReadBoolean("ExtractHqlNamedQuery", "Enabled", true); findHqlFileStrategy = storage.ReadInt32("ExtractHqlNamedQuery", "FindHqlFileStrategy", 0); hqlNamedQueryFileName = storage.ReadString("ExtractHqlNamedQuery", "HqlNamedQueryFileName", "NamedQueries.hbm.xml"); } chkEnabled.Checked = enabled; comboFindHqlFileStrategy.SelectedIndex = findHqlFileStrategy; textHqlNamedQueryFileName.Text = hqlNamedQueryFileName; } catch (Exception ex) { ExtractHqlNamedQuery.ShowException(ex); } }
private static IBlockPaintingStrategySettings LoadSettingsForStrategy(Type strategyType, DecoupledStorage storage) { object strategyInstance = Activator.CreateInstance(strategyType); string blockTypeName = strategyInstance.GetType().GetProperty("BlockTypeName").GetValue(strategyInstance, null) as string; IBlockPaintingStrategySettings result = new BlockPaintingStrategySettings(blockTypeName); result.Enabled = storage.ReadBoolean(result.BlockTypeName, SettingNames.Enabled, true); result.ShowDetailedBlockMetaData = storage.ReadBoolean(result.BlockTypeName, SettingNames.ShowDetailedBlockMetaData, DefaultValues.ShowDetailedBlockMetaData); result.MinimumBlockSize = (byte)storage.ReadInt32(result.BlockTypeName, SettingNames.MinimumBlockSize, 0); result.BlockMetaDataAlpha = (byte)storage.ReadInt32(result.BlockTypeName, SettingNames.BlockMetaDataAlpha, DefaultValues.BlockMetaDataAlpha); result.BlockMetaDataRed = (byte)storage.ReadInt32(result.BlockTypeName, SettingNames.BlockMetaDataRed, DefaultValues.BlockMetaDataRed); result.BlockMetaDataGreen = (byte)storage.ReadInt32(result.BlockTypeName, SettingNames.BlockMetaDataGreen, DefaultValues.BlockMetaDataGreen); result.BlockMetaDataBlue = (byte)storage.ReadInt32(result.BlockTypeName, SettingNames.BlockMetaDataBlue, DefaultValues.BlockMetaDataBlue); result.PrefixAlpha = (byte)storage.ReadInt32(result.BlockTypeName, SettingNames.PrefixAlpha, DefaultValues.PrefixAlpha); result.PrefixRed = (byte)storage.ReadInt32(result.BlockTypeName, SettingNames.PrefixRed, DefaultValues.PrefixRed); result.PrefixGreen = (byte)storage.ReadInt32(result.BlockTypeName, SettingNames.PrefixGreen, DefaultValues.PrefixGreen); result.PrefixBlue = (byte)storage.ReadInt32(result.BlockTypeName, SettingNames.PrefixBlue, DefaultValues.PrefixBlue); result.PrefixText = storage.ReadString(result.BlockTypeName, SettingNames.PrefixText, DefaultValues.PrefixText); return(result); }
private void openModelEditor(Project project) { Configuration configuration = project.ConfigurationManager.ActiveConfiguration; Property outputPathProperty = configuration.FindProperty(ConfigurationProperty.OutputPath); Property outputFileProperty = project.FindProperty(ProjectProperty.OutputFileName); Property outputDiffsProperty = project.FindProperty(ProjectProperty.FullPath); string outputFileName = outputFileProperty.Value.ToString(); if (outputFileName.ToLower().EndsWith(".exe")) outputFileName += ".config"; ProjectItem modelItem = getModelItem(project); if (modelItem != null) using (var storage = new DecoupledStorage(typeof(Options))) { string path = storage.ReadString(Options.GetPageName(), "modelEditorPath"); if (!string.IsNullOrEmpty(path)) { string assemblyName = Path.Combine(outputDiffsProperty.Value.ToString(), Path.Combine(outputPathProperty.Value.ToString(), outputFileName)); if (!File.Exists(assemblyName)) { MessageBox.Show("Assembly " + assemblyName + " not found", null, MessageBoxButtons.OK); return; } string arguments = string.Format("\"{0}\" \"{1}\"", assemblyName, outputDiffsProperty.Value); if (File.Exists(path)) Process.Start(path, arguments); else MessageBox.Show("Model editor not found at " + path); } else MessageBox.Show("ModelEditorPath path is empty"); } }
private void SpAtDesignTime_Execute(ExecuteEventArgs ea) { IEnumerable<ProjectItem> enumerable = CodeRush.ApplicationObject.Solution.FindStartUpProject().ProjectItems.Cast<ProjectItem>(); Trace.Listeners.Add(new DefaultTraceListener { LogFileName = "log.txt" }); foreach (ProjectItem item in enumerable) { if (item.Name.ToLower() == "app.config" || item.Name.ToLower() == "web.config") { Trace.Write("config found"); using (var storage = new DecoupledStorage(typeof (Options))) { string connectionStringName = storage.ReadString(Options.GetPageName(), "connectionStringName"); if (!string.IsNullOrEmpty(connectionStringName)) { Trace.Write("conneection string found"); ConnectionStringSettings connectionStringSettings = GetConnectionStringSettings(item); dropDatabase(connectionStringSettings.ConnectionString); } } } } }
public static string ReadMaxContextLength(DecoupledStorage storage) { return(storage.ReadString(kPreferencesSection, kMaxContextLength, Default.ContextLength)); }
public static string ReadMaxContextLength(DecoupledStorage storage) { return storage.ReadString(kPreferencesSection, kMaxContextLength, Default.ContextLength); }
public static BindingList<ConnectionString> GetConnectionStrings(DecoupledStorage storage) { string readString = storage.ReadString(GetPageName(), "ConnectionStrings", ""); return new BindingList<ConnectionString>( readString.Split(';').Where(s => !(string.IsNullOrEmpty(s))).Select( s => new ConnectionString { Name = s }).ToList()); }
public static Settings LoadSettings(DecoupledStorage storage) { Settings settings = new Settings(); settings.AttributeNames = storage.ReadString("XMLNav", "AttributeNames","id|ref"); return settings; }