/// <summary> /// Creates a new context with a custom parent (nested, i.e. more local layer). /// </summary> /// <param name="parentContext"> /// The parent context for the new context. /// </param> public ParseContext(ParseContext parentContext) { _isReadOnly = false; _variables = new Dictionary<String, Value>(); _functions = new Dictionary<String, IFunction>(StringComparer.OrdinalIgnoreCase); _constants = new Dictionary<String, IConstants>(StringComparer.OrdinalIgnoreCase); _defaultProperties = new Dictionary<String, IDictionary<String, Value>>(); _parent = parentContext; _precision = parentContext.Precision; _displayStyle = parentContext._displayStyle; }
ParseContext(IDictionary<String, Value> shadowVariables) { _answer = "$"; _isReadOnly = true; _variables = new ReadOnlyDictionary<String, Value>(shadowVariables); _functions = new Dictionary<String, IFunction>(StringComparer.OrdinalIgnoreCase); _constants = new Dictionary<String, IConstants>(StringComparer.OrdinalIgnoreCase); _defaultProperties = new Dictionary<String, IDictionary<String, Value>>(); _parent = null; _precision = 6; _displayStyle = DisplayStyle.Default; _elements = new Elements(this); _elements.RegisterAssembly(this, Assembly.GetExecutingAssembly()); }
public Display(Application application, WinApi.WndProc proc, DisplayStyle style) { m_application = application; m_instance = WinApi.GetModuleHandle(null); m_windowProc = new WinApi.WndProc(proc); m_className = "GRANITE_" + Guid.NewGuid().ToString("N"); WinApi.WindowClass wc = new WinApi.WindowClass() { style = WinApi.CS_OWNDC | WinApi.CS_VREDRAW | WinApi.CS_HREDRAW, windowProcedure = Marshal.GetFunctionPointerForDelegate(m_windowProc), instance = m_instance, cursor = WinApi.LoadCursor(IntPtr.Zero, WinApi.IDC_ARROW), className = m_className }; WinApi.RegisterClass(ref wc); uint s = WinApi.WS_POPUP; switch (style) { case DisplayStyle.Fixed: s = WinApi.WS_BORDER; break; case DisplayStyle.FixedWithTitle: s = WinApi.WS_CAPTION | WinApi.WS_SYSMENU; break; case DisplayStyle.Resizeable: s = WinApi.WS_POPUP | WinApi.WS_THICKFRAME; break; case DisplayStyle.ResizeableWithTitle: s |= WinApi.WS_CAPTION | WinApi.WS_SYSMENU | WinApi.WS_THICKFRAME | WinApi.WS_MINIMIZEBOX | WinApi.WS_MAXIMIZEBOX; break; } m_handle = WinApi.CreateWindowEx( 0, m_className, "", s, 0, 0, 800, 600, IntPtr.Zero, IntPtr.Zero, m_instance, IntPtr.Zero ); m_deviceContext = WinApi.GetDC(m_handle); }
public ToolStripItem CreateItem(bool fLarge, DisplayStyle displayStyle) { if(labelTime == null) { labelTime = new ToolStripLabel(); labelTime.DisplayStyle = ToolStripItemDisplayStyle.Text; labelTime.AutoSize = true; labelTime.Font = new Font("Courier New", labelTime.Font.SizeInPoints); labelTime.Alignment = ToolStripItemAlignment.Right; labelTime.Padding = new Padding(0, 0, 24, 0); } if(timer == null) { timer = new Timer(); timer.Interval = 1000; timer.Tick += timer_Tick; } timer.Start(); return labelTime; }
public ToolStripItem CreateItem(bool fLarge, DisplayStyle displayStyle) { if(button == null) { button = new ToolStripButton(); button.Text = button.ToolTipText = ResStrs[6]; button.MouseDown += button_MouseDown; } switch(displayStyle) { case DisplayStyle.NoLabel: case DisplayStyle.SelectiveText: button.DisplayStyle = ToolStripItemDisplayStyle.Image; break; case DisplayStyle.ShowTextLabel: button.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText; break; } button.Image = fLarge ? Resource.ViewModeButton_large : Resource.ViewModeButton_small; return button; }
public CommandLink(DisplayStyle style, string text, string description) : this(style, text) { this.Description = description; }
public CommandLink(DisplayStyle style, string text) : this(style) { this.Text = text; }
public CommandLink(DisplayStyle style) : this() { this.Style = style; }
public ToolStripItem CreateItem(bool fLarge, DisplayStyle displayStyle) { if(this.button == null) { this.button = new ToolStripButton(); this.button.Text = this.button.ToolTipText = this.ResStrs[6]; this.button.MouseDown += new MouseEventHandler(button_MouseDown); } switch(displayStyle) { case DisplayStyle.NoLabel: case DisplayStyle.SelectiveText: this.button.DisplayStyle = ToolStripItemDisplayStyle.Image; break; case DisplayStyle.ShowTextLabel: this.button.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText; break; } this.button.Image = fLarge ? Resource.ViewModeButton_large : Resource.ViewModeButton_small; return this.button; }
public virtual void ProcessNotification(DisplayStyle.Notification notification, Growl.Daemon.CallbackInfo cbInfo, Growl.Connector.RequestInfo requestInfo) { try { bool done = this.display.ProcessNotification(notification, this.ActualName); // for any notifications that remain open (essentially, any visual notifications), add them to a list so we // can handle their callbacks later if (!done) { this.notificationsAwaitingCallback.Add(notification.UUID, cbInfo); } } catch(Exception ex) { // suppress any exceptions here (in case the display fails for some reason) Utility.WriteDebugInfo(String.Format("Display failed to process notification: '{0}' - {1}", ex.Message, ex.StackTrace)); } }