void Open(object param, ExecutedRoutedEventArgs e) { OpenFileDialog of = new OpenFileDialog(); of.InitialDirectory = Directory.GetCurrentDirectory(); of.Filter = "Text Files (.txt)|*.txt"; var res = of.ShowDialog(); if (res == DialogResult.OK) { Filename = of.SafeFileName; int cpt = 0; Phrases.Clear(); var lines = File.ReadAllLines(of.FileName, Encoding.GetEncoding(1252)); foreach (string l in lines) { if (l[0] != '-' && l != "") { Phrases.Add(l); ((PhraseControl)_stack.Children[cpt]).SetPhrase(l); cpt++; } } } }
void Read(object param, ExecutedRoutedEventArgs e) { OpenFileDialog of = new OpenFileDialog(); of.InitialDirectory = Directory.GetCurrentDirectory(); of.Filter = "Text Files (.txt)|*.txt"; var res = of.ShowDialog(); if (res == DialogResult.OK) { Filename = of.SafeFileName; int cpt = 1; Phrases.Clear(); var lines = File.ReadAllLines(of.FileName, Encoding.GetEncoding(1252)); foreach (string l in lines) { if (l[0] != '-' && l != "") { Phrases.Add(l); _stack.Children.Add(new PhraseControl(cpt, l, parole, this)); cpt++; } } PhraseInProgress = Phrases[0]; PhraseId = 0; InProgress = true; } }
public void CreatePhrases() { Phrases.Add("\"What is this? this is very unusual. Your life line goes on and on.\""); Phrases.Add("\"The path of your life will be fraught with many hardships.\""); Phrases.Add("\"Are you in love? Ah? Well you soon will be.\""); Phrases.Add("\"You should not get too comfortable, I see a great change ahead.\""); }
public void CreatePhrases() { Phrases.Add("\"Night time is a dark place for you. Be careful of your choices.\""); Phrases.Add("\"Joy shines upon you with the coming of the dawn.\""); Phrases.Add("\"Stop and wait. Realign your energies. You are in conflict.\""); Phrases.Add("\"Now is the time to act! You must make your move immediately!\""); Phrases.Add("\"I see shiny objects in your near future.\""); Phrases.Add("\"The decorating around you is terrible Feng Shui.\""); Phrases.Add("\"Mars is in high sanction - don't start any business ventures.\""); Phrases.Add("\"If you always face the light, you will never see shadow.\""); Phrases.Add("\"The moon is full.. beware your tomorrows."); Phrases.Add("\"Never take your safety for granted. Death watches and paces restlessly.\""); Phrases.Add("\"The beautiful emerald resonates with your soul. Your aura will protect you.\""); }
public void Deserialize(XmlNode node) { foreach (XmlNode childNode in node.ChildNodes) { switch (childNode.Name) { case "Type": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) { Type = (ProductInfoType)temp; } } break; case "Selected": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) { Selected = temp; } } break; case "Group": Group = childNode.InnerText; break; case "Phrase": Phrases.Add(childNode.InnerText); break; case "UserValue": UserValue = childNode.InnerText; break; } } }
//let's create an overloaded method now protected void CreatePhrases(string phrase) { Phrases.Add(phrase); }
public void CreatePhrases() { Phrases.Add(" has been to many parts of the world. "); Phrases.Add(" was once owned by a white haired man with a beard."); Phrases.Add(" will be important to you in a future endeavor."); }
private void EventHub_HeardSomethingEvent(object sender, HeardSomethingEventArgs e) { Phrases.Add("You: " + e.Phrase); }
private void EventHub_StartTalkingEvent(object sender, StartTalkingEventArgs e) { Phrases.Add(e.Name + ": " + e.Phrase); }
//overloaded method public void CreatePhrases(string phrase) { Phrases.Add(phrase);//this is an overload - the default() version is in the interface! }
public void CreatePhrases(string phrase) { Phrases.Add(phrase); }
public void CreatePhrases() { Phrases.Add(" your lifeline is short, but has amazing adventures in your future. "); Phrases.Add(" your lifeline is long and prosperous."); Phrases.Add(" your lifeline is grand in scale and is awed by many."); }