Beispiel #1
0
 public CookerTree(CookerDocument document)
 {
     ShowRoot          = false;
     AllowDrop         = true;
     this.document     = document;
     DragDrop         += CookerTree_DragDrop;
     DragOver         += CookerTree_DragOver;
     DragEnter        += CookerTree_DragEnter;
     SelectionChanged += CookerTree_SelectionChanged;
 }
Beispiel #2
0
        public static void Run(IDocument document)
        {
            CookerDocument doc = document as CookerDocument;

            if (doc != null)
            {
                Console.WriteLine(String.Format("Cooking project: {0}", doc.Uri.ToString()));
                doc.Cook();
            }
            else
            {
                Console.WriteLine("ERROR: Document is not a valid CookerDocument");
                Console.WriteLine(String.Format("    Found: {0}", document.GetType().FullName));
            }
        }
Beispiel #3
0
        public CookerView(CookerDocument doc) : base(doc)
        {
            InitializeComponent();

            palette      = new CookerPalette();
            palette.Dock = DockStyle.Fill;

            contents      = new CookerTree(doc);
            contents.Dock = DockStyle.Fill;

            splitter.Panel1.Controls.Add(palette);
            splitter.Panel2.Controls.Add(contents);

            // Toolstrip commands for the cooker
            ToolStrip st = new ToolStrip();

            st.Dock = DockStyle.Top;
            Controls.Add(st);

            // Cook
            ToolStripButton cookCmd = new ToolStripButton("Cook");

            cookCmd.Click += (src, args) =>
            {
                doc.Cook();
            };
            st.Items.Add(cookCmd);

            // Delete
            ToolStripButton deleteCmd = new ToolStripButton("");

            deleteCmd.Image  = EditorCore.Media.ImageUtil.FromResourceFolder("delete.png");
            deleteCmd.Click += (src, args) =>
            {
                contents.DeleteSelected();
            };
            st.Items.Add(deleteCmd);
        }