コード例 #1
0
        public void AddTab(OpenTabCommandParameters commandParams, MainWindow mw)
        {
            UserControl userControl;

            if (commandParams.Control == null)
            {
                userControl = new TabView(mw, commandParams.Url);
            }
            else
            {
                userControl = commandParams.Control;
            }

            Dispatcher.BeginInvoke((Action)(() =>
            {
                tab = new Tab(commandParams.Title, mw, userControl, commandParams.Brush);

                tab.Width = tabWidth;
                tab.Height = tabHeight;
                canvas.Children.Add(tab);
                Canvas.SetLeft(tab, TabCount * tabWidth);
                Canvas.SetTop(tab, 0);
                Canvas.SetTop(AddButton, 0);
                if (AddButtonCount == 1)
                {
                    AddButton.BeginAnimation(Canvas.LeftProperty,
                                             new DoubleAnimation(0, AddButtonCount * tabWidth, TimeSpan.FromMilliseconds(moveButtonDuration)));
                }
                else
                {
                    AddButton.BeginAnimation(Canvas.LeftProperty,
                                             new DoubleAnimation(Canvas.GetLeft(AddButton), AddButtonCount * tabWidth, TimeSpan.FromMilliseconds(moveButtonDuration)));
                }
                TabCount += 1;
                AddButtonCount += 1;
                TabCollection.Add(tab);

                var fade = new DoubleAnimation()
                {
                    From = 0,
                    To = 1,
                    Duration = TimeSpan.FromSeconds(0.25),
                };
                Storyboard.SetTarget(fade, tab);
                Storyboard.SetTargetProperty(fade, new PropertyPath(Button.OpacityProperty));

                var sb = new Storyboard();
                sb.Children.Add(fade);
                sb.Begin();

                CalcSizes();
            }));
        }
コード例 #2
0
        public void AddLanguageSteps()
        {
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "LanguagesAndSkills");
            AddNewButton.Click();
            EnterLanguage.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Language"));
            LangLevelDD.Click();
            SelectElement langLevel = new SelectElement(LangLevelDD);

            langLevel.SelectByValue(GlobalDefinitions.ExcelLib.ReadData(3, "Language Level"));
            AddButton.Click();
            GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("//div[contains(@class,'ns-box ns-growl ns-effect-jelly ns-type-success ns-show')]"), 10);
        }
コード例 #3
0
ファイル: PopupAddUser.xaml.cs プロジェクト: AllDayer/NXT
 // Method for animation child in PopupPage
 // Invoced after custom animation end
 protected async override Task OnAppearingAnimationEnd()
 {
     var translateLength = 400u;
     await Task.WhenAll(
         myGrid.TranslateTo(0, 0, easing: Easing.SpringOut, length: translateLength),
         myGrid.FadeTo(1),
         CloseImage.FadeTo(1),
         CloseImage.ScaleTo(1, easing: Easing.SpringOut),
         CloseImage.RotateTo(0),
         AddButton.ScaleTo(1),
         AddButton.FadeTo(1));
 }
コード例 #4
0
 void ReleaseDesignerOutlets()
 {
     if (AddButton != null)
     {
         AddButton.Dispose();
         AddButton = null;
     }
     if (todoItemTableView != null)
     {
         todoItemTableView.Dispose();
         todoItemTableView = null;
     }
 }
コード例 #5
0
        public PackageAddFromUrlField()
        {
            root = Resources.GetTemplate("PackageAddFromUrlField.uxml");
            Add(root);

            UrlTextField.value = urlText;

            AddButton.SetEnabled(!string.IsNullOrEmpty(urlText));
            AddButton.clickable.clicked += OnAddButtonClick;

            RegisterCallback <AttachToPanelEvent>(OnEnterPanel);
            RegisterCallback <DetachFromPanelEvent>(OnLeavePanel);
        }
コード例 #6
0
        ///////unlocks all the boxes essentially for now //////
        private void Modify_Click(object sender, EventArgs e)
        {
            Modname Amod = new Modname(Allergen.Text, Description.Text);

            Undo_Click(Amod, e);

            this.BackColor = Color.Blue;

            Allergen.ReadOnly    = false;
            Description.ReadOnly = false;
            Save.Show();
            AddButton.Show();
        }
コード例 #7
0
 void ReleaseDesignerOutlets()
 {
     if (AddButton != null)
     {
         AddButton.Dispose();
         AddButton = null;
     }
     if (MasterView != null)
     {
         MasterView.Dispose();
         MasterView = null;
     }
 }
 void ReleaseDesignerOutlets()
 {
     if (AddButton != null)
     {
         AddButton.Dispose();
         AddButton = null;
     }
     if (nameTextField != null)
     {
         nameTextField.Dispose();
         nameTextField = null;
     }
 }
