Source Code examples

Last post 01-05-2010 2:58 PM by OthmaneRahmouni. 25 replies.

Sort Posts:

  • Re: Source Code examples

    06-24-2009, 8:26 AM
    • All-Star
      96,253 point All-Star
    • SGWellens
    • Member since 01-02-2007, 9:27 PM
    • Minneapolis
    • Posts 7,788
    • Moderator
      TrustedFriends-MVPs

    tmorton:

    SGWellens:
    Hmmm...Apparently message preview isn't operational yet.
     

    Which browser?  It's working OK for me in IE8.

     

    IE8.  As MikeB said, the code shows in preview but it's not formatted.

    Steve Wellens

    My blog
  • Re: Source Code examples

    06-24-2009, 8:30 AM
    • All-Star
      96,253 point All-Star
    • SGWellens
    • Member since 01-02-2007, 9:27 PM
    • Minneapolis
    • Posts 7,788
    • Moderator
      TrustedFriends-MVPs

    Default options:

    body
    {
    	margin: 0;
    	padding: 0;
    	font-family: Arial,Helvetica,sans-serif;
    	font-size: .88em;
    	color: #4c4c4c;
    	cursor: default;
    }
    html *
    {
    	margin: 0;
    	padding: 0;
    }


     

    Steve Wellens

    My blog
  • Re: Source Code examples

    06-24-2009, 9:09 AM
    • All-Star
      127,676 point All-Star
    • XIII
    • Member since 07-01-2002, 3:59 AM
    • Essen, Belgium
    • Posts 13,931
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs

    New try with none of the checkboxes checked, CSS chosen from the list:

    body
    {
    	margin: 0;
    	padding: 0;
    	font-family: Arial,Helvetica,sans-serif;
    	font-size: .88em;
    	color: #4c4c4c;
    	cursor: default;
    }
    html *
    {
    	margin: 0;
    	padding: 0;
    }


    with none of the checkboxes checked, C# chosen from list:

    body
    {
    	margin: 0;
    	padding: 0;
    	font-family: Arial,Helvetica,sans-serif;
    	font-size: .88em;
    	color: #4c4c4c;
    	cursor: default;
    }
    html *
    {
    	margin: 0;
    	padding: 0;
    }


    Update: it seems the CSS scripts file isn't included or doesn't work. Also there's no color coding for the code that gets into the fancy layout so I guess there's also some missing external css for the color coding. I still strongly suggest that the 2.0 version of syntaxhighlighter would be used instead of 1.5. 

    Grz, Kris.

  • Re: Source Code examples

    06-24-2009, 9:34 AM
    • All-Star
      42,326 point All-Star
    • tmorton
    • Member since 08-06-2002, 9:37 PM
    • SE Pennsylvania, USA
    • Posts 7,032
    • ASPInsiders
      Moderator

    XIII:
    Update: it seems the CSS scripts file isn't included or doesn't work. Also there's no color coding for the code that gets into the fancy layout so I guess there's also some missing external css for the color coding. 

    We'll take a look at these, and once I can verify I will add these to the known issues


    XIII:
    I still strongly suggest that the 2.0 version of syntaxhighlighter would be used instead of 1.5. 

    We had some technical difficulties getting the 2.0 version to work, and ran out of time.  So we decided to deploy with 1.5, and logged a work item to move to 2.0 in the coming weeks. 

    Terri Morton
    ASP.NET Website Manager, Neudesic
  • Re: Source Code examples

    06-24-2009, 6:06 PM
    • Participant
      917 point Participant
    • crpietschmann
    • Member since 07-05-2002, 9:06 PM
    • Wisconsin, USA
    • Posts 221

     Yeah it seems like the "Insert code" button doesn't seem to work... hm...

    body
    {
    	margin: 0;
    	padding: 0;
    	font-family: Arial,Helvetica,sans-serif;
    	font-size: .88em;
    	color: #4c4c4c;
    	cursor: default;
    }
    html *
    {
    	margin: 0;
    	padding: 0;
    }
    Microsoft MVP - Windows Live Platform
    Blog: http://pietschsoft.com | Web.Maps.VE - ASP.NET AJAX Bing Maps Control
  • Re: Source Code examples

    06-24-2009, 6:37 PM
    • All-Star
      100,818 point All-Star
    • mbanavige
    • Member since 11-06-2003, 1:29 PM
    • New England, USA
    • Posts 10,509
    • Moderator
      TrustedFriends-MVPs

    i think the insert code function is working ok, but for the CSS content, there might be an issue either with the css SyntaxHighlighter brush or just with the class value that gets set on the pre tag when css is the code type selected.

    The class name assigned to the pre tag for css code in the threads posts is 'css ' - note the trailing space.  None of the other code types have this trailing space.  If i use the ie debugger to replace the class with 'css' without that trailing space on the code pre tag and then i manually run the javascript method:

    dp.SyntaxHighlighter.HighlightAll('code');

    then the css code in your post is suddenly syntax highlighted.

    Mike Banavige
    ~~~~~~~~~~~~
    Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/
  • Re: Source Code examples

    06-24-2009, 8:55 PM
    • All-Star
      42,326 point All-Star
    • tmorton
    • Member since 08-06-2002, 9:37 PM
    • SE Pennsylvania, USA
    • Posts 7,032
    • ASPInsiders
      Moderator

    mbanavige:

    i think the insert code function is working ok, but for the CSS content, there might be an issue either with the css SyntaxHighlighter brush or just with the class value that gets set on the pre tag when css is the code type selected.

    The class name assigned to the pre tag for css code in the threads posts is 'css ' - note the trailing space.  None of the other code types have this trailing space.  If i use the ie debugger to replace the class with 'css' without that trailing space on the code pre tag and then i manually run the javascript method:

    dp.SyntaxHighlighter.HighlightAll('code');

    then the css code in your post is suddenly syntax highlighted.

    Thank you for your analysis, Mike!  I've added this to the known issues.

    Terri Morton
    ASP.NET Website Manager, Neudesic
  • Re: Source Code examples

    06-24-2009, 9:15 PM
    • All-Star
      100,818 point All-Star
    • mbanavige
    • Member since 11-06-2003, 1:29 PM
    • New England, USA
    • Posts 10,509
    • Moderator
      TrustedFriends-MVPs

    Possibly this is a latent bug in the 1.5 version of the syntaxhighlighter that will self correct when you can get to version 2.0?

    In the interim, for anybody wanting to use the css syntax highlighting, just use the code paste as normal and select the css option.  but, before hitting the "Post" button, click the html button in the editor and fix the class name on the "pre" tag.

    Locate this html:

    <PRE class="css " name="code">


    and change it to this:

    <PRE class="css" name="code">


    The result should be some highlighted css:

    html *
    {
    	margin: 0;
    	padding: 0;
    }


     

    Mike Banavige
    ~~~~~~~~~~~~
    Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/
  • Re: Source Code examples

    06-27-2009, 10:55 AM
    • All-Star
      127,676 point All-Star
    • XIII
    • Member since 07-01-2002, 3:59 AM
    • Essen, Belgium
    • Posts 13,931
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs

    Trying it from Chrome and some javascript:

    	// The number of elements contained in the matched element set
    	size: function() {
    		///	<summary>
    		///		The number of elements currently matched.
    		///		Part of Core
    		///	</summary>
    		///	<returns type="Number" />
    
    		return this.length;
    	},



    Grz, Kris.

  • Re: Source Code examples

    06-27-2009, 12:36 PM
    • All-Star
      96,253 point All-Star
    • SGWellens
    • Member since 01-02-2007, 9:27 PM
    • Minneapolis
    • Posts 7,788
    • Moderator
      TrustedFriends-MVPs

    I found a minor glitch (the &nbsp; characters are processed):

    Raw:

        <asp:TreeView ID="TreeView1" runat="server">
            <Nodes>
                <asp:TreeNode Text="My 'tabbed' &nbsp;&nbsp;&nbsp;&nbsp; Node" Value="1"></asp:TreeNode>
                <asp:TreeNode Text="my css <span style='left:500px;position:absolute'>node</span>" Value="2"></asp:TreeNode>
            </Nodes>
        </asp:TreeView>

    Formatted:

        <asp:TreeView ID="TreeView1" runat="server">
            <Nodes>
                <asp:TreeNode Text="My 'tabbed'      Node" Value="1"></asp:TreeNode>
                <asp:TreeNode Text="my css <span style='left:500px;position:absolute'>node</span>" Value="2"></asp:TreeNode>
            </Nodes>
        </asp:TreeView>


     

    Steve Wellens

    My blog
  • Re: Source Code examples

    01-05-2010, 2:58 PM

    test

    Stack<int> intStack = new Stack<int>();
    
    Dictionary<string, string> dictionary = new Dictionary<string, string>();
    
    public void MyGenericMethod(T x, T y)
    
    {
    Console.Writeline("Parameters type is {0}", typeof(T));
    }
     


     

Page 2 of 2 (26 items) < Previous 1 2