public CustomersAdministrationViewModel(ISession session)
        {
            _session = session;

            #region Maintance - Customers

            Actions.Add(new AdministrationActionViewModel()
            {
                Action = (p) =>
                {
                                    IsBusy = true;

                    Dispatcher.CurrentDispatcher.BeginInvoke((Action) delegate
                                                                          {
                                                                              View =
                                                                                  new EditorView(_session);
                                                                              View.DataContext =
                                                                                  new EditorViewModel
                                                                                      <Customer>(_session);

                                                                              IsBusy = false;
                                                                          }, DispatcherPriority.Background);
                },
                Category = "Maintance",
                Title = "Customers"
            });

            #endregion
        }
    public override IView Create(ViewTypes type)
    {
        IView view = null;
        switch (type) {
            case ViewTypes.EDITOR_LANDING:
                view = new EditorView(services.ViewService);
                break;
            case ViewTypes.EDITOR_PATH:
                view = new PathView((services as EditorServices).PathService, services.ViewService);
                break;
            case ViewTypes.EDITOR_EDIT_PATH:
                view = new EditPathView((services as EditorServices).PathService, services.ViewService);
                break;
            case ViewTypes.EDITOR_LEVELS:
                view = new LevelsView((services as EditorServices).LevelService, services.ViewService,
                    (services as EditorServices).PathService, (services as EditorServices).EnemyService,
                    (services as EditorServices).BonusService, (services as EditorServices).DifficultyService);
                break;
            case ViewTypes.EDITOR_EDIT_LEVEL:
                view = new EditLevelView(services.Pool,
                    (services as EditorServices).LevelService,
                    services.ViewService,
                    (services as EditorServices).PathService,
                    (services as EditorServices).EnemyService);
                break;
            case ViewTypes.EDITOR_EDIT_ENEMY:
                view = new EditEnemyView(services.Pool, services.ViewService, (services as EditorServices).EnemyService);
                break;
            case ViewTypes.EDITOR_ENEMIES:
                view = new EnemiesView(services.Pool, services.ViewService, (services as EditorServices).EnemyService);
                break;
            case ViewTypes.EDITOR_EDIT_DIFFICULTY:
                view = new EditDifficultyView(services.Pool, services.ViewService, (services as EditorServices).DifficultyService);
                break;
            case ViewTypes.EDITOR_DIFFICULTIES:
                view = new DifficultiesView(services.Pool, services.ViewService, (services as EditorServices).DifficultyService);
                break;
            case ViewTypes.EDITOR_EDIT_BONUS:
                view = new EditBonusView(services.Pool, services.ViewService, (services as EditorServices).BonusService);
                break;
            case ViewTypes.EDITOR_BONUSES:
                view = new BonusesView(services.Pool, services.ViewService, (services as EditorServices).BonusService);
                break;
            case ViewTypes.EDITOR_EDIT_LANGUAGE:
                view = new EditLanguageView(services.Pool, services.ViewService, (services as EditorServices).LanguageService);
                break;
            case ViewTypes.EDITOR_LANUGAGES:
                view = new LanguagesView(services.Pool, services.ViewService, (services as EditorServices).LanguageService);
                break;
        }
        if (view == null) {
            view = base.Create(type);
        }
        else {
            initView(view);
        }

        return view;
    }
Beispiel #3
0
        public EditorTab(EditorView v, EditorInstance i, IntPtr h)
        {
            view = v;
            instance = i;
            handle = h;

            initDone = false;
        }
        /// <summary>
        /// Initializes the control.
        /// </summary>
        protected override void Initialize()
        {
            effect = new BasicEffect(this.GraphicsDevice);

            // Get our editor view.
            editorView = Hephaestus.ViewManager.GetEditorView(this.GraphicsDevice);

            // Start editor timer
            timer = Stopwatch.StartNew();

            // Hook the idle event to keep redrawing the animation
            Application.Idle += delegate { Invalidate(); };
        }
        public ProjectLineBuffer(
			Project project,
			EditorView editorView)
        {
            // Save the parameters as member fields for later.
            this.project = project;
            this.editorView = editorView;

            // Pull out some common elements.
            blocks = this.project.Blocks;
            commands = project.Commands;

            // Hook up the events.
            editorView.Controller.PopulateContextMenu += OnPopulateContextMenu;
            blocks.BlockTextChanged += OnBlockTextChanged;
            blocks.TextSpansChanged += OnTextSpansChanged;
            blocks.BlockTypeChanged += OnBlockTypeChanged;
        }
		public ImeHighlight(EditorView editorView)
		{
			_editorView = editorView;
			_editorHelper = new SourceEditorViewHelper(_editorView);
			Color highlightColor = SystemColors.HighlightColor;
			Color color = Color.FromArgb(0x60, highlightColor.R, highlightColor.G, highlightColor.B);
			Color color3 = Color.FromArgb(180, (Byte)(highlightColor.R / 3), (Byte)(highlightColor.G / 3), (Byte)(highlightColor.B / 3));
			_baseBrush = new SolidColorBrush(color);
			_blinkBrush = new SolidColorBrush(color3);
			_provisionalSpan = null;
			Int32 caretBlinkTime = User32.GetCaretBlinkTime();
			if (caretBlinkTime > 0)
			{
				_blinkTimer = new Timer((Double)caretBlinkTime);
				_blinkTimer.AutoReset = true;
			}
			base.Visibility = Visibility.Hidden;
			base.IsVisibleChanged += new DependencyPropertyChangedEventHandler(this.OnThisVisibilityChanged);
		}
		/// <summary>
		/// </summary>
		public CaretElement(EditorView editorView)
		{
			SizeChangedEventHandler handler = null;
			_editorView = editorView;
			_caretPlacement = CaretPlacement.LeftOfCharacter;
			_insertionPoint = new TextPoint(editorView.TextBuffer, 0);
			_preferredVerticalPosition = _preferredHorizontalPosition = 0;
			_textViewHelper = new TextViewHelper(_editorView);
			this.ConstructCaretGeometry();
			TextLine line = TextFormatter.Create().FormatLine(new DefaultLineGutterTextSource("W", TextFormattingRunProperties.DefaultProperties), 0, 10, new TextFormattingParagraphProperties(), null);
			_defaultOverwriteCaretWidth = line.Width;
			_overwriteCaretBrush = new SolidColorBrush(Colors.Gray);
			_overwriteCaretBrush.Opacity = 0.5;
			DoubleAnimationUsingKeyFrames frames = new DoubleAnimationUsingKeyFrames();
			frames.BeginTime = new TimeSpan((long)0);
			frames.RepeatBehavior = RepeatBehavior.Forever;
			frames.KeyFrames.Add(new DiscreteDoubleKeyFrame(1, KeyTime.FromPercent(0)));
			Int32 caretBlinkTime = User32.GetCaretBlinkTime();
			if (caretBlinkTime > 0)
			{
				frames.KeyFrames.Add(new DiscreteDoubleKeyFrame(0, KeyTime.FromPercent(0.5)));
			}
			else
			{
				caretBlinkTime = 500;
			}
			frames.Duration = new Duration(new TimeSpan(0, 0, 0, 0, caretBlinkTime * 2));
			_blinkAnimationClock = frames.CreateClock();
			base.ApplyAnimationClock(UIElement.OpacityProperty, _blinkAnimationClock);
			this.PositionChanged = (EventHandler<CaretPositionChangedEventArgs>)Delegate.Combine(this.PositionChanged, new EventHandler<CaretPositionChangedEventArgs>(this.CaretElement_PositionChanged));
			if (handler == null)
			{
				handler = delegate
				{
					this.ConstructCaretGeometry();
				};
			}
			base.SizeChanged += handler;
			base.IsVisibleChanged += new DependencyPropertyChangedEventHandler(this.UIElement_VisibleChanged);
			this.OverwriteMode = false;
		}
        /// <summary>
        /// Initializes a new instance of the <see cref="EditorViewController"/> class.
        /// </summary>
        /// <param name="editorView">The text editor associated with this controller.</param>
        public EditorViewController(EditorView editorView)
        {
            // Saves the display context for performing actions.
            if (editorView == null)
            {
                throw new ArgumentNullException("editorView");
            }

            displayContext = editorView;

            // Bind the initial keybindings.
            keyBindings = new Dictionary <int, ActionEntry>();
            actions     = new Dictionary <string, ActionEntry>();

            // Bind the action states.
            states            = new ActionStateCollection();
            Commands          = new CommandManager();
            CommandController = new LineBufferCommandController();
            CommandFactory    =
                new CommandFactoryManager <OperationContext>(CommandController);

            // Bind the default actions for the editor.
            BindActions();
        }
