示例#1
0
        ////////////////////////////////////////////////////////////////////////
        //
        //  ReadOnly
        //
        //  Create a cloned readonly instance or return the input one if it is 
        //  readonly.
        //
        ////////////////////////////////////////////////////////////////////////
        public static TextInfo ReadOnly(TextInfo textInfo)
        {
            if (textInfo == null) { throw new ArgumentNullException(nameof(textInfo)); }
            Contract.EndContractBlock();
            if (textInfo.IsReadOnly) { return (textInfo); }

            TextInfo clonedTextInfo = (TextInfo)(textInfo.MemberwiseClone());
            clonedTextInfo.SetReadOnlyState(true);

            return (clonedTextInfo);
        }
示例#2
0
        /// <summary>
        /// Create a cloned readonly instance or return the input one if it is
        /// readonly.
        /// </summary>
        public static TextInfo ReadOnly(TextInfo textInfo)
        {
            ArgumentNullException.ThrowIfNull(textInfo);

            if (textInfo.IsReadOnly)
            {
                return(textInfo);
            }

            TextInfo clonedTextInfo = (TextInfo)(textInfo.MemberwiseClone());

            clonedTextInfo.SetReadOnlyState(true);
            return(clonedTextInfo);
        }
        public static TextInfo ReadOnly(TextInfo textInfo)
        {
            if (textInfo == null)
            {
                throw new ArgumentNullException("textInfo");
            }
            if (textInfo.IsReadOnly)
            {
                return(textInfo);
            }
            TextInfo textInfo2 = (TextInfo)textInfo.MemberwiseClone();

            textInfo2.SetReadOnlyState(true);
            return(textInfo2);
        }
示例#4
0
        public static TextInfo ReadOnly(TextInfo textInfo)
        {
            if (textInfo == null)
            {
                throw new ArgumentNullException("textInfo");
            }
            if (textInfo.IsReadOnly)
            {
                return(textInfo);
            }
            TextInfo textInfo1 = (TextInfo)textInfo.MemberwiseClone();
            int      num       = 1;

            textInfo1.SetReadOnlyState(num != 0);
            return(textInfo1);
        }
示例#5
0
        public static TextInfo ReadOnly(TextInfo textInfo)
        {
            if (textInfo == null)
            {
                throw new ArgumentNullException("textInfo");
            }
            if (textInfo.IsReadOnly)
            {
                return(textInfo);
            }

            TextInfo clonedTextInfo = (TextInfo)(textInfo.MemberwiseClone());

            clonedTextInfo.isReadOnly = true;

            return(clonedTextInfo);
        }
示例#6
0
        internal static TextInfo ReadOnly(TextInfo textInfo)
        {
            if (textInfo == null) { throw new ArgumentNullException("textInfo"); }
            Contract.EndContractBlock();
            if (textInfo.IsReadOnly) { return (textInfo); }

            TextInfo clonedTextInfo = (TextInfo)(textInfo.MemberwiseClone());
            clonedTextInfo.SetReadOnlyState(true);

            return (clonedTextInfo);
        }
 public static TextInfo ReadOnly(TextInfo textInfo) 
 {
     if (textInfo == null)       { throw new ArgumentNullException("textInfo"); }
     if (textInfo.IsReadOnly)    { return (textInfo); }
     
     TextInfo clonedTextInfo = (TextInfo)(textInfo.MemberwiseClone());
     clonedTextInfo.SetReadOnlyState(true);
     
     return (clonedTextInfo);
 }