Esempio n. 1
0
        protected virtual object Transform(object value)
        {
            if (this.m_stExtendedFormat != null)
            {
                IFormattable formattable = value as IFormattable;
                if (formattable != null)
                {
                    value = formattable.ToString(this.m_stExtendedFormat, null);
                }
            }
            string text = InvariantString.Format(this.m_stFormat, new object[] { value });

            //if (MarkupSystem.EnableStringCaseTransforms)
            //{
            //    if (this.m_fToUpper)
            //    {
            //        return text.ToUpper(CultureInfo.CurrentUICulture);
            //    }
            //    if (this.m_fToLower)
            //    {
            //        text = text.ToLower(CultureInfo.CurrentUICulture);
            //    }
            //}
            return(text);
        }
Esempio n. 2
0
        public override object ConvertFrom(ITypeDescriptorContext tdc, CultureInfo ci, object value)
        {
            string stUri = value as string;

            if (stUri == null)
            {
                return(base.ConvertFrom(tdc, ci, value));
            }
            Resource resource = ResourceManager.Instance.GetResource(stUri);

            if (resource == null)
            {
                throw new ArgumentException(InvariantString.Format("Invalid Resource value '{0}'", new object[] { stUri }));
            }
            return(resource);
        }
Esempio n. 3
0
        public override string ToString()
        {
            string text = InvariantString.Format("{0}(", new object[] { base.GetType().Name });

            if (!this.m_fEnabled)
            {
                text = InvariantString.Format("{0}Disabled", new object[] { text });
            }
            else
            {
                text = InvariantString.Format("{0}(BeginPadding={1}({2}), EndPadding={3}({4})", new object[] { text, this.m_nBeginPadding, this.m_relativeBeginPadding, this.m_nEndPadding, this.m_relativeEndPadding });
                if (this.Locked)
                {
                    text = InvariantString.Format("{0}, LockedPosition={1}, LockedAlignment={2}", new object[] { text, this.m_flLockedPosition, this.m_flLockedAlignment });
                }
            }
            return(text + ")");
        }
Esempio n. 4
0
        // Methods
        public override string ToString()
        {
            StringBuilder builder = new StringBuilder();
            bool          flag    = true;

            foreach (KeyValuePair <int, Size> pair in this.m_cache)
            {
                if (!flag)
                {
                    builder.Append(", ");
                }
                flag = false;
                builder.Append("[");
                builder.Append(pair.Key);
                builder.Append("]=");
                builder.Append(pair.Value);
            }
            return(InvariantString.Format("{0}({1})", new object[] { base.GetType().Name, builder }));
        }
Esempio n. 5
0
 public override string ToString()
 {
     return(InvariantString.Format("(Major={0}, Minor={1})", new object[] { this.Major, this.Minor }));
 }