Exemplo n.º 1
0
 public static bool ShowsEdges(DisplayStyle displayStyle)
 {
     return(displayStyle == DisplayStyle.Wireframe ||
            displayStyle == DisplayStyle.HLR ||
            displayStyle == DisplayStyle.ShadingWithEdges ||
            displayStyle == DisplayStyle.FlatColors ||
            displayStyle == DisplayStyle.RealisticWithEdges);
 }
Exemplo n.º 2
0
 FrmWaitScreen()
 {
     InitializeComponent(); DisplayStyle.SetDefaultFont(this);
     Icon           = Properties.Resources.AryaLogoIcon;
     Left           = Screen.FromControl(this).WorkingArea.Width - Width;
     Top            = Screen.FromControl(this).WorkingArea.Height - Height;
     lblWait.Parent = pictBackgroundImage;
 }
Exemplo n.º 3
0
        public FrmCheckpoint()
        {
            InitializeComponent();
            DisplayStyle.SetDefaultFont(this);
            Icon = Resources.AryaLogoIcon;
            dgvCheckpoint.AutoGenerateColumns = false;

            InitData();
        }
Exemplo n.º 4
0
        void SetGutterTrackDisplay(GutterTrack t, DisplayStyle display)
        {
            if (m_GutterLabelLookup.TryGetValue(t, out VisualElement l))
            {
                l.style.display = display;
            }

            t.SetDisplay(display);
        }
Exemplo n.º 5
0
        public static void SetDisplayStyle(VisualElement target, DisplayStyle displayStyle)
        {
            if (target == null)
            {
                return;
            }

            target.style.display = displayStyle;
        }
Exemplo n.º 6
0
 // 2020/7/1
 public NormalResult LedDisplay(string ledName,
                                string text,
                                int x,
                                int y,
                                DisplayStyle property,
                                string style)
 {
     return(Program.Led.Display(ledName, text, x, y, property, style));
 }
Exemplo n.º 7
0
        public static VisualElement SetDisplay(this VisualElement self, DisplayStyle v)
        {
            var c = self.style.display;

            c.value            = v;
            self.style.display = c;

            return(self);
        }
            public virtual EffectInstance EffectInstance(DisplayStyle displayStyle, bool IsShadingPass)
            {
                if (effectInstance == null)
                {
                    effectInstance = new EffectInstance(vertexFormatBits);
                }

                return(effectInstance);
            }
Exemplo n.º 9
0
 public FrmBuildView()
 {
     InitializeComponent();
     DisplayStyle.SetDefaultFont(this);
     Icon = Resources.AryaLogoIcon;
     //_changeMonitor.Interval = 500;
     //_changeMonitor.Start();
     //_changeMonitor.Tick += changeMonitor_Tick;
 }
        // Submits the geometry for rendering.
        public void RenderScene(Autodesk.Revit.DB.View view, DisplayStyle displayStyle)
        {
            try
            {
                // Populate geometry buffers if they are not initialized or need updating.
                if (UpdateAll ||
                    m_nonTransparentFaceBufferStorage == null || m_nonTransparentFaceBufferStorage.needsUpdate(displayStyle) ||
                    m_transparentFaceBufferStorage == null || m_transparentFaceBufferStorage.needsUpdate(displayStyle) ||
                    m_edgeBufferStorage == null || m_edgeBufferStorage.needsUpdate(displayStyle))
                {
                    Options         options  = new Options();
                    GeometryElement geomElem = m_element.get_Geometry(options);

                    CreateBufferStorageForElement(geomElem, displayStyle);
                }

                // Submit a subset of the geometry for drawing. Determine what geometry should be submitted based on
                // the type of the rendering pass (opaque or transparent) and DisplayStyle (wireframe or shaded).

                // If the server is requested to submit transparent geometry, DrawContext().IsTransparentPass()
                // will indicate that the current rendering pass is for transparent objects.
                RenderingPassBufferStorage faceBufferStorage = DrawContext.IsTransparentPass() ? m_transparentFaceBufferStorage : m_nonTransparentFaceBufferStorage;

                // Conditionally submit triangle primitives (for non-wireframe views).
                if (displayStyle != DisplayStyle.Wireframe &&
                    faceBufferStorage.PrimitiveCount > 0)
                {
                    DrawContext.FlushBuffer(faceBufferStorage.VertexBuffer,
                                            faceBufferStorage.VertexBufferCount,
                                            faceBufferStorage.IndexBuffer,
                                            faceBufferStorage.IndexBufferCount,
                                            faceBufferStorage.VertexFormat,
                                            faceBufferStorage.EffectInstance, PrimitiveType.TriangleList, 0,
                                            faceBufferStorage.PrimitiveCount);
                }

                // Conditionally submit line segment primitives.
                if (displayStyle != DisplayStyle.Shading &&
                    m_edgeBufferStorage.PrimitiveCount > 0)
                {
                    DrawContext.FlushBuffer(m_edgeBufferStorage.VertexBuffer,
                                            m_edgeBufferStorage.VertexBufferCount,
                                            m_edgeBufferStorage.IndexBuffer,
                                            m_edgeBufferStorage.IndexBufferCount,
                                            m_edgeBufferStorage.VertexFormat,
                                            m_edgeBufferStorage.EffectInstance, PrimitiveType.LineList, 0,
                                            m_edgeBufferStorage.PrimitiveCount);
                }

                UpdateAll = false;
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }
        }
        /* END Recording Mode Controls */

        /* START UIElement Utility Methods */
        private void BulkButtonDisplayUpdate(List <Button> buttons, DisplayStyle style)
        {
            foreach (var button in buttons)
            {
                if (button != null)
                {
                    button.style.display = style;
                }
            }
        }
