コード例 #1
0
ファイル: PluginInvoker.cs プロジェクト: NoxWings/FreePIE
 public PluginInvoker(ISettingsManager settingsManager, Func<Type, IPlugin> pluginFactory, IFileSystem fileSystem, IPaths paths)
 {
     this.settingsManager = settingsManager;
     this.pluginFactory = pluginFactory;
     this.fileSystem = fileSystem;
     this.paths = paths;
 }
コード例 #2
0
		public override bool OnStart()
		{
			var fileManipulation = new FileManipulation();
			var zipping = new Zipping();
			var localResourceManager = new LocalResourceManager();
			var cloudDriveManager = new CloudDriveManager(localResourceManager);
			paths = new Paths(localResourceManager);
			//paths = new TestPaths(localResourceManager);

			neo4JManager = new Neo4jManager(fileManipulation, zipping);

			ServicePointManager.DefaultConnectionLimit = 12;

			CrashDumps.EnableCollection(true);

			var initialConfiguration = DiagnosticMonitor.GetDefaultInitialConfiguration();
			var directoryConfiguration = neo4JManager.GetLogDirectory(paths);
			initialConfiguration.Directories.DataSources.Add(directoryConfiguration);

			DiagnosticMonitor.Start(ConfigSettings.DiagnosticsConnectionString, initialConfiguration);

			RoleEnvironment.Changing += RoleEnvironmentChanging;
			CloudStorageAccount.SetConfigurationSettingPublisher(
					(configName, configSetter) => configSetter(RoleEnvironment.GetConfigurationSettingValue(configName))
				);

			var storageAccount = CloudStorageAccount.FromConfigurationSetting(ConfigSettings.StorageConnectionString);

			var neo4jInternalPort = paths.Neo4jPort;
			neo4JManager.Install(paths, storageAccount, neo4jInternalPort, cloudDriveManager);

			return base.OnStart();
		}
コード例 #3
0
		public void Install(IPaths paths, CloudStorageAccount storageAccount, int port, ICloudDriveManager cloudDriveManager)
		{
			Trace.TraceInformation("Installing Neo4j server.");

			DownloadJava(paths, storageAccount);
            UnzipJava(paths);

			DownloadNeo4j(paths, storageAccount);
			UnzipNeo4j(paths);

            try
            {
                // try to mount cloud drive
                MountDatabase(paths, cloudDriveManager);
                SetServerDbPathConfig(paths, port);
            }
            catch (Exception ex)
            {
                Trace.TraceError("Drive Mounting Error: " + ex.Message);
            }
            
			SetServerPortAndUrlConfig(paths, port);
			SetJavaPath(paths);
			CopyConfigurationFilesToLogsDirectory(paths);

			ClearLogDirectory(paths);

			Trace.TraceInformation("Neo4j server installed.");
		}
コード例 #4
0
		internal void MountDatabase(IPaths paths, ICloudDriveManager cloudDriveManager)
		{
			Trace.TraceInformation("Mounting the Neoj4 database blob drive.");

            paths.MountDrivePath = cloudDriveManager.MountDrive(ConfigSettings.StorageConnectionString, paths.Neo4jDBDriveBlobRelativePath, paths.LocalNeo4jDababaseResourceName, paths.Neo4jDBDriveSize);

			Trace.TraceInformation("Done mounting the Neoj4 database blob drive.");
		}
コード例 #5
0
		internal void ClearLogDirectory(IPaths paths)
		{
			var localNeo4JLogsPath = paths.LocalNeo4jLogsPath;

			Trace.TraceInformation(string.Format("Clearing the Neoj4 log directory <{0}>.", localNeo4JLogsPath));

			var logDirectory = new DirectoryInfo(localNeo4JLogsPath);
			foreach (var fileInfo in logDirectory.GetFiles())
				fileInfo.Delete();

			Trace.TraceInformation(string.Format("Done clearing the Neoj4 log directory <{0}>.", localNeo4JLogsPath));
		}
