private void FillStylesCollection()
        {
            if (!_isViewLoaded)
            {
                return;
            }

            var grid = View.Grid as CustomGridControl;

            if (grid == null)
            {
                return;
            }

            foreach (var p in StylesCollection.Where(p => !p.IsReadOnly).ToArray())
            {
                StylesCollection.Remove(p);
            }

            foreach (var o in grid.ExpressionStyleOptions.Options)
            {
                StylesCollection.Add(new StyleOption(o));
            }

            CollectionModify();
        }
        private void FillStylesCollection()
        {
            if (!_isViewLoaded)
            {
                return;
            }

            var tree = View.DataControl as CustomTreeListControl;

            if (tree == null)
            {
                return;
            }

            var stylesCollection = StylesCollection.Where(p => p.IsReadOnly).ToArray();

            StylesCollection.Clear();

            foreach (var p in stylesCollection)
            {
                StylesCollection.Add(p);
            }

            foreach (var o in tree.ExpressionStyleOptions.Options)
            {
                StylesCollection.Add(new StyleOption(o));
            }
        }
 public NodeParametersPanel(List <NodeParameter> parameters)
 {
     _backgroundTexture   = TextureUtils.LoadTexture("Assets/Editor/Textures/NodeParameters.psd");
     _parameters          = parameters;
     _nodeParametersStyle = StylesCollection.GetStyle(VntStyles.NodeParameters);
     Width = 120;
 }
        protected NodeView(Vector2 position)
        {
            BRect = new Rect(position.x, position.y, Width, Height);

            _arrowButtonStyle        = StylesCollection.GetStyle(VntStyles.ButtonArrow);
            _arrowButtonStyle.margin = new RectOffset(60, 0, 0, 0);
        }
        public DialogueNodeView(string title, Vector2 position) : base(position)
        {
            DefaultNodeStyle  = StylesCollection.GetStyle(VntStyles.DialogueNode);
            SelectedNodeStyle = StylesCollection.GetStyle(VntStyles.DialogueNode);

            Width  = 130;
            Height = 75;
        }
        protected NodeView(string title, Vector2 position)
        {
            _title = title;
            BRect  = new Rect(position.x, position.y, Width, Height);

            _labelStyle       = StylesCollection.GetStyle(VntStyles.Label);
            _buttonStyle      = StylesCollection.GetStyle(VntStyles.Button);
            _arrowButtonStyle = StylesCollection.GetStyle(VntStyles.ButtonArrow);
        }
        private void ShowExpressionWindow()
        {
            try
            {
                SetColumnInfo();
                //Конвертируем название свойств в название столбцов.
                foreach (var p in StylesCollection.Where(p => p != null))
                {
                    if (p.ExpressionString == null)
                    {
                        p.ExpressionString = string.Empty;
                    }
                    else if (p.ExpressionString != string.Empty)
                    {
                        p.ExpressionString = p.Parent.ConvertToCaptions(p.ExpressionString);
                    }

                    if (p.FormatConditionType == FormatConditionType.Default && string.IsNullOrEmpty(p.Name))
                    {
                        p.Name = p.ExpressionString;
                    }
                }

                var window = new ConditionalFormattingWindow(View, StylesCollection)
                {
                    Owner = Application.Current.MainWindow.IsActive ? Application.Current.MainWindow : null
                };
                if (window.ShowDialog() == true)
                {
                    Dispatcher.Invoke(new Action(delegate
                    {
                        if (View.Grid is CustomGridControl)
                        {
                            var grid = (CustomGridControl)View.Grid;
                            grid.ExpressionStyleOptions.Clear();

                            //Конвертируем название столбцов в название свойств.
                            foreach (var p in StylesCollection.Where(p => p != null && !string.IsNullOrEmpty(p.ExpressionString)))
                            {
                                p.ExpressionString = p.Parent.ConvertToFields(p.ExpressionString);
                            }
                            grid.ExpressionStyleOptions.Options.AddRange(
                                StylesCollection.Where(p => p != null && !p.IsReadOnly));
                        }

                        View.ClearFormatConditionsFromAllColumns();
                        CollectionModify();
                    }));
                }
            }
            finally
            {
                ShowFormatConditionsEditorWindow = false;
            }
        }
