bool.ToString()

Here are the examples of the csharp api bool.ToString() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2097 Examples 7

19 View Source File : GetAccessibleDatabasesQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            if (Full != null)
            {
                return "full=" + Full.ToString().ToLower();
            }
            else
            {
                return "";
            }
        }

19 View Source File : PXGraphCreationForBqlQueriesAnalyzer.cs
License : GNU General Public License v3.0
Project Creator : Acumatica

private ImmutableDictionary<string, string> CreateDiagnosticProperties(IEnumerable<ISymbol> availableGraphs, PXContext pxContext)
		{
			var builder = ImmutableDictionary.CreateBuilder<string, string>();
			int i = 0;

			foreach (var graph in availableGraphs)
			{
				ITypeSymbol type = graph switch
				{
					IParameterSymbol property => property.Type,
					ILocalSymbol local => local.Type,
					_ => null
				};

				builder.Add(IdentifierNamePropertyPrefix + i, graph.Name);
				
				if (type != null && type.IsPXGraphExtension(pxContext))
					builder.Add(IsGraphExtensionPropertyPrefix + i, true.ToString());

				i++;
			}

19 View Source File : PutDocumentQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            var query = new List<string>();
            if (WaitForSync != null)
            {
                query.Add("waitForSync=" + WaitForSync.ToString().ToLower());
            }
            if (ReturnNew != null)
            {
                query.Add("returnNew=" + ReturnNew.ToString().ToLower());
            }
            if (ReturnOld != null)
            {
                query.Add("returnOld=" + ReturnOld.ToString().ToLower());
            }
            if (IgnoreRevs != null)
            {
                query.Add("ignoreRevs=" + IgnoreRevs.ToString().ToLower());
            }
            if (Silent != null)
            {
                query.Add("silent=" + Silent.ToString().ToLower());
            }
            return string.Join("&", query);
        }

19 View Source File : PostVertexQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            List<string> query = new List<string>();
            if (WaitForSync != null)
            {
                query.Add("waitForSync=" + WaitForSync.ToString().ToLower());
            }
            if (ReturnNew != null)
            {
                query.Add("returnNew=" + ReturnNew.ToString().ToLower());
            }

            return string.Join("&", query);
        }

19 View Source File : DeleteGraphQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            List<string> query = new List<string>();
            if (DropCollections != null)
            {
                query.Add("dropCollections=" + DropCollections.ToString().ToLower());
            }
            return string.Join("&", query);
        }

19 View Source File : DeleteDocumentsQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            var queryParams = new List<string>();
            if (WaitForSync != null)
            {
                queryParams.Add("waitForSync=" + WaitForSync.ToString().ToLower());
            }
            if (ReturnOld != null)
            {
                queryParams.Add("returnOld=" + ReturnOld.ToString().ToLower());
            }
            if (IgnoreRevs != null)
            {
                queryParams.Add("ignoreRevs=" + IgnoreRevs.ToString().ToLower());
            }
            if (Silent != null)
            {
                queryParams.Add("silent=" + Silent.ToString().ToLower());
            }
            return string.Join("&", queryParams);
        }

19 View Source File : TaskAgentHttpClientBase.cs
License : MIT License
Project Creator : actions

[EditorBrowsable(EditorBrowsableState.Never)]
        public virtual Task<PackageMetadata> GetPackageAsync(
            string packageType,
            string platform,
            string version,
            bool? includeToken = null,
            object userState = null,
            CancellationToken cancellationToken = default)
        {
            HttpMethod httpMethod = new HttpMethod("GET");
            Guid locationId = new Guid("8ffcd551-079c-493a-9c02-54346299d144");
            object routeValues = new { packageType = packageType, platform = platform, version = version };

            List<KeyValuePair<string, string>> queryParams = new List<KeyValuePair<string, string>>();
            if (includeToken != null)
            {
                queryParams.Add("includeToken", includeToken.Value.ToString());
            }

            return SendAsync<PackageMetadata>(
                httpMethod,
                locationId,
                routeValues: routeValues,
                version: new ApiResourceVersion(5.1, 2),
                queryParameters: queryParams,
                userState: userState,
                cancellationToken: cancellationToken);
        }

19 View Source File : DefaultEditionCreator.cs
License : MIT License
Project Creator : 52ABP

private void CreateFeatureIfNotExists(int editionId, string featureName, bool isEnabled)
        {
            if (_context.EditionFeatureSettings.IgnoreQueryFilters().Any(ef => ef.EditionId == editionId && ef.Name == featureName))
            {
                return;
            }

            _context.EditionFeatureSettings.Add(new EditionFeatureSetting
            {
                Name = featureName,
                Value = isEnabled.ToString(),
                EditionId = editionId
            });
            _context.SaveChanges();
        }

19 View Source File : DacPropertyAttributesAnalyzer.cs
License : GNU General Public License v3.0
Project Creator : Acumatica

private static void ReportIncompatibleTypesDiagnostics(DacPropertyInfo property, AttributeInfo fieldAttribute,
															   SymbolreplacedysisContext symbolContext, PXContext pxContext, bool registerCodeFix)
		{
			var diagnosticProperties = ImmutableDictionary.Create<string, string>()
														  .Add(DiagnosticProperty.RegisterCodeFix, registerCodeFix.ToString());
			Location propertyTypeLocation = property.Node.Type.GetLocation();
			Location attributeLocation = fieldAttribute.AttributeData.GetLocation(symbolContext.CancellationToken);

			if (propertyTypeLocation != null)
			{
				symbolContext.ReportDiagnosticWithSuppressionCheck(
					Diagnostic.Create(Descriptors.PX1021_PXDBFieldAttributeNotMatchingDacProperty, propertyTypeLocation, attributeLocation.ToEnumerable(),
									  diagnosticProperties),
					pxContext.CodereplacedysisSettings);
			}

			if (attributeLocation != null)
			{
				symbolContext.ReportDiagnosticWithSuppressionCheck(
					Diagnostic.Create(Descriptors.PX1021_PXDBFieldAttributeNotMatchingDacProperty, attributeLocation, propertyTypeLocation.ToEnumerable(),
									  diagnosticProperties),
					pxContext.CodereplacedysisSettings);
			}
		}

