public BrowserTabsPO(IWebDriver driver) { this.driver = driver; element = new ElementHelper(this.driver); tab = new TabHelper(this.driver); byClickHereLink = By.PartialLinkText("Click Here"); }
private void TearableTabControl_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { TabHelper.AdjustTabItemWidth(sender as ItemCollection); if (null != e.NewItems) { UpdateSharedData(e.NewItems); } OnItemsChanged(e); }
private void SetTabControlItemsChangedEventHandler() { foreach (var item in VisualHelper.FindVisualChildren <TearableTabControl>(this)) { TabHelper.AdjustTabItemWidth(item.Items); var view = CollectionViewSource.GetDefaultView(item.Items); view.CollectionChanged += TabItem_AdjustWidth; item.SizeChanged += TabControl_AdjustWidthOfTabItems; } }
static void Main(string[] args) { var folder = @"..\..\..\Halloumi.Notez.Engine\SourceMidi\doom"; var section = MidiHelper.ReadMidi(folder + @"\AC-Gasoline1.mid"); var phrase = section.Phrases[0]; NoteHelper.ShiftNotesDirect(phrase, 2, Interval.Step); var tab = TabHelper.GenerateTab(phrase, "E,B,G,D,A,D"); Console.WriteLine(tab); Console.WriteLine("push any key.."); Console.ReadLine(); }
private void LoadTab(string fileName) { if (string.IsNullOrEmpty(fileName)) { return; } _currentFile = fileName; FilenameTextbox.Text = Path.GetFileName(fileName); var transposeSteps = Convert.ToInt32(TransposeBox.Items[TransposeBox.SelectedIndex]); var oneLine = OneLineBox.Items[OneLineBox.SelectedIndex].ToString() == "Yes"; var tuningName = TuningBox.Items[TuningBox.SelectedIndex].ToString(); var tuning = ""; if (tuningName == "Drop D") { tuning = "E,B,G,D,A,D"; } else if (tuningName == "E Standard") { tuning = "E,B,G,D,A,E"; } else if (tuningName == "Drop C#") { tuning = "D#,A#,F#,C#,G#,C#"; } else if (tuningName == "Drop C") { tuning = "D,A,F,C,G,C"; } var section = MidiHelper.ReadMidi(_currentFile); var phrase = section.Phrases[0]; NoteHelper.ShiftNotesDirect(phrase, transposeSteps, Interval.Step); TabBox.Text = TabHelper.GenerateTab(phrase, tuning, oneLine); }
private void STEPS() { TabHelper tab = new TabHelper(tabs); ScriptSequence sequence = new ScriptSequence(i); ScriptParser scriptParser = new ScriptParser(tab, sequence); //agrupa as transicoes de acordo com o nome... IEnumerable <IGrouping <string, UmlTransition> > groups = curActDiag.UmlObjects.OfType <UmlTransition>() .GroupBy(t => getFriendlyName(t.Source.Name), t => t); //organiza em GroupNodes GroupNode root = new GroupNode(); root.GroupName = groups.First().Key; root.Transitions = groups.First().ToList(); List <GroupNode> lista = new List <GroupNode>(); lista.Add(root); groups = groups.Where(x => !x.Key.Equals(root.GroupName)); foreach (IGrouping <string, UmlTransition> group in groups) { GroupNode gn = new GroupNode(); gn.GroupName = group.Key; group.ToList().ForEach( x => fixName(x) ); gn.Transitions = group.ToList(); lista.Add(gn); // root.SubGroups.Add(gn); } GroupNode father = null; GroupNode next = null; GroupNode prev = null; for (int j = 0; j < root.SubGroups.Count; j++) { if (root.SubGroups[j] != null) { //ajusta os passos que estao desalinhados ate este ponto // if ((j + 1 < root.SubGroups.Count) && root.SubGroups[j].Transitions.Last().Target.Name.Contains(root.SubGroups[j + 1].GroupName)) // { // root.SubGroups[j + 1].Transitions.Insert(0, root.SubGroups[j].Transitions.Last()); // root.SubGroups[j].Transitions.RemoveAt(root.SubGroups[j].Transitions.Count - 1); // } //seleciona o pai, este pai, pois caso o proximo seja filho, este ja é o pai dos proximos if (root.SubGroups[j].Transitions.Count > 0 && !root.SubGroups[j].Transitions.Last().TaggedValues.ContainsKey("paramcycle")) { //ajusta a ref. dos irmaos pois quando trocar o pai, os irmaos nao terao a a mesma descendencia... prev = next = null; father = root.SubGroups[j]; } //identifica os filhos no subdiagrama... if (root.SubGroups[j].Transitions.Count > 0 && root.SubGroups[j].Transitions.Last().TaggedValues.ContainsKey("paramcycle")) { root.SubGroups[j].Father = father; root.SubGroups[j].NextSibling = next; root.SubGroups[j].PrevSibling = prev; //ajusta a ref. do diagrama principal father.SubGroups.Add(root.SubGroups[j]); root.SubGroups[j] = null; } } } //remove os realocados root.SubGroups.RemoveAll(g => g == null); foreach (GroupNode g in lista) { sw.WriteLine(scriptParser.parse(g)); } //sw.WriteLine(scriptParser.parse(root)); }
private void TearableTabControl_SizeChanged(object sender, SizeChangedEventArgs e) { TabHelper.AdjustTabItemWidth(this.Items); }
private void TabControl_AdjustWidthOfTabItems(object sender, SizeChangedEventArgs e) { TabHelper.AdjustTabItemWidth((sender as TearableTabControl).Items as ItemCollection); }
private void TabItem_AdjustWidth(object sender, NotifyCollectionChangedEventArgs e) { TabHelper.AdjustTabItemWidth(sender as ItemCollection); }