string.IsNullOrEmpty(string)

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 7

1. Example

View license
private async Task RunUpdate()
        {
            if (!string.IsNullOrEmpty(_path.Value()))
     /n ..... /n //View Source file for more details /n }

2. Example

Project: boxcli
Source File: FileSubCommandBase.cs
View license
protected 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);
            }
        }

3. Example

Project: boxcli
Source File: FileVersionSubCommandBase.cs
View license
protected void CheckForFileVersionId(string id, CommandLineApplication app)
        {
            if (string.IsNullOrEmpty(id))
            {
                app.ShowHelp();
                throw new Exception("A file version ID is required for this command.");
            }
        }

4. Example

Project: boxcli
Source File: FileSubCommandBase.cs
View license
protected void CheckForFileId(string id, CommandLineApplication app)
        {
            if (string.IsNullOrEmpty(id))
            {
                app.ShowHelp();
                throw new Exception("A file ID is required for this command.");
            }
        }

5. Example

Project: boxcli
Source File: BoxBaseCommand.cs
View license
protected virtual BoxClient ConfigureBoxClient(string oneCallAsUserId = null,
        bool returnSer/n ..... /n //View Source file for more details /n }

6. Example

Project: boxcli
Source File: BoxDefaultSettings.cs
View license
private 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;
        }

7. Example

Project: boxcli
Source File: BoxDefaultSettings.cs
View license
private BoxHomeDefaultSettings SetBoxReportsFolderPathIfNull(BoxHomeDefaultSettings settings)
        {
            if (string.IsNullOrEmpty(settings.BoxReportsFolderPath))
            {
                var path = $"{_boxHome.GetBaseDirectoryPath()}{Path.DirectorySeparatorChar}Documents{Path.DirectorySeparatorChar}{settings.BoxReportsFolderName}";
                settings.BoxReportsFolderPath = path;
            }
            return settings;
        }

8. Example

Project: boxcli
Source File: BoxEnvironments.cs
View license
private BoxEnvironmentConfigFileValidation ValidateConfigFileValues(string jsonString)
        {

            var validation = new BoxEnvironmentConfigFileValidation();
            var config = BoxPlatformUtilities.ParseBoxConfig(jsonString);

            validation.HasClientId = (!string.IsNullOrEmpty(config.AppSettings.ClientId));
            validation.HasClientSecret = (!string.IsNullOrEmpty(config.AppSettings.ClientSecret));
            validation.HasPublicKeyId = (!string.IsNullOrEmpty(config.AppSettings.AppAuth.PublicKeyId));
            validation.HasEnterpriseId = (!string.IsNullOrEmpty(config.EnterpriseId));

            if (validation.HasClientId && validation.HasClientSecret && validation.HasEnterpriseId && validation.HasPublicKeyId)
            {
                validation.IsValid = true;
            }
            return validation;
        }

9. Example

View license
private async Task RunCreate()
        {
            base.CheckForValue(this._membershipId.Value, this._app, "A group memebership ID is required for this command.");
            var role = "";
            if (this._admin.HasValue())
            {
                role = "admin";
            }
            else if (this._member.HasValue())
            {
                role = "member";
            }
            var boxClient = base.ConfigureBoxClient(base._asUser.Value());
            var memberRequest = new BoxGroupMembershipRequest();
            if (!string.IsNullOrEmpty(role))
            {
                memberRequest.Role = role;
            }
            else
            {
                throw new Exception("Couldn't update the user's membership role.");
            }
            var updatedMembership = await boxClient.GroupsManager.UpdateGroupMembershipAsync(this._membershipId.Value, memberRequest);
            if (base._json.HasValue() || this._home.GetBoxHomeSettings().GetOutputJsonSetting())
            {
                base.OutputJson(updatedMembership);
                return;
            }
            Reporter.WriteSuccess("Updated the user's role.");
            base.PrintGroupMember(updatedMembership);
        }

10. Example

View license
public bool UpdateNameReference(ConfuserContext context, INameService service) {
			string typeName = sig.ReflectionName;
			string prefix = xmlnsCtx.GetPrefix(sig.ReflectionNamespace, sig.ToBasicTypeDefOrRef().ResolveTypeDefThrow().Module.Assembly);
			if (!string.IsNullOrEmpty(prefix))
				typeName = prefix + ":" + typeName;
			rec.Value = typeName + "." + member.Name;
			return true;
		}

