Inheritance: MonoBehaviour
Exemplo n.º 1
0
        public MainPage()
        {
            this.InitializeComponent();

            this.NavigationCacheMode = NavigationCacheMode.Required;

            statusBar = StatusBar.GetForCurrentView();

            HardwareButtons.BackPressed += Quit_App;

            calculator = new BasicCalculator();
            converter = new Converter();
            justPressedSign = false;
            justPressedEquals = false;
            currentArie = 10;

            decimalDisplay.Text = "0";
            octalDisplay.Text = "0";
            hexDisplay.Text = "0";

            #region initialise currentBinary
            currentBinary = "";
            for(int i = 0; i < 64; i++)
            {
                currentBinary += "0";
            }
            #endregion
        }
Exemplo n.º 2
0
        public PersonPanel(Rectangle boundingBox)
            : base(MediaRepository.Textures["Blank"], boundingBox, Color.TransparentWhite)
        {
            professionToString = new Dictionary<Person.ProfessionType, string>();
            professionToString[Person.ProfessionType.Doctor] = "Doctor";
            professionToString[Person.ProfessionType.Educator] = "Educator";
            professionToString[Person.ProfessionType.Environmentalist] = "Environmentalist";
            professionToString[Person.ProfessionType.Scientist] = "Scientist";
            professionToString[Person.ProfessionType.Worker] = "Worker";

            professionToColor = new Dictionary<Person.ProfessionType, Color>();
            professionToColor[Person.ProfessionType.Doctor] = Color.Red;
            professionToColor[Person.ProfessionType.Educator] = Color.Yellow;
            professionToColor[Person.ProfessionType.Environmentalist] = Color.Green;
            professionToColor[Person.ProfessionType.Scientist] = Color.Blue;
            professionToColor[Person.ProfessionType.Worker] = Color.Gray;

            title = new TextBox(new Rectangle(45, 10, 50, 25), "Person", Color.White, TextBox.AlignType.Left);
            movementBar = new StatusBar(new Rectangle(125, 40, 150, 10), Color.Green, Color.White);
            educationBar = new StatusBar(new Rectangle(125, 65, 150, 10), new Color(200, 200, 0), Color.White);
            healthBar = new StatusBar(new Rectangle(125, 90, 150, 10), Color.Red, Color.White);

            professionIcon = new ImageBox(new Rectangle(25, 15, 10, 10), Color.White);

            AddComponent(title);
            AddComponent(new TextBox(new Rectangle(25, 40, 100, 10), "Movement:", Color.Black, TextBox.AlignType.Left));
            AddComponent(movementBar);
            AddComponent(new TextBox(new Rectangle(25, 65, 100, 10), "Education:", Color.Black, TextBox.AlignType.Left));
            AddComponent(educationBar);
            AddComponent(new TextBox(new Rectangle(25, 90, 100, 10), "Health:", Color.Black, TextBox.AlignType.Left));
            AddComponent(healthBar);
            AddComponent(professionIcon);
            this.consumesMouseEvent = false;
            Deactivate();
        }
 private async void FullDescriptionPage_OnLoaded(object sender, RoutedEventArgs e)
 {
     _statusBar = StatusBar.GetForCurrentView();
     FullDescriptionViewModel = DataContext as IFullDescriptionViewModel;
     FullDescriptionViewModel.VisualStateChanged += FullDescriptionViewModel_VisualStateChanged;
     FullDescriptionViewModel?.LoadShowDescriptionAsync(_requestedShowId);
 }
Exemplo n.º 4
0
	public MainForm ()
	{
		// 
		// _statusBar
		// 
		_statusBar = new StatusBar ();
		_statusBar.ShowPanels = true;
		Controls.Add (_statusBar);
		// 
		// _myComputerPanel
		// 
		_myComputerPanel = new StatusBarPanel ();
		_myComputerPanel.AutoSize = StatusBarPanelAutoSize.Contents;
		_myComputerPanel.Icon = Icon;
		_myComputerPanel.Text = "My Computer";
		_statusBar.Panels.Add (_myComputerPanel);
		// 
		// MainForm
		// 
		ClientSize = new Size (300, 60);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #82487";
		Load += new EventHandler (MainForm_Load);
	}
Exemplo n.º 5
0
        public WorldStatsPanel(Rectangle boundingBox)
            : base(MediaRepository.Textures["Blank"], boundingBox, Color.TransparentWhite)
        {
            Rectangle firstBarRect = new Rectangle(0, BarInterval, boundingBox.Width, BarHeight);
            Rectangle firstTextRect = new Rectangle(-10, BarInterval, 5, BarHeight);

            overallBar = new StatusBar(firstBarRect, new Color(255, 255, 255, 200), new Color(255, 255, 255, 100));
            educationBar = new StatusBar(Geometry.Translate(firstBarRect, 0, BarHeight + BarInterval), new Color(255, 255, 0, 200), new Color(255, 255, 255, 100));
            healthBar = new StatusBar(Geometry.Translate(firstBarRect, 0, 2 * (BarHeight + BarInterval)), new Color(255, 0, 0, 200), new Color(255, 255, 255, 100));
            environmentBar = new StatusBar(Geometry.Translate(firstBarRect, 0, 3 * (BarHeight + BarInterval)), new Color(0, 255, 0, 200), new Color(255, 255, 255, 100));

            overallText = new TextBox(firstTextRect, "Overall", Color.Black, MediaRepository.Fonts["Arial10"], TextBox.AlignType.Right);
            educationText = new TextBox(Geometry.Translate(firstTextRect, 0, BarHeight + BarInterval), "Education", Color.Black, MediaRepository.Fonts["Arial10"], TextBox.AlignType.Right);
            healthText = new TextBox(Geometry.Translate(firstTextRect, 0, 2 * (BarHeight + BarInterval)), "Health", Color.Black, MediaRepository.Fonts["Arial10"], TextBox.AlignType.Right);
            environmentText = new TextBox(Geometry.Translate(firstTextRect, 0, 3 * (BarHeight + BarInterval)), "Environment", Color.Black, MediaRepository.Fonts["Arial10"], TextBox.AlignType.Right);

            /* Temporary Values */
            healthBar.Fraction = 0.7;

            AddComponent(overallBar);
            AddComponent(educationBar);
            AddComponent(healthBar);
            AddComponent(environmentBar);

            AddComponent(overallText);
            AddComponent(educationText);
            AddComponent(healthText);
            AddComponent(environmentText);
        }
Exemplo n.º 6
0
    public MForm2()
    {
        Text = "Check menu item";

        sb = new StatusBar();
        sb.Parent = this;
        sb.Text = "Ready";

        MainMenu mainMenu = new MainMenu();

        MenuItem file = mainMenu.MenuItems.Add("&File");
        file.MenuItems.Add(new MenuItem("E&xit",
            new EventHandler(OnExit), Shortcut.CtrlX));

        MenuItem view = mainMenu.MenuItems.Add("&View");
        viewStatusBar = new MenuItem("View StatusBar");
        viewStatusBar.Checked = true;
        viewStatusBar.Click += new EventHandler(ToggleStatusBar);
        view.MenuItems.Add(viewStatusBar);

        Menu = mainMenu;
        Size = new Size(250, 200);

        CenterToScreen();
    }
Exemplo n.º 7
0
	public MainForm ()
	{
		SuspendLayout ();
		// 
		// _userControl
		// 
		_userControl = new UserControl1 ();
		_userControl.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right);
		_userControl.BackColor = Color.White;
		_userControl.Location = new Point (8, 8);
		_userControl.Size = new Size (288, 238);
		_userControl.TabIndex = 0;
		Controls.Add (_userControl);
		// 
		// _statusBar
		// 
		_statusBar = new StatusBar ();
		Controls.Add (_statusBar);
		// 
		// MainForm
		// 
		ClientSize = new Size (304, 280);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #81695";
		Load += new EventHandler (MainForm_Load);
		ResumeLayout (false);
	}
Exemplo n.º 8
0
    public MForm9()
    {
        Text = "TreeView";
        Size = new Size(250, 250);

        TreeView tv = new TreeView();

        TreeNode root = new TreeNode();
        root.Text = "Languages";

        TreeNode child1 = new TreeNode();
        child1.Text = "Python";

        TreeNode child2 = new TreeNode();
        child2.Text = "Ruby";

        TreeNode child3 = new TreeNode();
        child3.Text = "Java";

        root.Nodes.AddRange(new TreeNode[] {child1, child2, child3});

        tv.Parent = this;
        tv.Nodes.Add(root);
        tv.Dock = DockStyle.Fill;
        tv.AfterSelect += new TreeViewEventHandler(AfterSelect);

        sb = new StatusBar();
        sb.Parent = this;

        CenterToScreen();
    }
		public StatusBarContextHandler (StatusBar statusBar)
		{
			StatusBar = statusBar;
			mainContext = new MainStatusBarContextImpl (this);
			activeContext = mainContext;
			contexts.Add (mainContext);
		}
Exemplo n.º 10
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="dte">Instance of DTE to get the Output Window and Status Bar from</param>
 /// 
 public CompilerStatus(EventBus eventBus)
 {
     _EventBus = eventBus;
     _DTE = _EventBus.DTE;
     _OutputWindow = _DTE.ToolWindows.OutputWindow.OutputWindowPanes.Item("Build");
     _StatusBar = _DTE.StatusBar;
 }
Exemplo n.º 11
0
    public MForm10()
    {
        Size = new Size(400, 400);
        Text = "Directories";

        tv = new TreeView();

        SuspendLayout();

        tv.Parent = this;
        tv.Location = new Point(10,10);
        tv.Size = new Size(ClientSize.Width - 20, Height - 200);
        tv.Anchor = AnchorStyles.Top | AnchorStyles.Left |
          AnchorStyles.Right ;

        tv.FullRowSelect = false;
        tv.ShowLines = true;
        tv.ShowPlusMinus = true;
        tv.Scrollable = true;
        tv.AfterSelect += new TreeViewEventHandler(AfterSelect);

        expand = new Button();
        expand.Parent = this;
        expand.Location = new Point(20, tv.Bottom + 20);
        expand.Text = "Expand";
        expand.Anchor = AnchorStyles.Left | AnchorStyles.Top;
        expand.Click += new EventHandler(OnExpand);

        expandAll = new Button();
        expandAll.Parent = this;
        expandAll.Location = new Point(20, expand.Bottom + 5);
        expandAll.Text = "Expand All";
        expandAll.Anchor = AnchorStyles.Left | AnchorStyles.Top;
        expandAll.Click += new EventHandler(OnExpandAll);

        collapse = new Button();
        collapse.Parent = this;
        collapse.Location = new Point(expandAll.Right + 5, expand.Top );
        collapse.Text = "Collapse";
        collapse.Anchor = AnchorStyles.Left | AnchorStyles.Top;
        collapse.Click += new EventHandler(OnCollapse);

        collapseAll = new Button();
        collapseAll.Parent = this;
        collapseAll.Location = new Point(collapse.Left, collapse.Bottom + 5);
        collapseAll.Text = "Collapse All";
        collapseAll.Anchor = AnchorStyles.Left | AnchorStyles.Top;
        collapseAll.Click += new EventHandler(OnCollapseAll);

        sb = new StatusBar();
        sb.Parent = this;

        ShowDirectories(tv.Nodes, HOME_DIR);

        ResumeLayout();

        CenterToScreen();
    }
Exemplo n.º 12
0
        public MainPage()
        {
            this.InitializeComponent();

            this.NavigationCacheMode = NavigationCacheMode.Required;

            statusBar = StatusBar.GetForCurrentView();
            inverted = false;
        }
Exemplo n.º 13
0
		public void Setup()
		{
			statusBar = new StatusBar();

			TestSuiteBuilder builder = new TestSuiteBuilder();
			suite = builder.Build( new TestPackage( testsDll ) );

			mockEvents = new MockTestEventSource( suite );
		}
Exemplo n.º 14
0
        public override void Initialize(EditorService service)
        {
            base.Initialize(service);

            bar = new StatusBar();
            EditorService.Instance.QueryModule<FormViewModule>().RegisterView(bar, "Status");

            Application.Idle += delegate { Idle(); };
        }
Exemplo n.º 15
0
 internal CustomTitleBar()
 {
     _titleBar = ApplicationView.GetForCurrentView().TitleBar;
     if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
     {
         _statusBar = StatusBar.GetForCurrentView();
         _statusBar.BackgroundOpacity = 1.0;
     }
 }
        public AboutPage()
        {
            this.InitializeComponent();
            _statusBar = StatusBar.GetForCurrentView();
            AppVersion = MetadataProvider.AppVersion;
            this.DataContext = this;

#if !DEBUG
            GoogleAnalytics.EasyTracker.GetTracker().SendView("About Page");
#endif
        }
        public QueryResultsTotalizerController(DocumentService docService, StatusBar statusBar, IVisualStudioAdapter teamExplorer)
        {
            var documentCreationTracker = new QueryResultsDocumentCreationObserver(docService);

            documentCreationTracker.DocumentCreated += (sender, e) =>
            {
                var queryResultsModel = new QueryResultsTotalizerModel(teamExplorer);

                new QueryResultsDocumentSelectionObserver(e.QueryResultsDocument, queryResultsModel);

                new QueryResultsTotalizerView(queryResultsModel, statusBar);
            };
        }
        public MainPage()
        {
            this.InitializeComponent();
            this.DataContext = this;
            this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Enabled;

            _menu = new MenuControl();
            _contentControlManager = new ControlManager(ProxiedControl_ActionRequested);

            _statusBar = StatusBar.GetForCurrentView();
            _statusBar.BackgroundColor = (Application.Current.Resources["AlternateDarkBrush"] as SolidColorBrush).Color;
            _statusBar.ForegroundColor = Colors.LightGray;
            _statusBar.ShowAsync();
        }
