Esempio n. 1
0
    public string GetCurrCharacter()
    {
        string myText = currCharacter;

        myText = myText.Replace("MC", MyName.GetName());
        return(myText);
    }
Esempio n. 2
0
    public string GetMainText()
    {
        string myText = this.GetComponent <Text>().text;

        myText = myText.Replace("MC", MyName.GetName());
        return(myText);
    }
Esempio n. 3
0
    void Start()
    {
        textFilePath    = "Text Files/" + MyName.Substring(0, MyName.Length - 4);
        contentText     = Resources.Load <TextAsset>(textFilePath);
        contentTMP      = transform.Find("Body/Viewport/Content").GetComponent <TMP_Text>();
        contentTMP.text = contentText.text;

        RectTransform contentRT = transform.Find("Body/Viewport/Content").GetComponent <RectTransform>();

        contentRT.sizeDelta = new Vector2(contentTMP.preferredWidth * 0.75f, contentTMP.preferredHeight + 10);
    }
Esempio n. 4
0
        private MyName pushName(string name)
        {
            _logger.LogInformation(LoggingEvents.InsertItem, $"Insert name {name}, DateTime:{DateTime.Now}");
            var myname = new MyName();

            myname.Id   = Guid.NewGuid();
            myname.Name = name;
            _context.Names.Add(myname);
            //_context.SaveChanges();

            return(myname);
        }
Esempio n. 5
0
        public void When_Divisible_by_3_Then_Name()
        {
            // AAA
            // Arrange
            // - Inicializa el nombre
            // - Inicializa un número divisible por 3 --> 3
            var numberDivisibleByThree = number % 3 == 0;
            // Act
            var myNameLogic = new MyName();
            var result      = myNameLogic.GetValue(name, lastName, number);

            // Assert
            Assert.AreEqual(result);
        }
Esempio n. 6
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (MyName.Text == "demo" && Password.Text == "demo")
     {
         new Form2().Show();
         this.Hide();
     }
     else
     {
         MessageBox.Show("The username or the password are incorrect");
         MyName.Clear();
         Password.Clear();
         MyName.Focus();
     }
 }
Esempio n. 7
0
 public static void Load(byte[] data)
 {   //read byte array in same order as its written above
     using (MemoryStream stream = new MemoryStream(data))
     {
         using (BinaryReader reader = new BinaryReader(stream))
         {
             MyBoolean = reader.ReadBoolean();
             MyByte    = reader.ReadByte();
             MyShort   = reader.ReadInt16();
             MyInt     = reader.ReadInt32();
             MyFloat   = reader.ReadSingle();
             //you'll need to cast enums when reading too
             MyName = (MyName)reader.ReadByte();
         }
     }
 }
Esempio n. 8
0
        public ActionResult <string> inserName([FromBody] MyName _name)
        {
            Console.WriteLine(" ----------> " + _name.Vorname + " " + _name.Name);

            return(JsonConvert.SerializeObject("Done insert Name: " + _name.Name));
        }
Esempio n. 9
0
 private void label2_Click(object sender, EventArgs e)
 {
     MyName.Clear();
     Password.Clear();
 }
