Exemplo n.º 1
0
 /// <summary>
 /// Instantiates
 /// </summary>
 /// <param name="Rooms"></param>
 public RoomDisplay(List <OrgRoom> Rooms) : base()
 {
     InitializeComponent();
     Objects.Clear();
     Objects.AddRange(Rooms);
     Text = "Room Display";
 }
Exemplo n.º 2
0
 /// <summary>
 /// Import the flatten objects from the <see cref="PrototypeLoader"/>
 /// </summary>
 /// <param name="loader">the loader with the ui data</param>
 public void ImportFlatten(PrototypeLoader loader)
 {
     Objects.AddRange(loader.Objects.ToList().ConvertAll((p) => p.Value.Flatten()));
     foreach (var s in loader.Status)
     {
         Status[s.Key] = s.Value;
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Instantiates
 /// </summary>
 /// <param name="Teams"></param>
 public TeamDisplay(List <OrgTeam> Teams) : base()
 {
     InitializeComponent();
     Objects.Clear();
     Objects.AddRange(Teams);
     Text = "Team Display";
     //DisableAugmentList();
 }
Exemplo n.º 4
0
 public UpdateCertificationObjectsBuilder(UpdateCertificationObjects?source = null) : base()
 {
     if (source != null)
     {
         Objects.AddRange(source.Objects);
         Service = source.Service;
     }
 }
        public override async Task <IReadOnlyList <T> > GetCollectionAsync <T>(string url, RequestOptions options, CancellationToken cancellationToken)
        {
            using (await ReaderLockAsync())
            {
                var readOnlyList = await base.GetCollectionAsync <T>(url, options, cancellationToken).ConfigureAwait(false);

                Objects.AddRange(readOnlyList);
                return(readOnlyList);
            }
        }
        public override async Task <PagedResponse <T> > GetPagedAsync <T>(string url, RequestOptions options, CancellationToken cancellationToken)
        {
            using (await ReaderLockAsync())
            {
                var pagedResponse = await base.GetPagedAsync <T>(url, options, cancellationToken).ConfigureAwait(false);

                Objects.AddRange(pagedResponse.Data);
                return(pagedResponse);
            }
        }
Exemplo n.º 7
0
 void LoadMap()
 {
     using (var stream = new System.IO.FileStream("./Content/Levels/Level_01.png", System.IO.FileMode.Open))
     {
         Map.Load(Texture2D.FromStream(Game.Graphics.GraphicsDevice, stream));
         Objects.Clear();
         Objects.AddRange(Map.GetObstacles());
         Enemies.Clear();
         Enemies.AddRange(Map.GetEnemies());
     }
 }
Exemplo n.º 8
0
        /// <summary>
        ///   Helper methods which simply adding items to current collection by dealing with
        ///   synchronization and asynchronous operations.
        /// </summary>
        /// <param name="dbQuery">The parametrized DB query.</param>
        /// <returns>Added item count</returns>
        protected async Task <int> AddItemsAsync(ITableQueryAsync <T> dbQuery)
        {
            // Get items asynchronously
            var items = await dbQuery.ToListAsync().ConfigureAwait(false);

            // Add to collection
            lock (LockObject)
                Objects.AddRange(items);

            return(items.Count);
        }
Exemplo n.º 9
0
 public void TakeAllFrom(MetaSet set)
 {
     Objects.AddRange(set.Objects);
     Actions.AddRange(set.Actions);
     Tutorials.AddRange(set.Tutorials);
     Mechanisms.AddRange(set.Mechanisms);
     Tags.AddRange(set.Tags);
     Commands.AddRange(set.Commands);
     Languages.AddRange(set.Languages);
     Events.AddRange(set.Events);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Returns a list of objects from the datastore
 /// </summary>
 /// <returns></returns>
 public override IEnumerable <DBObject> GetObjects()
 {
     if (Objects.Count < 1)
     {
         lock (Objects)
         {
             Objects.AddRange(_dstore.Connection.GetSchemaTables(_dstore));
         }
     }
     return(Objects);
 }
Exemplo n.º 11
0
        /// <summary>
        ///   Manually add items.
        /// </summary>
        /// <param name="items">Objects to add</param>
        /// <param name="sort">
        ///   Whether to sort list following items addition.
        /// </param>
        public virtual void AddManual(IEnumerable <T> items, bool sort = true)
        {
            lock (LockObject)
            {
                Objects.AddRange(items);

                if (sort)
                {
                    Sort();
                }
            }
        }
Exemplo n.º 12
0
        /// <summary>
        ///     Copy attachments to another messageAttachments
        ///     Use to prevent bad behaviour when you use :
        ///     messageA.Attachments = messageB.Attachments
        /// </summary>
        /// <param name="attachments"></param>
        public void Copy(MessageAttachments attachments)
        {
            if (attachments is null)
            {
                throw new ArgumentNullException(nameof(attachments));
            }

            Objects.AddRange(attachments.Objects);
            KnowledgeId   = attachments.KnowledgeId;
            KnowledgeBit  = attachments.KnowledgeBit;
            KnowledgeBits = attachments.KnowledgeBits;
            BeliefBits    = attachments.BeliefBits;
        }
Exemplo n.º 13
0
        internal override void ReadContent(EndianBinaryReader reader, IOContext context)
        {
            var objectListCount = reader.ReadInt32();

            reader.ReadOffset(() =>
            {
                for (int i = 0; i < objectListCount; i++)
                {
                    var list = reader.ReadObject <FieldObjectList>();
                    Objects.AddRange(list);
                }
            });
            Field1C = reader.ReadObjectOffset <FieldSceneField1CData>();
        }
Exemplo n.º 14
0
 private void UpdateObjects()
 {
     if (!FollowSelection)
     {
         UpdateKeyValues();
         UpdateVisgroups(false);
         return;
     }
     Objects.Clear();
     if (!Document.Selection.InFaceSelection)
     {
         Objects.AddRange(Document.Selection.GetSelectedParents());
     }
     RefreshData();
 }
Exemplo n.º 15
0
        public async Task OnPostAsync()
        {
            try
            {
                Connection.Open();

                ExceptionMessage = null;

                Objects.Clear();

                switch (SelectedInfoType)
                {
                case null:
                    throw new Exception("type of information isn't chosed");

                case "studentToCourse":
                    if (!AreAllInputFieldsFilled())
                    {
                        throw new Exception("All input fields must be filled (with non-zero value)");
                    }

                    await Repository.CreateStudentCourseAsync(Connection, (FirstInputField, SecondInputField));

                    Objects.AddRange(await Repository.GetAllStudentsInCourseAsync(Connection, SecondInputField));
                    break;

                case "lecturerToCourse":
                    if (!AreAllInputFieldsFilled())
                    {
                        throw new Exception("All input fields must be filled (with non-zero value)");
                    }

                    await Repository.CreateCourseLecturerAsync(Connection, (SecondInputField, FirstInputField));

                    Objects.AddRange(await Repository.GetAllLecturersForCourseAsync(Connection, SecondInputField));
                    break;
                }
            }
            catch (Exception ex)
            {
                ExceptionMessage = "Error: " + ex.Message;
            }
            finally
            {
                Connection.Close();
            }
        }
Exemplo n.º 16
0
        public void NextTick()
        {
            for (int i = 0; i < _sweeperDodgers.Count; i++)
            {
                var sweeper = _sweeperDodgers[i];

                var mines       = Objects.Where(x => x.Item1 == ObjectType.Mine).Select(x => x.Item2).ToList();
                var closestMine = DistanceCalculator.GetClosestObject(sweeper.Motion.Position, mines);

                var holes       = Objects.Where(x => x.Item1 == ObjectType.Hole).Select(x => x.Item2).ToList();
                var closestHole = DistanceCalculator.GetClosestObject(sweeper.Motion.Position, holes);

                sweeper.Update(closestMine, closestHole);

                var mineCollision = DistanceCalculator.DetectCollision(sweeper.Motion.Position, closestMine, Settings.TouchDistance);
                if (mineCollision)
                {
                    var mine = Objects.Where(x => x.Item1 == ObjectType.Mine).Single(x => x.Item2.VectorEquals(closestMine));
                    Objects.Remove(mine);
                    if (Settings.ReplaceMine)
                    {
                        Objects.AddRange(GetObjects(ObjectType.Mine, 1));
                    }
                    sweeper.IncreaseFitness(1);
                }

                if (holes.Count > 0)
                {
                    var holeCollision = DistanceCalculator.DetectCollision(sweeper.Motion.Position, closestHole, Settings.TouchDistance);
                    if (holeCollision)
                    {
                        var hole = Objects.Where(x => x.Item1 == ObjectType.Hole).Single(x => x.Item2.VectorEquals(closestHole));
                        Objects.Remove(hole);
                        //Objects.AddRange(GetObjects(ObjectType.Hole, 1));
                        sweeper.DecreaseFitness(10);
                    }
                }
            }
            Population.UpdateFitnessStats();
        }
Exemplo n.º 17
0
 public RoomGroup Load(Game game)
 {
     if (!isLoaded)
     {
         isLoaded = true;
         Objects.Clear();
         int minX = -1, minY = -1, maxX = -1, maxY = -1;
         for (int i = 0; i < RoomDatas.Count; i++)
         {
             JObject rd = RoomDatas.Values[i];
             int     x  = (int)rd["X"];
             int     y  = (int)rd["Y"];
             if (x < minX || minX == -1)
             {
                 minX = x;
             }
             if (x > maxX || maxX == -1)
             {
                 maxX = x;
             }
             if (y < minY || minY == -1)
             {
                 minY = y;
             }
             if (y > maxY || maxY == -1)
             {
                 maxY = y;
             }
             Room r = LoadRoom(rd, game);
             Objects.AddRange(r.Objects);
         }
         X = minX;
         Y = minY;
         w = maxX + 1 - minX;
         h = maxY + 1 - minY;
     }
     return(this);
 }
Exemplo n.º 18
0
        /// <summary>
        /// Find and process matched objects
        /// </summary>
        /// <param name="namePattern"></param>
        /// <remarks>
        /// patterns have 2 parts: xxx.nnn, where xxx is the object type (equivalent to file extension)
        /// and nnn is the name.
        /// <list type="bullet">
        /// <item>
        /// <description><c>object type</c>: can be * or a supported file extension for the Access file format</description>
        /// <description><c>name</c>: the name of an object or name with one or more asterix</description>
        /// </item>
        /// </list>
        /// </remarks>
        private void ProcessObjectsWithWildcards(string namePattern)
        {
            Regex regex = new Regex(@"(\*|\w{3})\.(.+)", RegexOptions.IgnoreCase);
            Match match = regex.Match(namePattern);

            if (match == null)
            {
                throw new CommandLineException(Properties.Resources.InvalidObjectName);
            }

            InitializeAccessApplication();

            string pattern = match.Groups[2].Value;

            if (pattern == "*")
            {
                pattern = "^" + pattern.Replace("*", ".*") + "$";
            }

            if (match.Groups[1].Value == "*")
            {
                foreach (ContainerNames container in App.AllowedContainers)
                {
                    Objects.AddRange(App.LoadObjectNames(container.InvariantName).
                                     Where(x => Regex.IsMatch(x.Name, pattern, RegexOptions.IgnoreCase)));
                }
            }
            else
            {
                FileExtensions fileExtension;
                Enum.TryParse <FileExtensions>(match.Groups[1].Value, true, out fileExtension);
                string containerInvariantName = App.AllowedContainers.Find(fileExtension).Container.InvariantName;
                Objects.AddRange(App.LoadObjectNames(containerInvariantName).
                                 Where(x => Regex.IsMatch(x.Name, pattern, RegexOptions.IgnoreCase)));
            }
        }
        // Methods
        public override void Load(Stream fileStream,
                                  Dictionary <string, SetObjectType> objectTemplates)
        {
            if (objectTemplates == null)
            {
                throw new ArgumentNullException("objectTemplates",
                                                "Cannot load Heroes set data without object templates.");
            }

            // We use lists so we don't have to skip null entries later
            var objs         = new List <SetObject>();
            var miscEntryIDs = new List <ushort>();

            // Object Entries
            var reader = new ExtendedBinaryReader(fileStream, Encoding.ASCII, true);

            for (uint i = 0; i < HeroesObjectLimit; ++i)
            {
                var   pos  = reader.ReadVector3();
                float rotX = (float)(reader.ReadInt32() * 180.0 / 32768.0);
                float rotY = (float)(reader.ReadInt32() * 180.0 / 32768.0);
                float rotZ = (float)(reader.ReadInt32() * 180.0 / 32768.0);

                ushort unknown1  = reader.ReadUInt16();
                byte   stageType = reader.ReadByte();
                byte   unknown2  = reader.ReadByte();
                uint   unknown3  = reader.ReadUInt32();
                ulong  unknown4  = reader.ReadUInt64(); // Repeat of the last 8 bytes?

                byte objList        = reader.ReadByte();
                byte objType        = reader.ReadByte();
                byte linkID         = reader.ReadByte();
                byte renderDistance = reader.ReadByte();

                ushort unknown5 = reader.ReadUInt16();
                if (unknown5 != 0)
                {
                    Console.WriteLine("WARNING: Unknown5 != 0! ({0})", unknown5);
                }

                ushort miscEntryID = reader.ReadUInt16();

                // Check if what we just read is a blank entry
                if (objList == 0 && objType == 0)
                {
                    continue;
                }

                // Make sure we have a template for the object as well
                string objectType = string.Format("{0:x2}-{1:x2}", objList, objType);
                if (!objectTemplates.ContainsKey(objectType))
                {
                    Console.WriteLine("Skipping obj type {0}...", objectType);
                    continue;
                }

                // Otherwise, generate a new object and add it to the list.
                miscEntryIDs.Add(miscEntryID);
                objs.Add(new SetObject()
                {
                    ObjectID   = i,
                    ObjectType = objectType,

                    CustomData =
                    {
                        { "StageType",      new SetObjectParam(typeof(byte), stageType)      },
                        { "LinkID",         new SetObjectParam(typeof(byte), linkID)         },
                        { "RenderDistance", new SetObjectParam(typeof(byte), renderDistance) },
                    },

                    Transform = new SetObjectTransform()
                    {
                        Position = pos,
                        // TODO: Make sure rotation is correct
                        Rotation = new Quaternion(new Vector3(rotX, rotY, rotZ), false)
                    }
                });
            }

            // Object Parameters
            for (int i = 0; i < objs.Count; ++i)
            {
                var obj = objs[i];

                // Get the Set Object Type and jump to the correct misc entry
                var setObjType = objectTemplates[obj.ObjectType];

                reader.BaseStream.Position = 4 + // We skip the first 4 bytes like the game does
                                             MiscEntriesStartPos + (miscEntryIDs[i] * MiscEntryLength);

                // Read the parameters according to the template
                foreach (var param in setObjType.Parameters)
                {
                    obj.Parameters.Add(new SetObjectParam(param.DataType,
                                                          reader.ReadByType(param.DataType)));
                }
            }

            Objects.AddRange(objs);
        }
Exemplo n.º 20
0
 public void SetObjects(IEnumerable <MapObject> objects)
 {
     Objects.Clear();
     Objects.AddRange(objects);
     RefreshData();
 }
Exemplo n.º 21
0
 private void createNewObjects()
 {
     Objects.Clear();
     Objects.AddRange(GetObjects(ObjectType.Mine, Settings.MineCount));
     Objects.AddRange(GetObjects(ObjectType.Hole, Settings.MineCount));
 }
Exemplo n.º 22
0
 public void Callback(uint numObjects, ClrObjectData[] objects)
 {
     Objects.AddRange(objects.Select(x => new ObjectInfo(x)));
 }
Exemplo n.º 23
0
        public async Task OnPostAsync()
        {
            try
            {
                Connection.Open();

                ExceptionMessage = null;

                Objects.Clear();

                ResultMessage = "All specified objects were disconnected successfully";

                switch (SelectedInfoType)
                {
                    case null:
                        throw new Exception("type of information isn't chosed");
                    case "studentFromCourse":
                        if (!AreAllInputFieldsFilled())
                            throw new Exception("All input fields must be filled (with non-zero value)");

                        var numberOfAffectedStudentsCoursesRows = await Repository.DeleteStudentCourseAsync(Connection, (FirstInputField, SecondInputField));
                        
                        if (numberOfAffectedStudentsCoursesRows == 0)
                            ResultMessage = "There isn't student with such ID that studies on this course";
                        else
                        {
                            ResultMessage = "Student was disconnected from course successfully. List of students on this course:";
                            Objects.AddRange(await Repository.GetAllStudentsInCourseAsync(Connection, SecondInputField));
                        }
                        break;
                    case "lecturerFromCourse":
                        if (!AreAllInputFieldsFilled())
                            throw new Exception("All input fields must be filled (with non-zero value)");

                        var numberOfAffectedCoursesLecturersRows = await Repository.DeleteCourseLecturerAsync(Connection, (SecondInputField, FirstInputField));

                        if (numberOfAffectedCoursesLecturersRows == 0)
                            ResultMessage = "There isn't lecturer with such ID that teaches on this course";
                        else
                        {
                            ResultMessage = "Lecturer was disconnected from course successfully. List of lecturers on this course:";
                            Objects.AddRange(await Repository.GetAllLecturersForCourseAsync(Connection, SecondInputField));
                        }
                        break;
                    case "allStudentsFromAllCourses":
                        var numberOfDeletedStudentsCoursesRows = await Repository.DeleteAllStudentCoursesAsync(Connection);

                        if (numberOfDeletedStudentsCoursesRows == 0)
                            ResultMessage = "There aren't any students on any courses";
                        break;
                    case "allLecturersFromAllCourses":
                        var numberOfDeletedCoursesLecturersRows = await Repository.DeleteAllCoursesLecturersAsync(Connection);

                        if (numberOfDeletedCoursesLecturersRows == 0)
                            ResultMessage = "There aren't any lecturers on any courses";
                        break;
                }
            }
            catch (Exception ex)
            {
                ExceptionMessage = "Error: " + ex.Message;
            }
            finally
            {
                Connection.Close();
            }
        }
Exemplo n.º 24
0
        public async Task OnPostAsync()
        {
            try
            {
                Connection.Open();

                ExceptionMessage = null;

                Objects.Clear();

                ResultMessage = "All specified objects were deleted successfully";

                switch (SelectedInfoType)
                {
                case null:
                    throw new Exception("type of information isn't chosed");

                case "allStudents":
                    var numberOfDeletedStudentsRows = await Repository.DeleteAllStudentsAsync(Connection);

                    if (numberOfDeletedStudentsRows == 0)
                    {
                        ResultMessage = "There aren't any students in database";
                    }
                    else
                    {
                        Objects.AddRange(await Repository.GetAllStudentsAsync(Connection));
                    }
                    break;

                case "allCourses":
                    var numberOfDeletedCoursesRows = await Repository.DeleteAllCoursesAsync(Connection);

                    if (numberOfDeletedCoursesRows == 0)
                    {
                        ResultMessage = "There aren't any courses in database";
                    }
                    else
                    {
                        Objects.AddRange(await Repository.GetAllCoursesAsync(Connection));
                    }
                    break;

                case "allLecturers":
                    var numberOfDeletedLecturersRows = await Repository.DeleteAllLecturersAsync(Connection);

                    if (numberOfDeletedLecturersRows == 0)
                    {
                        ResultMessage = "There aren't any lecturers in database";
                    }
                    else
                    {
                        Objects.AddRange(await Repository.GetAllLecturersAsync(Connection));
                    }
                    break;

                case "allHomeTasks":
                    var numberOfDeletedHometasksRows = await Repository.DeleteAllHomeTasksAsync(Connection);

                    if (numberOfDeletedHometasksRows == 0)
                    {
                        ResultMessage = "There aren't any hometask in database";
                    }
                    else
                    {
                        Objects.AddRange(await Repository.GetAllHomeTasksAsync(Connection));
                    }
                    break;

                case "allGrades":
                    var numberOfDeletedGradesRows = await Repository.DeleteAllGradesAsync(Connection);

                    if (numberOfDeletedGradesRows == 0)
                    {
                        ResultMessage = "There aren't any grades in database";
                    }
                    else
                    {
                        Objects.AddRange(await Repository.GetAllGradesAsync(Connection));
                    }
                    break;

                case "studentWithDefiniteID":
                    if (!IsFirstInputFieldFilled())
                    {
                        throw new Exception("student ID field must be filled (with non-zero value)");
                    }

                    var numberOfAffectedStudentRows = await Repository.DeleteStudentAsync(Connection, FirstInputField);

                    if (numberOfAffectedStudentRows == 0)
                    {
                        ResultMessage = "There isn't student with such ID in database";
                    }
                    else
                    {
                        ResultMessage = "Object was deleted successfully";
                        Objects.AddRange(await Repository.GetAllStudentsAsync(Connection));
                    }
                    break;

                case "courseWithDefiniteID":
                    if (!IsFirstInputFieldFilled())
                    {
                        throw new Exception("course ID field must be filled (with non-zero value)");
                    }

                    var numberOfAffectedCourseRows = await Repository.DeleteCourseAsync(Connection, FirstInputField);

                    if (numberOfAffectedCourseRows == 0)
                    {
                        ResultMessage = "There isn't course with such ID in database";
                    }
                    else
                    {
                        ResultMessage = "Object was deleted successfully";
                        Objects.AddRange(await Repository.GetAllCoursesAsync(Connection));
                    }
                    break;

                case "lecturerWithDefiniteID":
                    if (!IsFirstInputFieldFilled())
                    {
                        throw new Exception("lecturer ID field must be filled (with non-zero value)");
                    }

                    var numberOfAffectedLecturerRows = await Repository.DeleteLecturerAsync(Connection, FirstInputField);

                    if (numberOfAffectedLecturerRows == 0)
                    {
                        ResultMessage = "There isn't lecturer with such ID in database";
                    }
                    else
                    {
                        ResultMessage = "Object was deleted successfully";
                        Objects.AddRange(await Repository.GetAllLecturersAsync(Connection));
                    }
                    break;

                case "hometaskWithDefiniteID":
                    if (!IsFirstInputFieldFilled())
                    {
                        throw new Exception("hometask ID field must be filled (with non-zero value)");
                    }

                    var numberOfAffectedHometaskRows = await Repository.DeleteHomeTaskAsync(Connection, FirstInputField);

                    if (numberOfAffectedHometaskRows == 0)
                    {
                        ResultMessage = "There isn't hometask with such ID in database";
                    }
                    else
                    {
                        ResultMessage = "Object was deleted successfully";
                        Objects.AddRange(await Repository.GetAllHomeTasksAsync(Connection));
                    }
                    break;

                case "gradeWithDefiniteID":
                    if (!IsFirstInputFieldFilled())
                    {
                        throw new Exception("grade ID field must be filled (with non-zero value)");
                    }

                    var numberOfAffectedGradeRows = await Repository.DeleteGradeAsync(Connection, FirstInputField);

                    if (numberOfAffectedGradeRows == 0)
                    {
                        ResultMessage = "There isn't grade with such ID in database";
                    }
                    else
                    {
                        ResultMessage = "Object was deleted successfully";
                        Objects.AddRange(await Repository.GetAllGradesAsync(Connection));
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                ExceptionMessage = "Error: " + ex.Message;
            }
            finally
            {
                Connection.Close();
            }
        }
Exemplo n.º 25
0
        public async Task OnGetAsync()
        {
            try
            {
                Connection.Open();

                ExceptionMessage = null;

                Objects.Clear();

                switch (SelectedInfoType)
                {
                case "allStudents":
                    Objects.AddRange(await Repository.GetAllStudentsAsync(Connection));
                    break;

                case "allCourses":
                    Objects.AddRange(await Repository.GetAllCoursesAsync(Connection));
                    break;

                case "allLecturers":
                    Objects.AddRange(await Repository.GetAllLecturersAsync(Connection));
                    break;

                case "allHomeTasks":
                    Objects.AddRange(await Repository.GetAllHomeTasksAsync(Connection));
                    break;

                case "allGrades":
                    Objects.AddRange(await Repository.GetAllGradesAsync(Connection));
                    break;

                case "allCoursesForStudent":
                    if (!IsFilterFieldFilled())
                    {
                        throw new Exception("student ID field must be filled (with non-zero value)");
                    }
                    Objects.AddRange(await Repository.GetAllCoursesForStudentAsync(Connection, FilterField));
                    break;

                case "allStudentsInCourse":
                    if (!IsFilterFieldFilled())
                    {
                        throw new Exception("course ID field must be filled (with non-zero value)");
                    }
                    Objects.AddRange(await Repository.GetAllStudentsInCourseAsync(Connection, FilterField));
                    break;

                case "allLecturersForCourse":
                    if (!IsFilterFieldFilled())
                    {
                        throw new Exception("course ID field must be filled (with non-zero value)");
                    }
                    Objects.AddRange(await Repository.GetAllLecturersForCourseAsync(Connection, FilterField));
                    break;

                case "allCoursesWithDefiniteLecturer":
                    if (!IsFilterFieldFilled())
                    {
                        throw new Exception("lecturer ID field must be filled (with non-zero value)");
                    }
                    Objects.AddRange(await Repository.GetAllCoursesWithDefiniteLecturerAsync(Connection, FilterField));
                    break;
                }
            }
            catch (Exception ex)
            {
                ExceptionMessage = "Error: " + ex.Message;
            }
            finally
            {
                Connection.Close();
            }
        }
Exemplo n.º 26
0
 public Problem Add(IEnumerable <IMapObject> objs)
 {
     Objects.AddRange(objs);
     return(this);
 }
Exemplo n.º 27
0
 public MedinaSiteSectorBuilder WithObjects(List <File3dmObject> objects)
 {
     Objects.AddRange(objects);
     return(this);
 }
Exemplo n.º 28
0
 public Scene(List <MaterialObject> objects, List <LightSource> lights)
 {
     Objects.AddRange(objects);
     Objects.AddRange(lights);
     Lights.AddRange(lights);
 }
Exemplo n.º 29
0
 public void Cancel()
 {
     _objectsStorage.AddRange(_objects);
     _objectsStorage.OnChanged();
 }