コード例 #9
0
 public frmMain(string username, string fullname)
 {
     InitializeComponent();
     _main = this;
     panelAside.VerticalScroll.Value = panelAside.VerticalScroll.Maximum;
     this.SetStyle(ControlStyles.ResizeRedraw, true);
     //chatbox1.Visible = false;
     this.username         = username;
     this.fullname         = fullname;
     this.lblNameUser.Text = fullname;
     this.label1.Text      = "ChatsApp - " + fullname;
     myDelegate            = new AddButton(AddButtonMethod);
     reFreshPanel          = new RefreshPanelAside(RefreshPanelAsideMethod);
 }
コード例 #10
0
        void ReleaseDesignerOutlets()
        {
            if (ColumnComboBox != null)
            {
                ColumnComboBox.Dispose();
                ColumnComboBox = null;
            }

            if (OperatorComboBox != null)
            {
                OperatorComboBox.Dispose();
                OperatorComboBox = null;
            }

            if (ValueTextField != null)
            {
                ValueTextField.Dispose();
                ValueTextField = null;
            }

            if (AddButton != null)
            {
                AddButton.Dispose();
                AddButton = null;
            }

            if (RemoveButton != null)
            {
                RemoveButton.Dispose();
                RemoveButton = null;
            }

            if (SaveButton != null)
            {
                SaveButton.Dispose();
                SaveButton = null;
            }

            if (CancelButton != null)
            {
                CancelButton.Dispose();
                CancelButton = null;
            }

            if (FilterTableView != null)
            {
                FilterTableView.Dispose();
                FilterTableView = null;
            }
        }
コード例 #11
0
        void ReleaseDesignerOutlets()
        {
            if (AddButton != null)
            {
                AddButton.Dispose();
                AddButton = null;
            }

            if (RecordContentView != null)
            {
                RecordContentView.Dispose();
                RecordContentView = null;
            }
        }
コード例 #12
0
 private void ElementInitializeWindow_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         AddButton.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent));
     }
     else
     {
         if (e.Key == Key.Escape)
         {
             CloseButton.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent));
         }
     }
 }
コード例 #13
0
        void ReleaseDesignerOutlets()
        {
            if (AddAllButton != null)
            {
                AddAllButton.Dispose();
                AddAllButton = null;
            }

            if (AddButton != null)
            {
                AddButton.Dispose();
                AddButton = null;
            }

            if (ApplyButton != null)
            {
                ApplyButton.Dispose();
                ApplyButton = null;
            }

            if (CancelButton != null)
            {
                CancelButton.Dispose();
                CancelButton = null;
            }

            if (RemoveAllButton != null)
            {
                RemoveAllButton.Dispose();
                RemoveAllButton = null;
            }

            if (RemoveButton != null)
            {
                RemoveButton.Dispose();
                RemoveButton = null;
            }

            if (NewAttributesList != null)
            {
                NewAttributesList.Dispose();
                NewAttributesList = null;
            }

            if (ExistingAttributesList != null)
            {
                ExistingAttributesList.Dispose();
                ExistingAttributesList = null;
            }
        }
コード例 #14
0
        private void PracticeButton_Click(object sender, EventArgs e)
        {
            PracticeControl practiceControl = new PracticeControl();

            Controls.Add(practiceControl);
            practiceControl.Dock = DockStyle.Fill;
            practiceControl.Show();
            TranslationGridView.Hide();
            AddButton.Hide();
            RemoveButton.Hide();
            PracticeButton.Hide();
            practiceModeToolStripMenuItem.Checked = true;
            editModeToolStripMenuItem.Checked     = false;
        }
コード例 #15
0
        void ReleaseDesignerOutlets()
        {
            if (RemoveButton != null)
            {
                RemoveButton.Dispose();
                RemoveButton = null;
            }

            if (AddButton != null)
            {
                AddButton.Dispose();
                AddButton = null;
            }

            if (RemoveAllButton != null)
            {
                RemoveAllButton.Dispose();
                RemoveAllButton = null;
            }

            if (AllReturnAttrCheckBox != null)
            {
                AllReturnAttrCheckBox.Dispose();
                AllReturnAttrCheckBox = null;
            }

            if (AttributeToExportComboBox != null)
            {
                AttributeToExportComboBox.Dispose();
                AttributeToExportComboBox = null;
            }

            if (AttributeToExportTableView != null)
            {
                AttributeToExportTableView.Dispose();
                AttributeToExportTableView = null;
            }

            if (FormatComboBox != null)
            {
                FormatComboBox.Dispose();
                FormatComboBox = null;
            }

            if (ScopeComboBox != null)
            {
                ScopeComboBox.Dispose();
                ScopeComboBox = null;
            }
        }
