Пример #1
0
 private void NewDialog_Click(object sender, EventArgs e)//сделано
 {
     SourceBox.Clear();
     QuestionBox.Clear();
     AnswersGrid.Rows.Clear();
     NEW = true;
 }
Пример #2
0
        /// <summary>全アイテムリセット</summary>
        public bool bxResetItems(ListBox src, ListBox target, IList trgItemsSource = null)
        {
            if (src == null || target == null)
            {
                return(false);
            }

            var trgItems = trgItemsSource ?? target.Items;

            SourceBox.UnselectAll();
            trgItems.Clear();
            trgItems.AddItemsAx(SourceBox.Items);
            TargetBoxItemsRefresh(target, trgItemsSource);

            return(true);
        }
Пример #3
0
 private void ResetSourcePath(Exception ex)
 {
     _copyFileService.SetSourceDirectory(null);
     _settings.SourcePath = string.Empty;
     SaveSettings();
     SourceBox.Clear();
     SourceBox.BackColor = SystemColors.Control;
     InputBarcodeBox.Clear();
     if (MessageBox.Show(ex.Message + "\nВыбрать заново где находятся файлы?", "Ошибка при поиске файлов изображений", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         SourceBtn.PerformClick();
     }
     else
     {
         InputBarcodeBox.Visible = false;
     }
 }
        public MainWindow()
        {
            this.InitializeComponent();

            RuntimeComponent1.UserControl userControl = new RuntimeComponent1.UserControl();

            Binding testBlockBinding = new Binding()
            {
                Path = new PropertyPath("Text")
            };

            TestBlock.DataContext = MyControl;
            TestBlock.SetBinding(TextBlock.TextProperty, testBlockBinding);

            Binding textBoxBinding = new Binding()
            {
                Path = new PropertyPath("Text"), Mode = BindingMode.TwoWay, Converter = new StringToStringConverter()
            };

            TestBox.DataContext = MyControl;
            TestBox.SetBinding(TextBox.TextProperty, textBoxBinding);

            Binding sourceBlockBinding = new Binding()
            {
                Path = new PropertyPath("Source"), Converter = new UriToStringConverter()
            };

            SourceBlock.DataContext = MyControl;
            SourceBlock.SetBinding(TextBlock.TextProperty, sourceBlockBinding);

            Binding sourceBoxBinding = new Binding()
            {
                Path = new PropertyPath("Source"), Mode = BindingMode.TwoWay, Converter = new UriToStringConverter()
            };

            SourceBox.DataContext = MyControl;
            SourceBox.SetBinding(TextBox.TextProperty, sourceBoxBinding);
        }