Exemplo n.º 19
0
 /// <summary>
 /// Запуск приложения.
 /// </summary>
 protected override void OnLaunched(LaunchActivatedEventArgs e)
 {
     AppShell shell = Window.Current.Content as AppShell;
     // Инициализация AppShell.
     shell = new AppShell();
     // AppShell становится текущим содержимым окна.
     Window.Current.Content = shell;
     // Определяет цветовую гамму заголовка окна или статусной панели.
     if (!ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
         if (Current.RequestedTheme == ApplicationTheme.Light)
         {
             var titleBar = ApplicationView.GetForCurrentView().TitleBar;
             titleBar.BackgroundColor = titleBar.ButtonBackgroundColor = titleBar.InactiveBackgroundColor = titleBar.ButtonInactiveBackgroundColor =
                 Color.FromArgb(255, 242, 242, 242);
             titleBar.ButtonHoverForegroundColor = titleBar.ButtonPressedForegroundColor = Colors.Black;
             titleBar.ButtonHoverBackgroundColor = Color.FromArgb(255, 230, 230, 230);
             titleBar.ButtonPressedBackgroundColor = Color.FromArgb(255, 204, 204, 204);
         }
         else
         {
             var titleBar = ApplicationView.GetForCurrentView().TitleBar;
             titleBar.BackgroundColor = titleBar.ButtonBackgroundColor = titleBar.InactiveBackgroundColor = titleBar.ButtonInactiveBackgroundColor =
                 Colors.Black;
             titleBar.ButtonHoverForegroundColor = titleBar.ButtonPressedForegroundColor = Colors.White;
             titleBar.ButtonHoverBackgroundColor = Color.FromArgb(255, 25, 25, 25);
             titleBar.ButtonPressedBackgroundColor = Color.FromArgb(255, 51, 51, 51);
         }
     else if (Current.RequestedTheme == ApplicationTheme.Light)
     {
         status = StatusBar.GetForCurrentView();
         status.BackgroundColor = Color.FromArgb(255, 242, 242, 242);
         status.ForegroundColor = Color.FromArgb(255, 102, 102, 102);
         status.BackgroundOpacity = 1;
     }
     else if (Current.RequestedTheme == ApplicationTheme.Dark)
     {
         status = StatusBar.GetForCurrentView();
         status.BackgroundColor = Colors.Black;
         status.BackgroundOpacity = 1;
     }
     // Выполняет навигацию к домашней странице.
     shell.AppFrame.Navigate(typeof(HomePage));
     // Очищает журнал переходов.
     shell.AppFrame.BackStack.Clear();
     SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
     // Активация Window.
     Window.Current.Activate();
 }
Exemplo n.º 20
0
        public PartialViewResult UserBar()
        {
            StatusBar statusBar = new StatusBar();

              //  if ((User.Identity.IsAuthenticated != null))// && (User.Identity.IsAuthenticated))
            var cookie = new HttpCookie("new")
            {
                Name = "test_cookie",
                Value = DateTime.Now.ToString("dd.MM.yyyy"),
                Expires = DateTime.Now.AddMinutes(10),
            };
            Response.SetCookie(cookie);
               user = cookie.Name;
            statusBar.UserName = user;
                  return PartialView(statusBar);
        }
Exemplo n.º 21
0
	public MainForm ()
	{
		_listView = new ListView ();
		_listView.Dock = DockStyle.Fill;
		_listView.View = View.Details;
		_listView.Items.Add ("item 1");
		_listView.Items.Add ("item 2");
		_listView.Items.Add ("item 3");
#if NET_2_0
		_listView.MouseClick += new MouseEventHandler (ListView_MouseClick);
#endif
		_listView.MouseMove += new MouseEventHandler (ListView_MouseMove);
		Controls.Add (_listView);
		// 
		// _nameColumnHeader
		// 
		_nameColumnHeader = new ColumnHeader ();
		_nameColumnHeader.Text = "Name";
		_listView.Columns.Add (_nameColumnHeader);
		// 
		// _statusBar
		// 
		_statusBar = new StatusBar ();
		_statusBar.ShowPanels = true;
		Controls.Add (_statusBar);
		// 
		// _activeItemPanel
		// 
		_activeItemPanel = new StatusBarPanel();
		_activeItemPanel.AutoSize = StatusBarPanelAutoSize.Contents;
		_activeItemPanel.MinWidth = 30;
		_statusBar.Panels.Add (_activeItemPanel);
		// 
		// _hitItemPanel
		// 
		_hitItemPanel = new StatusBarPanel ();
		_hitItemPanel.AutoSize = StatusBarPanelAutoSize.Spring;
		_statusBar.Panels.Add (_hitItemPanel);
		// 
		// MainForm
		// 
		ClientSize = new Size (300, 300);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #82004";
		Load += new EventHandler (MainForm_Load);
	}
Exemplo n.º 22
0
    public MForm()
    {
        Text = "FolderBrowserDialog";

        toolbar = new ToolBar();
        open = new ToolBarButton();

        statusbar = new StatusBar();
        statusbar.Parent = this;

        toolbar.Buttons.Add(open);
        toolbar.ButtonClick += new ToolBarButtonClickEventHandler(OnClicked);

        Controls.Add(toolbar);

        CenterToScreen();
    }
Exemplo n.º 23
0
        public MainPage()
        {
            this.InitializeComponent();

            //this.NavigationCacheMode = NavigationCacheMode.Required;
            
            VisualStateManager.GoToState(this, "VisualStatePost", true);
            tbTitle.Text = "Todos os Posts";
            title = "Todos os Posts";

            statusBar = StatusBar.GetForCurrentView();
            statusBar.BackgroundColor = Util.ConvertStringToColor("#FFD25349");
            statusBar.ForegroundColor = Util.ConvertStringToColor("#FFE9E7E3");
            statusBar.BackgroundOpacity = 1;

            dataTransfer = DataTransferManager.GetForCurrentView();
        }
Exemplo n.º 24
0
	public MainForm ()
	{
		// 
		// _statusBar
		// 
		_statusBar = new StatusBar ();
		Controls.Add (_statusBar);
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Steps to execute:{0}{0}" +
			"1. Attempt to make this form larger in size.{0}{0}" +
			"Expected result:{0}{0}" +
			"1. The form can be resized to 500 by 400 pixels.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// MainForm
		//
		ClientSize = new Size (350, 180);
		MaximumSize = new Size (500, 400);
		StartPosition = FormStartPosition.CenterScreen;
		Text = "bug #81798";
		Load += new EventHandler (MainForm_Load);
		Resize += new EventHandler (MainForm_Resize);
	}
Exemplo n.º 25
0
        public void _runInit()
        {
            if (true == mInited)
            {
                return;
            }

            Button button_ = new Button();
            this._regControl(button_);
            MenuStrip menuStrip_ = new MenuStrip();
            this._regControl(menuStrip_);
            ToolPanel toolPanel_ = new ToolPanel();
            this._regControl(toolPanel_);
            SideBar sideBar_ = new SideBar();
            this._regControl(sideBar_);
            DockPanel dockPanel_ = new DockPanel();
            this._regControl(dockPanel_);
            StatusBar statusBar_ = new StatusBar();
            this._regControl(statusBar_);
            Panel panel_ = new Panel();
            this._regControl(panel_);
            TextLabel textLabel_ = new TextLabel();
            this._regControl(textLabel_);
            TextBox textBox_ = new TextBox();
            this._regControl(textBox_);
            ListView listView_ = new ListView();
            this._regControl(listView_);
            TreeView treeView_ = new TreeView();
            this._regControl(treeView_);
            TextEdit textEdit_ = new TextEdit();
            this._regControl(textEdit_);
            ComboBox combox_ = new ComboBox();
            this._regControl(combox_);
            RadioButtonEx radioButtonEx_ = new RadioButtonEx();
            this._regControl(radioButtonEx_);
            RadioButton radioButton_ = new RadioButton();
            this._regControl(radioButton_);
            GroupBox groupBox_ = new GroupBox();
            this._regControl(groupBox_);
            mInited = true;
        }
Exemplo n.º 26
0
    public MForm7()
    {
        Text = "ListBox";
        Size = new Size(210, 210);

        ListBox lb = new ListBox();
        lb.Parent = this;
        lb.Items.Add("Jessica");
        lb.Items.Add("Rachel");
        lb.Items.Add("Angelina");
        lb.Items.Add("Amy");
        lb.Items.Add("Jennifer");
        lb.Items.Add("Scarlett");

        lb.Dock = DockStyle.Fill;
        lb.SelectedIndexChanged += new EventHandler(OnChanged);

        sb = new StatusBar();
        sb.Parent = this;

        CenterToScreen();
    }
Exemplo n.º 27
0
    public MForm2()
    {
        Text = "Editor";
        Size = new Size(210, 180);

        MainMenu mainMenu = new MainMenu();
        MenuItem file = mainMenu.MenuItems.Add("&File");
        file.MenuItems.Add(new MenuItem("E&xit",
                 new EventHandler(this.OnExit), Shortcut.CtrlX));

        Menu = mainMenu;

        TextBox tb = new TextBox();
        tb.Parent = this;
        tb.Dock = DockStyle.Fill;
        tb.Multiline = true;

        StatusBar sb = new StatusBar();
        sb.Parent = this;
        sb.Text = "Ready";

        CenterToScreen();
    }
Exemplo n.º 28
0
    public OldStatusBar()
    {
        this.Text = "StatusBar 예제. 닷넷 1.x 형태";

        StatusBar sb = new StatusBar();
        sb.Parent = this;
        sb.ShowPanels = true;

        sbp1 = new StatusBarPanel();
        sbp1.Text = DateTime.Now.ToLongTimeString();
        sb.Panels.Add(sbp1);

        StatusBarPanel sbp2 = new StatusBarPanel();
        sbp2.Text = "상태바 예제~";
        sbp2.Width = 200;
        sbp2.ToolTipText = "상태바 툴팁";
        sbp2.BorderStyle = StatusBarPanelBorderStyle.Raised;
        sb.Panels.Add(sbp2);

        Timer time = new Timer();
        time.Tick += new EventHandler(Time_Tick);
        time.Interval = 1000;
        time.Start();
    }
Exemplo n.º 29
0
 /// <summary>
 /// Устанавливает цвета для заголовка окна и статусной строки.
 /// </summary>
 public void SetColors()
 {
     if (!ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
         if (Application.Current.RequestedTheme == ApplicationTheme.Light)
         {
             ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;
             titleBar.BackgroundColor = titleBar.ButtonBackgroundColor = titleBar.InactiveBackgroundColor = titleBar.ButtonInactiveBackgroundColor =
                 Color.FromArgb(255, 230, 230, 230);
             titleBar.ButtonHoverForegroundColor = titleBar.ButtonPressedForegroundColor = Colors.Black;
             titleBar.ButtonHoverBackgroundColor = Color.FromArgb(255, 207, 207, 207);
             titleBar.ButtonPressedBackgroundColor = Color.FromArgb(255, 184, 184, 184);
         }
         else
         {
             ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;
             titleBar.BackgroundColor = titleBar.ButtonBackgroundColor = titleBar.InactiveBackgroundColor = titleBar.ButtonInactiveBackgroundColor =
                 Color.FromArgb(255, 31, 31, 31);
             titleBar.ButtonHoverForegroundColor = titleBar.ButtonPressedForegroundColor = Colors.White;
             titleBar.ButtonHoverBackgroundColor = Color.FromArgb(255, 53, 53, 53);
             titleBar.ButtonPressedBackgroundColor = Color.FromArgb(255, 76, 76, 76);
         }
     else if (Application.Current.RequestedTheme == ApplicationTheme.Light)
     {
         status = StatusBar.GetForCurrentView();
         status.BackgroundColor = Color.FromArgb(255, 230, 230, 230);
         status.ForegroundColor = Color.FromArgb(255, 102, 102, 102);
         status.BackgroundOpacity = 1;
     }
     else if (Application.Current.RequestedTheme == ApplicationTheme.Dark)
     {
         status = StatusBar.GetForCurrentView();
         status.BackgroundColor = Color.FromArgb(255, 31, 31, 31);
         status.ForegroundColor = Color.FromArgb(255, 191, 191, 191);
         status.BackgroundOpacity = 1;
     }
 }
Exemplo n.º 30
0
	public MainForm ()
	{
		// 
		// _statusBar
		// 
		_statusBar = new StatusBar ();
		Controls.Add (_statusBar);
		// 
		// _mainMenu
		// 
		_mainMenu = new MainMenu ();

		// 
		// _fileMenu
		// 
		_fileMenuItem = new MenuItem ();
		_fileMenuItem.Text = "&File";
		_mainMenu.MenuItems.Add (_fileMenuItem);
		// 
		// openToolStripMenuItem
		// 
		_openMenuItem = new MenuItem ();
		_openMenuItem.Text = "&Open";
		_openMenuItem.Click += new EventHandler (OpenMenuItem_Click);
		_fileMenuItem.MenuItems.Add (_openMenuItem);
		// 
		// MainForm
		// 
		ClientSize = new Size (400, 300);
		IsMdiContainer = true;
		Location = new Point (200, 100);
		Menu = _mainMenu;
		StartPosition = FormStartPosition.Manual;
		Text = "bug #81409";
		Load += new EventHandler (MainForm_Load);
	}
Exemplo n.º 31
0
        public GarminProductType IdentifyDeviceType()
        {
            m_productType = null;               // make sure we can't have a stale product data instance,
            // and return null if no positive identification

            GPacketReceived received = Transact(new GPacketBasic(BasicPids.Pid_Product_Rqst));

            /* this works fine too:
             * SendPacketWaitAck(new GPacketBasic(BasicPids.Pid_Product_Rqst));
             * GPacketReceived received = ReceivePacket();
             */

            if (received.pid != (int)BasicPids.Pid_Product_Data)
            {
                throw new GpsException("GPS did not reply with product data - check GPS cable");
            }

            if (received.size < 5)
            {
                throw new GpsException("Product data packet is too small");
            }

            A000Product_Data_Type productData = (A000Product_Data_Type)received.fromBytes(0);

            m_productType = new GarminProductType();

            m_productType.product_ID       = productData.product_ID;
            m_productType.software_version = productData.software_version;
            m_productType.descriptions     = new string[productData.strings.Count];
            int i = 0;

            foreach (string s in productData.strings)
            {
                m_productType.descriptions[i++] = s;
                StatusBar.Trace(s);
            }

            // most models send also protocol capabilities (A001) data, wait for those to come.
            // this is what GPS V sends:
            //      P000 L001 A010 T001 A100 D109 A201 D202 D109 D210 A301 D310 D301
            //      A400 D109 A500 D501 A600 D600 A700 D700 A800 D800 A900 A902 A903 A904
            //
            // this is eTrex Vista response:
            //      P000 L001 A010 A100 D108 A201 D202 D108 D210 A301 D310 D301
            //      A500 D501 A600 D600 A700 D700 A800 D800 A900 A902 A903
            try
            {
                while (true)
                {
                    received = ReceivePacket();
                    int packetId = received.pid;
                    // packet body structure: byte[] { pid, count, ...data... }
                    string str = "<" + packetId + "> cnt=" + received.size + " :";
                    if (packetId == (int)BasicPids.Pid_Protocol_Array)
                    {
                        for (int ii = 0; ii < received.size; ii += 3)
                        {
                            int    iProt = received.bytes[ii + 1] + received.bytes[ii + 2] * 256;
                            string sProt = "" + ((char)received.bytes[ii]) + string.Format("{0:D3}", iProt);
                            str += " " + sProt;
                            m_productType.supported_protocols.Add(sProt);
                        }
                        StatusBar.Trace("IP: device ID=" + m_productType.product_ID + " " + m_productType.product_description + " Firmware " +
                                        m_productType.software_version + " received Protocol Capabilities data: " + str);
                        break;
                    }
                }
            }
            catch
            {
                // DEBUG:
                //m_productType.product_ID = 73;
                //m_productType.software_version = 200;

                m_productType.supported_protocols.Clear();

                StatusBar.Trace("FYI: legacy device ID=" + m_productType.product_ID + " Firmware " +
                                m_productType.software_version + " doesn't send Protocol Capabilities data");

                string legacyProtos = devices.tryUseLegacyDevice(m_productType.product_ID,
                                                                 m_productType.software_version, m_productType.supported_protocols);

                if (m_productType.supported_protocols.Count > 0)
                {
                    StatusBar.Trace("OK: reconstructed Protocol Capabilities data: " + legacyProtos);
                }
                else
                {
                    StatusBar.Error("unknown legacy device, couldn't reconstruct Protocol Capabilities data");
                }
            }

            if (m_productType.supports("A010") || m_productType.supports("A011"))
            {
                // make sure that whatever transfer has been going on is terminated:
                SendPacketWaitAck(new GPacketA010Commands(A010Commands.Cmnd_Abort_Transfer));
            }

            // prepare all protocols here, as making them on the fly may overrun serial connection:
            if (m_productType.supports("A100"))
            {
                log("FYI: supports A100 protocol for waypoints transfer");
                m_waypointTransferProtocol = new WaypointTransferProtocol(this);
            }

            if (m_productType.supports("A201"))
            {
                log("FYI: will use A201 protocol for transferring routes");
                m_routeTransferProtocol = new RouteTransferProtocol(this, "A201");
            }
            else
            {
                log("FYI: will use A200 protocol for transferring routes");
                m_routeTransferProtocol = new RouteTransferProtocol(this, "A200");
            }

            if (m_productType.supports("A301"))
            {
                log("FYI: will use A301 protocol for uploading tracks");
                m_trackLogTransferProtocol = new TrackLogTransferProtocol(this, "A301");
            }
            else
            {
                log("FYI: will use A300 protocol for uploading tracks");
                m_trackLogTransferProtocol = new TrackLogTransferProtocol(this, "A300");
            }

            // none of the legacy devices implement A800 protocol (PVT data transfer), so we need explicit indication.
            if (m_productType.supports("A800"))
            {
                log("FYI: will use A800 protocol for real time data");
                m_pvtTransferProtocol = new PvtTransferProtocol(this);
            }

            return(m_productType);
        }
Exemplo n.º 32
0
        public override void Setup()
        {
            var statusBar = new StatusBar(new StatusItem[] {
                //new StatusItem(Key.ControlR, "~CTRL-R~ Refresh Data", () => RefreshScreen()),
                new StatusItem(Key.ControlQ, "~CTRL-Q~ Back/Quit", () => Quit())
            });

            LeftPane = new Window("Schedules")
            {
                X           = 0,
                Y           = 0, // for menu
                Width       = 40,
                Height      = Dim.Fill(),
                CanFocus    = false,
                ColorScheme = Colors.TopLevel,
            };

            try
            {
                if (STClient.GetAllSchedules().Items?.Count > 0)
                {
                    _viewSchedules = STClient.GetAllSchedules().Items
                                     .OrderBy(t => t.Name)
                                     .Select(t => new KeyValuePair <string, Schedule>(t.Name, t))
                                     .ToDictionary(t => t.Key, t => t.Value);
                }
                else
                {
                    SetErrorView($"You have no schedules configured");
                }
            }
            catch (SmartThingsNet.Client.ApiException exp)
            {
                SetErrorView($"Error calling API: {exp.Source} {exp.ErrorCode} {exp.Message}");
            }
            catch (System.Exception exp)
            {
                SetErrorView($"Unknown error calling API: {exp.Message}");
            }

            ClassListView = new ListView(_viewSchedules?.Keys?.ToList())
            {
                X             = 0,
                Y             = 0,
                Width         = Dim.Fill(0),
                Height        = Dim.Fill(), // for status bar
                AllowsMarking = false,
                ColorScheme   = Colors.TopLevel,
            };

            if (_viewSchedules?.Keys?.Count > 0)
            {
                ClassListView.SelectedItemChanged += (args) =>
                {
                    ClearClass(CurrentView);
                    var    selectedItem = _viewSchedules.Values.ToArray()[ClassListView.SelectedItem];
                    string json         = selectedItem.ToJson();
                    CurrentView = CreateJsonView(json);
                };
            }

            LeftPane.Add(ClassListView);

            HostPane = new FrameView("")
            {
                X = Pos.Right(LeftPane),
                //Y = Pos.Bottom(_settingsPane),
                Width       = Dim.Fill(),
                Height      = Dim.Fill(1), // + 1 for status bar
                ColorScheme = Colors.Dialog,
            };

            Top.Add(LeftPane, HostPane);
            Top.Add(statusBar);

            if (_viewSchedules?.Count > 0)
            {
                CurrentView = CreateJsonView(_viewSchedules?.FirstOrDefault().Value?.ToJson());
            }

            DisplayErrorView();
        }
Exemplo n.º 33
0
    // Test the constructors
    public void TestPanelCollections()
    {
        StatusBar bar = new StatusBar();

        StatusBar.StatusBarPanelCollection panels = bar.Panels;

        StatusBarPanel p1 = new StatusBarPanel();
        StatusBarPanel p2 = new StatusBarPanel();
        StatusBarPanel p3 = new StatusBarPanel();
        StatusBarPanel p4 = new StatusBarPanel();

        AssertEquals("Count (1)", 0, panels.Count);

        panels.Add(p2);
        AssertEquals("Count (2)", 1, panels.Count);

        panels[0] = p2;
        AssertEquals("Count (3)", 1, panels.Count);
        AssertEquals("Indexer (1)", p2, panels[0]);

        panels[0] = p1;
        AssertEquals("Count (4)", 1, panels.Count);
        AssertEquals("Indexer (2)", p1, panels[0]);

        panels.AddRange(new StatusBarPanel[] { p2, p3 });
        AssertEquals("Count (5)", 3, panels.Count);
        AssertEquals("Indexer (3)", p1, panels[0]);
        AssertEquals("Indexer (4)", p2, panels[1]);
        AssertEquals("Indexer (5)", p3, panels[2]);

        AssertEquals("Contains (1)", true, panels.Contains(p1));
        AssertEquals("Contains (2)", true, panels.Contains(p2));
        AssertEquals("Contains (3)", true, panels.Contains(p3));
        AssertEquals("Contains (4)", false, panels.Contains(p4));

        AssertEquals("IndexOf (1)", 0, panels.IndexOf(p1));
        AssertEquals("IndexOf (2)", 1, panels.IndexOf(p2));
        AssertEquals("IndexOf (3)", -1, panels.IndexOf(p4));

        panels.Insert(0, p4);
        AssertEquals("IndexOf (4)", 1, panels.IndexOf(p1));
        AssertEquals("IndexOf (5)", 2, panels.IndexOf(p2));
        AssertEquals("IndexOf (6)", 0, panels.IndexOf(p4));

        panels.Remove(p4);
        AssertEquals("Count (6)", 3, panels.Count);
        AssertEquals("IndexOf (7)", 0, panels.IndexOf(p1));
        AssertEquals("IndexOf (8)", 1, panels.IndexOf(p2));
        AssertEquals("IndexOf (9)", -1, panels.IndexOf(p4));

        try
        {
            panels.Add(p1);
            Fail("Add (1)");
        }
        catch (ArgumentException)
        {
            // Success - already in collection
        }

        try
        {
            StatusBarPanel nullPanel = null;
            panels.Add(nullPanel);
            Fail("Add (2)");
        }
        catch (ArgumentNullException)
        {
            // Success - null argument
        }

        try
        {
            panels.AddRange(new StatusBarPanel[] { p1, p2 });
            Fail("AddRange (1)");
        }
        catch (ArgumentException)
        {
            // Success - already in collection
        }

        try
        {
            panels[1] = p1;
            Fail("Indexer (6)");
        }
        catch (ArgumentException)
        {
            // Success- already in collection
        }

        panels.Clear();
        AssertEquals("Count (7)", 0, panels.Count);
    }
Exemplo n.º 34
0
 private void SetText(StatusBar bar, String text)
 {
     bar.Text = text;
 }
Exemplo n.º 35
0
        public override void Setup()
        {
            var statusBar = new StatusBar(new StatusItem [] {
                new StatusItem(Key.CtrlMask | Key.Q, "~^Q~ Quit", () => Quit()),
                new StatusItem(Key.F2, "~F2~ Toggle Frame Ruler", () => {
                    ConsoleDriver.Diagnostics ^= ConsoleDriver.DiagnosticFlags.FrameRuler;
                    Top.SetNeedsDisplay();
                }),
                new StatusItem(Key.F3, "~F3~ Toggle Frame Padding", () => {
                    ConsoleDriver.Diagnostics ^= ConsoleDriver.DiagnosticFlags.FramePadding;
                    Top.SetNeedsDisplay();
                }),
            });

            Top.Add(statusBar);

            _viewClasses = GetAllViewClassesCollection()
                           .OrderBy(t => t.Name)
                           .Select(t => new KeyValuePair <string, Type> (t.Name, t))
                           .ToDictionary(t => t.Key, t => t.Value);

            _leftPane = new Window("Classes")
            {
                X           = 0,
                Y           = 0,
                Width       = 15,
                Height      = Dim.Fill(1),             // for status bar
                CanFocus    = false,
                ColorScheme = Colors.TopLevel,
            };

            _classListView = new ListView(_viewClasses.Keys.ToList())
            {
                X             = 0,
                Y             = 0,
                Width         = Dim.Fill(0),
                Height        = Dim.Fill(0),
                AllowsMarking = false,
                ColorScheme   = Colors.TopLevel,
            };
            _classListView.OpenSelectedItem += (a) => {
                _settingsPane.SetFocus();
            };
            _classListView.SelectedItemChanged += (args) => {
                ClearClass(_curView);
                _curView = CreateClass(_viewClasses.Values.ToArray() [_classListView.SelectedItem]);
            };
            _leftPane.Add(_classListView);

            _settingsPane = new FrameView("Settings")
            {
                X           = Pos.Right(_leftPane),
                Y           = 0,       // for menu
                Width       = Dim.Fill(),
                Height      = 10,
                CanFocus    = false,
                ColorScheme = Colors.TopLevel,
            };
            _computedCheckBox = new CheckBox("Computed Layout", true)
            {
                X = 0, Y = 0
            };
            _computedCheckBox.Toggled += (previousState) => {
                if (_curView != null)
                {
                    _curView.LayoutStyle = previousState ? LayoutStyle.Absolute : LayoutStyle.Computed;
                    _hostPane.LayoutSubviews();
                }
            };
            _settingsPane.Add(_computedCheckBox);

            var radioItems = new ustring [] { "Percent(x)", "AnchorEnd(x)", "Center", "At(x)" };

            _locationFrame = new FrameView("Location (Pos)")
            {
                X      = Pos.Left(_computedCheckBox),
                Y      = Pos.Bottom(_computedCheckBox),
                Height = 3 + radioItems.Length,
                Width  = 36,
            };
            _settingsPane.Add(_locationFrame);

            var label = new Label("x:")
            {
                X = 0, Y = 0
            };

            _locationFrame.Add(label);
            _xRadioGroup = new RadioGroup(radioItems)
            {
                X = 0,
                Y = Pos.Bottom(label),
            };
            _xRadioGroup.SelectedItemChanged += (selected) => DimPosChanged(_curView);
            _xText = new TextField($"{_xVal}")
            {
                X = Pos.Right(label) + 1, Y = 0, Width = 4
            };
            _xText.TextChanged += (args) => {
                try {
                    _xVal = int.Parse(_xText.Text.ToString());
                    DimPosChanged(_curView);
                } catch {
                }
            };
            _locationFrame.Add(_xText);

            _locationFrame.Add(_xRadioGroup);

            radioItems = new ustring [] { "Percent(y)", "AnchorEnd(y)", "Center", "At(y)" };
            label      = new Label("y:")
            {
                X = Pos.Right(_xRadioGroup) + 1, Y = 0
            };
            _locationFrame.Add(label);
            _yText = new TextField($"{_yVal}")
            {
                X = Pos.Right(label) + 1, Y = 0, Width = 4
            };
            _yText.TextChanged += (args) => {
                try {
                    _yVal = int.Parse(_yText.Text.ToString());
                    DimPosChanged(_curView);
                } catch {
                }
            };
            _locationFrame.Add(_yText);
            _yRadioGroup = new RadioGroup(radioItems)
            {
                X = Pos.X(label),
                Y = Pos.Bottom(label),
            };
            _yRadioGroup.SelectedItemChanged += (selected) => DimPosChanged(_curView);
            _locationFrame.Add(_yRadioGroup);

            _sizeFrame = new FrameView("Size (Dim)")
            {
                X      = Pos.Right(_locationFrame),
                Y      = Pos.Y(_locationFrame),
                Height = 3 + radioItems.Length,
                Width  = 40,
            };

            radioItems = new ustring [] { "Percent(width)", "Fill(width)", "Sized(width)" };
            label      = new Label("width:")
            {
                X = 0, Y = 0
            };
            _sizeFrame.Add(label);
            _wRadioGroup = new RadioGroup(radioItems)
            {
                X = 0,
                Y = Pos.Bottom(label),
            };
            _wRadioGroup.SelectedItemChanged += (selected) => DimPosChanged(_curView);
            _wText = new TextField($"{_wVal}")
            {
                X = Pos.Right(label) + 1, Y = 0, Width = 4
            };
            _wText.TextChanged += (args) => {
                try {
                    _wVal = int.Parse(_wText.Text.ToString());
                    DimPosChanged(_curView);
                } catch {
                }
            };
            _sizeFrame.Add(_wText);
            _sizeFrame.Add(_wRadioGroup);

            radioItems = new ustring [] { "Percent(height)", "Fill(height)", "Sized(height)" };
            label      = new Label("height:")
            {
                X = Pos.Right(_wRadioGroup) + 1, Y = 0
            };
            _sizeFrame.Add(label);
            _hText = new TextField($"{_hVal}")
            {
                X = Pos.Right(label) + 1, Y = 0, Width = 4
            };
            _hText.TextChanged += (args) => {
                try {
                    _hVal = int.Parse(_hText.Text.ToString());
                    DimPosChanged(_curView);
                } catch {
                }
            };
            _sizeFrame.Add(_hText);

            _hRadioGroup = new RadioGroup(radioItems)
            {
                X = Pos.X(label),
                Y = Pos.Bottom(label),
            };
            _hRadioGroup.SelectedItemChanged += (selected) => DimPosChanged(_curView);
            _sizeFrame.Add(_hRadioGroup);

            _settingsPane.Add(_sizeFrame);

            _hostPane = new FrameView("")
            {
                X           = Pos.Right(_leftPane),
                Y           = Pos.Bottom(_settingsPane),
                Width       = Dim.Fill(),
                Height      = Dim.Fill(1),             // + 1 for status bar
                ColorScheme = Colors.Dialog,
            };

            Top.Add(_leftPane, _settingsPane, _hostPane);

            Top.LayoutSubviews();

            _curView = CreateClass(_viewClasses.First().Value);
        }
Exemplo n.º 36
0
        internal PendingChangesTab(
            WorkspaceInfo wkInfo,
            ViewHost viewHost,
            bool isGluonMode,
            WorkspaceWindow workspaceWindow,
            IViewSwitcher switcher,
            IMergeViewLauncher mergeViewLauncher,
            IHistoryViewLauncher historyViewLauncher,
            PlasticGui.WorkspaceWindow.PendingChanges.PendingChanges pendingChanges,
            NewIncomingChangesUpdater developerNewIncomingChangesUpdater,
            GluonNewIncomingChangesUpdater gluonNewIncomingChangesUpdater,
            IAssetStatusCache assetStatusCache,
            StatusBar statusBar,
            EditorWindow parentWindow)
        {
            mWkInfo              = wkInfo;
            mViewHost            = viewHost;
            mIsGluonMode         = isGluonMode;
            mWorkspaceWindow     = workspaceWindow;
            mHistoryViewLauncher = historyViewLauncher;
            mPendingChanges      = pendingChanges;
            mDeveloperNewIncomingChangesUpdater = developerNewIncomingChangesUpdater;
            mGluonNewIncomingChangesUpdater     = gluonNewIncomingChangesUpdater;
            mAssetStatusCache    = assetStatusCache;
            mStatusBar           = statusBar;
            mParentWindow        = parentWindow;
            mGuiMessage          = new UnityPlasticGuiMessage();
            mCheckedStateManager = new CheckedStateManager();

            mNewChangesInWk = NewChangesInWk.Build(
                mWkInfo,
                new BuildWorkspacekIsRelevantNewChange());

            BuildComponents(isGluonMode, parentWindow);

            mBorderColor = EditorGUIUtility.isProSkin
                ? (Color) new Color32(35, 35, 35, 255)
                : (Color) new Color32(153, 153, 153, 255);

            mProgressControls = new ProgressControlsForViews();

            mCooldownClearCheckinSuccessAction = new CooldownWindowDelayer(
                DelayedClearCheckinSuccess,
                UnityConstants.NOTIFICATION_CLEAR_INTERVAL);

            workspaceWindow.RegisterPendingChangesProgressControls(mProgressControls);

            mPendingChangesOperations = new PendingChangesOperations(
                mWkInfo,
                workspaceWindow,
                switcher,
                mergeViewLauncher,
                this,
                mProgressControls,
                workspaceWindow,
                null,
                null,
                null);

            InitIgnoreRulesAndRefreshView(mWkInfo.ClientPath, this);
        }
Exemplo n.º 37
0
        void LoadFrame(IActivatedEventArgs args, object arguments)
        {
            try
            {
                var stop = Stopwatch.StartNew();
                BLogger.Logger.Info("Loading frame started...");
                Frame rootFrame = Window.Current.Content as Frame;

                // Do not repeat app initialization when the Window already has content
                if (rootFrame == null)
                {
                    // Create a Frame to act as the navigation context
                    rootFrame = new Frame();
                    BLogger.Logger.Info("New frame created.");
                    if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                    {
                        //CoreWindowLogic.ShowMessage("HellO!!!!!", "we are here");
                        //TODO: Load state from previously suspended application
                    }
                    rootFrame.NavigationFailed += OnNavigationFailed;
                    // Place the frame in the current Window
                    Window.Current.Content = rootFrame;
                    BLogger.Logger.Info("Content set to Window successfully...");
                }
                if (rootFrame.Content == null)
                {
                    // When the navigation stack isn't restored navigate to the first page,
                    // configuring the new page by passing required information as a navigation
                    // parameter
                    BLogger.Logger.Info("Navigating to Shell...");
                    rootFrame.Navigate(typeof(Shell), arguments);
                }

                // CoreWindowLogic logic = new CoreWindowLogic();
                var view = ApplicationView.GetForCurrentView();
                view.SetPreferredMinSize(new Size(360, 100));
                if (RequestedTheme == ApplicationTheme.Dark)
                {
                    view.TitleBar.BackgroundColor       = Color.FromArgb(20, 20, 20, 1);
                    view.TitleBar.ButtonBackgroundColor = Color.FromArgb(20, 20, 20, 1);
                }
                if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
                {
                    //view.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow);
                    var statusBar = StatusBar.GetForCurrentView();
                    statusBar.BackgroundColor   = RequestedTheme == ApplicationTheme.Light ? (App.Current.Resources["PhoneAccentBrush"] as SolidColorBrush).Color : Color.FromArgb(20, 20, 20, 1);
                    statusBar.BackgroundOpacity = 1;
                    statusBar.ForegroundColor   = Colors.White;
                }
                if (args.Kind != ActivationKind.File)
                {
                    CoreWindowLogic.LoadSettings();
                }
                else
                {
                    CoreWindowLogic.LoadSettings(true);
                }
                Window.Current.Activate();
                stop.Stop();
                Debug.Write(stop.ElapsedMilliseconds.ToString() + "\r\n");
            }
            catch (Exception ex)
            {
                BLogger.Logger?.Info("Exception occured in LoadFrame Method", ex);
            }
        }
        // Load the HTTP log into the database.

        public static void Load(String FilePath, StatusBar TheStatusBar)
        {
            Cursor.Current = Cursors.WaitCursor;

            TheStatusBar.Text = "Parsing web server log Please wait.....";

            Stream LogFileS = File.OpenRead(FilePath);

            StreamReader LogFileSR = new StreamReader(LogFileS, System.Text.Encoding.ASCII);

            LogFileSR.BaseStream.Seek(0, SeekOrigin.Begin);

            String Pattern = @"(?<IPAddr>[\S]+)(?<Discard>[\s-\[]*)(?<Day>\d{1,2})(?<Discard>/)(?<Month>[a-zA-Z]+)(?<Discard>/)(?<Year>\d{2,4})(?<Discard>:)(?<Hour>\d{1,2})(?<Discard>:)(?<Minute>\d{1,2})(?<Discard>:)(?<Second>\d{1,2})(?<Discard>[\s]*)(?<TZInt>[\+\-]*\d{2})(?<TZFrac>\d{2})(?<Discard>([\]\s])*""(GET|HEAD)([\s])*)(?<File>[\S]*)(?<Discard>[^""]*""[\s]*)(?<Status>[0-9]*)(?<Discard>[\s]*)(?<Bytes>([0-9])*)(?<Discard>[^""]*"")(?<RefURL>[^""]*)(?<Discard>[^""]*""[^""]*"")(?<UserAgent>[^""]*)";
            Regex  RE      = new Regex(Pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);

            // Prepare to create a temporary file used to import data into the
            // database.
            String ImportFileName = Path.GetDirectoryName(Application.ExecutablePath) + @"\data.txt";

            StreamWriter ImportFileSW = new StreamWriter(ImportFileName);

            String       WordsFileName = Path.GetDirectoryName(Application.ExecutablePath) + @"\words.txt";
            StreamWriter WordsFileSW   = new StreamWriter(WordsFileName);

            Regex searchRegex = new Regex(@"[\s]+""SEARCH[\s]+", RegexOptions.IgnoreCase | RegexOptions.Compiled);

            while (LogFileSR.Peek() > -1)
            {
                String Line = LogFileSR.ReadLine().Trim();

                try
                {
                    // If this entry is not a "SEARCH" entry...
                    if (searchRegex.Match(Line).Length == 0)
                    {
                        Match M = RE.Match(Line);

                        String IPAddress = M.Result("${IPAddr}");
                        IPAddress = DecodeIPAddress(IPAddress);

                        int    Day       = Int32.Parse(M.Result("${Day}"));
                        String MonthName = M.Result("${Month}");

                        int Month  = GetMonth(MonthName);
                        int Year   = Int32.Parse(M.Result("${Year}"));
                        int Hour   = Int32.Parse(M.Result("${Hour}"));
                        int Minute = Int32.Parse(M.Result("${Minute}"));
                        int Second = Int32.Parse(M.Result("${Second}"));

                        int   HoursFromUTInt  = Int32.Parse(M.Result("${TZInt}"));
                        float HoursFromUTFrac = Int32.Parse(M.Result("${TZFrac}")) / 100.0f;

                        DateTime TheDateTime = new DateTime(Year, Month, Day, Hour, Minute, Second);

                        String FileName       = M.Result("${File}");
                        int    StatusCode     = Int32.Parse(M.Result("${Status}"));
                        int    Bytes          = Int32.Parse(M.Result("${Bytes}"));
                        String ReferringURL   = M.Result("${RefURL}");
                        String UserAgent      = M.Result("${UserAgent}");
                        String OS             = GetOs(UserAgent);
                        String TopLevelDomain = GetTopLevelDomain(IPAddress);
                        String HoursFromUT    = HoursFromUTInt + "." + HoursFromUTFrac;

                        // Add an entry to the temporary file in the format
                        // specified by schema.ini.
                        String TextLine = IPAddress + Delimiter +
                                          TopLevelDomain + Delimiter +
                                          TheDateTime + Delimiter +
                                          HoursFromUT + Delimiter +
                                          FileName + Delimiter +
                                          StatusCode + Delimiter +
                                          Bytes + Delimiter +
                                          ReferringURL + Delimiter +
                                          UserAgent + Delimiter + OS;

                        ImportFileSW.WriteLine(TextLine);

                        ExtractWords(ReferringURL, WordsFileSW, TheDateTime);
                    }
                }
                catch (Exception)
                {
                }
            }

            ImportFileSW.Close();
            LogFileSR.Close();
            LogFileS.Close();

            WordsFileSW.Close();

            TheStatusBar.Text = "Loading database Please Wait......";

            ImportData();
            ImportSearchWords();

            Cursor.Current = Cursors.Arrow;
        }
Exemplo n.º 39
0
 /// <summary>
 /// Popola la pagina con il contenuto passato durante la navigazione.  Vengono inoltre forniti eventuali stati
 /// salvati durante la ricreazione di una pagina in una sessione precedente.
 /// </summary>
 /// <param name="sender">
 /// Origine dell'evento. In genere <see cref="NavigationHelper"/>
 /// </param>
 /// <param name="e">Dati evento che forniscono il parametro di navigazione passato a
 /// <see cref="Frame.Navigate(Type, Object)"/> quando la pagina è stata inizialmente richiesta e
 /// un dizionario di stato mantenuto da questa pagina nel corso di una sessione
 /// precedente.  Lo stato è null la prima volta che viene visitata una pagina.</param>
 private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
     StatusBar statusBar = StatusBar.GetForCurrentView();
     await statusBar.HideAsync();
 }
Exemplo n.º 40
0
        const double TURN_POINT   = 10;    //快速转慢速的转变点

        #endregion

        #region 设置角度

        public void angleSetStart(Motors motorsIn, double angleSetIn, int motorNumberIn, StatusBar statusBarIn, TextBlock statusInfoTextBlockIn,
                                  Button angleSetButtonIn, Button emergencyStopButtonIn, Button getZeroPointButtonIn, Button zeroPointSetButtonIn,
                                  TextBox angleSetTextBoxIn, TextBox motorNumberTextBoxIn)//设置角度
        {
            motors              = motorsIn;
            angleSet            = angleSetIn;
            motorNumber         = motorNumberIn;
            statusBar           = statusBarIn;
            statusInfoTextBlock = statusInfoTextBlockIn;
            angleSetButton      = angleSetButtonIn;
            emergencyStopButton = emergencyStopButtonIn;
            getZeroPointButton  = getZeroPointButtonIn;
            zeroPointSetButton  = zeroPointSetButtonIn;
            angleSetTextBox     = angleSetTextBoxIn;
            motorNumberTextBox  = motorNumberTextBoxIn;

            timer          = new DispatcherTimer();
            timer.Interval = TimeSpan.FromMilliseconds(10);
            timer.Tick    += new EventHandler(angleSetTimer_Tick);
            timer.Start();
        }
Exemplo n.º 41
0
 public Resume()
 {
     this.InitializeComponent();
     Init();
     StatusBar.GetForCurrentView().BackgroundColor = Windows.UI.Color.FromArgb(1, 67, 197, 144);
 }
Exemplo n.º 42
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
     this.contextMenu1       = new System.Windows.Forms.ContextMenu();
     this.setFontMenuItem    = new System.Windows.Forms.MenuItem();
     this.openMenuItem       = new System.Windows.Forms.MenuItem();
     this.saveMenuItem       = new System.Windows.Forms.MenuItem();
     this.fontDialog1        = new System.Windows.Forms.FontDialog();
     this.saveFileDialog1    = new System.Windows.Forms.SaveFileDialog();
     this.openFileDialog1    = new System.Windows.Forms.OpenFileDialog();
     this.statusBar1         = new System.Windows.Forms.StatusBar();
     this.statusBarPanel1    = new System.Windows.Forms.StatusBarPanel();
     this.sandDockManager1   = new TD.SandDock.SandDockManager();
     this.leftSandDock       = new TD.SandDock.DockContainer();
     this.rightSandDock      = new TD.SandDock.DockContainer();
     this.bottomSandDock     = new TD.SandDock.DockContainer();
     this.topSandDock        = new TD.SandDock.DockContainer();
     this.toolBar1           = new TD.SandBar.ToolBar();
     this.buttonOpen         = new TD.SandBar.ButtonItem();
     this.saveButton         = new TD.SandBar.ButtonItem();
     this.recordButton       = new TD.SandBar.ButtonItem();
     this.assertButton       = new TD.SandBar.ButtonItem();
     this.playbackButton     = new TD.SandBar.ButtonItem();
     this.dropDownMenuItem1  = new TD.SandBar.DropDownMenuItem();
     this.menuButtonItem2    = new TD.SandBar.MenuButtonItem();
     this.menuButtonItem5    = new TD.SandBar.MenuButtonItem();
     this.menuButtonItem6    = new TD.SandBar.MenuButtonItem();
     this.menuButtonItem3    = new TD.SandBar.MenuButtonItem();
     this.menuButtonItem4    = new TD.SandBar.MenuButtonItem();
     this.menuButtonItem1    = new TD.SandBar.MenuButtonItem();
     this.aboutButton        = new TD.SandBar.ButtonItem();
     this.documentContainer1 = new TD.SandDock.DocumentContainer();
     this.dockControl1       = new TD.SandDock.DockControl();
     this.panel1             = new System.Windows.Forms.Panel();
     this.groupBox1          = new System.Windows.Forms.GroupBox();
     this.textScript         = new System.Windows.Forms.RichTextBox();
     this.splitter1          = new System.Windows.Forms.Splitter();
     this.groupBox2          = new System.Windows.Forms.GroupBox();
     this.lstEvents          = new System.Windows.Forms.ListBox();
     this.dockControlOutput  = new TD.SandDock.DockControl();
     this.groupBox3          = new System.Windows.Forms.GroupBox();
     this.rtbStdOutLog       = new System.Windows.Forms.RichTextBox();
     this.btnSaveLog         = new System.Windows.Forms.Button();
     this.btnClear           = new System.Windows.Forms.Button();
     ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
     this.documentContainer1.SuspendLayout();
     this.dockControl1.SuspendLayout();
     this.panel1.SuspendLayout();
     this.groupBox1.SuspendLayout();
     this.groupBox2.SuspendLayout();
     this.dockControlOutput.SuspendLayout();
     this.groupBox3.SuspendLayout();
     this.SuspendLayout();
     //
     // contextMenu1
     //
     this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.setFontMenuItem,
         this.openMenuItem,
         this.saveMenuItem
     });
     //
     // setFontMenuItem
     //
     this.setFontMenuItem.Index  = 0;
     this.setFontMenuItem.Text   = "Set Font...";
     this.setFontMenuItem.Click += new System.EventHandler(this.setFontMenuItem_Click);
     //
     // openMenuItem
     //
     this.openMenuItem.Index  = 1;
     this.openMenuItem.Text   = "Open...";
     this.openMenuItem.Click += new System.EventHandler(this.openMenuItem_Click);
     //
     // saveMenuItem
     //
     this.saveMenuItem.Index  = 2;
     this.saveMenuItem.Text   = "Save...";
     this.saveMenuItem.Click += new System.EventHandler(this.saveMenuItem_Click);
     //
     // statusBar1
     //
     this.statusBar1.Location = new System.Drawing.Point(0, 583);
     this.statusBar1.Name     = "statusBar1";
     this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
         this.statusBarPanel1
     });
     this.statusBar1.ShowPanels = true;
     this.statusBar1.Size       = new System.Drawing.Size(608, 22);
     this.statusBar1.TabIndex   = 8;
     //
     // statusBarPanel1
     //
     this.statusBarPanel1.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
     this.statusBarPanel1.Name     = "statusBarPanel1";
     this.statusBarPanel1.Width    = 592;
     //
     // sandDockManager1
     //
     this.sandDockManager1.OwnerForm = this;
     //
     // leftSandDock
     //
     this.leftSandDock.Dock         = System.Windows.Forms.DockStyle.Left;
     this.leftSandDock.Guid         = new System.Guid("25ec745e-de38-4c1a-a783-53b829ea6734");
     this.leftSandDock.LayoutSystem = new TD.SandDock.SplitLayoutSystem(250, 400);
     this.leftSandDock.Location     = new System.Drawing.Point(0, 0);
     this.leftSandDock.Manager      = this.sandDockManager1;
     this.leftSandDock.Name         = "leftSandDock";
     this.leftSandDock.Size         = new System.Drawing.Size(0, 605);
     this.leftSandDock.TabIndex     = 10;
     //
     // rightSandDock
     //
     this.rightSandDock.Dock         = System.Windows.Forms.DockStyle.Right;
     this.rightSandDock.Guid         = new System.Guid("c4aec7ed-9055-44f4-af3f-2ea35df51099");
     this.rightSandDock.LayoutSystem = new TD.SandDock.SplitLayoutSystem(250, 400);
     this.rightSandDock.Location     = new System.Drawing.Point(608, 0);
     this.rightSandDock.Manager      = this.sandDockManager1;
     this.rightSandDock.Name         = "rightSandDock";
     this.rightSandDock.Size         = new System.Drawing.Size(0, 605);
     this.rightSandDock.TabIndex     = 11;
     //
     // bottomSandDock
     //
     this.bottomSandDock.Dock         = System.Windows.Forms.DockStyle.Bottom;
     this.bottomSandDock.Guid         = new System.Guid("5196e983-c717-40e9-b223-368ca5f449f3");
     this.bottomSandDock.LayoutSystem = new TD.SandDock.SplitLayoutSystem(250, 400);
     this.bottomSandDock.Location     = new System.Drawing.Point(0, 605);
     this.bottomSandDock.Manager      = this.sandDockManager1;
     this.bottomSandDock.Name         = "bottomSandDock";
     this.bottomSandDock.Size         = new System.Drawing.Size(608, 0);
     this.bottomSandDock.TabIndex     = 12;
     //
     // topSandDock
     //
     this.topSandDock.Dock         = System.Windows.Forms.DockStyle.Top;
     this.topSandDock.Guid         = new System.Guid("c11b7c3d-b652-47b2-bf7d-0a72097ec98e");
     this.topSandDock.LayoutSystem = new TD.SandDock.SplitLayoutSystem(250, 400);
     this.topSandDock.Location     = new System.Drawing.Point(0, 0);
     this.topSandDock.Manager      = this.sandDockManager1;
     this.topSandDock.Name         = "topSandDock";
     this.topSandDock.Size         = new System.Drawing.Size(608, 0);
     this.topSandDock.TabIndex     = 13;
     //
     // toolBar1
     //
     this.toolBar1.ContextMenu  = this.contextMenu1;
     this.toolBar1.FlipLastItem = true;
     this.toolBar1.Guid         = new System.Guid("a57ee27e-f5fa-4a3f-986a-cbe4264539d5");
     this.toolBar1.Items.AddRange(new TD.SandBar.ToolbarItemBase[] {
         this.buttonOpen,
         this.saveButton,
         this.recordButton,
         this.assertButton,
         this.playbackButton,
         this.dropDownMenuItem1,
         this.aboutButton
     });
     this.toolBar1.Location = new System.Drawing.Point(0, 0);
     this.toolBar1.Name     = "toolBar1";
     this.toolBar1.ShowShortcutsInToolTips = true;
     this.toolBar1.Size      = new System.Drawing.Size(608, 22);
     this.toolBar1.TabIndex  = 14;
     this.toolBar1.Text      = "";
     this.toolBar1.TextAlign = TD.SandBar.ToolBarTextAlign.Underneath;
     //
     // buttonOpen
     //
     this.buttonOpen.IconSize    = new System.Drawing.Size(32, 32);
     this.buttonOpen.Text        = "Open";
     this.buttonOpen.ToolTipText = "Open";
     this.buttonOpen.Activate   += new System.EventHandler(this.buttonOpen_Activate);
     //
     // saveButton
     //
     this.saveButton.IconSize    = new System.Drawing.Size(32, 32);
     this.saveButton.Text        = "Save";
     this.saveButton.ToolTipText = "Save";
     this.saveButton.Activate   += new System.EventHandler(this.saveButton_Activate);
     //
     // recordButton
     //
     this.recordButton.BeginGroup  = true;
     this.recordButton.Text        = "Start";
     this.recordButton.ToolTipText = "Start";
     this.recordButton.Activate   += new System.EventHandler(this.recordButton_Activate);
     //
     // assertButton
     //
     this.assertButton.IconSize    = new System.Drawing.Size(128, 128);
     this.assertButton.Text        = "Assert";
     this.assertButton.ToolTipText = "Add assertion";
     this.assertButton.Activate   += new System.EventHandler(this.assertButton_Activate);
     //
     // playbackButton
     //
     this.playbackButton.Text        = "Playback";
     this.playbackButton.ToolTipText = "Playback";
     this.playbackButton.Activate   += new System.EventHandler(this.playbackButton_Activate);
     //
     // dropDownMenuItem1
     //
     this.dropDownMenuItem1.Items.AddRange(new TD.SandBar.ToolbarItemBase[] {
         this.menuButtonItem2,
         this.menuButtonItem3,
         this.menuButtonItem4,
         this.menuButtonItem1
     });
     this.dropDownMenuItem1.Text    = "Options";
     this.dropDownMenuItem1.Visible = false;
     //
     // menuButtonItem2
     //
     this.menuButtonItem2.Items.AddRange(new TD.SandBar.ToolbarItemBase[] {
         this.menuButtonItem5,
         this.menuButtonItem6
     });
     this.menuButtonItem2.Text = "Browser Selection";
     //
     // menuButtonItem5
     //
     this.menuButtonItem5.Text = "Firewatir: Mozilla Firefox";
     //
     // menuButtonItem6
     //
     this.menuButtonItem6.Text = "Watir: Internet Explorer";
     //
     // menuButtonItem3
     //
     this.menuButtonItem3.Text = "Watir Project Page";
     //
     // menuButtonItem4
     //
     this.menuButtonItem4.Text = "Ruby Project Page";
     //
     // menuButtonItem1
     //
     this.menuButtonItem1.BeginGroup = true;
     this.menuButtonItem1.Text       = "About...";
     this.menuButtonItem1.Activate  += new System.EventHandler(this.menuButtonItem1_Activate);
     //
     // aboutButton
     //
     this.aboutButton.BuddyMenu   = this.menuButtonItem1;
     this.aboutButton.IconSize    = new System.Drawing.Size(32, 32);
     this.aboutButton.Text        = "About";
     this.aboutButton.ToolTipText = "About";
     this.aboutButton.Activate   += new System.EventHandler(this.aboutButton_Activate);
     //
     // documentContainer1
     //
     this.documentContainer1.Controls.Add(this.dockControl1);
     this.documentContainer1.Controls.Add(this.dockControlOutput);
     this.documentContainer1.Guid         = new System.Guid("a1f0db60-29b8-4f8c-b3ca-0613232ae52d");
     this.documentContainer1.LayoutSystem = new TD.SandDock.SplitLayoutSystem(250, 400, System.Windows.Forms.Orientation.Horizontal, new TD.SandDock.LayoutSystemBase[] {
         ((TD.SandDock.LayoutSystemBase)(new TD.SandDock.DocumentLayoutSystem(606, 559, new TD.SandDock.DockControl[] {
             this.dockControl1,
             this.dockControlOutput
         }, this.dockControl1)))
     });
     this.documentContainer1.Location   = new System.Drawing.Point(0, 22);
     this.documentContainer1.Manager    = null;
     this.documentContainer1.Name       = "documentContainer1";
     this.documentContainer1.Renderer   = new TD.SandDock.Rendering.Office2003Renderer();
     this.documentContainer1.Size       = new System.Drawing.Size(608, 561);
     this.documentContainer1.TabIndex   = 15;
     this.documentContainer1.DragDrop  += new System.Windows.Forms.DragEventHandler(this.textScript_DragDrop);
     this.documentContainer1.DragEnter += new System.Windows.Forms.DragEventHandler(this.textScript_DragEnter);
     //
     // dockControl1
     //
     this.dockControl1.Controls.Add(this.panel1);
     this.dockControl1.Guid     = new System.Guid("804e5184-274f-4191-a3ab-346cf996384a");
     this.dockControl1.Location = new System.Drawing.Point(5, 33);
     this.dockControl1.Name     = "dockControl1";
     this.dockControl1.Size     = new System.Drawing.Size(598, 523);
     this.dockControl1.TabIndex = 0;
     this.dockControl1.Text     = "Recording";
     this.dockControl1.Closing += new System.ComponentModel.CancelEventHandler(this.dockControl1_Closing);
     //
     // panel1
     //
     this.panel1.Controls.Add(this.groupBox1);
     this.panel1.Controls.Add(this.splitter1);
     this.panel1.Controls.Add(this.groupBox2);
     this.panel1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.panel1.Location = new System.Drawing.Point(0, 0);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(598, 523);
     this.panel1.TabIndex = 8;
     //
     // groupBox1
     //
     this.groupBox1.Controls.Add(this.textScript);
     this.groupBox1.Dock       = System.Windows.Forms.DockStyle.Fill;
     this.groupBox1.Location   = new System.Drawing.Point(0, 0);
     this.groupBox1.Name       = "groupBox1";
     this.groupBox1.Size       = new System.Drawing.Size(598, 384);
     this.groupBox1.TabIndex   = 4;
     this.groupBox1.TabStop    = false;
     this.groupBox1.Text       = "Watir Test Code";
     this.groupBox1.DragOver  += new System.Windows.Forms.DragEventHandler(this.textScript_DragEnter);
     this.groupBox1.DragDrop  += new System.Windows.Forms.DragEventHandler(this.textScript_DragDrop);
     this.groupBox1.DragEnter += new System.Windows.Forms.DragEventHandler(this.textScript_DragEnter);
     //
     // textScript
     //
     this.textScript.AllowDrop   = true;
     this.textScript.ContextMenu = this.contextMenu1;
     this.textScript.DetectUrls  = false;
     this.textScript.Dock        = System.Windows.Forms.DockStyle.Fill;
     this.textScript.Font        = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.textScript.Location    = new System.Drawing.Point(3, 16);
     this.textScript.Name        = "textScript";
     this.textScript.Size        = new System.Drawing.Size(592, 365);
     this.textScript.TabIndex    = 1;
     this.textScript.Text        = "";
     this.textScript.DragDrop   += new System.Windows.Forms.DragEventHandler(this.textScript_DragDrop);
     this.textScript.DragEnter  += new System.Windows.Forms.DragEventHandler(this.textScript_DragEnter);
     //
     // splitter1
     //
     this.splitter1.Dock     = System.Windows.Forms.DockStyle.Bottom;
     this.splitter1.Location = new System.Drawing.Point(0, 384);
     this.splitter1.Name     = "splitter1";
     this.splitter1.Size     = new System.Drawing.Size(598, 3);
     this.splitter1.TabIndex = 6;
     this.splitter1.TabStop  = false;
     //
     // groupBox2
     //
     this.groupBox2.Controls.Add(this.lstEvents);
     this.groupBox2.Dock     = System.Windows.Forms.DockStyle.Bottom;
     this.groupBox2.Location = new System.Drawing.Point(0, 387);
     this.groupBox2.Name     = "groupBox2";
     this.groupBox2.Size     = new System.Drawing.Size(598, 136);
     this.groupBox2.TabIndex = 5;
     this.groupBox2.TabStop  = false;
     this.groupBox2.Text     = "Events";
     //
     // lstEvents
     //
     this.lstEvents.Dock           = System.Windows.Forms.DockStyle.Fill;
     this.lstEvents.Font           = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.lstEvents.IntegralHeight = false;
     this.lstEvents.ItemHeight     = 16;
     this.lstEvents.Location       = new System.Drawing.Point(3, 16);
     this.lstEvents.Name           = "lstEvents";
     this.lstEvents.Size           = new System.Drawing.Size(592, 117);
     this.lstEvents.TabIndex       = 2;
     //
     // dockControlOutput
     //
     this.dockControlOutput.Controls.Add(this.groupBox3);
     this.dockControlOutput.Controls.Add(this.btnSaveLog);
     this.dockControlOutput.Controls.Add(this.btnClear);
     this.dockControlOutput.Guid     = new System.Guid("e4b3c490-2cd9-4436-a969-ac697467fb4a");
     this.dockControlOutput.Location = new System.Drawing.Point(5, 33);
     this.dockControlOutput.Name     = "dockControlOutput";
     this.dockControlOutput.Size     = new System.Drawing.Size(598, 523);
     this.dockControlOutput.TabIndex = 1;
     this.dockControlOutput.Text     = "Standard Output Log";
     //
     // groupBox3
     //
     this.groupBox3.Controls.Add(this.rtbStdOutLog);
     this.groupBox3.Location = new System.Drawing.Point(0, 0);
     this.groupBox3.Name     = "groupBox3";
     this.groupBox3.Size     = new System.Drawing.Size(603, 460);
     this.groupBox3.TabIndex = 3;
     this.groupBox3.TabStop  = false;
     this.groupBox3.Text     = "Standard Output";
     //
     // rtbStdOutLog
     //
     this.rtbStdOutLog.Dock      = System.Windows.Forms.DockStyle.Fill;
     this.rtbStdOutLog.Enabled   = false;
     this.rtbStdOutLog.Font      = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
     this.rtbStdOutLog.ForeColor = System.Drawing.SystemColors.Desktop;
     this.rtbStdOutLog.Location  = new System.Drawing.Point(3, 16);
     this.rtbStdOutLog.Name      = "rtbStdOutLog";
     this.rtbStdOutLog.ReadOnly  = true;
     this.rtbStdOutLog.Size      = new System.Drawing.Size(597, 441);
     this.rtbStdOutLog.TabIndex  = 0;
     this.rtbStdOutLog.Text      = "";
     //
     // btnSaveLog
     //
     this.btnSaveLog.Location = new System.Drawing.Point(435, 466);
     this.btnSaveLog.Name     = "btnSaveLog";
     this.btnSaveLog.Size     = new System.Drawing.Size(75, 23);
     this.btnSaveLog.TabIndex = 2;
     this.btnSaveLog.Text     = "Save Log";
     this.btnSaveLog.UseVisualStyleBackColor = true;
     this.btnSaveLog.Click += new System.EventHandler(this.btnSaveLog_Click);
     //
     // btnClear
     //
     this.btnClear.Location = new System.Drawing.Point(516, 466);
     this.btnClear.Name     = "btnClear";
     this.btnClear.Size     = new System.Drawing.Size(75, 23);
     this.btnClear.TabIndex = 1;
     this.btnClear.Text     = "Clear";
     this.btnClear.UseVisualStyleBackColor = true;
     this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
     //
     // frmMain
     //
     this.AccessibleName    = "WatirRecorder#";
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(608, 605);
     this.Controls.Add(this.documentContainer1);
     this.Controls.Add(this.toolBar1);
     this.Controls.Add(this.statusBar1);
     this.Controls.Add(this.leftSandDock);
     this.Controls.Add(this.rightSandDock);
     this.Controls.Add(this.bottomSandDock);
     this.Controls.Add(this.topSandDock);
     this.Icon  = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Name  = "frmMain";
     this.Text  = "WatirRecorder#";
     this.Load += new System.EventHandler(this.frmMain_Load);
     ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).EndInit();
     this.documentContainer1.ResumeLayout(false);
     this.dockControl1.ResumeLayout(false);
     this.panel1.ResumeLayout(false);
     this.groupBox1.ResumeLayout(false);
     this.groupBox2.ResumeLayout(false);
     this.dockControlOutput.ResumeLayout(false);
     this.groupBox3.ResumeLayout(false);
     this.ResumeLayout(false);
 }
