public LayoutVisualViewModel(VisualOptions visualOptions, ILayoutViewModel element) { VisualOptions = visualOptions; PixelPerUnit = VisualOptions.PixelPerUnit; Element = element; Element .SetPropertyChanged(nameof(Element.Width), () => { OnPropertyChanged(nameof(Width)); OnPropertyChanged(nameof(Rect)); }) .SetPropertyChanged(nameof(Element.Height), () => { OnPropertyChanged(nameof(Height)); OnPropertyChanged(nameof(Rect)); }) .SetPropertyChanged(nameof(Element.Top), () => { OnPropertyChanged(nameof(Top)); OnPropertyChanged(nameof(Rect)); }) .SetPropertyChanged(nameof(Element.Left), () => { OnPropertyChanged(nameof(Left)); OnPropertyChanged(nameof(Rect)); }) .SetPropertyChanged(nameof(Element.OpacityMask), () => OnPropertyChanged(nameof(OpacityMask))) .SetPropertyChanged(nameof(Element.Rect), () => OnPropertyChanged(nameof(Rect))); }
/// <summary> /// Applies visual options to the editor /// </summary> /// <typeparam name="TFont">Font Type</typeparam> /// <typeparam name="TColor">Colour Type</typeparam> /// <param name="options">Visual Options</param> public override void Apply <TFont, TColor>(VisualOptions <TFont, TColor> options) { try { this.Apply(options as VisualOptions <FontFamily, Color>); } catch { throw new ArgumentException("Type Arguments for the Visual Options for a WpfEditorAdaptor are invalid!"); } }
public WavySurfaceVisualViewModel(VisualOptions visualOptions, IWavyBorder<IEnumerable<Point>> element) { var pixelPerUnit = visualOptions.PixelPerUnit; var vavySurfaceTransform = element.Transform(pixelPerUnit.Transform); Func<IBottom<IEnumerable<Point>>, IEnumerable<Point>> transform = b => b.Start.Concat(b.Finish.Reverse()); Peak = vavySurfaceTransform.Waves.Select(w => w.Peak); InSide = vavySurfaceTransform.Waves.Select(w => transform(w.InSide)); OutSide = vavySurfaceTransform.Waves.Select(w => transform(w.OutSide)); Bottom = vavySurfaceTransform.Bottoms.Select(transform); }
public void CreateDefaultOptions() { BehaviorOptions = new BehaviorOptions(); DatabaseSchemaViewOptions = new DatabaseSchemaViewOptions(); DesignPaneOptions = new DesignPaneOptions(); VisualOptions = new VisualOptions(); AddObjectDialogOptions = new AddObjectDialogOptions(); DataSourceOptions = new DataSourceOptions(); QueryNavBarOptions = new QueryNavBarOptions(); UserInterfaceOptions = new UserInterfaceOptions(); SqlFormattingOptions = new SQLFormattingOptions(); SqlGenerationOptions = new SQLGenerationOptions(); }
public OpenQueryResults(VisualOptions<FontFamily, Color> options) { InitializeComponent(); this._editor = new Editor<TextEditor, FontFamily, Color>(new WpfEditorFactory()); this._editor.DocumentManager.VisualOptions = options; Document<TextEditor> doc = this._editor.DocumentManager.New(true); doc.Syntax = "SparqlQuery11"; Grid.SetRow(doc.TextEditor.Control, 2); Grid.SetColumn(doc.TextEditor.Control, 1); this.gridContent.Children.Add(doc.TextEditor.Control); doc.TextEditor.Control.TabIndex = 3; this.btnOpenQueryResults.TabIndex = 4; }
public OpenQueryResults(VisualOptions <FontFamily, Color> options) { InitializeComponent(); this._editor = new Editor <TextEditor, FontFamily, Color>(new WpfEditorFactory()); this._editor.DocumentManager.VisualOptions = options; Document <TextEditor> doc = this._editor.DocumentManager.New(true); doc.Syntax = "SparqlQuery11"; Grid.SetRow(doc.TextEditor.Control, 2); Grid.SetColumn(doc.TextEditor.Control, 1); this.gridContent.Children.Add(doc.TextEditor.Control); doc.TextEditor.Control.TabIndex = 3; this.btnOpenQueryResults.TabIndex = 4; }
public void SetOptions(Options options) { AddObjectDialogOptions.Assign(options.AddObjectDialogOptions); BehaviorOptions.Assign(options.BehaviorOptions); MainForm.DBView.Options.Assign(options.DatabaseSchemaViewOptions); DataSourceOptions.Assign(options.DataSourceOptions); DesignPaneOptions.Assign(options.DesignPaneOptions); ExpressionEditorOptions.Assign(options.ExpressionEditorOptions); QueryColumnListOptions.Assign(options.QueryColumnListOptions); QueryNavBarOptions.Assign(options.QueryNavBarOptions); SqlFormattingOptions.Assign(options.SqlFormattingOptions); SqlGenerationOptions.Assign(options.SqlGenerationOptions); TextEditorOptions.Assign(options.TextEditorOptions); TextEditorSqlOptions.Assign(options.TextEditorSqlOptions); UserInterfaceOptions.Assign(options.UserInterfaceOptions); VisualOptions.Assign(options.VisualOptions); }
public void CreateDefaultOptions() { BehaviorOptions = new BehaviorOptions(); DatabaseSchemaViewOptions = new DatabaseSchemaViewOptions(); DesignPaneOptions = new DesignPaneOptions(); VisualOptions = new VisualOptions(); AddObjectDialogOptions = new AddObjectDialogOptions(); DataSourceOptions = new DataSourceOptions(); QueryNavBarOptions = new QueryNavBarOptions(); UserInterfaceOptions = new UserInterfaceOptions(); SqlFormattingOptions = new SQLFormattingOptions(); SqlGenerationOptions = new SQLGenerationOptions(); ExpressionEditorOptions = new ExpressionEditorOptions(); TextEditorOptions = new TextEditorOptions { Padding = DefaultTextEditorPadding, LineHeight = new LengthUnit(90, SizeUnitType.Percent) }; TextEditorSqlOptions = new SqlTextEditorOptions(); }
public AppearanceSettings(VisualOptions <FontFamily, Color> options) { this._options = options; this._decorations = new List <string>() { "None", "Baseline", "OverLine", "Strikethrough", "Underline" }; InitializeComponent(); //Prepare a list of colours as we need this to select the relevant colours later Type t = typeof(Colors); Type cType = typeof(Color); foreach (PropertyInfo p in t.GetProperties()) { if (p.PropertyType.Equals(cType)) { try { Color c = (Color)ColorConverter.ConvertFromString(p.Name); this._colours.Add(c.ToString()); } catch { //Ignore errors here } } } //Show current settings this.ShowSettings(); }
/// <summary> /// Applies visual options to the editor /// </summary> /// <param name="options">Visual Options</param> public void Apply(VisualOptions <FontFamily, Color> options) { if (options == null) { return; } this.Control.Options.EnableEmailHyperlinks = options.EnableClickableUris; this.Control.Options.EnableHyperlinks = options.EnableClickableUris; if (options.FontFace != null) { this.Control.FontFamily = options.FontFace; } this.Control.FontSize = options.FontSize; this.Control.Foreground = new SolidColorBrush(options.Foreground); this.Control.Background = new SolidColorBrush(options.Background); this.ShowLineNumbers = options.ShowLineNumbers; this.ShowSpaces = options.ShowSpaces; this.ShowTabs = options.ShowTabs; this.ShowEndOfLine = options.ShowEndOfLine; this.WordWrap = options.WordWrap; }
public AppearanceSettings(VisualOptions<FontFamily, Color> options) { this._options = options; this._decorations = new List<string>() { "None", "Baseline", "OverLine", "Strikethrough", "Underline" }; InitializeComponent(); //Prepare a list of colours as we need this to select the relevant colours later Type t = typeof(Colors); Type cType = typeof(Color); foreach (PropertyInfo p in t.GetProperties()) { if (p.PropertyType.Equals(cType)) { try { Color c = (Color)ColorConverter.ConvertFromString(p.Name); this._colours.Add(c.ToString()); } catch { //Ignore errors here } } } //Show current settings this.ShowSettings(); }
/// <summary> /// Creates an element /// </summary> /// <param name="options">Visual Options</param> /// <param name="parentLine">Visual Line</param> /// <param name="length">Element Length</param> public ValidationErrorLineText(VisualOptions <FontFamily, Color> options, VisualLine parentLine, int length) : base(parentLine, length) { this._options = options; }
public ValidationErrorElementGenerator(WpfEditorAdaptor adaptor, VisualOptions <FontFamily, Color> options) { this._adaptor = adaptor; this._options = options; }
public void CopyTo(VisualOptions other) { other.FeedbackLevel = this.m_FeedbackLevel; other.ParticleFeedbackLevel = this.m_ParticleFeedbackLevel; other.WarpPropagation = this.m_WarpPropagation; other.WarpVariance = this.m_WarpVariance; other.WarpPersistence = this.m_WarpPersistence; other.SelfImage = this.m_SelfImage; other.SelfFeedback = this.m_SelfFeedback; other.SelfColor = this.m_SelfColor; other.SelfFeedbackColor = this.m_SelfFeedbackColor; }
public ValidationErrorLineText(VisualOptions<FontFamily, Color> options, VisualLine parentLine, int length) : base(parentLine, length) { this._options = options; }
public ValidationErrorElementGenerator(WpfEditorAdaptor adaptor, VisualOptions<FontFamily, Color> options) { this._adaptor = adaptor; this._options = options; }