示例#1
0
        private void MenuAboutClick(object sender, EventArgs e)
        {
            _ = GetType().Assembly.GetName().Name;
            StringBuilder stringBuilder = new StringBuilder();

            object[] customAttributes = GetType().Assembly.GetCustomAttributes(typeof(AssemblyDescriptionAttribute), inherit: false);
            if (customAttributes.Length != 0)
            {
                stringBuilder.Append(((AssemblyDescriptionAttribute)customAttributes[0]).Description).Append(Environment.NewLine);
            }
            stringBuilder.Append(Environment.NewLine);
            stringBuilder.Append("Version: ").Append(GetType().Assembly.GetName().Version.ToString()).Append(Environment.NewLine);
            object[] customAttributes2 = GetType().Assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), inherit: false);
            if (customAttributes2.Length != 0)
            {
                stringBuilder.Append("Copyright: ").Append(((AssemblyCopyrightAttribute)customAttributes2[0]).Copyright).Append(Environment.NewLine);
            }
            stringBuilder.Append(Environment.NewLine);
            stringBuilder.Append(ExtractInfo(g_Weather));
            stringBuilder.Append(ExtractInfo(g_SunRiseSet));
            AboutDialog val = (AboutDialog)(object)new AboutDialog();

            val.SetPosition((WindowPosition)3);
            val.Title   = "Simple Weather Tray Gtk Edition";
            val.Authors = new string[1] {
                "Luke Liukonen"
            };
            val.Comments = stringBuilder.ToString();
            val.Show();
        }
        public void HelpAbout()
        {
            var dlg = new AboutDialog(this.Owner)
            {
                Title = "About OxyPlot ExportDemo",
                Image = new BitmapImage(new Uri(@"pack://application:,,,/ExportDemo;component/Images/oxyplot.png"))
            };

            dlg.Show();
        }
 /*display the about dialog*/
 private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (aboutDialog != null)
     {
         return;
     }
     aboutDialog = new AboutDialog();
     aboutDialog.StartPosition = FormStartPosition.Manual;
     aboutDialog.Location = new Point(this.Location.X,
         this.Location.Y + this.Height);
     aboutDialog.FormClosed += AboutDialog_FormClosed;
     aboutDialog.Show();
 }
示例#4
0
        private static void HelpClickedEvent(object o, ButtonPressEventArgs args)
        {
            //todo Close button not working fix
            var dialog = new AboutDialog
            {
                Authors  = new[] { "lxzy" },
                License  = "MIT License",
                Website  = "https://github.com/llxzy",
                Comments = "Made for fun.",
                Artists  = new[] { "Icon made by DinosoftLabs at Flaticon." }
            };

            dialog.Show();
        }
示例#5
0
        //Override of About Tool Strip Menu Item Handler
        public override void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AboutDialog abtDlg = new AboutDialog();

            abtDlg.Owner = this;

            try
            {
                abtDlg.Show();
            }
            catch
            {
                throw new NotSupportedException("About Dialog not supported");
            }
        }
示例#6
0
        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AboutDialog dlg = new AboutDialog();

            foreach (Form fm in Application.OpenForms)
            {
                if (fm.Name == "AboutDialog")
                {
                    return;
                }
            }
            dlg.Owner         = this;
            dlg.StartPosition = FormStartPosition.Manual;
            dlg.SetDesktopLocation((this.DesktopLocation.X + this.Width), this.DesktopLocation.Y);
            dlg.Show();
        }
