string.Format(System.IFormatProvider, string, object, object)

Here are the examples of the csharp api string.Format(System.IFormatProvider, string, object, object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

928 Examples 7

19 View Source File : MetadataEntry.cs
License : MIT License
Project Creator : 0xC0000054

public PaintDotNet.Imaging.ExifPropertyItem CreateExifPropertyItem()
        {
            PaintDotNet.Imaging.ExifSection exifSection;
            switch (this.Section)
            {
                case MetadataSection.Image:
                    exifSection = PaintDotNet.Imaging.ExifSection.Image;
                    break;
                case MetadataSection.Exif:
                    exifSection = PaintDotNet.Imaging.ExifSection.Photo;
                    break;
                case MetadataSection.Gps:
                    exifSection = PaintDotNet.Imaging.ExifSection.GpsInfo;
                    break;
                case MetadataSection.Interop:
                    exifSection = PaintDotNet.Imaging.ExifSection.Interop;
                    break;
                default:
                    throw new InvalidOperationException(string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                                                      "Unexpected {0} type: {1}",
                                                                      nameof(MetadataSection),
                                                                      (int)this.Section));
            }

            return new PaintDotNet.Imaging.ExifPropertyItem(exifSection,
                                                            this.TagId,
                                                            new PaintDotNet.Imaging.ExifValue((PaintDotNet.Imaging.ExifValueType)this.Type,
                                                                                              (byte[])this.data.Clone()));
        }

19 View Source File : RawFileType.cs
License : MIT License
Project Creator : 0xC0000054

private static Doreplacedent GetRAWImageDoreplacedent(string file)
        {
            Doreplacedent doc = null;

            string options = GetDCRawOptions();
            // Set the -Z - option to tell the LibRaw dcraw-emu example program
            // that the image data should be written to standard output.
            string arguments = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0} -Z - \"{1}\"", options, file);
            ProcessStartInfo startInfo = new ProcessStartInfo(ExecutablePath, arguments)
            {
                UseShellExecute = false,
                CreateNoWindow = true,
                RedirectStandardOutput = true,
                RedirectStandardError = true
            };
            bool useTIFF = options.Contains("-T");

            using (Process process = new Process())
            {
                process.StartInfo = startInfo;
                process.Start();

                if (useTIFF)
                {
                    using (Bitmap image = new Bitmap(process.StandardOutput.BaseStream))
                    {
                        doc = Doreplacedent.FromImage(image);
                    }
                }
                else
                {
                    using (PixMapReader reader = new PixMapReader(process.StandardOutput.BaseStream, leaveOpen: true))
                    {
                        doc = reader.DecodePNM();
                    }
                }

                process.WaitForExit();
            }

            return doc;
        }

19 View Source File : AvifFile.cs
License : MIT License
Project Creator : 0xC0000054

private static Dictionary<MetadataKey, MetadataEntry> GetExifMetadataFromDoreplacedent(Doreplacedent doc)
        {
            Dictionary<MetadataKey, MetadataEntry> items = null;

            Metadata metadata = doc.Metadata;

            ExifPropertyItem[] exifProperties = metadata.GetExifPropertyItems();

            if (exifProperties.Length > 0)
            {
                items = new Dictionary<MetadataKey, MetadataEntry>(exifProperties.Length);

                foreach (ExifPropertyItem property in exifProperties)
                {
                    MetadataSection section;
                    switch (property.Path.Section)
                    {
                        case ExifSection.Image:
                            section = MetadataSection.Image;
                            break;
                        case ExifSection.Photo:
                            section = MetadataSection.Exif;
                            break;
                        case ExifSection.Interop:
                            section = MetadataSection.Interop;
                            break;
                        case ExifSection.GpsInfo:
                            section = MetadataSection.Gps;
                            break;
                        default:
                            throw new InvalidOperationException(string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                                                              "Unexpected {0} type: {1}",
                                                                              nameof(ExifSection),
                                                                              (int)property.Path.Section));
                    }

                    MetadataKey metadataKey = new MetadataKey(section, property.Path.TagID);

                    if (!items.ContainsKey(metadataKey))
                    {
                        byte[] clonedData = PaintDotNet.Collections.EnumerableExtensions.ToArrayEx(property.Value.Data);

                        items.Add(metadataKey, new MetadataEntry(metadataKey, (TagDataType)property.Value.Type, clonedData));
                    }
                }
            }

            return items;
        }

19 View Source File : OutputImageUtil.cs
License : GNU General Public License v3.0
Project Creator : 0xC0000054

public static void SaveAllToFolder(IReadOnlyList<Surface> outputImages, string outputFolder)
        {
            if (outputImages is null)
            {
                ExceptionUtil.ThrowArgumentNullException(nameof(outputImages));
            }

            if (outputFolder is null)
            {
                ExceptionUtil.ThrowArgumentNullException(nameof(outputFolder));
            }

            DirectoryInfo directoryInfo = new DirectoryInfo(outputFolder);

            if (!directoryInfo.Exists)
            {
                directoryInfo.Create();
            }

            string currentTime = DateTime.Now.ToString("yyyyMMdd-THHmmss");

            for (int i = 0; i < outputImages.Count; i++)
            {
                string imageName = string.Format(CultureInfo.InvariantCulture, "{0}-{1}.png", currentTime, i);

                string path = Path.Combine(outputFolder, imageName);

                using (FileStream stream = new FileStream(path, FileMode.Create, FileAccess.Write))
                {
                    using (System.Drawing.Bitmap image = outputImages[i].CreateAliasedBitmap())
                    {
                        image.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
                    }
                }
            }
        }

19 View Source File : MetadataEntry.cs
License : MIT License
Project Creator : 0xC0000054

public PaintDotNet.Imaging.ExifPropertyItem CreateExifPropertyItem()
        {
            PaintDotNet.Imaging.ExifSection exifSection;
            switch (Section)
            {
                case MetadataSection.Image:
                    exifSection = PaintDotNet.Imaging.ExifSection.Image;
                    break;
                case MetadataSection.Exif:
                    exifSection = PaintDotNet.Imaging.ExifSection.Photo;
                    break;
                case MetadataSection.Gps:
                    exifSection = PaintDotNet.Imaging.ExifSection.GpsInfo;
                    break;
                case MetadataSection.Interop:
                    exifSection = PaintDotNet.Imaging.ExifSection.Interop;
                    break;
                default:
                    throw new InvalidOperationException(string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                                                      "Unexpected {0} type: {1}",
                                                                      nameof(MetadataSection),
                                                                      (int)Section));
            }

            return new PaintDotNet.Imaging.ExifPropertyItem(exifSection,
                                                            TagId,
                                                            new PaintDotNet.Imaging.ExifValue((PaintDotNet.Imaging.ExifValueType)Type,
                                                                                              (byte[])data.Clone()));
        }

19 View Source File : WebPFile.cs
License : MIT License
Project Creator : 0xC0000054

private static Dictionary<MetadataKey, MetadataEntry> GetMetadataFromDoreplacedent(Doreplacedent doc)
        {
            Dictionary<MetadataKey, MetadataEntry> items = null;

            Metadata metadata = doc.Metadata;
            PaintDotNet.Imaging.ExifPropertyItem[] exifProperties = metadata.GetExifPropertyItems();

            if (exifProperties.Length > 0)
            {
                items = new Dictionary<MetadataKey, MetadataEntry>(exifProperties.Length);

                foreach (PaintDotNet.Imaging.ExifPropertyItem property in exifProperties)
                {
                    MetadataSection section;
                    switch (property.Path.Section)
                    {
                        case PaintDotNet.Imaging.ExifSection.Image:
                            section = MetadataSection.Image;
                            break;
                        case PaintDotNet.Imaging.ExifSection.Photo:
                            section = MetadataSection.Exif;
                            break;
                        case PaintDotNet.Imaging.ExifSection.Interop:
                            section = MetadataSection.Interop;
                            break;
                        case PaintDotNet.Imaging.ExifSection.GpsInfo:
                            section = MetadataSection.Gps;
                            break;
                        default:
                            throw new InvalidOperationException(string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                                                              "Unexpected {0} type: {1}",
                                                                              nameof(PaintDotNet.Imaging.ExifSection),
                                                                              (int)property.Path.Section));
                    }

                    MetadataKey metadataKey = new MetadataKey(section, property.Path.TagID);

                    if (!items.ContainsKey(metadataKey))
                    {
                        byte[] clonedData = PaintDotNet.Collections.EnumerableExtensions.ToArrayEx(property.Value.Data);

                        items.Add(metadataKey, new MetadataEntry(metadataKey, (TagDataType)property.Value.Type, clonedData));
                    }
                }
            }

            return items;
        }

19 View Source File : Vector2d.cs
License : MIT License
Project Creator : 734843327

public override string ToString()
        {
            return string.Format(NumberFormatInfo.InvariantInfo, "{0:F5},{1:F5}", this.y, this.x);
        }

19 View Source File : Half.cs
License : MIT License
Project Creator : 91Act

char IConvertible.ToChar(IFormatProvider provider)
        {
            throw new InvalidCastException(string.Format(CultureInfo.CurrentCulture, "Invalid cast from '{0}' to '{1}'.", "Half", "Char"));
        }

19 View Source File : Half.cs
License : MIT License
Project Creator : 91Act

DateTime IConvertible.ToDateTime(IFormatProvider provider)
        {
            throw new InvalidCastException(string.Format(CultureInfo.CurrentCulture, "Invalid cast from '{0}' to '{1}'.", "Half", "DateTime"));
        }

19 View Source File : BTCChinaWebSocketApi.cs
License : MIT License
Project Creator : aabiryukov

private void btc_MessageReceived(object sender, MessageReceivedEventArgs e)
		{
			int eioMessageType;
			if (int.TryParse(e.Message.Substring(0, 1), out eioMessageType))
			{
				switch ((EngineioMessageType)eioMessageType)
				{
					case EngineioMessageType.PING:
						//replace incoming PING with PONG in incoming message and resend it.
						m_webSocket.Send(string.Format(CultureInfo.InvariantCulture, "{0}{1}", (int)EngineioMessageType.PONG, e.Message.Substring(1, e.Message.Length - 1)));
						break;
					case EngineioMessageType.PONG:
						m_pong = true;
						break;

					case EngineioMessageType.MESSAGE:
						int sioMessageType;
						if (int.TryParse(e.Message.Substring(1, 1), out sioMessageType))
						{
							switch ((SocketioMessageType)sioMessageType)
							{
								case SocketioMessageType.CONNECT:
									//Send "42["subscribe",["marketdata_cnybtc","marketdata_cnyltc","marketdata_btcltc"]]"
									m_webSocket.Send(string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}", (int)EngineioMessageType.MESSAGE,
																	   (int)SocketioMessageType.EVENT,
//																	   "[\"subscribe\",[\"marketdata_cnybtc\",\"marketdata_cnyltc\",\"grouporder_cnybtc\"]]"
																	   "[\"subscribe\",[\"grouporder_cnybtc\"]]"
																	   )
																	   );

									break;

								case SocketioMessageType.EVENT:
									if (e.Message.Substring(4, 5) == "trade")//listen on "trade"
										Log.Info("[BtcChina] TRADE: " + e.Message.Substring(e.Message.IndexOf('{'), e.Message.LastIndexOf('}') - e.Message.IndexOf('{') + 1));
									else
										if (e.Message.Substring(4, 10) == "grouporder")//listen on "trade")
										{
											Log.Info("[BtcChina] grouporder event");

											var json = e.Message.Substring(e.Message.IndexOf('{'), e.Message.LastIndexOf('}') - e.Message.IndexOf('{') + 1);
											var objResponse = JsonConvert.DeserializeObject<WsGroupOrderMessage>(json);
											OnMessageGroupOrder(objResponse.GroupOrder);
										}
										else
										{
											Log.Warn("[BtcChina] Unknown message: " + e.Message.Substring(0, 100));
										}
									break;

								default:
									Log.Error("[BtcChina] error switch socket.io messagetype: " + e.Message);
									break;
							}
						}
						else
						{
							Log.Error("[BtcChina] error parse socket.io messagetype!");
						}
						break;

					default:
						Log.Error("[BtcChina] error switch engine.io messagetype");
						break;
				}
			}
			else
			{
				Log.Error("[BtcChina] error parsing engine.io messagetype!");
			}
		}

19 View Source File : BTCChinaWebSocketApi.cs
License : MIT License
Project Creator : aabiryukov

private void btc_Opened(object sender, EventArgs e)
		{
			//send upgrade message:"52"
			//server responses with message: "40" - message/connect
			Log.Info("[BtcChina] Websocket opened.");
			m_webSocket.Send(string.Format(CultureInfo.InvariantCulture, "{0}{1}", (int)EngineioMessageType.UPGRADE, (int)SocketioMessageType.EVENT));
		}

19 View Source File : Balance.cs
License : MIT License
Project Creator : aabiryukov

public override string ToString()
		{
			return string.Format(CultureInfo.CurrentCulture, "{0}$ {1}btc", Usd, Btc);
		}

19 View Source File : OrderBook.cs
License : MIT License
Project Creator : aabiryukov

public override string ToString()
		{
			return string.Format(CultureInfo.CurrentCulture, "P: {0} A: {1}", Price, Amount);
		}

19 View Source File : HistoryViewer.cs
License : MIT License
Project Creator : aabiryukov

[System.Diagnostics.Codereplacedysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
		private void ExecViewHistory(Uri tfsCollectionUri, string sourceControlFolder)
        {
            // gource start arguments
            string arguments;
            string replacedle;
			string avatarsDirectory = null;

            if (m_settigs.PlayMode == VisualizationSettings.PlayModeOption.History)
            {
                replacedle = "History of " + sourceControlFolder;
				var logFile = Path.Combine(FileUtils.GetTempPath(), "TfsHistoryLog.tmp.txt");
	            
	            if (m_settigs.ViewAvatars)
	            {
		            avatarsDirectory = Path.Combine(FileUtils.GetTempPath(), "TfsHistoryLog.tmp.Avatars");
					if (!Directory.Exists(avatarsDirectory))
		            {
			            Directory.CreateDirectory(avatarsDirectory);
		            }
	            }

				bool historyFound;
				bool hasLines;

                using (var waitMessage = new WaitMessage("Connecting to Team Foundation Server...", OnCancelByUser))
                {
                    var progress = waitMessage.CreateProgress("Loading history ({0}% done) ...");

                    hasLines =
                        TfsLogWriter.CreateGourceLogFile(
                            logFile,
							avatarsDirectory,
                            tfsCollectionUri,
                            sourceControlFolder,
                            m_settigs,
                            ref m_canceled,
                            progress.SetValue
                            );

	                historyFound = progress.LastValue > 0;
                    progress.Done();
                }

                if (m_canceled)
					return;

                if (!hasLines)
                {
	                MessageBox.Show(
		                historyFound
			                ? "No items found.\nCheck your filters: 'User name' and 'File type'."
							: "No items found.\nTry to change period of the history (From/To dates).",
		                "TFS History Visualization");
	                return;
                }

	            arguments = string.Format(CultureInfo.InvariantCulture, " \"{0}\" ", logFile);

                // Setting other history settings

                arguments += " --seconds-per-day " + m_settigs.SecondsPerDay.ToString(CultureInfo.InvariantCulture);

                if (m_settigs.TimeScale != VisualizationSettings.TimeScaleOption.None)
                {
                    var optionValue = ConvertToString(m_settigs.TimeScale);
                    if (optionValue != null)
                        arguments += " --time-scale " + optionValue;
                }

                if (m_settigs.LoopPlayback)
                {
                    arguments += " --loop";
                }

				arguments += " --file-idle-time 60"; // 60 is default in gource 0.40 and older. Since 0.41 default 0.
            }
            else
            {
                // PlayMode: Live
                replacedle = "Live changes of " + sourceControlFolder;

                arguments = " --realtime --log-format custom -";
                arguments += " --file-idle-time 28800"; // 8 hours (work day)
            }

            var baseDirectory = Path.GetDirectoryName(System.Reflection.replacedembly.GetExecutingreplacedembly().Location) ??
                                "unknown";


            if (baseDirectory.Contains("Test"))
            {
                baseDirectory += @"\..\..\..\VSExtension";
            }

#if DEBUG
			// baseDirectory = @"C:\Temp\aaaa\уи³пс\";
#endif
            var gourcePath = Path.Combine(baseDirectory, @"Gource\Gource.exe");
            var dataPath = Path.Combine(baseDirectory, @"Data");

            // ******************************************************
            // Configuring Gource command line
            // ******************************************************

            arguments +=
                string.Format(CultureInfo.InvariantCulture, " --highlight-users --replacedle \"{0}\"", replacedle);

			if (m_settigs.ViewLogo != CheckState.Unchecked)
			{
				var logoFile = m_settigs.ViewLogo == CheckState.Indeterminate
					? Path.Combine(dataPath, "Logo.png")
					: m_settigs.LogoFileName;

				// fix gource unicode path problems
				logoFile = FileUtils.GetShortPath(logoFile);

				arguments += string.Format(CultureInfo.InvariantCulture, " --logo \"{0}\"", logoFile);
			}

            if (m_settigs.FullScreen)
            {
                arguments += " --fullscreen";

				// By default gource not using full area of screen width ( It's a bug. Must be fixed in gource 0.41).
				// Fixing fullscreen resolution to real full screen.
				if (!m_settigs.SetResolution)
				{
					var screenBounds = Screen.PrimaryScreen.Bounds;
					arguments += string.Format(CultureInfo.InvariantCulture, " --viewport {0}x{1}", screenBounds.Width,
											   screenBounds.Height);
				}
			}

            if (m_settigs.SetResolution)
            {
                arguments += string.Format(CultureInfo.InvariantCulture, " --viewport {0}x{1}",
                                           m_settigs.ResolutionWidth, m_settigs.ResolutionHeight);
            }

            if (m_settigs.ViewFilesExtentionMap)
            {
                arguments += " --key";
            }

			if (!string.IsNullOrEmpty(avatarsDirectory))
			{
				arguments += string.Format(CultureInfo.InvariantCulture, " --user-image-dir \"{0}\"", avatarsDirectory);
			}

            // Process "--hide" option
            {
                var hideItems = string.Empty;
                if (!m_settigs.ViewDirNames)
                {
                    hideItems = "dirnames";
                }
                if (!m_settigs.ViewFileNames)
                {
                    if (hideItems.Length > 0) hideItems += ",";
                    hideItems += "filenames";
                }
                if (!m_settigs.ViewUserNames)
                {
                    if (hideItems.Length > 0) hideItems += ",";
                    hideItems += "usernames";
                }

                if (hideItems.Length > 0)
                    arguments += " --hide " + hideItems;
            }

            arguments += " --max-files " + m_settigs.MaxFiles.ToString(CultureInfo.InvariantCulture);

			if (SystemInformation.TerminalServerSession)
			{
				arguments += " --disable-bloom";
			}

			if (m_settigs.PlayMode == VisualizationSettings.PlayModeOption.History)
            {
                var si = new ProcessStartInfo(gourcePath, arguments)
                    {
                        WindowStyle = ProcessWindowStyle.Maximized,
 //                       UseShellExecute = true
					};

                Process.Start(si);
            }
            else
            {
                var logReader = new VersionControlLogReader(tfsCollectionUri, sourceControlFolder, m_settigs.UsersFilter,
                                                     m_settigs.FilesFilter);
                using (new WaitMessage("Connecting to Team Foundation Server..."))
                {
                    logReader.Connect();
                }

                System.Threading.Tasks.Task.Factory.StartNew(() => RunLiveChangesMonitor(logReader, gourcePath, arguments));
            }
        }

19 View Source File : MessageHelper.cs
License : MIT License
Project Creator : aabiryukov

public static void ShowShellErrorMessage(IVsUIShell uiShell, Exception ex)
        {
            ShowShellErrorMessage(uiShell, string.Format(CultureInfo.CurrentCulture, "{0}\n\nDetails:\n{1}", ex.Message, ex));
        }

19 View Source File : WexApi.cs
License : MIT License
Project Creator : aabiryukov

private static T DeserializeBtceObject<T>(string json)
			where T: clreplaced 
		{
//			CheckError(json);
			var returnData = JsonConvert.DeserializeObject<ReturnData<T>>(json);

			if (returnData.Success != 1)
			{
				throw new WexApiException(string.Format(CultureInfo.CurrentCulture, "Wex error [succ={0}]: {1}", returnData.Success, returnData.ErrorText));
			}

			if (returnData.Object == null)
			{
				throw new WexApiException(string.Format(CultureInfo.CurrentCulture, "Wex error [succ={0}, type={1}]: Returned object is null", returnData.Success, typeof(T)));
			}

			return returnData.Object;
		}

19 View Source File : BTCChinaWebSocketApi.cs
License : MIT License
Project Creator : aabiryukov

public void Stop()
		{
			if (m_webSocket == null)
				return;

			//close the connection.
			m_webSocket.Send(string.Format(CultureInfo.InvariantCulture, "{0}{1}", (int)EngineioMessageType.MESSAGE, (int)SocketioMessageType.DISCONNECT));
//			Thread.Sleep(100);

			using (var timerDisposed = new ManualResetEvent(false))
			{
				m_pingIntervalTimer.Dispose(timerDisposed);
				timerDisposed.WaitOne();
				m_pingIntervalTimer = null;
			}

			using (var timerDisposed = new ManualResetEvent(false))
			{
				m_pingTimeoutTimer.Dispose(timerDisposed);
				timerDisposed.WaitOne();
				m_pingTimeoutTimer = null;
			}

			m_webSocket.Close();
			m_webSocket.Dispose();
			m_webSocket = null;
		}

19 View Source File : WexApi.cs
License : MIT License
Project Creator : aabiryukov

private static string Query(string method, IEnumerable<WexPair> pairlist, Dictionary<string, string> args = null)
        {
            var pairliststr = MakePairListString(pairlist);
            var sb = new StringBuilder();
            sb.Append(WebApi.RootUrl + "/api/3/");
            sb.Append(method);
            sb.Append("/");
            sb.Append(pairliststr);
            if (args != null && args.Count > 0)
            {
                sb.Append("?");
				var arr = args.Select(x => string.Format(CultureInfo.InvariantCulture, "{0}={1}", WebUtility.UrlEncode(x.Key), WebUtility.UrlEncode(x.Value))).ToArray();
                sb.Append(string.Join("&", arr));
            }
            var queryStr = sb.ToString();
            return WebApi.Query(queryStr);
        }

19 View Source File : TextLocation.cs
License : MIT License
Project Creator : Abdesol

public override string ToString()
		{
			return string.Format(CultureInfo.InvariantCulture, "(Line {1}, Col {0})", this.column, this.line);
		}

19 View Source File : NominatedArchitect.cs
License : GNU Lesser General Public License v3.0
Project Creator : acnicholas

public override string ToString()
        {
            return string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0};{1}", Name, Id);
        }

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

