コード例 #1
0
ファイル: InsertGEFileCommand.cs プロジェクト: msCube/Gallery
        public InsertGeFileCommand(string fileName, GraphicContent graphicContent)
        {
            f_layers = new List<Layer>();
            Canvas loadedCanvas;
            using (FileStream fileStream = new FileStream(fileName, FileMode.Open))
            {
                try
                {
                    loadedCanvas = XamlReader.Load(fileStream) as Canvas;
                }
                catch (XamlParseException exception)
                {
                    MessageBox.Show(exception.ToString(), @"Error adding layer");
                    return;
                }
                catch (ArgumentException exception)
                {
                    MessageBox.Show(exception.ToString(), @"Error adding layer");
                    return;
                }
            }

            if (loadedCanvas == null) return;

            foreach (Layer layer in loadedCanvas.Children)
                f_layers.Add(layer.Clone(false));

            f_graphicContent = graphicContent;
        }
コード例 #2
0
ファイル: CommandReceiver.cs プロジェクト: msCube/Gallery
 public void InsertGeFile(string filename, GraphicContent graphicContent)
 {
     f_command = new InsertGeFileCommand(filename, graphicContent);
     f_undoCommands.Push(f_command);
     f_redoCommands.Clear();
     f_command.Execute();
 }
コード例 #3
0
ファイル: Tool.cs プロジェクト: msCube/Gallery
 public Tool(GraphicContent graphicContent)
 {
     f_graphicContent = graphicContent;
     f_graphicContent.WorkSpace.MouseMove += MouseMoveHandler;
     f_graphicContent.WorkSpace.MouseLeftButtonDown += MouseDownHandler;
     f_graphicContent.WorkSpace.MouseLeftButtonUp += MouseUpHandler;
 }
コード例 #4
0
ファイル: BrushTool.cs プロジェクト: msCube/Gallery
 public BrushTool(GraphicContent graphicContent)
     : base(graphicContent)
 {
     f_thickness = 2;
     f_opacity = 1;
     f_softness = 10;
     Name = "Brush";
 }
コード例 #5
0
ファイル: LineTool.cs プロジェクト: msCube/Gallery
 public LineTool(GraphicContent graphicContent)
     : base(graphicContent)
 {
     f_thickness = 10;
     f_opacity = 1;
     f_softness = 10;
     Name = "Line";
 }
コード例 #6
0
 public LayersChildWindowFactory(GraphicContent graphicContent)
 {
     GraphicContent = graphicContent;
     ChildWindow = new LayersViewChildWindow { Header = "Layers" };
     ChildWindow.Move(-20, 10);
     ((LayersViewViewModel)ChildWindow.ViewModel).AddLayer(GraphicContent.SelectedLayer);
     ((LayersViewViewModel)ChildWindow.ViewModel).OnLayerCreate += LayerWindowViewModel_OnLayerCreate;
     ((LayersViewViewModel)ChildWindow.ViewModel).OnLayerDelete += LayerWindowViewModel_OnLayerDelete;
     ((LayersViewViewModel)ChildWindow.ViewModel).OnLayerDublicate += LayerWindowViewModel_OnLayerDublicate;
     GraphicContent.OnLayerCreate += GraphicContentOnOnLayerCreate;
     GraphicContent.OnLayerRemove += GraphicContentOnOnLayerRemove;
 }
コード例 #7
0
ファイル: MainWindowViewModel.cs プロジェクト: msCube/Gallery
 public MainWindowViewModel()
 {
     SubscribeToCommands();
     GraphicContent = new GraphicContent();
     GraphicContent.WorkSpace.MouseMove += GraphicContentWorkSpaceMouseMove;
     ConfigureWorkSpace();
     f_layersChildWindowFactory = new LayersChildWindowFactory(GraphicContent);
     f_colorPickerChildWindowFactory = new ColorPickerChildWindowFactory();
     f_zoomBoxChildWindowFactory = new ZoomBoxChildWindowFactory();
     ((ZoomBoxChildWindow)f_zoomBoxChildWindowFactory.ChildWindow).ScrollViewer = ScrollViewer;
     ((ColorPickerViewModel)f_colorPickerChildWindowFactory.ChildWindow.ViewModel).Subscribe(GraphicContent.GraphicToolProperties);
     f_childWindows = new List<IChildWindowFactory>()
     {
         f_layersChildWindowFactory,
         f_colorPickerChildWindowFactory,
         f_zoomBoxChildWindowFactory
     };
 }
コード例 #8
0
ファイル: FillTool.cs プロジェクト: msCube/Gallery
 public FillTool(GraphicContent graphicContent) : base(graphicContent)
 {
     Name = "Fill";
 }
コード例 #9
0
ファイル: NoTool.cs プロジェクト: msCube/Gallery
 public NoTool(GraphicContent graphicContent)
     : base(graphicContent)
 {
 }
コード例 #10
0
ファイル: PointerTool.cs プロジェクト: msCube/Gallery
 public PointerTool(GraphicContent graphicContent)
     : base(graphicContent)
 {
     Name = "Pointer";
 }