Ejemplo n.º 1
0
        /// <summary>
        /// Facebook API Instance
        /// </summary>
        /// <param name="session"></param>
        public Api(FacebookSession session) : base(session)
        {
            AuthToken = string.Empty;

#if !SILVERLIGHT
            InstalledCulture = CultureInfo.InstalledUICulture;
#else
            InstalledCulture = CultureInfo.CurrentUICulture;
#endif

            Session = session;

            Auth          = new Auth(Session);
            Video         = new Video(Session);
            Marketplace   = new Marketplace(Session);
            Admin         = new Admin(Session);
            Photos        = new Photos(Session);
            Users         = new Users(Session);
            Friends       = new Friends(Users, Session);
            Events        = new Events(Session);
            Groups        = new Groups(Session);
            Notifications = new Notifications(Session);
            Profile       = new Profile(Session);
            Fbml          = new Fbml(Session);
            Feed          = new Feed(Session);
            Fql           = new Fql(Session);
            LiveMessage   = new LiveMessage(Session);
            Message       = new Message(Session);
            Batch         = new Batch(Session);
            Pages         = new Pages(Session);
            Application   = new Application(Session);
            Data          = new Data(Session);
            Permissions   = new Permissions(Session);
            Connect       = new Connect(Session);
            Comments      = new Comments(Session);
            Stream        = new Stream(Session);
            Status        = new Status(Session);
            Links         = new Links(Session);
            Notes         = new Notes(Session);
            Intl          = new Intl(Session);

            Batch.Batch             = Batch;
            Permissions.Permissions = Permissions;
            Batch.Permissions       = Permissions;
            Permissions.Batch       = Batch;

            foreach (RestBase restBase in new RestBase[] { Auth, Video, Marketplace, Admin, Photos, Users, Friends, Events,
                                                           Groups, Notifications, Profile, Fbml, Feed, Fql, LiveMessage, Message, Pages, Application, Data, Connect, Comments,
                                                           Stream, Status, Links, Notes })
            {
                restBase.Batch       = Batch;
                restBase.Permissions = Permissions;
            }
        }
        public IFacebookApi Initialize(IFacebookSession session)
        {
            AuthToken = string.Empty;

            #if !SILVERLIGHT
            InstalledCulture = CultureInfo.InstalledUICulture;
            #else
            InstalledCulture = CultureInfo.CurrentUICulture;
            #endif

            Session = session;

            Auth = new Auth(Session);
            Video = new Video(Session);
            Marketplace = new Marketplace(Session);
            Admin = new Admin(Session);
            Photos = new Photos(Session);
            Users = new Users(Session);
            Friends = new Friends(Users, Session);
            Events = new Events(Session);
            Groups = new Groups(Session);
            Notifications = new Notifications(Session);
            Profile = new Profile(Session);
            Fbml = new Fbml(Session);
            Feed = new Feed(Session);
            Fql = new Fql(Session);
            LiveMessage = new LiveMessage(Session);
            Message = new Message(Session);
            Batch = new Batch(Session);
            Pages = new Pages(Session);
            Application = new Application(Session);
            Data = new Data(Session);
            Permissions = new Permissions(Session);
            Connect = new Connect(Session);
            Comments = new Comments(Session);
            Stream = new Stream(Session);
            Status = new Status(Session);
            Links = new Links(Session);
            Notes = new Notes(Session);
            Intl = new Intl(Session);

            Batch.Batch = Batch;
            Permissions.Permissions = Permissions;
            Batch.Permissions = Permissions;
            Permissions.Batch = Batch;

            foreach (IRestBase restBase in new IRestBase[] {Auth, Video, Marketplace, Admin, Photos, Users, Friends, Events,
                Groups, Notifications, Profile, Fbml, Feed, Fql, LiveMessage, Message, Pages, Application, Data, Connect, Comments,
                Stream, Status, Links, Notes})
            {
                restBase.Batch = Batch;
                restBase.Permissions = Permissions;
            }

            return this;
        }