示例#1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void initialize(org.maltparser.core.flow.FlowChartInstance flowChartinstance, org.maltparser.core.flow.spec.ChartItemSpecification chartItemSpecification) throws org.maltparser.core.exception.MaltChainedException
        public override void initialize(FlowChartInstance flowChartinstance, ChartItemSpecification chartItemSpecification)
        {
            base.initialize(flowChartinstance, chartItemSpecification);

            foreach (string key in chartItemSpecification.ChartItemAttributes.Keys)
            {
                if (key.Equals("target"))
                {
                    targetName = chartItemSpecification.ChartItemAttributes[key];
                }
                else if (key.Equals("source"))
                {
                    sourceName = chartItemSpecification.ChartItemAttributes[key];
                }
                else if (key.Equals("mode"))
                {
                    modeName = chartItemSpecification.ChartItemAttributes[key];
                }
                else if (key.Equals("task"))
                {
                    taskName = chartItemSpecification.ChartItemAttributes[key];
                }
                else if (key.Equals("id"))
                {
                    idName = chartItemSpecification.ChartItemAttributes[key];
                }
            }
            if (ReferenceEquals(targetName, null))
            {
                targetName = getChartElement("singlemalt").Attributes.get("target").DefaultValue;
            }
            else if (ReferenceEquals(sourceName, null))
            {
                sourceName = getChartElement("singlemalt").Attributes.get("source").DefaultValue;
            }
            else if (ReferenceEquals(modeName, null))
            {
                modeName = getChartElement("singlemalt").Attributes.get("mode").DefaultValue;
            }
            else if (ReferenceEquals(taskName, null))
            {
                taskName = getChartElement("singlemalt").Attributes.get("task").DefaultValue;
            }
            else if (ReferenceEquals(idName, null))
            {
                idName = getChartElement("singlemalt").Attributes.get("id").DefaultValue;
            }

            singleMalt = (SingleMalt)flowChartinstance.getFlowChartRegistry(typeof(SingleMalt), idName);
            if (singleMalt == null)
            {
                singleMalt = new SingleMalt();
                flowChartinstance.addFlowChartRegistry(typeof(SingleMalt), idName, singleMalt);
                flowChartinstance.addFlowChartRegistry(typeof(Configuration), idName, singleMalt);
            }
        }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void initialize(org.maltparser.core.flow.FlowChartInstance flowChartinstance, org.maltparser.core.flow.spec.ChartItemSpecification chartItemSpecification) throws org.maltparser.core.exception.MaltChainedException
        public override void initialize(FlowChartInstance flowChartinstance, ChartItemSpecification chartItemSpecification)
        {
            base.initialize(flowChartinstance, chartItemSpecification);

            foreach (string key in chartItemSpecification.ChartItemAttributes.Keys)
            {
                if (key.Equals("target"))
                {
                    targetName = chartItemSpecification.ChartItemAttributes[key];
                }
                else if (key.Equals("source"))
                {
                    sourceName = chartItemSpecification.ChartItemAttributes[key];
                }
                else if (key.Equals("id"))
                {
                    idName = chartItemSpecification.ChartItemAttributes[key];
                }
                else if (key.Equals("task"))
                {
                    taskName = chartItemSpecification.ChartItemAttributes[key];
                }
            }

            if (ReferenceEquals(targetName, null))
            {
                targetName = getChartElement("pseudoproj").Attributes.get("target").DefaultValue;
            }
            else if (ReferenceEquals(sourceName, null))
            {
                sourceName = getChartElement("pseudoproj").Attributes.get("source").DefaultValue;
            }
            else if (ReferenceEquals(idName, null))
            {
                idName = getChartElement("pseudoproj").Attributes.get("id").DefaultValue;
            }
            else if (ReferenceEquals(taskName, null))
            {
                taskName = getChartElement("pseudoproj").Attributes.get("task").DefaultValue;
            }

            PseudoProjectivity tmppproj = (PseudoProjectivity)flowChartinstance.getFlowChartRegistry(typeof(PseudoProjectivity), idName);

            if (tmppproj == null)
            {
                pproj = new PseudoProjectivity();
                flowChartinstance.addFlowChartRegistry(typeof(PseudoProjectivity), idName, pproj);
            }
            else
            {
                pproj = tmppproj;
            }
        }