Ejemplo n.º 1
0
        public void getConnector(DiagramConnector l)
        {
            string DiagramType = l.DiagramType;
            int    pos         = 0;
            string sKey        = "";
            string type        = "";
            string lineStyle   = "";
            string stereotype  = "";
            bool   isDefault   = false;
            bool   isEnabled   = false;

            foreach (KeyValueConfigurationElement configEntry in currentConfig.AppSettings.Settings)
            {
                sKey = configEntry.Key;
                string regex = DiagramType + "Connector([0-9]+)([a-zA-Z_0-9]+)";
                Match  match = Regex.Match(sKey, regex);
                if (match.Success)
                {
                    pos = Convert.ToInt16(match.Groups[1].Value);
                    switch (match.Groups[2].Value)
                    {
                    case "Type":
                        type = configEntry.Value;
                        break;

                    case "Stereotype":
                        stereotype = configEntry.Value;
                        break;

                    case "LineStyle":
                        lineStyle = configEntry.Value;
                        break;

                    case "IsDefault":
                        isDefault = false;
                        if (configEntry.Value == "True")
                        {
                            isDefault = true;
                        }

                        break;

                    case "IsEnabled":
                        isEnabled = false;
                        if (configEntry.Value == "True")
                        {
                            isEnabled = true;
                        }
                        l.Add(new Connector(type, stereotype, lineStyle, isDefault, isEnabled));
                        break;
                    }
                }
            }
            return;
        }
Ejemplo n.º 2
0
        private void GetConnector(DiagramConnector l)
        {
            string diagramType = l.DiagramType;
            string type        = "";
            string lineStyle   = "";
            string stereotype  = "";
            bool   isDefault   = false;

            foreach (KeyValueConfigurationElement configEntry in CurrentConfig.AppSettings.Settings)
            {
                var    sKey  = configEntry.Key;
                string regex = diagramType + "Connector([0-9]+)([a-zA-Z_0-9]+)";
                Match  match = Regex.Match(sKey, regex);
                if (match.Success)
                {
                    switch (match.Groups[2].Value)
                    {
                    case "Type":
                        type = configEntry.Value;
                        break;

                    case "Stereotype":
                        stereotype = configEntry.Value;
                        break;

                    case "LineStyle":
                        lineStyle = configEntry.Value;
                        break;

                    case "IsDefault":
                        isDefault = false;
                        if (configEntry.Value == "True")
                        {
                            isDefault = true;
                        }

                        break;

                    case "IsEnabled":
                        bool isEnabled = configEntry.Value == "True";
                        l.Add(new Connector(type, stereotype, lineStyle, isDefault, isEnabled));
                        break;
                    }
                }
            }
        }
        public void getConnector(DiagramConnector l)
        {
            string DiagramType = l.DiagramType;
            int pos = 0;
            string sKey = "";
            string type = "";
            string lineStyle = "";
            string stereotype = "";
            bool isDefault = false;
            bool isEnabled = false;

            foreach (KeyValueConfigurationElement configEntry in currentConfig.AppSettings.Settings)
            {
                sKey = configEntry.Key;
                string regex = DiagramType +"Connector([0-9]+)([a-zA-Z_0-9]+)";
                Match match = Regex.Match(sKey, regex);
                if (match.Success)
                {
                    pos = Convert.ToInt16(match.Groups[1].Value);
                    switch (match.Groups[2].Value)
                    {
                        case "Type":
                            type = configEntry.Value;
                            break;
                        case "Stereotype":
                            stereotype = configEntry.Value;
                            break;
                        case "LineStyle":
                            lineStyle = configEntry.Value;
                            break;
                        case "IsDefault":
                            isDefault = false;
                            if (configEntry.Value == "True") isDefault = true;

                            break;
                        case "IsEnabled":
                            isEnabled = false;
                            if (configEntry.Value == "True") isEnabled = true;
                            l.Add(new Connector(type, stereotype, lineStyle, isDefault, isEnabled));
                            break;
                    }
                }
            }
            return;
            
        }
        private void GetConnector(DiagramConnector l)
        {
            string diagramType = l.DiagramType;
            string type = "";
            string lineStyle = "";
            string stereotype = "";
            bool isDefault = false;

            foreach (KeyValueConfigurationElement configEntry in CurrentConfig.AppSettings.Settings)
            {
                var sKey = configEntry.Key;
                string regex = diagramType +"Connector([0-9]+)([a-zA-Z_0-9]+)";
                Match match = Regex.Match(sKey, regex);
                if (match.Success)
                {
                    switch (match.Groups[2].Value)
                    {
                        case "Type":
                            type = configEntry.Value;
                            break;
                        case "Stereotype":
                            stereotype = configEntry.Value;
                            break;
                        case "LineStyle":
                            lineStyle = configEntry.Value;
                            break;
                        case "IsDefault":
                            isDefault = false;
                            isDefault |= configEntry.Value == "True";

                            break;
                        case "IsEnabled":
                            var isEnabled = false;
                            isEnabled |= configEntry.Value == "True";
                            l.Add(new Connector(type, stereotype, lineStyle, isDefault, isEnabled));
                            break;
                    }
                }
            }
           
        }