private static bool? GetStoredState(DecoupledStorage storage, string propertyName)
 {
     CheckState checkState = storage.ReadEnum<CheckState>("ProjectDefaults", propertyName, CheckState.Indeterminate);
     if (checkState == CheckState.Checked)
         return true;
     else if (checkState == CheckState.Unchecked)
         return false;
     else
         return null;
 }
        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));
            }
        }
Esempio n. 3
0
        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);
        }
		/// <summary>
		/// Loads the options from storage.
		/// </summary>
		/// <param name="storage">A storage object from which options should be loaded.</param>
		/// <returns>
		/// A populated <see cref="DX_FormatOnSave.OptionSet"/> from the storage.
		/// </returns>
		/// <exception cref="System.ArgumentNullException">
		/// Thrown if <paramref name="storage" /> is <see langword="null" />.
		/// </exception>
		public static OptionSet Load(DecoupledStorage storage)
		{
			if (storage == null)
			{
				throw new ArgumentNullException("storage");
			}
			Log.SendMsg("Loading 'format on save' options.");
			OptionSet options = new OptionSet();
			OptionSet defaults = new OptionSet();
			options.Enabled = storage.ReadBoolean(SectionGeneral, KeyEnabled, defaults.Enabled);
			Log.SendBool("Enabled", options.Enabled);
			options.LanguagesToFormat = storage.ReadEnum<DocumentLanguages>(SectionGeneral, KeyLanguagesToFormat, defaults.LanguagesToFormat);
			Log.SendEnum("Languages to format", options.LanguagesToFormat);
			return options;
		}
Esempio n. 5
0
        /// <summary>
        /// Loads the options from storage.
        /// </summary>
        /// <param name="storage">A storage object from which options should be loaded.</param>
        /// <returns>
        /// A populated <see cref="DX_FormatOnSave.OptionSet"/> from the storage.
        /// </returns>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown if <paramref name="storage" /> is <see langword="null" />.
        /// </exception>
        public static OptionSet Load(DecoupledStorage storage)
        {
            if (storage == null)
            {
                throw new ArgumentNullException("storage");
            }
            Log.SendMsg("Loading 'format on save' options.");
            OptionSet options  = new OptionSet();
            OptionSet defaults = new OptionSet();

            options.Enabled = storage.ReadBoolean(SectionGeneral, KeyEnabled, defaults.Enabled);
            Log.SendBool("Enabled", options.Enabled);
            options.LanguagesToFormat = storage.ReadEnum <DocumentLanguages>(SectionGeneral, KeyLanguagesToFormat, defaults.LanguagesToFormat);
            Log.SendEnum("Languages to format", options.LanguagesToFormat);
            return(options);
        }
 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);
 }