示例#7
0
        /// <summary>
        /// Show the NetOffice default about dialog
        /// </summary>
        /// <param name="owner">owner window. can be null(Nothing in Visual Basic)</param>
        /// <param name="modal">show dialog modal to its owner window</param>
        /// <param name="size">size for the dialog. Size.Empty to use default size</param>
        /// <param name="headerCaption">header caption on top</param>
        /// <param name="assemblyTitle">title of the owner assembly</param>
        /// <param name="assemblyVersion">version of the owner assembly</param>
        /// <param name="copyrightHint">copyright hints of the owner assembly</param>
        /// <param name="companyName">name of the manufactor</param>
        /// <param name="companyUrl">optional url of the manufactor</param>
        /// <param name="licenceText">licence informations</param>
        public void ShowAbout(IWin32Window owner, bool modal, Size size, string headerCaption, string assemblyTitle, string assemblyVersion, string copyrightHint, string companyName, string companyUrl, string licenceText)
        {
            bool isCurrentlySuspended = IsCurrentlySuspended();

            List <KeyValuePair <string, object> > arguments = new List <KeyValuePair <string, object> >();

            arguments.Add(new KeyValuePair <string, object>("Caption", headerCaption));
            arguments.Add(new KeyValuePair <string, object>("AssemblyTitle", assemblyTitle));
            arguments.Add(new KeyValuePair <string, object>("AssemblyVersion", assemblyVersion));
            arguments.Add(new KeyValuePair <string, object>("Copyright", copyrightHint));
            arguments.Add(new KeyValuePair <string, object>("CompanyName", companyName));
            arguments.Add(new KeyValuePair <string, object>("CompanyUrl", companyUrl));
            arguments.Add(new KeyValuePair <string, object>("Licence", licenceText));

            RaiseDialogShow(DialogType.About, isCurrentlySuspended, modal, arguments);
            if (isCurrentlySuspended)
            {
                RaiseDialogShown(DialogType.About, true, modal, DialogResult.None, arguments);
                return;
            }

            Dialogs.AboutDialog dlg = new AboutDialog(headerCaption, assemblyTitle, assemblyVersion, copyrightHint, companyName, companyUrl, licenceText);
            OnCreateToolsDialog(dlg, "AboutDialog");

            if (null == owner)
            {
                dlg.StartPosition = FormStartPosition.CenterScreen;
            }
            if (Size.Empty != size)
            {
                dlg.Size = size;
            }

            if (modal)
            {
                dlg.ShowDialog(owner);
                RaiseDialogShown(DialogType.About, false, true, DialogResult.None, arguments);
            }
            else
            {
                _openNonModalDialogs.Add(dlg, new NonModalDialogValue(DialogType.About, arguments));
                dlg.FormClosed += new FormClosedEventHandler(NonModalDialog_FormClosed);
                dlg.Show(owner);
            }
        }
示例#8
0
        private void OnCommandClick(CadPlusCommands_e spec)
        {
            switch (spec)
            {
            case CadPlusCommands_e.Help:
                try
                {
                    System.Diagnostics.Process.Start(Resources.HelpLink);
                }
                catch
                {
                }
                break;

            case CadPlusCommands_e.About:
                AboutDialog.Show(this.GetType().Assembly, Resources.logo,
                                 (IntPtr)Application.Sw.IFrameObject().GetHWndx64());
                break;
            }
        }
示例#9
0
        private void OnCommandClick(CadPlusCommands_e spec)
        {
            switch (spec)
            {
            case CadPlusCommands_e.Help:
                try
                {
                    System.Diagnostics.Process.Start(Resources.HelpLink);
                }
                catch
                {
                }
                break;

            case CadPlusCommands_e.About:
                AboutDialog.Show(this.GetType().Assembly, Resources.logo,
                                 m_Ext.Application.WindowHandle);
                break;
            }
        }
        protected virtual void OnAboutActionActivated(object sender, System.EventArgs e)
        {
            AboutDialog about = new AboutDialog();

            about.ProgramName = "Monoreports - report designer tool";
            about.Authors     = new string[] { "Tomasz Kubacki" };
            about.WrapLicense = true;
            about.License     = @"
Copyright (c) 2010 Tomasz Kubacki

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the ""Software""), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