19 View Source File : AuditTrailKeyValueRepository.cs
License : Apache License 2.0
Project Creator : aadreja

public bool Add(object recordId, int? recordVersionNo, object updatedBy, RecordOperationEnum operation)
        {
            if (operation != RecordOperationEnum.Delete && operation != RecordOperationEnum.Recover)
                throw new InvalidOperationException("Invalid call to this method. This method shall be call for Delete and Recover operation only.");

            CreateTableIfNotExist();

            AuditTrailKeyValue audit = new AuditTrailKeyValue
            {
                OperationType = operation,
                RecordId = recordId.ToString(),
                RecordVersionNo =   (recordVersionNo??0) + 1,
                TableName = enreplacedyTableInfo.Name,
                CreatedBy = updatedBy,
                lstAuditTrailDetail = new List<IAuditTrailDetail>()
                {
                    new AuditTrailKeyValueDetail()
                    {
                        ColumnName = Config.ISACTIVE_COLUMN.Name,
                        ColumnType = (int)DbType.Boolean,
                        OldValue = (operation == RecordOperationEnum.Delete).ToString(),
                        NewValue = (!(operation == RecordOperationEnum.Delete)).ToString()
                    }
                }
            };

            return AddAuditTrail(audit);
        }

19 View Source File : PostEdgeQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            List<string> query = new List<string>();
            if (ReturnNew != null)
            {
                query.Add("returnNew=" + ReturnNew.ToString().ToLower());
            }
            if (WaitForSync != null)
            {
                query.Add("waitForSync=" + WaitForSync.ToString().ToLower());
            }
            return string.Join("&", query);
        }

19 View Source File : DeleteVertexQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            List<string> query = new List<string>();
            if (WaitForSync != null)
            {
                query.Add("waitForSync=" + WaitForSync.ToString().ToLower());
            }
            if (ReturnOld != null)
            {
                query.Add("returnOld=" + ReturnOld.ToString().ToLower());
            }

            return string.Join("&", query);
        }

19 View Source File : GetCollectionsQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            List<string> query = new List<string>();
            if (ExcludeSystem != null)
            {
                query.Add("excludeSystem=" + ExcludeSystem.ToString().ToLower());
            }
            return string.Join("&", query);
        }

19 View Source File : PutEdgeQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            List<string> query = new List<string>();
            if (WaitForSync != null)
            {
                query.Add("waitForSync=" + WaitForSync.ToString().ToLower());
            }
            if (ReturnNew != null)
            {
                query.Add("returnNew=" + ReturnNew.ToString().ToLower());
            }
            if (ReturnOld != null)
            {
                query.Add("returnOld=" + ReturnOld.ToString().ToLower());
            }
            if (KeepNull != null)
            {
                query.Add("keepNull=" + KeepNull.ToString().ToLower());
            }

            return string.Join("&", query);
        }

19 View Source File : XProject.cs
License : MIT License
Project Creator : 3F

public bool AddReference(string inc, string path, bool local, bool? embed = null, bool? spec = null)
        {
            var meta = new Dictionary<string, string>() {
                { "HintPath", path },
                { "Private", local.ToString() }
            };

            if(embed != null) {
                meta["EmbedInteropTypes"] = embed.ToString();
            }

            if(spec != null) {
                meta["SpecificVersion"] = spec.ToString();
            }

            return AddItem(ITEM_REF, inc, meta);
        }

19 View Source File : TaskAgentHttpClientBase.cs
License : MIT License
Project Creator : actions

public virtual Task<TaskAgent> GetAgentAsync(
            int poolId,
            int agentId,
            bool? includeCapabilities = null,
            bool? includereplacedignedRequest = null,
            bool? includeLastCompletedRequest = null,
            IEnumerable<string> propertyFilters = null,
            object userState = null,
            CancellationToken cancellationToken = default)
        {
            HttpMethod httpMethod = new HttpMethod("GET");
            Guid locationId = new Guid("e298ef32-5878-4cab-993c-043836571f42");
            object routeValues = new { poolId = poolId, agentId = agentId };

            List<KeyValuePair<string, string>> queryParams = new List<KeyValuePair<string, string>>();
            if (includeCapabilities != null)
            {
                queryParams.Add("includeCapabilities", includeCapabilities.Value.ToString());
            }
            if (includereplacedignedRequest != null)
            {
                queryParams.Add("includereplacedignedRequest", includereplacedignedRequest.Value.ToString());
            }
            if (includeLastCompletedRequest != null)
            {
                queryParams.Add("includeLastCompletedRequest", includeLastCompletedRequest.Value.ToString());
            }
            if (propertyFilters != null && propertyFilters.Any())
            {
                queryParams.Add("propertyFilters", string.Join(",", propertyFilters));
            }

            return SendAsync<TaskAgent>(
                httpMethod,
                locationId,
                routeValues: routeValues,
                version: new ApiResourceVersion(6.0, 2),
                queryParameters: queryParams,
                userState: userState,
                cancellationToken: cancellationToken);
        }