Exemplo n.º 12
0
        public FrmBrowser()
        {
            InitializeComponent();

            DisplayStyle.SetDefaultFont(this);
            Icon = Properties.Resources.AryaLogoIcon;
            Jsvo = new JavascriptSkuViewObject();
            _itemWebBrowser.ObjectForScripting = Jsvo;
            PinCurrentUrl = false;
        }
Exemplo n.º 13
0
        private void LoadTests(TestNode topLevelTest, DisplayStyle displayStyle)
        {
            _treeMap.Clear();

            using (new WaitCursor())
            {
                TreeNode topLevelNode = BuildTestTree(topLevelTest, displayStyle, false);
                _view.Tree.Load(topLevelNode);
            }
        }
Exemplo n.º 14
0
 public FrmTree(TaxonomyInfo defaultTaxonomy)
 {
     InitializeComponent();
     DisplayStyle.SetDefaultFont(this);
     Icon = Resources.AryaLogoIcon;
     skuViewToolStripMenuItem.Checked = true;
     taxonomyTree.ShowEnrichments     = false;
     taxonomyTree.SelectedTaxonomy    = defaultTaxonomy;
     OrderNodesBy = NodeOrder.NodeType;
 }
Exemplo n.º 15
0
 /// <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;
 }
Exemplo n.º 16
0
 public FrmSkuGroups()
 {
     InitializeComponent(); DisplayStyle.SetDefaultFont(this);
     this.Icon = Resources.AryaLogoIcon;
     GroupTaxonomyCount.Clear();
     initdgvSkuGroups();
     initdgvGroupDetails();
     //initdgvGroupComments();
     timerGroupDetails.Interval = 100;
     timerGroupDetails.Start();
 }
Exemplo n.º 17
0
 /// <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;
 }
        private void UpdateRenameButtonsDisplayStyle(VisualElement rowContainer, DisplayStyle style)
        {
            var saveRenameButton   = rowContainer.Q <Button>("SaveRecordingButton");
            var cancelRenameButton = rowContainer.Q <Button>("CancelRecordingButton");

            List <Button> buttons = new List <Button> {
                cancelRenameButton, saveRenameButton
            };

            BulkButtonDisplayUpdate(buttons, style);
        }
Exemplo n.º 19
0
        private FrmFindReplace()
        {
            InitializeComponent(); DisplayStyle.SetDefaultFont(this);
            Icon = Properties.Resources.AryaLogoIcon;

            ddReplaceType.Items.Clear();
            ddReplaceType.Items.AddRange(new[] { "Search String", FindTypeEntireValue });

            ddFindType.Items.Clear();
            ddFindType.Items.AddRange(new[] { "Contains", FindTypeEqualTo, "Starts with", "Ends with" });
            ddFindType.SelectedIndex = 0;
        }
        public void PerformRestart(
            DisplayStyle displayStyle)
        {
            _displayStyle = displayStyle;

            foreach (var item in _playerToRigidbodySprite)
            {
                Destroy(item.Item2.gameObject);
            }

            _playerToRigidbodySprite.Clear();
        }
Exemplo n.º 21
0
 private void TaskBarButton_MouseUp(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         displayStyle = DisplayStyle.MouseUp;
     }
     else
     {
         displayStyle = DisplayStyle.Normal;
     }
     this.Refresh();
 }
        private void UpdateRecordingButtonsDisplayStyle(VisualElement rowContainer, DisplayStyle style)
        {
            var playButton = rowContainer.Q <Button>("PlayRecordingButton");
            var findButton = rowContainer.Q <Button>("FindRecordingButton");
            //            var renameButton = rowContainer.Q<Button>("EditRecordingButton");

            List <Button> buttons = new List <Button> {
                playButton, findButton
            };

            BulkButtonDisplayUpdate(buttons, style);
        }