Exemplo n.º 43
0
        private void InitializeUI()
        {
            settings     = NavMeshGenerationSettings.Default;
            areaSettings = new AreaIdGenerationSettings();

            DockBase dock = new DockBase(gwenCanvas);

            dock.Dock = Pos.Fill;
            dock.SetSize(Width, Height);
            dock.RightDock.Width   = 280;
            dock.BottomDock.Height = 150;

            statusBar = new StatusBar(gwenCanvas);

            Label genTime = new Label(statusBar);

            genTime.Name = "GenTime";
            genTime.Text = "Generation Time: 0ms";
            genTime.Dock = Pos.Left;

            LabeledCheckBox catchCheckBox = new LabeledCheckBox(statusBar);

            catchCheckBox.Text          = "Intercept and log exceptions";
            catchCheckBox.Dock          = Pos.Right;
            catchCheckBox.CheckChanged += (s, e) => interceptExceptions = catchCheckBox.IsChecked;
            catchCheckBox.IsChecked     = true;

            Base genBase = new Base(dock);

            dock.RightDock.TabControl.AddPage("NavMesh Generation", genBase);

            Button generateButton = new Button(genBase);

            generateButton.Text      = "Generate!";
            generateButton.Height    = 30;
            generateButton.Dock      = Pos.Top;
            generateButton.Released += (s, e) => GenerateNavMesh();

            GroupBox displaySettings = new GroupBox(genBase);

            displaySettings.Text   = "Display";
            displaySettings.Dock   = Pos.Top;
            displaySettings.Height = 60;

            Base levelCheckBase = new Base(displaySettings);

            levelCheckBase.Dock = Pos.Top;

            Label levelCheckLabel = new Label(levelCheckBase);

            levelCheckLabel.Text = "Level";
            levelCheckLabel.Dock = Pos.Left;

            CheckBox levelCheckBox = new CheckBox(levelCheckBase);

            levelCheckBox.Dock       = Pos.Right;
            levelCheckBox.Checked   += (s, e) => displayLevel = true;
            levelCheckBox.UnChecked += (s, e) => displayLevel = false;
            levelCheckBox.IsChecked  = true;

            levelCheckBase.SizeToChildren();

            Base displayModeBase = new Base(displaySettings);

            displayModeBase.Dock    = Pos.Top;
            displayModeBase.Padding = new Padding(0, 4, 0, 0);

            Label displayModeLabel = new Label(displayModeBase);

            displayModeLabel.Text    = "Generation Step";
            displayModeLabel.Dock    = Pos.Left;
            displayModeLabel.Padding = new Padding(0, 0, 4, 0);

            ComboBox displayModes = new ComboBox(displayModeBase);

            displayModes.Dock = Pos.Top;
            displayModes.AddItem("None", "", DisplayMode.None);
            displayModes.AddItem("Heightfield", "", DisplayMode.Heightfield);
            displayModes.AddItem("Compact Heightfield", "", DisplayMode.CompactHeightfield);
            displayModes.AddItem("Distance Field", "", DisplayMode.DistanceField);
            displayModes.AddItem("Regions", "", DisplayMode.Regions);
            displayModes.AddItem("Contours", "", DisplayMode.Contours);
            displayModes.AddItem("Polygon Mesh", "", DisplayMode.PolyMesh);
            displayModes.AddItem("Polygon Mesh Detail", "", DisplayMode.PolyMeshDetail);
            displayModes.AddItem("NavMesh", "", DisplayMode.NavMesh);
            displayModes.AddItem("Pathfinding", "", DisplayMode.Pathfinding);
            displayModes.ItemSelected += (s, e) => displayMode = (DisplayMode)e.SelectedItem.UserData;

            displayModes.SelectByUserData(DisplayMode.PolyMeshDetail);

            displayModeBase.SizeToChildren();
            displayModeBase.Height += 4;             //accounts for the padding, GWEN.NET should do this

            const int leftMax  = 125;
            const int rightMax = 20;

            GroupBox areaSetting = new GroupBox(genBase);

            areaSetting.Text   = "Area";
            areaSetting.Dock   = Pos.Top;
            areaSetting.Height = 90;

            var   levelTris = level.GetTriangles();
            BBox3 bounds    = TriangleEnumerable.FromTriangle(levelTris, 0, levelTris.Length).GetBoundingBox();

            Base maxTriSlope    = CreateSliderOption(areaSetting, "Max Tri Slope:", 0.0001f, 3.14f, 3.14f, "N2", leftMax, rightMax, v => areaSettings.MaxTriSlope = v);
            Base minLevelHeight = CreateSliderOption(areaSetting, "Min Height:", bounds.Min.Y, bounds.Max.Y, bounds.Min.Y, "N0", leftMax, rightMax, v => areaSettings.MinLevelHeight = v);
            Base maxLevelHeight = CreateSliderOption(areaSetting, "Max Height:", bounds.Min.Y, bounds.Max.Y, bounds.Max.Y, "N0", leftMax, rightMax, v => areaSettings.MaxLevelHeight = v);

            GroupBox rsSettings = new GroupBox(genBase);

            rsSettings.Text   = "Rasterization";
            rsSettings.Dock   = Pos.Top;
            rsSettings.Height = 90;

            Base cellSizeSetting   = CreateSliderOption(rsSettings, "Cell Size:", 0.1f, 2.0f, 0.3f, "N2", leftMax, rightMax, v => settings.CellSize = v);
            Base cellHeightSetting = CreateSliderOption(rsSettings, "Cell Height:", 0.1f, 2f, 0.2f, "N2", leftMax, rightMax, v => settings.CellHeight = v);

            GroupBox agentSettings = new GroupBox(genBase);

            agentSettings.Text   = "Agent";
            agentSettings.Dock   = Pos.Top;
            agentSettings.Height = 115;

            Base maxSlopeSetting  = CreateSliderOption(agentSettings, "Max Climb:", 0.1f, 5.0f, 0.9f, "N0", leftMax, rightMax, v => settings.MaxClimb = v);
            Base maxHeightSetting = CreateSliderOption(agentSettings, "Height:", 0.1f, 5.0f, 2.0f, "N0", leftMax, rightMax, v => settings.AgentHeight = v);
            Base erodeRadius      = CreateSliderOption(agentSettings, "Radius:", 0.0f, 5.0f, 0.6f, "N1", leftMax, rightMax, v => { settings.AgentRadius = v; agentCylinder.Radius = v; });
            Base addRemoveAgent   = CreateAddRemoveButton(agentSettings, "Count", leftMax, rightMax, 0, MAX_AGENTS, () => { numActiveAgents++; GenerateCrowd(); }, () => { numActiveAgents--; GenerateCrowd(); });

            GroupBox regionSettings = new GroupBox(genBase);

            regionSettings.Text   = "Region";
            regionSettings.Dock   = Pos.Top;
            regionSettings.Height = 65;

            Base minRegionSize = CreateSliderOption(regionSettings, "Min Region Size:", 0f, 150f, 8f, "N0", leftMax, rightMax, v => settings.MinRegionSize = (int)Math.Round(v));
            Base mrgRegionSize = CreateSliderOption(regionSettings, "Merged Region Size:", 0f, 150f, 20f, "N0", leftMax, rightMax, v => settings.MergedRegionSize = (int)Math.Round(v));

            GroupBox navMeshSettings = new GroupBox(genBase);

            navMeshSettings.Text   = "NavMesh";
            navMeshSettings.Dock   = Pos.Top;
            navMeshSettings.Height = 90;

            Base maxEdgeLength = CreateSliderOption(navMeshSettings, "Max Edge Length:", 0f, 50f, 12f, "N0", leftMax, rightMax, v => settings.MaxEdgeLength = (int)Math.Round(v));
            Base maxEdgeErr    = CreateSliderOption(navMeshSettings, "Max Edge Error:", 0f, 3f, 1.8f, "N1", leftMax, rightMax, v => settings.MaxEdgeError = v);
            Base vertsPerPoly  = CreateSliderOption(navMeshSettings, "Verts Per Poly:", 3f, 12f, 6f, "N0", leftMax, rightMax, v => settings.VertsPerPoly = (int)Math.Round(v));

            GroupBox navMeshDetailSettings = new GroupBox(genBase);

            navMeshDetailSettings.Text   = "NavMeshDetail";
            navMeshDetailSettings.Dock   = Pos.Top;
            navMeshDetailSettings.Height = 65;

            Base sampleDistance = CreateSliderOption(navMeshDetailSettings, "Sample Distance:", 0f, 16f, 6f, "N0", leftMax, rightMax, v => settings.SampleDistance = (int)Math.Round(v));
            Base maxSampleError = CreateSliderOption(navMeshDetailSettings, "Max Sample Error:", 0f, 16f, 1f, "N0", leftMax, rightMax, v => settings.MaxSampleError = (int)Math.Round(v));

            Base logBase = new Base(dock);

            dock.BottomDock.TabControl.AddPage("Log", logBase);

            ListBox logBox = new ListBox(logBase);

            logBox.Dock             = Pos.Fill;
            logBox.AllowMultiSelect = false;
            logBox.EnableScroll(true, true);
            Console.SetOut(new GwenTextWriter(logBox));
        }
