string.Format(System.IFormatProvider, string, params object[])

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

200 Examples 7

1. Example

Project: vr-studies
Source File: RoomInfo.cs
View license
public string ToStringFull()
    {
        return string.Format("Room: '{0}' {1},{2} {4}/{3} players.\ncustomProps: {5}", this.nameField, this.visibleField ? "visible" : "hidden", this.openField ? "open" : "closed", this.maxPlayersField, this.PlayerCount, this.customPropertiesField.ToStringFull());
    }

2. Example

Project: vr-studies
Source File: CircularDrive.cs
View license
private void UpdateDebugText()
		{
			if ( debugText )
			{
				debugText.text = string.Format( "Linear: {0}\nAngle:  {1}\n", linearMapping.value, outAngle );
			}
		}

3. Example

Project: vr-studies
Source File: Room.cs
View license
public new string ToStringFull()
    {
        return string.Format("Room: '{0}' {1},{2} {4}/{3} players.\ncustomProps: {5}", this.nameField, this.visibleField ? "visible" : "hidden", this.openField ? "open" : "closed", this.maxPlayersField, this.PlayerCount, this.CustomProperties.ToStringFull());
    }

4. Example

Project: vr-studies
Source File: PhotonClasses.cs
View license
public string ToStringFull()
    {
        return string.Format("{0}={2}: {1} \"{3}\"", Name, SupportClassPun.DictionaryToString(Parameters), ReturnCode, DebugMessage);
    }

5. Example

Project: vr-studies
Source File: PhotonPlayer.cs
View license
public string ToStringFull()
    {
        return string.Format("#{0:00} '{1}'{2} {3}", this.ID, this.NickName, this.IsInactive ? " (inactive)" : "", this.CustomProperties.ToStringFull());
    }

6. Example

Project: vr-studies
Source File: Room.cs
View license
public override string ToString()
    {
        return string.Format("Room: '{0}' {1},{2} {4}/{3} players.", this.nameField, this.visibleField ? "visible" : "hidden", this.openField ? "open" : "closed", this.maxPlayersField, this.PlayerCount);
    }

7. Example

Project: vr-studies
Source File: CircularDrive.cs
View license
private void UpdateDebugText()
		{
			if ( debugText )
			{
				debugText.text = string.Format( "Linear: {0}\nAngle:  {1}\n", linearMapping.value, outAngle );
			}
		}

8. Example

Project: vr-studies
Source File: PhotonClasses.cs
View license
public override string ToString()
    {
        return string.Format("[PhotonMessageInfo: Sender='{1}' Senttime={0}]", this.timestamp, this.sender);
    }

9. Example

Project: vr-studies
Source File: PhotonPlayer.cs
View license
public string ToStringFull()
    {
        return string.Format("#{0:00} '{1}'{2} {3}", this.ID, this.NickName, this.IsInactive ? " (inactive)" : "", this.CustomProperties.ToStringFull());
    }

10. Example

