Ejemplo n.º 1
0
        private HootsuiteData CheckHootsuiteData()
        {
            try
            {
                lock (_hootsuiteDataLocker)
                {
                    // Release the lock if we have the data already
                    if (_hootsuiteData != null)
                    {
                        return(_hootsuiteData);
                    }

                    // Deserialize from attribute data
                    var data = _model.GetAttribute("Hootsuite_RawData");
                    _hootsuiteData = JsonConvert.DeserializeObject <HootsuiteData>(data);

                    // Return data
                    return(_hootsuiteData);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
#if DEBUG
                MessageBox.Show(ex.Message);
#endif

                // Bummer. Create empty data structure and return
                _hootsuiteData = new HootsuiteData();
                return(_hootsuiteData);
            }
        }
Ejemplo n.º 2
0
        //TODO: Create view models for HootsuitePostConversation and HootsuitePostAttachment
        //public ObservableCollection<HootsuitePostConversationViewModel> Conversations { get; }
        //public ObservableCollection<HootsuitePostAttachmentViewModel> Attachments { get; }

        #endregion



        public HootsuiteDataViewModel(HootsuiteData data)
        {
            _model = data;
        }