Exemplo n.º 44
0
 private void UpdateStatusBarText(string msg)
 {
     BeginInvoke(new Action(() => { SbarLbl.Text = msg; StatusBar.Update(); }));
 }
Exemplo n.º 45
0
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        private void DisableAllButtons(bool activate)
        {
            for (int i = 0; i < AllButtons.Length; i++)
            {
                if (AllButtons[i].InvokeRequired)
                {
                    AllButtons[i].Invoke(new Action(() =>
                    {
                        AllButtons[i].Enabled = activate;
                    }));
                }
                else
                {
                    AllButtons[i].Enabled = activate;
                }
            }
            for (int i = 0; i < AllCheckBoxes.Length; i++)
            {
                if (AllCheckBoxes[i].InvokeRequired)
                {
                    AllCheckBoxes[i].Invoke(new Action(() =>
                    {
                        if (!activate)
                        {
                            AllCheckBoxes[i].Tag     = AllCheckBoxes[i].Enabled;
                            AllCheckBoxes[i].Enabled = false;
                        }
                        else if ((bool)AllCheckBoxes[i].Tag)
                        {
                            AllCheckBoxes[i].Enabled = true;
                        }
                    }));
                }
                else
                {
                    if (!activate)
                    {
                        AllCheckBoxes[i].Tag     = AllCheckBoxes[i].Enabled;
                        AllCheckBoxes[i].Enabled = false;
                    }
                    else if ((bool)AllCheckBoxes[i].Tag)
                    {
                        AllCheckBoxes[i].Enabled = true;
                    }
                }
            }
            if (activate)
            {
                if (StatusBar.InvokeRequired)
                {
                    StatusBar.Invoke(new Action(() =>
                    {
                        StatusBar.Visible = false;
                    }));
                }
                else
                {
                    StatusBar.Visible = false;
                }
            }
        }