コード例 #6
0
		internal void CopyConfigurationFilesToLogsDirectory(IPaths paths)
		{
			Trace.TraceInformation("Copying Neo4j Configuration files to the log directory.");

			var logDirectory = new DirectoryInfo(paths.LocalNeo4jLogsPath);

			var neo4JServerConfigFilePath = paths.Neo4jServerConfigPath;
			File.Copy(neo4JServerConfigFilePath, Path.Combine(logDirectory.FullName, Path.GetFileName(neo4JServerConfigFilePath)));

			var neo4JWrapperConfigPath = paths.Neo4jWrapperConfigPath;
			File.Copy(neo4JWrapperConfigPath, Path.Combine(logDirectory.FullName, Path.GetFileName(neo4JWrapperConfigPath)));

			Trace.TraceInformation("Done copying Neo4j Configuration files to the log directory.");
		}
コード例 #7
0
ファイル: PathsExtensions.cs プロジェクト: iouri-s/autorest
 /// <summary>
 /// Get '-9999999.999' numeric value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='doublePath'>
 /// '-9999999.999'numeric value
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DoubleDecimalNegativeAsync(this IPaths operations, double?doublePath, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.DoubleDecimalNegativeWithHttpMessagesAsync(doublePath, null, cancellationToken).ConfigureAwait(false);
 }