コード例 #16
0
        void ReleaseDesignerOutlets()
        {
            if (AliasField != null)
            {
                AliasField.Dispose();
                AliasField = null;
            }

            if (PrivateKeyField != null)
            {
                PrivateKeyField.Dispose();
                PrivateKeyField = null;
            }

            if (CertificateField != null)
            {
                CertificateField.Dispose();
                CertificateField = null;
            }

            if (OpenPrivateKeyFileButton != null)
            {
                OpenPrivateKeyFileButton.Dispose();
                OpenPrivateKeyFileButton = null;
            }

            if (OpenCertificateFileButton != null)
            {
                OpenCertificateFileButton.Dispose();
                OpenCertificateFileButton = null;
            }

            if (AddButton != null)
            {
                AddButton.Dispose();
                AddButton = null;
            }

            if (CancelButton != null)
            {
                CancelButton.Dispose();
                CancelButton = null;
            }

            if (PasswordField != null)
            {
                PasswordField.Dispose();
                PasswordField = null;
            }
        }
コード例 #17
0
        void ReleaseDesignerOutlets()
        {
            if (AddButton != null)
            {
                AddButton.Dispose();
                AddButton = null;
            }

            if (ContactTableView != null)
            {
                ContactTableView.Dispose();
                ContactTableView = null;
            }
        }
コード例 #18
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Lists);

            // Create the adapter using the default CachingViewHolder
            _adapter = Vm.Items.GetRecyclerAdapter(
                BindViewHolder,
                Resource.Layout.ItemTemplate,
                OnItemClick);

            MyRecycler.SetLayoutManager(new LinearLayoutManager(this));
            MyRecycler.SetAdapter(_adapter);

            _bindings.Add(
                this.SetBinding(
                    () => _adapter.SelectedItem.Name,
                    () => SelectedItemNameText.Text,
                    fallbackValue: "Nothing selected"));

            _bindings.Add(
                this.SetBinding(
                    () => Vm.ToggledItems,
                    () => ToggledItemsText.Text));

            AddButton.SetCommand(Vm.AddCommand);

            var selectedItemBinding = this.SetBinding(() => _adapter.SelectedItem);

            _bindings.Add(selectedItemBinding);
            RemoveButton.SetCommand(Vm.DeleteCommand, selectedItemBinding);

            // Subscribing to events to avoid linker issues in release mode ---------------------------------
            // This "fools" the linker into believing that the events are used.
            // In fact we don't even subscribe to them.
            // See https://developer.xamarin.com/guides/android/advanced_topics/linking/

            if (_falseFlag)
            {
                AddButton.Click += (s, e) =>
                {
                };
                RemoveButton.Click += (s, e) =>
                {
                };
            }
        }
コード例 #19
0
ファイル: TipView.cs プロジェクト: markendy/ToDo
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            var source = new MainViewDataSource(TableView);

            var set = this.CreateBindingSet <TipView, TipViewModel>();

            set.Bind(source).For(v => v.ItemsSource).To(vm => vm.TaskList);

            set.Bind(AddButton.Tap()).For(v => v.Command).To(vm => vm.AddRecordCommand);
            set.Apply();

            TableView.Source = source;
            TableView.ReloadData();
        }
コード例 #20
0
 private void setActiveWordListToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (SelectWordList selectWordList = new SelectWordList())
     {
         selectWordList.SelectHandler += MyListFormSelectedHandler;
         selectWordList.ShowDialog();
         selectWordList.StartPosition = FormStartPosition.CenterParent;
         TranslationGridView.Show();
         editModeToolStripMenuItem.Checked     = true;
         practiceModeToolStripMenuItem.Checked = false;
         AddButton.Show();
         RemoveButton.Show();
         PracticeButton.Show();
     }
 }
コード例 #21
0
        public TabBar()
        {
            InitializeComponent();
            TabCount  = 0;
            tabHeight = 26;

            moveButtonDuration = 200;
            pixelsSoFar        = 0;
            tabWidth           = 170;
            AddButton.SetRippleMargin(3);
            AddButton.ImageSource("add.png");
            AddButton.SetImageScale(20);
            AddButtonCount = 1;
            TabCollection  = new List <Tab>();
        }
