int.ToString()

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

200 Examples 7

1. Example

Project: CloudinaryDotNet
Source File: ListResourcesParams.cs
public override SortedDictionary<string, object> ToParamsDictionary()
        {
            SortedDictionary<string, object> dict = base.ToParamsDictionary();

            if (MaxResults > 0)
                AddParam(dict, "max_results", MaxResults.ToString());

            AddParam(dict, "start_at", StartAt);
            AddParam(dict, "next_cursor", NextCursor);
            AddParam(dict, "tags", Tags);
            AddParam(dict, "moderations", Moderations);
            AddParam(dict, "context", Context);
            AddParam(dict, "direction", Direction);
            AddParam(dict, "type", Type);

            return dict;
        }

2. Example

Project: alphaTab
Source File: BarNumberGlyph.cs
public override void DoLayout()
        {
            Renderer.ScoreRenderer.Canvas.Font = Renderer.Resources.BarNumberFont;
            Width = Renderer.ScoreRenderer.Canvas.MeasureText(_number.ToString()) + 5 * Scale;
        }

3. Example

Project: alphaTab
Source File: BarNumberGlyph.cs
public override void Paint(float cx, float cy, ICanvas canvas)
        {
            if (!Renderer.Staff.IsFirstInAccolade)
            {
                return;
            }
            var res = Renderer.Resources;
            canvas.Color = res.BarNumberColor;
            canvas.Font = res.BarNumberFont;

            canvas.FillText(_number.ToString(), cx + X, cy + Y);

            canvas.Color = res.MainGlyphColor;
        }

4. Example

Project: TraceLab
Source File: MainWindow.xaml.cs
private void New_click(object sender, RoutedEventArgs e)
        {
            string title = "newDoc";
            int i = 0;
            while (dockingManager.Documents.Any(d => d.Title == title))
            {
                title = "newDoc" + i.ToString();
                i++;
            }

            var doc = new Document() { Title = title };
            doc.Show(dockingManager);
            doc.Activate();
        }

5. Example

Project: TraceLab
Source File: MainWindow.xaml.cs
private void New_click(object sender, RoutedEventArgs e)
        {
            string title = "newDoc";
            int i = 0;
            while (dockingManager.Documents.Any(d => d.Title == title))
            {
                title = "newDoc" + i.ToString();
                i++;
            }

            var doc = new Document() { Title = title };
            doc.Show(dockingManager);
            doc.Activate();
        }

6. Example