19 View Source File : PatchDocumentsQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            var queryParams = new List<string>();
            if (KeepNull != null)
            {
                queryParams.Add("keepNull=" + KeepNull.ToString().ToLower());
            }
            if (MergeObjects != null)
            {
                queryParams.Add("mergeObjects=" + MergeObjects.ToString().ToLower());
            }
            if (WaitForSync != null)
            {
                queryParams.Add("waitForSync=" + WaitForSync.ToString().ToLower());
            }
            if (IgnoreRevs != null)
            {
                queryParams.Add("ignoreRevs=" + IgnoreRevs.ToString().ToLower());
            }
            if (ReturnOld != null)
            {
                queryParams.Add("returnOld=" + ReturnOld.ToString().ToLower());
            }
            if (ReturnNew != null)
            {
                queryParams.Add("returnNew=" + ReturnNew.ToString().ToLower());
            }
            if (Silent != null)
            {
                queryParams.Add("silent=" + Silent.ToString().ToLower());
            }
            return string.Join("&", queryParams);
        }

19 View Source File : TaskAgentHttpClientBase.cs
License : MIT License
Project Creator : actions

[EditorBrowsable(EditorBrowsableState.Never)]
        public virtual Task<List<PackageMetadata>> GetPackagesAsync(
            string packageType,
            string platform = null,
            int? top = null,
            bool? includeToken = null,
            object userState = null,
            CancellationToken cancellationToken = default)
        {
            HttpMethod httpMethod = new HttpMethod("GET");
            Guid locationId = new Guid("8ffcd551-079c-493a-9c02-54346299d144");
            object routeValues = new { packageType = packageType, platform = platform };

            List<KeyValuePair<string, string>> queryParams = new List<KeyValuePair<string, string>>();
            if (top != null)
            {
                queryParams.Add("$top", top.Value.ToString(CultureInfo.InvariantCulture));
            }
            if (includeToken != null)
            {
                queryParams.Add("includeToken", includeToken.Value.ToString());
            }

            return SendAsync<List<PackageMetadata>>(
                httpMethod,
                locationId,
                routeValues: routeValues,
                version: new ApiResourceVersion(5.1, 2),
                queryParameters: queryParams,
                userState: userState,
                cancellationToken: cancellationToken);
        }

19 View Source File : TableColumnsTest.cs
License : MIT License
Project Creator : 0x1000000

[Test]
        public void TestBoolean()
        {
            replacedert.AreEqual(SqQueryBuilder.SqlType.Boolean, this.Table.ColBoolean.SqlType);
            replacedert.AreEqual("[AT].[ColBoolean]", this.Table.ColBoolean.ToSql());
            replacedert.IsFalse(this.Table.ColBoolean.IsNullable);

            DerivedTable dt = new DerivedTable();
            var customColumn = this.Table.ColBoolean.AddToDerivedTable(dt);
            replacedert.AreEqual(this.Table.ColBoolean.ColumnName, customColumn.ColumnName);
            replacedert.IsTrue(dt.Columns.Contains(customColumn));

            var customColumn2 = this.Table.ColBoolean.ToCustomColumn(this.NewSource);
            replacedert.AreEqual(this.Table.ColBoolean.ColumnName, customColumn2.ColumnName);

            var reader = new Mock<ISqDataRecordReader>();

            this.Table.ColBoolean.Read(reader.Object);
            customColumn.Read(reader.Object);

            reader.Verify(r => r.GetBoolean(It.Is<string>(name => name == customColumn.ColumnName.Name)), Times.Exactly(2));

            replacedert.Throws<SqExpressException>(() => this.Table.ColBoolean.Readreplacedtring(reader.Object));
            reader.Setup(r=>r.GetNullableBoolean(It.Is<string>(name => name == customColumn.ColumnName.Name))).Returns(true);
            replacedert.AreEqual(true.ToString(),this.Table.ColBoolean.Readreplacedtring(reader.Object));

            replacedert.AreEqual("1", this.Table.ColBoolean.FromString("True").ToSql());
            replacedert.Throws<SqExpressException>(() => this.Table.ColBoolean.FromString(null));
        }

19 View Source File : UnderscoresInDacAnalyzer.cs
License : GNU General Public License v3.0
Project Creator : Acumatica

private static void CheckIdentifierForUnderscores(SyntaxToken identifier, SymbolreplacedysisContext context, PXContext pxContext)
		{
			if (!identifier.ValueText.Contains("_"))
				return;

			bool registerCodeFix = !IdentifierContainsOnlyUnderscores(identifier.ValueText);

			var diagnosticProperties = new Dictionary<string, string>
			{
				{ DiagnosticProperty.RegisterCodeFix, registerCodeFix.ToString() }
			}.ToImmutableDictionary();

			context.ReportDiagnosticWithSuppressionCheck(
				Diagnostic.Create(Descriptors.PX1026_UnderscoresInDacDeclaration, identifier.GetLocation(), diagnosticProperties),
				pxContext.CodereplacedysisSettings);
		}

19 View Source File : DeleteEdgeDefinitionQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            List<string> query = new List<string>();
            if (WaitForSync != null)
            {
                query.Add("waitForSync=" + WaitForSync.ToString().ToLower());
            }
            if (DropCollections != null)
            {
                query.Add("dropCollections=" + DropCollections.ToString().ToLower());
            }
            return string.Join("&", query);
        }