";

            about.Response += delegate(object o, ResponseArgs args) {
                about.Destroy();
            };

            about.Show();
        }
示例#11
0
 private void OnAbout(object o, EventArgs args)
 {
     AboutDialog.Show(MainWindow);
 }
示例#12
0
        private void AboutMenuItem_Click(object sender, RoutedEventArgs e)
        {
            AboutDialog aboutDialog = new AboutDialog();

            aboutDialog.Show();
        }
示例#13
0
 protected virtual void OnAboutThisProgramActionActivated(object sender, System.EventArgs e)
 {
     AboutDialog about = new AboutDialog ();
     about.Modal = true;
     about.Show ();
 }
示例#14
0
        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AboutDialog aboutDialog = new AboutDialog();

            aboutDialog.Show();
        }
示例#15
0
        void HandleAboutActionTriggered()
        {
            var aboutDialog = new AboutDialog(Gui.MainWindow);

            aboutDialog.Show();
        }
示例#16
0
 private void About_Btn_Click(object sender, RoutedEventArgs e)
 {
     AboutDialog aboutDlg = new AboutDialog();
     aboutDlg.Show();
 }
示例#17
0
        /// <summary>
        /// Handles the navigation item selected event
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public bool OnNavigationItemSelected(IMenuItem item)
        {
            int id = item.ItemId;

            if (id == Resource.Id.nav_casual)
            {
                // Select casual mode
                mMode = "Casual";
            }
            else if (id == Resource.Id.nav_comp)
            {
                // Select comp mode
                mMode = "Competitive";
            }
            else if (id == Resource.Id.nav_login)
            {
                // Navigate to the Login activity
                Intent intent = new Intent(this, typeof(LoginActivity));
                StartActivity(intent);
                OverridePendingTransition(Resource.Animation.slide_in_left, Resource.Animation.slide_out_right);
            }
            else if (id == Resource.Id.nav_signup)
            {
                // Navigate to the SignUp activity
                Intent intent = new Intent(this, typeof(SignUpActivity));
                StartActivity(intent);
                OverridePendingTransition(Resource.Animation.slide_in_left, Resource.Animation.slide_out_right);
            }
            else if (id == Resource.Id.nav_leaderboard)
            {
                // Navigate to the Leaderboard activity
                Intent intent = new Intent(this, typeof(LeaderboardActivity));
                intent.PutExtra("Username", mUsername);
                StartActivity(intent);
                OverridePendingTransition(Resource.Animation.slide_in_left, Resource.Animation.slide_out_right);
            }
            else if (id == Resource.Id.nav_achievements)
            {
                // Navigate to the Achievements activity
                Intent intent = new Intent(this, typeof(AchievementsActivity));
                intent.PutExtra("Username", mUsername);
                StartActivity(intent);
                OverridePendingTransition(Resource.Animation.slide_in_left, Resource.Animation.slide_out_right);
            }
            else if (id == Resource.Id.nav_profile)
            {
                // Navigate to the Profile activity
                Intent intent = new Intent(this, typeof(ProfileActivity));
                intent.PutExtra("Username", mUsername);
                StartActivity(intent);
                OverridePendingTransition(Resource.Animation.slide_in_left, Resource.Animation.slide_out_right);
            }
            else if (id == Resource.Id.nav_logout)
            {
                Logout();
            }
            else if (id == Resource.Id.nav_reports)
            {
                // Navigate to the Feedback activity
                Intent intent = new Intent(this, typeof(ReportsActivity));
                StartActivity(intent);
                OverridePendingTransition(Resource.Animation.slide_in_left, Resource.Animation.slide_out_right);
            }
            else if (id == Resource.Id.nav_feedback)
            {
                // Navigate to the Feedback activity
                Intent intent = new Intent(this, typeof(FeedbackActivity));
                intent.PutExtra("Username", mUsername);
                StartActivity(intent);
                OverridePendingTransition(Resource.Animation.slide_in_left, Resource.Animation.slide_out_right);
            }
            else if (id == Resource.Id.nav_about)
            {
                // Pull up About dialog
                FragmentTransaction transaction = FragmentManager.BeginTransaction();
                AboutDialog         dialogFrag  = new AboutDialog();
                dialogFrag.Show(transaction, "dialog fragment");
            }

            // Close out the navigation drawer
            mDrawer.CloseDrawer(GravityCompat.Start);
            return(true);
        }
