Example #1
0
        public StartUpViewModel(IScreen screen) : base(screen)
        {
            IsDbAvailable = App.Features.InAppDatabase == Infrastructure.Features.FeatureAvailability.Available &&
                            App.Features.MultiUserEnabled == Infrastructure.Features.FeatureAvailability.Available;
            Identifier = new TestIndentifier {
                ImpulseRate = _minimumImpulseRate, Correction = false
            };

            NavigateCommand      = ReactiveCommand.Create(StartTest);
            NavigateToturialMode = ReactiveCommand.Create(StartTurotial);
            Quantums             = QuantumTypeLookup.Load();
            Counts          = TestCountTypeLookup.Load();
            SelectedQuantum = Quantums.FirstOrDefault(x => x.Item == Quantum.TwoHalf);
            SelectedCount   = Counts.FirstOrDefault(x => x.Item == TestCount.Sixty);
            Representations = RepresentationTypeLookup.Load();

            SelectedRepresentation = Representations.FirstOrDefault(x => x.Item == RepresentationType.UI);
            SelectedUser           = UserManager.GetDefaultUser();
            SuggestedUsers         = new ObservableCollection <User>();
            this.WhenActivated(disposables =>
            {
                this
                .WhenAnyValue(x => x.SelectedRepresentation)
                .WhereNotNull()
                .Subscribe(x => Identifier.RepresentationType = x.Item)
                .DisposeWith(disposables);

                this.WhenAnyValue(x => x.SearchTerm)
                .WhereNotNull()
                .Subscribe(term => Search(term.Trim()));
            });
        }
Example #2
0
 public override string WhereRule()
 {
     if (Representations.OfType <IfcShapeModel>().Count() != Representations.Count)
     {
         return
             ("WR11 ProductDefinitionShape: Only representations of type IfcShapeModel, i.e. either IfcShapeRepresentation or IfcTopologyRepresentation should be used to represent a product through the IfcProductDefinitionShape");
     }
     return("");
 }
Example #3
0
        public override string GetStepParameters()
        {
            var parameters = new List <string>();

            parameters.Add(Name != null ? Name.ToStepValue() : "$");
            parameters.Add(Description != null ? Description.ToStepValue() : "$");
            parameters.Add(Representations != null ? Representations.ToStepValue() : "$");

            return(string.Join(", ", parameters.ToArray()));
        }