Beispiel #9
0
        protected override void LoadContent()
        {
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            FontBank fontBank = new FontBank();

            fontBank.Load(this.Content, "Fonts");

            IFontScaler fontScaler = new SimpleFontScaler(fontBank);

            var textEntity = new TextEntity()
            {
                Colour    = Color.Cyan,
                Text      = "This is a test.",
                Bounds    = new RectangleF(100, 100, 100, 25),
                FontName  = "Calibri",
                FontSize  = 20,
                Behaviour = TextEntityBehaviour.AutoScale,
            };

            var textEntityView = new TextEntityView(
                textEntity,
                fontScaler,
                _spriteBatch,
                fontBank
                );

            var textEntityEditorView = new EditorView(
                textEntityView,
                _spriteBatch
                );

            _views.Add(textEntityEditorView);
            _controllers.Add(new EditorViewController(textEntityEditorView));
            _controllers.Add(new TextEntityViewController(textEntityView, _graphics.GraphicsDevice, _spriteBatch));
        }
        /// <summary>
        /// Attach model to view.
        /// </summary>
        /// <param name="model">The model object</param>
        /// <param name="view">The view object</param>
        /// <param name="explorerPresenter">The explorer presenter</param>
        public void Attach(object model, object view, ExplorerPresenter explorerPresenter)
        {
            this.operations            = model as Operations;
            this.view                  = view as EditorView;
            this.explorerPresenter     = explorerPresenter;
            this.intellisense          = new IntellisensePresenter(view as ViewBase);
            intellisense.ItemSelected += (sender, e) =>
            {
                if (e.TriggerWord == string.Empty)
                {
                    this.view.InsertAtCaret(e.ItemSelected);
                }
                else
                {
                    int position = this.view.Text.Substring(0, this.view.Offset).LastIndexOf(e.TriggerWord);
                    this.view.InsertCompletionOption(e.ItemSelected, e.TriggerWord);
                }
            };

            this.PopulateEditorView();
            this.view.ContextItemsNeeded   += this.OnContextItemsNeeded;
            this.view.TextHasChangedByUser += this.OnTextHasChangedByUser;
            this.explorerPresenter.CommandHistory.ModelChanged += this.OnModelChanged;
        }
 protected override void OnViewLoaded(object view)
 {
     _view = (EditorView)view;
 }
Beispiel #12
0
 /// <summary>
 /// Called once when view is created
 /// </summary>
 public void TextViewCreated(IWpfTextView textView)
 {
     EditorView.Create(textView);
     OnTextViewCreated(textView);
 }