コード例 #8
0
ファイル: PathsExtensions.cs プロジェクト: iouri-s/autorest
 /// <summary>
 /// Get true Boolean value on path
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='boolPath'>
 /// true boolean value
 /// </param>
 public static void GetBooleanTrue(this IPaths operations, bool?boolPath)
 {
     Task.Factory.StartNew(s => ((IPaths)s).GetBooleanTrueAsync(boolPath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
コード例 #9
0
ファイル: PathsExtensions.cs プロジェクト: iouri-s/autorest
 /// <summary>
 /// Get '-1.034E-20' numeric value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='floatPath'>
 /// '-1.034E-20'numeric value
 /// </param>
 public static void FloatScientificNegative(this IPaths operations, double?floatPath)
 {
     Task.Factory.StartNew(s => ((IPaths)s).FloatScientificNegativeAsync(floatPath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
コード例 #10
0
		internal void SetServerDbPathConfig(IPaths paths, int port)
		{
			Trace.TraceInformation("Setting Neo4j server database path setting.");

			var patternToFind = string.Format("{0}=", paths.Neo4jServerConfigSettings.DatabaseLocation);
			string dbPath = paths.MountDrivePath + paths.LocalNeo4jDababaseResourceName;
			var lineToInsert = string.Format("{0}{1}", patternToFind, dbPath);
			var replacement = Replacement.Create(patternToFind, lineToInsert);

			var fileName = paths.Neo4jServerConfigPath;
			fileManipulation.ReplaceConfigLine(fileName, replacement);

			Trace.TraceInformation("Finished setting Neo4j server database path settings.");
		}
コード例 #11
0
 /// <summary>
 /// Get '2012-01-01T01:01:01Z' as date-time
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='dateTimePath'>
 /// '2012-01-01T01:01:01Z' as date-time
 /// </param>
 public static void DateTimeValid(this IPaths operations, DateTime?dateTimePath)
 {
     Task.Factory.StartNew(s => ((IPaths)s).DateTimeValidAsync(dateTimePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
コード例 #12
0
 /// <summary>
 /// Get a 200 to test a valid base uri
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='accountName'>
 /// Account Name
 /// </param>
 public static void GetEmpty(this IPaths operations, string accountName)
 {
     operations.GetEmptyAsync(accountName).GetAwaiter().GetResult();
 }
コード例 #13
0
 /// <summary>
 /// Get '1000000' integer value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static void GetIntOneMillion(this IPaths operations)
 {
     operations.GetIntOneMillionAsync().GetAwaiter().GetResult();
 }
コード例 #14
0
ファイル: PathsExtensions.cs プロジェクト: iouri-s/autorest
 /// <summary>
 /// Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='bytePath'>
 /// '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array
 /// </param>
 public static void ByteMultiByte(this IPaths operations, byte[] bytePath)
 {
     Task.Factory.StartNew(s => ((IPaths)s).ByteMultiByteAsync(bytePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
コード例 #15
0
ファイル: PathsExtensions.cs プロジェクト: iouri-s/autorest
 /// <summary>
 /// Get null (should throw)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='stringPath'>
 /// null string value
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task StringNullAsync(this IPaths operations, string stringPath, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.StringNullWithHttpMessagesAsync(stringPath, null, cancellationToken).ConfigureAwait(false);
 }
コード例 #16
0
		internal DirectoryConfiguration GetLogDirectory(IPaths paths)
		{
			var localNeo4JLogsPath = paths.LocalNeo4jLogsPath;
			return new DirectoryConfiguration
			{
				Container = paths.Neo4jLogsContainerName,
				DirectoryQuotaInMB = 1000,
				Path = localNeo4JLogsPath
			};
		}
コード例 #17
0
		public void Start(IPaths paths)
		{
			Trace.TraceInformation("Starting the Neo4j service.");

			string neo4JRoot = paths.LocalNeo4jPath, neo4JRelativePath = paths.Neo4jExePath;

			var process = new Process
			{
				StartInfo = new ProcessStartInfo(neo4JRelativePath)
				{
					RedirectStandardInput = true, RedirectStandardOutput = true,
					RedirectStandardError = true, UseShellExecute = false,
					WindowStyle = ProcessWindowStyle.Hidden, WorkingDirectory = neo4JRoot,
				}

			};

            process.StartInfo.EnvironmentVariables["JAVA_HOME"] = paths.LocalJavaHomePath;
		    process.StartInfo.EnvironmentVariables["javaVersion"] = "1.7";
            if (process.StartInfo.EnvironmentVariables.ContainsKey("Path") && process.StartInfo.EnvironmentVariables["Path"].Length > 0)
            {
                process.StartInfo.EnvironmentVariables["Path"] += ";" + paths.LocalJavaHomePath + "\\bin";
            }
            else
            {
                process.StartInfo.EnvironmentVariables["Path"] = paths.LocalJavaHomePath + "\\bin";
            }

			process.Exited += (sender, e) => Trace.TraceInformation("Neo4j service process exited.");
			process.ErrorDataReceived += (sender, e) => Trace.TraceError(e.Data);
			process.OutputDataReceived += (sender, e) => Trace.TraceInformation(e.Data);

			try
			{
				process.Start();
				process.BeginOutputReadLine();
				process.BeginErrorReadLine();
				process.WaitForExit();
			}
			catch (Exception e)
			{
				Trace.Fail(string.Format("Error running Neo4j: type <{0}> message <{1}> stack trace <{2}>.", e.GetType().FullName, e.Message, e.StackTrace));
				throw;
			}
			Trace.TraceInformation("Neo4j service running.");
		}
コード例 #18
0
		internal void UnzipJava(IPaths paths)
		{
			string localJavaZip;
			try
			{
				Trace.TraceInformation("Unzipping java.");

				localJavaZip = paths.LocalJavaZip;
				var localJavaPath = paths.LocalJavaPath;
				zipping.Extract(localJavaZip, localJavaPath);
			}
			catch (Exception e)
			{
				Trace.Fail(string.Format("Error unzipping Neo4j: type <{0}> message <{1}> stack trace <{2}>.", e.GetType().FullName, e.Message, e.StackTrace));
				throw;
			}

			//File.Delete(localJavaZip);
			Trace.TraceInformation("Java unzipped.");
		}
コード例 #19
0
		public void DownloadJava(IPaths paths, CloudStorageAccount storageAccount)
		{
			try
			{
				var localJavaZipPath = paths.LocalJavaZip;

				if (File.Exists(localJavaZipPath))
				{
					File.Delete(localJavaZipPath);
					//return;
				}

				Trace.TraceInformation("Downloading Java.");

				var blobClient = new CloudBlobClient(storageAccount.BlobEndpoint, storageAccount.Credentials);

				string blobStoragePath = storageAccount.BlobEndpoint.AbsoluteUri;
				string jBlobRelativePath = RoleEnvironment.GetConfigurationSettingValue(ConfigSettings.JavaBlobNameSetting);

				string javaBlobAddress = blobStoragePath.CombineUris(jBlobRelativePath);

				var blob = blobClient.GetBlobReference(javaBlobAddress);
                
                var option = new BlobRequestOptions();
                option.Timeout = new TimeSpan(0, 15, 0);
				blob.DownloadToFile(localJavaZipPath, option);

				Trace.TraceInformation("Java downloaded.");
			}
			catch (Exception e)
			{
				Trace.Fail(string.Format("Error downloading Java: type <{0}> message <{1}> stack trace <{2}>.", e.GetType().FullName, e.Message, e.StackTrace));
				throw;
			}
		}
コード例 #20
0
ファイル: PathsExtensions.cs プロジェクト: iouri-s/autorest
 /// <summary>
 /// Get null (should throw on the client before the request is sent on wire)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='enumPath'>
 /// send null should throw. Possible values for this parameter include: 'red
 /// color', 'green color', 'blue color'
 /// </param>
 public static void EnumNull(this IPaths operations, UriColor?enumPath)
 {
     Task.Factory.StartNew(s => ((IPaths)s).EnumNullAsync(enumPath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
コード例 #21
0
		internal void SetJavaPath(IPaths paths)
		{
			var localJavaPath = paths.LocalJavaExePath;
			var fileName = paths.Neo4jWrapperConfigPath;

			Trace.TraceInformation(string.Format("Setting path to Java in Neo4j to '{0}' in the file <{1}>.", localJavaPath, fileName));

			var wrapperJavaCommand = paths.Neo4jWrapperSettingJavaCommand;
			var patternToFind = string.Format("{0}=", wrapperJavaCommand);
			var lineToInsert = string.Format("{0}{1}", patternToFind, localJavaPath);
			var replacement = Replacement.Create(patternToFind, lineToInsert);

			fileManipulation.ReplaceConfigLine(fileName, replacement);

			Trace.TraceInformation(string.Format("Finished setting path to Java in Neo4j to '{0}'.", localJavaPath));
		}
コード例 #22
0
ファイル: Log.cs プロジェクト: tagaf/FreePIE
 public Log(IFileSystem fileSystem, IPaths paths)
 {
     this.fileSystem = fileSystem;
     path = paths.GetDataPath("FreePIE.log");
 }
コード例 #23
0
ファイル: SettingsManager.cs プロジェクト: NoxWings/FreePIE
 public SettingsManager(IPaths paths)
 {
     this.paths = paths;
 }
コード例 #24
0
 /// <summary>
 /// Get '1000000' integer value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task GetIntOneMillionAsync(this IPaths operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.GetIntOneMillionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
コード例 #25
0
 /// <summary>
 /// Get '1000000' integer value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='intPath'>
 /// '1000000' integer value
 /// </param>
 public static void GetIntOneMillion(this IPaths operations, int?intPath)
 {
     Task.Factory.StartNew(s => ((IPaths)s).GetIntOneMillionAsync(intPath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
コード例 #26
0
 /// <summary>
 /// Get a 200 to test a valid base uri
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='accountName'>
 /// Account Name
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task GetEmptyAsync(this IPaths operations, string accountName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.GetEmptyWithHttpMessagesAsync(accountName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
コード例 #27
0
ファイル: PathsExtensions.cs プロジェクト: iouri-s/autorest
 /// <summary>
 /// Get '-10000000000' 64 bit integer value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='longPath'>
 /// '-10000000000' 64 bit integer value
 /// </param>
 public static void GetNegativeTenBillion(this IPaths operations, long?longPath)
 {
     Task.Factory.StartNew(s => ((IPaths)s).GetNegativeTenBillionAsync(longPath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
コード例 #28
0
 /// <summary>
 /// Get null as date-time, should be disallowed or throw depending on
 /// representation of date-time
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='dateTimePath'>
 /// null as date-time
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DateTimeNullAsync(this IPaths operations, DateTime?dateTimePath, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.DateTimeNullWithHttpMessagesAsync(dateTimePath, null, cancellationToken).ConfigureAwait(false);
 }
コード例 #29
0
		internal void SetServerPortAndUrlConfig(IPaths paths, int port)
		{
			Trace.TraceInformation("Setting Neo4j server port and uri settings.");

			var neo4JServerConfigSettings = paths.Neo4jServerConfigSettings;

			var patternToFind = string.Format("{0}=", neo4JServerConfigSettings.Port);
			var lineToInsert = string.Format("{0}{1}", patternToFind, port);
			var replacement1 = Replacement.Create(patternToFind, lineToInsert);

			const string portPattern = "%%port%%";
			string portString = port.ToString();

			string neo4JAdminDataUri = paths.Neo4jAdminDataUri;
			patternToFind = string.Format("{0}=", neo4JServerConfigSettings.WebAdminDataUri);
			string webAdminDataUri = neo4JAdminDataUri.Replace(portPattern, portString);
			lineToInsert = string.Format("{0}{1}", patternToFind, webAdminDataUri);
			var replacement2 = Replacement.Create(patternToFind, lineToInsert);

			string neo4JAdminManagementUri = paths.Neo4jAdminManagementUri;
			patternToFind = string.Format("{0}=", neo4JServerConfigSettings.WebAdminManagementUri);
			string webAdminManagementUri = neo4JAdminManagementUri.Replace(portPattern, portString);
			lineToInsert = string.Format("{0}{1}", patternToFind, webAdminManagementUri);
			var replacement3 = Replacement.Create(patternToFind, lineToInsert);

		    patternToFind = "#org.neo4j.server.webserver.address=0.0.0.0";
            lineToInsert = "org.neo4j.server.webserver.address=0.0.0.0";
            var replacement4 = Replacement.Create(patternToFind, lineToInsert);

			var fileName = paths.Neo4jServerConfigPath;
            fileManipulation.ReplaceConfigLine(fileName, replacement1, replacement2, replacement3, replacement4);

			Trace.TraceInformation("Finished setting Neo4j server port and uri settings.");
		}
コード例 #30
0
ファイル: PathsExtensions.cs プロジェクト: iouri-s/autorest
 /// <summary>
 /// Get '-1000000' integer value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='intPath'>
 /// '-1000000' integer value
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task GetIntNegativeOneMillionAsync(this IPaths operations, int?intPath, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.GetIntNegativeOneMillionWithHttpMessagesAsync(intPath, null, cancellationToken).ConfigureAwait(false);
 }
コード例 #31
0
 /// <summary>
 /// Get '2012-01-01T01:01:01Z' as date-time
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DateTimeValidAsync(this IPaths operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DateTimeValidWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
コード例 #32
0
ファイル: PathsExtensions.cs プロジェクト: iouri-s/autorest
 /// <summary>
 /// Get '-10000000000' 64 bit integer value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='longPath'>
 /// '-10000000000' 64 bit integer value
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task GetNegativeTenBillionAsync(this IPaths operations, long?longPath, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.GetNegativeTenBillionWithHttpMessagesAsync(longPath, null, cancellationToken).ConfigureAwait(false);
 }
コード例 #33
0
 /// <summary>
 /// Get null as date-time, should be disallowed or throw depending on
 /// representation of date-time
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='dateTimePath'>
 /// null as date-time
 /// </param>
 public static void DateTimeNull(this IPaths operations, System.DateTime dateTimePath)
 {
     operations.DateTimeNullAsync(dateTimePath).GetAwaiter().GetResult();
 }
コード例 #34
0
ファイル: PathsExtensions.cs プロジェクト: iouri-s/autorest
 /// <summary>
 /// Get '-1.034E-20' numeric value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='floatPath'>
 /// '-1.034E-20'numeric value
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task FloatScientificNegativeAsync(this IPaths operations, double?floatPath, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.FloatScientificNegativeWithHttpMessagesAsync(floatPath, null, cancellationToken).ConfigureAwait(false);
 }
コード例 #35
0
 /// <summary>
 /// Get 'lorem' encoded value as 'bG9yZW0' (base64url)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='base64UrlPath'>
 /// base64url encoded value
 /// </param>
 public static void Base64Url(this IPaths operations, byte[] base64UrlPath)
 {
     operations.Base64UrlAsync(base64UrlPath).GetAwaiter().GetResult();
 }
コード例 #36
0
ファイル: PathsExtensions.cs プロジェクト: iouri-s/autorest
 /// <summary>
 /// Get '-9999999.999' numeric value
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='doublePath'>
 /// '-9999999.999'numeric value
 /// </param>
 public static void DoubleDecimalNegative(this IPaths operations, double?doublePath)
 {
     Task.Factory.StartNew(s => ((IPaths)s).DoubleDecimalNegativeAsync(doublePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
コード例 #37
0
 /// <summary>
 /// Get 'lorem' encoded value as 'bG9yZW0' (base64url)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='base64UrlPath'>
 /// base64url encoded value
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task Base64UrlAsync(this IPaths operations, byte[] base64UrlPath, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.Base64UrlWithHttpMessagesAsync(base64UrlPath, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
コード例 #38
0
ファイル: PathsExtensions.cs プロジェクト: iouri-s/autorest
 /// <summary>
 /// Get null (should throw)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='stringPath'>
 /// null string value
 /// </param>
 public static void StringNull(this IPaths operations, string stringPath)
 {
     Task.Factory.StartNew(s => ((IPaths)s).StringNullAsync(stringPath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
コード例 #39
0
 /// <summary>
 /// Get an array of string ['ArrayPath1', 'begin!*'();:@ &amp;=+$,/?#[]end' ,
 /// null, ''] using the csv-array format
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='arrayPath'>
 /// an array of string ['ArrayPath1', 'begin!*'();:@ &amp;=+$,/?#[]end' , null,
 /// ''] using the csv-array format
 /// </param>
 public static void ArrayCsvInPath(this IPaths operations, IList <string> arrayPath)
 {
     operations.ArrayCsvInPathAsync(arrayPath).GetAwaiter().GetResult();
 }
コード例 #40
0
ファイル: PathsExtensions.cs プロジェクト: iouri-s/autorest
 /// <summary>
 /// Get true Boolean value on path
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='boolPath'>
 /// true boolean value
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task GetBooleanTrueAsync(this IPaths operations, bool?boolPath, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.GetBooleanTrueWithHttpMessagesAsync(boolPath, null, cancellationToken).ConfigureAwait(false);
 }
コード例 #41
0
 /// <summary>
 /// Get an array of string ['ArrayPath1', 'begin!*'();:@ &amp;=+$,/?#[]end' ,
 /// null, ''] using the csv-array format
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='arrayPath'>
 /// an array of string ['ArrayPath1', 'begin!*'();:@ &amp;=+$,/?#[]end' , null,
 /// ''] using the csv-array format
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task ArrayCsvInPathAsync(this IPaths operations, IList <string> arrayPath, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.ArrayCsvInPathWithHttpMessagesAsync(arrayPath, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
コード例 #42
0
ファイル: PathsExtensions.cs プロジェクト: iouri-s/autorest
 /// <summary>
 /// Get null (should throw on the client before the request is sent on wire)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='enumPath'>
 /// send null should throw. Possible values for this parameter include: 'red
 /// color', 'green color', 'blue color'
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task EnumNullAsync(this IPaths operations, UriColor?enumPath, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.EnumNullWithHttpMessagesAsync(enumPath, null, cancellationToken).ConfigureAwait(false);
 }
コード例 #43
0
 /// <summary>
 /// Get the date 2016-04-13 encoded value as '1460505600' (Unix time)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='unixTimeUrlPath'>
 /// Unix time encoded value
 /// </param>
 public static void UnixTimeUrl(this IPaths operations, System.DateTime unixTimeUrlPath)
 {
     operations.UnixTimeUrlAsync(unixTimeUrlPath).GetAwaiter().GetResult();
 }
コード例 #44
0
ファイル: PathsExtensions.cs プロジェクト: iouri-s/autorest
 /// <summary>
 /// Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='bytePath'>
 /// '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task ByteMultiByteAsync(this IPaths operations, byte[] bytePath, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.ByteMultiByteWithHttpMessagesAsync(bytePath, null, cancellationToken).ConfigureAwait(false);
 }
コード例 #45
0
 /// <summary>
 /// Get the date 2016-04-13 encoded value as '1460505600' (Unix time)
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='unixTimeUrlPath'>
 /// Unix time encoded value
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task UnixTimeUrlAsync(this IPaths operations, System.DateTime unixTimeUrlPath, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.UnixTimeUrlWithHttpMessagesAsync(unixTimeUrlPath, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }