示例#1
0
 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 Color ReadTestSkipColor(DecoupledStorage storage)
		{
			int alpha = storage.ReadInt32("Preferences", "SkipAlphaComponent", Default.SkipColor.Alpha);
			int red = storage.ReadInt32("Preferences", "SkipRedComponent", Default.SkipColor.Red);
			int blue = storage.ReadInt32("Preferences", "SkipGreenComponent", Default.SkipColor.Green);
			int green = storage.ReadInt32("Preferences", "SkipBlueComponent", Default.SkipColor.Blue);
			return Color.FromArgb(alpha, red, blue, green);
		}
示例#3
0
        public static Color ReadTestFailColor(DecoupledStorage storage)
        {
            int alpha = storage.ReadInt32(kPreferencesSection, "FailAlphaComponent", Default.FailColor.Alpha);
            int red   = storage.ReadInt32(kPreferencesSection, "FailRedComponent", Default.FailColor.Red);
            int blue  = storage.ReadInt32(kPreferencesSection, "FailGreenComponent", Default.FailColor.Green);
            int green = storage.ReadInt32(kPreferencesSection, "FailBlueComponent", Default.FailColor.Blue);

            return(Color.FromArgb(alpha, red, blue, green));
        }
示例#4
0
        public static Color ReadTestSkipColor(DecoupledStorage storage)
        {
            int alpha = storage.ReadInt32("Preferences", "SkipAlphaComponent", Default.SkipColor.Alpha);
            int red   = storage.ReadInt32("Preferences", "SkipRedComponent", Default.SkipColor.Red);
            int blue  = storage.ReadInt32("Preferences", "SkipGreenComponent", Default.SkipColor.Green);
            int green = storage.ReadInt32("Preferences", "SkipBlueComponent", Default.SkipColor.Blue);

            return(Color.FromArgb(alpha, red, blue, green));
        }
示例#5
0
 public void Load(DecoupledStorage storage, string section, string prefix)
 {
     _KeyState  = storage.ReadInt32(section, prefix + "KeyState");
     _KeyCode   = storage.ReadInt32(section, prefix + "KeyCode");
     _Ctrl      = storage.ReadBoolean(section, prefix + "Ctrl");
     _Shift     = storage.ReadBoolean(section, prefix + "Shift");
     _Alt       = storage.ReadBoolean(section, prefix + "Alt");
     _RightSide = storage.ReadBoolean(section, prefix + "RightSide");
     _Extended  = storage.ReadBoolean(section, prefix + "Extended");
 }
示例#6
0
        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);
        }
 public DrawLinesBetweenMethodsSettings(DecoupledStorage storage)
 {
     FullWidth               = storage.ReadBoolean("DrawLinesBetweenMethods", "FullWidth", FullWidth);
     LineDashStyle           = (DashStyle)storage.ReadEnum("DrawLinesBetweenMethods", "LineDashStyle", typeof(DashStyle), LineDashStyle);
     LineWidth               = storage.ReadInt32("DrawLinesBetweenMethods", "LineWidth", LineWidth);
     LineColor               = storage.ReadColor("DrawLinesBetweenMethods", "LineColor", LineColor);
     DrawLineAtStartOfMethod = storage.ReadBoolean("DrawLinesBetweenMethods", "DrawLineAtStartOfMethod", DrawLineAtStartOfMethod);
     DrawLineAtEndOfMethod   = storage.ReadBoolean("DrawLinesBetweenMethods", "DrawLineAtEndOfMethod", DrawLineAtEndOfMethod);
     DrawShadow              = storage.ReadBoolean("DrawLinesBetweenMethods", "DrawShadow", DrawShadow);
     EnableOnClass           = storage.ReadBoolean("DrawLinesBetweenMethods", "EnableOnClass", EnableOnClass);
     EnableOnProperty        = storage.ReadBoolean("DrawLinesBetweenMethods", "EnableOnProperty", EnableOnProperty);
     EnableOnMethod          = storage.ReadBoolean("DrawLinesBetweenMethods", "EnableOnMethod", EnableOnMethod);
     EnableOnEnum            = storage.ReadBoolean("DrawLinesBetweenMethods", "EnableOnEnum", EnableOnEnum);
     LineSpacer              = storage.ReadInt32("DrawLinesBetweenMethods", "LineSpacer", LineSpacer);
     ShadowHeight            = storage.ReadInt32("DrawLinesBetweenMethods", "ShadowHeight", ShadowHeight);
     Enabled = storage.ReadBoolean("DrawLinesBetweenMethods", "Enabled", Enabled);
 }
 public DrawLinesBetweenMethodsSettings(DecoupledStorage storage)
 {
     FullWidth = storage.ReadBoolean("DrawLinesBetweenMethods", "FullWidth", FullWidth);
     LineDashStyle = (DashStyle)storage.ReadEnum("DrawLinesBetweenMethods", "LineDashStyle", typeof(DashStyle), LineDashStyle);
     LineWidth = storage.ReadInt32("DrawLinesBetweenMethods", "LineWidth", LineWidth);
     LineColor = storage.ReadColor("DrawLinesBetweenMethods", "LineColor", LineColor);
     DrawLineAtStartOfMethod = storage.ReadBoolean("DrawLinesBetweenMethods", "DrawLineAtStartOfMethod", DrawLineAtStartOfMethod);
     DrawLineAtEndOfMethod = storage.ReadBoolean("DrawLinesBetweenMethods", "DrawLineAtEndOfMethod", DrawLineAtEndOfMethod);
     DrawShadow = storage.ReadBoolean("DrawLinesBetweenMethods", "DrawShadow", DrawShadow);
     EnableOnClass = storage.ReadBoolean("DrawLinesBetweenMethods", "EnableOnClass", EnableOnClass);
     EnableOnProperty = storage.ReadBoolean("DrawLinesBetweenMethods", "EnableOnProperty", EnableOnProperty);
     EnableOnMethod = storage.ReadBoolean("DrawLinesBetweenMethods", "EnableOnMethod", EnableOnMethod);
     EnableOnEnum = storage.ReadBoolean("DrawLinesBetweenMethods", "EnableOnEnum", EnableOnEnum);
     LineSpacer = storage.ReadInt32("DrawLinesBetweenMethods", "LineSpacer", LineSpacer);
     ShadowHeight = storage.ReadInt32("DrawLinesBetweenMethods", "ShadowHeight", ShadowHeight);
     Enabled = storage.ReadBoolean("DrawLinesBetweenMethods", "Enabled", Enabled);
 }
示例#9
0
 public void Load(DecoupledStorage storage)
 {
     ShowBeacon           = storage.ReadBoolean(STR_Preferences, STR_ShowBeacon, ShowBeacon);
     BeaconColor          = storage.ReadColor(STR_Preferences, STR_BeaconColor, BeaconColor);
     BeaconDuration       = storage.ReadInt32(STR_Preferences, STR_BeaconDuration, BeaconDuration);
     RollOverOnPrevNext   = storage.ReadBoolean(STR_Preferences, STR_RollOverOnPrevNext, RollOverOnPrevNext);
     SkipSelectionMarkers = storage.ReadBoolean(STR_Preferences, STR_SkipSelectionMarkers, SkipSelectionMarkers);
 }
 public void Load(DecoupledStorage storage)
 {
   ShowBeacon = storage.ReadBoolean(STR_Preferences, STR_ShowBeacon, ShowBeacon);
   BeaconColor = storage.ReadColor(STR_Preferences, STR_BeaconColor, BeaconColor);
   BeaconDuration = storage.ReadInt32(STR_Preferences, STR_BeaconDuration, BeaconDuration);
   RollOverOnPrevNext = storage.ReadBoolean(STR_Preferences, STR_RollOverOnPrevNext, RollOverOnPrevNext);
   SkipSelectionMarkers = storage.ReadBoolean(STR_Preferences, STR_SkipSelectionMarkers, SkipSelectionMarkers);
 }
        void loadSettings()
        {
            try
            {
                using (DecoupledStorage storage = OptDrawLinesBetweenMethods.Storage)
                {
                    _fullWidth = storage.ReadBoolean("DrawLinesBetweenMethods", "FullWidth", _fullWidth);
                    _lineWidth = storage.ReadInt32("DrawLinesBetweenMethods", "LineWidth", _lineWidth);
                    _lineColor = storage.ReadColor("DrawLinesBetweenMethods", "LineColor", _lineColor);
                    _drawLineAtStartOfMethod = storage.ReadBoolean("DrawLinesBetweenMethods", "DrawLineAtStartOfMethod", _drawLineAtStartOfMethod);
                    _drawLineAtEndOfMethod   = storage.ReadBoolean("DrawLinesBetweenMethods", "DrawLineAtEndOfMethod", _drawLineAtEndOfMethod);
                    _drawShadow       = storage.ReadBoolean("DrawLinesBetweenMethods", "DrawShadow", _drawShadow);
                    _enableOnClass    = storage.ReadBoolean("DrawLinesBetweenMethods", "EnableOnClass", _enableOnClass);
                    _enableOnProperty = storage.ReadBoolean("DrawLinesBetweenMethods", "EnableOnProperty", _enableOnProperty);
                    _enableOnMethod   = storage.ReadBoolean("DrawLinesBetweenMethods", "EnableOnMethod", _enableOnMethod);
                    _enableOnEnum     = storage.ReadBoolean("DrawLinesBetweenMethods", "EnableOnEnum", _enableOnEnum);
                    _lineSpacer       = storage.ReadInt32("DrawLinesBetweenMethods", "LineSpacer", _lineSpacer);
                    _shadowHeight     = storage.ReadInt32("DrawLinesBetweenMethods", "ShadowHeight", _shadowHeight);
                    _enabled          = storage.ReadBoolean("DrawLinesBetweenMethods", "Enabled", _enabled);
                }

                _fullWidthChk.Checked       = _fullWidth;
                _lineWidthLst.Text          = _lineWidth.ToString();
                _lineColorBtn.BackColor     = _lineColor;
                _drawLineAtStartChk.Checked = _drawLineAtStartOfMethod;
                _drawLineAtEndChk.Checked   = _drawLineAtEndOfMethod;
                _drawShadowChk.Checked      = _drawShadow;
                _enableOnMemberCheckList.SetItemChecked(0, _enableOnClass);
                _enableOnMemberCheckList.SetItemChecked(1, _enableOnProperty);
                _enableOnMemberCheckList.SetItemChecked(2, _enableOnMethod);
                _enableOnMemberCheckList.SetItemChecked(3, _enableOnEnum);
                _lineSpaceNUD.Value      = _lineSpacer;
                _shadowHeightNUD.Enabled = _drawShadowChk.Checked;
                _shadowHeightNUD.Value   = _shadowHeightNUD.Enabled ? _shadowHeight : 0;
                _enabledChk.Checked      = _enabled;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
        public void Load()
        {
            Keys.Clear();
            DecoupledStorage storage = OptXkeysLayout.Storage;
            int numKeys = storage.ReadInt32("Layout", "Count");

            for (int i = 0; i < numKeys; i++)
            {
                Keys.Add(KeyBase.CreateAndLoad(storage, "Layout", i));
            }
            BlockSettingsChanged();
        }
        public override void Load(DecoupledStorage storage, string section, int index)
        {
            base.Load(storage, section, index);
            Type = (KeyGroupType)storage.ReadEnum <KeyGroupType>(section, "Type" + index, KeyGroupType.Wide);

            int numElements = storage.ReadInt32(section, "GroupCount" + index, 0);

            for (int i = 0; i < numElements; i++)
            {
                keys.Add(KeyBase.CreateAndLoad(storage, String.Format("{0}.Group{1}", section, index), i));
            }
        }
 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);
     }
 }
示例#15
0
        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 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);
        }
        // Methods
        public void Load(DecoupledStorage storage)
        {
            KeepFirstAttribute = false;
            Sort = false;
            OverrideTabSettings = true;
            TabSize = 2;
            PutCloseTagOnOwnLine = true;

            if (storage != null)
            {
                KeepFirstAttribute = storage.ReadBoolean("General", STR_KeepFirstAttribute, false);
                Sort = storage.ReadBoolean("General", STR_SortAttributes, false);

                OverrideTabSettings = storage.ReadBoolean("General", "OverrideTabSettings", true);
                TabSize = ((short)storage.ReadInt32("General", "TabSize", 2));
                PutCloseTagOnOwnLine = storage.ReadBoolean("General", "PutCloseTagOnOwnLine", true);
            }
        }
        // Methods
        public void Load(DecoupledStorage storage)
        {
            KeepFirstAttribute = false;
            Sort = false;
            OverrideTabSettings  = true;
            TabSize              = 2;
            PutCloseTagOnOwnLine = true;

            if (storage != null)
            {
                KeepFirstAttribute = storage.ReadBoolean("General", STR_KeepFirstAttribute, false);
                Sort = storage.ReadBoolean("General", STR_SortAttributes, false);

                OverrideTabSettings  = storage.ReadBoolean("General", "OverrideTabSettings", true);
                TabSize              = ((short)storage.ReadInt32("General", "TabSize", 2));
                PutCloseTagOnOwnLine = storage.ReadBoolean("General", "PutCloseTagOnOwnLine", true);
            }
        }
示例#19
0
        /// <summary>
        /// Loads the command key bindings from storage.
        /// </summary>
        /// <param name="aDecoupledStorage"></param>
        /// <returns>Returns the most recently selected command key binding.</returns>
        public CommandKeyBinding Load(DecoupledStorage aDecoupledStorage, CommandKeyFolder parentFolder)
        {
            Clear();
            CommandKeyBinding lLastSelected      = null;
            CommandKeyBinding lCommandKeyBinding = null;
            int thisCount = aDecoupledStorage.ReadInt32("Header", "Count", Count);

            for (int i = 0; i < thisCount; i++)
            {
                lCommandKeyBinding = new CommandKeyBinding();
                lCommandKeyBinding.SetParentFolder(parentFolder);
                if (lCommandKeyBinding.Load(aDecoupledStorage, "Command" + i.ToString()))
                {
                    lLastSelected = lCommandKeyBinding;
                }
                Add(lCommandKeyBinding);
            }
            return(lLastSelected);
        }
示例#20
0
        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);
            }
        }
        public static void LoadSettings()
        {
            try
            {
                DecoupledStorage store = CodeRush.Options.GetStorage(GetCategory(), GetPageName());
                if (store != null)
                {
                    MiniCodeColumnEnabled  = store.ReadBoolean("Config", "Enabled", true);
                    WordDoubleClickEnabled = store.ReadBoolean("Config", "WordDoubleClickEnabled", true);

                    //ColumnWidth = store.ReadInt32("Config", "ColumnWidth", 40);

                    ColumnBackgroundColor = Color.FromArgb(
                        store.ReadInt32(
                            "Config",
                            "ColumnBackgroundColor",
                            CodeRush.Color.VSLight.ToArgb()
                            ));
                    ColumnBackgroundColorSelectedWord = Color.FromArgb(
                        store.ReadInt32(
                            "Config",
                            "ColumnBackgroundColorSelectedWord",
                            Color.FromArgb(40, Color.Blue).ToArgb()
                            ));
                    ColumnVisibleLinesColor = Color.FromArgb(
                        store.ReadInt32(
                            "Config",
                            "ColumnVisibleLinesColor",
                            Color.FromArgb(70, Color.DarkBlue).ToArgb()
                            ));

                    CodeColorNormalLine = Color.FromArgb(
                        store.ReadInt32(
                            "Config",
                            "CodeColorNormalLine",
                            Color.FromArgb(70, Color.Black).ToArgb()
                            ));
                    CodeColorSelectedWord = Color.FromArgb(
                        store.ReadInt32(
                            "Config",
                            "CodeColorPenSelectedWord",
                            Color.FromArgb(100, Color.Red).ToArgb()
                            ));
                    CodeColorCommentLine = Color.FromArgb(
                        store.ReadInt32(
                            "Config",
                            "CodeColorCommentLine",
                            Color.FromArgb(70, Color.Green).ToArgb()
                            ));
                    BreakPointColor = Color.FromArgb(
                        store.ReadInt32(
                            "Config",
                            "BreakPointColor",
                            Color.FromArgb(90, Color.Red).ToArgb()
                            ));
                }
            }
            catch
            {
            }
        }
		public static Color ReadTestPassColor(DecoupledStorage storage)
		{
			int alpha = storage.ReadInt32(kPreferencesSection, "PassAlphaComponent", Default.PassColor.Alpha);
			int red = storage.ReadInt32(kPreferencesSection, "PassRedComponent", Default.PassColor.Red);
			int blue = storage.ReadInt32(kPreferencesSection, "PassGreenComponent", Default.PassColor.Green);
			int green = storage.ReadInt32(kPreferencesSection, "PassBlueComponent", Default.PassColor.Blue);
			return Color.FromArgb(alpha, red, blue, green);
		}