Beispiel #13
0
 public static EditorView GetEditorView(GraphicsDevice graphicsDevice)
 {
     EditorView view = new EditorView(graphicsDevice);
     _views.Add(view);
     return view;
 }
        public StockAdministrationViewModel(ISession session, IProductService productService, IStockService stockService)
        {
            _session = session;
            _productService = productService;
            _stockService = stockService;

            #region Maintance - Products

            Actions.Add(new AdministrationActionViewModel()
            {
                Action = (p) =>
                                {
                                    IsBusy = true;

                                    Dispatcher.CurrentDispatcher.BeginInvoke((Action)delegate
                                    {
                                        View = new EditorView(_session);
                                        var _viewModel = new EditorViewModel<Product>(_session);
                                        _viewModel.ItemRemoved += (sender, e) =>
                                            {
                                                _session.Delete<Data.Models.Stock>(s => s.ProductId == e.Item.Id);
                                                _session.CommitChanges();
                                            };
                                        _viewModel.NewItemSaved += (sender, e) =>
                                            {
                                                _session.Add<Data.Models.Stock>(new Data.Models.Stock()
                                                            {
                                                                Id = Guid.NewGuid(),
                                                                ProductId = e.Item.Id,
                                                                Units = 0
                                                            });
                                                _session.CommitChanges();
                                            };
                                        View.DataContext = _viewModel;

                                        IsBusy = false;
                                    }, DispatcherPriority.Background);
                                },
                Category = "Maintance",
                Title = "Products"
            });

            #endregion

            #region Maintance - Tax

            Actions.Add(new AdministrationActionViewModel()
            {
                Action = (p) =>
                {
                    IsBusy = true;
                    Dispatcher.CurrentDispatcher.BeginInvoke((Action)delegate
                                                                         {
                                                                             View = new EditorView(_session);
                                                                             View.DataContext =
                                                                                 new EditorViewModel<Tax>(_session);

                                                                             IsBusy = false;
                                    }, DispatcherPriority.Background);
                },
                Category = "Maintance",
                Title = "Tax"
            });

            #endregion

            #region Maintance - Categories

            Actions.Add(new AdministrationActionViewModel()
            {
                Action = (p) =>
                {
                    IsBusy = true;
                    Dispatcher.CurrentDispatcher.BeginInvoke((Action)delegate
                                                                         {
                                                                             View = new EditorView(_session);
                                                                             View.DataContext =
                                                                                 new EditorViewModel<Category>(_session);

                                                                             IsBusy = false;
                                    }, DispatcherPriority.Background);
                },
                Category = "Maintance",
                Title = "Categories"
            });

            #endregion

            #region Maintance - Stock Maintance

            Actions.Add(new AdministrationActionViewModel()
            {
                Action = (p) =>
                {
                    IsBusy = true;
                    Dispatcher.CurrentDispatcher.BeginInvoke((Action)delegate
                                                                         {

                                                                             View = new StockMaintanceView_Main();
                                                                             View.DataContext =
                                                                                 new StockMaintanceViewModel(
                                                                                     _productService, _stockService);

                                                                             IsBusy = false;
                                    }, DispatcherPriority.Background);
                },
                Category = "Maintance",
                Title = "Stock Maintance"
            });

            #endregion

            #region Reports - Products

            Actions.Add(new AdministrationActionViewModel()
            {
                Action = (p) =>
                {
                    IsBusy = true;
                    Dispatcher.CurrentDispatcher.BeginInvoke((Action)delegate
                                                                         {

                                                                             ReportDocument reportDocument =
                                                                                 new ReportDocument();

                                                                             StreamReader reader =
                                                                                 new StreamReader(
                                                                                     new FileStream(
                                                                                         @"Templates\ProductsReport.xaml",
                                                                                         FileMode.Open, FileAccess.Read));
                                                                             reportDocument.XamlData =
                                                                                 reader.ReadToEnd();
                                                                             reportDocument.XamlImagePath =
                                                                                 Path.Combine(
                                                                                     Environment.CurrentDirectory,
                                                                                     @"Templates\");
                                                                             reader.Close();

                                                                             ReportData reportData = new ReportData();
                                                                             DataTable table = new DataTable("Products");
                                                                             table.Columns.Add("Reference",
                                                                                               typeof (string));
                                                                             table.Columns.Add("Name", typeof (string));
                                                                             table.Columns.Add("BuyPrice",
                                                                                               typeof (double));
                                                                             table.Columns.Add("SellPrice",
                                                                                               typeof (double));

                                                                             foreach (
                                                                                 var product in
                                                                                     _productService.GetProducts())
                                                                             {
                                                                                 table.Rows.Add(new object[]
                                                                                                    {
                                                                                                        product.Reference,
                                                                                                        product.Name,
                                                                                                        product.BuyPrice,
                                                                                                        product.SellPrice
                                                                                                    });
                                                                             }
                                                                             reportData.DataTables.Add(table);

                                                                             XpsDocument xps =
                                                                                 reportDocument.CreateXpsDocument(
                                                                                     reportData);

                                                                             View = new SimpleReportView(xps);

                                                                             IsBusy = false;
                                                                         }, DispatcherPriority.SystemIdle);
                },
                Category = "Reports",
                Title = "Products"
            });

            #endregion

            #region Reports - Current Inventory

            Actions.Add(new AdministrationActionViewModel()
            {
                Action = (p) =>
                {
                    IsBusy = true;
                    Dispatcher.CurrentDispatcher.BeginInvoke((Action)delegate
                                                                         {
                                                                             ReportDocument reportDocument =
                                                                                 new ReportDocument();

                                                                             StreamReader reader =
                                                                                 new StreamReader(
                                                                                     new FileStream(
                                                                                         @"Templates\CurrentInventoryReport.xaml",
                                                                                         FileMode.Open, FileAccess.Read));
                                                                             reportDocument.XamlData =
                                                                                 reader.ReadToEnd();
                                                                             reportDocument.XamlImagePath =
                                                                                 Path.Combine(
                                                                                     Environment.CurrentDirectory,
                                                                                     @"Templates\");
                                                                             reader.Close();

                                                                             ReportData reportData = new ReportData();
                                                                             DataTable table = new DataTable("Products");
                                                                             table.Columns.Add("Reference",
                                                                                               typeof (string));
                                                                             table.Columns.Add("Name", typeof (string));
                                                                             table.Columns.Add("Units", typeof (double));

                                                                             foreach (
                                                                                 var product in
                                                                                     _productService.GetProducts())
                                                                             {
                                                                                 Data.Models.Stock stock =
                                                                                     _stockService.GetStockByProductId(
                                                                                         product.Id);
                                                                                 table.Rows.Add(new object[]
                                                                                                    {
                                                                                                        product.Reference,
                                                                                                        product.Name,
                                                                                                        stock.Units
                                                                                                    });
                                                                             }
                                                                             reportData.DataTables.Add(table);

                                                                             XpsDocument xps =
                                                                                 reportDocument.CreateXpsDocument(
                                                                                     reportData);

                                                                             View = new SimpleReportView(xps);

                                                                             IsBusy = false;
                                                                         }, DispatcherPriority.SystemIdle);
                },
                Category = "Reports",
                Title = "Current Inventory"
            });

            #endregion
        }
 /// <summary>
 /// Resizes the specified margin based on the context.
 /// </summary>
 /// <param name="editorView">The text editor.</param>
 public virtual void Resize(EditorView editorView)
 {
     // The default implementation is to do nothing.
 }
Beispiel #16
0
 /// <summary>
 /// Gets a list of open file names in the specified view.
 /// </summary>
 /// <param name="view">The editor view to retrieve the list of open file names.</param>
 /// <returns>A list of file names for the open files.</returns>
 /// <remarks>To get a list of all open file names in both views, you can use the 'FileNames' property.</remarks>
 public IEnumerable<string> GetFileNames(EditorView view)
 {
     return Plugin.NppIntf.GetFileNames(view);
 }
Beispiel #17
0
 /// <summary>
 /// Switches to the file in the specified view.
 /// </summary>
 /// <param name="view">The view in which the file is to be switched.</param>
 /// <param name="index">Zero-based index of the view to switch to.</param>
 public void SetActiveFileIndex(EditorView view, int index)
 {
     Plugin.NppIntf.SetActiveFileIndex(view, index);
 }
Beispiel #18
0
 /// <summary>
 /// Gets a list of open file names in the specified view.
 /// </summary>
 /// <param name="view">The editor view to retrieve the list of open file names.</param>
 /// <returns>A list of file names for the open files.</returns>
 /// <remarks>To get a list of all open file names in both views, you can use the 'FileNames' property.</remarks>
 public IEnumerable <string> GetFileNames(EditorView view)
 {
     return(Plugin.NppIntf.GetFileNames(view));
 }
Beispiel #19
0
 public Editor(SongResources songResources)
 {
     editorView = new EditorView(songResources);
     SetGameTimer(59700);
 }
Beispiel #20
0
 /// <summary>
 /// Switches to the file in the specified view.
 /// </summary>
 /// <param name="view">The view in which the file is to be switched.</param>
 /// <param name="index">Zero-based index of the view to switch to.</param>
 public void SetActiveFileIndex(EditorView view, int index)
 {
     Plugin.NppIntf.SetActiveFileIndex(view, index);
 }
Beispiel #21
0
 public EditorPresenter(EditorView view) {
   mView = view;
   mBuildManager = CommonInjector.provideBuildManager();
 }
        private Widget CreateGuiEditor()
        {
            // Create the editor for the user.
            commandController = new ProjectCommandController();

            editorView = new EditorView();
            editorView.Controller.CommandController = commandController;
            EditorViewTheme.SetupTheme(editorView.Theme);

            // Remove the default margins because they aren't helpful at this
            // point and whenever they load, it causes the document to reset.
            editorView.Margins.Clear();

            // Wrap the text editor in a scrollbar.
            var scrolledWindow = new ScrolledWindow();
            scrolledWindow.VscrollbarPolicy = PolicyType.Always;
            scrolledWindow.Add(editorView);

            // Create the indicator bar that is 10 px wide.
            indicatorView = new IndicatorView(editorView);
            indicatorView.SetSizeRequest(20, 1);

            var indicatorFrame = new Frame
            {
                BorderWidth = 2,
                ShadowType = ShadowType.None,
                Shadow = ShadowType.None
            };
            indicatorFrame.Add(indicatorView);

            // Add the editor and bar to the current tab.
            var editorBand = new HBox(false, 0);
            editorBand.PackStart(indicatorFrame, false, false, 0);
            editorBand.PackStart(scrolledWindow, true, true, 4);

            // Return the top-most frame.
            return editorBand;
        }
Beispiel #23
0
        /// <inheritdoc/>
        public override IDock CreateLayout()
        {
            // Documents

            var pageDocument = new PageDocument
            {
                Id     = nameof(PageDocument),
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Page"
            };

            // Left / Top

            var projectView = new ProjectTool
            {
                Id     = nameof(ProjectTool),
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Project"
            };

            var optionsView = new OptionsTool
            {
                Id     = nameof(OptionsTool),
                Width  = 200,
                Height = 200,
                Title  = "Options"
            };

            var imagesView = new ImagesTool
            {
                Id     = nameof(ImagesTool),
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Images"
            };

            // Left / Bottom

            var groupsView = new GroupsTool
            {
                Id     = nameof(GroupsTool),
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Groups"
            };

            var databasesView = new DatabasesTool
            {
                Id     = nameof(DatabasesTool),
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Databases"
            };

            // Right / Top

            var stylesView = new StylesTool
            {
                Id     = nameof(StylesTool),
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Styles"
            };

            var templatesView = new TemplatesTool
            {
                Id     = nameof(TemplatesTool),
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Templates"
            };

            var containerView = new ContainerTool
            {
                Id     = nameof(ContainerTool),
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Container"
            };

            var zoomView = new ZoomTool
            {
                Id     = nameof(ZoomTool),
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Zoom"
            };

            // Right / Bottom

            var toolsView = new ToolsTool
            {
                Id     = nameof(ToolsTool),
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Tools"
            };

            var shapeView = new ShapeTool
            {
                Id     = nameof(ShapeTool),
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Shape"
            };

            var dataView = new DataTool
            {
                Id     = nameof(DataTool),
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Data"
            };

            var styleView = new StyleTool
            {
                Id     = nameof(StyleTool),
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Style"
            };

            var templateView = new TemplateTool
            {
                Id     = nameof(TemplateTool),
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Template"
            };

            // Left Pane

            var leftPane = new LayoutDock
            {
                Id          = nameof(ILayoutDock),
                Dock        = "Left",
                Width       = 200,
                Height      = double.NaN,
                Title       = "EditorLeft",
                CurrentView = null,
                Views       = new ObservableCollection <IView>
                {
                    new ToolDock
                    {
                        Id          = nameof(IToolDock),
                        Dock        = "Top",
                        Width       = double.NaN,
                        Height      = 340,
                        Title       = "EditorLeftTop",
                        CurrentView = projectView,
                        Views       = new ObservableCollection <IView>
                        {
                            projectView,
                            optionsView,
                            imagesView
                        }
                    },
                    new SplitterDock()
                    {
                        Id    = nameof(ISplitterDock),
                        Dock  = "Top",
                        Title = "LeftTopSplitter"
                    },
                    new ToolDock
                    {
                        Id          = nameof(IToolDock),
                        Dock        = "Bottom",
                        Width       = double.NaN,
                        Height      = double.NaN,
                        Title       = "EditorLeftBottom",
                        CurrentView = groupsView,
                        Views       = new ObservableCollection <IView>
                        {
                            groupsView,
                            databasesView
                        }
                    }
                }
            };

            // Right Pane

            var rightPane = new LayoutDock
            {
                Id          = nameof(ILayoutDock),
                Dock        = "Right",
                Width       = 240,
                Height      = double.NaN,
                Title       = "EditorRight",
                CurrentView = null,
                Views       = new ObservableCollection <IView>
                {
                    new ToolDock
                    {
                        Id          = nameof(IToolDock),
                        Dock        = "Top",
                        Width       = double.NaN,
                        Height      = 340,
                        Title       = "EditorRightTop",
                        CurrentView = stylesView,
                        Views       = new ObservableCollection <IView>
                        {
                            stylesView,
                            templatesView,
                            containerView,
                            zoomView
                        }
                    },
                    new SplitterDock()
                    {
                        Id    = nameof(ISplitterDock),
                        Dock  = "Top",
                        Title = "RightTopSplitter"
                    },
                    new ToolDock
                    {
                        Id          = nameof(IToolDock),
                        Dock        = "Bottom",
                        Width       = double.NaN,
                        Height      = double.NaN,
                        Title       = "EditorRightBottom",
                        CurrentView = toolsView,
                        Views       = new ObservableCollection <IView>
                        {
                            toolsView,
                            shapeView,
                            dataView,
                            styleView,
                            templateView
                        }
                    }
                }
            };

            // Documents

            var documentsPane = new DocumentDock
            {
                Id          = nameof(IDocumentDock),
                Dock        = "",
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "DocumentsPane",
                CurrentView = pageDocument,
                Views       = new ObservableCollection <IView>
                {
                    pageDocument
                }
            };

            // Main

            var editorLayout = new LayoutDock
            {
                Id          = nameof(ILayoutDock),
                Dock        = "",
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "EditorLayout",
                CurrentView = null,
                Views       = new ObservableCollection <IView>
                {
                    leftPane,
                    new SplitterDock()
                    {
                        Id    = nameof(ISplitterDock),
                        Dock  = "Left",
                        Title = "LeftSplitter"
                    },
                    rightPane,
                    new SplitterDock()
                    {
                        Id    = nameof(ISplitterDock),
                        Dock  = "Right",
                        Title = "RightSplitter"
                    },
                    documentsPane
                }
            };

            var editorView = new EditorView
            {
                Id          = nameof(EditorView),
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "Editor",
                CurrentView = editorLayout,
                Views       = new ObservableCollection <IView>
                {
                    editorLayout
                }
            };

            // About

            var aboutView = new AboutView
            {
                Id     = nameof(AboutView),
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "About"
            };

            // Browser

            var browserView = new BrowserView
            {
                Id     = nameof(BrowserView),
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Browser"
            };

            // Document

            var documentView = new DocumentView
            {
                Id     = nameof(DocumentView),
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Document"
            };

            // Dashboard

            var dashboardView = new DashboardView
            {
                Id     = nameof(DashboardView),
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Dashboard"
            };

            // Main

            var layout = new RootDock
            {
                Id          = nameof(IRootDock),
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "Root",
                CurrentView = dashboardView,
                DefaultView = dashboardView,
                Views       = new ObservableCollection <IView>
                {
                    dashboardView,
                    editorView,
                    aboutView,
                    browserView,
                    documentView
                }
            };

            return(layout);
        }
Beispiel #24
0
 /// <summary>
 /// Gets the current document index in the specified view.
 /// </summary>
 /// <param name="view">The view in which the active file index will be retrieved.</param>
 /// <returns>Zero-based index of the active file.</returns>
 public int GetActiveFileIndex(EditorView view)
 {
     return Plugin.NppIntf.GetActiveFileIndex(view);
 }
Beispiel #25
0
 /// <summary>
 /// Gets the current document index in the specified view.
 /// </summary>
 /// <param name="view">The view in which the active file index will be retrieved.</param>
 /// <returns>Zero-based index of the active file.</returns>
 public int GetActiveFileIndex(EditorView view)
 {
     return(Plugin.NppIntf.GetActiveFileIndex(view));
 }
Beispiel #26
0
        /// <inheritdoc/>
        public override IDock CreateDefaultLayout()
        {
            // Dashboard

            var dashboardView = new DashboardView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Dashboard"
            };

            // Page

            var pageView = new PageView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Page"
            };

            // Left / Top

            var projectView = new ProjectView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Project"
            };

            var optionsView = new OptionsView
            {
                Dock   = "",
                Width  = 200,
                Height = 200,
                Title  = "Options"
            };

            var imagesView = new ImagesView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Images"
            };

            // Left / Bottom

            var groupsView = new GroupsView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Groups"
            };

            var databasesView = new DatabasesView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Databases"
            };

            // Right / Top

            var stylesView = new StylesView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Styles"
            };

            var templatesView = new TemplatesView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Templates"
            };

            var containerView = new ContainerView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Container"
            };

            var zoomView = new ZoomView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Zoom"
            };

            // Right / Bottom

            var toolsView = new ToolsView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Tools"
            };

            var shapeView = new ShapeView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Shape"
            };

            var dataView = new DataView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Data"
            };

            var styleView = new StyleView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Style"
            };

            var templateView = new TemplateView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Template"
            };

            // Left

            var leftPane = new DockLayout
            {
                Dock        = "Left",
                Width       = 200,
                Height      = double.NaN,
                Title       = "EditorLeft",
                CurrentView = null,
                Views       = new ObservableCollection <IDock>
                {
                    new DockStrip
                    {
                        Dock        = "Top",
                        Width       = double.NaN,
                        Height      = 340,
                        Title       = "EditorLeftTop",
                        CurrentView = projectView,
                        Views       = new ObservableCollection <IDock>
                        {
                            projectView,
                            optionsView,
                            imagesView
                        }
                    },
                    new DockSplitter()
                    {
                        Dock = "Top", Title = "LeftTopSplitter"
                    },
                    new DockStrip
                    {
                        Dock        = "Bottom",
                        Width       = double.NaN,
                        Height      = double.NaN,
                        Title       = "EditorLeftBottom",
                        CurrentView = groupsView,
                        Views       = new ObservableCollection <IDock>
                        {
                            groupsView,
                            databasesView
                        }
                    }
                }
            };

            // Right

            var rightPane = new DockLayout
            {
                Dock        = "Right",
                Width       = 240,
                Height      = double.NaN,
                Title       = "EditorRight",
                CurrentView = null,
                Views       = new ObservableCollection <IDock>
                {
                    new DockStrip
                    {
                        Dock        = "Top",
                        Width       = double.NaN,
                        Height      = 340,
                        Title       = "EditorRightTop",
                        CurrentView = stylesView,
                        Views       = new ObservableCollection <IDock>
                        {
                            stylesView,
                            templatesView,
                            containerView,
                            zoomView
                        }
                    },
                    new DockSplitter()
                    {
                        Dock = "Top", Title = "RightTopSplitter"
                    },
                    new DockStrip
                    {
                        Dock        = "Bottom",
                        Width       = double.NaN,
                        Height      = double.NaN,
                        Title       = "EditorRightBottom",
                        CurrentView = toolsView,
                        Views       = new ObservableCollection <IDock>
                        {
                            toolsView,
                            shapeView,
                            dataView,
                            styleView,
                            templateView
                        }
                    }
                }
            };

            // Editor

            var editorLayout = new DockLayout
            {
                Dock        = "",
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "EditorLayout",
                CurrentView = null,
                Views       = new ObservableCollection <IDock>
                {
                    leftPane,
                    new DockSplitter()
                    {
                        Dock = "Left", Title = "LeftSplitter"
                    },
                    rightPane,
                    new DockSplitter()
                    {
                        Dock = "Right", Title = "RightSplitter"
                    },
                    pageView
                }
            };

            var editorView = new EditorView
            {
                Dock        = "",
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "Editor",
                CurrentView = editorLayout,
                Views       = new ObservableCollection <IDock>
                {
                    editorLayout
                }
            };

            // About

            var aboutView = new AboutView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "About"
            };

            // Browser

            var browserView = new BrowserView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Browser"
            };

            // Document

            var documentView = new DocumentView
            {
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Document"
            };

            // Main

            var layout = new DockRoot
            {
                Dock        = "",
                Width       = double.NaN,
                Height      = double.NaN,
                CurrentView = dashboardView,
                Views       = new ObservableCollection <IDock>
                {
                    dashboardView,
                    editorView,
                    aboutView,
                    browserView,
                    documentView
                }
            };

            return(layout);
        }
