Exemplo n.º 1
0
        protected override void afterPopulateProps()
        {
            LabelCodes.InitOptions      = _initGhsPhraseOptions;
            Classifications.InitOptions = _initGhsClassificationOptions;

            AddLabelCodes.SetOnPropChange(OnAddLabelCodesPropChange);
            Pictograms.SetOnPropChange(OnPictorgramsChange);

            LabelCodesGrid.SetOnBeforeRender(delegate(CswNbtNodeProp Prop)
            {
                CswNbtNodePropGrid PropAsGrid = (CswNbtNodePropGrid)Prop;
                CswNbtView UpdatedPhraseView  = setupPhraseView(PropAsGrid.View, LabelCodes.Value);
                UpdatedPhraseView.SaveToCache(IncludeInQuickLaunch: false, UpdateCache: true, KeepInQuickLaunch: false);
            });

            ClassificationsGrid.SetOnBeforeRender(delegate(CswNbtNodeProp Prop)
            {
                CswNbtNodePropGrid PropAsGrid = (CswNbtNodePropGrid)Prop;
                _setupClassificationView(PropAsGrid.View, Classifications.Value);
            });

            SignalWord.SetOnBeforeRender(delegate(CswNbtNodeProp Prop)
            {
                CswNbtNodePropRelationship PropAsRelationship     = (CswNbtNodePropRelationship)Prop;
                Dictionary <CswPrimaryKey, string> TranslatedOpts = new Dictionary <CswPrimaryKey, string>();
                ICswNbtTree tree = _CswNbtResources.Trees.getTreeFromView(PropAsRelationship.View, true, false, false);
                int count        = tree.getChildNodeCount();
                for (int i = 0; i < count; i++)
                {
                    tree.goToNthChild(i);
                    CswNbtObjClassGHSSignalWord SignalWordNode = tree.getNodeForCurrentPosition();
                    string TranslatedText = SignalWordNode.Node.Properties[_getLanguageForTranslation()].AsText.Text;
                    TranslatedOpts.Add(SignalWordNode.NodeId, TranslatedText);
                    tree.goToParentNode();
                }

                PropAsRelationship.SetOptionsOverride(TranslatedOpts);
                if (CswTools.IsPrimaryKey(PropAsRelationship.RelatedNodeId))
                {
                    CswNbtObjClassGHSSignalWord Selected = _CswNbtResources.Nodes[PropAsRelationship.RelatedNodeId];
                    string TranslantedText = Selected.Node.Properties[_getLanguageForTranslation()].AsText.Text;
                    Selected.Node.NodeName = (false == string.IsNullOrEmpty(TranslantedText) ? TranslantedText : Selected.English.Text);
                }
            });
        } //afterPopulateProps()