Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

Paul Harsent

@Paul Harsent
About
Posts
32
Topics
16
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Placing C# into an ASP.net Form
    P Paul Harsent

    The object is been declared from the View when it is brought in from the model. I can access the item.price object from outside the

    , it might just be a basic miss understanding. value="50.00" I would like to be able to have value= <%item.price>% or something similar. Thanks

    <% foreach (var item in Model) { %>
    
        
            
              <%= Html.Encode(item.Id)%>
            
            
                <%= Html.Encode(String.Format("{0:F}", item.Name))%>
            
            
                <%= Html.Encode(item.Description) %>
            
            
                <%= Html.Encode(String.Format("{0:F}", item.Price)) %>
            
       
              <%if (Roles.IsUserInRole("FullMember") == false)
              {%>
                
            
    
                
                
    
                
                
    
                
                
    
                
                
    
                
                
    
                
    
                ![](https://www.paypal.com/en_US/i/scr/pixel.gif)
                       
                
            <%}
              else
              { %>
              
              <%=Html.ActionLink("Read", "ViewItem", "item", new {itemID = item.Id,itemName = item.Name, itemDescription = item.Description, itemFullArt = item.FullArt, itemPrice = item.Price }, nul
    
    ASP.NET csharp asp-net question architecture

  • Placing C# into an ASP.net Form
    P Paul Harsent

    Yes I do, but it doesnt work when I do that.

    ASP.NET csharp asp-net question architecture

  • Placing C# into an ASP.net Form
    P Paul Harsent

    I have a form for which I want the price to resemble the current price of an object. But I cant add any C# into this form. Im building a paypal program using MVC.

    <%if (Roles.IsUserInRole("FullMember") == false)
    {%>

    I want to place

    <% item.price%>

    Into the value-"10.00" place. Is this possialbe and how do I go about doing this? Thanks

    ASP.NET csharp asp-net question architecture

  • Best way to save/load data locally. WPF
    P Paul Harsent

    Afternoon, I was wondering what people though the best way to save data locally, I dont want to export to txt files. When I was developing for Windows phone, I used isoloated storage, but ov this isnt available. Thanks.

    WPF csharp wpf

  • Socket Exception
    P Paul Harsent

    It is just a method which is call by a thread, the method is passed the server IP to connect to. It throws an exception even when connecting only to one IP

    C# sysadmin help

  • Socket Exception
    P Paul Harsent

    I am trying to connect to a tcp listener, after I hit the clint.Connect(server, port) it throughts a SocketException

    public void Connect(String server, String message)
    {
    try
    {
    StreamWriter sw;
    StreamReader sr;

                int port = 5000;
                TcpClient client = new TcpClient(server, port);
    
                client.Connect(server, port);
    
    
                sw = new StreamWriter(client.GetStream());
    
                sr = new StreamReader(client.GetStream());
    
    
                sw.WriteLine(message);
                sw.Flush();
                
                string rtnMsg = sr.ReadToEnd().Trim();
    
            }
            catch (ArgumentNullException e)
            {
                Console.WriteLine("ArgumentNullException: {0}", e);
            }
            catch (SocketException e)
            {
                Console.WriteLine("SocketException: {0}", e);
            }
            catch (IOException e)
            {
    
            }
            catch (NullReferenceException e)
            {
    
            }
    
            Console.WriteLine("\\n Press Enter to continue...");
            Console.Read();
        }
    

    Any help would be really helpful.

    C# sysadmin help

  • Navigating to a specific Panorama item
    P Paul Harsent

    Hi, I have a page on a windows phone 7 app, that I want to be able to click to specific button say a "Message" button and it would navigate to the Message panorama item on another panorama page. How would I go about navigating to a specific panorama item? Thanks

    WPF question

  • The Property 'Content' is set more than once - I cant see were I am doing this
    P Paul Harsent

    I wanted two pannels inside my PanoramaItem The StackPannel will hold fix pre set info The ListBox will hold a groups of info which should be listed. somethings like that. How would I go about doing that, so that is isnt illegal. Am I using the wrong items? Thanks

    WPF wpf help wcf data-structures

  • The Property 'Content' is set more than once - I cant see were I am doing this
    P Paul Harsent

    Hi, Im new to coding in XAML and silverlight. I keep getting the error The Property 'Content' is set more than once. This error came up after I added in the top stack pannel. This is prob a very simple error to fix but I can see where I am setting the content again.

            <controls:PanoramaItem Header="">
                <StackPanel Height="100" HorizontalAlignment="Left" Margin="107,260,0,0" Name="stackPanel1" VerticalAlignment="Top" Width="200">
                    <Image Height="112" HorizontalAlignment="Left" Margin="12,184,0,0" Name="userProfilePhoto" Source="{Binding UserProfileImage}" Stretch="Fill" VerticalAlignment="Top" Width="111" />
                    <TextBlock Height="44" HorizontalAlignment="Left" Margin="129,184,0,0" Name="userProfileName" Text="TextBlock" VerticalAlignment="Top" Width="297" />
                    <Image Height="77" HorizontalAlignment="Left" Margin="350,219,0,0" Name="userProfileMood" Stretch="Fill" VerticalAlignment="Top" Width="76" />
                    <TextBlock Height="157" HorizontalAlignment="Left" Margin="129,219,0,0" Name="userProfileStatus" Text="TextBlock" VerticalAlignment="Top" Width="221" />
                </StackPanel>
    
           <ListBox Margin="0,150,0,0" ItemsSource="{Binding Items}" Height="402">
            <ListBox.ItemTemplate>
                <DataTemplate>
                      <StackPanel Margin="0,0,0,17" Width="432" >
                        <!--<Rectangle Height="100" Width="100" Fill="#FFE5001b" Margin="12,0,9,0"/>-->
                        <TextBlock Text="{Binding DatePosted}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}" />
                        <TextBlock Text="{Binding PostText}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}" />
                                <TextBlock Text="{Binding UserText}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}" />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
                
                <!--Double line list with text wrapping-->
            </controls:PanoramaItem>
    
    WPF wpf help wcf data-structures

  • Importing a WCF method into WP7 App becomes async and doesnt return the list.
    P Paul Harsent

    I am new to creating WCF projects as well as windows phone 7. I created a simple method in WCF which just returns a list of an object.

        public List GetSticky()
        {
            return stickys;
        }
    

    I then used it very simply

    Sticky[] test = client.GetSticky();

    When I import the WCF dll via a service reference into a console app the method acts how it should. When I import the method into a Windows Phone 7 application it become an async method (not sure what this means)and doesnt return a list, it comes up void.

            client.GetStickyAsync();
    

    If anyone can help explain what is going on and help me to be a little less confused. Thanks

    C# csharp css wcf help question

  • Windows Phone 7 passing multiple items between pages
    P Paul Harsent

    Thank you very much.

    C# question wpf help

  • Windows Phone 7 passing multiple items between pages
    P Paul Harsent

    Hi, I am building a simple windows phone 7 app. I need to pass more that one data item between pages. I know you need to make a small change to sending one data item across but im not sure what this change is. Currently I send one item across like this:

    phoneApplicationPage.NavigationService.Navigate(new Uri("/Pages/View_Stickies.xaml?string=" + info, UriKind.RelativeOrAbsolute));

    Where in this case info is the string sent. I unpack it on page 2 like this:

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            if (this.NavigationContext.QueryString.ContainsKey("string"))
            {
               string GPS = this.NavigationContext.QueryString\["string"\];
               MessageBox.Show(GPS);
            }
    
            base.OnNavigatedTo(e);
        }
    

    Im sure there is a very simple answer to the question and any help would be great. Thanks

    C# question wpf help

  • dictionary
    P Paul Harsent

    Readin the stream, break it up into the bit you want. Asign it into the dic. i.e. textIn = new StreamReader(File); string text = textIn.ReadLine(); var 1 = text.IndexOf("String") var 2 = text.IndexOf("String") var 3 = text.IndexOf("String") Dictionary.Add(Key, new CLing(var1, var2, var3....)) Im unsure what you want. Hopefully this helps.

    C# csharp tutorial

  • Scaling text OpenGL
    P Paul Harsent

    Im drawing text that can be rotated. But how can I scale the glutStrokeString as you can not select the size.

            Gl.glRotatef(angle, 0, 1, 0);
            Gl.glTranslatef(-600, 0, -400);
            len = Dmsg.Count();
    
            Glut.glutStrokeString(Glut.GLUT\_STROKE\_ROMAN, Dstg);
    
    C# graphics game-dev question

  • Rotate Text OpenGL
    P Paul Harsent

    I didnt know I could use c++.dll in C#, im writing it in C~ two reason one my C++ isnt good enough, and the program im writing this plug in for is writen in C#. Thanks very much will have a looked the links.

    C# tutorial csharp c++ graphics game-dev

  • Draw Text in C# using OpenGL
    P Paul Harsent

    I have been looking at the NeHe lesson and they seem to be in C++, sorry if im being blind. Also what is the best way to rotate text, i.e. having it writing at the angle or vertical. Thanks

    C# help csharp c++ graphics game-dev

  • Rotate Text OpenGL
    P Paul Harsent

    Hi, I have been building a project in OpenGL, and the code to display text I have been using is

    Glut.glutBitmapCharacter()

    which cant be rotated. There are loads of tutorials out there for C and C++, but not for C#. Do anyone know how to rotate text in OpenGl, or a good step tutorial. This is the code class I used to render my text

    class String
    {
        public String()
        {
    
        }
    
        public void RenderString(double p\_x, double p\_y, string str, float rotateAngle)
        {
            float x = (float)p\_x;
            float y = (float)p\_y;
            Gl.glRasterPos2f(x, y);
            
            int len = str.Length;
    
            for (int i = 0; i < len; i++)
            {
                Gl.glClearColor(0, 0, 0, 0);
                Gl.glColor3f(0, 0, 0);
              
                Glut.glutBitmapCharacter(Glut.GLUT\_BITMAP\_HELVETICA\_18, str\[i\]);               
               
            }
        }
    
    }
    

    }

    C# tutorial csharp c++ graphics game-dev

  • Rendering issue C#
    P Paul Harsent

    I am drawing a custom graph in c# openGL. When I load the program the the Y axis lables draws (it is draw as txt) but everything else, the box representing the bars on the graph and the axis dont draw until you resize the window normally going from full screen down to a smaller window then the graph draws properly. Does anyone have any ideas why this might be or have had a similar problem. thanks.

    C# graphics help csharp game-dev data-structures

  • Interactive 2D openGL
    P Paul Harsent

    Hi, I need some advice on the best way to go about this so I dont end up making it overly complicated. I have a 2d graph draw in openGL the scale is set on drawing depending how much data there is. What I need to do is make it interactive because at the moment with large ammount of data the finer point are lost because the scale is so big. what would the best was to impliement a zoom feature so you can see part of the graph in more detail and move around the graph close up. Im not the most advanced with openGL but any help would be great. fyi this isnt for any collage or school work.

    C# graphics game-dev data-structures help

  • Removing values in a dictionary [modified]
    P Paul Harsent

    I feel very stupid. I was checking for the following space and having looked at the code for so long didnt see the lead space. Thanks very much.

    C#
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups