Exemple #1
0
 public void RemoveCanvas(CCanvas c)
 {
     foreach (Workspace ws in allWorkspaces)
     {
         ws.RemoveCanvas(c);
     }
 }
Exemple #2
0
 public void RefreshNames(ObservableCollection <CCanvas> allCanvases)
 {
     foreach (SketchThumbnail s in Sketches)
     {
         CCanvas c = allCanvases.Where(x => x.ID == s.canvasID).ToList()[0];
         s.name = c.name;
     }
 }
        public CCanvas NewCanvas()
        {
            ObservableCollection <CCanvas> NewCanvases = allCanvases;
            CCanvas newCanvas = new CCanvas(NextID());

            NewCanvases.Add(newCanvas);
            allCanvases = NewCanvases;
            return(newCanvas);
        }
Exemple #4
0
 public void RemoveCanvas(CCanvas c)
 {
     for (int i = Sketches.Count - 1; i >= 0; i--)
     {
         if (Sketches[i].canvasID == c.ID)
         {
             Sketches.RemoveAt(i);
         }
     }
     c.isInActiveWS = false;
 }
 public SketchThumbnail(CCanvas c, double zindex)
 {
     _canvasID      = c.ID;
     _canvas        = c;
     _matchesFilter = true;
     name           = c.name;
     x         = 50;
     y         = 50;
     z         = zindex;
     width     = 100 * (int)Settings.Default.workingAreaWidth / (int)Settings.Default.workingAreaHeight;
     height    = 100;
     Scale     = 1.0;
     thumbnail = c.thumbnail;
 }
 public void LoadAllCanvases(string path)
 {
     foreach (string file in Directory.EnumerateFiles(path))
     {
         if (File.Exists(file))
         {
             CCanvas newCanvas = NewCanvas();
             using (FileStream fs = new FileStream(file, FileMode.Open))
             {
                 newCanvas.canvas.Strokes = new StrokeCollection(fs);
             }
             allCanvases.Add(newCanvas);
         }
     }
 }
        public CCanvas CloneCanvas(CCanvas c)
        {
            ObservableCollection <CCanvas> NewCanvases = allCanvases;
            CCanvas newCanvas = new CCanvas(NextID());

            foreach (Stroke s in c.canvas.Strokes)
            {
                newCanvas.canvas.Strokes.Add(s.Clone());
            }

            newCanvas.name = string.Format("{0} - Copy", c.name);

            NewCanvases.Add(newCanvas);
            allCanvases = NewCanvases;
            return(newCanvas);
        }
Exemple #8
0
        public void AddCanvas(CCanvas c)
        {
            // Only add the canvas if it is not already here
            if (Sketches.Count(s => s.canvasID == c.ID) == 0)
            {
                ObservableCollection <SketchThumbnail> newSketches = Sketches;

                SketchThumbnail s = new SketchThumbnail(c, newSketches.Count);

                Point p = GetNextPoint(_lastInitPoint);
                s.x            = p.X;
                s.y            = p.Y;
                _lastInitPoint = p;

                newSketches.Add(s);
                Sketches = newSketches;

                c.isInActiveWS = true;
            }
        }