private void WriteError(int exitCode)
        {
            String diagFolder = GetDiagnosticFolderPath();
            String eventText = String.Format(
                CultureInfo.InvariantCulture,
                "The Runner.Listener process failed to start successfully. It exited with code {0}. Check the latest Runner log files in {1} for more information.",
                exitCode,
                diagFolder);

            WriteToEventLog(eventText, EventLogEntryType.Error);
        }

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

public static string ContainerItemWithDifferentTypeExists(object arg0, object arg1)
        {
            const string Format = @"The items could not be created because an item with type {0} already exists at {1}.";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string ContainerItemDoesNotExist(object arg0, object arg1)
        {
            const string Format = @"The item {0} of type {1} could not be found.";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string ResourceNotFoundOnServerMessage(object arg0, object arg1)
        {
            const string Format = @"API resource location {0} is not registered on {1}.";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string ServiceDefinitionDoesNotExist(object arg0, object arg1)
        {
            const string Format = @"The service definition with service type '{0}' and identifier '{1}' does not exist.";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

private static string Format(CultureInfo culture, string format, params object[] args)
        {
            try
            {
                // 1) Protect against argument null exception for the format parameter.
                // 2) Protect against argument null exception for the args parameter.
                // 3) Coalesce null or empty args with an array containing one null element.
                //    This protects against format exceptions where string.Format thinks
                //    that not enough arguments were supplied, even though the intended arg
                //    literally is null or an empty array.
                return string.Format(
                    culture,
                    format ?? string.Empty,
                    args == null || args.Length == 0 ? s_defaultFormatArgs : args);
            }
            catch (FormatException)
            {
                // TODO: Log that string format failed. Consider moving this into a context base clreplaced if that's the only place it's used. Then the current trace scope would be available as well.
                if (args != null)
                {
                    return string.Format(culture, "{0} {1}", format, string.Join(", ", args));
                }

                return format;
            }
        }

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

public static string PropertyArgumentExceededMaximumSizeAllowed(object arg0, object arg1)
        {
            const string Format = @"The argument '{0}' is too long. It must not contain more than '{1}' characters.";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string ErrorReadingFile(object arg0, object arg1)
        {
            const string Format = @"Error reading file: {0} ({1}).";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string DoubleValueOutOfRange(object arg0, object arg1)
        {
            const string Format = @"Property '{0}' with value '{1}' is out of range for the Team Foundation Properties service. Double values must be 0, within -1.79E+308 to -2.23E-308, or within 2.23E-308 to 1.79E+308.";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string XmlAttributeEmpty(object arg0, object arg1)
        {
            const string Format = @"The attribute '{0}' on node '{1}' cannot be empty";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string XmlAttributeNull(object arg0, object arg1)
        {
            const string Format = @"The node '{0}' must only have the attribute '{1}'";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string XmlNodeEmpty(object arg0, object arg1)
        {
            const string Format = @"The xml node '{0}' under node '{1}' cannot be empty";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string XmlNodeMissing(object arg0, object arg1)
        {
            const string Format = @"The mandatory xml node '{0}' is missing under '{1}'.";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string VssUnsupportedPropertyValueType(object arg0, object arg1)
        {
            const string Format = @"Property '{0}' of type '{1}' is not supported by the Properties service. Convert the value to an Int32, DateTime, Double, String or Byte array for storage.";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string BothStringsCannotBeNull(object arg0, object arg1)
        {
            const string Format = @"One of the following values must not be null or String.Empty: {0}, {1}.";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string ContainerItemCopyTargetChildOfSource(object arg0, object arg1)
        {
            const string Format = @"The target folder {0} of the copy operation is a child of the source folder {1}.";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string UnexpectedContentType(object arg0, object arg1)
        {
            const string Format = @"Requested content type {0} but got back content type {1}.";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string DigestUnsupportedException(object arg0, object arg1)
        {
            const string Format = @"JsonWebTokens support only the {0} Digest, but the signing credentials specify {1}.";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string InvalidValue(object arg0, object arg1)
        {
            const string Format = @"Value {0} does not match the expected type {1}.";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string InvalidAclStoreException(object arg0, object arg1)
        {
            const string Format = @"The ACL store with identifier '{1}' was not found in the security namespace '{0}'.";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string ExtensibleServiceTypeNotValid(object arg0, object arg1)
        {
            const string Format = @"'{1}' does not extend or implement the service type '{0}'.";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string ApiVersionOutOfRangeForRoutes(object arg0, object arg1)
        {
            const string Format = @"The following routes matched, but the requested REST API version {0} was outside the valid version ranges: {1}";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string UnexpectedType(object arg0, object arg1)
        {
            const string Format = @"Expecting '{0}' to be of type '{1}'.";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string UriUtility_MustBeAuthorityOnlyUri(object arg0, object arg1)
        {
            const string Format = @"The following URL is not valid: {0}. Try removing any relative path information from the URL (for example, {1}).";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string InvalidClientStoragePath(object arg0, object arg1)
        {
            const string Format = @"The storage path specified is invalid: '{0}'  This storage path cannot be null or empty. It should begin with the '{1}' path separator character, and have no empty path segments.";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string CollectionSizeLimitExceeded(object arg0, object arg1)
        {
            const string Format = @"Collection '{0}' can have maximum '{1}' elements.";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string InvalidFormatSpecifiers(object arg0, object arg1)
        {
            const string Format = @"The format specifiers '{0}' are not valid for objects of type '{1}'";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string ContainerItemNotFoundException(object arg0, object arg1)
        {
            const string Format = @"The item {0} in container {1} could not be found.";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string InvalidRegexOptions(object arg0, object arg1)
        {
            const string Format = @"Provider regex options '{0}' are invalid. Supported combination of flags: `{1}`. Eg: 'IgnoreCase, Multiline', 'Multiline'";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

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

public static string RegexFailed(object arg0, object arg1)
        {
            const string Format = @"Regular expression failed evaluating '{0}' : {1}";
            return string.Format(CultureInfo.CurrentCulture, Format, arg0, arg1);
        }

See More Examples