Esempio n. 1
0
        /// <summary>
        /// Constructs a <see cref="MultipleChoiceSetting"/> object.
        /// </summary>
        /// <param name="resourceId">the string table id for the presentation of the setting in the PropertyExplorer (<see cref="IControlCenter"/></param>
        /// <param name="settingName">the name of the setting</param>
        public MultipleChoiceSetting(string resourceId, string settingName) : base()
        {
            this.resourceId        = resourceId;
            this.settingName       = settingName;
            base.propertyLabelText = StringTable.GetString(this.resourceId);
            string SelText = StringTable.GetString(resourceId + ".Values");

            base.choices = StringTable.GetSplittedStrings(resourceId + ".Values");
            selected     = -1;
        }
Esempio n. 2
0
        /// <summary>
        /// Constructor required by deserialization
        /// </summary>
        /// <param name="info">SerializationInfo</param>
        /// <param name="context">StreamingContext</param>
        protected MultipleChoiceSetting(SerializationInfo info, StreamingContext context)
        {
            selected    = (int)info.GetValue("Selected", typeof(int));
            resourceId  = (string)info.GetValue("ResourceId", typeof(string));
            settingName = (string)info.GetValue("SettingName", typeof(string));

            base.propertyLabelText = StringTable.GetString(this.resourceId);
            base.choices           = StringTable.GetSplittedStrings(resourceId + ".Values");
            if (selected >= 0 && selected < base.choices.Length)
            {
                base.selectedText = base.choices[selected];
            }
        }
Esempio n. 3
0
        public void SetObjectData(IJsonReadData data)
        {
            selected    = data.GetProperty <int>("Selected");
            resourceId  = data.GetProperty <string>("ResourceId");
            settingName = data.GetProperty <string>("SettingName");

            base.propertyLabelText = StringTable.GetString(this.resourceId);
            base.choices           = StringTable.GetSplittedStrings(resourceId + ".Values");
            if (selected >= 0 && selected < base.choices.Length)
            {
                base.selectedText = base.choices[selected];
            }
        }
Esempio n. 4
0
        public override void Added(IPropertyPage pp)
        {
            base.Added(pp);
            subEntries = new IPropertyEntry[1];
            string[] choices = StringTable.GetSplittedStrings("LineWidth.Scaling");
            string   choice  = "";

            if ((int)scale < choices.Length)
            {
                choice = choices[(int)scale];
            }
            MultipleChoiceProperty mcp = new MultipleChoiceProperty("LineWidth.Scale", choices, choice);

            mcp.ValueChangedEvent += new ValueChangedDelegate(ScalingChanged);
            subEntries[0]          = mcp;
            base.resourceId        = "LineWidthName";
        }