Esempio n. 1
0
 public MDView(IStatusbarService statusbar)
 {
     _md = new Markdown();
     this._statusbar = statusbar;
     InitializeComponent();
     textEditor.TextArea.Caret.PositionChanged += Caret_PositionChanged;
 }
Esempio n. 2
0
 public MDView(IStatusbarService statusbar)
 {
     _md        = new Markdown();
     _statusbar = statusbar;
     InitializeComponent();
     textEditor.TextArea.Caret.PositionChanged += Caret_PositionChanged;
 }
Esempio n. 3
0
 /// <summary>
 /// The generic workspace that will be used if the application does not have its workspace
 /// </summary>
 /// <param name="container">The injected container - can be used by custom flavors of workspace</param>
 /// <param name="eventAggregator">The event aggregator.</param>
 public Workspace(IEventAggregator eventAggregator,
                  IMenuService menuService,
                  IShellToolbarService shellToolbarService,
                  IStatusbarService statusbarService,
                  ICommandManager commandManager)
     : base(eventAggregator, menuService, shellToolbarService, statusbarService, commandManager)
 {
 }
Esempio n. 4
0
 /// <summary>
 /// Constructor of content handler registry
 /// </summary>
 /// <param name="container">The injected container of the application</param>
 public ContentHandlerRegistry(IUnityContainer container, IStatusbarService statusBar)
 {
     _contentHandlers     = new List <IContentHandler>();
     _container           = container;
     _statusBar           = statusBar;
     _dictionary          = new Dictionary <NewContentAttribute, IContentHandler>();
     _availableNewContent = new List <NewContentAttribute>();
     this.NewCommand      = new DelegateCommand(NewDocument, CanExecuteNewCommand);
 }
 /// <summary>
 /// Constructor of content handler registry
 /// </summary>
 /// <param name="container">The injected container of the application</param>
 public ContentHandlerRegistry(IUnityContainer container, IStatusbarService statusBar)
 {
     _contentHandlers = new List<IContentHandler>();
     _container = container;
     _statusBar = statusBar;
     _dictionary = new Dictionary<NewContentAttribute, IContentHandler>();
     _availableNewContent = new List<NewContentAttribute>();
     this.NewCommand = new DelegateCommand(NewDocument, CanExecuteNewCommand);
 }
Esempio n. 6
0
 public HSView(IStatusbarService statusbar)
 {
     this._statusbar = statusbar;
     InitializeComponent();
     textEditor.TextArea.Caret.PositionChanged += Caret_PositionChanged;
     using (Stream s = typeof(HSView).Assembly.GetManifestResourceStream("HDevelop.Core.Hassium.xshd"))
     {
         using (XmlTextReader reader = new XmlTextReader(s))
         {
             textEditor.SyntaxHighlighting = HighlightingLoader.Load(reader, HighlightingManager.Instance);
         }
     }
 }
Esempio n. 7
0
 public HSView(IStatusbarService statusbar)
 {
     this._statusbar = statusbar;
     InitializeComponent();
     textEditor.TextArea.Caret.PositionChanged += Caret_PositionChanged;
     using (Stream s = typeof(HSView).Assembly.GetManifestResourceStream("HDevelop.Core.Hassium.xshd"))
     {
         using (XmlTextReader reader = new XmlTextReader(s))
         {
             textEditor.SyntaxHighlighting = HighlightingLoader.Load(reader, HighlightingManager.Instance);
         }
     }
 }
Esempio n. 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AbstractWorkspace" /> class.
 /// </summary>
 /// <param name="container">The injected container.</param>
 /// <param name="eventAggregator">The event aggregator.</param>
 protected AbstractWorkspace(IUnityContainer container, IEventAggregator eventAggregator)
 {
     _container               = container;
     _eventAggregator         = eventAggregator;
     _docs                    = new ObservableCollection <ContentViewModel>();
     _docs.CollectionChanged += Docs_CollectionChanged;
     _tools                   = new ObservableCollection <ToolViewModel>();
     _menus                   = _container.Resolve <IMenuService>() as MenuItemViewModel;
     _menus.PropertyChanged  += _menus_PropertyChanged;
     _toolbarService          = _container.Resolve <IToolbarService>() as AbstractToolbar;
     _statusbarService        = _container.Resolve <IStatusbarService>();
     _commandManager          = _container.Resolve <ICommandManager>();
 }