Beispiel #27
0
        /// <inheritdoc/>
        public override IDock CreateLayout()
        {
            // Documents

            var pageDocument = new PageDocument
            {
                Id    = nameof(PageDocument),
                Title = "Page"
            };

            // Tools

            var projectTool = new ProjectTool
            {
                Id    = nameof(ProjectTool),
                Title = "Project"
            };

            var optionsTool = new OptionsTool
            {
                Id    = nameof(OptionsTool),
                Title = "Options"
            };

            var imagesTool = new ImagesTool
            {
                Id    = nameof(ImagesTool),
                Title = "Images"
            };

            var groupsTool = new GroupsTool
            {
                Id    = nameof(GroupsTool),
                Title = "Groups"
            };

            var databasesTool = new DatabasesTool
            {
                Id    = nameof(DatabasesTool),
                Title = "Databases"
            };

            var scriptTool = new ScriptTool
            {
                Id    = nameof(ScriptTool),
                Title = "Script"
            };

            var browserTool = new BrowserTool
            {
                Id    = nameof(BrowserTool),
                Title = "Browser"
            };

            var stylesTool = new StylesTool
            {
                Id    = nameof(StylesTool),
                Title = "Styles"
            };

            var templatesTool = new TemplatesTool
            {
                Id    = nameof(TemplatesTool),
                Title = "Templates"
            };

            var containerTool = new ContainerTool
            {
                Id    = nameof(ContainerTool),
                Title = "Container"
            };

            var zoomTool = new ZoomTool
            {
                Id    = nameof(ZoomTool),
                Title = "Zoom"
            };

            var shapeTool = new ShapeTool
            {
                Id    = nameof(ShapeTool),
                Title = "Shape"
            };

            var toolsTool = new ToolsTool
            {
                Id    = nameof(ToolsTool),
                Title = "Tools"
            };

            var dataTool = new DataTool
            {
                Id    = nameof(DataTool),
                Title = "Data"
            };

            var styleTool = new StyleTool
            {
                Id    = nameof(StyleTool),
                Title = "Style"
            };

            var templateTool = new TemplateTool
            {
                Id    = nameof(TemplateTool),
                Title = "Template"
            };

            // Panes

            var leftPane = new LayoutDock
            {
                Id          = nameof(ILayoutDock),
                Title       = "EditorLeft",
                Orientation = Orientation.Vertical,
                Proportion  = 0.17,
                CurrentView = null,
                Views       = new ObservableCollection <IView>
                {
                    new ToolDock
                    {
                        Id          = nameof(IToolDock),
                        Title       = "EditorLeftTop",
                        Proportion  = double.NaN,
                        CurrentView = projectTool,
                        Views       = new ObservableCollection <IView>
                        {
                            projectTool,
                            optionsTool,
                            imagesTool
                        }
                    },
                    new SplitterDock()
                    {
                        Id    = nameof(ISplitterDock),
                        Title = "LeftTopSplitter"
                    },
                    new ToolDock
                    {
                        Id          = nameof(IToolDock),
                        Title       = "EditorLeftBottom",
                        Proportion  = double.NaN,
                        CurrentView = groupsTool,
                        Views       = new ObservableCollection <IView>
                        {
                            groupsTool,
                            databasesTool,
                            scriptTool,
                            browserTool
                        }
                    }
                }
            };

            var rightPane = new LayoutDock
            {
                Id          = nameof(ILayoutDock),
                Title       = "EditorRight",
                Orientation = Orientation.Vertical,
                Proportion  = 0.17,
                CurrentView = null,
                Views       = new ObservableCollection <IView>
                {
                    new ToolDock
                    {
                        Id          = nameof(IToolDock),
                        Title       = "EditorRightTop",
                        Proportion  = double.NaN,
                        CurrentView = stylesTool,
                        Views       = new ObservableCollection <IView>
                        {
                            stylesTool,
                            templatesTool,
                            containerTool,
                            zoomTool
                        }
                    },
                    new SplitterDock()
                    {
                        Id    = nameof(ISplitterDock),
                        Title = "RightTopSplitter"
                    },
                    new ToolDock
                    {
                        Id          = nameof(IToolDock),
                        Title       = "EditorRightBottom",
                        Proportion  = double.NaN,
                        CurrentView = shapeTool,
                        Views       = new ObservableCollection <IView>
                        {
                            shapeTool,
                            toolsTool,
                            dataTool,
                            styleTool,
                            templateTool
                        }
                    }
                }
            };

            var documentsPane = new DocumentDock
            {
                Id          = nameof(IDocumentDock),
                Title       = "DocumentsPane",
                Proportion  = double.NaN,
                CurrentView = pageDocument,
                Views       = new ObservableCollection <IView>
                {
                    pageDocument
                }
            };

            // Editor

            var editorLayout = new LayoutDock
            {
                Id          = nameof(ILayoutDock),
                Title       = "EditorLayout",
                Orientation = Orientation.Horizontal,
                Proportion  = double.NaN,
                CurrentView = null,
                Views       = new ObservableCollection <IView>
                {
                    leftPane,
                    new SplitterDock()
                    {
                        Id    = nameof(ISplitterDock),
                        Title = "LeftSplitter"
                    },
                    documentsPane,
                    new SplitterDock()
                    {
                        Id    = nameof(ISplitterDock),
                        Title = "RightSplitter"
                    },
                    rightPane
                }
            };

            // Views

            var editorView = new EditorView
            {
                Id          = nameof(EditorView),
                Title       = "Editor",
                CurrentView = editorLayout,
                Views       = new ObservableCollection <IView>
                {
                    editorLayout
                }
            };

            var aboutView = new AboutView
            {
                Id    = nameof(AboutView),
                Title = "About"
            };

            var browserView = new BrowserView
            {
                Id    = nameof(BrowserView),
                Title = "Browser"
            };

            var scriptView = new ScriptView
            {
                Id    = nameof(ScriptView),
                Title = "Script"
            };

            var documentView = new DocumentView
            {
                Id    = nameof(DocumentView),
                Title = "Document"
            };

            var dashboardView = new DashboardView
            {
                Id    = nameof(DashboardView),
                Title = "Dashboard"
            };

            // Root

            var layout = new RootDock
            {
                Id          = nameof(IRootDock),
                Title       = "Root",
                CurrentView = dashboardView,
                DefaultView = dashboardView,
                Views       = new ObservableCollection <IView>
                {
                    dashboardView,
                    editorView,
                    aboutView,
                    browserView,
                    scriptView,
                    documentView
                }
            };

            return(layout);
        }