Esempio n. 8
0
 public NodeParameter(string text)
 {
     _text                    = text;
     _labelStyle              = StylesCollection.GetStyle(VntStyles.Label);
     _buttonStyle             = StylesCollection.GetStyle(VntStyles.Button);
     _labelStyle.margin       = new RectOffset(5, 5, 5, 5);
     _labelStyle.fixedHeight  = 20;
     _labelStyle.fixedWidth   = 20;
     _buttonStyle.margin      = new RectOffset(5, 5, 5, 5);
     _buttonStyle.fixedHeight = 20;
     _buttonStyle.fixedWidth  = 20;
     Text   = "0";
     Width  = 20;
     Height = 20;
 }
        private void CollectionModify()
        {
            try
            {
                View.FormatConditions.BeginUpdate();

                foreach (var t in StylesCollection.Where(p => p != null))
                {
                    CollectionModify(t);
                }
            }
            finally
            {
                View.FormatConditions.EndUpdate();
            }
        }
Esempio n. 10
0
        public PortView(PortType type)
        {
            _rect = new Rect(0, 0, Width, Height);
            _type = type;

            switch (type)
            {
            case PortType.In:
                _style = StylesCollection.GetStyle(VntStyles.PortIn);
                break;

            case PortType.Out:
                _style = StylesCollection.GetStyle(VntStyles.PortOut);
                break;
            }
        }
        private void ShowExpressionWindow()
        {
            try
            {
                SetColumnInfo();
                //Конвертируем название свойств в название столбцов.
                foreach (var p in StylesCollection.Where(p => p != null))
                {
                    if (p.ExpressionString == null)
                    {
                        p.ExpressionString = string.Empty;
                    }
                    else if (p.ExpressionString != string.Empty)
                    {
                        p.ExpressionString = p.Parent.ConvertToCaptions(p.ExpressionString);
                    }

                    if (p.FormatConditionType == FormatConditionType.Default && string.IsNullOrEmpty(p.Name))
                    {
                        p.Name = p.ExpressionString;
                    }
                }

                var window = new ConditionalFormattingWindow(View, StylesCollection, true)
                {
                    Owner = Application.Current.MainWindow.IsActive ? Application.Current.MainWindow : null
                };
                if (window.ShowDialog() == true)
                {
                    if (View != null && View.DataControl is CustomTreeListControl)
                    {
                        var tree = (CustomTreeListControl)View.DataControl;
                        tree.ExpressionStyleOptions.Clear();
                        //Конвертируем название столбцов в название свойств.
                        foreach (var p in StylesCollection)
                        {
                            p.ExpressionString = p.Parent.ConvertToFields(p.ExpressionString);
                        }
                        tree.ExpressionStyleOptions.Options.AddRange(StylesCollection.Where(p => p != null && !p.IsReadOnly));
                    }
                }
            }
            finally
            {
                ShowFormatConditionsEditorWindow = false;
            }
        }
        public ConnectionPointView(INodeView nodeView, ConnectionPointType type)
        {
            _rect     = new Rect(0, 0, Width, Height);
            _nodeView = nodeView;
            _type     = type;

            switch (type)
            {
            case ConnectionPointType.In:
                _style = StylesCollection.GetStyle(VntStyles.ConnectionIn);
                break;

            case ConnectionPointType.Out:
                _style = StylesCollection.GetStyle(VntStyles.ConnectionOut);
                break;
            }
        }
        protected override void OnDetaching()
        {
            base.OnDetaching();
            ExprButton.ItemClick -= BarButtonItem_ItemClick;

            View.Loaded -= View_Loaded;

            StylesCollection.CollectionChanged -= StylesCollection_CollectionChanged;
            StylesCollection.Clear();

            View.DataControl.ItemsSourceChanged -= OnItemsSourceChanged;
            var cgc = View.DataControl as CustomTreeListControl;

            if (cgc != null)
            {
                cgc.ExpressionStyleOptionsChanged -= ExpressionStyleOptionsChanged;
            }
        }
 /// <summary>
 /// Required method for Designer support - do not modify 
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     //this.SuspendLayout();
     // 
     // StyledListView
     // 
     //this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     //this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     //this.Name = "StyledListView";
     //this.Size = new System.Drawing.Size(326, 87);
     //this.ResumeLayout(false);
     this.components = new System.ComponentModel.Container();
     this.styles = new StylesCollection();
     this.items = new ListViewItemsCollection(this, this.OnNewItemAdded);
     this.sorter = new StyledControls.ListViewColumnSorter();
     this.ListViewItemSorter = this.sorter;
     this.DrawItem += new System.Windows.Forms.DrawListViewItemEventHandler(this.DrawShadedItem);
     this.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.OnColunmClickSort);
 }
