示例#1
1
 internal WebViewBackend(SWC.WebBrowser browser)
 {
     view = browser;
     view.Navigating += HandleNavigating;
     view.Navigated += HandleNavigated;
     view.LoadCompleted += HandleLoadCompleted;
     view.Loaded += HandleViewLoaded;
     Widget = view;
     view.Navigate ("about:blank"); // force Document initialization
     Title = string.Empty;
 }
示例#2
0
 void Scrollbar_Scroll(object sender, SWC.Primitives.ScrollEventArgs e)
 {
     this.Context.InvokeUserCode(delegate
     {
         eventSink.OnValueChanged();
     });
 }
        public void SetLinkCount()
        {
            int count = 0;

            if (CurrentTile != null)
            {
                HexagonTile tile = CurrentTile;

                HexagonTile[] neighbours =
                    new[]{
                    tile.North,
                    tile.NorthEast,
                    tile.NorthWest,
                    tile.South,
                    tile.SouthEast,
                    tile.SouthWest,
                };

                foreach (HexagonTile neighbour in neighbours)
                {
                    if (neighbour != null)
                    {
                        count++;
                    }
                }
            }

            Links.Text = count.ToString();
        }
        public void ParametersCanUseDataContextBindings()
        {
            Window.LoadContent(
              @"<Button xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' 
	                xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
                    xmlns:magellan='http://xamlforge.com/magellan'
                    xmlns:i='clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity'
                    Name='MyButton'
                    Content='Hello'
                    >
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName='Click'>
                            <magellan:NavigateControllerAction x:Name='NavBehavior' Controller='MyController' Action='MyAction'>
                                <magellan:NavigateControllerAction.Parameters>
                                    <magellan:Parameter ParameterName='param' Value='{Binding}' />
                                    <magellan:Parameter ParameterName='paramA' Value='{Binding Path=A}' />
                                    <magellan:Parameter ParameterName='paramB' Value='{Binding Path=B}' />
                                </magellan:NavigateControllerAction.Parameters>
                            </magellan:NavigateControllerAction>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </Button>");

            var dataContext = new { A = 3, B = 8 };
            ExpectNavigationRequest("MyController", "MyAction", new { param = dataContext, paramA = dataContext.A, paramB = dataContext.B });
            Window.DataContext = dataContext;
            NavigationProperties.SetNavigator(Window, Navigator.Object);
            Window.Find<Button>("MyButton").ExecuteClick();
            Window.ProcessEvents();
        }
        public ScreenBrightnessUI()
        {
            InitializeComponent();

            int[] items = new[] { 2, 4, 6, 8, 10, 20, 30, 50, 80, 100 };
            foreach (var i in items)
            {
                NumPercent.Items.Add(i);
            }
        }
        public StickyNoteListBoxExample()
        {
            InitializeComponent();

            var items = new[]
                            {
                                "Whatever",
                                "Whatever",
                                "Whatever",
                                "Whatever",
                                "Whatever",
                            };
            listBox.ItemsSource = items;
        }
		public void addCallerAndCalleesToGraphNode(WPF.Control graphNode, string methodSignature)
		{
			if (graphNode != null && methodSignature.valid())
			{
				if (ExpandMethodsCalled)
					if (this.MethodsCalledMappings.hasKey(methodSignature))
						foreach (var methodCalled in this.MethodsCalledMappings[methodSignature]) 
							//if (GraphNodes.hasKey(methodCalled).isFalse())
								GraphViewer.add_Edge(graphNode, createGraphNode(methodCalled));
				if (ExpandMethodIsCalledBy)
					if (MethodIsCalledByMappings.hasKey(methodSignature))
						foreach (var methodIsCalledBy in this.MethodIsCalledByMappings[methodSignature])
							//if (GraphNodes.hasKey(methodIsCalledBy).isFalse())
								GraphViewer.add_Edge(createGraphNode(methodIsCalledBy), graphNode);
								
				graphNode.color("Green");
			}
		}
		public void addCallerAndCalleesToGraphNode(WPF.Control graphNode)
		{
			if (graphNode != null)
				addCallerAndCalleesToGraphNode(graphNode,graphNode.get_Tag<string>());
		}