19 View Source File : DeleteEdgeQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            List<string> query = new List<string>();
            if (ReturnOld != null)
            {
                query.Add("returnOld=" + ReturnOld.ToString().ToLower());
            }
            if (WaitForSync != null)
            {
                query.Add("waitForSync=" + WaitForSync.ToString().ToLower());
            }
            return string.Join("&", query);
        }

19 View Source File : TableColumnsTest.cs
License : MIT License
Project Creator : 0x1000000

[Test]
        public void TestNullableBoolean()
        {
            replacedert.AreEqual(SqQueryBuilder.SqlType.Boolean, this.Table.ColNullableBoolean.SqlType);
            replacedert.AreEqual("[AT].[ColNullableBoolean]", this.Table.ColNullableBoolean.ToSql());
            replacedert.IsTrue(this.Table.ColNullableBoolean.IsNullable);

            DerivedTable dt = new DerivedTable();
            var customColumn = this.Table.ColNullableBoolean.AddToDerivedTable(dt);
            replacedert.AreEqual(this.Table.ColNullableBoolean.ColumnName, customColumn.ColumnName);
            replacedert.IsTrue(dt.Columns.Contains(customColumn));

            var customColumn2 = this.Table.ColNullableBoolean.ToCustomColumn(this.NewSource);
            replacedert.AreEqual(this.Table.ColNullableBoolean.ColumnName, customColumn2.ColumnName);

            var reader = new Mock<ISqDataRecordReader>();

            this.Table.ColNullableBoolean.Read(reader.Object);
            customColumn.Read(reader.Object);

            reader.Verify(r => r.GetNullableBoolean(It.Is<string>(name => name == customColumn.ColumnName.Name)), Times.Exactly(2));

            replacedert.IsNull(this.Table.ColNullableBoolean.Readreplacedtring(reader.Object));
            reader.Setup(r => r.GetNullableBoolean(It.Is<string>(name => name == customColumn.ColumnName.Name))).Returns(true);
            replacedert.AreEqual(true.ToString(), this.Table.ColNullableBoolean.Readreplacedtring(reader.Object));

            replacedert.AreEqual("0", this.Table.ColNullableBoolean.FromString("False").ToSql());
            replacedert.AreEqual("NULL", this.Table.ColNullableBoolean.FromString(null).ToSql());
        }

19 View Source File : DeleteVertexCollectionQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            List<string> query = new List<string>();
            if (DropCollection != null)
            {
                query.Add("dropCollection=" + DropCollection.ToString().ToLower());
            }
            return string.Join("&", query);
        }

19 View Source File : OVRPluginUpdater.cs
License : MIT License
Project Creator : absurd-joy

private static void AttemptPluginUpdate(bool triggeredByAutoUpdate)
	{
		OVRPlugin.SendEvent("attempt_plugin_update_auto", triggeredByAutoUpdate.ToString());

		PluginPackage bundledPluginPkg = GetBundledPluginPackage();
		List<PluginPackage> allUtilsPluginPkgs = GetAllUtilitiesPluginPackages();

		PluginPackage enabledUtilsPluginPkg = null;
		PluginPackage newestUtilsPluginPkg = null;

		foreach(PluginPackage pluginPkg in allUtilsPluginPkgs)
		{
			if ((newestUtilsPluginPkg == null) || (pluginPkg.Version > newestUtilsPluginPkg.Version))
			{
				newestUtilsPluginPkg = pluginPkg;
			}

			if (pluginPkg.IsEnabled())
			{
				if ((enabledUtilsPluginPkg == null) || (pluginPkg.Version > enabledUtilsPluginPkg.Version))
				{
					enabledUtilsPluginPkg = pluginPkg;
				}
			}
		}

		bool reenableCurrentPluginPkg = false;
		PluginPackage targetPluginPkg = null;

		if ((newestUtilsPluginPkg != null) && (newestUtilsPluginPkg.Version > bundledPluginPkg.Version))
		{
			if ((enabledUtilsPluginPkg == null) || (enabledUtilsPluginPkg.Version != newestUtilsPluginPkg.Version))
			{
				targetPluginPkg = newestUtilsPluginPkg;
			}
		}
		else if ((enabledUtilsPluginPkg != null) && (enabledUtilsPluginPkg.Version < bundledPluginPkg.Version))
		{
			targetPluginPkg = bundledPluginPkg;
		}

		PluginPackage currentPluginPkg = (enabledUtilsPluginPkg != null) ? enabledUtilsPluginPkg : bundledPluginPkg;

		if ((targetPluginPkg == null) && !UnitySupportsEnabledAndroidPlugin())
		{
			// Force reenabling the current package to configure the correct android plugin for this unity version.
			reenableCurrentPluginPkg = true;
			targetPluginPkg = currentPluginPkg;
		}

		if (targetPluginPkg == null)
		{
			if (!triggeredByAutoUpdate && !unityRunningInBatchmode)
			{
				EditorUtility.DisplayDialog("Update Oculus Utilities Plugin",
					"OVRPlugin is already up to date.\n\nCurrent version: "
						+ GetVersionDescription(currentPluginPkg.Version),
					"Ok",
					"");
			}

			return; // No update necessary.
		}

		System.Version targetVersion = targetPluginPkg.Version;

		bool userAcceptsUpdate = false;

		if (unityRunningInBatchmode)
		{
			userAcceptsUpdate = true;
		}
		else
		{
			string dialogBody = "Oculus Utilities has detected that a newer OVRPlugin is available."
				+ " Using the newest version is recommended. Do you want to enable it?\n\n"
				+ "Current version: "
				+ GetVersionDescription(currentPluginPkg.Version)
				+ "\nAvailable version: "
				+ targetVersion;

			if (reenableCurrentPluginPkg)
			{
				dialogBody = "Oculus Utilities has detected a configuration change that requires re-enabling the current OVRPlugin."
					+ " Do you want to proceed?\n\nCurrent version: "
					+ GetVersionDescription(currentPluginPkg.Version);
			}

			int dialogResult = EditorUtility.DisplayDialogComplex("Update Oculus Utilities Plugin", dialogBody, "Yes", "No, Don't Ask Again", "No");

			switch (dialogResult)
			{
				case 0: // "Yes"
					userAcceptsUpdate = true;
					break;
				case 1: // "No, Don't Ask Again"
					autoUpdateEnabled = false;

					EditorUtility.DisplayDialog("Oculus Utilities OVRPlugin",
						"To manually update in the future, use the following menu option:\n\n"
							+ "[Oculus -> Tools -> Update OVR Utilities Plugin]",
						"Ok",
						"");
					return;
				case 2: // "No"
					return;
			}
		}

		if (userAcceptsUpdate)
		{
			DisableAllUtilitiesPluginPackages();

			if (!targetPluginPkg.IsBundledPluginPackage())
			{
				EnablePluginPackage(targetPluginPkg);
			}

			if (unityRunningInBatchmode
				|| EditorUtility.DisplayDialog("Restart Unity",
					"OVRPlugin has been updated to "
						+ GetVersionDescription(targetPluginPkg.Version)
						+ ".\n\nPlease restart the Unity Editor to complete the update process."
						,
					"Restart",
					"Not Now"))
			{
				RestartUnityEditor();
			}
		}
	}