View license
private void NetSimWindow(int windowId)
    {
        GUILayout.Label(string.Format("Rtt:{0,4} +/-{1/n ..... /n //View Source file for more details /n }

11. Example

View license
void OnGUI()
    {
        if (InputToEvent.goPointedAt != null)
        {
            PhotonView pv = InputToEvent.goPointedAt.GetPhotonView();
            if (pv != null)
            {
                GUI.Label(new Rect(Input.mousePosition.x + 5, Screen.height - Input.mousePosition.y - 15, 300, 30), string.Format("ViewID {0} {1}{2}", pv.viewID, (pv.isSceneView) ? "scene " : "", (pv.isMine) ? "mine" : "owner: " + pv.ownerId));
            }
        }
    }

12. Example

View license
private void NetSimWindow(int windowId)
    {
        GUILayout.Label(string.Format("Rtt:{0,4} +/-{1/n ..... /n //View Source file for more details /n }

13. Example

Project: vr-studies
Source File: Room.cs
View license
public override string ToString()
    {
        return string.Format("Room: '{0}' {1},{2} {4}/{3} players.", this.nameField, this.visibleField ? "visible" : "hidden", this.openField ? "open" : "closed", this.maxPlayersField, this.PlayerCount);
    }

14. Example

View license
void OnGUI()
    {
        if (InputToEvent.goPointedAt != null)
        {
            PhotonView pv = InputToEvent.goPointedAt.GetPhotonView();
            if (pv != null)
            {
                GUI.Label(new Rect(Input.mousePosition.x + 5, Screen.height - Input.mousePosition.y - 15, 300, 30), string.Format("ViewID {0} {1}{2}", pv.viewID, (pv.isSceneView) ? "scene " : "", (pv.isMine) ? "mine" : "owner: " + pv.ownerId));
            }
        }
    }

15. Example

Project: vr-studies
Source File: PhotonView.cs
View license
public override string ToString()
    {
        return string.Format("View ({3}){0} on {1} {2}", this.viewID, (this.gameObject != null) ? this.gameObject.name : "GO==null", (this.isSceneView) ? "(scene)" : string.Empty, this.prefix);
    }

16. Example

Project: vr-studies
Source File: PhotonClasses.cs
View license
public override string ToString()
    {
        return string.Format("[PhotonMessageInfo: Sender='{1}' Senttime={0}]", this.timestamp, this.sender);
    }

17. Example

Project: vr-studies
Source File: PhotonView.cs
View license
public override string ToString()
    {
        return string.Format("View ({3}){0} on {1} {2}", this.viewID, (this.gameObject != null) ? this.gameObject.name : "GO==null", (this.isSceneView) ? "(scene)" : string.Empty, this.prefix);
    }

18. Example

Project: vr-studies
Source File: RoomInfo.cs
View license
public string ToStringFull()
    {
        return string.Format("Room: '{0}' {1},{2} {4}/{3} players.\ncustomProps: {5}", this.nameField, this.visibleField ? "visible" : "hidden", this.openField ? "open" : "closed", this.maxPlayersField, this.PlayerCount, this.customPropertiesField.ToStringFull());
    }

19. Example

Project: vr-studies
Source File: PhotonClasses.cs
View license
public string ToStringFull()
    {
        return string.Format("{0}={2}: {1} \"{3}\"", Name, SupportClassPun.DictionaryToString(Parameters), ReturnCode, DebugMessage);
    }

20. Example

View license
public override string ToRegexPattern()
        {
            string result = string.Format(CultureInfo.InvariantCulture, "(?>{0})", InnerExpression.ToRegexPattern());
            if (HasQuantifier)
            {
                result += Quantifier.ToRegexPattern();
            }
            return result;
        }

21. Example

View license
public override string ToRegexPattern()
        {
            string format = string.Empty;
            switch (LookAroundType)
            {
                case RegexLookAround.PositiveLookAhead:
                    format = "(?:{1}(?={0}))";
                    break;
                case RegexLookAround.PositiveLookBehind:
                    format = "(?:(?<={0}){1})";
                    break;
                case RegexLookAround.NegativeLookAhead:
                    format = "(?:{1}(?!{0}))";
                    break;
                case RegexLookAround.NegativeLookBehind:
                    format = "(?:(?<!{0}){1})";
                    break;
            }

            string result = string.Format(CultureInfo.InvariantCulture, format, LookAroundExpression.ToRegexPattern(), MatchExpression.ToRegexPattern());
            if (HasQuantifier)
            {
                result += Quantifier.ToRegexPattern();
            }

            return result;
        }

22. Example

View license
public override string ToRegexPattern()
        {
            string result = string.Format
                (
                    CultureInfo.InvariantCulture,
                    "(?{0}{1}{2}{3}{4}:{5})",
                    ((Options & RegexOptions.IgnoreCase) == RegexOptions.IgnoreCase) ? "i" : null,
                    ((Options & RegexOptions.Multiline) == RegexOptions.Multiline) ? "m" : null,
                    ((Options & RegexOptions.Singleline) == RegexOptions.Singleline) ? "s" : null,
                    ((Options & RegexOptions.ExplicitCapture) == RegexOptions.ExplicitCapture) ? "n" : null,
                    ((Options & RegexOptions.IgnorePatternWhitespace) == RegexOptions.IgnorePatternWhitespace) ? "x" : null,
                    InnerExpression.ToRegexPattern()
                );
            return result;
        }

23. Example

Project: midichlorian
Source File: PitchConverter.cs
View license
public static string PitchToString(Pitch pitch)
        {
            return string.Format("{0}{1}", pitch.NotePreferringSharps(), pitch.Octave());
        }

24. Example

View license
protected string Typeof(IParameter parameter, ISubstitution s)
        {
            return string.Format("typeof({0})", s.Apply(parameter.Type).GetPresentableName(CSharpLanguage.Instance));
        }

25. Example

View license
private BindingFlags GetInvokeMemberBindingFlag(IDeclaredElement declaredElement, bool isAssign)
        {
            BindingFlags flag;
            if (declaredElement is IMethod)
            {
                flag = BindingFlags.InvokeMethod;
            }
            else if (declaredElement is IField)
            {
                flag = isAssign ? BindingFlags.SetField : BindingFlags.GetField;
            }
            else if (declaredElement is IProperty)
            {
                flag = isAssign ? BindingFlags.SetProperty : BindingFlags.GetProperty;
            }
            else
            {
                throw new ArgumentException(string.Format("Couldn't process element '{0}'", declaredElement));
            }
            return flag;
        }

26. Example

View license
protected string Typeof(IType type, ISubstitution substitution)
        {
            return string.Format("typeof({0})", substitution.Apply(type).GetPresentableName(CSharpLanguage.Instance));
        }

27. Example

Project: Granular
Source File: PropertyPath.cs
View license
public override string ToString()
        {
            return Elements.Select(element => element.ToString()).DefaultIfEmpty(String.Empty).Aggregate((s1, s2) => String.Format("{0}.{1}", s1, s2));
        }

28. Example

Project: Granular
Source File: PropertyPath.cs
View license
public override string ToString()
        {
            return PropertyName.HasContainingTypeName ? String.Format("({0})", PropertyName.LocalName) : PropertyName.LocalName;
        }

29. Example

Project: jslintnet
Source File: ConsoleJSLintProvider.cs
View license
public int EditSettings(ConsoleOptions options)
        {
            var settings = this.settingRepository.Load(options.SettingsFile);
            var message = string.Empty;

            this.consoleWriter
                .WriteLine()
                .WriteLine(Resources.SettingsEditorLaunching)
                .WriteLine(Resources.SettingsEditorCloseWarning);

            var view = this.viewFactory.CreateSettings(settings);
            var result = view.ShowDialog();

            if (result.HasValue && result.Value)
            {
                this.settingRepository.Save(settings, options.SettingsFile);

                message = string.Format(Resources.SettingsEditorSavedFormat, options.SettingsFile);
            }
            else
            {
                message = Resources.SettingsEditorCanceled;
            }

            this.consoleWriter
                .WriteLine()
                .WriteLine(message);

            return 0;
        }

30. Example

Project: AzureCP
Source File: ClaimsTable.aspx.cs
View license
protected void UpdatePersistedObject()
        {
            if (null == PersistedObject)
            {
                AzureCPLogging.Log(
                    String.Format("PersistedObject {0} should not be null.", Constants.AZURECPCONFIG_NAME),
                    TraceSeverity.Unexpected,
                    EventSeverity.Error,
                    AzureCPLogging.Categories.Configuration);
                return;
            }

            if (null == CurrentTrustedLoginProvider)
            {
                AzureCPLogging.Log(
                    "Trust associated with AzureCP could not be found.",
                    TraceSeverity.Unexpected,
                    EventSeverity.Error,
                    AzureCPLogging.Categories.Configuration);
                return;
            }

            // Update object in database
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                this.Web.AllowUnsafeUpdates = true;
                PersistedObject.Update();
                this.Web.AllowUnsafeUpdates = false;

                AzureCPLogging.Log(
                    String.Format("Objects list of AzureCP was successfully updated in PersistedObject {0}.", Constants.AZURECPCONFIG_NAME),
                    TraceSeverity.Medium,
                    EventSeverity.Information,
                    AzureCPLogging.Categories.Configuration);
            });
            ViewState["PersistedObjectVersion"] = PersistedObject.Version;
        }

31. Example

Project: Rabbit
Source File: PageController.cs
View license
[Get("Create")]
    public virtual object Create()
    {
        //check access
        dynamic newitem = new ExpandoObject();
        newitem.Id = null as string;
        newitem.Title = string.Format("[New {0}]", this.ContentType);
        newitem = SiteEngine.RunHook(NEW_ITEM, newitem);
        return RenderView((ExpandoObject)newitem);
    }

32. Example

Project: git-tools
Source File: GitIntellisenseHelper.cs
View license
internal static string GetPrompt()
        {
            if(!GitViewModel.Current.Tracker.HasGitRepository) return "No Git Repository";
            var changed = GitViewModel.Current.Tracker.ChangedFiles;
            return string.Format("{0} +{1} ~{2} -{3} !{4}", GitViewModel.Current.Tracker.CurrentBranch,
                changed.Where(f=> f.Status == GitFileStatus.New || f.Status == GitFileStatus.Added).Count(),
                changed.Where(f => f.Status == GitFileStatus.Modified || f.Status == GitFileStatus.Staged).Count(),
                changed.Where(f => f.Status == GitFileStatus.Deleted || f.Status == GitFileStatus.Removed).Count(),
                changed.Where(f => f.Status == GitFileStatus.Conflict).Count()
            );
        }

33. Example

View license
internal static string GetPrompt(GitFileStatusTracker tracker)
        {
            if(tracker==null || !tracker.HasGitRepository) return "No Git Repository";
            var changed = tracker.ChangedFiles;
            return string.Format("{0} +{1} ~{2} -{3} !{4}", tracker.CurrentBranch,
                changed.Where(f=> f.Status == GitFileStatus.New || f.Status == GitFileStatus.Added).Count(),
                changed.Where(f => f.Status == GitFileStatus.Modified || f.Status == GitFileStatus.Staged).Count(),
                changed.Where(f => f.Status == GitFileStatus.Deleted || f.Status == GitFileStatus.Removed).Count(),
                changed.Where(f => f.Status == GitFileStatus.Conflict).Count()
            );
        }

34. Example

View license
public override string ToString()
		{
			return string.Format(CultureInfo.InvariantCulture, "[{0} '{1}{2}{3}']", base.ToString(), this.Name, this.EqualsSign, this.Value);
		}

35. Example

View license
public override string ToString()
		{
			return string.Format(CultureInfo.InvariantCulture, "[{0} Chld:{1}]", base.ToString(), this.Children.Count);
		}

36. Example

View license
public override string ToString()
			{
				return string.Format(
					CultureInfo.InvariantCulture,
					"[Block StartLine={0}, LastWord='{1}', Continuation={2}, OneLineBlock={3}, PreviousOneLineBlock={4}]",
					this.StartLine, this.LastWord, this.Continuation, this.OneLineBlock, this.PreviousOneLineBlock);
			}

37. Example

View license
private void GraphLoaded_Executed(object sender, ExecutedRoutedEventArgs e)
		{
			gitViewModel.DisableAutoRefresh();

			this.loading.Visibility = Visibility.Collapsed;
			this.topToolBar.GitViewModel = gitViewModel;

			this.Title = gitViewModel.Tracker.HasGitRepository ?
				string.Format("{0} ({1})", gitViewModel.Tracker.GitWorkingDirectory, gitViewModel.Tracker.CurrentBranch) :
				string.Format("{0} (No Repository)", gitViewModel.WorkingDirectory);

			gitViewModel.EnableAutoRefresh();
		}

38. Example

View license
public override string ToString()
		{
			return string.Format(CultureInfo.InvariantCulture, "[{0} '{1}{2}{3}' Attr:{4}]", base.ToString(), this.OpeningBracket, this.Name, this.ClosingBracket, this.Children.Count);
		}

39. Example

View license
internal static string GetPrompt()
        {
            if(!GitViewModel.Current.Tracker.HasGitRepository) return "No Git Repository";
            var changed = GitViewModel.Current.Tracker.ChangedFiles;
            return string.Format("{0} +{1} ~{2} -{3} !{4}", GitViewModel.Current.Tracker.CurrentBranch,
                changed.Where(f=> f.Status == GitFileStatus.New || f.Status == GitFileStatus.Added).Count(),
                changed.Where(f => f.Status == GitFileStatus.Modified || f.Status == GitFileStatus.Staged).Count(),
                changed.Where(f => f.Status == GitFileStatus.Deleted || f.Status == GitFileStatus.Removed).Count(),
                changed.Where(f => f.Status == GitFileStatus.Conflict).Count()
            );
        }

40. Example

View license
public override string ToString()
		{
			return string.Format(CultureInfo.InvariantCulture, "[{0} Text.Length={1}]", base.ToString(), this.EscapedValue.Length);
		}

41. Example

View license
public static void OnSyntaxError(AXmlObject obj, int start, int end, string message, params object[] args)
		{
			if (end <= start) end = start + 1;
			string formattedMessage = string.Format(CultureInfo.InvariantCulture, message, args);
			AXmlParser.Log("Syntax error ({0}-{1}): {2}", start, end, formattedMessage);
			obj.AddSyntaxError(new SyntaxError() {
			                   	Object = obj,
			                   	StartOffset = start,
			                   	EndOffset = end,
			                   	Message = formattedMessage,
			                   });
		}

42. Example

View license
public override string ToString()
		{
			return string.Format(CultureInfo.InvariantCulture, "[{0} '{1}' Attr:{2} Chld:{3} Nest:{4}]", base.ToString(), this.Name, this.HasStartOrEmptyTag ? this.StartTag.Children.Count : 0, this.Children.Count, this.IsProperlyNested ? "Ok" : "Bad");
		}

43. Example

Project: UltimaXNA
Source File: OptionsGump.cs
View license
public int GetCurrentFullScreenIndex()
        {
            string res = string.Format("{0}x{1}", Settings.UserInterface.FullScreenResolution.Width, Settings.UserInterface.FullScreenResolution.Height);
            for (int i = 0; i < Resolutions.FullScreenResolutionsList.Count; i++)
            {
                if (Resolutions.FullScreenResolutionsList[i].Width == Settings.UserInterface.FullScreenResolution.Width && Resolutions.FullScreenResolutionsList[i].Height == Settings.UserInterface.FullScreenResolution.Height)
                    return i;
            }
            return -1;
        }

44. Example

Project: UltimaXNA
Source File: Action.cs
View license
public override string ToString()
        {
            return string.Format("{0}{1}{2}{3}", 
                Shift ? "Shift+" : string.Empty,
                Alt ? "Alt+" : string.Empty,
                Ctrl ? "Ctrl+" : string.Empty,
                Keystroke.ToString());
        }

45. Example

Project: UltimaXNA
Source File: WorldClient.cs
View license
void ReceiveDamage(DamagePacket p)
        {
            Mobile entity = WorldModel.Entities.GetObject<Mobile>(p.Serial, false);
            if (entity == null)
                return;

            m_World.Interaction.ChatMessage(string.Format("{0} takes {1} damage!", entity.Name, p.Damage));
        }

46. Example

Project: UltimaXNA
Source File: WorldClient.cs
View license
void ReceiveTime(TimePacket p)
        {
            m_World.Interaction.ChatMessage(string.Format("The current server time is {0}:{1}:{2}", p.Hour, p.Minute, p.Second));
        }

47. Example

View license
public override string ToString()
        {
            return string.Format("VPNTH: <{0}> <{1}>", Position.ToString(), TextureCoordinate.ToString());
        }

48. Example

Project: UltimaXNA
Source File: ItemGumpling.cs
View license
void UpdateLabel(bool isDisposing = false)
        {
            if (!isDisposing && Item.Overheads.Count > 0)
            {
                if (m_Label == null)
                {
                    IInputService input = Service.Get<IInputService>();
                    UserInterface.AddControl(m_Label = new HtmlGumpling(null, 0, 0, 200, 32, 0, 0,
                        string.Format("<center><span style='font-family: ascii3;'>{0}</center>", Item.Overheads[0].Text)),
                        input.MousePosition.X - 100, input.MousePosition.Y - 12);
                    m_Label.MetaData.Layer = UILayer.Over;
                }
            }
            else if (m_Label != null)
            {
                {
                    m_Label.Dispose();
                    m_Label = null;
                }
            }
        }

49. Example

Project: UltimaXNA
Source File: OptionsGump.cs
View license
public int GetCurrentPlayWindowIndex()
        {
            string res = string.Format("{0}x{1}", Settings.UserInterface.PlayWindowGumpResolution.Width, Settings.UserInterface.PlayWindowGumpResolution.Height);
            for (int i = 0; i < Resolutions.PlayWindowResolutionsList.Count; i++)
            {
                if (Resolutions.PlayWindowResolutionsList[i].Width == Settings.UserInterface.PlayWindowGumpResolution.Width && Resolutions.PlayWindowResolutionsList[i].Height == Settings.UserInterface.PlayWindowGumpResolution.Height)
                    return i;
            }
            return -1;
        }

50. Example

Project: UltimaXNA
Source File: SpellbookGump.cs
View license
void CreateSpellPage(int page, bool rightPage, int circle, SpellDefinition spell)
        {
            // header: "NTH CIRCLE"
            AddControl(new HtmlGumpling(this, 64 + (rightPage ? 148 : 0), 10, 130, 200, 0, 0,
                string.Format("<span color='#004' style='font-family=uni0;'><center>{0}</center></span>", SpellsMagery.CircleNames[circle])),
                page);
            // icon and spell name
            AddControl(new HtmlGumpling(this, 56 + (rightPage ? 156 : 0), 38, 130, 44, 0, 0,
                string.Format("<a href='spellicon={0}'><gumpimg src='{1}'/></a>",
                spell.ID, spell.GumpIconID - 0x1298)),
                page);
            AddControl(new HtmlGumpling(this, 104 + (rightPage ? 156 : 0), 38, 88, 40, 0, 0, string.Format(
                "<a href='spell={0}' color='#542' hovercolor='#875' activecolor='#420' style='font-family=uni0; text-decoration=none;'>{1}</a>",
                spell.ID, spell.Name)),
                page);
            // reagents.
            AddControl(new HtmlGumpling(this, 56 + (rightPage ? 156 : 0), 84, 146, 106, 0, 0, string.Format(
                "<span color='#400' style='font-family=uni0;'>Reagents:</span><br/><span style='font-family=ascii6;'>{0}</span>", spell.CreateReagentListString(", "))),
                page);
        }