Esempio n. 9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AbstractWorkspace" /> class.
        /// </summary>
        /// <param name="container">The injected container.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        protected AbstractWorkspace(IUnityContainer container, IEventAggregator eventAggregator)
        {
            _container               = container;
            _eventAggregator         = eventAggregator;
            _docs                    = new ObservableCollection <ContentViewModel>();
            _docs.CollectionChanged += Docs_CollectionChanged;
            _tools                   = new ObservableCollection <ToolViewModel>();
            _menus                   = _container.Resolve <IMenuService>() as MenuItemViewModel;
            _menus.PropertyChanged  += _menus_PropertyChanged;
            _toolbarService          = _container.Resolve <IToolbarService>() as AbstractToolbar;
            _statusbarService        = _container.Resolve <IStatusbarService>();
            _commandManager          = _container.Resolve <ICommandManager>();

            //    this.ConfirmationRequest = new InteractionRequest<Confirmation>();
            //     this.NotificationRequest = new InteractionRequest<Notification>();

            MinHeight = 200; //default
            MinHeight = 200; //default
        }
Esempio n. 10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AbstractWorkspace" /> class.
        /// </summary>
        /// <param name="container">The injected container.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        protected AbstractWorkspace()
        {
            _docs = new ObservableCollection <ContentViewModel>();
            _docs.CollectionChanged += Docs_CollectionChanged;
            _tools = new ObservableCollection <ToolViewModel>();
            _menus = VEFModule.UnityContainer.Resolve(typeof(IMenuService), "") as MenuItemViewModel;
            //     _menus = VEFModule.UnityContainer.Resolve(typeof(MenuItemViewModel), "MenuItemViewModel") as MenuItemViewModel;
            _menus.PropertyChanged += _menus_PropertyChanged;
            _toolbarService         = VEFModule.UnityContainer.Resolve(typeof(IToolbarService), "") as AbstractToolbar;
            //    _toolbarService = VEFModule.UnityContainer.Resolve(typeof(AbstractToolbar), "AbstractToolbar") as AbstractToolbar;
            _statusbarService = VEFModule.UnityContainer.Resolve(typeof(IStatusbarService), "") as IStatusbarService;
            _commandManager   = VEFModule.UnityContainer.Resolve(typeof(ICommandManager), "") as ICommandManager;

            //    this.ConfirmationRequest = new InteractionRequest<Confirmation>();
            //     this.NotificationRequest = new InteractionRequest<Notification>();

            MinHeight = 200; //default
            MinHeight = 200; //default
        }
Esempio n. 11
0
        //private MjolnirApp _applicationDefinition;

        //[JsonIgnore]
        //public ImageSource Icon
        //{
        //    get
        //    {
        //        return _applicationDefinition.ApplicationIconSource;
        //    }
        //}

        //[JsonIgnore]
        //public string Title
        //{
        //    get
        //    {
        //        return _applicationDefinition.ApplicationName;
        //    }
        //}

        #endregion

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="DefaultWorkspace" /> class.
        /// </summary>
        /// <param name="container">The injected container.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        protected DefaultWorkspace(IEventAggregator eventAggregator,
                                   IMenuService menuService,
                                   IShellToolbarService shellToolbarService,
                                   IStatusbarService statusbarService,
                                   ICommandManager commandManager)
        {
            _eventAggregator  = eventAggregator;
            _toolbarService   = shellToolbarService as DefaultToolbar;
            _statusbarService = statusbarService;
            _commandManager   = commandManager;
            _menuService      = menuService;

            _menuService.PropertyChanged += _menus_PropertyChanged;

            _docs = new ObservableCollection <ContentViewModel>();
            _docs.CollectionChanged += Docs_CollectionChanged;
            _tools = new ObservableCollection <ToolViewModel>();

            IsValidationEnabled = false;
        }