11. Example

Project: ModPhuserEx
Source File: ObfAttrMarker.cs
View license
void ApplyInfo(IDnlibDef context, ProtectionSettings settings, IEnumerable<ProtectionSettingsInfo> infos, ApplyInfoType type) {
				foreach (var info in infos) {
					if (info.Condition != null && !(bool)info.Condition.Evaluate(context))
						continue;

					if (info.Condition == null && info.Exclude) {
						if (type == ApplyInfoType.CurrentInfoOnly ||
							(type == ApplyInfoType.CurrentInfoInherits && info.ApplyToMember)) {
							settings.Clear();
						}
					}
					if (!string.IsNullOrEmpty(info.Settings)) {
						if ((type == ApplyInfoType.ParentInfo && info.Condition != null && info.ApplyToMember) ||
							type == ApplyInfoType.CurrentInfoOnly ||
							(type == ApplyInfoType.CurrentInfoInherits && info.Condition == null && info.ApplyToMember)) {
							parser.ParseProtectionString(settings, info.Settings);
						}
					}
				}
			}

12. Example

View license
public bool UpdateNameReference(ConfuserContext context, INameService service) {
			string name = sig.ReflectionName;
			string prefix = xmlnsCtx.GetPrefix(sig.ReflectionNamespace, sig.ToBasicTypeDefOrRef().ResolveTypeDefThrow().Module.Assembly);
			if (!string.IsNullOrEmpty(prefix))
				name = prefix + ":" + name;
			if (propRec != null)
				propRec.Value = name;
			else
				textRec.Value = name;
			return true;
		}

13. Example

View license
void PathBox_TextChanged(object sender, TextChangedEventArgs e) {
			PwdBox.IsEnabled = !string.IsNullOrEmpty(PathBox.Text);
		}

14. Example

Project: ModPhuserEx
Source File: Utils.cs
View license
public static string NullIfEmpty(this string val) {
			if (string.IsNullOrEmpty(val))
				return null;
			return val;
		}

15. Example

Project: ModPhuserEx
Source File: ObfAttrMarker.cs
View license
bool ToInfo(ObfuscationAttributeInfo attr, out ProtectionSettingsInfo info) {
			info = new ProtectionSettingsInfo();

			info.Condition = null;

			info.Exclude = (attr.Exclude ?? true);
			info.ApplyToMember = (attr.ApplyToMembers ?? true);
			info.Settings = attr.FeatureValue;

			bool ok = true;
			try {
				new ObfAttrParser(protections).ParseProtectionString(null, info.Settings);
			}
			catch {
				ok = false;
			}

			if (!ok) {
				context.Logger.WarnFormat("Ignoring rule '{0}' in {1}.", info.Settings, attr.Owner);
				return false;
			}

			if (!string.IsNullOrEmpty(attr.FeatureName))
				throw new ArgumentException("Feature name must not be set. Owner=" + attr.Owner);
			if (info.Exclude && (!string.IsNullOrEmpty(attr.FeatureName) || !string.IsNullOrEmpty(attr.FeatureValue))) {
				throw new ArgumentException("Feature property cannot be set when Exclude is true. Owner=" + attr.Owner);
			}
			return true;
		}

16. Example

Project: aspnet-core-react-template
Source File: Tests.cs
View license
[Fact]
        public void TestNewContactProperties()
        {
            var contact = new app.Models.Contact();

            Assert.True(string.IsNullOrEmpty(contact.lastName));
            Assert.True(string.IsNullOrEmpty(contact.firstName));
            Assert.True(string.IsNullOrEmpty(contact.email));
            Assert.True(string.IsNullOrEmpty(contact.phone));
        }

17. Example

View license
[Fact]
        public void Test1()
        {
            var contact = new aspnetCoreReactTemplate.Models.Contact();
            Assert.True(string.IsNullOrEmpty(contact.email));
        }

18. Example

View license
[Fact]
        public void Test1()
        {
            var contact = new aspnetCoreReactTemplate.Models.Contact();
            Assert.True(string.IsNullOrEmpty(contact.email));
        }

19. Example