Exemplo n.º 46
0
        private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            try
            {
                if (e.NavigationParameter != null)
                {
                    this.LockScreenPreviewViewModel.Post = Post.FromXml(e.NavigationParameter as string);
                }
            }
            catch (Exception ex)
            {
            }



            ApplicationView.GetForCurrentView().SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow);
            IsFullScreenEnabled = ApplicationView.GetForCurrentView().TryEnterFullScreenMode();
            ApplicationView.GetForCurrentView().SuppressSystemOverlays      = true;
            ApplicationView.GetForCurrentView().FullScreenSystemOverlayMode = FullScreenSystemOverlayMode.Minimal;

            if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar") && StatusBar.GetForCurrentView() != null)
            {
                DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait;
                await StatusBar.GetForCurrentView().ShowAsync();
            }
            else
            {
                ApplicationView.GetForCurrentView().VisibleBoundsChanged += LockScreenPreviewPage_VisibleBoundsChanged;
            }
        }
Exemplo n.º 47
0
 public Login()
 {
     this.InitializeComponent();
     StatusBar.GetForCurrentView().BackgroundColor = Windows.UI.Color.FromArgb(1, 38, 92, 170);
     Init();
 }
Exemplo n.º 48
0
        private async void Page_Loaded(object sender, RoutedEventArgs e)
        {
            if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape;
                await StatusBar.GetForCurrentView().HideAsync();
            }
            else
            {
                WindowManager.HandleTitleBarForGrid(topGrid);
            }

            if (_model.StorageFile == null)
            {
                await UIUtilities.ShowErrorDialogAsync("This clip cannot be edited.", "Currently, you can only edit video clips from files. Sorry!");

                Close();
                return;
            }

            if (_model.Composition == null)
            {
                _createdNew = true;

                var name = Path.ChangeExtension(_model.StorageFile.Name, "uni-cmp");
                try
                {
                    _model.CompositionFile = _model.CompositionFile ?? await ApplicationData.Current.LocalFolder.GetFileAsync(name);

                    if (await UIUtilities.ShowYesNoDialogAsync("Load previous edit?", "It looks like you've edited this file before, do you want to load your previous edits?"))
                    {
                        _model.Composition = await MediaComposition.LoadAsync(_model.CompositionFile);
                    }
                    else
                    {
                        _model.Composition = new MediaComposition();
                    }
                }
                catch
                {
                    _model.Composition = new MediaComposition();
                }
            }

            if (_model.Composition.Clips.Count == 0)
            {
                var clip = await MediaClip.CreateFromFileAsync(_model.StorageFile);

                _model.Composition.Clips.Add(clip);
                _model.Clip = clip;
            }
            else
            {
                _model.Clip = _model.Composition.Clips.First();
            }

            rangeSelector.Maximum  = _model.Clip.OriginalDuration.TotalSeconds;
            rangeSelector.RangeMin = _model.Clip.TrimTimeFromStart.TotalSeconds;
            rangeSelector.RangeMax = _model.Clip.OriginalDuration.TotalSeconds - _model.Clip.TrimTimeFromEnd.TotalSeconds;
            rangeSelector.Value    = rangeSelector.RangeMin;
            startPointText.Text    = _model.Clip.TrimTimeFromStart.ToString("mm\\:ss");
            endPointText.Text      = (_model.Clip.OriginalDuration - _model.Clip.TrimTimeFromEnd).ToString("mm\\:ss");

            _ready = true;
            UpdateMediaElementSource();
        }
 void OnStatusBarShowing(StatusBar sender, object args)
 {
     UpdatePageSizes();
 }