Beispiel #28
0
        /// <inheritdoc/>
        public override DM.IDock CreateLayout()
        {
            // Documents

            var pageDocument = new PageDocument
            {
                Id    = nameof(PageDocument),
                Title = "Page"
            };

            // Tools

            var projectTool = new ProjectTool
            {
                Id    = nameof(ProjectTool),
                Title = "Project"
            };

            var optionsTool = new OptionsTool
            {
                Id    = nameof(OptionsTool),
                Title = "Options"
            };

            var imagesTool = new ImagesTool
            {
                Id    = nameof(ImagesTool),
                Title = "Images"
            };

            var groupsTool = new GroupsTool
            {
                Id    = nameof(GroupsTool),
                Title = "Groups"
            };

            var databasesTool = new DatabasesTool
            {
                Id    = nameof(DatabasesTool),
                Title = "Databases"
            };

            var scriptTool = new ScriptTool
            {
                Id    = nameof(ScriptTool),
                Title = "Script"
            };

            var exportTool = new ExportTool
            {
                Id    = nameof(ExportTool),
                Title = "Export"
            };

            var browserTool = new BrowserTool
            {
                Id    = nameof(BrowserTool),
                Title = "Browser"
            };

            var documentTool = new DocumentTool
            {
                Id    = nameof(DocumentTool),
                Title = "Document"
            };

            var stylesTool = new StylesTool
            {
                Id    = nameof(StylesTool),
                Title = "Styles"
            };

            var templatesTool = new TemplatesTool
            {
                Id    = nameof(TemplatesTool),
                Title = "Templates"
            };

            var scriptsTool = new ScriptsTool
            {
                Id    = nameof(ScriptsTool),
                Title = "Scripts"
            };

            var containerTool = new ContainerTool
            {
                Id    = nameof(ContainerTool),
                Title = "Container"
            };

            var zoomTool = new ZoomTool
            {
                Id    = nameof(ZoomTool),
                Title = "Zoom"
            };

            var rendererTool = new RendererTool
            {
                Id    = nameof(RendererTool),
                Title = "Renderer"
            };

            var shapeTool = new ShapeTool
            {
                Id    = nameof(ShapeTool),
                Title = "Shape"
            };

            var toolsTool = new ToolsTool
            {
                Id    = nameof(ToolsTool),
                Title = "Tools"
            };

            var recordTool = new RecordTool
            {
                Id    = nameof(RecordTool),
                Title = "Record"
            };

            var propertiesTool = new PropertiesTool
            {
                Id    = nameof(PropertiesTool),
                Title = "Properties"
            };

            var styleTool = new StyleTool
            {
                Id    = nameof(StyleTool),
                Title = "Style"
            };

            var templateTool = new TemplateTool
            {
                Id    = nameof(TemplateTool),
                Title = "Template"
            };

            // Panes

            var leftPane = new DMC.ProportionalDock
            {
                Id               = nameof(DMC.IProportionalDock),
                Title            = "EditorLeft",
                Orientation      = DM.Orientation.Vertical,
                Proportion       = 0.17,
                ActiveDockable   = null,
                VisibleDockables = CreateList <DM.IDockable>
                                   (
                    new DMC.ToolDock
                {
                    Id               = nameof(DMC.IToolDock),
                    Title            = "EditorLeftTop",
                    Proportion       = double.NaN,
                    ActiveDockable   = projectTool,
                    VisibleDockables = CreateList <DM.IDockable>
                                       (
                        projectTool,
                        optionsTool,
                        rendererTool,
                        imagesTool
                                       )
                },
                    new DMC.SplitterDock()
                {
                    Id    = nameof(DMC.ISplitterDock),
                    Title = "LeftTopSplitter"
                },
                    new DMC.ToolDock
                {
                    Id               = nameof(DMC.IToolDock),
                    Title            = "EditorLeftBottom",
                    Proportion       = double.NaN,
                    ActiveDockable   = groupsTool,
                    VisibleDockables = CreateList <DM.IDockable>
                                       (
                        groupsTool,
                        databasesTool,
                        toolsTool,
                        scriptsTool
                                       )
                }
                                   )
            };

            var rightPane = new DMC.ProportionalDock
            {
                Id               = nameof(DMC.IProportionalDock),
                Title            = "EditorRight",
                Orientation      = DM.Orientation.Vertical,
                Proportion       = 0.20,
                ActiveDockable   = null,
                VisibleDockables = CreateList <DM.IDockable>
                                   (
                    new DMC.ToolDock
                {
                    Id               = nameof(DMC.IToolDock),
                    Title            = "EditorRightTop",
                    Proportion       = double.NaN,
                    ActiveDockable   = stylesTool,
                    VisibleDockables = CreateList <DM.IDockable>
                                       (
                        stylesTool,
                        containerTool,
                        templatesTool,
                        templateTool
                                       )
                },
                    new DMC.SplitterDock()
                {
                    Id    = nameof(DMC.ISplitterDock),
                    Title = "RightTopSplitter"
                },
                    new DMC.ToolDock
                {
                    Id               = nameof(DMC.IToolDock),
                    Title            = "EditorRightBottom",
                    Proportion       = double.NaN,
                    ActiveDockable   = shapeTool,
                    VisibleDockables = CreateList <DM.IDockable>
                                       (
                        shapeTool,
                        propertiesTool,
                        recordTool,
                        styleTool,
                        zoomTool
                                       )
                }
                                   )
            };

            var documentsPane = new DMC.DocumentDock
            {
                Id               = nameof(DMC.IDocumentDock),
                Title            = "DocumentsPane",
                IsCollapsable    = false,
                Proportion       = double.NaN,
                ActiveDockable   = pageDocument,
                VisibleDockables = CreateList <DM.IDockable>
                                   (
                    pageDocument,
                    documentTool,
                    scriptTool,
                    exportTool,
                    browserTool
                                   )
            };

            // Editor

            var editorLayout = new DMC.ProportionalDock
            {
                Id               = nameof(DMC.IProportionalDock),
                Title            = "EditorLayout",
                Orientation      = DM.Orientation.Horizontal,
                Proportion       = double.NaN,
                ActiveDockable   = null,
                VisibleDockables = CreateList <DM.IDockable>
                                   (
                    leftPane,
                    new DMC.SplitterDock()
                {
                    Id    = nameof(DMC.ISplitterDock),
                    Title = "LeftSplitter"
                },
                    documentsPane,
                    new DMC.SplitterDock()
                {
                    Id    = nameof(DMC.ISplitterDock),
                    Title = "RightSplitter"
                },
                    rightPane
                                   )
            };

            // Views

            var dashboardView = new DashboardView
            {
                Id    = nameof(DashboardView),
                Title = "Dashboard"
            };

            var editorView = new EditorView
            {
                Id               = nameof(EditorView),
                Title            = "Editor",
                ActiveDockable   = editorLayout,
                VisibleDockables = CreateList <DM.IDockable>
                                   (
                    editorLayout
                                   )
            };

            // Root

            var root = new DMC.RootDock
            {
                Id               = nameof(DMC.IRootDock),
                Title            = "Root",
                IsCollapsable    = false,
                ActiveDockable   = dashboardView,
                DefaultDockable  = dashboardView,
                VisibleDockables = CreateList <DM.IDockable>
                                   (
                    dashboardView,
                    editorView
                                   )
            };

            root.Top              = CreatePinDock();
            root.Top.Alignment    = DM.Alignment.Top;
            root.Bottom           = CreatePinDock();
            root.Bottom.Alignment = DM.Alignment.Bottom;
            root.Left             = CreatePinDock();
            root.Left.Alignment   = DM.Alignment.Left;
            root.Right            = CreatePinDock();
            root.Right.Alignment  = DM.Alignment.Right;

            return(root);
        }
