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
  1. Home
  2. General Programming
  3. C#
  4. C# need some direction

C# need some direction

Scheduled Pinned Locked Moved C#
csharpc++adobedata-structureshelp
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    marksmit
    wrote on last edited by
    #1

    Hi All, I'm pretty new here so excuse my ignorance ;) I've just started learning C# and come from a long history of C/C++/PowerBASIC/Assembly, 20 years total. To learn C# I decided to jump in with both feet and recreate some past projects for fun. So here is what I want to do and where I am getting stuck. I have a Layout which consists of Tracks, each Track contains Layers. Think of this like an multi-track audio application and Photoshop combined. Each Track in a Layout should have a unique Name. Every Layer in a Track should also have a unique Name. This sounds to me like I need to use a Dictionary collection. I also need to iterate over these Tracks and Layers in order to draw them IN the correct order. The order should be user defined and should allow for user re-ordering (MoveUp MoveDown type of thing). So I'm left thinking I need a Dictionary + Sorted Array by Order collection? I'm sure this can be done but as I said I'm quite new to C#/.NET and would like some direction. Thanks!

    H C S M 5 Replies Last reply
    0
    • M marksmit

      Hi All, I'm pretty new here so excuse my ignorance ;) I've just started learning C# and come from a long history of C/C++/PowerBASIC/Assembly, 20 years total. To learn C# I decided to jump in with both feet and recreate some past projects for fun. So here is what I want to do and where I am getting stuck. I have a Layout which consists of Tracks, each Track contains Layers. Think of this like an multi-track audio application and Photoshop combined. Each Track in a Layout should have a unique Name. Every Layer in a Track should also have a unique Name. This sounds to me like I need to use a Dictionary collection. I also need to iterate over these Tracks and Layers in order to draw them IN the correct order. The order should be user defined and should allow for user re-ordering (MoveUp MoveDown type of thing). So I'm left thinking I need a Dictionary + Sorted Array by Order collection? I'm sure this can be done but as I said I'm quite new to C#/.NET and would like some direction. Thanks!

      H Offline
      H Offline
      Henry Minute
      wrote on last edited by
      #2

      A Dictionary might be the way to go, but you will have to be very careful what you use for the key. If you use trackName it will complicate retrieving the display order. Even if you use displayIndex, implementing the move up/down functionality could get complicated. Without thinking about it for a while, I don't have a better suggestion, but I'm sure that somebody will.

      Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

      1 Reply Last reply
      0
      • M marksmit

        Hi All, I'm pretty new here so excuse my ignorance ;) I've just started learning C# and come from a long history of C/C++/PowerBASIC/Assembly, 20 years total. To learn C# I decided to jump in with both feet and recreate some past projects for fun. So here is what I want to do and where I am getting stuck. I have a Layout which consists of Tracks, each Track contains Layers. Think of this like an multi-track audio application and Photoshop combined. Each Track in a Layout should have a unique Name. Every Layer in a Track should also have a unique Name. This sounds to me like I need to use a Dictionary collection. I also need to iterate over these Tracks and Layers in order to draw them IN the correct order. The order should be user defined and should allow for user re-ordering (MoveUp MoveDown type of thing). So I'm left thinking I need a Dictionary + Sorted Array by Order collection? I'm sure this can be done but as I said I'm quite new to C#/.NET and would like some direction. Thanks!

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        If by user defined, you just mean the user can reorder them manually, then just a dictionary works fine to create mappings of Tracks to Layers. I thought that the order of keys remains the order in which they were added, also, although I am not sure that the collection supports remove at index and add at index, I would have to hope that it did.

        Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

        1 Reply Last reply
        0
        • M marksmit

          Hi All, I'm pretty new here so excuse my ignorance ;) I've just started learning C# and come from a long history of C/C++/PowerBASIC/Assembly, 20 years total. To learn C# I decided to jump in with both feet and recreate some past projects for fun. So here is what I want to do and where I am getting stuck. I have a Layout which consists of Tracks, each Track contains Layers. Think of this like an multi-track audio application and Photoshop combined. Each Track in a Layout should have a unique Name. Every Layer in a Track should also have a unique Name. This sounds to me like I need to use a Dictionary collection. I also need to iterate over these Tracks and Layers in order to draw them IN the correct order. The order should be user defined and should allow for user re-ordering (MoveUp MoveDown type of thing). So I'm left thinking I need a Dictionary + Sorted Array by Order collection? I'm sure this can be done but as I said I'm quite new to C#/.NET and would like some direction. Thanks!

          S Offline
          S Offline
          sgenie68
          wrote on last edited by
          #4

          You can use queries with orderby clause - then you can have your displayOrder as a part of your Track schema and make sequence ordering by this parameter while maintaining Dictionary capability.

          1 Reply Last reply
          0
          • M marksmit

            Hi All, I'm pretty new here so excuse my ignorance ;) I've just started learning C# and come from a long history of C/C++/PowerBASIC/Assembly, 20 years total. To learn C# I decided to jump in with both feet and recreate some past projects for fun. So here is what I want to do and where I am getting stuck. I have a Layout which consists of Tracks, each Track contains Layers. Think of this like an multi-track audio application and Photoshop combined. Each Track in a Layout should have a unique Name. Every Layer in a Track should also have a unique Name. This sounds to me like I need to use a Dictionary collection. I also need to iterate over these Tracks and Layers in order to draw them IN the correct order. The order should be user defined and should allow for user re-ordering (MoveUp MoveDown type of thing). So I'm left thinking I need a Dictionary + Sorted Array by Order collection? I'm sure this can be done but as I said I'm quite new to C#/.NET and would like some direction. Thanks!

            M Offline
            M Offline
            marksmit
            wrote on last edited by
            #5

            Just want to say thanks for the advise so far. You've given me some more things to think about and try. I'm going to spend today tinkering again and might post some code later for further advise. ;)

            1 Reply Last reply
            0
            • M marksmit

              Hi All, I'm pretty new here so excuse my ignorance ;) I've just started learning C# and come from a long history of C/C++/PowerBASIC/Assembly, 20 years total. To learn C# I decided to jump in with both feet and recreate some past projects for fun. So here is what I want to do and where I am getting stuck. I have a Layout which consists of Tracks, each Track contains Layers. Think of this like an multi-track audio application and Photoshop combined. Each Track in a Layout should have a unique Name. Every Layer in a Track should also have a unique Name. This sounds to me like I need to use a Dictionary collection. I also need to iterate over these Tracks and Layers in order to draw them IN the correct order. The order should be user defined and should allow for user re-ordering (MoveUp MoveDown type of thing). So I'm left thinking I need a Dictionary + Sorted Array by Order collection? I'm sure this can be done but as I said I'm quite new to C#/.NET and would like some direction. Thanks!

              M Offline
              M Offline
              marksmit
              wrote on last edited by
              #6

              Ok guys, Looks like I've gone a thoroughly confused myself here. Perhaps one of you kind folks can chime in and set me straight. Here are my requirements: 1. Collection of layers called layerCollection 2. Each Layer must have a Name property that is unique to the collection it resides in. 3. You can access each Layer in the collection by Name or Index[] foundLayer = layerCollection.getLayer("Background"); <-- returns Layer with layerName = "Border" foundLayer = layerCollection.getLayer("Border"); foundLayer = layerCollection [0]; foundLayer = layerCollection [1]; etc... Help :D Once I figure this part out I'm sure sorting the layerCollection to reorder them will be a simple task. Thanks again for your help and patience!

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

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