19 View Source File : PatchVertexQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            List<string> query = new List<string>();
            if (WaitForSync != null)
            {
                query.Add("waitForSync=" + WaitForSync.ToString().ToLower());
            }
            if (ReturnNew != null)
            {
                query.Add("returnNew=" + ReturnNew.ToString().ToLower());
            }
            if (ReturnOld != null)
            {
                query.Add("returnOld=" + ReturnOld.ToString().ToLower());
            }
            if (KeepNull != null)
            {
                query.Add("keepNull=" + KeepNull.ToString().ToLower());
            }
            return string.Join("&", query);
        }

19 View Source File : GetVertexQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            List<string> query = new List<string>();
            if (Rev != null)
            {
                query.Add("rev=" + Rev.ToString().ToLower());
            }
            return string.Join("&", query);
        }

19 View Source File : DeleteAqlFunctionQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            if (Group != null)
            {
                return "group=" + Group.ToString().ToLower();
            }
            else
            {
                return "";
            }
        }

19 View Source File : PostGraphQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            if (WaitForSync != null)
            {
                return "waitForSync=" + WaitForSync.ToString().ToLower();
            }
            else
            {
                return "";
            }
        }

19 View Source File : ConsulServiceDiscovery.cs
License : MIT License
Project Creator : 1100100

public async Task<bool> RegisterAsync(CancellationToken cancellationToken = default)
        {
            if (ConsulRegisterServiceConfiguration == null)
            {
                ConsulRegisterServiceConfiguration = new ConsulRegisterServiceConfiguration();
            }

            if (string.IsNullOrWhiteSpace(ConsulRegisterServiceConfiguration.Id))
            {
                ConsulRegisterServiceConfiguration.Id = ServerSettings.ToString();
            }

            if (string.IsNullOrWhiteSpace(ConsulRegisterServiceConfiguration.Name))
            {
                ConsulRegisterServiceConfiguration.Name = ServerSettings.ToString();
            }

            if (string.IsNullOrWhiteSpace(ConsulRegisterServiceConfiguration.Name))
                throw new ArgumentNullException(nameof(ConsulRegisterServiceConfiguration.Name), "Service name value cannot be null.");

            Logger.LogTrace("Start registering with consul[{0}]...", ConsulClientConfigure.Address);

            try
            {
                using (var consul = new ConsulClient(conf =>
                {
                    conf.Address = ConsulClientConfigure.Address;
                    conf.Datacenter = ConsulClientConfigure.Datacenter;
                    conf.Token = ConsulClientConfigure.Token;
                    conf.WaitTime = ConsulClientConfigure.WaitTime;
                }))
                {
                    ConsulRegisterServiceConfiguration.Meta = new Dictionary<string, string>{
                        {"X-Tls",(ServerSettings.X509Certificate2!=null).ToString()}
                    };
                    if (ServerSettings.Weight.HasValue)
                    {
                        ConsulRegisterServiceConfiguration.Meta.Add("X-Weight", ServerSettings.Weight.ToString());
                    }

                    //Register service to consul agent 
                    var result = await consul.Agent.ServiceRegister(new AgentServiceRegistration
                    {
                        Address = ServerSettings.Address,
                        Port = ServerSettings.Port,
                        ID = ConsulRegisterServiceConfiguration.Id,
                        Name = ConsulRegisterServiceConfiguration.Name,
                        EnableTagOverride = ConsulRegisterServiceConfiguration.EnableTagOverride,
                        Meta = ConsulRegisterServiceConfiguration.Meta,
                        Tags = ConsulRegisterServiceConfiguration.Tags,
                        Check = new AgentServiceCheck
                        {
                            TCP = ServerSettings.ToString(),
                            DeregisterCriticalServiceAfter = TimeSpan.FromSeconds(20),
                            Timeout = TimeSpan.FromSeconds(3),
                            Interval = ConsulRegisterServiceConfiguration.HealthCheckInterval
                        }
                    }, cancellationToken);
                    if (result.StatusCode != HttpStatusCode.OK)
                    {
                        Logger.LogError("Registration service failed:{0}", result.StatusCode);
                        throw new ConsulRequestException("Registration service failed.", result.StatusCode);
                    }

                    Logger.LogTrace("Consul service registration completed");
                    return result.StatusCode == HttpStatusCode.OK;
                }
            }
            catch (Exception e)
            {
                Logger.LogError(e, "Registration service failed:{0}", e.Message);
                return false;
            }
        }

19 View Source File : PutEdgeDefinitionQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            List<string> query = new List<string>();
            if (WaitForSync != null)
            {
                query.Add("waitForSync=" + WaitForSync.ToString().ToLower());
            }
            return string.Join("&", query);
        }

19 View Source File : DeleteDocumentQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            var queryParams = new List<string>();
            if (WaitForSync != null)
            {
                queryParams.Add("waitForSync=" + WaitForSync.ToString().ToLower());
            }
            if (ReturnOld != null)
            {
                queryParams.Add("returnOld=" + ReturnOld.ToString().ToLower());
            }
            if (Silent != null)
            {
                queryParams.Add("silent=" + Silent.ToString().ToLower());
            }
            return string.Join("&", queryParams);
        }

19 View Source File : PutVertexQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            List<string> query = new List<string>();
            if (WaitForSync != null)
            {
                query.Add("waitForSync=" + WaitForSync.ToString().ToLower());
            }
            if (KeepNull != null)
            {
                query.Add("keepNull=" + KeepNull.ToString().ToLower());
            }
            if (ReturnOld != null)
            {
                query.Add("returnOld=" + ReturnOld.ToString().ToLower());
            }
            if (ReturnNew != null)
            {
                query.Add("returnNew=" + ReturnNew.ToString().ToLower());
            }
            return string.Join("&", query);
        }

19 View Source File : TableColumn.Types.cs
License : MIT License
Project Creator : 0x1000000

public override string? Readreplacedtring(ISqDataRecordReader recordReader) => this.Read(recordReader)?.ToString();

19 View Source File : ActionPlugin.cs
License : MIT License
Project Creator : actions

public void SetRepositoryPath(string repoName, string path, bool workspaceRepo)
        {
            Output($"##[internal-set-repo-path repoFullName={repoName};workspaceRepo={workspaceRepo.ToString()}]{path}");
        }

19 View Source File : PatchDocumentQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            var queryParams = new List<string>();
            if (WaitForSync != null)
            {
                queryParams.Add("waitForSync=" + WaitForSync.ToString().ToLower());
            }
            if (ReturnOld != null)
            {
                queryParams.Add("returnOld=" + ReturnOld.ToString().ToLower());
            }
            if (Silent != null)
            {
                queryParams.Add("silent=" + Silent.ToString().ToLower());
            }
            if (KeepNull != null)
            {
                queryParams.Add("keepNull=" + KeepNull.ToString().ToLower());
            }
            if (MergeObjects != null)
            {
                queryParams.Add("mergeObjects=" + MergeObjects.ToString().ToLower());
            }
            if (ReturnNew != null)
            {
                queryParams.Add("returnNew=" + ReturnNew.ToString().ToLower());
            }
            if (IgnoreRevs != null)
            {
                queryParams.Add("ignoreRevs=" + IgnoreRevs.ToString().ToLower());
            }
            return string.Join("&", queryParams);
        }

19 View Source File : TaskAgentHttpClientBase.cs
License : MIT License
Project Creator : actions

public virtual Task<List<TaskAgent>> GetAgentsAsync(
            int poolId,
            string agentName = null,
            bool? includeCapabilities = null,
            bool? includereplacedignedRequest = null,
            bool? includeLastCompletedRequest = null,
            IEnumerable<string> propertyFilters = null,
            IEnumerable<string> demands = null,
            object userState = null,
            CancellationToken cancellationToken = default)
        {
            HttpMethod httpMethod = new HttpMethod("GET");
            Guid locationId = new Guid("e298ef32-5878-4cab-993c-043836571f42");
            object routeValues = new { poolId = poolId };

            List<KeyValuePair<string, string>> queryParams = new List<KeyValuePair<string, string>>();
            if (agentName != null)
            {
                queryParams.Add("agentName", agentName);
            }
            if (includeCapabilities != null)
            {
                queryParams.Add("includeCapabilities", includeCapabilities.Value.ToString());
            }
            if (includereplacedignedRequest != null)
            {
                queryParams.Add("includereplacedignedRequest", includereplacedignedRequest.Value.ToString());
            }
            if (includeLastCompletedRequest != null)
            {
                queryParams.Add("includeLastCompletedRequest", includeLastCompletedRequest.Value.ToString());
            }
            if (propertyFilters != null && propertyFilters.Any())
            {
                queryParams.Add("propertyFilters", string.Join(",", propertyFilters));
            }
            if (demands != null && demands.Any())
            {
                queryParams.Add("demands", string.Join(",", demands));
            }

            return SendAsync<List<TaskAgent>>(
                httpMethod,
                locationId,
                routeValues: routeValues,
                version: new ApiResourceVersion(6.0, 2),
                queryParameters: queryParams,
                userState: userState,
                cancellationToken: cancellationToken);
        }

19 View Source File : JsonData.cs
License : MIT License
Project Creator : 404Lcc

public override string ToString ()
        {
            switch (type) {
            case JsonType.Array:
                return "JsonData array";

            case JsonType.Boolean:
                return inst_boolean.ToString ();

            case JsonType.Double:
                return inst_double.ToString ();

            case JsonType.Int:
                return inst_int.ToString ();

            case JsonType.Long:
                return inst_long.ToString ();

            case JsonType.Object:
                return "JsonData object";

            case JsonType.String:
                return inst_string;
            }

            return "Uninitialized JsonData";
        }