Exemplo n.º 50
0
 public async void Dispose()
 {
     if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
     {
         statusBar.BackgroundOpacity = 0;
         this.statusBar = null;
         HardwareButtons.BackPressed -= HardwareButtons_BackPressed;
         this.inputPane.Showing      -= InputPane_Showing;
         this.inputPane.Hiding       -= InputPane_Hiding;
         this.inputPane                 = null;
         richTextBox.GotFocus          -= RichTextBox_GotFocus;
         richTextBox.Tapped            -= RichTextBox_Tapped;
         richTextBox.ZoomFactorChanged -= RichTextBox_ZoomFactorChanged;
         ribbon.RibbonTabPanelOpened   -= Ribbon_RibbonTabPanelOpened;
         ribbon.RibbonTabPanelClosed   -= Ribbon_RibbonTabPanelClosed;
     }
     ribbon.BackStageOpened -= Ribbon_BackStageOpened;
     ribbon.BackStageClosed -= Ribbon_BackStageClosed;
     this.Unloaded          -= DocumentEditor_Unloaded;
     this.Loaded            -= DocumentEditor_Loaded;
     if (highlightcolorpicker != null)
     {
         this.highlightcolorpicker.HighlightColorGridView.SelectionChanged -= HighlightColorGridView_SelectionChanged;
         this.highlightcolorpicker.HighlightColorGridView.SetBinding(GridView.SelectedIndexProperty, new Binding());
     }
     this.highlightcolorpicker = null;
     //Handled to cancel the asynchronous load operation.
     if (loadAsync != null && !loadAsync.IsCompleted && !loadAsync.IsFaulted && cancellationTokenSource != null)
     {
         cancellationTokenSource.Cancel();
         try
         {
             await loadAsync;
         }
         catch
         { }
     }
     this.richTextBox.PrintCompleted   -= RichTextBoxAdv_PrintCompleted;
     this.richTextBox.RequestNavigate  -= RichTextBoxAdv_RequestNavigate;
     this.richTextBox.SelectionChanged -= RichTextBox_SelectionChanged;
     this.richTextBox.ContentChanged   -= RichTextBox_ContentChanged;
     //Disposes the SfRichTextBoxAdv contents explicitly.
     this.richTextBox.Dispose();
     printDocumentSource = null;
     this.richTextBox    = null;
     //Un hook backstage events
     printBackStageButton.Click -= PrintDocument_OnClick;
     printBackStageButton.Dispose();
     openBackStageButton.Click -= WordImport_Click;
     openBackStageButton.Dispose();
     openBackStageButton          = null;
     saveAsBackStageButton.Click -= WordExport_Click;
     saveAsBackStageButton.Dispose();
     saveAsBackStageButton       = null;
     helpBackaStageButton.Click -= HelpButton_Clicked;
     helpBackaStageButton.Dispose();
     helpBackaStageButton = null;
     //Disposing the BackStage
     this.ribbon.BackStage.Dispose();
     //Disposing the QAT
     this.ribbon.QuickAccessToolBar.Dispose();
     //Disposing the Ribbon.
     this.ribbon.Dispose();
     //Disposing the RibbonPage
     if (!Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
     {
         this.ribbonPage.Dispose();
     }
     mainGrid.Resources.Clear();
     mainGrid.Resources = null;
     this.Resources.Clear();
     this.Resources = null;
     busy.ClearValue(ProgressBar.IsIndeterminateProperty);
     busy.ClearValue(ProgressBar.ForegroundProperty);
     busy.ClearValue(ProgressBar.VerticalAlignmentProperty);
     UnlinkChildrens(this);
     UnlinkChildrens(this.ribbon.BackStage);
 }
Exemplo n.º 51
0
        private async void NavigationHelper_SaveState(object sender, SaveStateEventArgs e)
        {
            ApplicationView.GetForCurrentView().SetDesiredBoundsMode(ApplicationViewBoundsMode.UseVisible);
            ApplicationView.GetForCurrentView().ExitFullScreenMode();
            ApplicationView.GetForCurrentView().SuppressSystemOverlays      = false;
            ApplicationView.GetForCurrentView().FullScreenSystemOverlayMode = FullScreenSystemOverlayMode.Minimal;


            if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar") && StatusBar.GetForCurrentView() != null)
            {
                await StatusBar.GetForCurrentView().HideAsync();

                DisplayInformation.AutoRotationPreferences = (DisplayOrientations)15;
            }

            ApplicationView.GetForCurrentView().VisibleBoundsChanged -= LockScreenPreviewPage_VisibleBoundsChanged;
        }
Exemplo n.º 52
0
        public void Application_Top_EnsureVisibleBounds_To_Driver_Rows_And_Cols()
        {
            var iterations = 0;

            Application.Iteration += () => {
                if (iterations == 0)
                {
                    Assert.Equal("Top1", Application.Top.Text);
                    Assert.Equal(0, Application.Top.Frame.X);
                    Assert.Equal(0, Application.Top.Frame.Y);
                    Assert.Equal(Application.Driver.Cols, Application.Top.Frame.Width);
                    Assert.Equal(Application.Driver.Rows, Application.Top.Frame.Height);

                    Application.Top.ProcessHotKey(new KeyEvent(Key.CtrlMask | Key.R, new KeyModifiers()));
                }
                else if (iterations == 1)
                {
                    Assert.Equal("Top2", Application.Top.Text);
                    Assert.Equal(0, Application.Top.Frame.X);
                    Assert.Equal(0, Application.Top.Frame.Y);
                    Assert.Equal(Application.Driver.Cols, Application.Top.Frame.Width);
                    Assert.Equal(Application.Driver.Rows, Application.Top.Frame.Height);

                    Application.Top.ProcessHotKey(new KeyEvent(Key.CtrlMask | Key.C, new KeyModifiers()));
                }
                else if (iterations == 3)
                {
                    Assert.Equal("Top1", Application.Top.Text);
                    Assert.Equal(0, Application.Top.Frame.X);
                    Assert.Equal(0, Application.Top.Frame.Y);
                    Assert.Equal(Application.Driver.Cols, Application.Top.Frame.Width);
                    Assert.Equal(Application.Driver.Rows, Application.Top.Frame.Height);

                    Application.Top.ProcessHotKey(new KeyEvent(Key.CtrlMask | Key.R, new KeyModifiers()));
                }
                else if (iterations == 4)
                {
                    Assert.Equal("Top2", Application.Top.Text);
                    Assert.Equal(0, Application.Top.Frame.X);
                    Assert.Equal(0, Application.Top.Frame.Y);
                    Assert.Equal(Application.Driver.Cols, Application.Top.Frame.Width);
                    Assert.Equal(Application.Driver.Rows, Application.Top.Frame.Height);

                    Application.Top.ProcessHotKey(new KeyEvent(Key.CtrlMask | Key.C, new KeyModifiers()));
                }
                else if (iterations == 6)
                {
                    Assert.Equal("Top1", Application.Top.Text);
                    Assert.Equal(0, Application.Top.Frame.X);
                    Assert.Equal(0, Application.Top.Frame.Y);
                    Assert.Equal(Application.Driver.Cols, Application.Top.Frame.Width);
                    Assert.Equal(Application.Driver.Rows, Application.Top.Frame.Height);

                    Application.Top.ProcessHotKey(new KeyEvent(Key.CtrlMask | Key.Q, new KeyModifiers()));
                }
                iterations++;
            };

            Application.Run(Top1());

            Toplevel Top1()
            {
                var top = Application.Top;

                top.Text = "Top1";
                var menu = new MenuBar(new MenuBarItem [] {
                    new MenuBarItem("_Options", new MenuItem [] {
                        new MenuItem("_Run Top2", "", () => Application.Run(Top2()), null, null, Key.CtrlMask | Key.R),
                        new MenuItem("_Quit", "", () => Application.RequestStop(), null, null, Key.CtrlMask | Key.Q)
                    })
                });

                top.Add(menu);

                var statusBar = new StatusBar(new [] {
                    new StatusItem(Key.CtrlMask | Key.R, "~^R~ Run Top2", () => Application.Run(Top2())),
                    new StatusItem(Key.CtrlMask | Key.Q, "~^Q~ Quit", () => Application.RequestStop())
                });

                top.Add(statusBar);

                var t1 = new Toplevel();

                top.Add(t1);

                return(top);
            }

            Toplevel Top2()
            {
                var top = new Toplevel(Application.Top.Frame);

                top.Text = "Top2";
                var win = new Window()
                {
                    Width = Dim.Fill(), Height = Dim.Fill()
                };
                var menu = new MenuBar(new MenuBarItem [] {
                    new MenuBarItem("_Stage", new MenuItem [] {
                        new MenuItem("_Close", "", () => Application.RequestStop(), null, null, Key.CtrlMask | Key.C)
                    })
                });

                top.Add(menu);

                var statusBar = new StatusBar(new [] {
                    new StatusItem(Key.CtrlMask | Key.C, "~^C~ Close", () => Application.RequestStop()),
                });

                top.Add(statusBar);

                win.Add(new ListView()
                {
                    X      = 0,
                    Y      = 0,
                    Width  = Dim.Fill(),
                    Height = Dim.Fill()
                });
                top.Add(win);

                return(top);
            }
        }
Exemplo n.º 53
0
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                DebugSettings.EnableFrameRateCounter = true;
            }