Esempio n. 15
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     //this.SuspendLayout();
     //
     // StyledListView
     //
     //this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     //this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     //this.Name = "StyledListView";
     //this.Size = new System.Drawing.Size(326, 87);
     //this.ResumeLayout(false);
     this.components         = new System.ComponentModel.Container();
     this.styles             = new StylesCollection();
     this.items              = new ListViewItemsCollection(this, this.OnNewItemAdded);
     this.sorter             = new StyledControls.ListViewColumnSorter();
     this.ListViewItemSorter = this.sorter;
     this.DrawItem          += new System.Windows.Forms.DrawListViewItemEventHandler(this.DrawShadedItem);
     this.ColumnClick       += new System.Windows.Forms.ColumnClickEventHandler(this.OnColunmClickSort);
 }
        protected override void OnDetaching()
        {
            base.OnDetaching();

            View.Loaded          -= OnViewLoaded;
            ExprButton.ItemClick -= OnExprButtonClick;
            ExprButton            = null;
            if (StylesCollection != null)
            {
                StylesCollection.Clear();
                StylesCollection = null;
            }

            View.Grid.ItemsSourceChanged -= OnGridItemsSourceChanged;
            var cgc = View.Grid as CustomGridControl;

            if (cgc != null)
            {
                cgc.ExpressionStyleOptionsChanged -= ExpressionStyleOptionsChanged;
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="WorksheetWriter{TClass, TClassMap}"/> class.
        /// </summary>
        /// <param name="worksheetName">The worksheet's name.</param>
        /// <param name="worksheetPositionIndex">The position where the worksheet should be inserted in the workbook.</param>
        /// <param name="spreadsheetDocument">A reference to the worksheet's parent <see cref="spreadsheetDocument"/>.</param>
        /// <param name="worksheetStyle">The workseet's style definitions.</param>
        /// <param name="sharedStrings">The shared strings collection shared by all worksheets.</param>
        /// <param name="spreadsheetStyles">The spreadsheet stylesheet shared by all worksheets.</param>
        public WorksheetWriter(string worksheetName, int worksheetPositionIndex, SpreadsheetDocument spreadsheetDocument, WorksheetStyle worksheetStyle, BidirectionalDictionary <string, string> sharedStrings, StylesCollection spreadsheetStyles)
        {
            this.sharedStrings          = sharedStrings;
            this.spreadsheetDocument    = spreadsheetDocument;
            this.spreadsheetStyles      = spreadsheetStyles;
            this.worksheetName          = worksheetName;
            this.worksheetPositionIndex = worksheetPositionIndex;
            this.worksheetStyle         = worksheetStyle;

            // setup worksheet
            this.currentRowIndex = this.worksheetStyle.HeaderRowIndex;
            this.worksheetPart   = this.spreadsheetDocument.WorkbookPart.AddNewPart <WorksheetPart>();

            // property maps
            this.orderedPropertyMaps = this.CreateOrderedPropertyMaps().ToList();

            // worksheet setup
            this.CacheWorksheetData();
            this.writer = OpenXmlWriter.Create(this.worksheetPart, System.Text.Encoding.UTF8);
            this.WriteInitialWorksheetElements();
        }
 public NodeParameter(string text)
 {
     _text        = text;
     _labelStyle  = StylesCollection.GetStyle(VntStyles.Label);
     _buttonStyle = StylesCollection.GetStyle(VntStyles.Button);
 }
 public SetBackgroundNodeView(string title, Vector2 position) : base(title, position)
 {
     DefaultNodeStyle  = StylesCollection.GetStyle(VntStyles.SetBackgroundNode);
     SelectedNodeStyle = StylesCollection.GetStyle(VntStyles.SetBackgroundNode);
 }
 private void VntViewOnAwaked()
 {
     StylesCollection.LoadStyles();
     _vntModel.LoadNodes();
 }
Esempio n. 21
0
 public DialogueNodeView(string title, Vector2 position) : base(title, position)
 {
     DefaultNodeStyle  = StylesCollection.GetStyle(VntStyles.DialogueNode);
     SelectedNodeStyle = StylesCollection.GetStyle(VntStyles.DialogueNode);
 }
Esempio n. 22
0
 public NodeParametersPanel(List <NodeParameter> parameters)
 {
     _parameters          = parameters;
     _nodeParametersStyle = StylesCollection.GetStyle(VntStyles.NodeParameters);
 }