19 View Source File : TaskAgentHttpClientBase.cs
License : MIT License
Project Creator : actions

[EditorBrowsable(EditorBrowsableState.Never)]
        public virtual Task<TaskAgentJobRequest> GetAgentRequestAsync(
            int poolId,
            long requestId,
            bool? includeStatus = null,
            object userState = null,
            CancellationToken cancellationToken = default)
        {
            HttpMethod httpMethod = new HttpMethod("GET");
            Guid locationId = new Guid("fc825784-c92a-4299-9221-998a02d1b54f");
            object routeValues = new { poolId = poolId, requestId = requestId };

            List<KeyValuePair<string, string>> queryParams = new List<KeyValuePair<string, string>>();
            if (includeStatus != null)
            {
                queryParams.Add("includeStatus", includeStatus.Value.ToString());
            }

            return SendAsync<TaskAgentJobRequest>(
                httpMethod,
                locationId,
                routeValues: routeValues,
                version: new ApiResourceVersion(5.1, 1),
                queryParameters: queryParams,
                userState: userState,
                cancellationToken: cancellationToken);
        }

19 View Source File : PostDocumentsQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            List<string> query = new List<string>();
            if (WaitForSync != null)
            {
                query.Add("waitForSync=" + WaitForSync.ToString().ToLower());
            }
            if (ReturnNew != null)
            {
                query.Add("returnNew=" + ReturnNew.ToString().ToLower());
            }
            if (ReturnOld != null)
            {
                query.Add("returnOld=" + ReturnOld.ToString().ToLower());
            }
            if (Silent != null)
            {
                query.Add("silent=" + Silent.ToString().ToLower());
            }
            if (Overwrite != null)
            {
                query.Add("overwrite=" + Overwrite.ToString().ToLower());
            }
            return string.Join("&", query);
        }

19 View Source File : TaskHttpClientBase.cs
License : MIT License
Project Creator : actions

public virtual Task<Timeline> GetTimelineAsync(
            Guid scopeIdentifier,
            string hubName,
            Guid planId,
            Guid timelineId,
            int? changeId = null,
            bool? includeRecords = null,
            object userState = null,
            CancellationToken cancellationToken = default)
        {
            HttpMethod httpMethod = new HttpMethod("GET");
            Guid locationId = new Guid("83597576-cc2c-453c-bea6-2882ae6a1653");
            object routeValues = new { scopeIdentifier = scopeIdentifier, hubName = hubName, planId = planId, timelineId = timelineId };

            List<KeyValuePair<string, string>> queryParams = new List<KeyValuePair<string, string>>();
            if (changeId != null)
            {
                queryParams.Add("changeId", changeId.Value.ToString(CultureInfo.InvariantCulture));
            }
            if (includeRecords != null)
            {
                queryParams.Add("includeRecords", includeRecords.Value.ToString());
            }

            return SendAsync<Timeline>(
                httpMethod,
                locationId,
                routeValues: routeValues,
                version: new ApiResourceVersion(5.1, 1),
                queryParameters: queryParams,
                userState: userState,
                cancellationToken: cancellationToken);
        }

19 View Source File : MetaRef.cs
License : MIT License
Project Creator : 0x0ade

public override void Write(DataContext ctx, MetaTypeWrap data) {
            data["ID"] = ID.ToString();
            data["IsAlive"] = IsAlive.ToString();
        }

19 View Source File : DacForeignKeyDeclarationAnalyzer.cs
License : GNU General Public License v3.0
Project Creator : Acumatica

protected override void MakeSpecificDacKeysreplacedysis(SymbolreplacedysisContext symbolContext, PXContext context, DacSemanticModel dac,
															List<INamedTypeSymbol> dacForeignKeys, Dictionary<INamedTypeSymbol, List<ITypeSymbol>> dacFieldsByKey)
		{
			symbolContext.CancellationToken.ThrowIfCancellationRequested();

			if (dacForeignKeys.Count == 0)
			{
				ReportNoForeignKeyDeclarationsInDac(symbolContext, context, dac);
				return;
			}

			INamedTypeSymbol foreignKeysContainer = dac.Symbol.GetTypeMembers(ReferentialIntegrity.ForeignKeyClreplacedName)
															  .FirstOrDefault();

			//We can register code fix only if there is no FK nested type in DAC or there is a public static FK clreplaced. Otherwise we will break the code.
			bool registerCodeFix = foreignKeysContainer == null ||
								   (foreignKeysContainer.DeclaredAccessibility == Accessibility.Public && foreignKeysContainer.IsStatic);

			List<INamedTypeSymbol> keysNotInContainer = GetKeysNotInContainer(dacForeignKeys, foreignKeysContainer);

			if (keysNotInContainer.Count == 0)
				return;

			symbolContext.CancellationToken.ThrowIfCancellationRequested();

			Location dacLocation = dac.Node.GetLocation();
			var keysNotInContainerLocations = GetKeysLocations(keysNotInContainer, symbolContext.CancellationToken).ToList(capacity: keysNotInContainer.Count);

			if (dacLocation == null || keysNotInContainerLocations.Count == 0)
				return;

			var dacLocationArray = new[] { dacLocation };
			var diagnosticProperties = new Dictionary<string, string>
			{
				{ nameof(RefIntegrityDacKeyType), RefIntegrityDacKeyType.ForeignKey.ToString() },
				{ DiagnosticProperty.RegisterCodeFix, registerCodeFix.ToString() }
			}
			.ToImmutableDictionary();

			foreach (Location keyLocation in keysNotInContainerLocations)
			{
				var otherKeyLocations = keysNotInContainerLocations.Where(location => location != keyLocation);
				var additionalLocations = dacLocationArray.Concat(otherKeyLocations);

				symbolContext.ReportDiagnosticWithSuppressionCheck(
									Diagnostic.Create(Descriptors.PX1036_WrongDacForeignKeyDeclaration, keyLocation, additionalLocations, diagnosticProperties),
									context.CodereplacedysisSettings);
			}
		}

