Here are the examples of the csharp api class string.IsNullOrEmpty(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
200 Examples
11
1. Example
View licenseprivate async Task RunUpdate() { if (!string.IsNullOrEmpty(_path.Value())) /n ..... /n //View Source file for more details /n }
5
2. Example
View licenseprivate static ProjectReferenceNode GetProjectReferenceOnNodeForHierarchy(IList<ReferenceNode> references, IVsHierarchy inputHierarchy) { if(references == null) { return null; } Guid projectGuid; ErrorHandler.ThrowOnFailure(inputHierarchy.GetGuidProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_ProjectIDGuid, out projectGuid)); string canonicalName; ErrorHandler.ThrowOnFailure(inputHierarchy.GetCanonicalName(VSConstants.VSITEMID_ROOT, out canonicalName)); foreach(ReferenceNode refNode in references) { ProjectReferenceNode projRefNode = refNode as ProjectReferenceNode; if(projRefNode != null) { if(projRefNode.ReferencedProjectGuid == projectGuid) { return projRefNode; } // Try with canonical names, if the project that is removed is an unloaded project than the above criteria will not pass. if(!String.IsNullOrEmpty(projRefNode.Url) && NativeMethods.IsSamePath(projRefNode.Url, canonicalName)) { return projRefNode; } } } return null; }
1
3. Example
View licenseprivate BoxHomeDefaultSettings SetBoxDownloadsFolderPathIfNull(BoxHomeDefaultSettings settings) { if (string.IsNullOrEmpty(settings.BoxDownloadsFolderPath)) { var path = $"{_boxHome.GetBaseDirectoryPath()}{Path.DirectorySeparatorChar}Downloads{Path.DirectorySeparatorChar}{settings.BoxDownloadsFolderName}"; settings.BoxDownloadsFolderPath = path; } return settings; }
1
4. Example
View licenseprotected async Task<BoxFile> MoveFile(string fileId, string parentId, string etag = "") { var boxClient = base.ConfigureBoxClient(this._asUser.Value()); var fileRequest = this.ConfigureFileRequest(fileId, parentId); if (!string.IsNullOrEmpty(etag)) { return await boxClient.FilesManager.UpdateInformationAsync(fileRequest, etag); } else { return await boxClient.FilesManager.UpdateInformationAsync(fileRequest); } }
1
5. Example
View licenseprotected void CheckForFileVersionId(string id, CommandLineApplication app) { if (string.IsNullOrEmpty(id)) { app.ShowHelp(); throw new Exception("A file version ID is required for this command."); } }
0
6. Example
View licensepublic IProgress<TaskSnapshot> GetProgressControl([NotNull] string taskName) { #region Sanity checks if (string.IsNullOrEmpty(taskName)) throw new ArgumentNullException(nameof(taskName)); #endregion taskControl.TaskName = taskName; taskControl.Visible = true; return taskControl; }
0
7. Example
View licensepublic void ShowNotificactionBar([NotNull] string message, [NotNull] Action clickHandler) { #region Sanity checks if (string.IsNullOrEmpty(message)) throw new ArgumentNullException(nameof(message)); if (clickHandler == null) throw new ArgumentNullException(nameof(clickHandler)); #endregion var targetLocation = labelNotificationBar.Location; labelNotificationBar.Location -= new Size(0, labelNotificationBar.Height); labelNotificationBar.Text = message; labelNotificationBar.Visible = true; var timer = new Timer {Interval = 10, Enabled = true}; components.Add(timer); timer.Tick += delegate { labelNotificationBar.Location += new Size(0, 1); if (labelNotificationBar.Location == targetLocation) timer.Enabled = false; }; _notificationBarClickHandler = clickHandler; }
0
8. Example
View licenseprivate void textBoxTarget_TextChanged(object sender, System.EventArgs e) { buttonDeploy.Enabled = !string.IsNullOrEmpty(textBoxTarget.Text); }
0
9. Example
View licenseprivate void textBoxCredentials_TextChanged(object sender, EventArgs e) { pageCredentials.AllowNext = !string.IsNullOrEmpty(textBoxUsername.Text) && !string.IsNullOrEmpty(textBoxPassword.Text); }
0
10. Example
View licenseprivate void textBoxCryptoKey_TextChanged(object sender, EventArgs e) { pageExistingCryptoKey.AllowNext = !string.IsNullOrEmpty(textBoxCryptoKey.Text); }
0
11. Example
View licenseprivate void textBoxCryptoKeyReset_TextChanged(object sender, EventArgs e) { pageResetCryptoKey.AllowNext = !string.IsNullOrEmpty(textBoxCryptoKeyReset.Text); }
0
12. Example
View licenseprivate void textBoxCryptoKeyNew_TextChanged(object sender, EventArgs e) { pageNewCryptoKey.AllowNext = !string.IsNullOrEmpty(textBoxCryptoKeyNew.Text); }
0
13. Example
View licenseprivate void textBoxCryptoKeyChange_TextChanged(object sender, EventArgs e) { pageChangeCryptoKey.AllowNext = !string.IsNullOrEmpty(textBoxCryptoKeyChange.Text); }
0
14. Example
View license[ContractAnnotation("=>null,foundAppEntry:null; =>notnull,foundAppEntry:notnull")] internal static AppAlias GetAppAlias([NotNull] AppList appList, [NotNull] string aliasName, out AppEntry foundAppEntry) { #region Sanity checks if (appList == null) throw new ArgumentNullException(nameof(appList)); if (string.IsNullOrEmpty(aliasName)) throw new ArgumentNullException(nameof(aliasName)); #endregion var results = from entry in appList.Entries where entry.AccessPoints != null from alias in entry.AccessPoints.Entries.OfType<AppAlias>() where alias.Name == aliasName select new {entry, alias}; var result = results.FirstOrDefault(); if (result == null) { foundAppEntry = null; return null; } else { foundAppEntry = result.entry; return result.alias; } }
0
15. Example
View license[CanBeNull] protected Feed FindByShortName([NotNull] string shortName) { #region Sanity checks if (string.IsNullOrEmpty(shortName)) throw new ArgumentNullException(nameof(shortName)); #endregion Feed result = null; if (!FeedManager.Refresh) result = CatalogManager.GetCachedSafe().FindByShortName(shortName); if (result == null && Config.NetworkUse != NetworkLevel.Offline) result = CatalogManager.GetOnlineSafe().FindByShortName(shortName); return result; }
0
16. Example
View licenseprivate void textBoxSyncServer_TextChanged(object sender, EventArgs e) { _config.SyncServer = (!textBoxSyncServer.IsValid || string.IsNullOrEmpty(textBoxSyncServer.Text)) ? new Uri(Config.DefaultSyncServer) : textBoxSyncServer.Uri; propertyGridAdvanced.Refresh(); }
0
17. Example
View licensepublic IProgress<TaskSnapshot> GetProgressControl([NotNull] string taskName) { #region Sanity checks if (string.IsNullOrEmpty(taskName)) throw new ArgumentNullException(nameof(taskName)); if (InvokeRequired) throw new InvalidOperationException("Method called from a non UI thread."); #endregion taskControl.Visible = true; // Hide other stuff if (_selectionsShown) selectionsControl.Hide(); taskControl.TaskName = taskName; return taskControl; }
0
18. Example
View licensepublic void ShowTrayIcon(string information = null, ToolTipIcon messageType = ToolTipIcon.None) { #region Sanity checks if (InvokeRequired) throw new InvalidOperationException("Method called from a non UI thread."); #endregion notifyIcon.Visible = true; if (!string.IsNullOrEmpty(information)) notifyIcon.ShowBalloonTip(7500, "Zero Install", information, messageType); }
0
19. Example
View licenseprivate void ConfigureTaskbar(IntPtr windowHandle) { if (_relaunchInformation == null || !WindowsUtils.IsWindows7) return; // Add correct relaunch information string commandPath = (_relaunchInformation.NeedsTerminal ? _relaunchControl.CommandPathCli : _relaunchControl.CommandPathGui + " --no-wait"); // Select best suited launcher string icon = (string.IsNullOrEmpty(_relaunchInformation.IconPath) ? null : _relaunchInformation.IconPath + ",0"); // Always use the first icon in the file WindowsTaskbar.SetWindowAppID(windowHandle, _relaunchInformation.AppID, '"' + commandPath + "\" run " + _relaunchInformation.Target, icon, _relaunchInformation.Name); // Add jump list entry to select an alternative application version WindowsTaskbar.AddTaskLinks(_relaunchInformation.AppID, new[] {new WindowsTaskbar.ShellLink("Versions", _relaunchControl.CommandPathGui, "run --customize " + _relaunchInformation.Target)}); }
0
20. Example
View licenseprivate void ParseScoreNode(XmlNode element) { foreach (var c in element.ChildNo/n ..... /n //View Source file for more details /n }
0
21. Example
View licenseprivate void BuildModel() { // build score for (int i = 0, j = _mast/n ..... /n //View Source file for more details /n }
0
22. Example
View licenseprivate void ParseLyric(XmlNode element, Beat beat) { foreach (var c in element.ChildNodes) { if (c.NodeType == XmlNodeType.Element) { switch (c.LocalName) { case "text": if (!string.IsNullOrEmpty(beat.Text)) { beat.Text += " " + c.InnerText; } else { beat.Text = c.InnerText; } break; } } } }
0
23. Example
View licenseprivate void ParseIdentification(XmlNode element) { foreach (var c in element.ChildNodes) { if (c.NodeType == XmlNodeType.Element) { switch (c.LocalName) { case "creator": if (c.GetAttribute("type") == "composer") { _score.Words = c.InnerText; } break; case "rights": if (!string.IsNullOrEmpty(_score.Copyright)) { _score.Copyright += "\n"; } _score.Copyright += c.InnerText; break; } } } }
0
24. Example
View licensepublic float MeasureText(string text) { if (string.IsNullOrEmpty(text)) return 0; var font = SupportedFonts.Arial; if (Font.Family.Contains("Times")) { font = SupportedFonts.TimesNewRoman; } return FontSizes.MeasureString(text, font, Font.Size, Font.Style); }
0
25. Example
View licensepublic override void DoLayout() { IsEmpty = string.IsNullOrEmpty(_noteString) && string.IsNullOrEmpty(_trillNoteString); if (!IsEmpty) { Renderer.ScoreRenderer.Canvas.Font = Renderer.Resources.TablatureFont; _noteStringWidth = Renderer.ScoreRenderer.Canvas.MeasureText(_noteString); _trillNoteStringWidth = Renderer.ScoreRenderer.Canvas.MeasureText(_trillNoteString); Width = _noteStringWidth + _trillNoteStringWidth; } }
0
26. Example
View licenseprivate void CreateScoreInfoGlyphs() { Logger.Info("ScoreLayout", "Creating scor/n ..... /n //View Source file for more details /n }
0
27. Example
View licensevoid UpdateStrings() { if (debugUIObject == null) return; if (!string.IsNullOrEmpty(strFPS)) fps.GetComponentInChildren<Text>().text = strFPS; if (!string.IsNullOrEmpty(strIPD)) ipd.GetComponentInChildren<Text>().text = strIPD; if (!string.IsNullOrEmpty(strFOV)) fov.GetComponentInChildren<Text>().text = strFOV; if (!string.IsNullOrEmpty(strResolutionEyeTexture)) resolutionEyeTexture.GetComponentInChildren<Text>().text = strResolutionEyeTexture; if (!string.IsNullOrEmpty(strLatencies)) { latencies.GetComponentInChildren<Text>().text = strLatencies; latencies.GetComponentInChildren<Text>().fontSize = 14; } if (!string.IsNullOrEmpty(strHeight)) height.GetComponentInChildren<Text>().text = strHeight; if (!string.IsNullOrEmpty(strDepth)) depth.GetComponentInChildren<Text>().text = strDepth; }
0
28. Example
View licenseprivate static bool IsIdentifierEmpty(PropertyIdentifier identifier) { #if SILVERLIGHT return identifier.IsEmpty; #else return String.IsNullOrEmpty(identifier.Name); #endif }
0
29. Example
View licenseprivate static object OnCoerceSortMemberPath(DependencyObject d, object baseValue) { var column = (DataGridBoundColumn)d; var sortMemberPath = (string)baseValue; if (string.IsNullOrEmpty(sortMemberPath)) { sortMemberPath = DataGridHelper.GetPathFromBinding(column.Binding as Binding); } return sortMemberPath; }
0
30. Example
View licenseprivate static object OnCoerceSortMemberPath(DependencyObject d, object baseValue) { var column = (DataGridComboBoxColumn)d; var sortMemberPath = (string)baseValue; if (string.IsNullOrEmpty(sortMemberPath)) { sortMemberPath = DataGridHelper.GetPathFromBinding(column.EffectiveBinding as Binding); } return sortMemberPath; }
0
31. Example
View licenseinternal static string GetPathFromBinding(Binding binding) { if (binding != null) { if (!string.IsNullOrEmpty(binding.XPath)) { return binding.XPath; } else if (binding.Path != null) { return binding.Path.Path; } } return null; }
0
32. Example
View licenseprivate static object OnCoerceTemplateColumnCanUserSort(DependencyObject d, object baseValue) { DataGridTemplateColumn templateColumn = (DataGridTemplateColumn)d; if (string.IsNullOrEmpty(templateColumn.SortMemberPath)) { return false; } return DataGridColumn.OnCoerceCanUserSort(d, baseValue); }
0
33. Example
View license[TestMethod] public void ExperimentNew() { IExperiment experiment = ExperimentManager.New(); Assert.IsNotNull(experiment); Assert.IsFalse(experiment.IsModified); Assert.AreEqual(2, experiment.VertexCount); Assert.IsTrue(string.IsNullOrEmpty(experiment.ExperimentInfo.FilePath)); }
0
34. Example
View licenseprivate bool hasChallengePasswordBeenUsed(){ if (!string.IsNullOrEmpty (m_applicationViewModel.Experiment.ExperimentInfo.ChallengePassword) && m_applicationViewModel.Experiment.ExperimentInfo.ChallengePassword.Equals(m_applicationViewModel.Experiment.unlockingPassword)){ return true; } return false; }
0
35. Example
View licensepublic void SetLabel (Gtk.Widget page, Gdk.Pixbuf icon, string label) { Pango.EllipsizeMode oldMode = Pango.EllipsizeMode.End; this.page = page; if (Child != null) { if (labelWidget != null) oldMode = labelWidget.Ellipsize; Gtk.Widget oc = Child; Remove (oc); oc.Destroy (); } Gtk.HBox box = new HBox (); box.Spacing = 2; if (icon != null) box.PackStart (new Gtk.Image (icon), false, false, 0); if (!string.IsNullOrEmpty (label)) { labelWidget = new Gtk.Label (label); labelWidget.UseMarkup = true; box.PackStart (labelWidget, true, true, 0); } else { labelWidget = null; } Add (box); // Get the required size before setting the ellipsize property, since ellipsized labels // have a width request of 0 ShowAll (); labelWidth = SizeRequest ().Width; if (labelWidget != null) labelWidget.Ellipsize = oldMode; }
0
36. Example
View licenseprotected void OnButtonOkClicked (object sender, EventArgs e) { this.error = "";/n ..... /n //View Source file for more details /n }
0
37. Example
View licenseprivate bool CanExecuteAuthenticate(object param) { if (String.IsNullOrEmpty(Username) || String.IsNullOrEmpty(Password)) { return false; } return true; }
0
38. Example
View licenseprivate bool CanAdvanceState(object param) { //if state is process allow advancing only when experiment is completed and if contest is online if (CurrentState == BenchmarkWizardState.Process) return BenchmarkExperimentCompleted && SelectedBenchmark.IsOnlineContest; if (CurrentState == BenchmarkWizardState.QuestionToPublishResults) return !String.IsNullOrEmpty(TechniqueName) && !String.IsNullOrEmpty(TechniqueDescription); if (CurrentState == BenchmarkWizardState.AuthenticationAndUpload) return false; //cannot advance anymore so disable button return SelectedBenchmark != null && SelectedBenchmark.ComponentTemplate != null && CurrentState != BenchmarkWizardState.Process; }
0
39. Example
View licenseprivate bool CanExecuteDefine(object param) { bool canExecuteDefine = (String.IsNullOrEmpty(BenchmarkInfo.FilePath) == false && SelectedTemplateNode != null); //if contest is to be published, it is required to select also experiment results if (PublishContest == true) { canExecuteDefine = canExecuteDefine && SelectedExperimentResults != null; } return canExecuteDefine; }
0
40. Example
View licenseprivate static void SetExperimentFileToBeOpen(string value) { if (string.IsNullOrEmpty(value)) throw new ArgumentNullException("value"); ExperimentFileToBeOpen = value; }
0
41. Example
View licenseprivate static void SetDecisionsDirectory(string value) { if (string.IsNullOrEmpty(value)) throw new ArgumentNullException("value"); DecisionDirectory = value; }
0
42. Example
View licenseprivate static void SetWorkspaceDirectory(string value) { if (string.IsNullOrEmpty(value)) throw new ArgumentNullException("value"); WorkspaceDirectory = value; }
0
43. Example
View licenseprivate static void SetCacheDirectory(string value) { if (string.IsNullOrEmpty(value)) throw new ArgumentNullException("value"); CacheDirectory = value; }
0
44. Example
View licenseprivate static void SetBaseDirectory(string value) { if (string.IsNullOrEmpty(value)) throw new ArgumentNullException("value"); BaseDirectory = value; }
0
45. Example
View licenseprivate string GetDebugDropPath() { if (string.IsNullOrEmpty(_smtpMailSettings.DebugMailDropDirectory)) { throw new ApplicationException("Cofoundry:SmtpMail:DebugMailDropDirectory configuration has been requested and is not set."); } var debugMailDropDirectory = _pathResolver.MapPath(_smtpMailSettings.DebugMailDropDirectory); if (!Directory.Exists(debugMailDropDirectory)) { Directory.CreateDirectory(debugMailDropDirectory); } return debugMailDropDirectory; }
0
46. Example
View licensepublic static TEntity GetById<TEntity>(this IQueryExecutor executor, string id) { if (string.IsNullOrEmpty(id)) return default(TEntity); var query = new GetByStringQuery<TEntity>() { Id = id }; return executor.Execute(query); }
0
47. Example
View licensepublic static TEntity GetById<TEntity>(this IQueryExecutor executor, string id, IExecutionContext ex) { if (string.IsNullOrEmpty(id)) return default(TEntity); var query = new GetByStringQuery<TEntity>() { Id = id }; return executor.Execute(query, ex); }
0
48. Example
View licensepublic static async Task<TEntity> GetByIdAsync<TEntity>(this IQueryExecutor executor, string id) { if (string.IsNullOrEmpty(id)) return default(TEntity); var query = new GetByStringQuery<TEntity>() { Id = id }; return await executor.ExecuteAsync(query); }
0
49. Example
View licensepublic static async Task<TEntity> GetByIdAsync<TEntity>(this IQueryExecutor executor, string id, IExecutionContext ex) { if (string.IsNullOrEmpty(id)) return default(TEntity); var query = new GetByStringQuery<TEntity>() { Id = id }; return await executor.ExecuteAsync(query, ex); }
0
50. Example
View licensepublic async Task<PagedQueryResult<ImageAssetSummary>> ExecuteAsync(SearchImageAssetSumm/n ..... /n //View Source file for more details /n }