public string PersonProperty_Add_Succeed(bool isAnd = false, params string[] persons)
        {
            PersonProperty property = new PersonProperty(isAnd);

            foreach (var item in persons)
            {
                property.AddPerson(item);
            }

            return(property.ToString());
        }
예제 #2
0
 public override string ToString()
 {
     string allInfo = ($"\n  Data of the graduate student:\n {PersonProperty.ToString()}\n  Employee position {EmployeePosition}\n Data of the supervisor: {Supervisor}" +
                $"Form of study {Form}\n learning year {LearningYear}\n List of Articles:\n");
     foreach (Article a in ArticlesPublished)
     {
         allInfo += a.ToString();
     }
     allInfo += $"Last Article: {LastArticle}\n List of notes:\n";//added output of last article
     foreach (Notes n in NotesMade)
     {
         allInfo += n.ToString();
     }
     return allInfo;
 }
예제 #3
0
        /// <summary>
        /// Получение свойств персон (должностей)
        /// </summary>
        /// <param name="personPropertyEntities"></param>
        /// <returns></returns>
        private List <PersonProperty> MapProperties(List <PersonPropertyReferent> personPropertyEntities)
        {
            var personProperties = new List <PersonProperty>();

            foreach (var personPropertyEntity in personPropertyEntities)
            {
                var personProperty = new PersonProperty()
                {
                    Name      = personPropertyEntity.Name,
                    Positions = MapPositions(personPropertyEntity.Occurrence)
                };
                personProperties.Add(personProperty);
            }
            return(personProperties);
        }
        public static void RunTest()
        {
            DateTime start, end;

            Console.WriteLine("# Starting 'Property' performance test...");
            start = DateTime.Now;
            for (int i = 0; i < 100000000; i++)
            {
                PersonProperty person = new PersonProperty()
                {
                    FirstName = "Nickolas",
                    LastName  = "Gupton",
                    Age       = 22
                };
            }
            end = DateTime.Now;
            Console.WriteLine("# Done. For 100,000,000 iterations it took: " + Utils.GetFormattedDuration(start, end));
            Console.WriteLine();


            Console.WriteLine("# Starting 'Member' performance test...");
            start = DateTime.Now;
            for (int i = 0; i < 100000000; i++)
            {
                PersonMember person = new PersonMember()
                {
                    FirstName = "Nickolas",
                    LastName  = "Gupton",
                    Age       = 22
                };
            }
            end = DateTime.Now;
            Console.WriteLine("# Done. For 100,000,000 iterations it took: " + Utils.GetFormattedDuration(start, end));


            Console.WriteLine();
            Console.WriteLine("Using Members instead of Properties can lead to a decent \n"
                              + "speed increase since there is not the additional overhead \n"
                              + "associated with the method calls for the getters and setters.");
        }
예제 #5
0
 SetValue(PersonProperty, value);
예제 #6
0
    public void Read(TProtocol iprot)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            TField field;
            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.Struct)
                    {
                        Person_property = new PersonProperty();
                        Person_property.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.Struct)
                    {
                        Page_property = new PageProperty();
                        Page_property.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.Struct)
                    {
                        Equiv = new EquivEdge();
                        Equiv.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.Struct)
                    {
                        Page_view = new PageViewEdge();
                        Page_view.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
        public string PersonProperty_Structure_Succeed(bool isAnd = false, params string[] persons)
        {
            PersonProperty property = new PersonProperty(isAnd, persons);

            return(property.ToString());
        }