public NewsFeedElement(string name, string imageUrl, DateTimeOffset time, IEnumerable<TextBlock> headerBlocks, IEnumerable<TextBlock> bodyBlocks, UIImage littleImage, Action tapped)
            : base(null)
        {
            _name = name;
            Uri.TryCreate(imageUrl, UriKind.Absolute, out _imageUri);
            _time = time.ToDaysAgo();
            _actionImage = littleImage;
            _tapped = tapped;

            var header = CreateAttributedStringFromBlocks(headerBlocks);
            _attributedHeader = header.Item1;
            _headerLinks = header.Item2;

            var body = CreateAttributedStringFromBlocks(bodyBlocks);
            _attributedBody = body.Item1;
            _bodyLinks = body.Item2;
            _bodyBlocks = bodyBlocks.Count();

            _headerLinkDelegate = new LinkDelegate(_headerLinks, this);
            _bodyLinkDelegate = new LinkDelegate(_bodyLinks, this);
        }
Example #2
0
        public NewsFeedElement(string name, string imageUrl, DateTimeOffset time, IEnumerable <TextBlock> headerBlocks, IEnumerable <TextBlock> bodyBlocks, UIImage littleImage, Action tapped)
            : base(null)
        {
            _name = name;
            Uri.TryCreate(imageUrl, UriKind.Absolute, out _imageUri);
            _time        = time.ToDaysAgo();
            _actionImage = littleImage;
            _tapped      = tapped;

            var header = CreateAttributedStringFromBlocks(headerBlocks);

            _attributedHeader = header.Item1;
            _headerLinks      = header.Item2;

            var body = CreateAttributedStringFromBlocks(bodyBlocks);

            _attributedBody = body.Item1;
            _bodyLinks      = body.Item2;
            _bodyBlocks     = bodyBlocks.Count();

            _headerLinkDelegate = new LinkDelegate(_headerLinks, this);
            _bodyLinkDelegate   = new LinkDelegate(_bodyLinks, this);
        }
Example #3
0
		/// -----------------------------------------------------------------------------------
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing"><c>true</c> to release both managed and unmanaged
		/// resources; <c>false</c> to release only unmanaged resources.
		/// </param>
		/// -----------------------------------------------------------------------------------
		protected override void Dispose(bool disposing)
		{
			//Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************");
			// Must not be run more than once.
			if (IsDisposed)
				return;

			FdoCache wndCache = null;
			if (disposing)
			{
				if (m_delegate != null)
					m_delegate.Dispose();
				if (m_viewHelper != null)
					m_viewHelper.Dispose();
				if (FwApp.App != null)
				{
					FwApp.App.OkToCloseApp = false;
					FwApp.App.RemoveWindow(this, out wndCache);
				}
			}

			// NOTE: base.Dispose() may need the FdoCache which RemoveWindow() wants to delete.
			base.Dispose(disposing);

			if (disposing)
			{
				if (FwApp.App != null)
				{
					FwApp.App.OkToCloseApp = true;
					if (wndCache != null)
						FwApp.App.RemoveFdoCache(wndCache);
				}
			}
			m_viewHelper = null;
			m_delegate = null;
			IncomingLinkHandler = null;
		}
Example #4
0
		private void BasicInit()
		{
			m_delegate = new MainWindowDelegate(this);
			IncomingLinkHandler = new LinkDelegate(OnIncomingLink);
		}
Example #5
0
 public static UIComponentVerificationProvider <Control <TOwner>, TOwner> WaitTo <TNavigateTo, TOwner>(this LinkDelegate <TNavigateTo, TOwner> clickable)
     where TNavigateTo : PageObject <TNavigateTo>
     where TOwner : PageObject <TOwner>
 {
     return(clickable.GetControl().WaitTo);
 }
Example #6
0
 public static DataProvider <string, TOwner> Content <TNavigateTo, TOwner>(this LinkDelegate <TNavigateTo, TOwner> clickable)
     where TNavigateTo : PageObject <TNavigateTo>
     where TOwner : PageObject <TOwner>
 {
     return(clickable.GetControl().Content);
 }
Example #7
0
 public static bool Missing <TNavigateTo, TOwner>(this LinkDelegate <TNavigateTo, TOwner> clickable, SearchOptions options = null)
     where TNavigateTo : PageObject <TNavigateTo>
     where TOwner : PageObject <TOwner>
 {
     return(clickable.GetControl().Missing(options));
 }
 public static TOwner Focus <TOwner>(this LinkDelegate <TOwner> clickable)
     where TOwner : PageObject <TOwner>
 {
     return(clickable.GetControl().Focus());
 }
Example #9
0
 public static TOwner ScrollTo <TNavigateTo, TOwner>(this LinkDelegate <TNavigateTo, TOwner> clickable)
     where TNavigateTo : PageObject <TNavigateTo>
     where TOwner : PageObject <TOwner>
 {
     return(clickable.GetControl().ScrollTo());
 }
Example #10
0
 public static Link <TNavigateTo, TOwner> GetControl <TNavigateTo, TOwner>(this LinkDelegate <TNavigateTo, TOwner> clickable)
     where TNavigateTo : PageObject <TNavigateTo>
     where TOwner : PageObject <TOwner>
 {
     return((Link <TNavigateTo, TOwner>)UIComponentResolver.GetControlByDelegate <TOwner>(clickable));
 }
Example #11
0
 public static UIComponentVerificationProvider <Control <TOwner>, TOwner> Should <TOwner>(this LinkDelegate <TOwner> clickable)
     where TOwner : PageObject <TOwner>
 {
     return(clickable.GetControl().Should);
 }
Example #12
0
 public static bool Exists <TOwner>(this LinkDelegate <TOwner> clickable, SearchOptions options = null)
     where TOwner : PageObject <TOwner>
 {
     return(clickable.GetControl().Exists(options));
 }
Example #13
0
 public static TOwner RightClick <TOwner>(this LinkDelegate <TOwner> clickable)
     where TOwner : PageObject <TOwner>
 {
     return(clickable.GetControl().RightClick());
 }
Example #14
0
 public void AddLinkEvent(LinkDelegate del)
 {
     _linkEvent += del;
 }
Example #15
0
 public static bool IsEnabled <TNavigateTo, TOwner>(this LinkDelegate <TNavigateTo, TOwner> clickable)
     where TNavigateTo : PageObject <TNavigateTo>
     where TOwner : PageObject <TOwner>
 {
     return(clickable.GetControl().IsEnabled.Value);
 }
Example #16
0
 public void RemoveLinkEvent(LinkDelegate del)
 {
     _linkEvent -= del;
 }
Example #17
0
 public static TNavigateTo ClickAndGo <TNavigateTo, TOwner>(this LinkDelegate <TNavigateTo, TOwner> linkDelegate)
     where TNavigateTo : PageObject <TNavigateTo>
     where TOwner : PageObject <TOwner>
 {
     return(linkDelegate.GetControl().ClickAndGo());
 }