Esempio n. 12
0
        public PyView(IStatusbarService statusbar)
        {
            InitializeComponent();

            this._statusbar = statusbar;
            InitializeComponent();
            textEditor.TextArea.Caret.PositionChanged += Caret_PositionChanged;
            editor = textEditor;

            try
            {
                byte[] r = Encoding.Default.GetBytes("30");
                byte[] g = Encoding.Default.GetBytes("40");
                byte[] b = Encoding.Default.GetBytes("34");
                textEditor.Background = new SolidColorBrush(Color.FromRgb(r[0], g[0], b[0]));
                IHighlightingDefinition pythonHighlighting;
                using (Stream s = typeof(PyView).Assembly.GetManifestResourceStream("Turtle_IDE.Core.Resource.Python.xshd"))
                {
                    if (s == null)
                    {
                        throw new InvalidOperationException("Could not find embedded resource");
                    }
                    using (XmlReader reader = new XmlTextReader(s))
                    {
                        pythonHighlighting = ICSharpCode.AvalonEdit.Highlighting.Xshd.
                                             HighlightingLoader.Load(reader, HighlightingManager.Instance);
                    }
                }

                HighlightingManager.Instance.RegisterHighlighting("Python Highlighting", new string[] { ".cool" }, pythonHighlighting);
                textEditor.SyntaxHighlighting = pythonHighlighting;
                IList <IVisualLineTransformer> transformers = textEditor.TextArea.TextView.LineTransformers;
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 13
0
 /// <summary>
 /// Constructor of content handler registry
 /// </summary>
 /// <param name="container">The injected container of the application</param>
 public ContentHandlerRegistry(IUnityContainer container, IStatusbarService statusBar)
     : base(container, statusBar)
 {
 }
Esempio n. 14
0
        public PyCraftView(IStatusbarService statusbar)
        {
            this._statusbar = statusbar;
            InitializeComponent();
            _panel         = new Panel();
            WFH.Child      = _panel;
            _panel.Resize += new EventHandler(this._panel_Resize);

            textEditor.TextArea.Caret.PositionChanged += Caret_PositionChanged;
            editor = textEditor;

            try
            {
                byte[] r = Encoding.Default.GetBytes("30");
                byte[] g = Encoding.Default.GetBytes("40");
                byte[] b = Encoding.Default.GetBytes("34");
                textEditor.Background = new SolidColorBrush(Color.FromRgb(r[0], g[0], b[0]));
                IHighlightingDefinition pythonHighlighting;
                using (Stream s = typeof(PyCraftView).Assembly.GetManifestResourceStream("Turtle_IDE.Core.Resource.Python.xshd"))
                {
                    if (s == null)
                    {
                        throw new InvalidOperationException("Could not find embedded resource");
                    }
                    using (XmlReader reader = new XmlTextReader(s))
                    {
                        pythonHighlighting = ICSharpCode.AvalonEdit.Highlighting.Xshd.
                                             HighlightingLoader.Load(reader, HighlightingManager.Instance);
                    }
                }

                HighlightingManager.Instance.RegisterHighlighting("Python Highlighting", new string[] { ".cool" }, pythonHighlighting);
                textEditor.SyntaxHighlighting = pythonHighlighting;
                IList <IVisualLineTransformer> transformers = textEditor.TextArea.TextView.LineTransformers;
            }
            catch (Exception e)
            {
                System.Windows.Forms.MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            new Thread(() =>
            {
                try
                {
                    Thread.CurrentThread.IsBackground = true;
                    ProcessStartInfo pro = new ProcessStartInfo("cmd.exe", "/k" + Environment.CurrentDirectory + @"\External\\WPy3710\scripts\pycraft.bat");
                    pro.WindowStyle      = ProcessWindowStyle.Hidden;
                    Process pycraft      = Process.Start(pro);
                }
                catch (Exception e)
                {
                    System.Windows.Forms.MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }).Start();

            IntPtr hWnd  = IntPtr.Zero;
            bool   isrun = false;

            while (!isrun)
            {
                foreach (Process pList in Process.GetProcesses())
                {
                    if (pList.MainWindowTitle.Contains("Pyglet"))
                    {
                        hWnd  = pList.MainWindowHandle;
                        isrun = true;
                    }
                }
            }

            // remove control box
            int style = GetWindowLong(WinGetHandle("Pyglet"), GWL_STYLE);

            style = style & ~WS_CAPTION & ~WS_THICKFRAME;
            SetWindowLong(WinGetHandle("Pyglet"), GWL_STYLE, style);
            SetParent(hWnd, _panel.Handle);

            // resize embedded application & refresh
            //ResizeEmbeddedApp();
        }