public override bool TryMorphExpression(ActivityWithResult expression, bool isLocationExpression, Type newType, EditingContext context, out ActivityWithResult newExpression) { Fx.Assert(expression != null, "Original expression shouldn't be null in morph helper"); Fx.Assert(context != null, "EditingContext shouldn't be null in morph helper"); newExpression = null; if (expression.ResultType == newType && (ExpressionHelper.IsGenericLocationExpressionType(expression) == isLocationExpression)) { newExpression = expression; return(true); } if (context != null) { string expressionEditor = ExpressionHelper.GetRootEditorSetting(context.Services.GetService <ModelTreeManager>(), WorkflowDesigner.GetTargetFramework(context)); ParserContext parserContext = new ParserContext(); string expressionText = ExpressionHelper.GetExpressionString(expression, parserContext); if (!string.IsNullOrEmpty(expressionEditor)) { return(ExpressionTextBox.TryConvertFromString(expressionEditor, expressionText, isLocationExpression, newType, out newExpression)); } } return(false); }
void OnExpressionEditorLoaded(object sender, RoutedEventArgs e) { ExpressionTextBox expressionTextBox = sender as ExpressionTextBox; Fx.Assert(expressionTextBox != null, "sender should be userControl"); //bind ExpressionProperty of Expression textbox to ModelItem.Condition Binding b = new Binding(); ArgumentToExpressionConverter argumentToExpressionConverter = new ArgumentToExpressionConverter(); b.Converter = argumentToExpressionConverter; b.Mode = BindingMode.TwoWay; b.Source = this.ModelItem; b.Path = new PropertyPath("Condition"); if (BindingOperations.GetBinding(expressionTextBox, ExpressionTextBox.ExpressionProperty) != null) { BindingOperations.ClearBinding(expressionTextBox, ExpressionTextBox.ExpressionProperty); } expressionTextBox.SetBinding(ExpressionTextBox.ExpressionProperty, b); //bind OwnerActivityProperty of Expression textbox to ModelItem Binding b1 = new Binding(); b1.Source = this.ModelItem; if (BindingOperations.GetBinding(expressionTextBox, ExpressionTextBox.OwnerActivityProperty) != null) { BindingOperations.ClearBinding(expressionTextBox, ExpressionTextBox.OwnerActivityProperty); } expressionTextBox.SetBinding(ExpressionTextBox.OwnerActivityProperty, b1); }
private void UpdateBinding() { if (ExpressionTextBox == null || SelectedCell == null) { return; } ExpressionTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateSource(); BindingOperations.ClearBinding(ExpressionTextBox, TextBox.TextProperty); Binding textBinding = null; if (SelectedCell.IsEditable) { textBinding = new Binding("Text") { Source = SelectedCell.ContentBox, Mode = BindingMode.TwoWay, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged }; } else { textBinding = new Binding("ExpressionStr") { Source = SelectedCell.DataContext, Mode = BindingMode.OneWay, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged }; } ExpressionTextBox.SetBinding(TextBox.TextProperty, textBinding); }
/// <summary> /// Creates a new Workflow Designer instance with C# Expression Editor /// </summary> /// <param name="sourceFile">Workflow FileName</param> public static void NewInstanceCSharp(string sourceFile = _defaultWorkflowCSharp) { _expressionEditorService = new RoslynExpressionEditorService(); ExpressionTextBox.RegisterExpressionActivityEditor(new CSharpValue <string>().Language, typeof(RoslynExpressionEditor), CSharpExpressionHelper.CreateExpressionFromString); _wfDesigner = new WorkflowDesigner(); _wfDesigner.Context.Services.GetService <DesignerConfigurationService>().TargetFrameworkName = new System.Runtime.Versioning.FrameworkName(".NETFramework", new Version(4, 5)); _wfDesigner.Context.Services.GetService <DesignerConfigurationService>().LoadingFromUntrustedSourceEnabled = true; _wfDesigner.Context.Services.Publish <IExpressionEditorService>(_expressionEditorService); //associates all of the basic activities with their designers new DesignerMetadata().Register(); //load Workflow Xaml _wfDesigner.Load(sourceFile); SelectHelper._wfDesigner = _wfDesigner; if (!SelectHelper.WorkflowDictionary.ContainsKey(sourceFile)) { SelectHelper.WorkflowDictionary.Add(sourceFile, _wfDesigner); } else { SelectHelper.WorkflowDictionary[sourceFile] = _wfDesigner; } if (!SelectHelper.RuntimeApplicationHelperDictionary.ContainsKey(sourceFile)) { SelectHelper.RuntimeApplicationHelperDictionary.Add(sourceFile, new RuntimeApplicationHelper()); } }
void OnValuesBoxLoaded(object sender, RoutedEventArgs e) { ExpressionTextBox etb = sender as ExpressionTextBox; Fx.Assert(null != etb, "sender should not be null!"); etb.ExpressionType = typeof(IEnumerable <>).MakeGenericType(this.ModelItem.ItemType.GetGenericArguments()); }
private void AddDesigner() { //Create an instance of WorkflowDesigner class. this.workflowDesigner = new WorkflowDesigner(); //Place the designer canvas in the middle column of the grid. Grid.SetColumn(this.workflowDesigner.View, 1); Grid.SetRow(this.workflowDesigner.View, 1); this.expressionEditorService = new RoslynExpressionEditorService(); ExpressionTextBox.RegisterExpressionActivityEditor(new CSharpValue <string>().Language, typeof(RoslynExpressionEditor), CSharpExpressionHelper.CreateExpressionFromString); this.workflowDesigner.Context.Services.Publish <IExpressionEditorService>(this.expressionEditorService); //To avoid loading the default VB expression editor DesignerConfigurationService configurationService = this.workflowDesigner.Context.Services.GetService <DesignerConfigurationService>(); configurationService.TargetFrameworkName = new FrameworkName(".NETFramework", new System.Version(4, 5)); configurationService.LoadingFromUntrustedSourceEnabled = true; //Load a new Sequence as default. this.workflowDesigner.Load("StartingWorkflow.xml"); //Add the designer canvas to the grid. grid1.Children.Add(this.workflowDesigner.View); }
private void ActivityDesigner_GotFocus(object sender, RoutedEventArgs e) { DataTemplate dataTemplate = FindResource("Expanded") as DataTemplate; ExpressionTextBox scriptBox = dataTemplate.FindName("scriptTextBox", CSharpCodingContentPresenter) as ExpressionTextBox; CSharpCoding.NameTypeDictionary = CSharpCoding.GetNameType(scriptBox.Expression.ToString()); }
void OnExpressionTextBoxUnloaded(object sender, RoutedEventArgs args) { ExpressionTextBox etb = (ExpressionTextBox)sender; if (!etb.IsReadOnly) { DataGridHelper.OnEditingControlUnloaded(sender, args); } }
/// <summary> /// Creates a new Workflow Designer instance with C# Expression Editor /// </summary> /// <param name="sourceFile">Workflow FileName</param> public static WorkflowDesigner NewInstance(string sourceFile = _defaultActivity) { if (string.IsNullOrWhiteSpace(sourceFile)) { sourceFile = Path.Combine(AssemblyDirectory, _defaultActivity); } var expressionEditorService = new RoslynExpressionEditorService(); ExpressionTextBox.RegisterExpressionActivityEditor(new CSharpValue <string>().Language, typeof(RoslynExpressionEditor), CSharpExpressionHelper.CreateExpressionFromString); var wfDesigner = new WorkflowDesigner(); var dcs = wfDesigner.Context.Services.GetService <DesignerConfigurationService>(); dcs.TargetFrameworkName = new System.Runtime.Versioning.FrameworkName(".NETFramework", new Version(4, 6, 1)); dcs.LoadingFromUntrustedSourceEnabled = true; wfDesigner.Context.Services.Publish <IExpressionEditorService>(expressionEditorService); //associates all of the basic activities with their designers new DesignerMetadata().Register(); string temp = File.ReadAllText(Path.Combine(AssemblyDirectory, @"colors.xaml")); StringReader reader = new StringReader(temp); XmlReader xmlReader = XmlReader.Create(reader); ResourceDictionary fontAndColorDictionary = (ResourceDictionary)System.Windows.Markup.XamlReader.Load(xmlReader); //var keys = GetColorKeys(); //foreach (var key in keys) //{ // fontAndColorDictionary[key] = Brushes.Pink; //} Hashtable hashTable = new Hashtable(); foreach (var key in fontAndColorDictionary.Keys) { hashTable.Add(key, fontAndColorDictionary[key]); } wfDesigner.PropertyInspectorFontAndColorData = XamlServices.Save(hashTable); //load Workflow Xaml wfDesigner.Load(sourceFile); //var g = wfDesigner.View as Grid; //g.Background = Brushes.Pink; return(wfDesigner); }
private void AddExpressionToList() { String addedEexpression = ExpressionTextBox.Text; if (String.IsNullOrEmpty(addedEexpression) || String.IsNullOrWhiteSpace(addedEexpression)) { MessageBox.Show("Expression cannot be null or empty"); return; } try { _cl.AddExpression(addedEexpression); ExpressionList.Items.Add(addedEexpression); ExpressionTextBox.Clear(); } catch (Exception) { MessageBox.Show("Some exception thrown during parce entered expression. Expression can't added to list. Please check it"); } }
void OnValuesBoxLoaded(object sender, RoutedEventArgs e) { ExpressionTextBox etb = sender as ExpressionTextBox; etb.ExpressionType = typeof(IEnumerable <>).MakeGenericType(this.ModelItem.ItemType.GetGenericArguments()); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.splitMain = new System.Windows.Forms.SplitContainer(); this.labelWarnings = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.labelColumn = new System.Windows.Forms.Label(); this.labelLine = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.panelExpressionEditor = new System.Windows.Forms.Panel(); this.buttonSave = new System.Windows.Forms.Button(); this.buttonRevert = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.splitVariables = new System.Windows.Forms.SplitContainer(); this.titleOrCompileError = new System.Windows.Forms.TextBox(); this.label6 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.listVariables = new System.Windows.Forms.ListView(); this.columnVariableName = new System.Windows.Forms.ColumnHeader(); this.columnVariableValue = new System.Windows.Forms.ColumnHeader(); this.columnVariableType = new System.Windows.Forms.ColumnHeader(); this.buttonHelp = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button(); this.buttonOK = new System.Windows.Forms.Button(); this.checkBoxDebugExec = new System.Windows.Forms.CheckBox(); this.lineNumbers = new VSWindowTitleChanger.RichTextBoxLineNumbers(); this.editTitleExpression = new VSWindowTitleChanger.ExpressionTextBox(); this.splitMain.Panel1.SuspendLayout(); this.splitMain.Panel2.SuspendLayout(); this.splitMain.SuspendLayout(); this.panelExpressionEditor.SuspendLayout(); this.splitVariables.Panel1.SuspendLayout(); this.splitVariables.Panel2.SuspendLayout(); this.splitVariables.SuspendLayout(); this.SuspendLayout(); // // splitMain // this.splitMain.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.splitMain.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; this.splitMain.Location = new System.Drawing.Point(12, 12); this.splitMain.Name = "splitMain"; this.splitMain.Orientation = System.Windows.Forms.Orientation.Horizontal; // // splitMain.Panel1 // this.splitMain.Panel1.Controls.Add(this.labelWarnings); this.splitMain.Panel1.Controls.Add(this.label5); this.splitMain.Panel1.Controls.Add(this.labelColumn); this.splitMain.Panel1.Controls.Add(this.labelLine); this.splitMain.Panel1.Controls.Add(this.label4); this.splitMain.Panel1.Controls.Add(this.label3); this.splitMain.Panel1.Controls.Add(this.panelExpressionEditor); this.splitMain.Panel1.Controls.Add(this.buttonSave); this.splitMain.Panel1.Controls.Add(this.buttonRevert); this.splitMain.Panel1.Controls.Add(this.label1); // // splitMain.Panel2 // this.splitMain.Panel2.Controls.Add(this.splitVariables); this.splitMain.Size = new System.Drawing.Size(960, 606); this.splitMain.SplitterDistance = 193; this.splitMain.TabIndex = 0; // // labelWarnings // this.labelWarnings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.labelWarnings.AutoSize = true; this.labelWarnings.Location = new System.Drawing.Point(599, 4); this.labelWarnings.Name = "labelWarnings"; this.labelWarnings.Size = new System.Drawing.Size(13, 13); this.labelWarnings.TabIndex = 14; this.labelWarnings.Text = "0"; // // label5 // this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label5.AutoSize = true; this.label5.Location = new System.Drawing.Point(444, 4); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(149, 13); this.label5.TabIndex = 13; this.label5.Text = "Warnings/unknown variables:"; // // labelColumn // this.labelColumn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.labelColumn.AutoSize = true; this.labelColumn.Location = new System.Drawing.Point(758, 4); this.labelColumn.Name = "labelColumn"; this.labelColumn.Size = new System.Drawing.Size(13, 13); this.labelColumn.TabIndex = 12; this.labelColumn.Text = "1"; // // labelLine // this.labelLine.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.labelLine.AutoSize = true; this.labelLine.Location = new System.Drawing.Point(684, 4); this.labelLine.Name = "labelLine"; this.labelLine.Size = new System.Drawing.Size(13, 13); this.labelLine.TabIndex = 11; this.labelLine.Text = "1"; // // label4 // this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(648, 4); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(30, 13); this.label4.TabIndex = 10; this.label4.Text = "Line:"; // // label3 // this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(727, 4); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(25, 13); this.label3.TabIndex = 9; this.label3.Text = "Col:"; // // panelExpressionEditor // this.panelExpressionEditor.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.panelExpressionEditor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panelExpressionEditor.Controls.Add(this.lineNumbers); this.panelExpressionEditor.Controls.Add(this.editTitleExpression); this.panelExpressionEditor.Location = new System.Drawing.Point(0, 23); this.panelExpressionEditor.Name = "panelExpressionEditor"; this.panelExpressionEditor.Size = new System.Drawing.Size(960, 168); this.panelExpressionEditor.TabIndex = 0; // // buttonSave // this.buttonSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonSave.Enabled = false; this.buttonSave.Location = new System.Drawing.Point(804, 0); this.buttonSave.Name = "buttonSave"; this.buttonSave.Size = new System.Drawing.Size(75, 20); this.buttonSave.TabIndex = 1; this.buttonSave.Text = "Save"; this.buttonSave.UseVisualStyleBackColor = true; // // buttonRevert // this.buttonRevert.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonRevert.Enabled = false; this.buttonRevert.Location = new System.Drawing.Point(885, 0); this.buttonRevert.Name = "buttonRevert"; this.buttonRevert.Size = new System.Drawing.Size(75, 20); this.buttonRevert.TabIndex = 2; this.buttonRevert.Text = "Revert"; this.buttonRevert.UseVisualStyleBackColor = true; // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(2, 5); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(260, 13); this.label1.TabIndex = 0; this.label1.Text = "Window Title Expression: (See help[F1] for examples.)"; // // splitVariables // this.splitVariables.Dock = System.Windows.Forms.DockStyle.Fill; this.splitVariables.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; this.splitVariables.Location = new System.Drawing.Point(0, 0); this.splitVariables.Name = "splitVariables"; this.splitVariables.Orientation = System.Windows.Forms.Orientation.Horizontal; // // splitVariables.Panel1 // this.splitVariables.Panel1.Controls.Add(this.titleOrCompileError); // // splitVariables.Panel2 // this.splitVariables.Panel2.Controls.Add(this.label6); this.splitVariables.Panel2.Controls.Add(this.label2); this.splitVariables.Panel2.Controls.Add(this.listVariables); this.splitVariables.Size = new System.Drawing.Size(960, 409); this.splitVariables.SplitterDistance = 69; this.splitVariables.TabIndex = 0; // // titleOrCompileError // this.titleOrCompileError.Dock = System.Windows.Forms.DockStyle.Fill; this.titleOrCompileError.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.titleOrCompileError.Location = new System.Drawing.Point(0, 0); this.titleOrCompileError.Multiline = true; this.titleOrCompileError.Name = "titleOrCompileError"; this.titleOrCompileError.ReadOnly = true; this.titleOrCompileError.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.titleOrCompileError.Size = new System.Drawing.Size(960, 69); this.titleOrCompileError.TabIndex = 0; this.titleOrCompileError.Text = "Window Title"; // // label6 // this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label6.AutoSize = true; this.label6.Location = new System.Drawing.Point(721, 6); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(236, 13); this.label6.TabIndex = 4; this.label6.Text = "Double click or ENTER to paste variable names."; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(2, 6); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(168, 13); this.label2.TabIndex = 3; this.label2.Text = "Available constants and variables:"; // // listVariables // this.listVariables.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.listVariables.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnVariableName, this.columnVariableValue, this.columnVariableType}); this.listVariables.FullRowSelect = true; this.listVariables.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; this.listVariables.LabelWrap = false; this.listVariables.Location = new System.Drawing.Point(0, 23); this.listVariables.MultiSelect = false; this.listVariables.Name = "listVariables"; this.listVariables.ShowItemToolTips = true; this.listVariables.Size = new System.Drawing.Size(960, 313); this.listVariables.TabIndex = 0; this.listVariables.UseCompatibleStateImageBehavior = false; this.listVariables.View = System.Windows.Forms.View.Details; // // columnVariableName // this.columnVariableName.Text = "Variable"; this.columnVariableName.Width = 200; // // columnVariableValue // this.columnVariableValue.Text = "Value"; this.columnVariableValue.Width = 670; // // columnVariableType // this.columnVariableType.Text = "Type"; // // buttonHelp // this.buttonHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.buttonHelp.Location = new System.Drawing.Point(12, 627); this.buttonHelp.Name = "buttonHelp"; this.buttonHelp.Size = new System.Drawing.Size(75, 23); this.buttonHelp.TabIndex = 3; this.buttonHelp.Text = "Help"; this.buttonHelp.UseVisualStyleBackColor = true; // // buttonCancel // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.Location = new System.Drawing.Point(897, 627); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(75, 23); this.buttonCancel.TabIndex = 2; this.buttonCancel.Text = "Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; // // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonOK.Location = new System.Drawing.Point(816, 627); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(75, 23); this.buttonOK.TabIndex = 1; this.buttonOK.Text = "OK"; this.buttonOK.UseVisualStyleBackColor = true; // // checkBoxDebugExec // this.checkBoxDebugExec.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.checkBoxDebugExec.AutoSize = true; this.checkBoxDebugExec.Location = new System.Drawing.Point(102, 633); this.checkBoxDebugExec.Name = "checkBoxDebugExec"; this.checkBoxDebugExec.Size = new System.Drawing.Size(151, 17); this.checkBoxDebugExec.TabIndex = 4; this.checkBoxDebugExec.Text = "Debug the exec command"; this.checkBoxDebugExec.UseVisualStyleBackColor = true; // // lineNumbers // this.lineNumbers.BackColor = System.Drawing.SystemColors.Control; this.lineNumbers.Dock = System.Windows.Forms.DockStyle.Left; this.lineNumbers.ForeColor = System.Drawing.Color.Gray; this.lineNumbers.Location = new System.Drawing.Point(0, 0); this.lineNumbers.Name = "lineNumbers"; this.lineNumbers.RightLineColor = System.Drawing.Color.LightGray; this.lineNumbers.Size = new System.Drawing.Size(51, 166); this.lineNumbers.TabIndex = 2; this.lineNumbers.TextBox = this.editTitleExpression; // // editTitleExpression // this.editTitleExpression.AcceptsTab = true; this.editTitleExpression.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.editTitleExpression.AutoWordSelection = true; this.editTitleExpression.BorderStyle = System.Windows.Forms.BorderStyle.None; this.editTitleExpression.DetectUrls = false; this.editTitleExpression.Font = new System.Drawing.Font("Consolas", 9F); this.editTitleExpression.Location = new System.Drawing.Point(51, 0); this.editTitleExpression.MaxLength = 65536; this.editTitleExpression.Name = "editTitleExpression"; this.editTitleExpression.Size = new System.Drawing.Size(907, 167); this.editTitleExpression.SmoothScroll = false; this.editTitleExpression.TabIndex = 1; this.editTitleExpression.Text = ""; this.editTitleExpression.WordWrap = false; // // TitleSetupEditor // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(984, 662); this.Controls.Add(this.checkBoxDebugExec); this.Controls.Add(this.buttonOK); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonHelp); this.Controls.Add(this.splitMain); this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "TitleSetupEditor"; this.Text = "Visual Studio Title Setup"; this.splitMain.Panel1.ResumeLayout(false); this.splitMain.Panel1.PerformLayout(); this.splitMain.Panel2.ResumeLayout(false); this.splitMain.ResumeLayout(false); this.panelExpressionEditor.ResumeLayout(false); this.splitVariables.Panel1.ResumeLayout(false); this.splitVariables.Panel1.PerformLayout(); this.splitVariables.Panel2.ResumeLayout(false); this.splitVariables.Panel2.PerformLayout(); this.splitVariables.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); }
// Called by the designer to register design-time metadata. public void Register() { AttributeTableBuilder builder = new AttributeTableBuilder(); // Register Designers. builder.AddCustomAttributes(typeof(Activity), new DesignerAttribute(typeof(ActivityDesigner))); builder.AddCustomAttributes(typeof(ActivityBuilder), new DesignerAttribute(typeof(ActivityTypeDesigner))); builder.AddCustomAttributes(typeof(ActivityBuilder <>), new DesignerAttribute(typeof(GenericActivityTypeDesigner))); // Register PropertyValueEditors builder.AddCustomAttributes(typeof(Argument), new EditorAttribute(typeof(ExpressionValueEditor), typeof(PropertyValueEditor))); builder.AddCustomAttributes(typeof(Type), PropertyValueEditor.CreateEditorAttribute(typeof(TypePropertyEditor))); builder.AddCustomAttributes(typeof(Activity <>), new EditorAttribute(typeof(ExpressionValueEditor), typeof(PropertyValueEditor))); // Disable reuse of propertyvalueeditors for Arguments builder.AddCustomAttributes(typeof(Argument), new EditorReuseAttribute(false)); builder.AddCustomAttributes(typeof(Activity <>), new EditorReuseAttribute(false)); //Removing all the properties except "Name" from property grid for the type SchemaType. foreach (MemberInfo mi in typeof(ActivityBuilder).GetMembers()) { if (mi.MemberType == MemberTypes.Property && !mi.Name.Equals("Name") && !mi.Name.Equals("ImplementationVersion")) { builder.AddCustomAttributes(typeof(ActivityBuilder), mi, new BrowsableAttribute(false)); } } // Removing all the properties property grid for the type SchemaType. foreach (MemberInfo mi in typeof(ActivityBuilder <>).GetMembers()) { builder.AddCustomAttributes(typeof(ActivityBuilder <>), mi, new BrowsableAttribute(false)); } builder.AddCustomAttributes(typeof(Argument), new SearchableStringConverterAttribute(typeof(ArgumentSearchableStringConverter))); builder.AddCustomAttributes(typeof(VisualBasicValue <>), new SearchableStringConverterAttribute(typeof(VisualBasicValueSearchableStringConverter))); builder.AddCustomAttributes(typeof(Type), new SearchableStringConverterAttribute(typeof(TypeSearchableStringConverter))); builder.AddCustomAttributes(typeof(ActivityAction <>), new SearchableStringConverterAttribute(typeof(ActivityActionSearchableStringConverter <>))); builder.AddCustomAttributes(typeof(XName), new SearchableStringConverterAttribute(typeof(XNameSearchableStringConverter))); builder.AddCustomAttributes(typeof(Encoding), new SearchableStringConverterAttribute(typeof(EncodingSearchableStringConverter))); builder.AddCustomAttributes(typeof(ErrorActivity), new SearchableStringConverterAttribute(typeof(EmptySearchableStringConverter))); builder.AddCustomAttributes(typeof(XName), new TypeConverterAttribute(typeof(XNameConverter))); builder.AddCustomAttributes(typeof(VBIdentifierName), new EditorAttribute(typeof(VBIdentifierNameEditor), typeof(PropertyValueEditor))); builder.AddCustomAttributes(typeof(VBIdentifierName), new EditorReuseAttribute(false)); ExpressionTextBox.RegisterExpressionActivityEditor(VisualBasicEditor.ExpressionLanguageName, typeof(VisualBasicEditor), VisualBasicEditor.CreateExpressionFromString); builder.AddCustomAttributes(typeof(VisualBasicValue <>), new ExpressionMorphHelperAttribute(typeof(VisualBasicExpressionMorphHelper))); builder.AddCustomAttributes(typeof(VisualBasicReference <>), new ExpressionMorphHelperAttribute(typeof(VisualBasicExpressionMorphHelper))); builder.AddCustomAttributes(typeof(VisualBasicValue <>), new FeatureAttribute(typeof(VisualBasicValueValidationFeature))); builder.AddCustomAttributes(typeof(VisualBasicReference <>), new FeatureAttribute(typeof(VisualBasicReferenceValidationFeature))); builder.AddCustomAttributes(typeof(Literal <>), new ExpressionMorphHelperAttribute(typeof(NonTextualExpressionMorphHelper))); builder.AddCustomAttributes(typeof(VariableValue <>), new ExpressionMorphHelperAttribute(typeof(NonTextualExpressionMorphHelper))); builder.AddCustomAttributes(typeof(VariableReference <>), new ExpressionMorphHelperAttribute(typeof(NonTextualExpressionMorphHelper))); builder.AddCustomAttributes(typeof(Activity), new ShowInOutlineViewAttribute()); builder.AddCustomAttributes(typeof(Collection <Activity>), new ShowInOutlineViewAttribute()); Type type = typeof(ActivityDelegate); builder.AddCustomAttributes(type, new ShowInOutlineViewAttribute() { PromotedProperty = "Handler" }); type = typeof(ActivityBuilder); builder.AddCustomAttributes(type, new ShowInOutlineViewAttribute()); builder.AddCustomAttributes(type, type.GetProperty("Implementation"), new ShowPropertyInOutlineViewAttribute() { CurrentPropertyVisible = false }); type = typeof(WorkflowService); builder.AddCustomAttributes(type, type.GetProperty("Body"), new ShowPropertyInOutlineViewAttribute() { CurrentPropertyVisible = false }); builder.AddCustomAttributes(typeof(WorkflowIdentity), new TypeConverterAttribute(typeof(ExpandableObjectConverter))); builder.AddCustomAttributes(typeof(Version), new EditorAttribute(typeof(VersionPropertyValueEditor), typeof(PropertyValueEditor))); // Apply the metadata MetadataStore.AddAttributeTable(builder.CreateTable()); }
public MainWindow() { InitializeComponent(); ExpressionTextBox.Focus(); }