Project: aspnet-core-vuejs-template
Source File: Tests.cs
View license
[Fact]
        public void TestNewContactProperties()
        {
            var contact = new app.Models.Contact();

            Assert.True(string.IsNullOrEmpty(contact.lastName));
            Assert.True(string.IsNullOrEmpty(contact.firstName));
            Assert.True(string.IsNullOrEmpty(contact.email));
            Assert.True(string.IsNullOrEmpty(contact.phone));
        }

20. Example

View license
[Test]
        public void Create_OverridesTheBillingAddressInTheNonce()
        {
            var customer = gateway.Customer.Create().Target;
            var nonce = TestHelper.GetNonceForNewCreditCard(
                gateway,
                new Params
                {
                    { "number", "4111111111111111" },
                    { "expirationMonth", "12" },
                    { "expirationYear", "2020" },
                    { "options", new Params
                        {
                            { "validate", false }
                        }
                    }
                });

            Assert.IsFalse(string.IsNullOrEmpty(nonce));

            var result = gateway.PaymentMethod.Create(new PaymentMethodRequest
            {
                PaymentMethodNonce = nonce,
                CustomerId = customer.Id,
                BillingAddress = new PaymentMethodAddressRequest
                {
                    StreetAddress = "123 Abc Way"
                }
            });

            Assert.IsTrue(result.IsSuccess());
            Assert.That(result.Target, Is.InstanceOf(typeof(CreditCard)));

            var token = result.Target.Token;
            var foundCreditCard = gateway.CreditCard.Find(token);
            Assert.IsNotNull(foundCreditCard);
            Assert.AreEqual("123 Abc Way", foundCreditCard.BillingAddress.StreetAddress);
        }

21. Example

View license
[Test]
        public void Create_AllowsPassingBillingAddressOutsideTheNonce()
        {
            var customer = gateway.Customer.Create().Target;
            var nonce = TestHelper.GetNonceForNewCreditCard(
                gateway,
                new Params
                {
                    { "number", "4111111111111111" },
                    { "expirationMonth", "12" },
                    { "expirationYear", "2020" },
                    { "options", new Params
                        {
                            { "validate", false }
                        }
                    }
                });
            Assert.IsFalse(string.IsNullOrEmpty(nonce));

            var result = gateway.PaymentMethod.Create(new PaymentMethodRequest
            {
                PaymentMethodNonce = nonce,
                CustomerId = customer.Id,
                BillingAddress = new PaymentMethodAddressRequest
                {
                    StreetAddress = "123 Abc Way"
                }
            });

            Assert.IsTrue(result.IsSuccess());
            Assert.That(result.Target, Is.InstanceOf(typeof(CreditCard)));

            var token = result.Target.Token;
            var foundCreditCard = gateway.CreditCard.Find(token);
            Assert.IsNotNull(foundCreditCard);
            Assert.AreEqual("123 Abc Way", foundCreditCard.BillingAddress.StreetAddress);
        }

22. Example

View license
[Test]
        public void Create_DoesNotOverrideTheBillingAddressForVaultedCreditCards()
        {
            var customer = gateway.Customer.Create().Target;
            var nonce = TestHelper.GetNonceForNewCreditCard(
                gateway,
                new Params
                {
                    { "number", "4111111111111111" },
                    { "expirationMonth", "12" },
                    { "expirationYear", "2020" },
                    { "billing_address", new Params
                        {
                            { "street_address", "456 Xyz Way" }
                        }
                    }
                },
                customer.Id);

            Assert.IsFalse(string.IsNullOrEmpty(nonce));

            var result = gateway.PaymentMethod.Create(new PaymentMethodRequest
            {
                PaymentMethodNonce = nonce,
                CustomerId = customer.Id,
                BillingAddress = new PaymentMethodAddressRequest
                {
                    StreetAddress = "123 Abc Way"
                }
            });

            Assert.IsTrue(result.IsSuccess());
            Assert.That(result.Target, Is.InstanceOf(typeof(CreditCard)));

            var token = result.Target.Token;
            var foundCreditCard = gateway.CreditCard.Find(token);
            Assert.IsNotNull(foundCreditCard);
            Assert.AreEqual("456 Xyz Way", foundCreditCard.BillingAddress.StreetAddress);
        }

23. Example