Beispiel #29
0
 private void SaveFilesInApp(EditorView view)
 {
     int fileIndex = 0;
     foreach (var fileName in GetFileNames(EditorView.Main))
     {
         try
         {
             if (ProbeEnvironment.FileExistsInApp(fileName))
             {
                 SetActiveFileIndex(view, fileIndex);
                 if (Modified)
                 {
                     if (!SaveFile())
                     {
                         Output.WriteLine(OutputStyle.Warning, "Could not save file '{0}'.", fileName);
                         Output.Show();
                     }
                 }
             }
         }
         catch (Exception ex)
         {
             Output.WriteLine(OutputStyle.Error, "Exception when saving file '{0}':\r\n{1}", fileName, ex);
             Output.Show();
         }
         fileIndex++;
     }
 }
 public EditorViewController(EditorView view)
 {
     _view = view ?? throw new ArgumentNullException();
 }
        private void CreateUIControls22(object sender, EventArgs e)
        {
            ICurrentDocumentWindow win = this.GetServiceForThisTypeKey <ICurrentDocumentWindow>();

            if (win != null)
            {
                string           id    = win.EditController.EditorView.Id;
                DependencyObject dataS = win.EditController.Document.DataSource as DependencyObject;
                if (dataS != null && dataS.ExtendedProperties.Contains("TFL_FormulaView") && //只有在E10中的公式查看按钮才执行下面的逻辑
                    (id.Contains("QC") || id.Contains("QM") || id.Contains("FS") ||
                     id.Contains("LFS")
                    ))
                {
                    DependencyObject obj = win.EditController.EditorView.DataSource as DependencyObject;

                    bool isLS = false;  //是否存在离散的条件
                    if (obj["FILER_MODE1"].ToInt32() == 2)
                    {
                        isLS = true;
                        obj["uiADMIN_UNIT_CODE"] = obj["uiADMIN_UNIT_NAME"] = obj["ADMIN_UNITS"].ToStringExtension();
                    }
                    if (obj["FILER_MODE6"].ToInt32() == 2)
                    {
                        isLS = true;
                        obj["uiCUSTOMER_CODE"] = obj["uiCUSTOMER_NAME"] = obj["CUSTOMERS"].ToStringExtension();
                    }
                    if (obj["FILER_MODE4"].ToInt32() == 2)
                    {
                        isLS = true;
                        obj["uiSUPPLIER_CODE"] = obj["uiSUPPLIER_NAME"] = obj["SUPPLIERS"].ToStringExtension();
                    }
                    if (obj["FILER_MODE2"].ToInt32() == 2)
                    {
                        isLS = true;
                        obj["uiEMPLOYEE_CODE"] = obj["uiEMPLOYEE_NAME"] = obj["EMPLOYEES"].ToStringExtension();
                    }
                    if (obj["FILER_MODE5"].ToInt32() == 2)
                    {
                        isLS = true;
                        obj["uiSALES_CENTER_CODE"] = obj["uiSALES_CENTER_NAME"] = obj["SALES_CENTERS"].ToStringExtension();
                    }
                    if (obj["FILER_MODE3"].ToInt32() == 2)
                    {
                        isLS = true;
                        obj["uiSUPPLY_CENTER_CODE"] = obj["uiSUPPLY_CENTER_NAME"] = obj["SUPPLY_CENTERS"].ToStringExtension();
                    }
                    if (obj["FILER_MODE7"].ToInt32() == 2)
                    {
                        isLS = true;
                        obj["uiPLANT_CODE"] = obj["uiPLANT_NAME"] = obj["PLANTS"].ToStringExtension();
                    }
                    if (obj["FILER_MODE8"].ToInt32() == 2)
                    {
                        isLS = true;
                        obj["uiAUXILIARY_ITEM_CODE"] = obj["uiAUXILIARY_ITEM_NAME"] = obj["AUXILIARY_ITEM1S"].ToStringExtension();
                    }
                    if (obj["FILER_MODE9"].ToInt32() == 2)
                    {
                        isLS = true;
                        obj["uiAUXILIARY_ITEM_CODE_02"] = obj["uiAUXILIARY_ITEM_NAME_02"] = obj["AUXILIARY_ITEM2S"].ToStringExtension();
                    }

                    if (isLS && !obj.ExtendedProperties.Contains("TFL_IN"))    //第一次通过业务的入口进去时,要初始化各参数的值
                    {
                        obj.ExtendedProperties.Add("TFL_IN", "TFL");
                    }

                    EditorView ev    = sender as EditorView;
                    Control[]  ctrls = ev.Control.Controls.Find("TabControl1", true);
                    if (ctrls.Length > 0)
                    {
                        TabControl tc = ctrls[0] as TabControl;
                        if (tc != null)
                        {
                            SetFINReadOnly(tc.TabPages["HeaderTab_2"]);  // 公式查看各参数只读
                        }
                    }
                }
            }
        }
        public override void DrawScrollBarBlockBackground(PaintEventArgs e, Rectangle bounds, EditorView view)
        {
            Graphics graphics            = e.Graphics;
            Image    scrollbarBlockImage = this.GetScrollbarBlockImage();

            try
            {
                graphics.DrawImage(scrollbarBlockImage, bounds);
            }
            finally
            {
                if (scrollbarBlockImage != null)
                {
                    scrollbarBlockImage.Dispose();
                }
            }
        }