示例#18
0
        public WindowBuilder()
        {
            _columnFilter = 0;
            _textToFilter = "";

            _processIdToKill = new List <int>();
            _listStore       = new ListStore(typeof(string), typeof(string), typeof(string), typeof(string),
                                             typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));

            Application.Init();

            _window = new Window("Label sample");
            _window.Resize(1300, 600);
            _window.Title = "Process Watch";
            _window.SetIconFromFile("icons/processIconSmall.png");
            _window.BorderWidth  = 5;
            _window.DeleteEvent += OnWindowClose;

            var aboutButton = new Button();
            var aboutIcon   = new Image();

            aboutIcon.Pixbuf        = new Pixbuf("icons/information.png");
            aboutButton.Image       = aboutIcon;
            aboutButton.TooltipText = "About Process Watch";
            aboutButton.Clicked    += (sender, args) =>
            {
                _aboutDialog.Show();
            };

            _aboutDialog = CreateAboutDialog();

            var filterButton = new Button();

            filterButton.Image       = new Image(Stock.Find, IconSize.Button);
            filterButton.TooltipText = "Filtration utilities";
            filterButton.Clicked    += (sender, args) =>
            {
                if (_filtrationHBox.IsVisible)
                {
                    _filtrationHBox.Hide();
                }
                else
                {
                    _filtrationHBox.ShowAll();
                }
            };

            var windowHBox = new HBox(false, 5);

            windowHBox.PackEnd(aboutButton, false, false, 0);
            windowHBox.PackEnd(filterButton, false, false, 0);

            _processNameEntry          = new Entry();
            _processNameEntry.Changed += OnChanged;

            _processIdEntry               = new Entry();
            _processIdEntry.Changed      += OnChanged;
            _processIdEntry.TextInserted += OnlyNumerical;

            // String values for the combobox - filtration direction
            _filtrationDirectionOptions = new[]
            {
                ">",
                "≥",
                "=",
                "≤",
                "<"
            };

            // String values for the combobox - memory usage units
            _memoryFiltrationDirectionUnits = new[]
            {
                "B",
                "KB",
                "MB",
                "GB"
            };


            _memoryFiltrationEntry = new Entry();
            _memoryFiltrationEntry.MaxWidthChars = 7;
            _memoryFiltrationEntry.WidthChars    = 7;
            _memoryFiltrationEntry.Changed      += OnChanged;
            _memoryFiltrationEntry.TextInserted += OnlyNumerical;

            _memoryFiltrationDirectionComboBox          = new ComboBox(_filtrationDirectionOptions);
            _memoryFiltrationDirectionComboBox.Changed += OnChanged;

            _memoryFiltrationUnitsComboBox          = new ComboBox(_memoryFiltrationDirectionUnits);
            _memoryFiltrationUnitsComboBox.Changed += OnChanged;

            _memoryFiltrationHbox = new HBox();
            _memoryFiltrationHbox.PackStart(_memoryFiltrationDirectionComboBox, false, false, 0);
            _memoryFiltrationHbox.PackStart(_memoryFiltrationEntry, false, false, 0);
            _memoryFiltrationHbox.PackStart(_memoryFiltrationUnitsComboBox, false, false, 0);


            _cpuFiltrationEntry = new Entry();
            _cpuFiltrationEntry.MaxWidthChars = 7;
            _cpuFiltrationEntry.WidthChars    = 7;
            _cpuFiltrationEntry.Changed      += OnChanged;
            _cpuFiltrationEntry.TextInserted += OnlyNumerical;

            _cpuFiltrationDirectionComboBox          = new ComboBox(_filtrationDirectionOptions);
            _cpuFiltrationDirectionComboBox.Changed += OnChanged;

            var cpuFiltrationLabel = new Label("%");

            _cpuFiltrationHbox = new HBox();
            _cpuFiltrationHbox.PackStart(_cpuFiltrationDirectionComboBox, false, false, 0);
            _cpuFiltrationHbox.PackStart(_cpuFiltrationEntry, false, false, 0);
            _cpuFiltrationHbox.PackStart(cpuFiltrationLabel, false, false, 0);


            _filtrationOptions = new[]
            {
                "All processes",
                "Filter by PID",
                "Filter by Process Name",
                "Filter by Memory Usage",
                "Filter by CPU usage",
            };

            var filtrationCombo = new ComboBox(_filtrationOptions);

            filtrationCombo.Changed += ComboOnChanged;

            _filtrationHBox = new HBox(false, 5);
            _filtrationHBox.PackStart(filtrationCombo, false, false, 0);


            string[] columnLabels =
            {
                "PID",
                "Process name",
                "Memory usage",
                "Priority",
                "User CPU Time",
                "Privileged CPU Time",
                "Total CPU Time",
                "CPU usage",
                "Threads",
                "Start Time"
            };


            _treeModelFilter             = new TreeModelFilter(_listStore, null);
            _treeModelFilter.VisibleFunc = Filter;

            var treeModelSort = new TreeModelSort(_treeModelFilter);

            treeModelSort.SetSortFunc(0, WindowBuilderHelper.IdSortFunc);
            treeModelSort.SetSortFunc(1, WindowBuilderHelper.ProcessNameSortFunc);
            treeModelSort.SetSortFunc(2, WindowBuilderHelper.MemoryUsageSortFunc);
            treeModelSort.SetSortFunc(3, WindowBuilderHelper.PrioritySortFunc);
            treeModelSort.SetSortFunc(4, WindowBuilderHelper.UserCpuTimeSortFunc);
            treeModelSort.SetSortFunc(5, WindowBuilderHelper.PrivilegedCpuTimeSortFunc);
            treeModelSort.SetSortFunc(6, WindowBuilderHelper.TotalCpuTimeSortFunc);
            treeModelSort.SetSortFunc(7, WindowBuilderHelper.CpuUsageSortFunc);
            treeModelSort.SetSortFunc(8, WindowBuilderHelper.ThreadCountSortFunc);
            treeModelSort.SetSortFunc(9, WindowBuilderHelper.StartTimeSortFunc);

            var treeView = new TreeView();

            treeView.Model              = treeModelSort;
            treeView.Selection.Mode     = SelectionMode.Multiple;
            treeView.Selection.Changed += OnSelectionChanged;
            treeView.TooltipColumn      = 1;

            // Create a scrollable window
            var scrolledWindow = new ScrolledWindow();

            scrolledWindow.Add(treeView);

            // Create a CellRendererText responsible for proper rendering cell data
            var cellRendererText = new CellRendererText();

            cellRendererText.Alignment = Pango.Alignment.Right;
            cellRendererText.Xalign    = 0.5f;

            // Load the _treeView with TreeViewColumns
            for (int i = 0; i < 10; i++)
            {
                var treeViewColumn = new TreeViewColumn();
                treeViewColumn.Clickable     = true;
                treeViewColumn.Resizable     = true;
                treeViewColumn.Title         = columnLabels[i];
                treeViewColumn.SortIndicator = true;
                treeViewColumn.Alignment     = 0.5f;
                treeViewColumn.Expand        = true;
                treeViewColumn.SortColumnId  = i;
                treeViewColumn.PackStart(cellRendererText, true);
                treeViewColumn.AddAttribute(cellRendererText, "text", i);

                switch (i)
                {
                case 0:
                    break;

                case 1:
                    _window.GetSize(out int width, out int height);
                    treeViewColumn.MaxWidth = Math.Abs(width / 2);
                    break;

                case 2:
                    treeViewColumn.SetCellDataFunc(cellRendererText, WindowBuilderHelper.MemoryUsageFormatter);
                    break;

                case 3:
                    break;

                case 4:
                    treeViewColumn.SetCellDataFunc(cellRendererText, WindowBuilderHelper.UserCpuTimeFormatter);
                    break;

                case 5:
                    treeViewColumn.SetCellDataFunc(cellRendererText, WindowBuilderHelper.PrivilegedCpuTimeFormatter);
                    break;

                case 6:
                    treeViewColumn.SetCellDataFunc(cellRendererText, WindowBuilderHelper.TotalCpuTimeFormatter);
                    break;

                case 7:
                    treeViewColumn.SetCellDataFunc(cellRendererText, WindowBuilderHelper.CpuUsageFormatter);
                    break;

                case 8:
                    break;

                case 9:
                    treeViewColumn.SetCellDataFunc(cellRendererText, WindowBuilderHelper.StartTimeFormatter);
                    break;
                }

                treeView.AppendColumn(treeViewColumn);
            }

            var killButton = new Button("Kill process");

            killButton.Clicked += KillProcess;

            var windowVBox = new VBox(false, 5);

            windowVBox.PackStart(windowHBox, false, false, 0);
            windowVBox.PackStart(_filtrationHBox, false, false, 0);
            windowVBox.PackStart(scrolledWindow, true, true, 0);
            windowVBox.PackStart(killButton, false, false, 0);

            _window.Add(windowVBox);

            // Create an instance of the object Updater
            _processGrabber = new ProcessGrabber();
            // Add a callback executed when _processGrabber takes process data.
            // The callback clears the _treeView content and loads new data
            // Before clearing the _treeView content the callback saves the current scroll position
            _processGrabber.OnResult += (sender, processList) =>
            {
                Application.Invoke(delegate
                {
                    _currentScrollPosition = treeView.Vadjustment.Value;
                    StoreClear();
                    LoadStore(processList);

                    treeView.ShowAll();
                });
            };

            // Add a callback executed after 'Changed' event raised after changing the position of the _treeView
            // When the _treeView content is reloaded the previous scroll position is updated
            treeView.Vadjustment.Changed += (sender, args) =>
            {
                treeView.Vadjustment.Value = _currentScrollPosition;
            };

            // Start the Timer process responsible for grabbing process data periodically
            _processGrabber.Run();

            treeView.ShowAll();
            _window.ShowAll();

            // Hide widgets related to process filtration
            _filtrationHBox.Hide();
        }
示例#19
0
 private void AboutTrigger_Activated(object sender, EventArgs e)
 {
     _aboutDialog.Show();
 }
示例#20
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     var ad = new AboutDialog();
     ad.Show();
 }
示例#21
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch ( item.ItemId ) {
                case Resource.Id.menu_about:
                    AboutDialog dialog = new AboutDialog(this);
                    dialog.Show();
                    return true;

                case Resource.Id.menu_app_settings:
                    AppSettingsActivity.Launch(this);
                    return true;

                case Resource.Id.menu_change_db:
                    GoToFileSelectActivity();
                    return true;
            }

            return base.OnOptionsItemSelected(item);
        }
示例#22
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId) {
            case Resource.Id.menu_donate:
                return Util.GotoDonateUrl(this);
            case Resource.Id.menu_about:
                AboutDialog dialog = new AboutDialog(this);
                dialog.Show();
                return true;

            case Resource.Id.menu_app_settings:
                AppSettingsActivity.Launch(this);
                return true;
            }

            return base.OnOptionsItemSelected(item);
        }