Logo Search packages:      
Sourcecode: f-spot version File versions  Download package

PhotoPermissions.cs

using System;
using System.Xml;

namespace FlickrNet
{
      /// <summary>
      /// Permissions for the selected photo.
      /// </summary>
      [System.Serializable]
00010       public class PhotoPermissions
      {
            private string _photoId;
            private bool _isPublic;
            private bool _isFriend;
            private bool _isFamily;
            private PermissionAddMeta _permAddMeta;
            private PermissionComment _permComment;

            internal PhotoPermissions(XmlElement element)
            {
                  if( element.Attributes.GetNamedItem("id") != null )
                        _photoId = element.Attributes.GetNamedItem("id").Value;
                  if( element.Attributes.GetNamedItem("ispublic") != null )
                        _isPublic = element.Attributes.GetNamedItem("ispublic").Value=="1";
                  if( element.Attributes.GetNamedItem("isfamily") != null )
                        _isFamily = element.Attributes.GetNamedItem("isfamily").Value=="1";
                  if( element.Attributes.GetNamedItem("isfriend") != null )
                        _isFriend = element.Attributes.GetNamedItem("isfriend").Value=="1";
                  if( element.Attributes.GetNamedItem("permcomment") != null )
                        _permComment = (PermissionComment)Enum.Parse(typeof(PermissionComment), element.Attributes.GetNamedItem("permcomment").Value, true);
                  if( element.Attributes.GetNamedItem("permaddmeta") != null )
                        _permAddMeta = (PermissionAddMeta)Enum.Parse(typeof(PermissionAddMeta), element.Attributes.GetNamedItem("permaddmeta").Value, true);
            }

            /// <remarks/>
            public string PhotoId
00037             {
                  get { return _photoId; }
            }

            /// <remarks/>
            public bool IsPublic
00043             {
                  get { return _isPublic; }
            }
    
            /// <remarks/>
            public bool IsFriend
00049             {
                  get { return _isFriend; }
            }
    
            /// <remarks/>
            public bool IsFamily
00055             {
                  get { return _isFamily; }
            }

            /// <remarks/>
            public PermissionComment PermissionComment
00061             {
                  get { return _permComment; }
            }

            /// <remarks/>
            public PermissionAddMeta PermissionAddMeta
00067             {
                  get { return _permAddMeta; }
            }
      }

}

Generated by  Doxygen 1.6.0   Back to index