public AccountDetail(Uri host, MastodonAccountSetting item) { this.Instance = host; this.Id = item.Id; this._userName = item.UserName; this._name = item.DisplayName; this._isProtected = item.IsLocked; this._profileImageUrl = item.Avatar; }
public MastodonAccount(MastodonAccountSetting item) : base(false) { this._setting = item.Clone(); this.ItemId = item.ItemId; this.Api = item.CreateApi(); this.InstanceHost = item.InstanceUrl.Host; this.DataStore = new MastodonDataManager(item.InstanceUrl); this.Info = this.DataStore.GetAccount(item); this.Timeline = new MastodonTimeline(this); this.Commands = new AccountCommandGroup(this); ((INotifyPropertyChanged)this.Info).PropertyChanged += this.OnProfileUpdated; }
public MastodonAccount(string itemId, MastodonApi api, Account account) : base(true) { this._setting = new() { ItemId = itemId, InstanceUrl = api.HostUrl, Id = account.Id, }; this.ItemId = itemId; this.Api = api; this.UpdateApiTokens(api); this.InstanceHost = api.HostUrl.Host; this.DataStore = new MastodonDataManager(api.HostUrl); this.Info = this.DataStore.RegisterAccount(account); this.Timeline = new MastodonTimeline(this); this.Commands = new AccountCommandGroup(this); this.OnProfileUpdated(this.Info, new(null)); ((INotifyPropertyChanged)this.Info).PropertyChanged += this.OnProfileUpdated; }