Esempio n. 10
0
        public void XMLWriteFile(string NodeLocation, string NodeName, string NodeValue)
        {
            string XmlRoot;

            if (NodeLocation == xmlUserNameLocation)
            {
                XmlRoot = xmlRootUserLocation;
            }
            else
            {
                XmlRoot = xmlRootUserLocation + "/" + NodeLocation;
            }

            XmlDocument m_xmld = new XmlDocument();

            try
            {
                XmlNodeList m_nodelist;
                string      StrTemp           = "";
                bool        BlnFoundAttribute = false;

                // Create the Attribute
                XmlAttribute aValue = m_xmld.CreateAttribute("value");
                aValue.Value = NodeValue;

                // Does the file Exist?
                if (!File.Exists(PathandFileName))
                {
                    XmlDocument xmlCreate = new XmlDocument();
                    // Create the Root
                    XmlElement Root    = xmlCreate.CreateElement(Configuration);
                    XmlNode    AppNode = xmlCreate.AppendChild(Root);
                    xmlCreate.AppendChild(Root);

                    // Create the username
                    XmlElement MyName = xmlCreate.CreateElement(NodeLocation);
                    AppNode.AppendChild(MyName);

                    // Save to disk
                    xmlCreate.Save(PathandFileName);
                }

                //# Load the Xml file
                m_xmld.Load(PathandFileName);

                //# Get the list of name nodes
                m_nodelist = m_xmld.SelectNodes(XmlRoot);

                if (m_nodelist.Count == 0)
                {
                    // need to create the Element
                    XmlElement ElementName = m_xmld.CreateElement(NodeLocation);

                    XmlNodeList DocumentNode = m_xmld.SelectNodes(xmlRootUserLocation);
                    foreach (XmlNode MyName in DocumentNode)
                    {
                        // There should be only on - I am using a loop to make sure the
                        // If something has been added - this should write the data in the correct section
                        if (MyName.Name == UserName)
                        {
                            MyName.AppendChild(ElementName);
                            m_xmld.Save(PathandFileName);
                            break;
                        }
                    }


                    // now select the Created Element
                    m_nodelist = m_xmld.SelectNodes(XmlRoot);
                }


                //# Loop through the nodes
                foreach (XmlNode m_node in m_nodelist)
                {
                    if (m_node.Name == NodeLocation)
                    {
                        //Look for the correct values
                        for (int intloop = 0; intloop < m_node.ChildNodes.Count; intloop++)
                        {
                            if ((m_node.ChildNodes.Item(intloop).Attributes != null))
                            {
                                //Load the key to see if you have the correct one
                                if (m_node.ChildNodes.Item(intloop).Attributes.GetNamedItem("key") != null)
                                {
                                    StrTemp = m_node.ChildNodes.Item(intloop).Attributes.GetNamedItem("key").Value;
                                    if (StrTemp == NodeName)
                                    {
                                        // return the value
                                        m_node.ChildNodes.Item(intloop).Attributes.SetNamedItem(aValue);
                                        BlnFoundAttribute = true;
                                        break;  // intloop exit
                                    }
                                }
                            }
                        }
                        if (!BlnFoundAttribute)
                        {
                            // create entry
                            //Reference
                            // http://groups.google.com/group/microsoft.public.xml/browse_frm/thread/d722490293c78e6/99e2eacfe9cdbd4a?lnk=st+q=vb.net+XmlNode+attribute+add+rnum=5+hl=en#99e2eacfe9cdbd4a
                            //
                            XmlNode      nn   = m_xmld.CreateElement("add");
                            XmlAttribute aKey = m_xmld.CreateAttribute("key");

                            // Set values
                            aKey.Value = NodeName;

                            // Append attributes to new node
                            nn.Attributes.Append(aKey);
                            nn.Attributes.Append(aValue);

                            // Add node to current node
                            m_node.AppendChild(nn);
                        }
                    }
                }

                // Write the result to disc
                m_xmld.Save(PathandFileName);
            }
            catch
            {
                throw;
            }
            finally
            {
                //if (m_xmld != null) { m_xmld = null; }
            }
        }
Esempio n. 11
0
 public void AddMeToDb(MyName myName)
 {
     context.MyName.Add(myName);
     context.SaveChangesAsync();
 }
 public void AddMeToDb(MyName myName)
 {
     throw new NotImplementedException();
 }
Esempio n. 13
0
 public override int GetHashCode()
 {
     // Для .Net Core
     // return HashCode.Combine(MyName, IdPass, DateOfBirth, City);
     return(MyName.GetHashCode() ^ IdPass ^ DateOfBirth.GetHashCode() ^ City.GetHashCode());
 }
Esempio n. 14
0
 private void clearName(MyName myName)
 {
     _logger.LogInformation(LoggingEvents.DeleteItem, $"Delete name {myName.Name}, DateTime:{DateTime.Now}");
     _context.Names.Remove(myName);
     //_context.SaveChanges();
 }