Exemplo n.º 23
0
        /// <summary>
        /// only public for unit testing
        /// </summary>
        public static MvcHtmlString LabelWithFieldDefinitionForImpl(string labelText,
                                                                    string fullHtmlFieldID,
                                                                    IFieldDefinitionData fieldDefinitionData,
                                                                    string urlToContent,
                                                                    int popupWidth,
                                                                    DisplayStyle displayStyle, bool hasRequiredAttribute)
        {
            if (String.IsNullOrEmpty(labelText))
            {
                return(MvcHtmlString.Empty);
            }

            var fieldDefinitionDefinition = new HtmlString(string.Empty);

            if (fieldDefinitionData != null)
            {
                fieldDefinitionDefinition = fieldDefinitionData.FieldDefinitionDataValueHtmlString;
            }
            var helpIconImgTag = GenerateHelpIconImgTag(labelText, fieldDefinitionDefinition, urlToContent, popupWidth, displayStyle);
            var labelTag       = new TagBuilder("label");

            labelTag.Attributes.Add("for", fullHtmlFieldID);
            labelTag.SetInnerText(labelText);

            switch (displayStyle)
            {
            case DisplayStyle.AsGridHeader:
                var divTag = new TagBuilder("div");
                divTag.Attributes.Add("style", "display:table; vertical-align: top");
                labelTag.Attributes.Add("style", "display:table-cell");
                divTag.InnerHtml = string.Format("{0}{1}", helpIconImgTag, labelTag.ToString(TagRenderMode.Normal));
                return(MvcHtmlString.Create(divTag.ToString(TagRenderMode.Normal)));

            case DisplayStyle.HelpIconOnly:
                return(MvcHtmlString.Create(helpIconImgTag));

            case DisplayStyle.HelpIconWithLabel:
                var labelWrapperTag = new TagBuilder("div");
                labelWrapperTag.Attributes.Add("style", "display:inline-block;");
                var requiredAsterisk = BuildRequiredAsterisk(hasRequiredAttribute, labelTag);

                labelTag.Attributes.Add("style", "display:inline;");
                labelTag.InnerHtml = string.Format("{0}{1}", labelText, requiredAsterisk);

                labelWrapperTag.AddCssClass("firma-label-wrapper");
                labelWrapperTag.InnerHtml = string.Format("{0}{1}", helpIconImgTag, labelTag.ToString(TagRenderMode.Normal));
                return(MvcHtmlString.Create(labelWrapperTag.ToString(TagRenderMode.Normal)));

            default:
                throw new ArgumentOutOfRangeException("displayStyle");
            }
        }
Exemplo n.º 24
0
        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);
        }
Exemplo n.º 25
0
        public IEnumerator ShouldDisplayButtonAndFieldBasedOnOption([Values(true, false)] bool option)
        {
            DisplayStyle expectedDisplayStyle = option ? DisplayStyle.Flex : DisplayStyle.None;

            listElement = new ListElement(Property, new ListOptions {
                EnableAdditions = option
            });
            return(WindowFixture.RootElement.AddAndRemove(listElement, () =>
            {
                Assert.AreEqual(expectedDisplayStyle, listElement.Controls.AddSection.resolvedStyle.display);
                return null;
            }));
        }
Exemplo n.º 26
0
 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());
 }
Exemplo n.º 27
0
        public IEnumerator ShouldDisplayFieldBasedOnOption([Values(true, false)] bool option)
        {
            DisplayStyle expectedDisplayStyle = option ? DisplayStyle.Flex : DisplayStyle.None;

            listElement = new ListElement(TestHelpers.GetProperty(nameof(TestHelpers.TestComponent.myCustomList)),
                                          new ListOptions {
                EnableObjectField = option
            });
            return(WindowFixture.RootElement.AddAndRemove(listElement, () =>
            {
                Assert.AreEqual(expectedDisplayStyle, listElement.Controls.AddObjectField.resolvedStyle.display);
                return null;
            }));
        }
Exemplo n.º 28
0
        public void LoadTests(TestNode topLevelTest)
        {
            DisplayStyle displayStyle = (DisplayStyle)_settings.Gui.TestTree.InitialTreeDisplay;
            var          nodeCount    = CountTestNodes(topLevelTest);

            if (displayStyle == DisplayStyle.Auto)
            {
                displayStyle = _view.Tree.VisibleCount < nodeCount
                    ? DisplayStyle.HideTests
                    : DisplayStyle.Expand;
            }

            LoadTests(topLevelTest, displayStyle);
        }