Example #4
0
 public override string WhereRule()
 {
     if (Representations.OfType <IfcStyledRepresentation>().Count() != Representations.Count)
     {
         return
             ("WR11 MaterialDefinitionRepresentation: Only representations of type StyledRepresentation should be used to represent material through the MaterialRepresentation. ");
     }
     else
     {
         return("");
     }
 }
        /// <summary>
        /// Processes IfcProductRepresentation attributes.
        /// </summary>
        /// <param name="ifcProductRepresentation">The IfcProductRepresentation handle.</param>
        protected override void Process(IFCAnyHandle ifcProductRepresentation)
        {
            base.Process(ifcProductRepresentation);

            Name = IFCImportHandleUtil.GetOptionalStringAttribute(ifcProductRepresentation, "Name", null);

            Description = IFCImportHandleUtil.GetOptionalStringAttribute(ifcProductRepresentation, "Description", null);

            List <IFCAnyHandle> representations =
                IFCAnyHandleUtil.GetAggregateInstanceAttribute <List <IFCAnyHandle> >(ifcProductRepresentation, "Representations");

            if (representations != null)
            {
                foreach (IFCAnyHandle representationHnd in representations)
                {
                    try
                    {
                        IFCRepresentation representation = IFCRepresentation.ProcessIFCRepresentation(representationHnd);
                        if (representation != null)
                        {
                            if (representation.RepresentationItems.Count > 0 || representation.BoundingBox != null)
                            {
                                Representations.Add(representation);
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        string msg = ex.Message;
                        // Ignore some specific errors.
                        if (msg != null)
                        {
                            if (!msg.Contains("not imported"))
                            {
                                Importer.TheLog.LogError(Id, msg, false);
                            }
                        }
                    }
                }
            }

            if (IFCImportFile.TheFile.SchemaVersion >= IFCSchemaVersion.IFC2x3)
            {
                if (IFCAnyHandleUtil.IsSubTypeOf(ifcProductRepresentation, IFCEntityType.IfcMaterialDefinitionRepresentation))
                {
                    IFCAnyHandle representedMaterial = IFCImportHandleUtil.GetRequiredInstanceAttribute(ifcProductRepresentation, "RepresentedMaterial", false);
                    if (!IFCAnyHandleUtil.IsNullOrHasNoValue(representedMaterial))
                    {
                        RepresentedMaterial = IFCMaterial.ProcessIFCMaterial(representedMaterial);
                    }
                }
            }
        }
Example #6
0
 public void ShowCalculate()
 {
     Scaling.SetActive(false);
     Representations.SetActive(false);
     File.SetActive(false);
     Labels.SetActive(false);
     if (Calculate.activeSelf == false)
     {
         Calculate.SetActive(true);
     }
     else
     {
         Calculate.SetActive(false);
     }
     Settings.SetActive(false);
 }
Example #7
0
 public void ShowLabels()
 {
     Representations.SetActive(false);
     File.SetActive(false);
     Scaling.SetActive(false);
     if (Labels.activeSelf == false)
     {
         Labels.SetActive(true);
     }
     else
     {
         Labels.SetActive(false);
     }
     Calculate.SetActive(false);
     Settings.SetActive(false);
 }
        internal override void parseJObject(JObject obj)
        {
            base.parseJObject(obj);
            JToken token = obj.GetValue("Name", StringComparison.InvariantCultureIgnoreCase);

            if (token != null)
            {
                Name = token.Value <string>();
            }
            token = obj.GetValue("Description", StringComparison.InvariantCultureIgnoreCase);
            if (token != null)
            {
                Description = token.Value <string>();
            }
            Representations.AddRange(mDatabase.extractJArray <Representation>(obj.GetValue("Representations", StringComparison.InvariantCultureIgnoreCase) as JArray));
        }
Example #9
0
 public void ShowScale()
 {
     if (Scaling.activeSelf == false)
     {
         Scaling.SetActive(true);
     }
     else
     {
         Scaling.SetActive(false);
     }
     Representations.SetActive(false);
     File.SetActive(false);
     Labels.SetActive(false);
     Calculate.SetActive(false);
     Settings.SetActive(false);
 }
Example #10
0
        private async void LoadCbRepresentations()
        {
            switch (ChampionshipType)
            {
            case ChampionshipType.Male:
                RepresentationRepo = new MaleRepresentation();
                break;

            case ChampionshipType.Female:
                RepresentationRepo = new FemaleRepresentation();
                break;
            }

            Cursor          = Cursors.Wait;
            Representations = (List <Representation>) await RepresentationRepo.GetAllTeams();

            Cursor = Cursors.Arrow;

            if (Representations != null)
            {
                Representations.Sort();

                foreach (var representation in Representations)
                {
                    cbRepresentations.Items.Add(representation);
                }

                if (File.Exists(Properties.Settings.Default.Representation_Filepath))
                {
                    var jsonRepresentation = File.ReadAllText(Properties.Settings.Default.Representation_Filepath);

                    if (!string.IsNullOrEmpty(jsonRepresentation))
                    {
                        RepresentationSaveFile saveFile = JsonConvert.DeserializeObject <RepresentationSaveFile>(jsonRepresentation);
                        if (saveFile.ChampionshipType == this.ChampionshipType)
                        {
                            FavoriteRepresentation         = saveFile.Representation;
                            cbRepresentations.SelectedItem = FavoriteRepresentation;
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("Unable to fetch representation data!");
            }
        }
        /// <summary>
        /// Tests the express where-clause specified in param 'clause'
        /// </summary>
        /// <param name="clause">The express clause to test</param>
        /// <returns>true if the clause is satisfied.</returns>
        public bool ValidateClause(IfcMaterialDefinitionRepresentationClause clause)
        {
            var retVal = false;

            try
            {
                switch (clause)
                {
                case IfcMaterialDefinitionRepresentationClause.WR11:
                    retVal = Functions.SIZEOF(Representations.Where(temp => (!(Functions.TYPEOF(temp).Contains("IFC2X3.IFCSTYLEDREPRESENTATION"))))) == 0;
                    break;
                }
            } catch (Exception ex) {
                var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc2x3.RepresentationResource.IfcMaterialDefinitionRepresentation>();
                log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcMaterialDefinitionRepresentation.{0}' for #{1}.", clause, EntityLabel), ex);
            }
            return(retVal);
        }
        /// <summary>
        /// Tests the express where-clause specified in param 'clause'
        /// </summary>
        /// <param name="clause">The express clause to test</param>
        /// <returns>true if the clause is satisfied.</returns>
        public bool ValidateClause(IfcProductDefinitionShapeClause clause)
        {
            var retVal = false;

            try
            {
                switch (clause)
                {
                case IfcProductDefinitionShapeClause.OnlyShapeModel:
                    retVal = Functions.SIZEOF(Representations.Where(temp => (!(Functions.TYPEOF(temp).Contains("IFC4.IFCSHAPEMODEL"))))) == 0;
                    break;
                }
            } catch (Exception ex) {
                var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc4.RepresentationResource.IfcProductDefinitionShape>();
                log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcProductDefinitionShape.{0}' for #{1}.", clause, EntityLabel), ex);
            }
            return(retVal);
        }
Example #13
0
        protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options)
        {
            base.setJSON(obj, host, options);
            string name = Name;

            if (!string.IsNullOrEmpty(name))
            {
                obj["Name"] = name;
            }
            string description = Description;

            if (!string.IsNullOrEmpty(description))
            {
                obj["Description"] = description;
            }

            obj["Representations"] = new JArray(Representations.ConvertAll(x => x.getJson(this, options)));
        }
Example #14
0
        private void LoadData()
        {
            // Switch this to your custom service to change the data on the web page
            DemoService service = new DemoService();

            // only get the needed information for this board
            if (Convert.ToBoolean(Configuration["Board:Alerts"]))
            {
                alerts = service.GetAlerts();
            }
            if (Convert.ToBoolean(Configuration["Board:Exams"]))
            {
                exams = service.GetExams();
            }
            if (Convert.ToBoolean(Configuration["Board:Representations"]))
            {
                representations = service.GetRepresentations();
            }
        }
Example #15
0
    public void ShowReps()
    {
        if (Representations.activeSelf == false)
        {
            Representations.SetActive(true);
        }
        else
        {
            Representations.SetActive(false);
        }
        File.SetActive(false);

        /*
         *      Scaling.SetActive(false);
         *      Labels.SetActive(false);
         *      Calculate.SetActive(false);
         *      Settings.SetActive(false);
         */
    }
 public bool DeepEquals(ContentItemPublicContract?other)
 {
     return(other is not null &&
            ContentId == other.ContentId &&
            CType == other.CType &&
            CmsPath == other.CmsPath &&
            CreationDate == other.CreationDate &&
            ModifyDate == other.ModifyDate &&
            AllowComments == other.AllowComments &&
            HasAgeGate == other.HasAgeGate &&
            MinimumAge == other.MinimumAge &&
            RatingImagePath == other.RatingImagePath &&
            (Author is not null ? Author.DeepEquals(other.Author) : other.Author is null) &&
            AutoEnglishPropertyFallback == other.AutoEnglishPropertyFallback &&
            Properties.DeepEqualsDictionaryNaive(other.Properties) &&
            Representations.DeepEqualsList(other.Representations) &&
            Tags.DeepEqualsListNaive(other.Tags) &&
            (CommentSummary is not null ? CommentSummary.DeepEquals(other.CommentSummary) : other.CommentSummary is null));
 }
Example #17
0
        public Representations GetRepresentations()
        {
            Representations     representations = new Representations();
            List <TeacherTable> teacherTables   = new List <TeacherTable>();

            representations.teacherTables = teacherTables;

            int demoTeacherCount = 4;
            int demoHourCount    = 3;

            for (int i = 0; i < demoTeacherCount; i++)
            {
                int          teacherCounter = i + 1;
                TeacherTable teacherTable   = new TeacherTable();
                teacherTables.Add(teacherTable);
                List <TeacherHour> teacherHours = new List <TeacherHour>();
                teacherTable.hours = teacherHours;
                teacherTable.name  = "Lehrer " + teacherCounter;
                for (int j = 0; j < demoHourCount; j++)
                {
                    int    hourCounter = j + 1;
                    Random rnd         = new Random();
                    teacherHours.Add(
                        new TeacherHour()
                    {
                        hour                  = hourCounter,
                        className             = "KURS" + hourCounter,
                        substituteTeacherName = "/",
                        room                  = "A" + rnd.Next(1, 3) + "." + rnd.Next(0, 3) + rnd.Next(1, 3),
                        note                  = "EVA"
                    }
                        );
                }
            }

            return(representations);
        }
Example #18
0
    public void FileSelectionWindow()
    {
        if (File.activeSelf == false)
        {
            File.SetActive(true);
        }
        else
        {
            File.SetActive(false);
        }
        Representations.SetActive(false);

        /*
         *      Play.SetActive(false);
         *      Scaling.SetActive(false);
         *      Labels.SetActive(false);
         *      Calculate.SetActive(false);
         *      Settings.SetActive(false);
         */
        //gameObject.GetComponent<PlayButton>().StopTraj(); // TODO: Get rid of FIND
        //FrameSlider.GetComponent<SliderGestureControl>().SliderValue = 0;

        //ClearData();
    }
 public void Update(ContentItemPublicContract?other)
 {
     if (other is null)
     {
         return;
     }
     if (ContentId != other.ContentId)
     {
         ContentId = other.ContentId;
         OnPropertyChanged(nameof(ContentId));
     }
     if (CType != other.CType)
     {
         CType = other.CType;
         OnPropertyChanged(nameof(CType));
     }
     if (CmsPath != other.CmsPath)
     {
         CmsPath = other.CmsPath;
         OnPropertyChanged(nameof(CmsPath));
     }
     if (CreationDate != other.CreationDate)
     {
         CreationDate = other.CreationDate;
         OnPropertyChanged(nameof(CreationDate));
     }
     if (ModifyDate != other.ModifyDate)
     {
         ModifyDate = other.ModifyDate;
         OnPropertyChanged(nameof(ModifyDate));
     }
     if (AllowComments != other.AllowComments)
     {
         AllowComments = other.AllowComments;
         OnPropertyChanged(nameof(AllowComments));
     }
     if (HasAgeGate != other.HasAgeGate)
     {
         HasAgeGate = other.HasAgeGate;
         OnPropertyChanged(nameof(HasAgeGate));
     }
     if (MinimumAge != other.MinimumAge)
     {
         MinimumAge = other.MinimumAge;
         OnPropertyChanged(nameof(MinimumAge));
     }
     if (RatingImagePath != other.RatingImagePath)
     {
         RatingImagePath = other.RatingImagePath;
         OnPropertyChanged(nameof(RatingImagePath));
     }
     if (!Author.DeepEquals(other.Author))
     {
         Author.Update(other.Author);
         OnPropertyChanged(nameof(Author));
     }
     if (AutoEnglishPropertyFallback != other.AutoEnglishPropertyFallback)
     {
         AutoEnglishPropertyFallback = other.AutoEnglishPropertyFallback;
         OnPropertyChanged(nameof(AutoEnglishPropertyFallback));
     }
     if (!Properties.DeepEqualsDictionary(other.Properties))
     {
         Properties = other.Properties;
         OnPropertyChanged(nameof(Properties));
     }
     if (!Representations.DeepEqualsList(other.Representations))
     {
         Representations = other.Representations;
         OnPropertyChanged(nameof(Representations));
     }
     if (!Tags.DeepEqualsListNaive(other.Tags))
     {
         Tags = other.Tags;
         OnPropertyChanged(nameof(Tags));
     }
     if (!CommentSummary.DeepEquals(other.CommentSummary))
     {
         CommentSummary.Update(other.CommentSummary);
         OnPropertyChanged(nameof(CommentSummary));
     }
 }
Example #20
0
        public static NewlineType GetNewlineType(this string ToTest)
        {
            string data = new string(ToTest.SkipWhile(x => !CommandChars.Value.Contains(x)).Take(2).Where(CommandChars.Value.Contains).ToArray());

            return(Representations.ContainsValue(data) ? Representations.First(x => x.Value == data).Key : NewlineType.Undefined);
        }
 public void AddRepresentation(SCIMRepresentation representation)
 {
     Representations.Add(representation);
 }
        public bool Equals(ContentItemPublicContract input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     ContentId == input.ContentId ||
                     (ContentId.Equals(input.ContentId))
                     ) &&
                 (
                     CType == input.CType ||
                     (CType != null && CType.Equals(input.CType))
                 ) &&
                 (
                     CmsPath == input.CmsPath ||
                     (CmsPath != null && CmsPath.Equals(input.CmsPath))
                 ) &&
                 (
                     CreationDate == input.CreationDate ||
                     (CreationDate != null && CreationDate.Equals(input.CreationDate))
                 ) &&
                 (
                     ModifyDate == input.ModifyDate ||
                     (ModifyDate != null && ModifyDate.Equals(input.ModifyDate))
                 ) &&
                 (
                     AllowComments == input.AllowComments ||
                     (AllowComments != null && AllowComments.Equals(input.AllowComments))
                 ) &&
                 (
                     HasAgeGate == input.HasAgeGate ||
                     (HasAgeGate != null && HasAgeGate.Equals(input.HasAgeGate))
                 ) &&
                 (
                     MinimumAge == input.MinimumAge ||
                     (MinimumAge.Equals(input.MinimumAge))
                 ) &&
                 (
                     RatingImagePath == input.RatingImagePath ||
                     (RatingImagePath != null && RatingImagePath.Equals(input.RatingImagePath))
                 ) &&
                 (
                     Author == input.Author ||
                     (Author != null && Author.Equals(input.Author))
                 ) &&
                 (
                     AutoEnglishPropertyFallback == input.AutoEnglishPropertyFallback ||
                     (AutoEnglishPropertyFallback != null && AutoEnglishPropertyFallback.Equals(input.AutoEnglishPropertyFallback))
                 ) &&
                 (
                     Properties == input.Properties ||
                     (Properties != null && Properties.SequenceEqual(input.Properties))
                 ) &&
                 (
                     Representations == input.Representations ||
                     (Representations != null && Representations.SequenceEqual(input.Representations))
                 ) &&
                 (
                     Tags == input.Tags ||
                     (Tags != null && Tags.SequenceEqual(input.Tags))
                 ) &&
                 (
                     CommentSummary == input.CommentSummary ||
                     (CommentSummary != null && CommentSummary.Equals(input.CommentSummary))
                 ));
        }
Example #23
0
 public static string AsString(this NewlineType Type) => Representations.ContainsKey(Type) ? Representations[Type] : Representations[NewlineType.Undefined];