Project: TraceLab
Source File: LayoutAnalyzerViewModel.SampleGraphs.cs
partial void CreateSampleGraphs()
        {
            #region SimpleTree
            int i = 0;
  /n ..... /n //View Source file for more details /n }

7. Example

Project: TraceLab
Source File: PlainCompoundLayoutTest.xaml.cs
private string[] InitVertices(CompoundGraph<object, IEdge<object>> g, int vertexCount)
        {
            var vertices = new string[vertexCount];
            for (int i = 0; i < vertexCount; i++)
            {
                vertices[i] = i.ToString();
                g.AddVertex(vertices[i]);
            }
            return vertices;
        }

8. Example

Project: TraceLab
Source File: LayeredTopologicalSortAlgorithmTest.cs
[TestMethod]
		public void Simple()
		{
			var g = new BidirectionalGraph<string, Edge<string>>( );
			var vs = new string[ 3 ];
			for ( int i = 1; i < 4; i++ )
			{
				vs[ i - 1 ] = i.ToString( );
				g.AddVertex( i.ToString( ) );
			}
			g.AddEdge( new Edge<string>( vs[ 0 ], vs[ 1 ] ) );
			g.AddEdge( new Edge<string>( vs[ 1 ], vs[ 2 ] ) );

			var lts = new LayeredTopologicalSortAlgorithm<string, Edge<string>>( g );
			lts.Compute( );

			Assert.AreEqual( lts.LayerIndices[ vs[ 0 ] ], 0 );
			Assert.AreEqual( lts.LayerIndices[ vs[ 1 ] ], 1 );
			Assert.AreEqual( lts.LayerIndices[ vs[ 2 ] ], 2 );
		}

9. Example

Project: TraceLab
Source File: LayeredTopologicalSortAlgorithmTest.cs
[TestMethod]
		public void MultipleSource()
		{
			var g = new BidirectionalGraph<string, Edge<string>>( );
			var vs = new string[ 5 ];
			for ( int i = 1; i < 6; i++ )
			{
				vs[ i - 1 ] = i.ToString( );
				g.AddVertex( i.ToString( ) );
			}
			g.AddEdge( new Edge<string>( vs[ 0 ], vs[ 1 ] ) );
			g.AddEdge( new Edge<string>( vs[ 1 ], vs[ 2 ] ) );
			g.AddEdge( new Edge<string>( vs[ 3 ], vs[ 1 ] ) );
			g.AddEdge( new Edge<string>( vs[ 4 ], vs[ 2 ] ) );

			var lts = new LayeredTopologicalSortAlgorithm<string, Edge<string>>( g );
			lts.Compute( );

			Assert.AreEqual( 0, lts.LayerIndices[ vs[ 0 ] ] );
			Assert.AreEqual( 1, lts.LayerIndices[ vs[ 1 ] ] );
			Assert.AreEqual( 2, lts.LayerIndices[ vs[ 2 ] ] );
			Assert.AreEqual( 0, lts.LayerIndices[ vs[ 3 ] ] );
			Assert.AreEqual( 0, lts.LayerIndices[ vs[ 4 ] ] );
		}

10. Example

Project: TraceLab
Source File: Program.cs
private static object PrepareMockData()
        {
            TLArtifactsCollection artifacts = new TLArtifactsCollection();
            int i = 0;
            foreach (string text in new string[] { "artifact text 1", "artifact text 2", "artifact text 3" })
            {
                artifacts.Add(new TLArtifact(i.ToString(), text));
                i++;
            }
            return artifacts;
        }

11. Example

Project: cofoundry
Source File: PasswordCryptographyService.cs
public virtual bool Verify(string password, string hash, int hashVersion)
        {
            switch (hashVersion)
            {
                case (int)PasswordEncryptionVersion.V1:
                    var service = new PasswordCryptographyV1();
                    return service.Verify(password, hash);
                case (int)PasswordEncryptionVersion.V2:
                    return Defuse.PasswordCryptographyV2.VerifyPassword(password, hash);
                default:
                    throw new ApplicationException("PasswordEncryptionVersion not recognised: " + hashVersion.ToString());
            }
        }

12. Example

Project: cofoundry
Source File: SimpleResizedImageAssetFileService.cs
private Stream GetFileStream(int imageAssetId)
        {
            var result = _queryExecutor.GetById<ImageAssetFile>(imageAssetId);

            if (result == null || result.ContentStream == null)
            {
                throw new FileNotFoundException(imageAssetId.ToString());
            }

            return result.ContentStream;
        }

13. Example

Project: cofoundry
Source File: DirectoriesRouteLibrary.cs
public string Details(int id)
        {
            return CreateAngularRoute(id.ToString());
        }

14. Example

Project: cofoundry
Source File: DocumentsModuleRouteLibrary.cs
public string Details(int id)
        {
            return CreateAngularRoute(id.ToString());
        }

15. Example

Project: cofoundry
Source File: ImagesModuleRouteLibrary.cs
public string Details(int id)
        {
            return CreateAngularRoute(id.ToString());
        }

16. Example

Project: cofoundry
Source File: PagesModuleRouteLibrary.cs
public string Details(int id)
        {
            return CreateAngularRoute(id.ToString());
        }

17. Example

Project: cofoundry
Source File: PageTemplatesRouteLibrary.cs
public string Details(int id)
        {
            return CreateAngularRoute(id.ToString());
        }

18. Example

Project: cofoundry
Source File: RolesRouteLibrary.cs
public string Details(int id)
        {
            return CreateAngularRoute(id.ToString());
        }

19. Example

Project: scorm4unity
Source File: Scorm2004_date_time.cs
public string ToString()
        {
            string s = "";
            s += "P";
            s += timespan.Days.ToString() + "DT";
            s += timespan.Hours.ToString() + "H";
            s += timespan.Minutes.ToString() + "M";
            s += timespan.Seconds.ToString() + "S";
            return s;
        }

20. Example

Project: scorm4unity
Source File: ScormSerialization.cs
public static string TimeSpanToString(TimeSpan val)
        {
            string s = "";
            s += "P";
            s += val.Days.ToString() + "DT";
            s += val.Hours.ToString() + "H";
            s += val.Minutes.ToString() + "M";
            s += val.Seconds.ToString() + "S";
            return s;
        }

21. Example

Project: scorm4unity
Source File: ScormExport.cs
string GetParameterString()
	{
		string parameters = "?";
		int num = 	PlayerPrefs.GetInt("Param_Count");
		
		for( int i = 0; i < num; i++)
		{
			if(PlayerPrefs.GetString("Param_"+i.ToString()+"_Name") != "")
			{
				parameters+= PlayerPrefs.GetString("Param_"+i.ToString()+"_Name") + "="+ PlayerPrefs.GetString("Param_"+i.ToString()+"_Value") + "&";
			}
		}
		return parameters;
	}

22. Example

Project: XWeather
Source File: SettingUtilities.cs
public static void SetSetting (string key, int value, bool asString = true)
		{
			using (var sharedPreferences = PreferenceManager.GetDefaultSharedPreferences (Application.Context))
			using (var sharedPreferencesEditor = sharedPreferences.Edit ())
			{
				if (asString)
				{
					sharedPreferencesEditor.PutString (key, value.ToString ());
				}
				else
				{
					sharedPreferencesEditor.PutInt (key, value);
				}
				sharedPreferencesEditor.Commit ();
			}
		}

23. Example

Project: TESUnity
Source File: Vector2i.cs
public override string ToString()
	{
		return "(" + x.ToString() + ", " + y.ToString() + ")";
	}

24. Example

Project: TESUnity
Source File: UIBook.cs
private void UpdateBook()
        {
            if (_numberOfPages > 1)
            {
                _page1.text = _pages[_cursor];
                _page2.text = _cursor + 1 >= _numberOfPages ? "" : _pages[_cursor + 1];
            }
            else
            {
                _page1.text = _pages[0];
                _page2.text = string.Empty;
            }

            _nextButton.interactable = _cursor + 2 < _numberOfPages;
            _previousButton.interactable = _cursor - 2 >= 0;

            if (_cursor + 2 < _numberOfPages && _pages[_cursor + 2] == string.Empty)
                _nextButton.interactable = false;

            _numPage1.text = (_cursor + 1).ToString();
            _numPage2.text = (_cursor + 2).ToString();
        }

25. Example

Project: More
Source File: ObservableQueueTTest.cs
[Fact( DisplayName = "observable queue should grow dynamically" )]
        public void ShouldGrowAutomatically()
        {
            var target = new ObservableQueue<string>( 3 );

            for ( var i = 0; i < 10; i++ )
                target.Enqueue( ( i + 1 ).ToString() );

            target.Clear();
            target.TrimExcess();
        }

26. Example

Project: RNGReporter
Source File: Functions.cs
public static string encounterItems(int slot)
        {
            if (slot < 12 || slot > 41)
                return slot.ToString();

            switch ((Language) Settings.Default.Language)
            {
                case (Language.Japanese):
                    return Translations.encounterItemsJPN[slot - 12];
                case (Language.German):
                    return Translations.encounterItemsGER[slot - 12];
                case (Language.French):
                    return Translations.encounterItemsFRA[slot - 12];
                case (Language.Spanish):
                    return Translations.encounterItemsSPA[slot - 12];
                case (Language.Italian):
                    return Translations.encounterItemsITA[slot - 12];
                case (Language.Korean):
                    return Translations.encounterItemsKOR[slot - 12];
                default:
                    return Translations.encounterItemsENG[slot - 12];
            }
        }

27. Example

Project: 07-Glitch-Garden
Source File: PlayerPrefsManager.cs
public static void UnlockLevel (int level) {
		if (level <= Application.levelCount - 1) {
			PlayerPrefs.SetInt (LEVEL_KEY + level.ToString(), 1); // Use 1 for true
		} else {
			Debug.LogError ("Trying to unlock level not in build order");
		}
	}

28. Example

Project: 07-Glitch-Garden
Source File: PlayerPrefsManager.cs
public static bool IsLevelUnlocked (int level) {
		int levelValue = PlayerPrefs.GetInt (LEVEL_KEY + level.ToString());
		bool isLevelUnlocked = (levelValue == 1);		

		if (level <= Application.levelCount - 1) {
			return isLevelUnlocked;
		} else {
			Debug.LogError ("Trying to query level not in build order");
			return false;
		}
	}

29. Example

Project: 07-Glitch-Garden
Source File: StarDisplay.cs
private void UpdateDisplay () {
		starText.text =stars.ToString();
	}

30. Example

Project: 04-Number-Wizard-UI
Source File: NumberWizards.cs
void NextGuess () {
		//guess = (max + min) / 2;
		guess = Random.Range(min, max);
		print ("Next guess is " + guess);
		guessText.text = guess.ToString();
	}

31. Example

Project: 10-TwinStick
Source File: PlayerPrefsManager.cs
public static void UnlockLevel (int level) {
		if (level <= Application.levelCount - 1) {
			PlayerPrefs.SetInt (LEVEL_KEY + level.ToString(), 1); // Use 1 for true
		} else {
			Debug.LogError ("Trying to unlock level not in build order");
		}
	}

32. Example

Project: 10-TwinStick
Source File: PlayerPrefsManager.cs
public static bool IsLevelUnlocked (int level) {
		int levelValue = PlayerPrefs.GetInt (LEVEL_KEY + level.ToString());
		bool isLevelUnlocked = (levelValue == 1);		

		if (level <= Application.levelCount - 1) {
			return isLevelUnlocked;
		} else {
			Debug.LogError ("Trying to query level not in build order");
			return false;
		}
	}

33. Example

Project: Krypton
Source File: Form1.cs
private KryptonPage NewPage(string name, int image, Control content)
        {
            // Create new page with title and image
            KryptonPage p = new KryptonPage();
            p.Text = name + _count.ToString();
            p.TextTitle = name + _count.ToString();
            p.TextDescription = name + _count.ToString();
            p.ImageSmall = imageListSmall.Images[image];

            // Add the control for display inside the page
            content.Dock = DockStyle.Fill;
            p.Controls.Add(content);

            _count++;
            return p;
        }

34. Example

Project: Krypton
Source File: Form1.cs
private KryptonPage NewDocument()
        {
            // Create new page with title and image
            KryptonPage p = new KryptonPage();
            p.Text = "Document " + _count.ToString();
            p.TextTitle = p.Text;
            p.TextDescription = p.Text;
            p.UniqueName = p.Text;
            p.ImageSmall = imageListSmall.Images[0];

            // Add the control for display inside the page
            ContentDocument contentDoc = new ContentDocument();
            contentDoc.Dock = DockStyle.Fill;
            p.Controls.Add(contentDoc);

            _count++;
            return p;
        }

35. Example

Project: Krypton
Source File: Form1.cs
private KryptonPage NewFlags()
        {
            // Create new page with title and image
            KryptonPage p = new KryptonPage();
            p.Text = "Flags " + _count.ToString();
            p.TextTitle = p.Text;
            p.TextDescription = p.Text;
            p.UniqueName = p.Text;
            p.ImageSmall = imageListSmall.Images[1];

            // Add the control for display inside the page
            ContentFlags contentFlags = new ContentFlags(p);
            contentFlags.Dock = DockStyle.Fill;
            p.Controls.Add(contentFlags);

            _count++;
            return p;
        }

36. Example

Project: Krypton
Source File: Form1.cs
private KryptonPage NewPage(string name, int image, Control content)
        {
            // Create new page with title and image
            KryptonPage p = new KryptonPage();
            p.Text = name + _count.ToString();
            p.TextTitle = name + _count.ToString();
            p.TextDescription = name + _count.ToString();
            p.UniqueName = p.Text;
            p.ImageSmall = imageListSmall.Images[image];

            // Add the control for display inside the page
            content.Dock = DockStyle.Fill;
            p.Controls.Add(content);

            _count++;
            return p;
        }

37. Example

Project: Krypton
Source File: Form1.cs
private void kryptonDockingManager_PageSaving(object sender, DockPageSavingEventArgs e)
        {
            // Example code showing how to save extra data into the page config
            e.XmlWriter.WriteStartElement("CustomPageData");
            e.XmlWriter.WriteAttributeString("SavedMilliseconds", DateTime.Now.Millisecond.ToString());
            e.XmlWriter.WriteEndElement();
        }

38. Example

Project: Krypton
Source File: Form1.cs
public KryptonPage NewPage(string name, int image, Control content)
        {
            // Create new page with title and image
            KryptonPage p = new KryptonPage();
            p.Text = name + _count.ToString();
            p.TextTitle = name + _count.ToString();
            p.TextDescription = name + _count.ToString();
            p.UniqueName = p.Text;
            p.ImageSmall = imageListSmall.Images[image];

            // Add the control for display inside the page
            content.Dock = DockStyle.Fill;
            p.Controls.Add(content);

            _count++;
            return p;
        }

39. Example

Project: Krypton
Source File: Form1.cs
private KryptonPage NewPage(string name, int image, Control content)
        {
            // Create new page with title and image
            KryptonPage p = new KryptonPage();
            p.Text = name + _count.ToString();
            p.TextTitle = name + _count.ToString();
            p.TextDescription = name + _count.ToString();
            p.ImageSmall = imageListSmall.Images[image];
            
            // Add the control for display inside the page
            content.Dock = DockStyle.Fill;
            p.Controls.Add(content);

            _count++;
            return p;
        }

40. Example

Project: Krypton
Source File: Form1.cs
private KryptonPage NewPage(string name, int image, Control content)
        {
            // Create new page with title and image
            KryptonPage p = new KryptonPage();
            p.Text = name + _count.ToString();
            p.TextTitle = name + _count.ToString();
            p.TextDescription = name + _count.ToString();
            p.UniqueName = p.Text;
            p.ImageSmall = imageListSmall.Images[image];

            // Add the control for display inside the page
            content.Dock = DockStyle.Fill;
            p.Controls.Add(content);

            _count++;
            return p;
        }

41. Example

Project: Krypton
Source File: Form1.cs
private KryptonPage NewPage(string name, int image, Control content)
        {
            // Create new page with title and image
            KryptonPage p = new KryptonPage();
            p.Text = name + _count.ToString();
            p.TextTitle = name + _count.ToString();
            p.TextDescription = name + _count.ToString();
            p.ImageSmall = imageListSmall.Images[image];

            // Add the control for display inside the page
            content.Dock = DockStyle.Fill;
            p.Controls.Add(content);

            _count++;
            return p;
        }

42. Example

Project: Krypton
Source File: Form1.cs
private void kryptonButtonAdd_Click(object sender, EventArgs e)
        {
            // Create a new krypton page
            KryptonPage newPage = new KryptonPage();

            // Populate with text and image
            newPage.Text = "Page " + _count.ToString();
            newPage.TextTitle = "Page " + _count.ToString() + " Title";
            newPage.TextDescription = "Page " + _count.ToString() + " Description";
            newPage.ImageSmall = imageList1.Images[_count % imageList1.Images.Count];
            _count++;

            // Append to end of the pages collection
            kryptonNavigator1.Pages.Add(newPage);

            // Select the new page
            kryptonNavigator1.SelectedPage = newPage;
        }

43. Example

Project: Krypton
Source File: Form1.cs
private void kryptonButtonAdd_Click(object sender, EventArgs e)
        {
            // Create a new krypton page
            KryptonPage newPage = new KryptonPage();

            // Populate with text and image
            newPage.Text = "Page " + _count.ToString();
            newPage.TextTitle = "Page " + _count.ToString() + " Title";
            newPage.TextDescription = "Page " + _count.ToString() + " Description";
            newPage.ImageSmall = imageList1.Images[_count % imageList1.Images.Count];
            _count++;

            // Append to end of the pages collection
            kryptonNavigator1.Pages.Add(newPage);

            // Select the new page
            kryptonNavigator1.SelectedPage = newPage;
        }

44. Example

Project: Krypton
Source File: Form1.cs
private void addText_Click(object sender, EventArgs e)
        {
            if (kryptonNavigator.SelectedPage != null)
            {
                ButtonSpecAny bsa = new ButtonSpecAny();
                bsa.Style = PaletteButtonStyle.Standalone;
                bsa.Text = DateTime.Now.Millisecond.ToString();
                bsa.Tag = kryptonNavigator.SelectedPage;
                kryptonNavigator.SelectedPage.ButtonSpecs.Add(bsa);
            }
        }

45. Example

Project: Krypton
Source File: Form1.cs
private void buttonAddPage_Click(object sender, EventArgs e)
        {
            KryptonPage newPage = new KryptonPage();
            newPage.Text = "Page " + _newPage.ToString();
            newPage.ImageSmall = imageList1.Images[_newPage++ % imageList1.Images.Count];
            kryptonNavigator1.Pages.Add(newPage);
        }

46. Example

Project: Krypton
Source File: Form1.cs
private void InsertNewPage()
        {
            // Then create a new page
            KryptonPage newPage = new KryptonPage();

            // Define the name and image of the page
            newPage.Text = "Page" + (_count++).ToString();
            newPage.ImageSmall = global::UserPageCreation.Properties.Resources.document;

            // Insert just at second to last index, just before the 'new page' page
            kryptonNavigator1.Pages.Insert(kryptonNavigator1.Pages.Count - 1, newPage);

            // Select the new page
            kryptonNavigator1.SelectedPage = newPage;

            // We insist that two pages are always present. As we have just added one we
            // need to check if we now have 3 and so the close button should be allowed again.
            if (kryptonNavigator1.Pages.Count == 3)
                kryptonNavigator1.Button.CloseButtonDisplay = ButtonDisplay.ShowEnabled;
        }

47. Example

Project: Krypton
Source File: Form1.cs
private void AddMDIChildWindow()
        {
            Form2 f = new Form2();
            f.Text = "Child " + (_count++).ToString();
            f.MdiParent = this;
            f.Show();
        }

48. Example

Project: Krypton
Source File: Form1.cs
private void AddMDIChildWindow()
        {
            Form2 f = new Form2();
            f.Text = "Child " + (_count++).ToString();
            f.MdiParent = this;
            f.Show();
        }

49. Example

Project: Krypton
Source File: Form1.cs
private KryptonPage CreatePage(string title, int imageIndex)
        {
            // Create a new page and give it a name and image
            KryptonPage page = new KryptonPage();
            page.Text = title;
            page.TextTitle = title + " Title";
            page.TextDescription = title + " Description";
            page.ImageSmall = imageList.Images[imageIndex];
            page.Tag = imageIndex.ToString();

            // Create a rich text box with some sample text inside
            KryptonRichTextBox rtb = new KryptonRichTextBox();
            rtb.Text = "This page (" + page.Text + ") contains a rich text box control as example content.";
            rtb.Dock = DockStyle.Fill;
            rtb.StateCommon.Border.Draw = InheritBool.False;

            // Add rich text box as the contents of the page
            page.Padding = new Padding(5);
            page.Controls.Add(rtb);

            return page;
        }

50. Example

Project: Krypton
Source File: Form1.cs
private KryptonPage CreatePage()
        {
            // Give each page a unique number
            string pageNumber = (_count++).ToString();

            // Create a new page and give it a name and image
            KryptonPage page = new KryptonPage();
            page.Text = "P" + pageNumber;
            page.TextTitle = "P" + pageNumber + " Title";
            page.TextDescription = "P" + pageNumber + " Description";
            page.ImageSmall = imageList.Images[_count % imageList.Images.Count];

            // Create a rich text box with some sample text inside
            KryptonRichTextBox rtb = new KryptonRichTextBox();
            rtb.Text = "This page (" + page.Text + ") contains a rich text box control as example content. Your application could place anything you like here such as data entry controls, charts, data grids etc.";
            rtb.Dock = DockStyle.Fill;
            rtb.StateCommon.Border.Draw = InheritBool.False;

            // Add rich text box as the contents of the page
            page.Padding = new Padding(5);
            page.Controls.Add(rtb);

            return page;
        }