Example #1
0
        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;
        }
Example #2
0
        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;
        }
Example #3
0
        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;
        }