View license
[Test]
        public void Create_PayPalOnlyMultiCurrencyMerchant()
        {
            gateway = /n ..... /n //View Source file for more details /n }

24. Example

View license
[Test]
        public void Create_ReturnsMerchantAndCredentials()
        {
            ResultImpl<Merchant> result = gateway.Merchant.Create(new MerchantRequest {
                Email = "na[email protected]",
                CountryCodeAlpha3 = "USA",
                PaymentMethods = new string[] {"credit_card", "paypal"},
                Scope = "read_write,shared_vault_transactions",
            });

            Assert.IsTrue(result.IsSuccess());
            Assert.IsFalse(string.IsNullOrEmpty(result.Target.Id));
            Assert.AreEqual("[email protected]", result.Target.Email);
            Assert.AreEqual("[email protected]", result.Target.CompanyName);
            Assert.AreEqual("USA", result.Target.CountryCodeAlpha3);
            Assert.AreEqual("US", result.Target.CountryCodeAlpha2);
            Assert.AreEqual("840", result.Target.CountryCodeNumeric);
            Assert.AreEqual("United States of America", result.Target.CountryName);

            Assert.IsTrue(result.Target.Credentials.AccessToken.StartsWith("access_token$"));
            Assert.IsTrue(result.Target.Credentials.RefreshToken.StartsWith("refresh_token$"));
            Assert.IsTrue(result.Target.Credentials.ExpiresAt > DateTime.Now);
            Assert.AreEqual("bearer", result.Target.Credentials.TokenType);
            Assert.AreEqual("read_write,shared_vault_transactions", result.Target.Credentials.Scope);
        }

25. Example

View license
[Test]
        public void Create_DefaultsToUSDForNonUSMerchantIfOnboardingApplicationIsInternalAndC/n ..... /n //View Source file for more details /n }

26. Example

View license
[Test]
        public void Create_MultiCurrencyMerchant()
        {
            gateway = new Braint/n ..... /n //View Source file for more details /n }

27. Example

View license
[Test]
        public void Create_AllowsCreationOfNonUSMerchantIfOnboardingApplicationIsInternal()
 /n ..... /n //View Source file for more details /n }

28. Example

View license
private string BuildRelationshipPath(string parentRelationshipPath, IRelationshipMapping relationship)
        {
            if (string.IsNullOrEmpty(parentRelationshipPath))
            {
                return relationship.RelationshipName;
            }
            else
            {
                return $"{parentRelationshipPath}.{relationship.RelationshipName}";
            }
        }

29. Example

Project: breeze.sharp
Source File: ValidationTests.cs
View license
[TestMethod]
    public async Task LocalizedValidationMessage() {
      var em1 = await TestFns.NewEm(_serviceName);

      var vr = new RequiredValidator();
      var mt = vr.LocalizedMessage.Message;
      Assert.IsTrue(!String.IsNullOrEmpty(mt));
      Assert.IsTrue(vr.LocalizedMessage.IsLocalized);
    }

30. Example

Project: breeze.sharp
Source File: TypeNameInfo.cs
View license
public static String ToStructuralTypeName(String shortName, String ns) {
      if (String.IsNullOrEmpty(ns)) {
        return shortName;
      } else {
        return shortName + ":#" + ns;
      }
    }

31. Example

Project: RobotDesk
Source File: HelpController.cs
View license
public ActionResult ResourceModel(string modelName)
        {
            if (!String.IsNullOrEmpty(modelName))
            {
                ModelDescriptionGenerator modelDescriptionGenerator = Configuration.GetModelDescriptionGenerator();
                ModelDescription modelDescription;
                if (modelDescriptionGenerator.GeneratedModels.TryGetValue(modelName, out modelDescription))
                {
                    return View(modelDescription);
                }
            }

            return View(ErrorViewName);
        }

32. Example

Project: RobotDesk
Source File: HelpController.cs
View license
public ActionResult Api(string apiId)
        {
            if (!String.IsNullOrEmpty(apiId))
            {
                HelpPageApiModel apiModel = Configuration.GetHelpPageApiModel(apiId);
                if (apiModel != null)
                {
                    return View(apiModel);
                }
            }

            return View(ErrorViewName);
        }

33. Example

Project: NuBuild
Source File: FileNode.cs
View license
protected override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusRe/n ..... /n //View Source file for more details /n }

34. Example

View license
private 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;

		}

35. Example

Project: NuBuild
Source File: OAFileItem.cs
View license
public override bool get_IsOpen(string viewKind)
		{
			if(this.Node == null || this.Node.ProjectMgr == null || this.Node.ProjectMgr.IsClosed || this.Node.ProjectMgr.Site == null)
			{
				throw new InvalidOperationException();
			}

			// Validate input params
			Guid logicalViewGuid = VSConstants.LOGVIEWID_Primary;
			try
			{
				if(!(String.IsNullOrEmpty(viewKind)))
				{
					logicalViewGuid = new Guid(viewKind);
				}
			}
			catch(FormatException)
			{
				// Not a valid guid
				throw new ArgumentException(SR.GetString(SR.ParameterMustBeAValidGuid, CultureInfo.CurrentUICulture), "viewKind");
			}

			bool isOpen = false;

			using(AutomationScope scope = new AutomationScope(this.Node.ProjectMgr.Site))
			{
				IVsUIHierarchy hier;
				uint itemid;

				IVsWindowFrame windowFrame;

				isOpen = VsShellUtilities.IsDocumentOpen(this.Node.ProjectMgr.Site, this.Node.Url, logicalViewGuid, out hier, out itemid, out windowFrame);

			}

			return isOpen;
		}

36. Example

Project: NuBuild
Source File: FileNode.cs
View license
protected virtual void RecoverFromRenameFailure(string fileThatFailed, string originalFileName)
        {
            if(this.ItemNode != null && !String.IsNullOrEmpty(originalFileName))
            {
                this.ItemNode.Rename(originalFileName);
            }
        }

37. Example

Project: NuBuild
Source File: NodeProperties.cs
View license
public override string GetComponentName()
		{
			string caption = this.Node.Caption;
			if(string.IsNullOrEmpty(caption))
			{
				return base.GetComponentName();
			}
			else
			{
				return caption;
			}
		}

38. Example

Project: NuBuild
Source File: ProjectNode.CopyPaste.cs
View license
private void CleanAndFlushClipboard()
		{
			IOleDataObject oleDataObject = null;
			ErrorHandler.ThrowOnFailure(UnsafeNativeMethods.OleGetClipboard(out oleDataObject));
			if(oleDataObject == null)
			{
				return;
			}


			string sourceProjectPath = DragDropHelper.GetSourceProjectPath(oleDataObject);

			if(!String.IsNullOrEmpty(sourceProjectPath) && NativeMethods.IsSamePath(sourceProjectPath, this.GetMkDocument()))
			{
				ErrorHandler.ThrowOnFailure(UnsafeNativeMethods.OleFlushClipboard());
				int clipboardOpened = 0;
				try
				{
					ErrorHandler.ThrowOnFailure(clipboardOpened = UnsafeNativeMethods.OpenClipboard(IntPtr.Zero));
					ErrorHandler.ThrowOnFailure(UnsafeNativeMethods.EmptyClipboard());
				}
				finally
				{
					if(clipboardOpened == 1)
					{
						ErrorHandler.ThrowOnFailure(UnsafeNativeMethods.CloseClipboard());
					}
				}
			}
		}

39. Example

Project: NuBuild
Source File: ProjectNode.cs
View license
internal NestedProjectNode GetNestedProjectForHierarchy(IVsHierarchy hierarchy)
        {
            IVsProject3 project = hierarchy as IVsProject3;

            if (project != null)
            {
                string mkDocument = String.Empty;
                ErrorHandler.ThrowOnFailure(project.GetMkDocument(VSConstants.VSITEMID_ROOT, out mkDocument));

                if (!String.IsNullOrEmpty(mkDocument))
                {
                    HierarchyNode node = this.FindChild(mkDocument);

                    return node as NestedProjectNode;
                }
            }

            return null;
        }

40. Example

Project: NuBuild
Source File: FolderNode.cs
View license
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Scc")]
		[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "scc")]
		protected internal override void GetSccSpecialFiles(string sccFile, IList<string> files, IList<tagVsSccFilesFlags> flags)
		{
			if(this.ExcludeNodeFromScc)
			{
				return;
			}

			if(files == null)
			{
				throw new ArgumentNullException("files");
			}

			if(flags == null)
			{
				throw new ArgumentNullException("flags");
			}

			if(string.IsNullOrEmpty(sccFile))
			{
				throw new ArgumentException(SR.GetString(SR.InvalidParameter, CultureInfo.CurrentUICulture), "sccFile");
			}

			// Get the file node for the file passed in.
			FileNode node = this.FindChild(sccFile) as FileNode;

			// Dependents do not participate directly in scc.
			if(node != null && !(node is DependentFileNode))
			{
				node.GetSccSpecialFiles(sccFile, files, flags);
			}
		}

