/// <summary> /// Initializes a new instance of the <see cref="NuGenSketchCanvas"/> class. /// </summary> /// <param name="hWnd">Specifies the handle of the window to associate.</param> /// <param name="serviceProvider"><para>Requires:</para> /// <para><see cref="INuGenButtonStateService"/></para> /// <para><see cref="INuGenControlStateService"/></para> /// <para><see cref="INuGenButtonLayoutManager"/></para> /// <para><see cref="INuGenButtonRenderer"/></para> /// <para><see cref="INuGenComboBoxRenderer"/></para> /// <para><see cref="INuGenDirectorySelectorRenderer"/></para> /// <para><see cref="INuGenImageListService"/></para> /// <para><see cref="INuGenPanelRenderer"/></para> /// <para><see cref="INuGenProgressBarLayoutManager"/></para> /// <para><see cref="INuGenProgressBarRenderer"/></para> /// <para><see cref="INuGenScrollBarRenderer"/></para> /// <para><see cref="INuGenSwitchButtonLayoutManager"/></para> /// <para><see cref="INuGenSwitchButtonRenderer"/></para> /// <para><see cref="INuGenTextBoxRenderer"/></para> /// <para><see cref="INuGenTrackBarRenderer"/></para> /// <para><see cref="INuGenThumbnailLayoutManager"/></para> /// <para><see cref="INuGenThumbnailRenderer"/></para> /// <para><see cref="INuGenToolStripRenderer"/></para> /// <para><see cref="INuGenValueTrackerService"/></para> /// </param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="serviceProvider"/> is <see langword="null"/>.</para> /// </exception> /// <exception cref="ArgumentException"> /// <para> /// <paramref name="hWnd"/> does not represent a window. /// </para> /// </exception> public NuGenSketchCanvas(IntPtr hWnd, INuGenServiceProvider serviceProvider) { if (!User32.IsWindow(hWnd)) { throw new ArgumentException(string.Format(Resources.Argument_InvalidHWnd, hWnd.ToInt32())); } if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } _hWnd = hWnd; _serviceProvider = serviceProvider; _painter = new Painter(this); _msgFilter = new MessageFilter(_hWnd); _msgFilter.MouseDown += _msgFilter_MouseDown; _msgFilter.MouseMove += _msgFilter_MouseMove; _msgFilter.MouseUp += _msgFilter_MouseUp; _msgFilter.Paint += _msgFilter_Paint; _showPointerTimer = new Timer(); _showPointerTimer.Interval = 50; _showPointerTimer.Tick += _showPointerTimer_Tick; }
/// <summary> /// Initializes a new instance of the <see cref="NuGenCommentsFolderTreeNode"/> class. /// </summary> public NuGenCommentsFolderTreeNode( INuGenServiceProvider serviceProvider, string folderText ) : base(serviceProvider, folderText) { this.Text = folderText; }
/// <summary> /// Initializes a new instance of the <see cref="NuGenCodeTaskTreeNode"/> class. /// </summary> /// <exception cref="ArgumentNullException"> /// <paramref name="serviceProvider"/> is <see langword="null"/>. /// </exception> public NuGenCodeTaskTreeNode( INuGenServiceProvider serviceProvider, string codeTaskDescription ) : this(serviceProvider, codeTaskDescription, -1) { }
public Label(INuGenServiceProvider serviceProvider) : base(serviceProvider) { this.AutoSize = false; this.Dock = DockStyle.Fill; this.Margin = new Padding(3, 6, 0, 3); }
/// <summary> /// Initializes a new instance of the <see cref="ExpressionTree"/> class. /// </summary> /// <param name="expression">Symbolic expression (e.g. "sin(x^2) + 10/x").</param> /// <exception cref="ArgumentException"> /// <para><paramref name="expression"/> has unknown tokens.</para> /// </exception> /// <exception cref="ArgumentNullException"> /// <para><paramref name="serviceProvider"/> is <see langword="null"/>.</para> /// -or- /// <para><paramref name="expression"/> is <see langword="null"/>.</para> /// -or- /// <para><paramref name="expression"/> is an empty string.</para> /// </exception> /// <exception cref="ExpressionSyntaxException">Specified <paramref name="expression"/> has syntax errors.</exception> public ExpressionTree(INuGenServiceProvider serviceProvider, String expression) { if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } if (String.IsNullOrEmpty(expression)) { throw new ArgumentNullException("expression"); } _serviceProvider = serviceProvider; _expression = expression; ExpressionToken[] tokens = ExpressionToken.GetTokens(ServiceProvider, expression); foreach (ExpressionToken token in tokens) { if (token.IsUnknownToken) { throw new ArgumentException(String.Format(Resources.Argument_UnknownToken, _expression, token.TokenBody)); } } _parsedExpression = ""; CreateTree(tokens); _variables = (String[])new ArrayList(FindVariables(_root).Keys).ToArray(typeof(String)); }
/// <summary> /// Initializes a new instance of the <see cref="ToolBarButton"/> class. /// </summary> /// <param name="serviceProvider"><para>Requires:</para> /// <para><see cref="INuGenButtonStateService"/></para> /// <para><see cref="INuGenControlStateService"/></para> /// <para><see cref="INuGenSwitchButtonLayoutManager"/></para> /// <para><see cref="INuGenSwitchButtonRenderer"/></para> /// <para><see cref="INuGenThumbnailLayoutManager"/></para> /// </param> /// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception> public ToolBarButton(INuGenServiceProvider serviceProvider) : base(serviceProvider) { this.Dock = DockStyle.Left; this.ImageAlign = ContentAlignment.MiddleCenter; this.Size = this.ThumbnailLayoutManager.GetToolbarButtonSize(); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenPinpointWindow"/> class. /// </summary> /// <param name="serviceProvider"><para>Requires:</para> /// <para><see cref="INuGenControlStateService"/></para> /// <para><see cref="INuGenPinpointLayoutManager"/></para> /// <para><see cref="INuGenPinpointRenderer"/></para> /// </param> /// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception> public NuGenPinpointWindow(INuGenServiceProvider serviceProvider) : base(serviceProvider) { this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.SetStyle(ControlStyles.Selectable, true); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.SetStyle(ControlStyles.UserPaint, true); this.AutoSize = false; this.BackColor = this.DefaultBackColor; this.MinimumSize = new Size(10, 10); _desiredMaxFontSize = 12; _desiredFocusLength = 11; _desiredSpacing = 0.5f; _minDesiredSpacing = 0.1f; _borderRight = 3; _labelBorderLeft = 3; _borderY = 3; _focusLength = _desiredFocusLength; _minFontSize = 3; _maxFontSize = _desiredMaxFontSize; _desiredSpace = (int)(_maxFontSize * _desiredSpacing); _borderLeft = this.GetBorderLeft(_maxFontSize); _fonts = new Font[_maxFontSize]; this.CreateRegularFontCollection(_maxFontSize).CopyTo(_fonts, 0); _boldFonts = new Font[_maxFontSize]; this.CreateBoldFontCollection(_maxFontSize).CopyTo(_boldFonts, 0); }
/// <summary> /// Initializes a new instance of the <see cref="Browser"/> class. /// </summary> /// <param name="serviceProvider"> /// <para>Requires:</para> /// <para><see cref="INuGenWindowStateTracker"/></para> /// <para><see cref="ISampleFolder"/></para> /// </param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="serviceProvider"/> is <see langword="null"/>.</para> /// </exception> public Browser(INuGenServiceProvider serviceProvider) { if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } _serviceProvider = serviceProvider; this.InitializeComponent(); _runButton.Text = res.Text_Browser_runButton; _runButton.ToolTipText = res.Tooltip_Browser_runButton; _csSampleButton.Text = res.Text_Browser_csSampleButton; _csSampleButton.ToolTipText = res.Tooltip_Browser_csSampleButton; _vbSampleButton.Text = res.Text_Browser_vbSampleButton; _vbSampleButton.ToolTipText = res.Tooltip_Browser_vbSampleButton; _browseButton.Text = res.Text_Browser_browseButton; _browseButton.ToolTipText = res.Tooltip_Browser_browseButton; _docButton.Text = res.Text_Browser_docButton; _docButton.ToolTipText = res.Tooltip_Browser_docButton; }
/// <summary> /// Initializes a new instance of the <see cref="NuGenTrackBar"/> class. /// </summary> /// <param name="serviceProvider"> /// Requires:<para/> /// <see cref="INuGenTrackBarRenderer"/><para/> /// <see cref="INuGenButtonStateService"/><para/> /// <see cref="INuGenControlStateService"/><para/> /// <see cref="INuGenValueTrackerService"/><para/> /// </param> public NuGenTrackBar(INuGenServiceProvider serviceProvider) : base(serviceProvider) { _trackButton = new TrackButton(serviceProvider); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.SetStyle(ControlStyles.Selectable, true); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.BackColor = Color.Transparent; this.TabStop = true; _trackButton.Parent = this; _trackButton.TickStyle = this.TickStyle; _trackButton.MouseDown += this.TrackButton_MouseDown; _trackButton.MouseMove += this.TrackButton_MouseMove; _trackButton.MouseUp += this.TrackButton_MouseUp; _trackButton.GotFocus += this.TrackButton_GotFocus; _trackButton.LostFocus += this.TrackButton_LostFocus; this.ValueTracker.LargeChange = this.DefaultLargeChange; this.ValueTracker.Maximum = this.DefaultMaximum; this.ValueTracker.Minimum = this.DefaultMinimum; this.ValueTracker.SmallChange = this.DefaultSmallChange; this.ValueTracker.Value = this.DefaultValue; this.AdjustTrackButtonBounds(); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenButton"/> class. /// </summary> /// <param name="serviceProvider"> /// <para>Requires:</para> /// <para><see cref="INuGenButtonStateTracker"/></para> /// <para><see cref="INuGenButtonLayoutManager"/></para> /// <para><see cref="INuGenButtonRenderer"/></para> /// </param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="serviceProvider"/> is <see langword="null"/>.</para> /// </exception> public NuGenButton(INuGenServiceProvider serviceProvider) : base(serviceProvider) { this.UseVisualStyleBackColor = false; this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.ImageAlign = ContentAlignment.MiddleLeft; }
/// <summary> /// Initializes a new instance of the <see cref="MainForm"/> class. /// </summary> /// <exception cref="ArgumentNullException"> /// <para> /// <paramref name="serviceProvider"/> is <see langword="null"/>. /// </para> /// </exception> public MainForm(INuGenServiceProvider serviceProvider) { if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } _serviceProvider = serviceProvider; _splashStarter = _serviceProvider.GetService <SplashStarter>(); Debug.Assert(_splashStarter != null, "_splashStarter != null"); _splashStarter.ShowSplashScreen(); InitializeComponent(); ForceActiveTitleBar = true; SetStyle(ControlStyles.Opaque, true); _canvasSizeToolStrip.ApplySettings += _canvasSizeToolStrip_ApplySettings; _canvasSizeToolStrip.CancelSettings += _canvasSizeToolStrip_CancelSettings; _insertFileDialog.Filter = Resources.Text_InsertFileDialog_Filter; _insertFileDialog.FilterIndex = 3; _insertFileDialog.Title = Resources.Text_InsertFileDialog; _openFileDialog.Filter = Resources.Text_OpenFileDialog_Filter; _openFileDialog.Title = Resources.Text_OpenFileDialog; _saveFileDialog.Filter = Resources.Text_SaveFileDialog_Filter; _saveFileDialog.Title = Resources.Text_SaveFileDialog; SetCanvasDependableButtonsVisibility(false); }
public OpacitySpin(INuGenServiceProvider serviceProvider) : base(serviceProvider) { this.Minimum = 0; this.Maximum = 100; this.Value = 100; }
/// <summary> /// Initializes a new instance of the <see cref="Switcher"/> class. /// </summary> /// <param name="serviceProvider"><para>Requires:</para> /// <para><see cref="INuGenRadioButtonRenderer"/></para> /// <para><see cref="INuGenRadioButtonLayoutManager"/></para> /// <para><see cref="INuGenButtonStateService"/></para> /// <para><see cref="INuGenControlStateService"/></para> /// </param> /// <param name="associatedAlignment"></param> /// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception> public Switcher(INuGenServiceProvider serviceProvider, ContentAlignment associatedAlignment) : base(serviceProvider) { _assoicatedAlignment = associatedAlignment; this.CheckAlign = ContentAlignment.MiddleCenter; this.Dock = DockStyle.Fill; }
/// <summary> /// Initializes a new instance of the <see cref="NuGenSwitcher"/> class. /// </summary> /// <param name="serviceProvider"><para>Requires:</para> /// <para><see cref="INuGenButtonStateService"/></para> /// <para><see cref="INuGenControlStateService"/></para> /// <para><see cref="INuGenSwitchButtonLayoutManager"/></para> /// <para><see cref="INuGenSwitchButtonRenderer"/></para> /// <para><see cref="INuGenPanelRenderer"/></para> /// </param> /// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception> public NuGenSwitcher(INuGenServiceProvider serviceProvider) : base(serviceProvider) { _buttonPageDictionary = new Dictionary <NuGenSwitchButton, NuGenSwitchPage>(); _pageButtonDictionary = new Dictionary <NuGenSwitchPage, NuGenSwitchButton>(); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.Opaque, false); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.SetStyle(ControlStyles.Selectable, true); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.SetStyle(ControlStyles.UserPaint, true); this.BackColor = Color.Transparent; _switchPanel = new NuGenSwitchPanel(serviceProvider); _switchPanel.BackColor = Color.Blue; this.RebuildLayout(); _switchPanel.Parent = this; _switchPanel.SelectedSwitchButtonChanged += _switchPanel_SelectedSwitchButtonChanged; _switchPanel.SwitchButtonImageAlignChanged += _switchPanel_SwitchButtonImageAlignChanged; _switchPanel.SwitchButtonTextAlignChanged += _switchPanel_SwitchButtonTextAlignChanged; _switchPanel.SwitchButtonSizeChanged += _switchPanel_SwitchButtonSizeChanged; }
/// <summary> /// Initializes a new instance of the <see cref="NuGenFontBox"/> class. /// </summary> /// <param name="serviceProvider">Requires:<para/> /// <see cref="INuGenComboBoxRenderer"/><para/> /// <see cref="INuGenButtonStateTracker"/><para/> /// <see cref="INuGenImageListService"/><para/> /// <see cref="INuGenFontFamiliesProvider"/><para/> /// </param> /// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception> public NuGenFontBox(INuGenServiceProvider serviceProvider) : base(serviceProvider) { List <string> fontNames = null; this.FontFamiliesProvider.FillWithFontNames(out fontNames); Debug.Assert(fontNames != null, "fontNames != null"); System.Windows.Forms.ImageList imageList = null; this.FontFamiliesProvider.FillWithFontSamples(fontNames, out imageList); Debug.Assert(imageList != null, "imageList != null"); base.ImageList = imageList; int selectedIndex = 0; for (int i = 0; i < fontNames.Count; i++) { string fontName = fontNames[i]; if (fontName == "Arial") { selectedIndex = i; } this.Items.Add(fontName); } this.DropDownStyle = ComboBoxStyle.DropDownList; this.SelectedIndex = selectedIndex; }
/// <summary> /// Initializes a new instance of the <see cref="ColorTabControl"/> class. /// </summary> /// <param name="serviceProvider"> /// Requires:<para/> /// <see cref="INuGenButtonStateTracker"/><para/> /// <see cref="INuGenControlStateTracker"/><para/> /// <see cref="INuGenTabRenderer"/><para/> /// <see cref="INuGenTabStateTracker"/><para/> /// <see cref="INuGenTabLayoutManager"/><para/> /// <see cref="INuGenPanelRenderer"/><para/> /// <see cref="INuGenListBoxRenderer"/><para/> /// <see cref="INuGenImageListService"/><para/> /// <see cref="INuGenColorsProvider"/><para/> /// </param> /// <exception cref="ArgumentNullException"> /// <para> /// <paramref name="serviceProvider"/> is <see langword="null"/>. /// </para> /// </exception> public ColorTabControl(INuGenServiceProvider serviceProvider) : base(serviceProvider) { _customColorsPanel = new CustomColorsPanel(serviceProvider); _stdColorListBox = new StdColorListBox(serviceProvider); _webColorListBox = new WebColorListBox(serviceProvider); this.CloseButtonOnTab = false; this.Dock = DockStyle.Fill; NuGenTabPage customColorsPage = new NuGenTabPage(serviceProvider); customColorsPage.Text = Resources.Text_ColorBoxPopup_Custom; customColorsPage.Controls.Add(_customColorsPanel); NuGenTabPage stdColorsPage = new NuGenTabPage(serviceProvider); stdColorsPage.Text = Resources.Text_ColorBoxPopup_System; stdColorsPage.Controls.Add(_stdColorListBox); NuGenTabPage webColorsPage = new NuGenTabPage(serviceProvider); webColorsPage.Text = Resources.Text_ColorBoxPopup_Web; webColorsPage.Controls.Add(_webColorListBox); this.TabPages.Add(customColorsPage); this.TabPages.Add(webColorsPage); this.TabPages.Add(stdColorsPage); _colorCollections = new Dictionary <IColorCollection, NuGenTabPage>(); _colorCollections.Add(_stdColorListBox, stdColorsPage); _colorCollections.Add(_webColorListBox, webColorsPage); _colorCollections.Add(_customColorsPanel, customColorsPage); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenToolTipInfoEditorUI"/> class. /// </summary> /// <param name="serviceContext"></param> /// <param name="serviceProvider"> /// <para>Requires:</para> /// <para><see cref="INuGenToolTipLayoutManager"/></para> /// <para><see cref="INuGenToolTipRenderer"/></para> /// </param> /// <param name="initialTooltipInfo"></param> /// <exception cref="ArgumentNullException"> /// <para> /// <paramref name="serviceProvider"/> is <see langword="null"/>. /// </para> /// -or- /// <para> /// <paramref name="serviceContext"/> is <see langword="null"/>. /// </para> /// </exception> public NuGenToolTipInfoEditorUI( INuGenServiceProvider serviceProvider, NuGenToolTipInfo initialTooltipInfo, NuGenCustomTypeEditorServiceContext serviceContext ) { if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } if (serviceContext == null) { throw new ArgumentNullException("serviceContext"); } _serviceProvider = serviceProvider; this.SuspendLayout(); _mainBlock = new MainBlock(serviceContext); _mainBlock.Parent = this; _remarksBlock = new RemarksBlock(serviceContext); _remarksBlock.Height = 100; _remarksBlock.Parent = this; _okButton = new Button(); _okButton.DialogResult = DialogResult.OK; _okButton.TabIndex = 0; _okButton.Text = Resources.Text_ToolTipInfoEditor_okButton; _cancelButton = new Button(); _cancelButton.DialogResult = DialogResult.Cancel; _cancelButton.TabIndex = 1; _cancelButton.Text = Resources.Text_ToolTipInfoEditor_cancelButton; _sizeBlock = new SizeBlock(); _sizeBlock.Parent = this; _dialogLayoutPanel = new DialogFlowLayoutPanel(); _dialogLayoutPanel.Controls.Add(_cancelButton); _dialogLayoutPanel.Controls.Add(_okButton); _dialogLayoutPanel.Parent = this; this.CancelButton = _cancelButton; this.FormBorderStyle = FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; this.Padding = new Padding(3); this.ShowIcon = false; this.ShowInTaskbar = false; this.Size = new Size(350, 400); this.StartPosition = FormStartPosition.CenterParent; this.Text = Resources.Text_ToolTipInfoEditor_EditorForm; this.SetStateFromTooltipInfo(initialTooltipInfo); this.ResumeLayout(false); }
/// <summary> /// Initializes a new instance of the <see cref="SizeSpin"/> class. /// </summary> /// <param name="serviceProvider">Requires:<para/> /// <see cref="INuGenSpinRenderer"/><para/> /// <see cref="INuGenButtonStateTracker"/><para/> /// <see cref="INuGenControlStateTracker"/><para/></param> /// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception> public SizeSpin(INuGenServiceProvider serviceProvider) : base(serviceProvider) { this.Maximum = 9600; this.Minimum = 1; this.Value = 640; this.Width = 100; }
/// <summary> /// Initializes a new instance of the <see cref="NuGenInt32Combo"/> class. /// </summary> /// <param name="serviceProvider"><para>Requires:</para> /// <para><see cref="INuGenComboBoxRenderer"/></para> /// <para><see cref="INuGenButtonStateService"/></para> /// <para><see cref="INuGenImageListService"/></para> /// <para><see cref="INuGenInt32ValueConverter"/></para> /// </param> /// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception> public NuGenInt32Combo(INuGenServiceProvider serviceProvider) : base(serviceProvider) { this.Int32ValueConverter.MaximumChanged += _int32ValueConverter_MaximumChanged; this.Int32ValueConverter.MinimumChanged += _int32ValueConverter_MinimumChanged; this.Int32ValueConverter.TextChanged += _int32ValueConverter_TextChanged; this.Int32ValueConverter.ValueChanged += _int32ValueConverter_ValueChanged; }
/// <summary> /// Initializes a new instance of the <see cref="StdColorListBox"/> class. /// </summary> /// <param name="serviceProvider"><para>Requires:</para> /// <para><see cref="INuGenControlStateTracker"/></para> /// <para><see cref="INuGenListBoxRenderer"/></para> /// <para><see cref="INuGenImageListService"/></para> /// <para><see cref="INuGenColorsProvider"/></para> /// </param> /// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception> public StdColorListBox(INuGenServiceProvider serviceProvider) : base(serviceProvider) { IList<Color> colors = null; this.ColorsProvider.FillWithStandardColors(out colors); Debug.Assert(colors != null, "colors != null"); this.InitializeColorBox(colors); }
public LoupePanel(INuGenServiceProvider serviceProvider, ImageTracker imageTracker) { _slideManager = new SlideManager(this.Controls, imageTracker); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.BackColor = Color.Transparent; this.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; }
public static ExpressionTreeNode BuildExpressionNode(INuGenServiceProvider serviceProvider, NodeBase schemaNode) { if (schemaNode == null) { return(null); } if (NeedToSkip(schemaNode)) { throw new InvalidOperationException("Expression node connected to unsupported node. Expression node cannot be recognized"); } ExpressionTreeNode node = null; if (schemaNode is Operator) { ExpressionToken token = new ExpressionToken(serviceProvider, ((Operator)schemaNode).OperatorDescriptor.StringRepresentation); node = new ExpressionTreeNode(token); switch (token.OperatorDescriptor.PrimitiveOperator) { case PrimitiveOperator.Add: case PrimitiveOperator.Sub: case PrimitiveOperator.Mul: case PrimitiveOperator.Div: { node.LeftNode = BuildExpressionNode(serviceProvider, schemaNode.Inputs[0].Connection.Node); node.RightNode = BuildExpressionNode(serviceProvider, schemaNode.Inputs[1].Connection.Node); break; } } if (token.IsOneVariableFunction) { node.LeftNode = BuildExpressionNode(serviceProvider, schemaNode.Inputs[0].Connection.Node); } if (token.IsTwoVariableFunction) { node.LeftNode = BuildExpressionNode(serviceProvider, schemaNode.Inputs[0].Connection.Node); node.RightNode = BuildExpressionNode(serviceProvider, schemaNode.Inputs[1].Connection.Node); } return(node); } if (schemaNode is NumberParam) { return(new ExpressionTreeNode(new ExpressionToken(serviceProvider, ((NumberParam)schemaNode).Name))); } if (schemaNode is VisiTypes.Number) { return(new ExpressionTreeNode(new ExpressionToken(serviceProvider, ((VisiTypes.Number)schemaNode).Value.ToString()))); } return(null); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenNavigationBar"/> class. /// </summary> /// <param name="serviceProvider"><para>Requires:</para> /// <para><see cref="INuGenControlStateTracker"/></para> /// <para><see cref="INuGenNavigationBarRenderer"/></para> /// <para><see cref="INuGenNavigationBarLayoutManager"/></para> /// </param> /// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception> public NuGenNavigationBar(INuGenServiceProvider serviceProvider) : base(serviceProvider) { this.Font = new Font("Tahoma", 8, FontStyle.Bold); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.ResizeRedraw, true); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenFolderTreeNode"/> class.<para/> /// <c>HasCheckBox = false</c>. <c>Checked = false</c>. /// </summary> public NuGenFolderTreeNode( INuGenServiceProvider serviceProvider, string folderText, int imageIndex, int expandedImageIndex ) : base(serviceProvider, folderText, imageIndex, expandedImageIndex) { this.HasCheckBox = false; }
/// <summary> /// Initializes a new instance of the <see cref="NuGenTaskTreeNodeBase"/> class. /// </summary> /// <param name="serviceProvider">Required:<para/> /// <see cref="T:INuGenStringProcessor"/><para/> /// <see cref="T:INuGenTaskXmlService"/><para/> /// </param> /// <param name="defaultNodeText">Specifies the text that appears on the node just after creation. /// The value of the <see cref="P:Text"/> property will still remain an empty string. Use the /// <see cref="P:Text"/> property to set actual text for the node after constructor initialization. /// </param> /// <param name="imageIndex"></param> /// <param name="expandedImageIndex"></param> protected NuGenTaskTreeNodeBase( INuGenServiceProvider serviceProvider, string defaultNodeText, int imageIndex, int expandedImageIndex ) : base(defaultNodeText, imageIndex, expandedImageIndex) { this.serviceProvider = serviceProvider; }
/// <summary> /// Initializes a new instance of the <see cref="StdColorListBox"/> class. /// </summary> /// <param name="serviceProvider"><para>Requires:</para> /// <para><see cref="INuGenControlStateTracker"/></para> /// <para><see cref="INuGenListBoxRenderer"/></para> /// <para><see cref="INuGenImageListService"/></para> /// <para><see cref="INuGenColorsProvider"/></para> /// </param> /// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception> public StdColorListBox(INuGenServiceProvider serviceProvider) : base(serviceProvider) { List <Color> colors = null; this.ColorsProvider.FillWithStandardColors(out colors); Debug.Assert(colors != null, "colors != null"); this.InitializeColorBox(colors); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenSmoothRenderer"/> class. /// </summary> /// <param name="serviceProvider"> /// Requires:<para/> /// <see cref="INuGenSmoothColorManager"/><para/> /// </param> /// <exception cref="ArgumentNullException"> /// <para> /// <paramref name="serviceProvider"/> is <see langword="null"/>. /// </para> /// </exception> public NuGenSmoothRenderer(INuGenServiceProvider serviceProvider) { if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } _serviceProvider = serviceProvider; }
/// <summary> /// Initializes a new instance of the <see cref="NuGenComponent"/> class. /// </summary> /// <param name="serviceProvider"></param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="serviceProvider"/> is <see langword="null"/>.</para> /// </exception> public NuGenComponent(INuGenServiceProvider serviceProvider) { if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } _serviceProvider = serviceProvider; }
/// <summary> /// Initializes a new instance of the <see cref="NuGenProgressBar"/> class. /// </summary> /// <param name="serviceProvider"> /// <para>Requires:</para> /// <para><see cref="INuGenProgressBarRenderer"/></para> /// <para><see cref="INuGenProgressBarLayoutManager"/></para> /// <para><see cref="INuGenControlStateService"/></para> /// </param> public NuGenProgressBar(INuGenServiceProvider serviceProvider) : base(serviceProvider) { this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.Selectable, false); }
static NuGenServiceManager() { ControlReflectorServiceProvider = new NuGenControlReflectorServiceProvider(); LinkLabelServiceProvider = new NuGenLinkLabelServiceProvider(); PictureBoxServiceProvider = new NuGenPictureBoxServiceProvider(); PropertyGridServiceProvider = new NuGenPropertyGridServiceProvider(); TabControlServiceProvider = new NuGenTabControlServiceProvider(); TreeViewServiceProvider = new NuGenTreeViewServiceProvider(); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenToolTipInfoEditor"/> class. /// </summary> /// <param name="serviceProvider"> /// <para>Requires:</para> /// <para><see cref="INuGenToolTipLayoutManager"/></para> /// <para><see cref="INuGenToolTipRenderer"/></para> /// </param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="serviceProvider"/> is <see langword="null"/>.</para> /// </exception> protected NuGenToolTipInfoEditor(INuGenServiceProvider serviceProvider) { if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } _serviceProvider = serviceProvider; }
public PropertiesForm(INuGenServiceProvider serviceProvider) { if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } _serviceProvider = serviceProvider; InitializeComponent(); SetStyle(ControlStyles.Opaque, true); }
public ActionButton(INuGenServiceProvider serviceProvider, IAction buttonAction, string text) : base(serviceProvider) { if (buttonAction == null) { throw new ArgumentNullException("buttonAction"); } _buttonAction = buttonAction; this.Text = text; }
/// <summary> /// </summary> /// <param name="serviceProvider"><para>Requires:</para> /// <para><see cref="ISampleFolder"/></para></param> /// <param name="treeView"></param> /// <param name="folderImageIndex"></param> /// <param name="expandedFolderImageIndex"></param> /// <param name="sampleImageIndex"></param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="serviceProvider"/> is <see langword="null"/>.</para> /// -or- /// <para><paramref name="treeView"/> is <see langword="null"/>.</para> /// </exception> public void PopulateSampleTree( INuGenServiceProvider serviceProvider , NuGenTreeView treeView , int folderImageIndex , int expandedFolderImageIndex , int sampleImageIndex ) { if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } if (treeView == null) { throw new ArgumentNullException("treeView"); } ISampleFolderDescriptor sampleFolder = serviceProvider.GetService<ISampleFolderDescriptor>(); Debug.Assert(sampleFolder != null, "sampleFolder != null"); DirectoryInfo sampleDirInfo = new DirectoryInfo(sampleFolder.Path); Debug.Write("Scanning \""); Debug.Write(sampleDirInfo.FullName); Debug.WriteLine("\" folder..."); if (!sampleDirInfo.Exists) { Trace.Write("Sample directory does not exist."); return; } DirectoryInfo[] samples = sampleDirInfo.GetDirectories(); Debug.WriteLine("Getting the list of sub-directories..."); Debug.WriteLineIf(samples != null, "samples.Length = " + samples.Length.ToString()); if (samples != null) { Debug.WriteLine("Looping through the sub-directories..."); foreach (DirectoryInfo dirInfo in samples) { NuGenTreeNode treeNode = new NuGenTreeNode(dirInfo.Name, folderImageIndex, expandedFolderImageIndex); treeView.Nodes.Add(treeNode); Debug.Write("Examining \""); Debug.Write(dirInfo.FullName); Debug.WriteLine("\" sub-directory..."); this.BuildSampleTreeNode(sampleFolder, dirInfo, treeNode, folderImageIndex, expandedFolderImageIndex, sampleImageIndex); } } }
public void SetUp() { _TaskTreeView = new NuGenTaskTreeView(); _InitialCount = _TaskTreeView.Nodes.Count; _EventSink = new TaskTreeViewEventSink(_TaskTreeView); _ServiceProvider = new NuGenTaskServiceProvider(); _XmlDoc = new XmlDocument(); _TaskItemDescription = "Description"; _TaskItemMock = new DynamicMock(typeof(TaskItem)); _TaskItemMock.SetValue("Description", _TaskItemDescription); _TaskItem = (TaskItem)_TaskItemMock.Object; Assert.IsFalse(_TaskTreeView.LabelEdit); }
public void SetUp() { this._ServiceProvider = new NuGenTaskServiceProvider(); this._FolderTreeNode = new NuGenFolderTreeNode(this._ServiceProvider); this._FolderTreeNode.Nodes.AddNode(new NuGenTreeNode()); this._FolderTreeNode.Expand(); this._FolderText = "folder"; this._FolderTreeNode.Text = this._FolderText; this._XmlDoc = new XmlDocument(); this._NodeToSaveTo = this._XmlDoc.CreateElement("Folder"); this._XmlDoc.AppendChild(this._NodeToSaveTo); }
/// <summary> /// Initializes a new instance of the <see cref="TypeCombo"/> class. /// </summary> /// <param name="serviceProvider"><para>Requires:</para> /// <para><see cref="INuGenComboBoxRenderer"/></para> /// <para><see cref="INuGenButtonStateService"/></para> /// <para><see cref="INuGenImageListService"/></para></param> /// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception> public TypeCombo(INuGenServiceProvider serviceProvider) : base(serviceProvider) { this.DropDownStyle = ComboBoxStyle.DropDownList; this.Items.AddRange( new object[] { res.ImageType_Color , res.ImageType_Grayscale , res.ImageType_Monochrome } ); this.SelectedIndex = 0; this.Width = 100; }
/// <summary> /// Initializes a new instance of the <see cref="FormatCombo"/> class. /// </summary> /// <param name="serviceProvider"><para>Requires:</para> /// <para><see cref="INuGenComboBoxRenderer"/></para> /// <para><see cref="INuGenButtonStateService"/></para> /// <para><see cref="INuGenImageListService"/></para> /// </param> /// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception> public FormatCombo(INuGenServiceProvider serviceProvider) : base(serviceProvider) { this.DropDownStyle = ComboBoxStyle.DropDownList; this.Items.AddRange( new object[] { res.FileFormat_JPEG , res.FileFormat_PNG , res.FileFormat_TIFF , res.FileFormat_BMP } ); this.SelectedIndex = 0; this.Width = 100; }
/// <summary> /// Initializes a new instance of the <see cref="NuGenContextMenuStrip"/> class. /// </summary> /// <param name="serviceProvider"> /// <para>Requires:</para> /// <para><see cref="INuGenToolStripRenderer"/></para> /// </param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="serviceProvider"/> is <see langword="null"/>.</para> /// </exception> /// <exception cref="NuGenServiceNotFoundException"/> public NuGenContextMenuStrip(INuGenServiceProvider serviceProvider) { if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } INuGenToolStripRenderer toolStripRenderer = serviceProvider.GetService<INuGenToolStripRenderer>(); if (toolStripRenderer == null) { throw new NuGenServiceNotFoundException<INuGenToolStripRenderer>(); } this.Renderer = toolStripRenderer.GetToolStripRenderer(); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenFontSizeBox"/> class. /// </summary> /// <param name="serviceProvider"><para>Requires:</para> /// <para><see cref="INuGenComboBoxRenderer"/></para> /// <para><see cref="INuGenButtonStateService"/></para> /// <para><see cref="INuGenImageListService"/></para> /// </param> /// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception> public NuGenFontSizeBox(INuGenServiceProvider serviceProvider) : base(serviceProvider) { base.Items.AddRange( new object[] { 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28 , 36, 48, 72 } ); base.Value = 10; base.Minimum = 1; base.Maximum = 1638; this.MaxDropDownItems = 12; }
public void SetUp() { this.serviceProvider = new NuGenTaskServiceProvider(); this.xmlDoc = new XmlDocument(); this.nodeToSaveTo = this.xmlDoc.CreateElement("Task"); this.xmlDoc.AppendChild(this.nodeToSaveTo); this.taskText = string.Concat(this.firstLine, Environment.NewLine, this.secondLine); this.taskTreeNode = new NuGenTaskTreeNode(this.serviceProvider, this.taskText, NuGenTaskPriority.Wanted); this.taskTreeNode.SetPriorityImageIndex(NuGenTaskPriority.Wanted, this.wantedImageIndex); this.taskTreeNode.SetPriorityImageIndex(NuGenTaskPriority.WouldBeNice, this.wouldBeNiceImageIndex); this.taskTreeNode.SetPriorityImageIndex(NuGenTaskPriority.Maybe, this.maybeImageIndex); this.taskTreeNode.SetPriorityImageIndex(NuGenTaskPriority.Required, this.requiredImageIndex); this.taskTreeNode.SetPriorityImageIndex(NuGenTaskPriority.Critical, this.criticalImageIndex); }
/// <summary> /// </summary> /// <param name="serviceProvider"> /// <para>Requires:</para> /// <para><see cref="INuGenSmoothColorManager"/></para> /// </param> /// <param name="paintParams"></param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="serviceProvider"/> is <see langword="null"/>.</para> /// -or- /// <para><paramref name="paintParams"/> is <see langword="null"/>.</para> /// </exception> /// <exception cref="NuGenServiceNotFoundException"/> public static void DrawBackground(INuGenServiceProvider serviceProvider, NuGenPaintParams paintParams) { if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } if (paintParams == null) { throw new ArgumentNullException("paintParams"); } Graphics g = paintParams.Graphics; Rectangle bounds = paintParams.Bounds; NuGenControlState state = paintParams.State; RectangleF ellipseBounds = new RectangleF( bounds.Left - bounds.Width * 0.2f , bounds.Top + bounds.Height * 0.6f , bounds.Width * 2 , bounds.Height ); if (ellipseBounds.Width > 0 && ellipseBounds.Height > 0) { INuGenSmoothColorManager colorManager = serviceProvider.GetService<INuGenSmoothColorManager>(); if (colorManager == null) { throw new NuGenServiceNotFoundException<INuGenSmoothColorManager>(); } Color beginColor = Color.FromArgb(60, colorManager.GetBorderColor(state)); Color endColor = Color.FromArgb(10, colorManager.GetBackgroundGradientEnd(state)); using (Brush brush = new LinearGradientBrush(ellipseBounds, beginColor, endColor, 0.0f)) { g.SetClip(bounds, CombineMode.Replace); g.FillEllipse(brush, ellipseBounds); } } }
public ThumbnailManager( INuGenServiceProvider serviceProvider , ControlCollection ctrls , ImageTracker imageTracker ) { Debug.Assert(serviceProvider != null, "serviceProvider != null"); _serviceProvider = serviceProvider; Debug.Assert(ctrls != null, "ctrls != null"); _ctrls = ctrls; Debug.Assert(imageTracker != null, "imageTracker != null"); _imageTracker = imageTracker; _imageTracker.ImageAdded += _imageTracker_ImageAdded; _imageTracker.ImageInserted += _imageTracker_ImageInserted; _imageTracker.ImageRemoved += _imageTracker_ImageRemoved; _imageThumbDictionary = new Dictionary<Image, NuGenThumbnail>(); }
public void SetUp() { this._DropService = new NuGenTaskDragDropService(); this._TaskTreeView = new NuGenTaskTreeView(); this._ServiceProvider = new NuGenTaskServiceProvider(); this._InitialCount = this._TaskTreeView.Nodes.Count; for (int i = 0; i < 10; i++) { NuGenFolderTreeNode folderNode = new NuGenFolderTreeNode(this._ServiceProvider); this._TaskTreeView.AddFolder(folderNode); for (int j = 0; j < 10; j++) { folderNode.Nodes.AddNode(new NuGenTaskTreeNode(this._ServiceProvider)); } } for (int i = 0; i < 10; i++) { this._TaskTreeView.AddTask(new NuGenTaskTreeNode(this._ServiceProvider)); } }
/// <summary> /// Initializes a new instance of the <see cref="NuGenSmoothPinpointWindow"/> class. /// </summary> /// <param name="serviceProvider"><para>Requires:</para> /// <para><see cref="INuGenControlStateService"/></para> /// <para><see cref="INuGenPinpointRenderer"/></para></param> /// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception> public NuGenSmoothPinpointWindow(INuGenServiceProvider serviceProvider) : base(serviceProvider) { }
/// <summary> /// Initializes a new instance of the <see cref="NuGenOrientationControlBase"/> class. /// </summary> /// <param name="serviceProvider"><para>Requires:</para> /// <para><see cref="INuGenControlStateTracker"/></para></param> /// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception> protected NuGenOrientationControlBase(INuGenServiceProvider serviceProvider) : base(serviceProvider) { }
/// <summary> /// Initializes a new instance of the <see cref="DropDownButton"/> class. /// </summary> /// <param name="serviceProvider"><para>Requires:</para> /// <para><see cref="INuGenButtonStateService"/></para> /// <para><see cref="INuGenDirectorySelectorRenderer"/></para> /// </param> /// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception> public DropDownButton(INuGenServiceProvider serviceProvider) : base(serviceProvider) { }
/// <summary> /// Initializes a new instance of the <see cref="NuGenSmoothCheckBoxRenderer"/> class. /// </summary> /// <param name="serviceProvider"> /// Requires:<para/> /// <see cref="INuGenSmoothColorManager"/><para/> /// </param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="serviceProvider"/> is <see langword="null"/>.</para> /// </exception> public NuGenSmoothCheckBoxRenderer(INuGenServiceProvider serviceProvider) : base(serviceProvider) { }
/// <summary> /// Initializes a new instance of the <see cref="NuGenTaskTreeView"/> class. /// </summary> /// <param name="serviceProvider"> /// Required:<para/> /// <see cref="T:INuGenImageListService"/><para/> /// <see cref="T:INuGenTreeViewSelectionService"/><para/> /// <see cref="T:INuGenTreeViewDragDropService"/><para/> /// <see cref="T:INuGenTreeViewSelectionService"/><para/> /// <see cref="T:INuGenTreeNodeSorter"/><para/> /// <see cref="T:INuGenTaskXmlService"/><para/> /// <see cref="T:INuGenStringProcessor"/><para/> /// </param> /// <exception cref="T:System.ArgumentNullException"> /// <paramref name="serviceProvider"/> is <see langword="null"/>. /// </exception> public NuGenTaskTreeView( INuGenServiceProvider serviceProvider ) : base(serviceProvider) { _Components = new Container(); this.InitializeContextMenu(ref _ContextMenu, ref _Components); this.InitializeTaskImageList(ref _TaskImageList, ref _Components); Debug.Assert(_ContextMenu != null, "_ContextMenu != null"); Debug.Assert(_TaskImageList != null, "_TaskImageList != null"); Debug.Assert(_Components != null, "_Components != null"); this.AllowDrop = true; this.CheckBoxes = true; this.ContextMenuStrip = _ContextMenu; this.FullRowSelect = true; this.HideSelection = false; this.ImageList = _TaskImageList; this.ShowLines = false; this.InitializeCommentsFolder(ref _CommentsFolder); Debug.Assert(_CommentsFolder != null, "_CommentsFolder != null"); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenTabButton"/> class. /// </summary> /// <param name="serviceProvider"> /// <para>Requires:</para> /// <para><see cref="INuGenTabLayoutManager"/></para> /// <para><see cref="INuGenTabRenderer"/></para> /// <para><see cref="INuGenTabStateService"/></para> /// </param> /// <exception cref="ArgumentNullException"> /// <para> /// <paramref name="serviceProvider"/> is <see langword="null"/>. /// </para> /// </exception> public NuGenTabButton(INuGenServiceProvider serviceProvider) { if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } _serviceProvider = serviceProvider; SetStyle(ControlStyles.ResizeRedraw, true); CloseButton.Bounds = this.GetCloseButtonBounds(); CloseButton.Visible = false; CloseButton.Parent = this; CloseButton.Click += delegate { OnClose(EventArgs.Empty); }; CloseButton.MouseEnter += delegate { OnMouseEnter(EventArgs.Empty); }; }
/// <summary> /// Initializes a new instance of the <see cref="NuGenSmoothTabPage"/> class. /// </summary> /// <param name="serviceProvider"> /// Requires:<para/> /// <see cref="INuGenTabRenderer"/> /// </param> /// <exception cref="ArgumentNullException"> /// <para> /// <paramref name="serviceProvider"/> is <see langword="null"/>. /// </para> /// </exception> public NuGenSmoothTabPage(INuGenServiceProvider serviceProvider) : base(serviceProvider) { }