Beispiel #1
0
        private void ProcessAsSource(PathRule pathRule, string path, string value)
        {
            if (!pathRule.IsBilingual)
            {
                SetCompleteSegmentData(path, value, path, string.Empty);
                return;
            }

            var key = GetKey(pathRule, path);

            if (_tempTargets.ContainsKey(key) && _tempTargets[key].Count > 0)
            {
                var target = _tempTargets[key].Dequeue();

                SetCompleteSegmentData(path, value, target.Key, pathRule.IsTargetValueNeeded ? target.Value : string.Empty);

                return;
            }

            if (!_tempSources.ContainsKey(key))
            {
                _tempSources.Add(key, new Queue <KeyValuePair <string, string> >());
            }

            _tempSources[key].Enqueue(new KeyValuePair <string, string>(path, value));
        }
Beispiel #2
0
        internal PathRule CreatePathRule()
        {
            PathRule pathRule = (PathRule)(m_coreRule = new PathRule());

            pathRule.BorderColor = Color.Empty;
            pathRule.Text        = "";
            pathRule.Category    = m_mapVectorLayer.Name;
            pathRule.Field       = "";
            m_coreMap.PathRules.Add(pathRule);
            SetRuleFieldName();
            return(pathRule);
        }
        private void _addRuleButton_Click(object sender, EventArgs e)
        {
            var pathRule = new PathRule();

            using (var pathRuleForm = new PathRuleForm(pathRule))
            {
                if (pathRuleForm.ShowDialog(this) != DialogResult.OK)
                {
                    return;
                }

                _rulesListView.Items.Add(new PathRuleListViewItem(pathRule));

                UpdateEnabledState();
            }
        }
Beispiel #4
0
        internal void RenderLineRule(LineTemplateMapper pathTemplateMapper, int?size)
        {
            PathRule pathRule = (PathRule)m_coreRule;

            SetRuleLegendProperties(pathRule);
            SetRuleDistribution(pathRule);
            pathRule.ShowInColorSwatch = GetShowInColorScale();
            if (m_mapRule is MapColorRangeRule)
            {
                RenderLineColorRangeRule(pathRule);
            }
            else if (m_mapRule is MapColorPaletteRule)
            {
                RenderLineColorPaletteRule(pathRule);
            }
            else
            {
                RenderLineCustomColorRule(pathRule);
            }
            InitializePathRule(pathRule, pathTemplateMapper, size);
        }
Beispiel #5
0
        public void RenderLineRule(LineTemplateMapper pathTemplateMapper, int?size)
        {
            PathRule pathRule = (PathRule)base.m_coreRule;

            base.SetRuleLegendProperties(pathRule);
            base.SetRuleDistribution(pathRule);
            pathRule.ShowInColorSwatch = this.GetShowInColorScale();
            if (base.m_mapRule is MapColorRangeRule)
            {
                this.RenderLineColorRangeRule(pathRule);
            }
            else if (base.m_mapRule is MapColorPaletteRule)
            {
                this.RenderLineColorPaletteRule(pathRule);
            }
            else
            {
                this.RenderLineCustomColorRule(pathRule);
            }
            this.InitializePathRule(pathRule, pathTemplateMapper, size);
        }
Beispiel #6
0
        private static void AddDebuggerOptions(IAdapterLaunchInfo adapterLaunchInfo, DebugInfo launchJson)
        {
            var debugService = (IPythonDebugOptionsService)Package.GetGlobalService(typeof(IPythonDebugOptionsService));

            // Stop on entry should always be true for VS Debug Adapter Host.
            // If stop on entry is disabled then VS will automatically issue
            // continue when it sees "stopped" event with "reason=entry".
            launchJson.StopOnEntry = true;

            // Force this to false to prevent subprocess debugging, which we do not support yet in PTVS
            launchJson.SubProcess = false;

            launchJson.PromptBeforeRunningWithBuildError = debugService.PromptBeforeRunningWithBuildError;
            launchJson.RedirectOutput        = debugService.TeeStandardOutput;
            launchJson.WaitOnAbnormalExit    = debugService.WaitOnAbnormalExit;
            launchJson.WaitOnNormalExit      = debugService.WaitOnNormalExit;
            launchJson.BreakOnSystemExitZero = debugService.BreakOnSystemExitZero;
            launchJson.DebugStdLib           = debugService.DebugStdLib;
            launchJson.ShowReturnValue       = debugService.ShowFunctionReturnValue;

            var variablePresentation = new VariablePresentation();

            variablePresentation.Class      = debugService.VariablePresentationForClasses;
            variablePresentation.Function   = debugService.VariablePresentationForFunctions;
            variablePresentation.Protected  = debugService.VariablePresentationForProtected;
            variablePresentation.Special    = debugService.VariablePresentationForSpecial;
            launchJson.VariablePresentation = variablePresentation;

            var excludePTVSInstallDirectory = new PathRule()
            {
                Path    = PathUtils.GetParent(typeof(DebugAdapterLauncher).Assembly.Location),
                Include = false,
            };

            launchJson.Rules = new List <PathRule>()
            {
                excludePTVSInstallDirectory
            };
        }
Beispiel #7
0
 private void RenderPathCustomColors(PathRule pathRule, ColoringMode coloringMode, MapColorPalette palette, Color fromColor, Color middleColor, Color toColor)
 {
     pathRule.UseCustomColors = true;
     SetRuleColors(pathRule.GetColors(coloringMode, palette, fromColor, middleColor, toColor, GetBucketCount()), pathRule.CustomColors);
 }
Beispiel #8
0
 private void RenderLineCustomColorRule(PathRule pathRule)
 {
     pathRule.UseCustomColors = true;
     SetRuleColors(GetCustomColors(((MapCustomColorRule)m_mapRule).MapCustomColors), pathRule.CustomColors);
 }
Beispiel #9
0
 private void RenderLineColorPaletteRule(PathRule pathRule)
 {
     RenderPathCustomColors(pathRule, ColoringMode.DistinctColors, GetColorPalette(), Color.Empty, Color.Empty, Color.Empty);
 }
Beispiel #10
0
        private void RenderLineColorRangeRule(PathRule pathRule)
        {
            MapColorRangeRule colorRangeRule = (MapColorRangeRule)m_mapRule;

            RenderPathCustomColors(pathRule, ColoringMode.ColorRange, MapColorPalette.Dundas, GetFromColor(colorRangeRule), GetMiddleColor(colorRangeRule), GetToColor(colorRangeRule));
        }
Beispiel #11
0
 private void InitializePathRule(PathRule pathRule, LineTemplateMapper pathTemplateMapper, int?size)
 {
     InitializeCustomColors(pathRule.CustomColors, pathTemplateMapper);
 }
Beispiel #12
0
 public PathRuleListViewItem(PathRule pathRule)
 {
     PathRule = pathRule;
 }
        public PathRuleForm(PathRule pathRule)
        {
            _pathRule = pathRule;

            InitializeComponent();
        }
Beispiel #14
0
        private static string GetKey(PathRule pathRule, string path)
        {
            var key = pathRule.GetHashCode().ToString();

            return(IndexerRegex.Matches(path).Cast <Match>().Aggregate(key, (current, match) => current + match.Value));
        }
Beispiel #15
0
 private void RenderLineCustomColorRule(PathRule pathRule)
 {
     pathRule.UseCustomColors = true;
     this.SetRuleColors(this.GetCustomColors(((MapCustomColorRule)base.m_mapRule).MapCustomColors), pathRule.CustomColors);
 }