コード例 #22
0
        protected override async Task OnAppearingAnimationEndAsync()
        {
            if (!IsAnimationEnabled)
            {
                return;
            }

            await Task.WhenAll(
                AddButton.ScaleTo(1),
                AddButton.FadeTo(1),
                CloseButton.ScaleTo(1),
                CloseButton.FadeTo(1));

            entryTitle.Focus();
        }
コード例 #23
0
        private void AddAddRuleButton()
        {
            AddButton      = RulesTab.Content.AddUIComponent <AddRuleButton>();
            AddButton.Text = Localize.AddNewRule;
            AddButton.Init();
            AddButton.OnButtonClick += AddRule;

            void AddRule()
            {
                var rule = new Rule();

                this.AddRule(rule);
                AddRulePanel(rule);
            }
        }
コード例 #24
0
        private async void BindListItemsListView()
        {
            try
            {
                List <ListItem> ListItems = DatabaseHelper.GetListItems(CurrentListId);
                DefaultViewModel["ListItems"] = ListItems;

                AddButton.Focus(FocusState.Programmatic);
            }
            catch (Exception ex)
            {
                MessageDialog md = new MessageDialog(ex.Message, "Critical Error!");
                await md.ShowAsync();
            }
        }
コード例 #25
0
 private void Animate()
 {
     if (BindingContext is MainViewModel viewModel && viewModel.IsAddButtonVisible)
     {
         uint length = 300;
         var  easing = Easing.SinOut;
         AddButton.RotateTo(viewModel.IsActionMenuVisible ? 135 : 0, length, easing);
         AddButton.ScaleTo(viewModel.IsActionMenuVisible ? 0.66 : 1, length, easing);
         var red   = (Color)Application.Current.Resources["Red"];
         var black = (Color)Application.Current.Resources["Black"];
         AddButton.BackgroundColor = viewModel.IsActionMenuVisible ? red : black;
         AddFoodButton.TranslateTo(viewModel.IsActionMenuVisible ? -75 : 0, 0, length, easing);
         AddWeightButton.TranslateTo(0, viewModel.IsActionMenuVisible ? -75 : 0, length, easing);
     }
 }
コード例 #26
0
        public virtual void ClickOnAddElementButton(int times)
        {
            if (times > 0)
            {
                for (int i = 1; i <= times; i++)
                {
                    AddButton.Click();
                    elementsToBeRemoved++;
                }
            }

            else
            {
                throw new ArgumentException("Invalid argument: value must be greater than zero.");
            }
        }
コード例 #27
0
 protected void OnAddButtonClicked(object sender, EventArgs e)
 {
     DoneLabel.Hide();
     NameLabel.Show();
     NameBox.Show();
     TypeLabeld.Show();
     Typebox.Show();
     OwnerLabel.Show();
     OwnerBox.Show();
     AddButton.Hide();
     ViewButton.Hide();
     BackButton.Show();
     DoneButton.Show();
     HoursBox.Show();
     HoursLabel.Show();
 }
コード例 #28
0
        //Add new Skill on the Profile page
        public void AddSkillOnProfile(string skill, string level)
        {
            //Click on AddNew button
            AddNewSkill.Click();

            //Enter new Skill
            SkillTextBox.SendKeys(skill);

            //Select Skill level
            SelectElement selectLanguageLevel = new SelectElement(Level);

            selectLanguageLevel.SelectByText(level);

            //Click on Add button to add skill data
            AddButton.Click();
        }
コード例 #29
0
        //Add new Language on the Profile page
        public void AddLanguageOnProfile(string language, string level)
        {
            //Click on AddNew button to add new language
            AddNewLanguage.Click();

            //Enter new Language
            LanguageTextBox.SendKeys(language);

            //Select Language level
            SelectElement selectLanguageLevel = new SelectElement(Level);

            selectLanguageLevel.SelectByText(level);

            //Click on Add button to add language data
            AddButton.Click();
        }
コード例 #30
0
 private void OnClosing(object sender, CancelEventArgs e)
 {
     if (Presenter.NeedsSave)
     {
         AddButton.Focus(); // this is needed if the user edited a textbox and didnt leave the textbox, the changed text is not automatically saved until the focus leaves the textbox
         string error = Presenter.Save();
         if (error.Length > 0)
         {
             var result = MessageBox.Show("Error, do you want to close anyway?" + Environment.NewLine + Environment.NewLine + error, "Error", MessageBoxButton.YesNo, MessageBoxImage.Error, MessageBoxResult.No);
             if (result == MessageBoxResult.No)
             {
                 e.Cancel = true;
             }
         }
     }
 }