private void save_Click(object sender, RoutedEventArgs e) { bool canSave = true; if (String.IsNullOrEmpty(TitleText.Text)) { MessageBox.Show("You must enter a title."); canSave = false; } if (canSave & String.IsNullOrEmpty(LinkText.Text)) { MessageBox.Show("You must enter a Url."); canSave = false; } if (canSave & (!LinkText.Text.ToUpper().StartsWith("HTTP://") && !LinkText.Text.ToUpper().StartsWith("HTTPS://"))) { MessageBox.Show("Url must begin with http:// or https://."); canSave = false; } if (canSave) { TitleText.GetBindingExpression(TextBox.TextProperty).UpdateSource(); LinkText.GetBindingExpression(TextBox.TextProperty).UpdateSource(); viewModel.Save(() => { NavigationService.GoBack(); PhoneApplicationService.Current.State["RefreshNeeded"] = true; }); } }
private void PasteHref_Loaded(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(Link)) { if (LinkText != null && LinkText.Contains("://") && !LinkText.Contains("\n")) { Link = LinkText; } else { string clipText = Clipboard.GetText(); if (clipText != null && clipText.Contains("://") && !clipText.Contains("\n")) { Link = clipText; } } } if (string.IsNullOrEmpty(LinkText) && !string.IsNullOrEmpty(Link)) { LinkText = Link; } if (string.IsNullOrEmpty(LinkText)) { this.TextLinkText.Focus(); } else { this.TextLink.Focus(); } }
internal T ClickLink <T>(LinkText link) { switch (link) { case LinkText.Home: Click(Home); LoggerHelpers.LogInfoAboutPageOrWindowOpening("HomePage"); return((T)Convert.ChangeType(new HomePage(Driver), typeof(T))); case LinkText.About: Click(AboutLinkLocator); LoggerHelpers.LogInfoAboutPageOrWindowOpening("AboutPage"); return((T)Convert.ChangeType(new AboutPage(Driver), typeof(T))); case LinkText.Business: Click(BusinessLinkLocator); LoggerHelpers.LogInfoAboutPageOrWindowOpening("BusinessPage"); return((T)Convert.ChangeType(new BusinessPage(Driver), typeof(T))); case LinkText.Careers: Click(CareersLinkLocator); LoggerHelpers.LogInfoAboutPageOrWindowOpening("CareerPage"); return((T)Convert.ChangeType(new CareersPage(Driver), typeof(T))); case LinkText.Contact: Click(ContactLinkLocator); LoggerHelpers.LogInfoAboutPageOrWindowOpening("ContactPage"); return((T)Convert.ChangeType(new ContactPage(Driver), typeof(T))); default: throw new Exception("No such link text"); } }
public LinkText GetValue(LinkText key, bool strict = true) { HttpQueryPair pair; Expect(_pairsByKey.TryGetValue(key, out pair) || !strict, "Unknown key: " + Text.Of(key)); return(pair == null ? null : pair.Value); }
public PostDto ToDto() { return(new PostDto { Id = Id, Title = Title.Trim(), LinkText = LinkText.Trim().ToLower(), PreviewText = PreviewText.Trim(), FullText = FullText.Trim(), PublishedAt = PublishedAt, Tags = Tags // IsPublished ignored }); }
public override int GetHashCode() { unchecked { var hashCode = Id; hashCode = (hashCode * 397) ^ ThemeId; hashCode = (hashCode * 397) ^ NotifyTime.GetHashCode(); hashCode = (hashCode * 397) ^ (Text != null ? Text.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Link != null ? Link.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (LinkText != null ? LinkText.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)FeedbackType; return(hashCode); } }
public Result Query(string q) { WebClient client = new WebClient(); client.Headers.Add("User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31"); string res = client.DownloadString(endpoint + q.Replace(" ", "+")); XmlDocument doc = new XmlDocument(); doc.LoadXml(res); Result r = new Result(); try { r.Abstract = new LinkText(); r.Abstract.Value = doc.SelectSingleNode("/DuckDuckGoResponse/AbstractText").InnerText; r.Abstract.Url = doc.SelectSingleNode("/DuckDuckGoResponse/AbstractURL").InnerText; //r.Abstract = l; } catch { } try { XmlNodeList list = doc.SelectNodes("/DuckDuckGoResponse/RelatedTopics/RelatedTopic"); LinkText[] results = new LinkText[list.Count]; for (int i = 0; i < list.Count; i++) { results[i] = new LinkText(); results[i].Url = list[i].InnerText; results[i].Value = list[i]["Text"].InnerText; } r.Related = results; } catch { } return(r); }
protected override void Execute(CodeActivityContext eContext) { var lookup = LookupAttribute.Get(eContext); var orgurl = OrgUrl.Get(eContext); var context = eContext.GetExtension<IWorkflowContext>(); var serviceFactory = eContext.GetExtension<IOrganizationServiceFactory>(); var service = serviceFactory.CreateOrganizationService(context.UserId); var reference = GetReference(service, lookup, new EntityReference(context.PrimaryEntityName, context.PrimaryEntityId)); // Update Reference Information if (reference == null) return; ID.Set(eContext, reference.Id.ToString()); LogicalName.Set(eContext, reference.LogicalName); // Update URL Information if (string.IsNullOrWhiteSpace(orgurl)) return; var url = CreateUrl(orgurl, reference); URL.Set(eContext, url); HtmlLink.Set(eContext, CreateHtmlLink(service, reference, url, LinkText.Get(eContext))); }
private void btnOK_Click(object sender, System.EventArgs e) { if (LinkText == String.Empty) { DisplayMessage.Show(MessageId.NoLinkTextSpecified, this); txtText.Focus(); } else if (Url.Trim() == String.Empty || Url.Trim() == HTTP_PREFIX) { DisplayMessage.Show(MessageId.NoValidHyperlinkSpecified, this); } else if (!_edit && IsAlreadyInGlossary(LinkText.Trim())) { if (DisplayMessage.Show(MessageId.ConfirmReplaceEntry) == DialogResult.Yes) { DialogResult = DialogResult.OK; } } else { DialogResult = DialogResult.OK; } }
public string GenerateQuery() { var query = $@" IF(NOT EXISTS(SELECT TOP (1) 1 from [dbo].[GenericAnnouncements] where ExternalId={ID.Safe()} )) BEGIN INSERT INTO [dbo].[GenericAnnouncements] ([Id] ,[ExternalId] ,[HostSite] ,[Title] ,[Description] ,[Owner] ,[Images] ,[ThumbImages] ,[SmallImages] ,[LargeUrls] ,[Price] ,[First_Publication_Date] ,[Expiration_Date] ,[Category_Id] ,[Category_Name] ,[LinkUrl] ,[Extra] ,[LinkText] ,[City] ,[Latitude] ,[Langitude] ,[Region] ,[SourceType]) VALUES (NEWID() ,{ID.Safe()} ,{HostSite.Safe()} ,{Title.Safe()} ,{Description.Safe()} ,{Owner.Safe()} ,{Images.Safe()} ,{ThumbImages.Safe()} ,{SmallImages.Safe()} ,{LargeUrls.Safe()} ,{Price.Safe()} ,{first_publication_date.Safe()} ,{expiration_date.Safe()} ,{category_id.Safe()} ,{category_name.Safe()} ,{LinkUrl.Safe()} ,{Extra.Safe()} ,{LinkText.Safe()} ,{City.Safe()} ,{Latitude.Safe()} ,{Langitude.Safe()} ,{Region.Safe()} ,0) END; ELSE BEGIN UPDATE [dbo].[GenericAnnouncements] SET [HostSite] = {HostSite.Safe()} ,[Title] = {Title.Safe()} ,[Description] = {Description.Safe()} ,[Owner] = {Owner.Safe()} ,[Images] = {Images.Safe()} ,[ThumbImages] = {ThumbImages.Safe()} ,[SmallImages] = {SmallImages.Safe()} ,[LargeUrls] = {LargeUrls.Safe()} ,[Price] = {Price.Safe()} ,[First_Publication_Date] = {first_publication_date.Safe()} ,[Expiration_Date] = {expiration_date.Safe()} ,[Category_Id] = {category_id.Safe()} ,[Category_Name] = {category_name.Safe()} ,[LinkUrl] = {LinkUrl.Safe()} ,[Extra] = {Extra.Safe()} ,[LinkText] = {LinkText.Safe()} ,[City] = {City.Safe()} ,[Latitude] = {Latitude.Safe()} ,[Langitude] = {Langitude.Safe()} ,[Region] = {Region.Safe()} --,[SourceType] = <SourceType, int,> WHERE ExternalId={ID.Safe()} END; "; return(query); }
protected override void Render(HtmlTextWriter writer) { base.Render(writer); var sb = new StringBuilder(); sb.AppendFormat("<div id='{0}'>", _jsObjName); if (IsMobileVersion) { sb.AppendFormat("<select class='comboBox' style='width:{0}px;' onchange='javascript:{1}.SelectUser(this);' >", InputWidth, _jsObjName); sb.AppendFormat("<option style='max-width:300px;' value='{0}' {2}>{1}</option>", -1, _linkText.HtmlEncode(), Guid.Empty.Equals(SelectedUserId) ? "selected = 'selected'" : string.Empty); var accounts = CoreContext.Authentication.GetUserAccounts().OrderBy(a => a.Department).ThenBy(a => a.Name); var department = ""; foreach (var account in accounts) { if (!String.Equals(account.Department, department, StringComparison.InvariantCultureIgnoreCase) && !String.IsNullOrEmpty(account.Department.HtmlEncode())) { if (department != "") { sb.Append("</optgroup>"); } department = account.Department; sb.AppendFormat("<optgroup label='{0}' style='max-width:300px;'>", department.HtmlEncode()); } sb.AppendFormat("<option style='max-width:300px;' value='{0}' {2}>{1}</option>", account.ID, account.Name.HtmlEncode(), Equals(account.ID, SelectedUserId) ? "selected = 'selected'" : string.Empty); } sb.AppendFormat("</select>"); } else { var valueForInput = Guid.Empty.Equals(SelectedUserId) ? string.Empty : CoreContext.UserManager.GetUsers(SelectedUserId).DisplayUserName().ReplaceSingleQuote(); if (IsLinkView) { sb.AppendFormat("<div><span class='addUserLink' onclick='{0}.OnInputClick({0}, event);'><a class='baseLinkAction linkMedium'>{1}</a><img src='{2}' align='absmiddle' style='margin-left:3px'></span></div>", _jsObjName, LinkText.HtmlEncode(), Page.ClientScript.GetWebResourceUrl(GetType(), "ASC.Web.Controls.AdvancedUserSelector.images.sort_down_black.png")); } else { var peopleImgStyle = valueForInput.Trim() == string.Empty ? "display:none;" : "display:block;"; var searchImgStyle = valueForInput.Trim() == string.Empty ? "display:block;" : "display:none;"; sb.AppendFormat(@" <table cellspacing='0' cellpadding='1' class='borderBase adv-userselector-inputContainer' width='{0}px'> <tbody> <tr> <td width='16px'> <img align='absmiddle' src='{1}' id='peopleImg' style='margin:2px;{7}'/> <img align='absmiddle' src='{2}' id='searchImg' style='{8}'/> </td> <td> <input type='text' id='inputUserName' autocomplete='off' oninput='{3}.SuggestUser(event);' onpaste='{3}.SuggestUser(event);' onkeyup='{3}.SuggestUser(event);' onclick='{3}.OnInputClick({3}, event);' onkeydown='{3}.ChangeSelection(event);' class='textEdit' style='width:100%;' value='{5}'/> <input id='login' name='login' value='{6}' type='hidden'/> </td> <td width='20px' onclick='{3}.OnInputClick({3}, event);'> <img align='absmiddle' src='{4}' style='cursor:pointer;'/> </td> </tr> </tbody> </table>", InputWidth + 8, Page.ClientScript.GetWebResourceUrl(GetType(), "ASC.Web.Controls.AdvancedUserSelector.images.people_icon.png"), Page.ClientScript.GetWebResourceUrl(GetType(), "ASC.Web.Controls.AdvancedUserSelector.images.search.png"), _jsObjName, Page.ClientScript.GetWebResourceUrl(GetType(), "ASC.Web.Controls.AdvancedUserSelector.images.collapse_down_dark.png"), valueForInput, SelectedUserId, peopleImgStyle, searchImgStyle); } sb.AppendFormat("<div id='DepsAndUsersContainer' class='adv-userselector-DepsAndUsersContainer' {0}>", IsLinkView ? "style='height:230px'" : string.Empty); if (IsLinkView) { sb.Append("<div style='margin-bottom: 10px;'>"); sb.Append("<div style=width:50%;'>"); sb.AppendFormat(@" <table cellspacing='0' cellpadding='1' class='borderBase adv-userselector-inputContainer' width='100%' style='height: 18px;'> <tbody> <tr> <td> <input type='text' id='inputUserName' autocomplete='off' oninput='javascript:{0}.SuggestUser(event);' onpaste='javascript:{0}.SuggestUser(event);' onkeyup='javascript:{0}.SuggestUser(event);' onclick='{0}.OnInputClick({0}, event);' onkeydown='{0}.ChangeSelection(event);' class='textEdit' style='width:100%;' value='{1}'/> </td> <td width='16px'> <img align='absmiddle' src='{2}' onclick='{0}.ClearFilter();' style='cursor:pointer;' title='{3}'/> </td> </tr> </tbody> </table>", _jsObjName, valueForInput, Page.ClientScript.GetWebResourceUrl(GetType(), "ASC.Web.Controls.AdvancedUserSelector.images.cross_grey.png"), Resources.AdvancedUserSelectorResource.ClearFilter); sb.AppendFormat("<input id='login' name='login' value='{0}' type='hidden'/>", SelectedUserId); sb.Append("</div>"); sb.Append("</div>"); } sb.Append(" <div id='divUsers' class='adv-userselector-users'></div>"); sb.Append(" <div id='divDepartments' class='adv-userselector-deps'></div>"); sb.Append("</div>"); } sb.Append("</div>"); writer.Write(sb.ToString()); }
public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; if (StaticPlot != null) { hashCode = hashCode * 59 + StaticPlot.GetHashCode(); } if (PlotlyServerUrl != null) { hashCode = hashCode * 59 + PlotlyServerUrl.GetHashCode(); } if (Editable != null) { hashCode = hashCode * 59 + Editable.GetHashCode(); } if (Edits != null) { hashCode = hashCode * 59 + Edits.GetHashCode(); } if (AutoSizable != null) { hashCode = hashCode * 59 + AutoSizable.GetHashCode(); } if (Responsive != null) { hashCode = hashCode * 59 + Responsive.GetHashCode(); } if (FillFrame != null) { hashCode = hashCode * 59 + FillFrame.GetHashCode(); } if (FrameMargins != null) { hashCode = hashCode * 59 + FrameMargins.GetHashCode(); } if (ScrollZoom != null) { hashCode = hashCode * 59 + ScrollZoom.GetHashCode(); } if (DoubleClick != null) { hashCode = hashCode * 59 + DoubleClick.GetHashCode(); } if (DoubleClickDelay != null) { hashCode = hashCode * 59 + DoubleClickDelay.GetHashCode(); } if (ShowAxisDragHandles != null) { hashCode = hashCode * 59 + ShowAxisDragHandles.GetHashCode(); } if (ShowAxisRangeEntryBoxes != null) { hashCode = hashCode * 59 + ShowAxisRangeEntryBoxes.GetHashCode(); } if (ShowTips != null) { hashCode = hashCode * 59 + ShowTips.GetHashCode(); } if (ShowLink != null) { hashCode = hashCode * 59 + ShowLink.GetHashCode(); } if (LinkText != null) { hashCode = hashCode * 59 + LinkText.GetHashCode(); } if (SendData != null) { hashCode = hashCode * 59 + SendData.GetHashCode(); } if (ShowSources != null) { hashCode = hashCode * 59 + ShowSources.GetHashCode(); } if (DisplayModeBar != null) { hashCode = hashCode * 59 + DisplayModeBar.GetHashCode(); } if (ShowSendToCloud != null) { hashCode = hashCode * 59 + ShowSendToCloud.GetHashCode(); } if (ShowEditInChartStudio != null) { hashCode = hashCode * 59 + ShowEditInChartStudio.GetHashCode(); } if (ModeBarButtonsToRemove != null) { hashCode = hashCode * 59 + ModeBarButtonsToRemove.GetHashCode(); } if (ModeBarButtonsToAdd != null) { hashCode = hashCode * 59 + ModeBarButtonsToAdd.GetHashCode(); } if (ModeBarButtons != null) { hashCode = hashCode * 59 + ModeBarButtons.GetHashCode(); } if (ToImageButtonOptions != null) { hashCode = hashCode * 59 + ToImageButtonOptions.GetHashCode(); } if (DisplayLogo != null) { hashCode = hashCode * 59 + DisplayLogo.GetHashCode(); } if (Watermark != null) { hashCode = hashCode * 59 + Watermark.GetHashCode(); } if (PlotGlPixelRatio != null) { hashCode = hashCode * 59 + PlotGlPixelRatio.GetHashCode(); } if (SetBackground != null) { hashCode = hashCode * 59 + SetBackground.GetHashCode(); } if (TopoJsonUrl != null) { hashCode = hashCode * 59 + TopoJsonUrl.GetHashCode(); } if (MapboxAccessToken != null) { hashCode = hashCode * 59 + MapboxAccessToken.GetHashCode(); } if (Logging != null) { hashCode = hashCode * 59 + Logging.GetHashCode(); } if (NotifyOnLogging != null) { hashCode = hashCode * 59 + NotifyOnLogging.GetHashCode(); } if (QueueLength != null) { hashCode = hashCode * 59 + QueueLength.GetHashCode(); } if (GlobalTransforms != null) { hashCode = hashCode * 59 + GlobalTransforms.GetHashCode(); } if (Locale != null) { hashCode = hashCode * 59 + Locale.GetHashCode(); } if (Locales != null) { hashCode = hashCode * 59 + Locales.GetHashCode(); } return(hashCode); } }
public bool Equals([AllowNull] Config other) { if (other == null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return((StaticPlot == other.StaticPlot && StaticPlot != null && other.StaticPlot != null && StaticPlot.Equals(other.StaticPlot)) && (PlotlyServerUrl == other.PlotlyServerUrl && PlotlyServerUrl != null && other.PlotlyServerUrl != null && PlotlyServerUrl.Equals(other.PlotlyServerUrl)) && (Editable == other.Editable && Editable != null && other.Editable != null && Editable.Equals(other.Editable)) && (Edits == other.Edits && Edits != null && other.Edits != null && Edits.Equals(other.Edits)) && (AutoSizable == other.AutoSizable && AutoSizable != null && other.AutoSizable != null && AutoSizable.Equals(other.AutoSizable)) && (Responsive == other.Responsive && Responsive != null && other.Responsive != null && Responsive.Equals(other.Responsive)) && (FillFrame == other.FillFrame && FillFrame != null && other.FillFrame != null && FillFrame.Equals(other.FillFrame)) && (FrameMargins == other.FrameMargins && FrameMargins != null && other.FrameMargins != null && FrameMargins.Equals(other.FrameMargins)) && (ScrollZoom == other.ScrollZoom && ScrollZoom != null && other.ScrollZoom != null && ScrollZoom.Equals(other.ScrollZoom)) && (DoubleClick == other.DoubleClick && DoubleClick != null && other.DoubleClick != null && DoubleClick.Equals(other.DoubleClick)) && (DoubleClickDelay == other.DoubleClickDelay && DoubleClickDelay != null && other.DoubleClickDelay != null && DoubleClickDelay.Equals(other.DoubleClickDelay)) && (ShowAxisDragHandles == other.ShowAxisDragHandles && ShowAxisDragHandles != null && other.ShowAxisDragHandles != null && ShowAxisDragHandles.Equals(other.ShowAxisDragHandles)) && (ShowAxisRangeEntryBoxes == other.ShowAxisRangeEntryBoxes && ShowAxisRangeEntryBoxes != null && other.ShowAxisRangeEntryBoxes != null && ShowAxisRangeEntryBoxes.Equals(other.ShowAxisRangeEntryBoxes)) && (ShowTips == other.ShowTips && ShowTips != null && other.ShowTips != null && ShowTips.Equals(other.ShowTips)) && (ShowLink == other.ShowLink && ShowLink != null && other.ShowLink != null && ShowLink.Equals(other.ShowLink)) && (LinkText == other.LinkText && LinkText != null && other.LinkText != null && LinkText.Equals(other.LinkText)) && (SendData == other.SendData && SendData != null && other.SendData != null && SendData.Equals(other.SendData)) && (ShowSources == other.ShowSources && ShowSources != null && other.ShowSources != null && ShowSources.Equals(other.ShowSources)) && (DisplayModeBar == other.DisplayModeBar && DisplayModeBar != null && other.DisplayModeBar != null && DisplayModeBar.Equals(other.DisplayModeBar)) && (ShowSendToCloud == other.ShowSendToCloud && ShowSendToCloud != null && other.ShowSendToCloud != null && ShowSendToCloud.Equals(other.ShowSendToCloud)) && (ShowEditInChartStudio == other.ShowEditInChartStudio && ShowEditInChartStudio != null && other.ShowEditInChartStudio != null && ShowEditInChartStudio.Equals(other.ShowEditInChartStudio)) && (ModeBarButtonsToRemove == other.ModeBarButtonsToRemove && ModeBarButtonsToRemove != null && other.ModeBarButtonsToRemove != null && ModeBarButtonsToRemove.Equals(other.ModeBarButtonsToRemove)) && (ModeBarButtonsToAdd == other.ModeBarButtonsToAdd && ModeBarButtonsToAdd != null && other.ModeBarButtonsToAdd != null && ModeBarButtonsToAdd.Equals(other.ModeBarButtonsToAdd)) && (ModeBarButtons == other.ModeBarButtons && ModeBarButtons != null && other.ModeBarButtons != null && ModeBarButtons.Equals(other.ModeBarButtons)) && (ToImageButtonOptions == other.ToImageButtonOptions && ToImageButtonOptions != null && other.ToImageButtonOptions != null && ToImageButtonOptions.Equals(other.ToImageButtonOptions)) && (DisplayLogo == other.DisplayLogo && DisplayLogo != null && other.DisplayLogo != null && DisplayLogo.Equals(other.DisplayLogo)) && (Watermark == other.Watermark && Watermark != null && other.Watermark != null && Watermark.Equals(other.Watermark)) && (PlotGlPixelRatio == other.PlotGlPixelRatio && PlotGlPixelRatio != null && other.PlotGlPixelRatio != null && PlotGlPixelRatio.Equals(other.PlotGlPixelRatio)) && (SetBackground == other.SetBackground && SetBackground != null && other.SetBackground != null && SetBackground.Equals(other.SetBackground)) && (TopoJsonUrl == other.TopoJsonUrl && TopoJsonUrl != null && other.TopoJsonUrl != null && TopoJsonUrl.Equals(other.TopoJsonUrl)) && (MapboxAccessToken == other.MapboxAccessToken && MapboxAccessToken != null && other.MapboxAccessToken != null && MapboxAccessToken.Equals(other.MapboxAccessToken)) && (Logging == other.Logging && Logging != null && other.Logging != null && Logging.Equals(other.Logging)) && (NotifyOnLogging == other.NotifyOnLogging && NotifyOnLogging != null && other.NotifyOnLogging != null && NotifyOnLogging.Equals(other.NotifyOnLogging)) && (QueueLength == other.QueueLength && QueueLength != null && other.QueueLength != null && QueueLength.Equals(other.QueueLength)) && (GlobalTransforms == other.GlobalTransforms && GlobalTransforms != null && other.GlobalTransforms != null && GlobalTransforms.Equals(other.GlobalTransforms)) && (Locale == other.Locale && Locale != null && other.Locale != null && Locale.Equals(other.Locale)) && (Locales == other.Locales && Locales != null && other.Locales != null && Locales.Equals(other.Locales))); }
private async void UploadTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { if (FileUpload.Uploader.Running) { try { if (Created) { ProgressBar.Invoke(new Action(() => { ProgressBar.Value = (int)(Math.Min(100, FileUpload.Uploader.Progress * 100 + 1)); // If we set the progressbar to a higher value first, there is no animation ProgressBar.Value = (int)(FileUpload.Uploader.Progress * 100); } )); } } catch { } } else { if (!UploadTimer.Enabled) { UploadTimer.Stop(); } if (Created) { ProgressBar.Invoke(new Action(() => StatusLabel.Text = "Finished")); } Uploading = false; if (Created) { ProgressBar.Invoke(new Action(() => ProgressBar.Value = 0)); } if (!FileUpload.IsSharing & FileUpload.Share && FileUpload.Uploader.Finished && !FileUpload.Uploader.Error) { FileUpload.IsSharing = true; string s = await Client.ShareFile( FileUpload.Uploader.Identifier, FileUpload.FirstView, FileUpload.Public, FileUpload.PublicRegistered, FileUpload.Whitelisted, FileUpload.Whitelist ); string link = Config.AppSettings["ShareGenUrl"].Value + s; if (Created) { LinkText.Invoke(new Action(() => LinkText.Text = link)); } SetClipboardText(link); SystemSounds.Beep.Play(); } UploadFinished?.Invoke(this, EventArgs.Empty); } }
protected override void Render(HtmlTextWriter writer) { base.Render(writer); if (String.IsNullOrEmpty(ParentContainerHtmlSelector)) { var sb = new StringBuilder(); sb.AppendFormat("<div id='{0}'>", _jsObjName); if (MobileDetector.IsMobile) { sb.AppendFormat("<select class='comboBox' style='width:{0}px;' onchange='javascript:{1}.SelectUser(this);' >", InputWidth, _jsObjName); sb.AppendFormat("<option style='max-width:300px;' value='{0}' {2}>{1}</option>", -1, _linkText.HtmlEncode(), Guid.Empty.Equals(SelectedUserId) ? "selected = 'selected'" : string.Empty); var accounts = CoreContext.Authentication.GetUserAccounts().OrderBy(a => a.Name); foreach (var account in accounts) { sb.AppendFormat("<option style='max-width:300px;' value='{0}' {2}>{1}</option>", account.ID, account.Name.HtmlEncode(), Equals(account.ID, SelectedUserId) ? "selected = 'selected'" : string.Empty); } sb.AppendFormat("</select>"); } else { var valueForInput = Guid.Empty.Equals(SelectedUserId) ? string.Empty : CoreContext.UserManager.GetUsers(SelectedUserId).DisplayUserName().ReplaceSingleQuote(); if (IsLinkView) { sb.AppendFormat("<span class='addUserLink' onclick='{0}.OnInputClick({0}, event);'><a class='link dotline'>{1}</a><span class='sort-down-black'></span></span>", _jsObjName, LinkText.HtmlEncode()); } else { var peopleImgStyle = valueForInput.Trim() == string.Empty ? "display:none;" : "display:block;"; var searchImgStyle = valueForInput.Trim() == string.Empty ? "display:block;" : "display:none;"; sb.AppendFormat(@" <table cellspacing='0' cellpadding='1' class='borderBase adv-userselector-inputContainer' width='{0}px'> <tbody> <tr> <td width='16px'> <img align='absmiddle' src='{1}' id='peopleImg' style='margin:2px;{7}'/> <img align='absmiddle' src='{2}' id='searchImg' style='{8}'/> </td> <td> <input type='text' autocomplete='off' oninput='{3}.SuggestUser(event);' onpaste='{3}.SuggestUser(event);' onkeyup='{3}.SuggestUser(event);' onclick='{3}.OnInputClick({3}, event);' onkeydown='{3}.ChangeSelection(event);' class='textEdit inputUserName' style='width:100%;' value='{5}'/> <input class='loginhidden' name='login' value='{6}' type='hidden'/> </td> <td width='20px' onclick='{3}.OnInputClick({3}, event);'> <img align='absmiddle' src='{4}' style='cursor:pointer;'/> </td> </tr> </tbody> </table>", InputWidth + 8, WebImageSupplier.GetAbsoluteWebPath("people_icon.png"), WebImageSupplier.GetAbsoluteWebPath("search.png"), _jsObjName, WebImageSupplier.GetAbsoluteWebPath("collapse_down_dark.png"), valueForInput, SelectedUserId, peopleImgStyle, searchImgStyle); } sb.AppendFormat("<div class='adv-userselector-DepsAndUsersContainer' {0}>", IsLinkView ? "style='height:230px'" : string.Empty); if (IsLinkView) { sb.Append("<div style='margin-bottom: 10px;'>"); sb.Append("<div style='width:50%;'>"); sb.AppendFormat(@" <table cellspacing='0' cellpadding='1' class='borderBase adv-userselector-inputContainer' width='100%' style='height: 18px;'> <tbody> <tr> <td> <input type='text' autocomplete='off' oninput='javascript:{0}.SuggestUser(event);' onpaste='javascript:{0}.SuggestUser(event);' onkeyup='javascript:{0}.SuggestUser(event);' onclick='{0}.OnInputClick({0}, event);' onkeydown='{0}.ChangeSelection(event);' class='textEdit inputUserName' style='width:100%;' value='{1}'/> </td> <td width='16px'> <img align='absmiddle' src='{2}' onclick='{0}.ClearFilter();' style='cursor:pointer;' title='{3}'/> </td> </tr> </tbody> </table>", _jsObjName, valueForInput, WebImageSupplier.GetAbsoluteWebPath("cross_grey.png"), UserControlsCommonResource.ClearFilter); sb.AppendFormat("<input class='loginhidden' name='login' value='{0}' type='hidden'/>", SelectedUserId); sb.Append("</div>"); sb.Append("</div>"); } sb.Append(" <div class='adv-userselector-users'></div>"); sb.Append(" <div class='adv-userselector-deps'></div>"); sb.Append("</div>"); } sb.Append("</div>"); writer.Write(sb.ToString()); } }
// // Factory // public static HttpDomain From(LinkText name) { return(new HttpDomain(name)); }
public void OnEnable() { MLinkText = target as LinkText; }
// // Factory // public static HttpQueryPair From(LinkText key, LinkText value) { return(new HttpQueryPair(key, value)); }
private HttpQueryPair(LinkText key, LinkText value) { Key = key; Value = value; }
public bool ContainsKey(LinkText key) { return(_pairsByKey.ContainsKey(key)); }
private HttpDomain(LinkText name) { Name = name; }