#endif
            //Desktop
            if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.ApplicationView"))
            {
                var titleBar = ApplicationView.GetForCurrentView().TitleBar;

                if (titleBar != null)
                {
                    titleBar.BackgroundColor       = Color.FromArgb(255, 230, 24, 115);
                    titleBar.ForegroundColor       = Colors.White;
                    titleBar.ButtonBackgroundColor = Color.FromArgb(255, 230, 24, 115);
                    titleBar.ButtonForegroundColor = Colors.White;
                }
            }

            //Mobile
            if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                var statusBar = StatusBar.GetForCurrentView();

                if (statusBar != null)
                {
                    statusBar.BackgroundColor   = Color.FromArgb(255, 230, 24, 115);
                    statusBar.ForegroundColor   = Colors.White;
                    statusBar.BackgroundOpacity = 1;
                }
            }

            var rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                HockeyClient.Current.Configure("2c53364256a4443da145fda334b9c3d8");

                Insights.Initialize("416420e0a779226dd8a0b72004d24af465e6a844");
                Xamarin.Forms.Forms.Init(e);
                ImageCircleRenderer.Init();
                Xamarin.Forms.DependencyService.Register <SocialAuthUWP>();

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (e.PrelaunchActivated == false)
            {
                if (rootFrame.Content == null)
                {
                    // When the navigation stack isn't restored navigate to the first page,
                    // configuring the new page by passing required information as a navigation
                    // parameter
                    rootFrame.Navigate(typeof(MainPage), e.Arguments);
                }
                // Ensure the current window is active
                Window.Current.Activate();
            }
        }
Exemplo n.º 54
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                var statusbar = StatusBar.GetForCurrentView();
                statusbar.BackgroundColor = new Windows.UI.Color()
                {
                    R = 115, G = 143, B = 186
                };
                statusbar.BackgroundOpacity = 1;
                statusbar.ForegroundColor   = Windows.UI.Colors.White;
            }

            int    paramIndex = e.Parameter.ToString().IndexOf("|");
            string strId      = e.Parameter.ToString().Substring(0, paramIndex);
            string type       = e.Parameter.ToString().Substring(paramIndex + 1);

            Cast      = new ObservableCollection <ExtendedVideoCast>();
            IsLoading = true;

            try
            {
                int id = int.Parse(strId);

                VideoCast[] cast;
                if (type.Equals("episode", StringComparison.OrdinalIgnoreCase))
                {
                    var episode = await App.Context.Connection.Kodi.VideoLibrary.GetEpisodeDetailsAsync(id, VideoFieldsEpisode.cast);

                    cast = episode.EpisodeDetails.Cast;
                }
                else if (type.Equals("tvshow", StringComparison.OrdinalIgnoreCase))
                {
                    var tvShow = await App.Context.Connection.Kodi.VideoLibrary.GetTvShowDetailsAsync(id, VideoFieldsTVShow.cast);

                    cast = tvShow.TvShowDetails.Cast;
                }
                else if (type.Equals("movie", StringComparison.OrdinalIgnoreCase))
                {
                    var movie = await App.Context.Connection.Kodi.VideoLibrary.GetMovieDetailsAsync(id, VideoFieldsMovie.cast);

                    cast = movie.Cast;
                }
                else
                {
                    if (Frame.CanGoBack)
                    {
                        Frame.GoBack();
                    }

                    return;
                }

                foreach (var c in cast)
                {
                    Cast.Add(new ExtendedVideoCast(c));
                }
            }
            catch (Exception ex)
            {
                App.TrackException(ex);
                var dialog = new MessageDialog(_resourceLoader.GetString("GlobalErrorMessage"), _resourceLoader.GetString("ApplicationTitle"));
                await dialog.ShowAsync();
            }
            finally
            {
                IsLoading = false;
            }
        }
Exemplo n.º 55
0
        public MainToolbarController(IMainToolbarView toolbarView)
        {
            ToolbarView = toolbarView;
            // Attach run button click handler.
            toolbarView.RunButtonClicked += HandleStartButtonClicked;

            // Register Search Entry handlers.
            ToolbarView.SearchEntryChanged    += HandleSearchEntryChanged;
            ToolbarView.SearchEntryActivated  += HandleSearchEntryActivated;
            ToolbarView.SearchEntryKeyPressed += HandleSearchEntryKeyPressed;
            ToolbarView.SearchEntryResized    += (o, e) => PositionPopup();
            ToolbarView.SearchEntryLostFocus  += (o, e) => {
                ToolbarView.SearchText = "";
                DestroyPopup();
            };

            toolbarView.ConfigurationChanged    += HandleConfigurationChanged;
            toolbarView.RunConfigurationChanged += HandleRunConfigurationChanged;
            toolbarView.RuntimeChanged          += HandleRuntimeChanged;

            IdeApp.Workbench.RootWindow.WidgetEvent += delegate(object o, WidgetEventArgs args) {
                if (args.Event is Gdk.EventConfigure)
                {
                    PositionPopup();
                }
            };

            // Update Search Entry on keybinding change.
            var cmd = IdeApp.CommandService.GetCommand(Commands.NavigateTo);

            cmd.KeyBindingChanged += delegate {
                UpdateSearchEntryLabel();
            };

            executionTargetsChanged = (sender, e) => UpdateCombos();

            IdeApp.ProjectOperations.CurrentSelectedSolutionChanged += HandleCurrentSelectedSolutionChanged;

            IdeApp.Workspace.FirstWorkspaceItemRestored += (sender, e) => {
                IdeApp.Workspace.ConfigurationsChanged      += HandleUpdateCombos;
                IdeApp.Workspace.ActiveConfigurationChanged += HandleUpdateCombos;

                IdeApp.Workspace.SolutionLoaded   += HandleSolutionLoaded;
                IdeApp.Workspace.SolutionUnloaded += HandleUpdateCombos;
                IdeApp.ProjectOperations.CurrentSelectedSolutionChanged += HandleUpdateCombos;

                UpdateCombos();
            };

            IdeApp.Workspace.LastWorkspaceItemClosed += (sender, e) => {
                IdeApp.Workspace.ConfigurationsChanged      -= HandleUpdateCombos;
                IdeApp.Workspace.ActiveConfigurationChanged -= HandleUpdateCombos;

                IdeApp.Workspace.SolutionLoaded   -= HandleSolutionLoaded;
                IdeApp.Workspace.SolutionUnloaded -= HandleUpdateCombos;

                IdeApp.ProjectOperations.CurrentSelectedSolutionChanged -= HandleUpdateCombos;

                StatusBar.ShowReady();
            };

            AddinManager.ExtensionChanged += OnExtensionChanged;
        }
Exemplo n.º 56
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     progressbar = StatusBar.GetForCurrentView().ProgressIndicator;
     this.navigationHelper.OnNavigatedTo(e);
 }
