Esempio n. 1
0
        private void OnTestListBoxItemSelected(NSelectEventArgs <NListBoxItem> arg1)
        {
            NListBoxItem selectedItem = arg1.Item;

            if (selectedItem == null)
            {
                return;
            }

            NRichTextToHtmlExample example = selectedItem.Tag as NRichTextToHtmlExample;

            if (example == null)
            {
                return;
            }

            // Recreate the content of the Nevron rich text widget
            NDocumentBlock documentRoot = example.CreateDocument();

            NRichTextDocument document = new NRichTextDocument();

            document.Content = documentRoot;
            document.Evaluate();

            m_RichText.Document = document;
            ExportToHtml();
        }
Esempio n. 2
0
        private void OnListBoxItemDeselected(NSelectEventArgs <NListBoxItem> args)
        {
            NListBoxItem item  = args.Item;
            int          index = item.GetAggregationInfo().Index;

            m_EventsLog.LogEvent("Deselected Item: " + index.ToString());
        }
        private void OnListBoxItemSelected(NSelectEventArgs <NListBoxItem> arg)
        {
            NListBoxItem selectedItem = arg.Item;

            switch (selectedItem.Text)
            {
            case EnglishLanguageName:
                // Load the English dictionary
                m_EnglishStream.Position = 0;
                NLocalizationDictionary.Instance.LoadFromStream(m_EnglishStream);
                break;

            case BulgarianLanguageName:
                // Load the Bulgarian dictionary
                m_BulgarianStream.Position = 0;
                NLocalizationDictionary.Instance.LoadFromStream(m_BulgarianStream);
                break;

            case GermanLanguageName:
                // Load the German dictionary
                m_GermanStream.Position = 0;
                NLocalizationDictionary.Instance.LoadFromStream(m_GermanStream);
                break;
            }

            // Recreate the Loan Calculator
            m_CalculatorHost.Content = CreateLoanCalculator();
        }
Esempio n. 4
0
        private void OnListBoxItemSelected(NSelectEventArgs <NListBoxItem> args)
        {
            m_RemoveSelectedButton.Enabled = true;

            NListBoxItem item = args.Item;

            m_EventsLog.LogEvent("Selected Item: " + item.Tag.ToString());
        }
Esempio n. 5
0
        private void OnListBoxItemSelected(NSelectEventArgs <NListBoxItem> arg1)
        {
            if (arg1.TargetNode == null)
            {
                return;
            }

            // Determine the full name of the selected resource
            string resName = (string)arg1.Item.Tag;

            // Read the stream
            using (Stream stream = NResources.Instance.GetResourceStream(resName))
            {
                m_RichText.LoadFromStream(stream);
            }
        }
Esempio n. 6
0
        private void OnListBoxItemSelected(NSelectEventArgs <NListBoxItem> arg1)
        {
            if (arg1.TargetNode == null)
            {
                return;
            }

            // Determine the full name of the selected resource
            string resName = (string)arg1.Item.Tag;

            // Read the stream and set it as text of the HTML code text box
            using (Stream stream = NResources.Instance.GetResourceStream(resName))
            {
                LoadSource(stream);
                LoadHtml(stream, null);
            }
        }
        /// <summary>
        /// Called when a diagram item has been deselected.
        /// </summary>
        /// <param name="arg"></param>
        void OnSelectionDeselected(NSelectEventArgs <NDiagramItem> arg)
        {
            NShape shape = arg.Item as NShape;

            if (shape == null)
            {
                return;
            }

            // unhook move slaves property changed event
            shape.RemoveEventHandler(NShape.MoveSlavesProperty.ValueChangedEvent, new NEventHandler <NValueChangeEventArgs>(OnMoveSlavesPropertyChanged));

            // clear hightlights
            ClearHighlights();

            // destroy property editor
            m_PropertyEditorHolder.Content = null;
        }
        /// <summary>
        /// Called when a diagram item has been selected.
        /// </summary>
        /// <param name="arg"></param>
        void OnSelectionSelected(NSelectEventArgs <NDiagramItem> arg)
        {
            NShape shape = arg.Item as NShape;

            if (shape == null)
            {
                return;
            }

            // create the shape move slaves property editor
            m_PropertyEditorHolder.Content = NDesigner.GetDesigner(shape).CreatePropertyEditor(shape, NShape.MoveSlavesProperty);

            // subscribe for move slaves property changes.
            shape.AddEventHandler(NShape.MoveSlavesProperty.ValueChangedEvent, new NEventHandler <NValueChangeEventArgs>(OnMoveSlavesPropertyChanged));

            // highlight the shape current slaves
            HighlightSlaves(shape);
        }
Esempio n. 9
0
        private void OnListBoxItemSelected(NSelectEventArgs <NListBoxItem> args)
        {
            if (m_bSelectionUpdating)
            {
                m_bSelectionUpdating = false;
                return;
            }

            // Get the list box and the other list box
            NListBox listBox      = (NListBox)args.Item.OwnerListBox;
            NListBox otherListBox = listBox == m_ListBox ? m_AdvancedListBox : m_ListBox;

            // Log the selection
            NListBoxItem selectedItem = listBox.Selection.FirstSelected;
            NCountry     country      = NNodeCollectionDataBinding <NListBoxItemCollection, NListBoxItem, NCountry> .GetDataBoundItem(selectedItem);

            m_EventsLog.LogEvent("'" + country.Name + "' selected");

            // Synchronize the selection between the two list boxes
            m_bSelectionUpdating = true;
            int selectedIndex = listBox.Items.IndexOf(selectedItem);

            otherListBox.Selection.SingleSelect(otherListBox.Items[selectedIndex]);
        }
Esempio n. 10
0
        private void OnListBoxItemDeselected(NSelectEventArgs <NListBoxItem> args)
        {
            NListBoxItem item = args.Item;

            m_EventsLog.LogEvent("Deselected Item: " + item.Tag.ToString());
        }