Exemple #1
0
 public CTFramesetter(NSAttributedString value)
 {
     if (value == null)
         throw ConstructorError.ArgumentNull (this, "value");
     handle = CTFramesetterCreateWithAttributedString (value.Handle);
     if (handle == IntPtr.Zero)
         throw ConstructorError.Unknown (this);
 }
Exemple #2
0
        public CTTypesetter(NSAttributedString value, CTTypesetterOptions options)
        {
            if (value == null)
                throw ConstructorError.ArgumentNull (this, "value");

            handle = CTTypesetterCreateWithAttributedStringAndOptions (value.Handle,
                    options == null ? IntPtr.Zero : options.Dictionary.Handle);

            if (handle == IntPtr.Zero)
                throw ConstructorError.Unknown (this);
        }
Exemple #3
0
        public void Append(NSAttributedString first, params object [] rest)
        {
            Append (first);
            foreach (var obj in rest){
                if (obj is NSAttributedString)
                    Append ((NSAttributedString) obj);
                else if (obj is string)
                    Append (new NSAttributedString ((string) obj));
                else
                    Append (new NSAttributedString (obj.ToString ()));

            }
        }
 public void Append(NSAttributedString first, params object [] rest)
 {
     Append(first);
     foreach (var obj in rest)
     {
         if (obj is NSAttributedString)
         {
             Append((NSAttributedString)obj);
         }
         else if (obj is string)
         {
             Append(new NSAttributedString((string)obj));
         }
         else
         {
             Append(new NSAttributedString(obj.ToString()));
         }
     }
 }
Exemple #5
0
 public static SCNText Create(NSAttributedString attributedString, nfloat extrusionDepth)
 {
     return Create ((NSObject) attributedString, extrusionDepth);
 }
Exemple #6
0
        internal NSAttributedString(NSData data, NSAttributedStringDataType type, out NSDictionary resultDocumentAttributes)
        {
            switch (type) {
            case NSAttributedStringDataType.DocFormat:
                Handle = new NSAttributedString (data, out resultDocumentAttributes).Handle;
                break;
            case NSAttributedStringDataType.HTML:
                Handle = InitWithHTML (data, out resultDocumentAttributes);
                break;
            case NSAttributedStringDataType.RTF:
                Handle = InitWithRtf (data, out resultDocumentAttributes);
                break;
            case NSAttributedStringDataType.RTFD:
                Handle = InitWithRtfd (data, out resultDocumentAttributes);
                break;
            default:
                throw new ArgumentException("Error creating NSAttributedString.");
            }

            if (Handle == IntPtr.Zero)
                throw new ArgumentException("Error creating NSAttributedString.");
        }
Exemple #7
0
 public NSTextStorage(NSAttributedString other)
     : base(other)
 {
 }