19 View Source File : PutDocumentsQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            List<string> query = new List<string>();
            if (WaitForSync != null)
            {
                query.Add("waitForSync=" + WaitForSync.ToString().ToLower());
            }
            if (ReturnNew != null)
            {
                query.Add("returnNew=" + ReturnNew.ToString().ToLower());
            }
            if (ReturnOld != null)
            {
                query.Add("returnOld=" + ReturnOld.ToString().ToLower());
            }
            if (IgnoreRevs != null)
            {
                query.Add("ignoreRevs=" + IgnoreRevs.ToString().ToLower());
            }
            if (Silent != null)
            {
                query.Add("silent=" + Silent.ToString().ToLower());
            }
            return string.Join("&", query);
        }

19 View Source File : SettingsHelper.cs
License : GNU General Public License v3.0
Project Creator : 9vult

public static void Save()
        {
            File.WriteAllLines(FileHelper.GetFile(
                FileHelper.APP_ROOT, "mikureader.txt").FullName,
                new string[] {
                    UseDoubleReader.ToString() + " // Use Double-Page Reader",
                    CheckForUpdates.ToString() + " // Check for updates on startup"
                }
            );
        }

19 View Source File : MetaBoundRef.cs
License : MIT License
Project Creator : 0x0ade

public override void Write(DataContext ctx, MetaTypeWrap data) {
            data["Type"] = TypeBoundTo;
            data["ID"] = ID.ToString();
            data["IsAlive"] = IsAlive.ToString();
        }

19 View Source File : TableColumn.Types.cs
License : MIT License
Project Creator : 0x1000000

public override string Readreplacedtring(ISqDataRecordReader recordReader) 
            => this.ReadNullable(recordReader)?.ToString() 
               ?? throw new SqExpressException($"Null value is not expected in non nullable column '{this.ColumnName.Name}'");

19 View Source File : Program.cs
License : GNU General Public License v3.0
Project Creator : 0x2b00b1e5

static bool Review()
        {
            Console.WriteLine("\n Please review these settings: \n");
            Console.WriteLine("-------------------------------------------------------------------------------");
            Console.WriteLine("Shortcuts:");
            Console.WriteLine(string.Format("   Replace desktop shortcuts: {0} \n", ReplaceDesktop.ToString()));
            if (WriteShortcuts[0] == "")
            {
                Console.WriteLine(string.Format("   Don't write additional shortcuts"));
            }
            else
            {
                Console.WriteLine(string.Format("   Write additional shortcuts to: \n"));
                foreach(string p in WriteShortcuts)
                {
                    Console.WriteLine(string.Format("       {0}", p));
                }
                Console.WriteLine();
            }
            Console.WriteLine("-------------------------------------------------------------------------------");
            Console.WriteLine("FL Studio versions:\n");
            Console.WriteLine(string.Format("   Path: {0}", FLStudioPaths));
            if(VersionNumber == ""){ Console.WriteLine("    No version specified\n"); }
            else
            { Console.WriteLine(string.Format("   Version: {0}\n", VersionNumber)); }
            Console.WriteLine("-------------------------------------------------------------------------------\n");
            Console.WriteLine("Are these settings OK? (Y/N)");
            switch (Console.ReadKey().Key)
            {
                case ConsoleKey.Y:
                    return true;
                case ConsoleKey.N:
                    return false;
            }
            return false;
        }

19 View Source File : DemoDataService.cs
License : Microsoft Public License
Project Creator : achimismaili

private string ActivateFeature(FeatureDefinition feature, Location location, bool elevatedPrivileges, bool force
            , out ActivatedFeature activatedFeature)
        {
            var props = new Dictionary<string, string>() {
                { "demo activation 'elevatedPrivileges' setting", elevatedPrivileges.ToString() },
                 { "demo activation 'force' setting", force.ToString() }

            };

            activatedFeature = Core.Factories.ActivatedFeatureFactory.GetActivatedFeature(
                feature.UniqueIdentifier
                , location.UniqueId
                , feature.DisplayName
                , false
                , props
                , DateTime.Now
                , feature.Version,
                feature.Version
                );



            demoRepository.AddActivatedFeature(activatedFeature);

            // wait 1 second in the demo
            System.Threading.Thread.Sleep(1000);

            return string.Empty;
        }

19 View Source File : PatchEdgeQuery.cs
License : Apache License 2.0
Project Creator : Actify-Inc

internal string ToQueryString()
        {
            List<string> query = new List<string>();
            if (ReturnNew != null)
            {
                query.Add("returnNew=" + ReturnNew.ToString().ToLower());
            }
            if (ReturnOld != null)
            {
                query.Add("returnOld=" + ReturnOld.ToString().ToLower());
            }
            if (KeepNull != null)
            {
                query.Add("keepNull=" + KeepNull.ToString().ToLower());
            }
            if (WaitForSync != null)
            {
                query.Add("waitForSync=" + WaitForSync.ToString().ToLower());
            }
            return string.Join("&", query);
        }

See More Examples