41. Example

Project: NuBuild
Source File: ReferenceContainerNode.cs
View license
protected override bool CanShowDefaultIcon()
        {
            if(!String.IsNullOrEmpty(this.VirtualNodeName))
            {
                return true;
            }
            return false;
        }

42. Example

Project: NuBuild
Source File: ComReferenceNode.cs
View license
protected override bool CanShowDefaultIcon()
        {
            return !String.IsNullOrEmpty(this.installedFilePath);
        }

43. Example

Project: Mayflower.NET
Source File: Options.cs
View license
internal string GetMigrationsTable()
        {
            return string.IsNullOrEmpty(MigrationsTable) ? "Migrations" : MigrationsTable;
        }

44. Example

Project: Mayflower.NET
Source File: Options.cs
View license
internal string GetConnectionString(DatabaseProvider provider)
        {
            if (provider != DatabaseProvider.SqlServer)
                throw new Exception($"Unsupported DatabaseProvider " + provider);

            if (!string.IsNullOrEmpty(ConnectionString))
                return ConnectionString;

            var server = string.IsNullOrEmpty(Server) ? "localhost" : Server;
            return $"Persist Security Info=False;Integrated Security=true;Initial Catalog={Database};server={server}";
        }

45. Example

Project: Tiraggo
Source File: XDWindowsMessaging.cs
View license
public void SendToChannel(string channelName, string message)
        {
            if (string.IsNul/n ..... /n //View Source file for more details /n }

46. Example

Project: Cropper
Source File: HotKeys.cs
View license
public static void UpdateHotKey(string id, Keys keyData)
        {
            if (string.IsNullOrEmpty(id))
                throw new ArgumentNullException(nameof(id));

            HotKeyData data = Cache.FirstOrDefault(hkd => hkd.Id == id);
            if (data == null)
                return;

            Cache.Remove(data.KeyData);
            data.KeyData = keyData;
            Cache.Add(data);
        }

47. Example

Project: Cropper
Source File: MainCropForm.cs
View license
private void ApplyConfiguration()
        {
            Settings settings = Configuration.Current;
            userFormSize = settings.UserSize;
            VisibleClientSize = userFormSize;
            colorIndex = settings.ColorIndex;
            isThumbnailed = settings.IsThumbnailed;
            maxThumbSize = settings.MaxThumbnailSize;
            Location = settings.Location;
            TopMost = settings.AlwaysOnTop;

            if (settings.HotKeySettings != null)
                foreach (HotKeySetting hk in settings.HotKeySettings)
                {
                    if (string.IsNullOrEmpty(hk.Id))
                        continue;

                    HotKeys.UpdateHotKey(hk.Id, (Keys) hk.KeyCode);
                }

            if (settings.UserOpacity < 0.1 || settings.UserOpacity > 0.9)
                settings.UserOpacity = 0.4;

            LayerOpacity = !settings.UsePerPixelAlpha ? settings.UserOpacity : 1.0;

            if (ImageCapture.ImageOutputs[settings.ImageFormat] != null)
            {
                imageCapture.ImageFormat = ImageCapture.ImageOutputs[settings.ImageFormat];
                outputDescription = imageCapture.ImageFormat.Description;
            }
            else
            {
                outputDescription = SR.MessageNoOutputLoaded;
            }
        }

48. Example

Project: Cropper
Source File: FileNameTemplate.cs
View license
private static string GetThumbImageTemplate()
        {
            return !string.IsNullOrEmpty(Configuration.Current.ThumbImageTemplate)
                ? Configuration.Current.ThumbImageTemplate
                : DefaultThumbImageTemplate;
        }

49. Example

Project: Cropper
Source File: FileNameTemplate.cs
View license
private static string GetFullImageTemplate()
        {
            return !string.IsNullOrEmpty(Configuration.Current.FullImageTemplate)
                ? Configuration.Current.FullImageTemplate
                : DefaultFullImageTemplate;
        }

50. Example

Project: NYoutubeDL
Source File: StringOption.cs
View license
public override string ToString()
        {
            if (!string.IsNullOrEmpty(this.Value))
            {
                return this.ParamString + " " + this.Value;
            }

            return string.Empty;
        }