public void SaveCurrentCatList(CatList CL) { if (File.Exists("CatSettings.xml")) { File.Delete("CatSettings.xml"); } using (XmlTextWriter Xwrite = new XmlTextWriter("CatSettings.xml", Encoding.UTF8)) { Xwrite.WriteStartDocument(); Xwrite.WriteWhitespace("\n"); Xwrite.WriteStartElement("CatSettings"); foreach (Category C in CL) { Xwrite.WriteWhitespace("\n\t"); Xwrite.WriteStartElement("Category"); Xwrite.WriteAttributeString("Name", C.Name); Xwrite.WriteAttributeString("Active", C.ShouldSort.ToString()); foreach (Extension E in C.Extensions) { Xwrite.WriteWhitespace("\n\t\t"); Xwrite.WriteElementString("Extension", E.Name); } Xwrite.WriteWhitespace("\n\t"); Xwrite.WriteEndElement(); } Xwrite.WriteWhitespace("\n"); Xwrite.WriteEndElement(); Xwrite.WriteEndDocument(); } }
public MainForm() { CatList = Manager.InitializeCatList(); InitializeComponent(); FillContextMenu(); }
protected void CatDataBind() { List <Cat> myCats = Cat.GetCats(); CatList.DataSource = myCats; CatList.DataBind(); }
private void EODReport_Load(object sender, EventArgs e) { DepSalesList.ClearSelection(); CatList.ClearSelection(); PayList.ClearSelection(); OverList.ClearSelection(); PumpList.ClearSelection(); }
// Start is called before the first frame update void Awake() { catlist = GameObject.Find("CatList").GetComponent <CatList>(); currentCat = catlist.catlist[catlist.catlist.Count - 1]; //if (currentCat.catType) { //} }
public void AppendCatItem(DocDto docDto) { if (_CatList == null) { _CatList = new ObservableCollection <DocDto>(); } docDto.Parent = this; CatList.Add(docDto); }
//----< function for clearing all selection>---------------- public void clearAll() { AuthText.Clear(); OpenBtn.IsChecked = false; CloseBtn.IsChecked = false; CatList.UnselectAll(); FileListRemote.UnselectAll(); refreshDisplayRemote(); }
public CatList ToArray() { CatList[] a = new CatList[mDict.Count]; int i = 0; foreach (KeyValuePair<Object, Object> pair in mDict) { a[i++] = CatList.MakePair(pair.Value, pair.Key); } return new CatList(a); }
//============================================= void Awake() { if (CatList._instance == null) { DontDestroyOnLoad(this); CatList._instance = this; } else { Destroy(this.gameObject); } }
public SetDialog() { CurrentCat = new CatList(); DefaultCat = MainForm.CatList; CurrentCat.AddRange(MainForm.CatList); InitializeComponent(); //Base Selected = Page.Gen; //Default Page UpdatePage(Selected); InitializeAll(); }
// Start is called before the first frame update void Awake() { CatPlayList = GameObject.Find("CatPlaylist").GetComponentsInChildren <CatList>(); clock = GameObject.Find("Clock").GetComponent <AudioHelmClock>(); print("catplaylist : " + CatPlayList.Length); clock.pause = true; order = 0; Started = false; PlayButton = GameObject.Find("PlayButton").GetComponent <Button>(); PauseButton = GameObject.Find("PauseButton").GetComponent <Button>(); StopButton = GameObject.Find("StopButton").GetComponent <Button>(); PlayButton.onClick.AddListener(delegate //If press start button { if (!Started) //Initialize sequencers and start to play { print("lets start : " + order); Started = true; currentCatList = CatPlayList[order]; currentSequencer = ExtractSequencersFromCatList(currentCatList); foreach (Sequencer sequencer in currentSequencer) { SequencerReadyToStart(sequencer); } //To listen beat event, choose pivot sequencer. pivot_sequencer = currentSequencer[0]; pivot_sequencer.beatEvent.AddListener(delegate { attachNextSequencer(pivot_sequencer); }); clock.pause = false; } else //Resume { print("resume"); clock.pause = false; } }); PauseButton.onClick.AddListener(delegate { clock.pause = true; }); StopButton.onClick.AddListener(delegate { Started = false; order = 0; pivot_sequencer = null; }); }
public CategoryPanel(int currentCat) { this.InitializeComponent(); CurrentCat = currentCat; Binding assetsVisibilityBinding = new Binding(); assetsVisibilityBinding.Source = ApiHandler.AllCategories; assetsVisibilityBinding.Mode = BindingMode.TwoWay; CatList.SetBinding(ListView.ItemsSourceProperty, assetsVisibilityBinding); // Making ALL invisible > to make ALL immutable :)) Loaded += (s, e) => (CatList.ContainerFromItem(ApiHandler.AllCategories[0]) as ListViewItem).Visibility = Visibility.Collapsed; }
public void Awake() { firebasesManager = GameObject.FindGameObjectWithTag("firebase"); DBreference = firebasesManager.GetComponent <FirebaseManager>().DBreference; catList = CatList.CreateFromJSON(catDataJson.text); coordsList = MapCoordsList.CreateFromJSON(mapCoordsJson.text); StartCoroutine(LoadUserData(returnValue => { playerData = PlayerInfo.CreateFromJSON(returnValue); DontDestroyOnLoad(this.gameObject); })); }
List <Sequencer> ExtractSequencersFromCatList(CatList catlist) { List <Sequencer> extractedSequencer = new List <Sequencer>(); List <Cat> extractedCatList = catlist.catlist; print("extractedCatList : " + extractedCatList.Count); foreach (Cat cat in extractedCatList) { print("get in to the extraction part"); extractedSequencer.Add(cat.sequencer); } print("catlist.catlist = " + extractedCatList.Count); return(extractedSequencer); }
void SaveKeyboardSequenceDataToCat() { CatList catlist = GameObject.Find("CatList").GetComponent <CatList>(); Debug.Log("SaveSequenceDataToCat : " + catlist.catlist.Count); Cat currentCat = catlist.catlist[catlist.catlist.Count - 1]; Keyboardsequencer.name = Keyboardsequencer.name + (catlist.catlist.Count - 1); Keyboardsequencer.GetComponent <Sequencer>().enabled = false; DontDestroyOnLoad(Keyboardsequencer); currentCat.SetSequencer(Keyboardsequencer.GetComponent <Sequencer>()); Keyboardsequencer.transform.parent = catlist.catObjectList[catlist.catObjectList.Count - 1].transform; Keyboardsequencer.GetComponent <Sequencer>().loop = false; SceneManager.LoadScene(0); }
// Start is called before the first frame update void Awake() { CatList catlist = GameObject.Find("CatList").GetComponent <CatList>(); Cat currentCat = catlist.catlist[catlist.catlist.Count - 1]; bool UIselect = currentCat.instrumentType; CatInstrument = currentCat.instrumentName; if (CatInstrument == "bass") { Keyboardsequencer = GameObject.Find("BassSequencer"); } else if (CatInstrument == "drum") { //Empty.. Drumsequencer = GameObject.Find("DrumKit01Sequencer"); } else if (CatInstrument == "guitar") { Keyboardsequencer = GameObject.Find("GuitarSequencer"); } else if (CatInstrument == "synthesizer") { Keyboardsequencer = GameObject.Find("SynthSequencer"); } else { //This is not good } DrumSaveButton.onClick.AddListener(delegate { SaveDrumSequenceDataToCat(); }); KeyboardSaveButton.onClick.AddListener(delegate { SaveKeyboardSequenceDataToCat(); }); Drum32SaveButton.onClick.AddListener(delegate { SaveDrumSequenceDataToCat(); }); Keyboard32SaveButton.onClick.AddListener(delegate { SaveKeyboardSequenceDataToCat(); }); }
} // end of UpdateGUI() /// <summary> /// Get Five Cats /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnMakeCats_Click(object sender, EventArgs e) { // Make a Proxy to the Service MakeACatServiceClient proxy = new MakeACatServiceClient(); // Call the Service CatList cats = proxy.MakeCats(); // Add to the Master Cat List foreach (Cat cat in cats) { mycats.Add(cat); } // Update the GUI UpdateGUI(); } // end of method
// Start is called before the first frame update void Start() { int[] whiteidx = { 0, 2, 4, 5, 7, 9, 11 }; int[] blackidx = { 1, 3, 6, 8, 10 }; CatList catlist = GameObject.Find("CatList").GetComponent <CatList>(); Cat currentCat = catlist.catlist[catlist.catlist.Count - 1]; if (currentCat.instrumentName == "drum") { //sequencer = GameObject.Find("DrumKit01Sequencer").GetComponent<Sequencer>(); } else if (currentCat.instrumentName == "synthesizer") { sequencer = GameObject.Find("SynthSequencer").GetComponent <Sequencer>(); } else if (currentCat.instrumentName == "bass") { sequencer = GameObject.Find("BassSequencer").GetComponent <Sequencer>(); baseKey = baseKey - 12; } else if (currentCat.instrumentName == "guitar") { sequencer = GameObject.Find("GuitarSequencer").GetComponent <Sequencer>(); } else { print("this is not good"); } Button[] WhiteKeys = gameObject.transform.Find("WhiteKey").GetComponentsInChildren <Button>(); Button[] BlackKeys = gameObject.transform.Find("BlackKey").GetComponentsInChildren <Button>(); Debug.Log(WhiteKeys.Length); Debug.Log(BlackKeys.Length); for (int i = 0; i < WhiteKeys.Length; i++) { Debug.Log(WhiteKeys[i].name); SetKey(WhiteKeys[i], baseKey + whiteidx[i]); } for (int i = 0; i < BlackKeys.Length; i++) { Debug.Log(BlackKeys[i].name); SetKey(BlackKeys[i], baseKey + blackidx[i]); } }
/// <summary> /// Returns a List of 5 Cats /// Random Names /// One from each cat breed /// </summary> /// <returns>CatList a List of Cat type objects</returns> public CatList MakeCats() { // If no cat names, load the list if (m_CatNames.Count == 0) { LoadNames(); } CatList cats = new CatList(); //int myCatBreedMemberCount = Enum.GetNames(typeof(CatBreed)).Length; //int myGenderTypeMemberCount = Enum.GetNames(typeof(GenderType)).Length; cats.Add(new Cat(m_CatNames[m_Random.Next(0, m_CatNames.Count)], CatBreed.Abyssinian, GenderType.Male, m_Random.Next(1, 18))); cats.Add(new Cat(m_CatNames[m_Random.Next(0, m_CatNames.Count)], CatBreed.American_Shorthair, GenderType.Female, m_Random.Next(1, 18))); cats.Add(new Cat(m_CatNames[m_Random.Next(0, m_CatNames.Count)], CatBreed.Bengal, GenderType.Male, m_Random.Next(1, 18))); cats.Add(new Cat(m_CatNames[m_Random.Next(0, m_CatNames.Count)], CatBreed.British_Longhair, GenderType.Female, m_Random.Next(1, 18))); cats.Add(new Cat(m_CatNames[m_Random.Next(0, m_CatNames.Count)], CatBreed.Maine_Coon, GenderType.Female, m_Random.Next(1, 18))); return(cats); } // end of method
public CatList InitializeCatList() { CatList CL = new CatList(); using (XmlTextReader Xread = new XmlTextReader("CatSettings.xml")) { while (Xread.Read()) { if (Xread.IsStartElement("Category")) { CL.Add(new Category(Xread.GetAttribute(0), bool.Parse(Xread.GetAttribute(1)))); } else if (Xread.IsStartElement("Extension")) { CL[CL.Count - 1].Extensions.Add(new Extension(CL[CL.Count - 1], Xread.ReadString())); } } } return(CL); }
void Awake() { CatList catlist = GameObject.Find("CatList").GetComponent <CatList>(); Cat currentCat = catlist.catlist[catlist.catlist.Count - 1]; bool UIselect = currentCat.instrumentType; GameObject DrumSequencer = GameObject.Find("DrumKit01Sequencer"); GameObject SynthSequencer = GameObject.Find("SynthSequencer"); GameObject BassSequencer = GameObject.Find("BassSequencer"); GameObject GuitarSequencer = GameObject.Find("GuitarSequencer"); if (UIselect && currentCat.catType == "supreme") { print("supreme keyboard"); GameObject.Find("KeyboardPanel").SetActive(false); GameObject.Find("DrumPanel").SetActive(false); GameObject.Find("KeyboardPanel_32").SetActive(true); GameObject.Find("DrumPanel_32").SetActive(false); } else if (UIselect && currentCat.catType != "supreme") { print("normal keyboard"); GameObject.Find("KeyboardPanel").SetActive(true); GameObject.Find("DrumPanel").SetActive(false); GameObject.Find("KeyboardPanel_32").SetActive(false); GameObject.Find("DrumPanel_32").SetActive(false); } else if (!UIselect && currentCat.catType == "supreme") { print("supreme drum"); GameObject.Find("KeyboardPanel").SetActive(false); GameObject.Find("DrumPanel").SetActive(false); GameObject.Find("KeyboardPanel_32").SetActive(false); GameObject.Find("DrumPanel_32").SetActive(true); } else { print("normal drum"); GameObject.Find("KeyboardPanel").SetActive(false); GameObject.Find("DrumPanel").SetActive(true); GameObject.Find("KeyboardPanel_32").SetActive(false); GameObject.Find("DrumPanel_32").SetActive(false); } if (currentCat.instrumentName == "drum") { DrumSequencer.SetActive(true); SynthSequencer.SetActive(false); BassSequencer.SetActive(false); GuitarSequencer.SetActive(false); sequencer = DrumSequencer.GetComponent <Sequencer>(); } else if (currentCat.instrumentName == "synthesizer") { DrumSequencer.SetActive(false); SynthSequencer.SetActive(true); BassSequencer.SetActive(false); GuitarSequencer.SetActive(false); sequencer = SynthSequencer.GetComponent <Sequencer>(); } else if (currentCat.instrumentName == "bass") { DrumSequencer.SetActive(false); SynthSequencer.SetActive(false); BassSequencer.SetActive(true); GuitarSequencer.SetActive(false); sequencer = BassSequencer.GetComponent <Sequencer>(); } else if (currentCat.instrumentName == "guitar") { DrumSequencer.SetActive(false); SynthSequencer.SetActive(false); BassSequencer.SetActive(false); GuitarSequencer.SetActive(true); sequencer = GuitarSequencer.GetComponent <Sequencer>(); } else { print("UIHandler : this is not good"); } if (currentCat.catType == "supreme") { sequencer.length = 16; } else { sequencer.length = 16; } }
public static string list_to_str(CatList x) { string result = ""; foreach (Object o in x) result += o.ToString(); return result; }
public override void Eval(Executor exec) { Regex re = exec.TypedPop<Regex>(); string s = exec.TypedPop<string>(); List<string> list = new List<string>(); foreach (Match m in re.Matches(s)) list.Add(m.Value); CatList f = new CatList(list); exec.Push(f); }
public CatList FxnsToList(CatExpr fxns) { CatList list = new CatList(); foreach (Function f in fxns ) { if (f is PushFunction) { list.Add(FxnsToList(f.GetSubFxns())); } else if (f is DefinedFunction) { DefinedFunction def = f as DefinedFunction; if (f.GetSubFxns().Count > 0) { foreach (Function g in f.GetSubFxns()) list.Add(g); } else { list.Add(f); } } else { list.Add(f); } } return list; }
// Start is called before the first frame update void Start() { patternElements = GetComponentsInChildren <Toggle>(); Debug.Log("NoteSet # of toggle : " + patternElements.Length); count = 0; clock = GameObject.Find("Clock").GetComponent <AudioHelmClock>(); //GameObject DrumSequencer = GameObject.Find("DrumKit01Sequencer"); //GameObject SynthSequencer = GameObject.Find("SynthSequencer"); //GameObject BassSequencer = GameObject.Find("BassSequencer"); //GameObject GuitarSequencer = GameObject.Find("GuitarSequencer"); CatList Catlist = GameObject.Find("CatList").GetComponent <CatList>(); currentCat = Catlist.catlist[Catlist.catlist.Count - 1]; positionText = GameObject.Find("Position").GetComponent <Text>(); print(currentCat.instrumentName); if (currentCat.instrumentName == "drum") { sequencer = GameObject.Find("DrumKit01Sequencer").GetComponent <Sequencer>(); } else if (currentCat.instrumentName == "synthesizer") { sequencer = GameObject.Find("SynthSequencer").GetComponent <Sequencer>(); } else if (currentCat.instrumentName == "bass") { print("Get into the bass"); sequencer = GameObject.Find("BassSequencer").GetComponent <Sequencer>(); //patch = GameObject.Find("basspatch").GetComponent<HelmPatch>(); //print(patch); //print(GameObject.Find("BassSequencer").GetComponent<HelmController>()); //GameObject.Find("BassSequencer").GetComponent<HelmController>().LoadPatch(patch); key = key - 12; } else if (currentCat.instrumentName == "guitar") { sequencer = GameObject.Find("GuitarSequencer").GetComponent <Sequencer>(); } else { print("this is not good"); } switch (currentCat.catType) { case "plain": velocity = 0.7f; beat = 16; beatdivider = 1f; break; case "strong": velocity = 1.0f; beat = 16; beatdivider = 1f; break; case "sensitive": velocity = 0.4f; beat = 16; beatdivider = 1f; break; case "supreme": velocity = 0.7f; beat = 32; beatdivider = 2f; break; default: break; } ResetButton = GameObject.Find("ResetButton").GetComponent <Button>(); if (sequencer == null) { print("null!"); } sequencer.Clear(); Color normalColor = patternElements[0].colors.normalColor; initColor = new Color(normalColor.r, normalColor.g, normalColor.b); ResetButton.onClick.AddListener(delegate { ResetNote(); }); sequencer.beatEvent.AddListener(delegate { ToggleBackgroundChange(); }); //sequencer. //Pattern Color Selection //if (InstName == "Bass Drum") { // for (int ) //} }
private void SetCatList() { categoryClasses = RepositoryCatagory.GetAll(); CatList.AddRange(categoryClasses); }
private void btnClearCats_Click(object sender, EventArgs e) { dgvCat.DataSource = null; oCats = new CatList(); }
public CatModel(object commonRecords, Type modelType) { this.modelType = modelType; InitializeComponent(); GenerateDetailsPage(); ml = (CatList)commonRecords; dataGrid1.ItemsSource = ml; dataGrid1.AutoGenerateColumns = false; }
private void Form1_Load(object sender, EventArgs e) { oCats = new CatList(); }