public PlusOneInfo(PlatformClient client, CommentInfo target)
     : base(client)
 {
     _lastUpdateMember = DateTime.MinValue;
     _targetId = "comment:" + target.Id;
     _activity = target.ParentActivity;
 }        
 public void TestInitialize()
 {
     client = new PlatformClient(
         new Uri("https://plus.google.com"), new Uri("https://talkgadget.google.com"), new System.Net.CookieContainer(), stub,
         new CacheDictionary<string, ProfileCache, ProfileData>(1200, 400, true, dt => new ProfileCache() { Value = dt }),
         new CacheDictionary<string, ActivityCache, ActivityData>(1200, 400, true, dt => new ActivityCache() { Value = dt }));
 }
 public AttachedImage(PlatformClient client, AttachedImageData data)
     : base(client)
 {
     _data = data;
     Image = new ImageInfo(client, data.Image);
     Album = new AlbumInfo(client, data.Album);
 }
 public PlusOneInfo(PlatformClient client, ActivityInfo target)
     : base(client)
 {
     _lastUpdateMember = DateTime.MinValue;
     _targetId = "buzz:" + target.Id;
     _activity = target;
 }
 public AttachedAlbum(PlatformClient client, AttachedAlbumData data)
     : base(client)
 {
     _data = data;
     Album = new AlbumInfo(client, data.Album);
     Pictures = _data.Pictures.Select(dt => new AttachedImage(client, dt)).ToArray();
 }
 public NotificationInfoContainer(PlatformClient client, bool isReadedItemOnly)
     : base(client)
 {
     _isReadedItemOnly = isReadedItemOnly;
     _notifications = new ObservableCollection<NotificationInfo>();
     Notifications = new ReadOnlyObservableCollection<NotificationInfo>(_notifications);
 }
 public NotificationInfoWithActor(SocialNotificationData data, NotificationInfoContainer container, PlatformClient client)
     : base(data, container, client)
 {
     _actionLogs = new ObservableCollection<NotificationItemInfo>(
         data.LogItems.Select(dt => new NotificationItemInfo(dt, client)));
     Actor = client.People.InternalGetAndUpdateProfile(data.LogItems.First().Actor);
     ActionLogs = new ReadOnlyObservableCollection<NotificationItemInfo>(_actionLogs);
 }
 public ActivityInfo(PlatformClient client, ActivityData data)
     : base(client)
 {
     _data = data;
     _postUser = data.Owner != null ? client.People.InternalGetAndUpdateProfile(data.Owner) : null;
     _attachedContent = data.AttachedContent != null ? AttachedContentDecorator(data.AttachedContent, client) : null;
     _comments = _data.Comments != null ? _data.Comments.Select(dt => new CommentInfo(Client, dt, _data, this)).ToArray() : null;
 }
 //ActivityInfo初期化はこちらの特殊仕様を使う。
 //これはActivityInfo用のCommentInfo、CommentInfo用のActivityInfoという無限ループ回避用処置
 internal CommentInfo(
     PlatformClient client, CommentData commentData, ActivityData activityData, ActivityInfo activityInfo)
     : base(client)
 {
     _commentData = commentData;
     _activityData = activityData;
     _owner = commentData.Owner != null ? client.People.InternalGetAndUpdateProfile(commentData.Owner) : null;
     _parentActivity = activityInfo;
     _talkgadgetBindObjs = new Dictionary<EventHandler, IDisposable>();
 }
 public NotificationContainer(PlatformClient client) : base(client) { }
 public NotificationInfoWithActivity(ContentNotificationData data, NotificationInfoContainer container, PlatformClient client)
     : base(data, container, client) { Activity = client.Activity.InternalGetAndUpdateActivity(data.Target); }
 public NotificationItemInfo(NotificationItemData data, PlatformClient client)
     : base(client)
 {
     _data = data;
     Actor = Client.People.InternalGetAndUpdateProfile(_data.Actor);
 }
 public NotificationInfo(NotificationData data, NotificationInfoContainer container, PlatformClient client)
     : base(client)
 {
     _data = data;
     _container = container;
 }
 public AttachedPost(PlatformClient client, AttachedPostData data)
 {
     _data = data;
     AttachedContent = data.AttachedContent != null
         ? ActivityInfo.AttachedContentDecorator(data.AttachedContent, client) : null;
 }
 public static IAttachable AttachedContentDecorator(IAttachable info, PlatformClient client)
 {
     switch(info.Type)
     {
         case ContentType.Album:
             return new AttachedAlbum(client, (AttachedAlbumData)info);
         case ContentType.Image:
             return new AttachedImage(client, (AttachedImageData)info);
         case ContentType.Reshare:
             return new AttachedPost(client, (AttachedPostData)info);
         default:
             return info;
     }
 }
 public async Task<PlatformClient> Create(System.Net.CookieContainer cookie,
     int accountIndex, IApiAccessor[] accessors = null,
     CacheDictionary<string, ProfileCache, ProfileData> profileCacheStorage = null,
     CacheDictionary<string, ActivityCache, ActivityData> activityCacheStorage = null)
 {
     var accountPrefix = string.Format("u/{0}/", accountIndex);
     accessors = accessors ?? new IApiAccessor[] { new DefaultAccessor() };
     //accessors内で使えるものを検索
     //G+apiバージョンで降順にしたIApiAccessor配列が用いられることを想定してる
     foreach (var item in accessors)
     {
         var client = new PlatformClient(
             new Uri(PlusBaseUrl, accountPrefix),
             new Uri(TalkBaseUrl, accountPrefix), cookie, item,
             profileCacheStorage ?? new CacheDictionary<string, ProfileCache, ProfileData>(1200, 400, true, dt => new ProfileCache() { Value = dt }),
             activityCacheStorage ?? new CacheDictionary<string, ActivityCache, ActivityData>(1200, 400, true, dt => new ActivityCache() { Value = dt }));
         try
         {
             await client.UpdateHomeInitDataAsync(true);
             return client;
         }
         catch (FailToOperationException)
         { client.Dispose(); }
     }
     throw new FailToOperationException("Create()に失敗。使用できるIApiAccessorがありませんでした。", null);
 }