Exemplo n.º 57
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.label1             = new System.Windows.Forms.Label();
     this._displayName       = new System.Windows.Forms.TextBox();
     this._resourceType      = new System.Windows.Forms.TextBox();
     this.label2             = new System.Windows.Forms.Label();
     this._properties        = new System.Windows.Forms.ListView();
     this.columnHeader1      = new System.Windows.Forms.ColumnHeader();
     this.columnHeader2      = new System.Windows.Forms.ColumnHeader();
     this.columnHeader4      = new System.Windows.Forms.ColumnHeader();
     this.columnHeader3      = new System.Windows.Forms.ColumnHeader();
     this.contextMenu1       = new System.Windows.Forms.ContextMenu();
     this.menuItem1          = new System.Windows.Forms.MenuItem();
     this.menuItem2          = new System.Windows.Forms.MenuItem();
     this.panel1             = new System.Windows.Forms.Panel();
     this._btnDeleteProperty = new System.Windows.Forms.Button();
     this._refresh           = new System.Windows.Forms.Button();
     this._traceProps        = new System.Windows.Forms.Button();
     this._btnDeleteResource = new System.Windows.Forms.Button();
     this._btnClose          = new System.Windows.Forms.Button();
     this._showLinks         = new System.Windows.Forms.CheckBox();
     this._btnCopy           = new System.Windows.Forms.Button();
     this.panel2             = new System.Windows.Forms.Panel();
     this._traceBox          = new System.Windows.Forms.ListBox();
     this.splitter1          = new System.Windows.Forms.Splitter();
     this._statusBar         = new System.Windows.Forms.StatusBar();
     this._setPropButton     = new System.Windows.Forms.Button();
     this.panel1.SuspendLayout();
     this.panel2.SuspendLayout();
     this.SuspendLayout();
     //
     // label1
     //
     this.label1.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.label1.Location  = new System.Drawing.Point(8, 12);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(80, 17);
     this.label1.TabIndex  = 0;
     this.label1.Text      = "Display name:";
     //
     // _displayName
     //
     this._displayName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                      | System.Windows.Forms.AnchorStyles.Right)));
     this._displayName.Location = new System.Drawing.Point(88, 8);
     this._displayName.Name     = "_displayName";
     this._displayName.ReadOnly = true;
     this._displayName.Size     = new System.Drawing.Size(392, 21);
     this._displayName.TabIndex = 1;
     this._displayName.Text     = "";
     //
     // _resourceType
     //
     this._resourceType.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                       | System.Windows.Forms.AnchorStyles.Right)));
     this._resourceType.Location = new System.Drawing.Point(88, 36);
     this._resourceType.Name     = "_resourceType";
     this._resourceType.ReadOnly = true;
     this._resourceType.Size     = new System.Drawing.Size(392, 21);
     this._resourceType.TabIndex = 3;
     this._resourceType.Text     = "";
     //
     // label2
     //
     this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.label2.Location  = new System.Drawing.Point(8, 40);
     this.label2.Name      = "label2";
     this.label2.Size      = new System.Drawing.Size(80, 16);
     this.label2.TabIndex  = 2;
     this.label2.Text      = "Resource type:";
     //
     // _properties
     //
     this._properties.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
         this.columnHeader1,
         this.columnHeader2,
         this.columnHeader4,
         this.columnHeader3
     });
     this._properties.ContextMenu           = this.contextMenu1;
     this._properties.Dock                  = System.Windows.Forms.DockStyle.Top;
     this._properties.FullRowSelect         = true;
     this._properties.Location              = new System.Drawing.Point(0, 0);
     this._properties.Name                  = "_properties";
     this._properties.Size                  = new System.Drawing.Size(592, 232);
     this._properties.Sorting               = System.Windows.Forms.SortOrder.Ascending;
     this._properties.TabIndex              = 4;
     this._properties.View                  = System.Windows.Forms.View.Details;
     this._properties.DoubleClick          += new System.EventHandler(this.OnDoubleClick);
     this._properties.SelectedIndexChanged += new System.EventHandler(this._properties_SelectedIndexChanged);
     //
     // columnHeader1
     //
     this.columnHeader1.Text  = "Name";
     this.columnHeader1.Width = 92;
     //
     // columnHeader2
     //
     this.columnHeader2.Text  = "Type";
     this.columnHeader2.Width = 107;
     //
     // columnHeader4
     //
     this.columnHeader4.Text  = "Dir";
     this.columnHeader4.Width = 40;
     //
     // columnHeader3
     //
     this.columnHeader3.Text  = "Value";
     this.columnHeader3.Width = 242;
     //
     // contextMenu1
     //
     this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.menuItem1,
         this.menuItem2
     });
     //
     // menuItem1
     //
     this.menuItem1.Index  = 0;
     this.menuItem1.Text   = "Show Blob As Picture";
     this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click);
     //
     // menuItem2
     //
     this.menuItem2.Index  = 1;
     this.menuItem2.Text   = "Show BlobAs Text";
     this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
     //
     // panel1
     //
     this.panel1.Controls.Add(this._setPropButton);
     this.panel1.Controls.Add(this._btnDeleteProperty);
     this.panel1.Controls.Add(this._refresh);
     this.panel1.Controls.Add(this._traceProps);
     this.panel1.Controls.Add(this._btnDeleteResource);
     this.panel1.Controls.Add(this._btnClose);
     this.panel1.Controls.Add(this._showLinks);
     this.panel1.Controls.Add(this._btnCopy);
     this.panel1.Controls.Add(this._resourceType);
     this.panel1.Controls.Add(this._displayName);
     this.panel1.Controls.Add(this.label2);
     this.panel1.Controls.Add(this.label1);
     this.panel1.Dock     = System.Windows.Forms.DockStyle.Top;
     this.panel1.Location = new System.Drawing.Point(0, 0);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(592, 104);
     this.panel1.TabIndex = 5;
     //
     // _btnDeleteProperty
     //
     this._btnDeleteProperty.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this._btnDeleteProperty.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this._btnDeleteProperty.Location  = new System.Drawing.Point(368, 76);
     this._btnDeleteProperty.Name      = "_btnDeleteProperty";
     this._btnDeleteProperty.Size      = new System.Drawing.Size(108, 23);
     this._btnDeleteProperty.TabIndex  = 10;
     this._btnDeleteProperty.Text      = "Delete Property";
     this._btnDeleteProperty.Click    += new System.EventHandler(this._btnDeleteProperty_Click);
     //
     // _refresh
     //
     this._refresh.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this._refresh.Enabled   = false;
     this._refresh.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this._refresh.Location  = new System.Drawing.Point(96, 76);
     this._refresh.Name      = "_refresh";
     this._refresh.TabIndex  = 9;
     this._refresh.Text      = "Refresh";
     this._refresh.Click    += new System.EventHandler(this.OnRefresh);
     //
     // _traceProps
     //
     this._traceProps.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this._traceProps.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this._traceProps.Location  = new System.Drawing.Point(176, 76);
     this._traceProps.Name      = "_traceProps";
     this._traceProps.TabIndex  = 8;
     this._traceProps.Text      = "Trace";
     this._traceProps.Click    += new System.EventHandler(this.OnTrace);
     //
     // _btnDeleteResource
     //
     this._btnDeleteResource.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this._btnDeleteResource.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this._btnDeleteResource.Location  = new System.Drawing.Point(256, 76);
     this._btnDeleteResource.Name      = "_btnDeleteResource";
     this._btnDeleteResource.Size      = new System.Drawing.Size(108, 23);
     this._btnDeleteResource.TabIndex  = 7;
     this._btnDeleteResource.Text      = "Delete Resource";
     this._btnDeleteResource.Click    += new System.EventHandler(this.OnDeleteResource);
     //
     // _btnClose
     //
     this._btnClose.Anchor       = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this._btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     this._btnClose.FlatStyle    = System.Windows.Forms.FlatStyle.System;
     this._btnClose.Location     = new System.Drawing.Point(500, 36);
     this._btnClose.Name         = "_btnClose";
     this._btnClose.Size         = new System.Drawing.Size(75, 24);
     this._btnClose.TabIndex     = 6;
     this._btnClose.Text         = "Close";
     this._btnClose.Click       += new System.EventHandler(this.OnClose);
     //
     // _showLinks
     //
     this._showLinks.FlatStyle       = System.Windows.Forms.FlatStyle.System;
     this._showLinks.Location        = new System.Drawing.Point(8, 64);
     this._showLinks.Name            = "_showLinks";
     this._showLinks.Size            = new System.Drawing.Size(128, 16);
     this._showLinks.TabIndex        = 5;
     this._showLinks.Text            = "Show links:";
     this._showLinks.CheckedChanged += new System.EventHandler(this._showLinks_CheckedChanged);
     //
     // _btnCopy
     //
     this._btnCopy.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this._btnCopy.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this._btnCopy.Location  = new System.Drawing.Point(500, 8);
     this._btnCopy.Name      = "_btnCopy";
     this._btnCopy.Size      = new System.Drawing.Size(75, 24);
     this._btnCopy.TabIndex  = 4;
     this._btnCopy.Text      = "Copy";
     this._btnCopy.Click    += new System.EventHandler(this._btnCopy_Click);
     //
     // panel2
     //
     this.panel2.Controls.Add(this._traceBox);
     this.panel2.Controls.Add(this.splitter1);
     this.panel2.Controls.Add(this._properties);
     this.panel2.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.panel2.Location = new System.Drawing.Point(0, 104);
     this.panel2.Name     = "panel2";
     this.panel2.Size     = new System.Drawing.Size(592, 416);
     this.panel2.TabIndex = 6;
     //
     // _traceBox
     //
     this._traceBox.Dock     = System.Windows.Forms.DockStyle.Fill;
     this._traceBox.Font     = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
     this._traceBox.Location = new System.Drawing.Point(0, 235);
     this._traceBox.Name     = "_traceBox";
     this._traceBox.Size     = new System.Drawing.Size(592, 173);
     this._traceBox.TabIndex = 6;
     //
     // splitter1
     //
     this.splitter1.Dock     = System.Windows.Forms.DockStyle.Top;
     this.splitter1.Location = new System.Drawing.Point(0, 232);
     this.splitter1.Name     = "splitter1";
     this.splitter1.Size     = new System.Drawing.Size(592, 3);
     this.splitter1.TabIndex = 5;
     this.splitter1.TabStop  = false;
     //
     // _statusBar
     //
     this._statusBar.Location = new System.Drawing.Point(0, 520);
     this._statusBar.Name     = "_statusBar";
     this._statusBar.Size     = new System.Drawing.Size(592, 22);
     this._statusBar.TabIndex = 5;
     //
     // _setPropButton
     //
     this._setPropButton.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this._setPropButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this._setPropButton.Location  = new System.Drawing.Point(480, 76);
     this._setPropButton.Name      = "_setPropButton";
     this._setPropButton.Size      = new System.Drawing.Size(96, 23);
     this._setPropButton.TabIndex  = 11;
     this._setPropButton.Text      = "Set Property";
     this._setPropButton.Click    += new System.EventHandler(this._setPropButton_Click);
     //
     // ResourcePropertiesDialog
     //
     this.AcceptButton      = this._btnClose;
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
     this.CancelButton      = this._btnClose;
     this.ClientSize        = new System.Drawing.Size(592, 542);
     this.Controls.Add(this.panel2);
     this.Controls.Add(this.panel1);
     this.Controls.Add(this._statusBar);
     this.MinimumSize   = new System.Drawing.Size(544, 336);
     this.Name          = "ResourcePropertiesDialog";
     this.ShowInTaskbar = true;
     this.Text          = "Resource Properties";
     this.panel1.ResumeLayout(false);
     this.panel2.ResumeLayout(false);
     this.ResumeLayout(false);
 }
Exemplo n.º 58
0
        public void loadObjMan()
        {
            MapGridBlock = Content.Load <Texture2D>(@"MapParts\OmniRax-Map_Entarya");
            Grid         = new MovementGrid(GameRef.ScreenRectangle, 32, 32, MapGridBlock, Level);
            BaseGrid     = Grid.SourceList;
            ObjManager   = new OmniLibrary.ObjectManager(base.menuFont, lstTexMageProjectile, Grid, lstTexCoins);
            if (Level == 0)
            {
                //LandScape = new MapLandscape(lstTexMaps[0], GameRef.ScreenRectangle, 0, spawn, waypoints);
            }
            else if (Level == 1)
            {
                //LandScape = new MapLandscape(lstTexMaps[1], lstTexMaps[2], GameRef.ScreenRectangle, 0, spawn, waypoints);
            }
            else if (Level == 2)
            {
                //LandScape = new MapLandscape(lstTexMaps[3], lstTexMaps[4], GameRef.ScreenRectangle, 0, spawn, waypoints);
            }
            else if (Level == 3)
            {
                //LandScape = new MapLandscape(lstTexMaps[5], lstTexMaps[6], GameRef.ScreenRectangle, 0, spawn, waypoints);
            }

            texGameOver               = Content.Load <Texture2D>(@"Ui Content\GameOver 1");
            pbGameOver                = new PictureBox(texGameOver, GameRef.ScreenRectangle, 1, 1, 0);
            pbGameOver.obj_Selected  += new EventHandler(YouLose);
            pbGameOver.obj_MouseOver += new EventHandler(pbExit_obj_MouseOver);
            pbGameOver.obj_Leave     += new EventHandler(pbExit_obj_Leave);
            texExit                     = Content.Load <Texture2D>(@"Ui Content\GamePlay\Exit");
            pbExit                      = new PictureBox(texExit, new Rectangle(GameRef.ScreenRectangle.Width - texExit.Width / 2 - 70, 0, 70, 70), 1, 1, 1);
            pbExit.obj_Selected        += new EventHandler(pbExit_obj_Selected);
            pbExit.obj_MouseOver       += new EventHandler(pbExit_obj_MouseOver);
            pbExit.obj_Leave           += new EventHandler(pbExit_obj_Leave);
            pbVictory                   = new PictureBox(texVictory, GameRef.ScreenRectangle, 1, 1, 0);
            pbVictory.obj_Win          += new EventHandler(pbVictory_obj_Win);
            pbVictory.obj_Selected     += new EventHandler(YouLose);
            pbVictory.obj_MouseOver    += new EventHandler(pbExit_obj_MouseOver);
            pbVictory.obj_Leave        += new EventHandler(pbExit_obj_Leave);
            pbVictory.Visable           = false;
            pbVictory.IsEnabled         = false;
            pbUiTutorial                = new PictureBox(texUiTutor, new Rectangle(GameRef.ScreenRectangle.Width - texExit.Width / 2, 0, 70, 70), 1, 1, 1);
            pbUiTutorial.obj_MouseOver += new EventHandler(pbExit_obj_MouseOver);
            pbUiTutorial.obj_Leave     += new EventHandler(pbExit_obj_Leave);
            pbUiTutorial.obj_Selected  += new EventHandler(pbUiTutorial_obj_Selected);


            StatusBar        = new StatusBar(texStatusBar, 5, 1, new Rectangle(0, GameRef.ScreenRectangle.Height - 50, 400, 50));
            StatusBar.Gold   = GameRef.player.gold;
            StatusBar.Health = 10;
            StatusBar.Font   = Content.Load <SpriteFont>(@"Fonts\HudFont");



            ObjManager.AddLst.Add(LandScape);
            ObjManager.AddLst.Add(StatusBar);
            ObjManager.AddLst.Add(pbExit);
            ObjManager.AddLst.Add(pbUiTutorial);
            //line = Content.Load<Texture2D>(@"MapParts\line");
            AddPlots(Content);
            //LoadWave();
            ObjManager.AddLst.Add(pbVictory);
        }
Exemplo n.º 59
0
        /// <summary>
        /// Setup the game UI.
        /// </summary>
        public override void Add(ScreenManager screenManager)
        {
            base.Add(screenManager);

            // Status bar.
            sbStats = new StatusBar(Manager);
            sbStats.Init();
            sbStats.Bottom = Manager.ScreenHeight;
            sbStats.Left   = 0;
            sbStats.Width  = Manager.ScreenWidth;

            lblStats = new Label(Manager)
            {
                Top = 4, Left = 8, Width = Manager.ScreenWidth - 16
            };
            lblStats.Init();

            sbStats.Add(lblStats);
            Window.Add(sbStats);

            // Inventory.
            pnlInventory      = new InventoryControl(this, Manager);
            pnlInventory.Left = Manager.TargetWidth / 2 - (pnlInventory.Width / 2);
            pnlInventory.Init();
            Window.Add(pnlInventory);

            // Chat.
            txtChat = new TextBox(Manager);
            txtChat.Init();
            txtChat.Left = 8;
            txtChat.DrawFormattedText = false;
            txtChat.Bottom            = sbStats.Top - 8;
            txtChat.Width             = (int)(Manager.TargetWidth * .4f) - 16; // Remove 16 to align due to invisible scrollbar
            txtChat.Visible           = false;
            txtChat.Passive           = true;
            Window.Add(txtChat);

            lstChats = new ControlList <ChatDataControl>(Manager)
            {
                Left   = txtChat.Left,
                Width  = txtChat.Width + 16,
                Height = (int)(Manager.TargetHeight * .25f)
            };
            lstChats.Init();
            lstChats.Color          = Color.Transparent;
            lstChats.HideSelection  = true;
            lstChats.Passive        = true;
            lstChats.HideScrollbars = true;
            lstChats.Top            = txtChat.Top - lstChats.Height;
            Window.Add(lstChats);

            // Tablist.
            lstPlayers = new ControlList <PlayerListDataControl>(Manager)
            {
                Width = 256,
                Top   = 256
            };
            lstPlayers.Init();
            lstPlayers.HideSelection  = true;
            lstPlayers.Left           = Manager.TargetWidth / 2 - (lstPlayers.Width / 2);
            lstPlayers.Passive        = true;
            lstPlayers.HideScrollbars = true;
            lstPlayers.Visible        = false;
            Window.Add(lstPlayers);

            foreach (var player in Level.Players)
            {
                lstPlayers.Items.Add(new PlayerListDataControl(player, Manager, lstPlayers));
            }


            // Listen for later player joins.
            Client.Events.Network.Game.PlayerJoinReceived.AddHandler(
                args => { lstPlayers.Items.Add(new PlayerListDataControl(args.Player, Manager, lstPlayers)); });

            // Listen for ping updates for players.
            Client.Events.Network.Game.PingUpdateReceived.AddHandler(args =>
            {
                foreach (var ping in args.Pings)
                {
                    var control =
                        (PlayerListDataControl)
                        lstPlayers.Items.FirstOrDefault(i => ((PlayerListDataControl)i).User.UUID == ping.Key);
                    control?.ChangePing(ping.Value);
                }
            });


            // Hackish way to get chats to start at the bottom.
            for (var i = 0; i < (Manager.TargetHeight * 0.25f) / 18; i++)
            {
                lstChats.Items.Add(new ChatDataControl("", Manager, lstChats, this));
            }

            Client.Events.Network.Game.ChatReceived.AddHandler(args => { AddChat(args.Message, Manager, lstChats); });

            // Level event handlers.
            Client.Events.Game.Level.BlockPlaced.AddHandler(args =>
            {
                // Directly access the tile array, as we don't want to send two BlockPlaced events, as the tile indexer will
                // automatically call the event and send a network message.
                if (args.Level != null)
                {
                    args.Level.Tiles.Tiles[args.X, args.Y, args.Z] = new Tile(args.Type);
                }
            });
        }
Exemplo n.º 60
0
 /// <summary>
 /// Invoked when this page is about to be displayed in a Frame.
 /// </summary>
 /// <param name="e">Event data that describes how this page was reached.
 /// This parameter is typically used to configure the page.</param>
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     StatusBar.GetForCurrentView().HideAsync();
     HardwareButtons.BackPressed += HardwareButtonsBackPressed;
 }