Exemplo n.º 29
0
        private static DisplayProperty parseCSS(string cssPath)
        {
            string cssContent = FileHelper.TryLoadFile(cssPath);
            var    parser     = new StylesheetParser();
            var    stylesheet = parser.Parse(cssContent);

            DisplayProperty displayProperty = new DisplayProperty();

            displayProperty.Title   = new DisplayStyle();
            displayProperty.Side    = new DisplayStyle();
            displayProperty.Display = new DisplayStyle();
            displayProperty.Tools   = new DisplayStyle();
            displayProperty.Search  = new DisplayStyle();
            displayProperty.Menu    = new DisplayStyle();
            displayProperty.Global  = new DisplayStyle();
            Type t1 = displayProperty.GetType();

            //在样式表中自上而下寻找
            foreach (StyleRule rule in stylesheet.StyleRules)
            {
                string selectors = rule.SelectorText;
                string color     = rule.Style.Color;
                string bg        = rule.Style.Background;
                string fontsize  = rule.Style.FontSize;
                int.TryParse(Regex.Match(fontsize, @"\d+").Value, out int fs);

                //获得选择器
                string[] selectTexts = selectors.Split('.');
                string   s1          = selectTexts[1].Trim();
                string   s2          = selectTexts[2].Trim();

                //反射
                DisplayStyle style = (DisplayStyle)t1.GetProperty(s1).GetValue(displayProperty);
                if (s2 == "Main")
                {
                    style.MainFontSize   = fs;
                    style.MainBackground = getColorFromRGBSring(bg);
                    style.MainForeground = getColorFromRGBSring(color);
                }
                else
                {
                    style.SubFontSize   = fs;
                    style.SubBackground = getColorFromRGBSring(bg);
                    style.SubForeground = getColorFromRGBSring(color);
                }
                t1.GetProperty(s1).SetValue(displayProperty, style);
            }

            return(displayProperty);
        }
Exemplo n.º 30
0
 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());
 }
Exemplo n.º 31
0
        public virtual void SetBounds(float x, float y, float size, bool isVisible)
        {
            if (!isVisible)
            {
                // TODO (PERF): Note to self: commenting out this and the inverse below makes scrolling super fast...
                // but it also breaks when resizing.
                if (lastDisplayStyle != DisplayStyle.None)
                {
                    style.display    = DisplayStyle.None;
                    lastDisplayStyle = DisplayStyle.None;
                }
            }
            else
            {
                // We're visible.  If we weren't visible before, then force update everything since we may not have updated
                // The following may be overkill; I'm unclear on whether or not setting a style to its existing value is expensive.
                // Update display (if changed)
                if (!wasVisible || lastDisplayStyle != DisplayStyle.Flex)
                {
                    style.display    = DisplayStyle.Flex;
                    lastDisplayStyle = DisplayStyle.Flex;
                }

                // Update location (if changed).  I'm assuming changing one of [left,top] is as expensive as changing both
                if (!wasVisible || x != lastX || y != lastY)
                {
                    style.left = lastX = x;
                    style.top  = lastY = y;
                }

                // Update size (if changed)
                if (!wasVisible || size != lastSizeSet)
                {
                    style.width  = size;
                    style.height = size;
                    if (label != null)
                    {
                        var labelIsVisible = size > 100;
                        if (labelIsVisible != labelWasVisible)
                        {
                            labelWasVisible = labelIsVisible;
                            label.text      = labelIsVisible ? labelText : "";
                        }
                    }
                    lastSizeSet = size;
                }
            }
            wasVisible = isVisible;
        }
Exemplo n.º 32
0
        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);
        }
Exemplo n.º 33
0
        /// <summary>
        /// Helper used to figure out the display style
        /// to use when the setting is Auto
        /// </summary>
        /// <returns>DisplayStyle to be used</returns>
        private DisplayStyle GetDisplayStyle()
        {
            DisplayStyle initialDisplay = (DisplayStyle)UserSettings.Gui.TestTree.InitialTreeDisplay;

            if (initialDisplay != DisplayStyle.Auto)
            {
                return(initialDisplay);
            }

            if (VisibleCount >= GetNodeCount(true))
            {
                return(DisplayStyle.Expand);
            }

            return(DisplayStyle.HideTests);
        }
Exemplo n.º 34
0
        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;
        }
Exemplo n.º 35
0
        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;
        }
Exemplo n.º 36
0
        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));
            }
        }
Exemplo n.º 37
0
        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;
        }
Exemplo n.º 38
0
 public CommandLink(DisplayStyle style)
     : this()
 {
     this.Style = style;
 }
Exemplo n.º 39
0
 public CommandLink(DisplayStyle style, string text)
     : this(style)
 {
     this.Text = text;
 }
Exemplo n.º 40
0
 public CommandLink(DisplayStyle style, string text, string description)
     : this(style, text)
 {
     this.Description = description;
 }